rulesync 2.1.0 → 3.0.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 CHANGED
@@ -636,10 +636,84 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
636
636
  };
637
637
 
638
638
  // src/commands/codexcli-command.ts
639
- var import_node_path6 = require("path");
639
+ var import_node_path5 = require("path");
640
+ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
641
+ static getSettablePaths() {
642
+ throw new Error("getSettablePaths is not supported for CodexcliCommand");
643
+ }
644
+ static getSettablePathsGlobal() {
645
+ return {
646
+ relativeDirPath: (0, import_node_path5.join)(".codex", "prompts")
647
+ };
648
+ }
649
+ toRulesyncCommand() {
650
+ const rulesyncFrontmatter = {
651
+ targets: ["*"],
652
+ description: ""
653
+ };
654
+ return new RulesyncCommand({
655
+ baseDir: ".",
656
+ // RulesyncCommand baseDir is always the project root directory
657
+ frontmatter: rulesyncFrontmatter,
658
+ body: this.getFileContent(),
659
+ relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
660
+ relativeFilePath: this.relativeFilePath,
661
+ fileContent: this.getFileContent(),
662
+ validate: true
663
+ });
664
+ }
665
+ static fromRulesyncCommand({
666
+ baseDir = ".",
667
+ rulesyncCommand,
668
+ validate = true,
669
+ global = false
670
+ }) {
671
+ const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
672
+ return new _CodexcliCommand({
673
+ baseDir,
674
+ fileContent: rulesyncCommand.getBody(),
675
+ relativeDirPath: paths.relativeDirPath,
676
+ relativeFilePath: rulesyncCommand.getRelativeFilePath(),
677
+ validate
678
+ });
679
+ }
680
+ validate() {
681
+ return { success: true, error: null };
682
+ }
683
+ getBody() {
684
+ return this.getFileContent();
685
+ }
686
+ static isTargetedByRulesyncCommand(rulesyncCommand) {
687
+ return this.isTargetedByRulesyncCommandDefault({
688
+ rulesyncCommand,
689
+ toolTarget: "codexcli"
690
+ });
691
+ }
692
+ static async fromFile({
693
+ baseDir = ".",
694
+ relativeFilePath,
695
+ validate = true,
696
+ global = false
697
+ }) {
698
+ const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
699
+ const filePath = (0, import_node_path5.join)(baseDir, paths.relativeDirPath, relativeFilePath);
700
+ const fileContent = await readFileContent(filePath);
701
+ const { body: content } = parseFrontmatter(fileContent);
702
+ return new _CodexcliCommand({
703
+ baseDir,
704
+ relativeDirPath: paths.relativeDirPath,
705
+ relativeFilePath: (0, import_node_path5.basename)(relativeFilePath),
706
+ fileContent: content.trim(),
707
+ validate
708
+ });
709
+ }
710
+ };
711
+
712
+ // src/commands/copilot-command.ts
713
+ var import_node_path7 = require("path");
640
714
 
641
715
  // src/commands/simulated-command.ts
642
- var import_node_path5 = require("path");
716
+ var import_node_path6 = require("path");
643
717
  var import_mini5 = require("zod/mini");
644
718
  var SimulatedCommandFrontmatterSchema = import_mini5.z.object({
645
719
  description: import_mini5.z.string()
@@ -705,7 +779,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
705
779
  relativeFilePath,
706
780
  validate = true
707
781
  }) {
708
- const filePath = (0, import_node_path5.join)(
782
+ const filePath = (0, import_node_path6.join)(
709
783
  baseDir,
710
784
  _SimulatedCommand.getSettablePaths().relativeDirPath,
711
785
  relativeFilePath
@@ -719,65 +793,15 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
719
793
  return {
720
794
  baseDir,
721
795
  relativeDirPath: _SimulatedCommand.getSettablePaths().relativeDirPath,
722
- relativeFilePath: (0, import_node_path5.basename)(relativeFilePath),
723
- frontmatter: result.data,
724
- body: content.trim(),
725
- validate
726
- };
727
- }
728
- };
729
-
730
- // src/commands/codexcli-command.ts
731
- var CodexCliCommand = class _CodexCliCommand extends SimulatedCommand {
732
- static getSettablePaths() {
733
- return {
734
- relativeDirPath: ".codex/commands"
735
- };
736
- }
737
- static fromRulesyncCommand({
738
- baseDir = ".",
739
- rulesyncCommand,
740
- validate = true
741
- }) {
742
- return new _CodexCliCommand(
743
- this.fromRulesyncCommandDefault({ baseDir, rulesyncCommand, validate })
744
- );
745
- }
746
- static async fromFile({
747
- baseDir = ".",
748
- relativeFilePath,
749
- validate = true
750
- }) {
751
- const filePath = (0, import_node_path6.join)(
752
- baseDir,
753
- _CodexCliCommand.getSettablePaths().relativeDirPath,
754
- relativeFilePath
755
- );
756
- const fileContent = await readFileContent(filePath);
757
- const { frontmatter, body: content } = parseFrontmatter(fileContent);
758
- const result = SimulatedCommandFrontmatterSchema.safeParse(frontmatter);
759
- if (!result.success) {
760
- throw new Error(`Invalid frontmatter in ${filePath}: ${result.error.message}`);
761
- }
762
- return new _CodexCliCommand({
763
- baseDir,
764
- relativeDirPath: _CodexCliCommand.getSettablePaths().relativeDirPath,
765
796
  relativeFilePath: (0, import_node_path6.basename)(relativeFilePath),
766
797
  frontmatter: result.data,
767
798
  body: content.trim(),
768
799
  validate
769
- });
770
- }
771
- static isTargetedByRulesyncCommand(rulesyncCommand) {
772
- return this.isTargetedByRulesyncCommandDefault({
773
- rulesyncCommand,
774
- toolTarget: "codexcli"
775
- });
800
+ };
776
801
  }
777
802
  };
778
803
 
779
804
  // src/commands/copilot-command.ts
780
- var import_node_path7 = require("path");
781
805
  var CopilotCommand = class _CopilotCommand extends SimulatedCommand {
782
806
  static getSettablePaths() {
783
807
  return {
@@ -831,7 +855,12 @@ var import_node_path8 = require("path");
831
855
  var CursorCommand = class _CursorCommand extends ToolCommand {
832
856
  static getSettablePaths() {
833
857
  return {
834
- relativeDirPath: ".cursor/commands"
858
+ relativeDirPath: (0, import_node_path8.join)(".cursor", "commands")
859
+ };
860
+ }
861
+ static getSettablePathsGlobal() {
862
+ return {
863
+ relativeDirPath: (0, import_node_path8.join)(".cursor", "commands")
835
864
  };
836
865
  }
837
866
  toRulesyncCommand() {
@@ -853,12 +882,14 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
853
882
  static fromRulesyncCommand({
854
883
  baseDir = ".",
855
884
  rulesyncCommand,
856
- validate = true
885
+ validate = true,
886
+ global = false
857
887
  }) {
888
+ const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
858
889
  return new _CursorCommand({
859
890
  baseDir,
860
891
  fileContent: rulesyncCommand.getBody(),
861
- relativeDirPath: _CursorCommand.getSettablePaths().relativeDirPath,
892
+ relativeDirPath: paths.relativeDirPath,
862
893
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
863
894
  validate
864
895
  });
@@ -878,18 +909,16 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
878
909
  static async fromFile({
879
910
  baseDir = ".",
880
911
  relativeFilePath,
881
- validate = true
912
+ validate = true,
913
+ global = false
882
914
  }) {
883
- const filePath = (0, import_node_path8.join)(
884
- baseDir,
885
- _CursorCommand.getSettablePaths().relativeDirPath,
886
- relativeFilePath
887
- );
915
+ const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
916
+ const filePath = (0, import_node_path8.join)(baseDir, paths.relativeDirPath, relativeFilePath);
888
917
  const fileContent = await readFileContent(filePath);
889
918
  const { body: content } = parseFrontmatter(fileContent);
890
919
  return new _CursorCommand({
891
920
  baseDir,
892
- relativeDirPath: _CursorCommand.getSettablePaths().relativeDirPath,
921
+ relativeDirPath: paths.relativeDirPath,
893
922
  relativeFilePath: (0, import_node_path8.basename)(relativeFilePath),
894
923
  fileContent: content.trim(),
895
924
  validate
@@ -919,6 +948,11 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
919
948
  relativeDirPath: ".gemini/commands"
920
949
  };
921
950
  }
951
+ static getSettablePathsGlobal() {
952
+ return {
953
+ relativeDirPath: (0, import_node_path9.join)(".gemini", "commands")
954
+ };
955
+ }
922
956
  parseTomlContent(content) {
923
957
  try {
924
958
  const parsed = (0, import_smol_toml.parse)(content);
@@ -960,7 +994,8 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
960
994
  static fromRulesyncCommand({
961
995
  baseDir = ".",
962
996
  rulesyncCommand,
963
- validate = true
997
+ validate = true,
998
+ global = false
964
999
  }) {
965
1000
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
966
1001
  const geminiFrontmatter = {
@@ -971,9 +1006,10 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
971
1006
  prompt = """
972
1007
  ${geminiFrontmatter.prompt}
973
1008
  """`;
1009
+ const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
974
1010
  return new _GeminiCliCommand({
975
1011
  baseDir,
976
- relativeDirPath: _GeminiCliCommand.getSettablePaths().relativeDirPath,
1012
+ relativeDirPath: paths.relativeDirPath,
977
1013
  relativeFilePath: rulesyncCommand.getRelativeFilePath().replace(".md", ".toml"),
978
1014
  fileContent: tomlContent,
979
1015
  validate
@@ -982,17 +1018,15 @@ ${geminiFrontmatter.prompt}
982
1018
  static async fromFile({
983
1019
  baseDir = ".",
984
1020
  relativeFilePath,
985
- validate = true
1021
+ validate = true,
1022
+ global = false
986
1023
  }) {
987
- const filePath = (0, import_node_path9.join)(
988
- baseDir,
989
- _GeminiCliCommand.getSettablePaths().relativeDirPath,
990
- relativeFilePath
991
- );
1024
+ const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
1025
+ const filePath = (0, import_node_path9.join)(baseDir, paths.relativeDirPath, relativeFilePath);
992
1026
  const fileContent = await readFileContent(filePath);
993
1027
  return new _GeminiCliCommand({
994
1028
  baseDir,
995
- relativeDirPath: _GeminiCliCommand.getSettablePaths().relativeDirPath,
1029
+ relativeDirPath: paths.relativeDirPath,
996
1030
  relativeFilePath: (0, import_node_path9.basename)(relativeFilePath),
997
1031
  fileContent,
998
1032
  validate
@@ -1134,11 +1168,19 @@ var commandsProcessorToolTargets = [
1134
1168
  "geminicli",
1135
1169
  "roo",
1136
1170
  "copilot",
1171
+ "cursor"
1172
+ ];
1173
+ var CommandsProcessorToolTargetSchema = import_mini8.z.enum(
1174
+ // codexcli is not in the list of tool targets but we add it here because it is a valid tool target for global mode generation
1175
+ commandsProcessorToolTargets.concat("codexcli")
1176
+ );
1177
+ var commandsProcessorToolTargetsSimulated = ["copilot"];
1178
+ var commandsProcessorToolTargetsGlobal = [
1179
+ "claudecode",
1137
1180
  "cursor",
1181
+ "geminicli",
1138
1182
  "codexcli"
1139
1183
  ];
1140
- var CommandsProcessorToolTargetSchema = import_mini8.z.enum(commandsProcessorToolTargets);
1141
- var commandsProcessorToolTargetsSimulated = ["copilot", "codexcli"];
1142
1184
  var CommandsProcessor = class extends FeatureProcessor {
1143
1185
  toolTarget;
1144
1186
  global;
@@ -1172,7 +1214,8 @@ var CommandsProcessor = class extends FeatureProcessor {
1172
1214
  }
1173
1215
  return GeminiCliCommand.fromRulesyncCommand({
1174
1216
  baseDir: this.baseDir,
1175
- rulesyncCommand
1217
+ rulesyncCommand,
1218
+ global: this.global
1176
1219
  });
1177
1220
  case "roo":
1178
1221
  if (!RooCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
@@ -1196,15 +1239,17 @@ var CommandsProcessor = class extends FeatureProcessor {
1196
1239
  }
1197
1240
  return CursorCommand.fromRulesyncCommand({
1198
1241
  baseDir: this.baseDir,
1199
- rulesyncCommand
1242
+ rulesyncCommand,
1243
+ global: this.global
1200
1244
  });
1201
1245
  case "codexcli":
1202
- if (!CodexCliCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
1246
+ if (!CodexcliCommand.isTargetedByRulesyncCommand(rulesyncCommand)) {
1203
1247
  return null;
1204
1248
  }
1205
- return CodexCliCommand.fromRulesyncCommand({
1249
+ return CodexcliCommand.fromRulesyncCommand({
1206
1250
  baseDir: this.baseDir,
1207
- rulesyncCommand
1251
+ rulesyncCommand,
1252
+ global: this.global
1208
1253
  });
1209
1254
  default:
1210
1255
  throw new Error(`Unsupported tool target: ${this.toolTarget}`);
@@ -1284,7 +1329,8 @@ var CommandsProcessor = class extends FeatureProcessor {
1284
1329
  case "geminicli":
1285
1330
  return GeminiCliCommand.fromFile({
1286
1331
  baseDir: this.baseDir,
1287
- relativeFilePath: (0, import_node_path11.basename)(path2)
1332
+ relativeFilePath: (0, import_node_path11.basename)(path2),
1333
+ global: this.global
1288
1334
  });
1289
1335
  case "roo":
1290
1336
  return RooCommand.fromFile({
@@ -1299,12 +1345,14 @@ var CommandsProcessor = class extends FeatureProcessor {
1299
1345
  case "cursor":
1300
1346
  return CursorCommand.fromFile({
1301
1347
  baseDir: this.baseDir,
1302
- relativeFilePath: (0, import_node_path11.basename)(path2)
1348
+ relativeFilePath: (0, import_node_path11.basename)(path2),
1349
+ global: this.global
1303
1350
  });
1304
1351
  case "codexcli":
1305
- return CodexCliCommand.fromFile({
1352
+ return CodexcliCommand.fromFile({
1306
1353
  baseDir: this.baseDir,
1307
- relativeFilePath: (0, import_node_path11.basename)(path2)
1354
+ relativeFilePath: (0, import_node_path11.basename)(path2),
1355
+ global: this.global
1308
1356
  });
1309
1357
  default:
1310
1358
  throw new Error(`Unsupported tool target: ${toolTarget}`);
@@ -1336,12 +1384,13 @@ var CommandsProcessor = class extends FeatureProcessor {
1336
1384
  });
1337
1385
  }
1338
1386
  /**
1339
- * Load Gemini CLI command configurations from .gemini/commands/ directory
1387
+ * Load Cursor command configurations from .cursor/commands/ directory
1340
1388
  */
1341
1389
  async loadCursorCommands() {
1390
+ const paths = this.global ? CursorCommand.getSettablePathsGlobal() : CursorCommand.getSettablePaths();
1342
1391
  return await this.loadToolCommandDefault({
1343
1392
  toolTarget: "cursor",
1344
- relativeDirPath: CursorCommand.getSettablePaths().relativeDirPath,
1393
+ relativeDirPath: paths.relativeDirPath,
1345
1394
  extension: "md"
1346
1395
  });
1347
1396
  }
@@ -1349,19 +1398,21 @@ var CommandsProcessor = class extends FeatureProcessor {
1349
1398
  * Load Gemini CLI command configurations from .gemini/commands/ directory
1350
1399
  */
1351
1400
  async loadGeminicliCommands() {
1401
+ const paths = this.global ? GeminiCliCommand.getSettablePathsGlobal() : GeminiCliCommand.getSettablePaths();
1352
1402
  return await this.loadToolCommandDefault({
1353
1403
  toolTarget: "geminicli",
1354
- relativeDirPath: GeminiCliCommand.getSettablePaths().relativeDirPath,
1355
- extension: "md"
1404
+ relativeDirPath: paths.relativeDirPath,
1405
+ extension: "toml"
1356
1406
  });
1357
1407
  }
1358
1408
  /**
1359
- * Load Roo Code command configurations from .roo/commands/ directory
1409
+ * Load Codex CLI command configurations from .codex/prompts/ directory
1360
1410
  */
1361
1411
  async loadCodexcliCommands() {
1412
+ const paths = this.global ? CodexcliCommand.getSettablePathsGlobal() : CodexcliCommand.getSettablePaths();
1362
1413
  return await this.loadToolCommandDefault({
1363
1414
  toolTarget: "codexcli",
1364
- relativeDirPath: CodexCliCommand.getSettablePaths().relativeDirPath,
1415
+ relativeDirPath: paths.relativeDirPath,
1365
1416
  extension: "md"
1366
1417
  });
1367
1418
  }
@@ -1393,7 +1444,7 @@ var CommandsProcessor = class extends FeatureProcessor {
1393
1444
  return commandsProcessorToolTargetsSimulated;
1394
1445
  }
1395
1446
  static getToolTargetsGlobal() {
1396
- return ["claudecode"];
1447
+ return commandsProcessorToolTargetsGlobal;
1397
1448
  }
1398
1449
  };
1399
1450
 
@@ -1863,55 +1914,8 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
1863
1914
  }
1864
1915
  };
1865
1916
 
1866
- // src/ignore/codexcli-ignore.ts
1867
- var import_node_path17 = require("path");
1868
- var CodexcliIgnore = class _CodexcliIgnore extends ToolIgnore {
1869
- static getSettablePaths() {
1870
- return {
1871
- relativeDirPath: ".",
1872
- relativeFilePath: ".codexignore"
1873
- };
1874
- }
1875
- toRulesyncIgnore() {
1876
- return this.toRulesyncIgnoreDefault();
1877
- }
1878
- static fromRulesyncIgnore({
1879
- baseDir = ".",
1880
- rulesyncIgnore
1881
- }) {
1882
- const fileContent = rulesyncIgnore.getFileContent();
1883
- return new _CodexcliIgnore({
1884
- baseDir,
1885
- relativeDirPath: this.getSettablePaths().relativeDirPath,
1886
- relativeFilePath: this.getSettablePaths().relativeFilePath,
1887
- fileContent,
1888
- validate: true
1889
- // Skip validation to allow empty patterns
1890
- });
1891
- }
1892
- static async fromFile({
1893
- baseDir = ".",
1894
- validate = true
1895
- }) {
1896
- const fileContent = await readFileContent(
1897
- (0, import_node_path17.join)(
1898
- baseDir,
1899
- this.getSettablePaths().relativeDirPath,
1900
- this.getSettablePaths().relativeFilePath
1901
- )
1902
- );
1903
- return new _CodexcliIgnore({
1904
- baseDir,
1905
- relativeDirPath: this.getSettablePaths().relativeDirPath,
1906
- relativeFilePath: this.getSettablePaths().relativeFilePath,
1907
- fileContent,
1908
- validate
1909
- });
1910
- }
1911
- };
1912
-
1913
1917
  // src/ignore/cursor-ignore.ts
1914
- var import_node_path18 = require("path");
1918
+ var import_node_path17 = require("path");
1915
1919
  var CursorIgnore = class _CursorIgnore extends ToolIgnore {
1916
1920
  static getSettablePaths() {
1917
1921
  return {
@@ -1944,7 +1948,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
1944
1948
  validate = true
1945
1949
  }) {
1946
1950
  const fileContent = await readFileContent(
1947
- (0, import_node_path18.join)(
1951
+ (0, import_node_path17.join)(
1948
1952
  baseDir,
1949
1953
  this.getSettablePaths().relativeDirPath,
1950
1954
  this.getSettablePaths().relativeFilePath
@@ -1961,7 +1965,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
1961
1965
  };
1962
1966
 
1963
1967
  // src/ignore/geminicli-ignore.ts
1964
- var import_node_path19 = require("path");
1968
+ var import_node_path18 = require("path");
1965
1969
  var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
1966
1970
  static getSettablePaths() {
1967
1971
  return {
@@ -1988,7 +1992,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
1988
1992
  validate = true
1989
1993
  }) {
1990
1994
  const fileContent = await readFileContent(
1991
- (0, import_node_path19.join)(
1995
+ (0, import_node_path18.join)(
1992
1996
  baseDir,
1993
1997
  this.getSettablePaths().relativeDirPath,
1994
1998
  this.getSettablePaths().relativeFilePath
@@ -2005,7 +2009,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
2005
2009
  };
2006
2010
 
2007
2011
  // src/ignore/junie-ignore.ts
2008
- var import_node_path20 = require("path");
2012
+ var import_node_path19 = require("path");
2009
2013
  var JunieIgnore = class _JunieIgnore extends ToolIgnore {
2010
2014
  static getSettablePaths() {
2011
2015
  return {
@@ -2032,7 +2036,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
2032
2036
  validate = true
2033
2037
  }) {
2034
2038
  const fileContent = await readFileContent(
2035
- (0, import_node_path20.join)(
2039
+ (0, import_node_path19.join)(
2036
2040
  baseDir,
2037
2041
  this.getSettablePaths().relativeDirPath,
2038
2042
  this.getSettablePaths().relativeFilePath
@@ -2049,7 +2053,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
2049
2053
  };
2050
2054
 
2051
2055
  // src/ignore/kiro-ignore.ts
2052
- var import_node_path21 = require("path");
2056
+ var import_node_path20 = require("path");
2053
2057
  var KiroIgnore = class _KiroIgnore extends ToolIgnore {
2054
2058
  static getSettablePaths() {
2055
2059
  return {
@@ -2076,7 +2080,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
2076
2080
  validate = true
2077
2081
  }) {
2078
2082
  const fileContent = await readFileContent(
2079
- (0, import_node_path21.join)(
2083
+ (0, import_node_path20.join)(
2080
2084
  baseDir,
2081
2085
  this.getSettablePaths().relativeDirPath,
2082
2086
  this.getSettablePaths().relativeFilePath
@@ -2093,7 +2097,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
2093
2097
  };
2094
2098
 
2095
2099
  // src/ignore/qwencode-ignore.ts
2096
- var import_node_path22 = require("path");
2100
+ var import_node_path21 = require("path");
2097
2101
  var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
2098
2102
  static getSettablePaths() {
2099
2103
  return {
@@ -2120,7 +2124,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
2120
2124
  validate = true
2121
2125
  }) {
2122
2126
  const fileContent = await readFileContent(
2123
- (0, import_node_path22.join)(
2127
+ (0, import_node_path21.join)(
2124
2128
  baseDir,
2125
2129
  this.getSettablePaths().relativeDirPath,
2126
2130
  this.getSettablePaths().relativeFilePath
@@ -2137,7 +2141,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
2137
2141
  };
2138
2142
 
2139
2143
  // src/ignore/roo-ignore.ts
2140
- var import_node_path23 = require("path");
2144
+ var import_node_path22 = require("path");
2141
2145
  var RooIgnore = class _RooIgnore extends ToolIgnore {
2142
2146
  static getSettablePaths() {
2143
2147
  return {
@@ -2164,7 +2168,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
2164
2168
  validate = true
2165
2169
  }) {
2166
2170
  const fileContent = await readFileContent(
2167
- (0, import_node_path23.join)(
2171
+ (0, import_node_path22.join)(
2168
2172
  baseDir,
2169
2173
  this.getSettablePaths().relativeDirPath,
2170
2174
  this.getSettablePaths().relativeFilePath
@@ -2181,7 +2185,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
2181
2185
  };
2182
2186
 
2183
2187
  // src/ignore/windsurf-ignore.ts
2184
- var import_node_path24 = require("path");
2188
+ var import_node_path23 = require("path");
2185
2189
  var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
2186
2190
  static getSettablePaths() {
2187
2191
  return {
@@ -2208,7 +2212,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
2208
2212
  validate = true
2209
2213
  }) {
2210
2214
  const fileContent = await readFileContent(
2211
- (0, import_node_path24.join)(
2215
+ (0, import_node_path23.join)(
2212
2216
  baseDir,
2213
2217
  this.getSettablePaths().relativeDirPath,
2214
2218
  this.getSettablePaths().relativeFilePath
@@ -2230,7 +2234,6 @@ var ignoreProcessorToolTargets = [
2230
2234
  "augmentcode",
2231
2235
  "claudecode",
2232
2236
  "cline",
2233
- "codexcli",
2234
2237
  "cursor",
2235
2238
  "geminicli",
2236
2239
  "junie",
@@ -2288,8 +2291,6 @@ var IgnoreProcessor = class extends FeatureProcessor {
2288
2291
  return [await ClaudecodeIgnore.fromFile({ baseDir: this.baseDir })];
2289
2292
  case "cline":
2290
2293
  return [await ClineIgnore.fromFile({ baseDir: this.baseDir })];
2291
- case "codexcli":
2292
- return [await CodexcliIgnore.fromFile({ baseDir: this.baseDir })];
2293
2294
  case "cursor":
2294
2295
  return [await CursorIgnore.fromFile({ baseDir: this.baseDir })];
2295
2296
  case "geminicli":
@@ -2347,11 +2348,6 @@ var IgnoreProcessor = class extends FeatureProcessor {
2347
2348
  baseDir: this.baseDir,
2348
2349
  rulesyncIgnore: rulesyncIgnore2
2349
2350
  });
2350
- case "codexcli":
2351
- return CodexcliIgnore.fromRulesyncIgnore({
2352
- baseDir: this.baseDir,
2353
- rulesyncIgnore: rulesyncIgnore2
2354
- });
2355
2351
  case "cursor":
2356
2352
  return CursorIgnore.fromRulesyncIgnore({
2357
2353
  baseDir: this.baseDir,
@@ -2418,10 +2414,10 @@ var IgnoreProcessor = class extends FeatureProcessor {
2418
2414
  var import_mini11 = require("zod/mini");
2419
2415
 
2420
2416
  // src/mcp/amazonqcli-mcp.ts
2421
- var import_node_path26 = require("path");
2417
+ var import_node_path25 = require("path");
2422
2418
 
2423
2419
  // src/mcp/rulesync-mcp.ts
2424
- var import_node_path25 = require("path");
2420
+ var import_node_path24 = require("path");
2425
2421
  var import_mini10 = require("zod/mini");
2426
2422
  var McpTransportTypeSchema = import_mini10.z.enum(["stdio", "sse", "http"]);
2427
2423
  var McpServerBaseSchema = import_mini10.z.object({
@@ -2472,7 +2468,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2472
2468
  }
2473
2469
  static async fromFile({ validate = true }) {
2474
2470
  const fileContent = await readFileContent(
2475
- (0, import_node_path25.join)(this.getSettablePaths().relativeDirPath, this.getSettablePaths().relativeFilePath)
2471
+ (0, import_node_path24.join)(this.getSettablePaths().relativeDirPath, this.getSettablePaths().relativeFilePath)
2476
2472
  );
2477
2473
  return new _RulesyncMcp({
2478
2474
  baseDir: ".",
@@ -2539,7 +2535,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
2539
2535
  validate = true
2540
2536
  }) {
2541
2537
  const fileContent = await readFileContent(
2542
- (0, import_node_path26.join)(
2538
+ (0, import_node_path25.join)(
2543
2539
  baseDir,
2544
2540
  this.getSettablePaths().relativeDirPath,
2545
2541
  this.getSettablePaths().relativeFilePath
@@ -2575,7 +2571,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
2575
2571
  };
2576
2572
 
2577
2573
  // src/mcp/claudecode-mcp.ts
2578
- var import_node_path27 = require("path");
2574
+ var import_node_path26 = require("path");
2579
2575
  var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
2580
2576
  static getSettablePaths() {
2581
2577
  return {
@@ -2588,7 +2584,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
2588
2584
  validate = true
2589
2585
  }) {
2590
2586
  const fileContent = await readFileContent(
2591
- (0, import_node_path27.join)(
2587
+ (0, import_node_path26.join)(
2592
2588
  baseDir,
2593
2589
  this.getSettablePaths().relativeDirPath,
2594
2590
  this.getSettablePaths().relativeFilePath
@@ -2624,7 +2620,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
2624
2620
  };
2625
2621
 
2626
2622
  // src/mcp/cline-mcp.ts
2627
- var import_node_path28 = require("path");
2623
+ var import_node_path27 = require("path");
2628
2624
  var ClineMcp = class _ClineMcp extends ToolMcp {
2629
2625
  static getSettablePaths() {
2630
2626
  return {
@@ -2637,7 +2633,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
2637
2633
  validate = true
2638
2634
  }) {
2639
2635
  const fileContent = await readFileContent(
2640
- (0, import_node_path28.join)(
2636
+ (0, import_node_path27.join)(
2641
2637
  baseDir,
2642
2638
  this.getSettablePaths().relativeDirPath,
2643
2639
  this.getSettablePaths().relativeFilePath
@@ -2673,7 +2669,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
2673
2669
  };
2674
2670
 
2675
2671
  // src/mcp/copilot-mcp.ts
2676
- var import_node_path29 = require("path");
2672
+ var import_node_path28 = require("path");
2677
2673
  var CopilotMcp = class _CopilotMcp extends ToolMcp {
2678
2674
  static getSettablePaths() {
2679
2675
  return {
@@ -2686,7 +2682,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
2686
2682
  validate = true
2687
2683
  }) {
2688
2684
  const fileContent = await readFileContent(
2689
- (0, import_node_path29.join)(
2685
+ (0, import_node_path28.join)(
2690
2686
  baseDir,
2691
2687
  this.getSettablePaths().relativeDirPath,
2692
2688
  this.getSettablePaths().relativeFilePath
@@ -2722,7 +2718,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
2722
2718
  };
2723
2719
 
2724
2720
  // src/mcp/cursor-mcp.ts
2725
- var import_node_path30 = require("path");
2721
+ var import_node_path29 = require("path");
2726
2722
  var CursorMcp = class _CursorMcp extends ToolMcp {
2727
2723
  static getSettablePaths() {
2728
2724
  return {
@@ -2735,7 +2731,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
2735
2731
  validate = true
2736
2732
  }) {
2737
2733
  const fileContent = await readFileContent(
2738
- (0, import_node_path30.join)(
2734
+ (0, import_node_path29.join)(
2739
2735
  baseDir,
2740
2736
  this.getSettablePaths().relativeDirPath,
2741
2737
  this.getSettablePaths().relativeFilePath
@@ -2782,7 +2778,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
2782
2778
  };
2783
2779
 
2784
2780
  // src/mcp/roo-mcp.ts
2785
- var import_node_path31 = require("path");
2781
+ var import_node_path30 = require("path");
2786
2782
  var RooMcp = class _RooMcp extends ToolMcp {
2787
2783
  static getSettablePaths() {
2788
2784
  return {
@@ -2795,7 +2791,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
2795
2791
  validate = true
2796
2792
  }) {
2797
2793
  const fileContent = await readFileContent(
2798
- (0, import_node_path31.join)(
2794
+ (0, import_node_path30.join)(
2799
2795
  baseDir,
2800
2796
  this.getSettablePaths().relativeDirPath,
2801
2797
  this.getSettablePaths().relativeFilePath
@@ -3002,12 +2998,12 @@ var McpProcessor = class extends FeatureProcessor {
3002
2998
  };
3003
2999
 
3004
3000
  // src/rules/rules-processor.ts
3005
- var import_node_path55 = require("path");
3001
+ var import_node_path54 = require("path");
3006
3002
  var import_fast_xml_parser = require("fast-xml-parser");
3007
3003
  var import_mini20 = require("zod/mini");
3008
3004
 
3009
3005
  // src/subagents/simulated-subagent.ts
3010
- var import_node_path32 = require("path");
3006
+ var import_node_path31 = require("path");
3011
3007
  var import_mini12 = require("zod/mini");
3012
3008
 
3013
3009
  // src/subagents/tool-subagent.ts
@@ -3109,7 +3105,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3109
3105
  relativeFilePath,
3110
3106
  validate = true
3111
3107
  }) {
3112
- const filePath = (0, import_node_path32.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
3108
+ const filePath = (0, import_node_path31.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
3113
3109
  const fileContent = await readFileContent(filePath);
3114
3110
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3115
3111
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -3119,7 +3115,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3119
3115
  return {
3120
3116
  baseDir,
3121
3117
  relativeDirPath: this.getSettablePaths().relativeDirPath,
3122
- relativeFilePath: (0, import_node_path32.basename)(relativeFilePath),
3118
+ relativeFilePath: (0, import_node_path31.basename)(relativeFilePath),
3123
3119
  frontmatter: result.data,
3124
3120
  body: content.trim(),
3125
3121
  validate
@@ -3243,15 +3239,15 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
3243
3239
  };
3244
3240
 
3245
3241
  // src/subagents/subagents-processor.ts
3246
- var import_node_path35 = require("path");
3242
+ var import_node_path34 = require("path");
3247
3243
  var import_mini15 = require("zod/mini");
3248
3244
 
3249
3245
  // src/subagents/claudecode-subagent.ts
3250
- var import_node_path34 = require("path");
3246
+ var import_node_path33 = require("path");
3251
3247
  var import_mini14 = require("zod/mini");
3252
3248
 
3253
3249
  // src/subagents/rulesync-subagent.ts
3254
- var import_node_path33 = require("path");
3250
+ var import_node_path32 = require("path");
3255
3251
  var import_mini13 = require("zod/mini");
3256
3252
  var RulesyncSubagentModelSchema = import_mini13.z.enum(["opus", "sonnet", "haiku", "inherit"]);
3257
3253
  var RulesyncSubagentFrontmatterSchema = import_mini13.z.object({
@@ -3305,13 +3301,13 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
3305
3301
  static async fromFile({
3306
3302
  relativeFilePath
3307
3303
  }) {
3308
- const fileContent = await readFileContent((0, import_node_path33.join)(".rulesync/subagents", relativeFilePath));
3304
+ const fileContent = await readFileContent((0, import_node_path32.join)(".rulesync/subagents", relativeFilePath));
3309
3305
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3310
3306
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
3311
3307
  if (!result.success) {
3312
3308
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${result.error.message}`);
3313
3309
  }
3314
- const filename = (0, import_node_path33.basename)(relativeFilePath);
3310
+ const filename = (0, import_node_path32.basename)(relativeFilePath);
3315
3311
  return new _RulesyncSubagent({
3316
3312
  baseDir: ".",
3317
3313
  relativeDirPath: this.getSettablePaths().relativeDirPath,
@@ -3423,7 +3419,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
3423
3419
  relativeFilePath,
3424
3420
  validate = true
3425
3421
  }) {
3426
- const fileContent = await readFileContent((0, import_node_path34.join)(baseDir, ".claude/agents", relativeFilePath));
3422
+ const fileContent = await readFileContent((0, import_node_path33.join)(baseDir, ".claude/agents", relativeFilePath));
3427
3423
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3428
3424
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
3429
3425
  if (!result.success) {
@@ -3554,7 +3550,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
3554
3550
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
3555
3551
  */
3556
3552
  async loadRulesyncFiles() {
3557
- const subagentsDir = (0, import_node_path35.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
3553
+ const subagentsDir = (0, import_node_path34.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
3558
3554
  const dirExists = await directoryExists(subagentsDir);
3559
3555
  if (!dirExists) {
3560
3556
  logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -3569,7 +3565,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
3569
3565
  logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
3570
3566
  const rulesyncSubagents = [];
3571
3567
  for (const mdFile of mdFiles) {
3572
- const filepath = (0, import_node_path35.join)(subagentsDir, mdFile);
3568
+ const filepath = (0, import_node_path34.join)(subagentsDir, mdFile);
3573
3569
  try {
3574
3570
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
3575
3571
  relativeFilePath: mdFile,
@@ -3672,8 +3668,8 @@ var SubagentsProcessor = class extends FeatureProcessor {
3672
3668
  relativeDirPath,
3673
3669
  fromFile
3674
3670
  }) {
3675
- const paths = await findFilesByGlobs((0, import_node_path35.join)(this.baseDir, relativeDirPath, "*.md"));
3676
- const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0, import_node_path35.basename)(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
3671
+ const paths = await findFilesByGlobs((0, import_node_path34.join)(this.baseDir, relativeDirPath, "*.md"));
3672
+ const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0, import_node_path34.basename)(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
3677
3673
  logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
3678
3674
  return subagents;
3679
3675
  }
@@ -3697,13 +3693,13 @@ var SubagentsProcessor = class extends FeatureProcessor {
3697
3693
  };
3698
3694
 
3699
3695
  // src/rules/agentsmd-rule.ts
3700
- var import_node_path38 = require("path");
3696
+ var import_node_path37 = require("path");
3701
3697
 
3702
3698
  // src/rules/tool-rule.ts
3703
- var import_node_path37 = require("path");
3699
+ var import_node_path36 = require("path");
3704
3700
 
3705
3701
  // src/rules/rulesync-rule.ts
3706
- var import_node_path36 = require("path");
3702
+ var import_node_path35 = require("path");
3707
3703
  var import_mini16 = require("zod/mini");
3708
3704
  var RulesyncRuleFrontmatterSchema = import_mini16.z.object({
3709
3705
  root: import_mini16.z.optional(import_mini16.z.optional(import_mini16.z.boolean())),
@@ -3769,7 +3765,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
3769
3765
  relativeFilePath,
3770
3766
  validate = true
3771
3767
  }) {
3772
- const filePath = (0, import_node_path36.join)(this.getSettablePaths().legacy.relativeDirPath, relativeFilePath);
3768
+ const filePath = (0, import_node_path35.join)(this.getSettablePaths().legacy.relativeDirPath, relativeFilePath);
3773
3769
  const fileContent = await readFileContent(filePath);
3774
3770
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3775
3771
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
@@ -3784,7 +3780,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
3784
3780
  agentsmd: result.data.agentsmd,
3785
3781
  cursor: result.data.cursor
3786
3782
  };
3787
- const filename = (0, import_node_path36.basename)(filePath);
3783
+ const filename = (0, import_node_path35.basename)(filePath);
3788
3784
  return new _RulesyncRule({
3789
3785
  baseDir: ".",
3790
3786
  relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
@@ -3798,7 +3794,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
3798
3794
  relativeFilePath,
3799
3795
  validate = true
3800
3796
  }) {
3801
- const filePath = (0, import_node_path36.join)(this.getSettablePaths().recommended.relativeDirPath, relativeFilePath);
3797
+ const filePath = (0, import_node_path35.join)(this.getSettablePaths().recommended.relativeDirPath, relativeFilePath);
3802
3798
  const fileContent = await readFileContent(filePath);
3803
3799
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3804
3800
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
@@ -3813,7 +3809,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
3813
3809
  agentsmd: result.data.agentsmd,
3814
3810
  cursor: result.data.cursor
3815
3811
  };
3816
- const filename = (0, import_node_path36.basename)(filePath);
3812
+ const filename = (0, import_node_path35.basename)(filePath);
3817
3813
  return new _RulesyncRule({
3818
3814
  baseDir: ".",
3819
3815
  relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
@@ -3902,7 +3898,7 @@ var ToolRule = class extends ToolFile {
3902
3898
  });
3903
3899
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
3904
3900
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
3905
- params.relativeDirPath = (0, import_node_path37.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
3901
+ params.relativeDirPath = (0, import_node_path36.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
3906
3902
  params.relativeFilePath = "AGENTS.md";
3907
3903
  }
3908
3904
  return params;
@@ -3978,8 +3974,8 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
3978
3974
  validate = true
3979
3975
  }) {
3980
3976
  const isRoot = relativeFilePath === "AGENTS.md";
3981
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path38.join)(".agents/memories", relativeFilePath);
3982
- const fileContent = await readFileContent((0, import_node_path38.join)(baseDir, relativePath));
3977
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path37.join)(".agents/memories", relativeFilePath);
3978
+ const fileContent = await readFileContent((0, import_node_path37.join)(baseDir, relativePath));
3983
3979
  return new _AgentsMdRule({
3984
3980
  baseDir,
3985
3981
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -4019,7 +4015,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
4019
4015
  };
4020
4016
 
4021
4017
  // src/rules/amazonqcli-rule.ts
4022
- var import_node_path39 = require("path");
4018
+ var import_node_path38 = require("path");
4023
4019
  var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
4024
4020
  static getSettablePaths() {
4025
4021
  return {
@@ -4034,7 +4030,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
4034
4030
  validate = true
4035
4031
  }) {
4036
4032
  const fileContent = await readFileContent(
4037
- (0, import_node_path39.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4033
+ (0, import_node_path38.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4038
4034
  );
4039
4035
  return new _AmazonQCliRule({
4040
4036
  baseDir,
@@ -4074,7 +4070,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
4074
4070
  };
4075
4071
 
4076
4072
  // src/rules/augmentcode-legacy-rule.ts
4077
- var import_node_path40 = require("path");
4073
+ var import_node_path39 = require("path");
4078
4074
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
4079
4075
  toRulesyncRule() {
4080
4076
  const rulesyncFrontmatter = {
@@ -4135,8 +4131,8 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
4135
4131
  }) {
4136
4132
  const settablePaths = this.getSettablePaths();
4137
4133
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
4138
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path40.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
4139
- const fileContent = await readFileContent((0, import_node_path40.join)(baseDir, relativePath));
4134
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path39.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
4135
+ const fileContent = await readFileContent((0, import_node_path39.join)(baseDir, relativePath));
4140
4136
  return new _AugmentcodeLegacyRule({
4141
4137
  baseDir,
4142
4138
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -4149,7 +4145,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
4149
4145
  };
4150
4146
 
4151
4147
  // src/rules/augmentcode-rule.ts
4152
- var import_node_path41 = require("path");
4148
+ var import_node_path40 = require("path");
4153
4149
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
4154
4150
  toRulesyncRule() {
4155
4151
  return this.toRulesyncRuleDefault();
@@ -4181,7 +4177,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
4181
4177
  validate = true
4182
4178
  }) {
4183
4179
  const fileContent = await readFileContent(
4184
- (0, import_node_path41.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4180
+ (0, import_node_path40.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4185
4181
  );
4186
4182
  const { body: content } = parseFrontmatter(fileContent);
4187
4183
  return new _AugmentcodeRule({
@@ -4204,7 +4200,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
4204
4200
  };
4205
4201
 
4206
4202
  // src/rules/claudecode-rule.ts
4207
- var import_node_path42 = require("path");
4203
+ var import_node_path41 = require("path");
4208
4204
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
4209
4205
  static getSettablePaths() {
4210
4206
  return {
@@ -4213,7 +4209,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
4213
4209
  relativeFilePath: "CLAUDE.md"
4214
4210
  },
4215
4211
  nonRoot: {
4216
- relativeDirPath: (0, import_node_path42.join)(".claude", "memories")
4212
+ relativeDirPath: (0, import_node_path41.join)(".claude", "memories")
4217
4213
  }
4218
4214
  };
4219
4215
  }
@@ -4236,7 +4232,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
4236
4232
  if (isRoot) {
4237
4233
  const relativePath2 = paths.root.relativeFilePath;
4238
4234
  const fileContent2 = await readFileContent(
4239
- (0, import_node_path42.join)(baseDir, paths.root.relativeDirPath, relativePath2)
4235
+ (0, import_node_path41.join)(baseDir, paths.root.relativeDirPath, relativePath2)
4240
4236
  );
4241
4237
  return new _ClaudecodeRule({
4242
4238
  baseDir,
@@ -4250,8 +4246,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
4250
4246
  if (!paths.nonRoot) {
4251
4247
  throw new Error("nonRoot path is not set");
4252
4248
  }
4253
- const relativePath = (0, import_node_path42.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
4254
- const fileContent = await readFileContent((0, import_node_path42.join)(baseDir, relativePath));
4249
+ const relativePath = (0, import_node_path41.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
4250
+ const fileContent = await readFileContent((0, import_node_path41.join)(baseDir, relativePath));
4255
4251
  return new _ClaudecodeRule({
4256
4252
  baseDir,
4257
4253
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -4293,7 +4289,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
4293
4289
  };
4294
4290
 
4295
4291
  // src/rules/cline-rule.ts
4296
- var import_node_path43 = require("path");
4292
+ var import_node_path42 = require("path");
4297
4293
  var import_mini17 = require("zod/mini");
4298
4294
  var ClineRuleFrontmatterSchema = import_mini17.z.object({
4299
4295
  description: import_mini17.z.string()
@@ -4338,7 +4334,7 @@ var ClineRule = class _ClineRule extends ToolRule {
4338
4334
  validate = true
4339
4335
  }) {
4340
4336
  const fileContent = await readFileContent(
4341
- (0, import_node_path43.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4337
+ (0, import_node_path42.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4342
4338
  );
4343
4339
  return new _ClineRule({
4344
4340
  baseDir,
@@ -4351,7 +4347,7 @@ var ClineRule = class _ClineRule extends ToolRule {
4351
4347
  };
4352
4348
 
4353
4349
  // src/rules/codexcli-rule.ts
4354
- var import_node_path44 = require("path");
4350
+ var import_node_path43 = require("path");
4355
4351
  var CodexcliRule = class _CodexcliRule extends ToolRule {
4356
4352
  static getSettablePaths() {
4357
4353
  return {
@@ -4383,7 +4379,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
4383
4379
  if (isRoot) {
4384
4380
  const relativePath2 = paths.root.relativeFilePath;
4385
4381
  const fileContent2 = await readFileContent(
4386
- (0, import_node_path44.join)(baseDir, paths.root.relativeDirPath, relativePath2)
4382
+ (0, import_node_path43.join)(baseDir, paths.root.relativeDirPath, relativePath2)
4387
4383
  );
4388
4384
  return new _CodexcliRule({
4389
4385
  baseDir,
@@ -4397,8 +4393,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
4397
4393
  if (!paths.nonRoot) {
4398
4394
  throw new Error("nonRoot path is not set");
4399
4395
  }
4400
- const relativePath = (0, import_node_path44.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
4401
- const fileContent = await readFileContent((0, import_node_path44.join)(baseDir, relativePath));
4396
+ const relativePath = (0, import_node_path43.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
4397
+ const fileContent = await readFileContent((0, import_node_path43.join)(baseDir, relativePath));
4402
4398
  return new _CodexcliRule({
4403
4399
  baseDir,
4404
4400
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -4440,7 +4436,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
4440
4436
  };
4441
4437
 
4442
4438
  // src/rules/copilot-rule.ts
4443
- var import_node_path45 = require("path");
4439
+ var import_node_path44 = require("path");
4444
4440
  var import_mini18 = require("zod/mini");
4445
4441
  var CopilotRuleFrontmatterSchema = import_mini18.z.object({
4446
4442
  description: import_mini18.z.optional(import_mini18.z.string()),
@@ -4533,11 +4529,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
4533
4529
  validate = true
4534
4530
  }) {
4535
4531
  const isRoot = relativeFilePath === "copilot-instructions.md";
4536
- const relativePath = isRoot ? (0, import_node_path45.join)(
4532
+ const relativePath = isRoot ? (0, import_node_path44.join)(
4537
4533
  this.getSettablePaths().root.relativeDirPath,
4538
4534
  this.getSettablePaths().root.relativeFilePath
4539
- ) : (0, import_node_path45.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
4540
- const fileContent = await readFileContent((0, import_node_path45.join)(baseDir, relativePath));
4535
+ ) : (0, import_node_path44.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
4536
+ const fileContent = await readFileContent((0, import_node_path44.join)(baseDir, relativePath));
4541
4537
  if (isRoot) {
4542
4538
  return new _CopilotRule({
4543
4539
  baseDir,
@@ -4556,7 +4552,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
4556
4552
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
4557
4553
  if (!result.success) {
4558
4554
  throw new Error(
4559
- `Invalid frontmatter in ${(0, import_node_path45.join)(baseDir, relativeFilePath)}: ${result.error.message}`
4555
+ `Invalid frontmatter in ${(0, import_node_path44.join)(baseDir, relativeFilePath)}: ${result.error.message}`
4560
4556
  );
4561
4557
  }
4562
4558
  return new _CopilotRule({
@@ -4595,7 +4591,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
4595
4591
  };
4596
4592
 
4597
4593
  // src/rules/cursor-rule.ts
4598
- var import_node_path46 = require("path");
4594
+ var import_node_path45 = require("path");
4599
4595
  var import_mini19 = require("zod/mini");
4600
4596
  var CursorRuleFrontmatterSchema = import_mini19.z.object({
4601
4597
  description: import_mini19.z.optional(import_mini19.z.string()),
@@ -4722,19 +4718,19 @@ var CursorRule = class _CursorRule extends ToolRule {
4722
4718
  validate = true
4723
4719
  }) {
4724
4720
  const fileContent = await readFileContent(
4725
- (0, import_node_path46.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4721
+ (0, import_node_path45.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4726
4722
  );
4727
4723
  const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
4728
4724
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
4729
4725
  if (!result.success) {
4730
4726
  throw new Error(
4731
- `Invalid frontmatter in ${(0, import_node_path46.join)(baseDir, relativeFilePath)}: ${result.error.message}`
4727
+ `Invalid frontmatter in ${(0, import_node_path45.join)(baseDir, relativeFilePath)}: ${result.error.message}`
4732
4728
  );
4733
4729
  }
4734
4730
  return new _CursorRule({
4735
4731
  baseDir,
4736
4732
  relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
4737
- relativeFilePath: (0, import_node_path46.basename)(relativeFilePath),
4733
+ relativeFilePath: (0, import_node_path45.basename)(relativeFilePath),
4738
4734
  frontmatter: result.data,
4739
4735
  body: content.trim(),
4740
4736
  validate
@@ -4766,7 +4762,7 @@ var CursorRule = class _CursorRule extends ToolRule {
4766
4762
  };
4767
4763
 
4768
4764
  // src/rules/geminicli-rule.ts
4769
- var import_node_path47 = require("path");
4765
+ var import_node_path46 = require("path");
4770
4766
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
4771
4767
  static getSettablePaths() {
4772
4768
  return {
@@ -4779,35 +4775,64 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
4779
4775
  }
4780
4776
  };
4781
4777
  }
4778
+ static getSettablePathsGlobal() {
4779
+ return {
4780
+ root: {
4781
+ relativeDirPath: ".gemini",
4782
+ relativeFilePath: "GEMINI.md"
4783
+ }
4784
+ };
4785
+ }
4782
4786
  static async fromFile({
4783
4787
  baseDir = ".",
4784
4788
  relativeFilePath,
4785
- validate = true
4789
+ validate = true,
4790
+ global = false
4786
4791
  }) {
4787
- const isRoot = relativeFilePath === "GEMINI.md";
4788
- const relativePath = isRoot ? "GEMINI.md" : (0, import_node_path47.join)(".gemini/memories", relativeFilePath);
4789
- const fileContent = await readFileContent((0, import_node_path47.join)(baseDir, relativePath));
4792
+ const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
4793
+ const isRoot = relativeFilePath === paths.root.relativeFilePath;
4794
+ if (isRoot) {
4795
+ const relativePath2 = paths.root.relativeFilePath;
4796
+ const fileContent2 = await readFileContent(
4797
+ (0, import_node_path46.join)(baseDir, paths.root.relativeDirPath, relativePath2)
4798
+ );
4799
+ return new _GeminiCliRule({
4800
+ baseDir,
4801
+ relativeDirPath: paths.root.relativeDirPath,
4802
+ relativeFilePath: paths.root.relativeFilePath,
4803
+ fileContent: fileContent2,
4804
+ validate,
4805
+ root: true
4806
+ });
4807
+ }
4808
+ if (!paths.nonRoot) {
4809
+ throw new Error("nonRoot path is not set");
4810
+ }
4811
+ const relativePath = (0, import_node_path46.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
4812
+ const fileContent = await readFileContent((0, import_node_path46.join)(baseDir, relativePath));
4790
4813
  return new _GeminiCliRule({
4791
4814
  baseDir,
4792
- relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
4793
- relativeFilePath: isRoot ? "GEMINI.md" : relativeFilePath,
4815
+ relativeDirPath: paths.nonRoot.relativeDirPath,
4816
+ relativeFilePath,
4794
4817
  fileContent,
4795
4818
  validate,
4796
- root: isRoot
4819
+ root: false
4797
4820
  });
4798
4821
  }
4799
4822
  static fromRulesyncRule({
4800
4823
  baseDir = ".",
4801
4824
  rulesyncRule,
4802
- validate = true
4825
+ validate = true,
4826
+ global = false
4803
4827
  }) {
4828
+ const paths = global ? this.getSettablePathsGlobal() : this.getSettablePaths();
4804
4829
  return new _GeminiCliRule(
4805
4830
  this.buildToolRuleParamsDefault({
4806
4831
  baseDir,
4807
4832
  rulesyncRule,
4808
4833
  validate,
4809
- rootPath: this.getSettablePaths().root,
4810
- nonRootPath: this.getSettablePaths().nonRoot
4834
+ rootPath: paths.root,
4835
+ nonRootPath: paths.nonRoot
4811
4836
  })
4812
4837
  );
4813
4838
  }
@@ -4826,7 +4851,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
4826
4851
  };
4827
4852
 
4828
4853
  // src/rules/junie-rule.ts
4829
- var import_node_path48 = require("path");
4854
+ var import_node_path47 = require("path");
4830
4855
  var JunieRule = class _JunieRule extends ToolRule {
4831
4856
  static getSettablePaths() {
4832
4857
  return {
@@ -4845,8 +4870,8 @@ var JunieRule = class _JunieRule extends ToolRule {
4845
4870
  validate = true
4846
4871
  }) {
4847
4872
  const isRoot = relativeFilePath === "guidelines.md";
4848
- const relativePath = isRoot ? "guidelines.md" : (0, import_node_path48.join)(".junie/memories", relativeFilePath);
4849
- const fileContent = await readFileContent((0, import_node_path48.join)(baseDir, relativePath));
4873
+ const relativePath = isRoot ? "guidelines.md" : (0, import_node_path47.join)(".junie/memories", relativeFilePath);
4874
+ const fileContent = await readFileContent((0, import_node_path47.join)(baseDir, relativePath));
4850
4875
  return new _JunieRule({
4851
4876
  baseDir,
4852
4877
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -4886,7 +4911,7 @@ var JunieRule = class _JunieRule extends ToolRule {
4886
4911
  };
4887
4912
 
4888
4913
  // src/rules/kiro-rule.ts
4889
- var import_node_path49 = require("path");
4914
+ var import_node_path48 = require("path");
4890
4915
  var KiroRule = class _KiroRule extends ToolRule {
4891
4916
  static getSettablePaths() {
4892
4917
  return {
@@ -4901,7 +4926,7 @@ var KiroRule = class _KiroRule extends ToolRule {
4901
4926
  validate = true
4902
4927
  }) {
4903
4928
  const fileContent = await readFileContent(
4904
- (0, import_node_path49.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4929
+ (0, import_node_path48.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4905
4930
  );
4906
4931
  return new _KiroRule({
4907
4932
  baseDir,
@@ -4941,7 +4966,7 @@ var KiroRule = class _KiroRule extends ToolRule {
4941
4966
  };
4942
4967
 
4943
4968
  // src/rules/opencode-rule.ts
4944
- var import_node_path50 = require("path");
4969
+ var import_node_path49 = require("path");
4945
4970
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
4946
4971
  static getSettablePaths() {
4947
4972
  return {
@@ -4960,8 +4985,8 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
4960
4985
  validate = true
4961
4986
  }) {
4962
4987
  const isRoot = relativeFilePath === "AGENTS.md";
4963
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path50.join)(".opencode/memories", relativeFilePath);
4964
- const fileContent = await readFileContent((0, import_node_path50.join)(baseDir, relativePath));
4988
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path49.join)(".opencode/memories", relativeFilePath);
4989
+ const fileContent = await readFileContent((0, import_node_path49.join)(baseDir, relativePath));
4965
4990
  return new _OpenCodeRule({
4966
4991
  baseDir,
4967
4992
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -5001,7 +5026,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
5001
5026
  };
5002
5027
 
5003
5028
  // src/rules/qwencode-rule.ts
5004
- var import_node_path51 = require("path");
5029
+ var import_node_path50 = require("path");
5005
5030
  var QwencodeRule = class _QwencodeRule extends ToolRule {
5006
5031
  static getSettablePaths() {
5007
5032
  return {
@@ -5020,8 +5045,8 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
5020
5045
  validate = true
5021
5046
  }) {
5022
5047
  const isRoot = relativeFilePath === "QWEN.md";
5023
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path51.join)(".qwen/memories", relativeFilePath);
5024
- const fileContent = await readFileContent((0, import_node_path51.join)(baseDir, relativePath));
5048
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path50.join)(".qwen/memories", relativeFilePath);
5049
+ const fileContent = await readFileContent((0, import_node_path50.join)(baseDir, relativePath));
5025
5050
  return new _QwencodeRule({
5026
5051
  baseDir,
5027
5052
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -5058,7 +5083,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
5058
5083
  };
5059
5084
 
5060
5085
  // src/rules/roo-rule.ts
5061
- var import_node_path52 = require("path");
5086
+ var import_node_path51 = require("path");
5062
5087
  var RooRule = class _RooRule extends ToolRule {
5063
5088
  static getSettablePaths() {
5064
5089
  return {
@@ -5073,7 +5098,7 @@ var RooRule = class _RooRule extends ToolRule {
5073
5098
  validate = true
5074
5099
  }) {
5075
5100
  const fileContent = await readFileContent(
5076
- (0, import_node_path52.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5101
+ (0, import_node_path51.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5077
5102
  );
5078
5103
  return new _RooRule({
5079
5104
  baseDir,
@@ -5128,7 +5153,7 @@ var RooRule = class _RooRule extends ToolRule {
5128
5153
  };
5129
5154
 
5130
5155
  // src/rules/warp-rule.ts
5131
- var import_node_path53 = require("path");
5156
+ var import_node_path52 = require("path");
5132
5157
  var WarpRule = class _WarpRule extends ToolRule {
5133
5158
  constructor({ fileContent, root, ...rest }) {
5134
5159
  super({
@@ -5154,8 +5179,8 @@ var WarpRule = class _WarpRule extends ToolRule {
5154
5179
  validate = true
5155
5180
  }) {
5156
5181
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
5157
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path53.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
5158
- const fileContent = await readFileContent((0, import_node_path53.join)(baseDir, relativePath));
5182
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path52.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
5183
+ const fileContent = await readFileContent((0, import_node_path52.join)(baseDir, relativePath));
5159
5184
  return new _WarpRule({
5160
5185
  baseDir,
5161
5186
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -5195,7 +5220,7 @@ var WarpRule = class _WarpRule extends ToolRule {
5195
5220
  };
5196
5221
 
5197
5222
  // src/rules/windsurf-rule.ts
5198
- var import_node_path54 = require("path");
5223
+ var import_node_path53 = require("path");
5199
5224
  var WindsurfRule = class _WindsurfRule extends ToolRule {
5200
5225
  static getSettablePaths() {
5201
5226
  return {
@@ -5210,7 +5235,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
5210
5235
  validate = true
5211
5236
  }) {
5212
5237
  const fileContent = await readFileContent(
5213
- (0, import_node_path54.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5238
+ (0, import_node_path53.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5214
5239
  );
5215
5240
  return new _WindsurfRule({
5216
5241
  baseDir,
@@ -5269,7 +5294,11 @@ var rulesProcessorToolTargets = [
5269
5294
  "windsurf"
5270
5295
  ];
5271
5296
  var RulesProcessorToolTargetSchema = import_mini20.z.enum(rulesProcessorToolTargets);
5272
- var rulesProcessorToolTargetsGlobal = ["claudecode", "codexcli"];
5297
+ var rulesProcessorToolTargetsGlobal = [
5298
+ "claudecode",
5299
+ "codexcli",
5300
+ "geminicli"
5301
+ ];
5273
5302
  var RulesProcessor = class extends FeatureProcessor {
5274
5303
  toolTarget;
5275
5304
  simulateCommands;
@@ -5384,7 +5413,8 @@ var RulesProcessor = class extends FeatureProcessor {
5384
5413
  return GeminiCliRule.fromRulesyncRule({
5385
5414
  baseDir: this.baseDir,
5386
5415
  rulesyncRule,
5387
- validate: true
5416
+ validate: true,
5417
+ global: this.global
5388
5418
  });
5389
5419
  case "junie":
5390
5420
  if (!JunieRule.isTargetedByRulesyncRule(rulesyncRule)) {
@@ -5519,7 +5549,6 @@ var RulesProcessor = class extends FeatureProcessor {
5519
5549
  const rootRule = toolRules[rootRuleIndex];
5520
5550
  rootRule?.setFileContent(
5521
5551
  this.generateXmlReferencesSection(toolRules) + this.generateAdditionalConventionsSection({
5522
- commands: { relativeDirPath: CodexCliCommand.getSettablePaths().relativeDirPath },
5523
5552
  subagents: {
5524
5553
  relativeDirPath: CodexCliSubagent.getSettablePaths().relativeDirPath
5525
5554
  }
@@ -5595,10 +5624,10 @@ var RulesProcessor = class extends FeatureProcessor {
5595
5624
  * Load and parse rulesync rule files from .rulesync/rules/ directory
5596
5625
  */
5597
5626
  async loadRulesyncFiles() {
5598
- const files = await findFilesByGlobs((0, import_node_path55.join)(".rulesync/rules", "*.md"));
5627
+ const files = await findFilesByGlobs((0, import_node_path54.join)(".rulesync/rules", "*.md"));
5599
5628
  logger.debug(`Found ${files.length} rulesync files`);
5600
5629
  const rulesyncRules = await Promise.all(
5601
- files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path55.basename)(file) }))
5630
+ files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path54.basename)(file) }))
5602
5631
  );
5603
5632
  const rootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().root);
5604
5633
  if (rootRules.length > 1) {
@@ -5616,10 +5645,10 @@ var RulesProcessor = class extends FeatureProcessor {
5616
5645
  return rulesyncRules;
5617
5646
  }
5618
5647
  async loadRulesyncFilesLegacy() {
5619
- const legacyFiles = await findFilesByGlobs((0, import_node_path55.join)(".rulesync", "*.md"));
5648
+ const legacyFiles = await findFilesByGlobs((0, import_node_path54.join)(".rulesync", "*.md"));
5620
5649
  logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
5621
5650
  return Promise.all(
5622
- legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path55.basename)(file) }))
5651
+ legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path54.basename)(file) }))
5623
5652
  );
5624
5653
  }
5625
5654
  /**
@@ -5683,13 +5712,13 @@ var RulesProcessor = class extends FeatureProcessor {
5683
5712
  return [];
5684
5713
  }
5685
5714
  const rootFilePaths = await findFilesByGlobs(
5686
- (0, import_node_path55.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
5715
+ (0, import_node_path54.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
5687
5716
  );
5688
5717
  return await Promise.all(
5689
5718
  rootFilePaths.map(
5690
5719
  (filePath) => root.fromFile({
5691
5720
  baseDir: this.baseDir,
5692
- relativeFilePath: (0, import_node_path55.basename)(filePath),
5721
+ relativeFilePath: (0, import_node_path54.basename)(filePath),
5693
5722
  global: this.global
5694
5723
  })
5695
5724
  )
@@ -5701,13 +5730,13 @@ var RulesProcessor = class extends FeatureProcessor {
5701
5730
  return [];
5702
5731
  }
5703
5732
  const nonRootFilePaths = await findFilesByGlobs(
5704
- (0, import_node_path55.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
5733
+ (0, import_node_path54.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
5705
5734
  );
5706
5735
  return await Promise.all(
5707
5736
  nonRootFilePaths.map(
5708
5737
  (filePath) => nonRoot.fromFile({
5709
5738
  baseDir: this.baseDir,
5710
- relativeFilePath: (0, import_node_path55.basename)(filePath),
5739
+ relativeFilePath: (0, import_node_path54.basename)(filePath),
5711
5740
  global: this.global
5712
5741
  })
5713
5742
  )
@@ -5881,18 +5910,20 @@ var RulesProcessor = class extends FeatureProcessor {
5881
5910
  * Load Gemini CLI rule configuration from GEMINI.md file
5882
5911
  */
5883
5912
  async loadGeminicliRules() {
5884
- const settablePaths = GeminiCliRule.getSettablePaths();
5913
+ const settablePaths = this.global ? GeminiCliRule.getSettablePathsGlobal() : GeminiCliRule.getSettablePaths();
5885
5914
  return await this.loadToolRulesDefault({
5886
5915
  root: {
5887
5916
  relativeDirPath: settablePaths.root.relativeDirPath,
5888
5917
  relativeFilePath: settablePaths.root.relativeFilePath,
5889
5918
  fromFile: (params) => GeminiCliRule.fromFile(params)
5890
5919
  },
5891
- nonRoot: {
5892
- relativeDirPath: settablePaths.nonRoot.relativeDirPath,
5893
- fromFile: (params) => GeminiCliRule.fromFile(params),
5894
- extension: "md"
5895
- }
5920
+ ...settablePaths.nonRoot ? {
5921
+ nonRoot: {
5922
+ relativeDirPath: settablePaths.nonRoot.relativeDirPath,
5923
+ fromFile: (params) => GeminiCliRule.fromFile(params),
5924
+ extension: "md"
5925
+ }
5926
+ } : {}
5896
5927
  });
5897
5928
  }
5898
5929
  /**
@@ -6060,7 +6091,7 @@ var RulesProcessor = class extends FeatureProcessor {
6060
6091
  const overview = `# Additional Conventions Beyond the Built-in Functions
6061
6092
 
6062
6093
  As this project's AI coding tool, you must follow the additional conventions below, in addition to the built-in functions.`;
6063
- const commandsSection = `## Simulated Custom Slash Commands
6094
+ const commandsSection = commands ? `## Simulated Custom Slash Commands
6064
6095
 
6065
6096
  Custom slash commands allow you to define frequently-used prompts as Markdown files that you can execute.
6066
6097
 
@@ -6075,14 +6106,14 @@ s/<command> [arguments]
6075
6106
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
6076
6107
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
6077
6108
 
6078
- When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path55.join)(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.`;
6079
- const subagentsSection = `## Simulated Subagents
6109
+ When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path54.join)(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
6110
+ const subagentsSection = subagents ? `## Simulated Subagents
6080
6111
 
6081
6112
  Simulated subagents are specialized AI assistants that can be invoked to handle specific types of tasks. In this case, it can be appear something like custom slash commands simply. Simulated subagents can be called by custom slash commands.
6082
6113
 
6083
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path55.join)(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
6114
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path54.join)(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
6084
6115
 
6085
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path55.join)(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.`;
6116
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path54.join)(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.` : "";
6086
6117
  const result = [
6087
6118
  overview,
6088
6119
  ...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
@@ -6307,9 +6338,9 @@ async function generateSubagents(config) {
6307
6338
  }
6308
6339
 
6309
6340
  // src/cli/commands/gitignore.ts
6310
- var import_node_path56 = require("path");
6341
+ var import_node_path55 = require("path");
6311
6342
  var gitignoreCommand = async () => {
6312
- const gitignorePath = (0, import_node_path56.join)(process.cwd(), ".gitignore");
6343
+ const gitignorePath = (0, import_node_path55.join)(process.cwd(), ".gitignore");
6313
6344
  const rulesFilesToIgnore = [
6314
6345
  "# Generated by rulesync - AI tool configuration files",
6315
6346
  "**/.amazonq/",
@@ -6546,7 +6577,7 @@ async function importSubagents(config, tool) {
6546
6577
  }
6547
6578
 
6548
6579
  // src/cli/commands/init.ts
6549
- var import_node_path57 = require("path");
6580
+ var import_node_path56 = require("path");
6550
6581
  async function initCommand() {
6551
6582
  logger.info("Initializing rulesync...");
6552
6583
  await ensureDir(".rulesync");
@@ -6617,7 +6648,7 @@ globs: ["**/*"]
6617
6648
  - Follow single responsibility principle
6618
6649
  `
6619
6650
  };
6620
- const filepath = (0, import_node_path57.join)(".rulesync/rules", sampleFile.filename);
6651
+ const filepath = (0, import_node_path56.join)(".rulesync/rules", sampleFile.filename);
6621
6652
  await ensureDir(".rulesync/rules");
6622
6653
  await ensureDir(RulesyncCommand.getSettablePaths().relativeDirPath);
6623
6654
  await ensureDir(".rulesync/subagents");
@@ -6630,7 +6661,7 @@ globs: ["**/*"]
6630
6661
  }
6631
6662
 
6632
6663
  // src/cli/index.ts
6633
- var getVersion = () => "2.1.0";
6664
+ var getVersion = () => "3.0.0";
6634
6665
  var main = async () => {
6635
6666
  const program = new import_commander.Command();
6636
6667
  const version = getVersion();