rulesync 3.13.0 → 3.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +439 -432
  2. package/dist/index.js +258 -251
  3. package/package.json +16 -13
package/dist/index.cjs CHANGED
@@ -112,6 +112,15 @@ async function readOrInitializeFileContent(filePath, initialContent = "") {
112
112
  return initialContent;
113
113
  }
114
114
  }
115
+ function resolvePath(relativePath, baseDir) {
116
+ if (!baseDir) return relativePath;
117
+ const resolved = (0, import_node_path.resolve)(baseDir, relativePath);
118
+ const rel = (0, import_node_path.relative)(baseDir, resolved);
119
+ if (rel.startsWith("..") || (0, import_node_path.resolve)(resolved) !== resolved) {
120
+ throw new Error(`Path traversal detected: ${relativePath}`);
121
+ }
122
+ return resolved;
123
+ }
115
124
  async function directoryExists(dirPath) {
116
125
  try {
117
126
  const stats = await (0, import_promises.stat)(dirPath);
@@ -176,14 +185,8 @@ function validateBaseDir(baseDir) {
176
185
  if (baseDir.includes("..")) {
177
186
  throw new Error(`baseDir cannot contain directory traversal (..): ${baseDir}`);
178
187
  }
179
- if (baseDir.startsWith("/")) {
180
- throw new Error(`baseDir must be a relative path. Absolute path not allowed: ${baseDir}`);
181
- }
182
- if (/^[a-zA-Z]:[/\\]/.test(baseDir)) {
183
- throw new Error(`baseDir must be a relative path. Absolute path not allowed: ${baseDir}`);
184
- }
185
- const normalized = (0, import_node_path.resolve)(".", baseDir);
186
- const rel = (0, import_node_path.relative)(".", normalized);
188
+ const normalized = (0, import_node_path.resolve)(baseDir);
189
+ const rel = (0, import_node_path.relative)(process.cwd(), normalized);
187
190
  if (rel.startsWith("..")) {
188
191
  throw new Error(`baseDir cannot contain directory traversal (..): ${baseDir}`);
189
192
  }
@@ -319,7 +322,7 @@ var AiFile = class {
319
322
  */
320
323
  global;
321
324
  constructor({
322
- baseDir = ".",
325
+ baseDir = process.cwd(),
323
326
  relativeDirPath,
324
327
  relativeFilePath,
325
328
  fileContent,
@@ -476,7 +479,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
476
479
  throw new Error("Not implemented because it is a SIMULATED file.");
477
480
  }
478
481
  static fromRulesyncCommandDefault({
479
- baseDir = ".",
482
+ baseDir = process.cwd(),
480
483
  rulesyncCommand,
481
484
  validate = true
482
485
  }) {
@@ -511,7 +514,7 @@ var SimulatedCommand = class _SimulatedCommand extends ToolCommand {
511
514
  }
512
515
  }
513
516
  static async fromFileDefault({
514
- baseDir = ".",
517
+ baseDir = process.cwd(),
515
518
  relativeFilePath,
516
519
  validate = true
517
520
  }) {
@@ -545,7 +548,7 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
545
548
  };
546
549
  }
547
550
  static fromRulesyncCommand({
548
- baseDir = ".",
551
+ baseDir = process.cwd(),
549
552
  rulesyncCommand,
550
553
  validate = true
551
554
  }) {
@@ -554,7 +557,7 @@ var AgentsmdCommand = class _AgentsmdCommand extends SimulatedCommand {
554
557
  );
555
558
  }
556
559
  static async fromFile({
557
- baseDir = ".",
560
+ baseDir = process.cwd(),
558
561
  relativeFilePath,
559
562
  validate = true
560
563
  }) {
@@ -643,7 +646,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
643
646
  const result = RulesyncCommandFrontmatterSchema.safeParse(frontmatter);
644
647
  if (!result.success) {
645
648
  throw new Error(
646
- `Invalid frontmatter in ${(0, import_node_path5.join)(rest.baseDir ?? ".", rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
649
+ `Invalid frontmatter in ${(0, import_node_path5.join)(rest.baseDir ?? process.cwd(), rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
647
650
  );
648
651
  }
649
652
  }
@@ -694,7 +697,7 @@ var RulesyncCommand = class _RulesyncCommand extends RulesyncFile {
694
697
  }
695
698
  const filename = (0, import_node_path5.basename)(relativeFilePath);
696
699
  return new _RulesyncCommand({
697
- baseDir: ".",
700
+ baseDir: process.cwd(),
698
701
  relativeDirPath: _RulesyncCommand.getSettablePaths().relativeDirPath,
699
702
  relativeFilePath: filename,
700
703
  frontmatter: result.data,
@@ -756,7 +759,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
756
759
  });
757
760
  }
758
761
  static fromRulesyncCommand({
759
- baseDir = ".",
762
+ baseDir = process.cwd(),
760
763
  rulesyncCommand,
761
764
  validate = true,
762
765
  global = false
@@ -799,7 +802,7 @@ var ClaudecodeCommand = class _ClaudecodeCommand extends ToolCommand {
799
802
  });
800
803
  }
801
804
  static async fromFile({
802
- baseDir = ".",
805
+ baseDir = process.cwd(),
803
806
  relativeFilePath,
804
807
  validate = true,
805
808
  global = false
@@ -851,7 +854,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
851
854
  });
852
855
  }
853
856
  static fromRulesyncCommand({
854
- baseDir = ".",
857
+ baseDir = process.cwd(),
855
858
  rulesyncCommand,
856
859
  validate = true,
857
860
  global = false
@@ -878,7 +881,7 @@ var CodexcliCommand = class _CodexcliCommand extends ToolCommand {
878
881
  });
879
882
  }
880
883
  static async fromFile({
881
- baseDir = ".",
884
+ baseDir = process.cwd(),
882
885
  relativeFilePath,
883
886
  validate = true,
884
887
  global = false
@@ -942,7 +945,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
942
945
  const originalFilePath = this.relativeFilePath;
943
946
  const relativeFilePath = originalFilePath.replace(/\.prompt\.md$/, ".md");
944
947
  return new RulesyncCommand({
945
- baseDir: ".",
948
+ baseDir: this.baseDir,
946
949
  frontmatter: rulesyncFrontmatter,
947
950
  body: this.body,
948
951
  relativeDirPath: RulesyncCommand.getSettablePaths().relativeDirPath,
@@ -968,7 +971,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
968
971
  }
969
972
  }
970
973
  static fromRulesyncCommand({
971
- baseDir = ".",
974
+ baseDir = process.cwd(),
972
975
  rulesyncCommand,
973
976
  validate = true
974
977
  }) {
@@ -991,7 +994,7 @@ var CopilotCommand = class _CopilotCommand extends ToolCommand {
991
994
  });
992
995
  }
993
996
  static async fromFile({
994
- baseDir = ".",
997
+ baseDir = process.cwd(),
995
998
  relativeFilePath,
996
999
  validate = true
997
1000
  }) {
@@ -1034,7 +1037,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
1034
1037
  description: ""
1035
1038
  };
1036
1039
  return new RulesyncCommand({
1037
- baseDir: ".",
1040
+ baseDir: process.cwd(),
1038
1041
  // RulesyncCommand baseDir is always the project root directory
1039
1042
  frontmatter: rulesyncFrontmatter,
1040
1043
  body: this.getFileContent(),
@@ -1045,7 +1048,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
1045
1048
  });
1046
1049
  }
1047
1050
  static fromRulesyncCommand({
1048
- baseDir = ".",
1051
+ baseDir = process.cwd(),
1049
1052
  rulesyncCommand,
1050
1053
  validate = true,
1051
1054
  global = false
@@ -1072,7 +1075,7 @@ var CursorCommand = class _CursorCommand extends ToolCommand {
1072
1075
  });
1073
1076
  }
1074
1077
  static async fromFile({
1075
- baseDir = ".",
1078
+ baseDir = process.cwd(),
1076
1079
  relativeFilePath,
1077
1080
  validate = true,
1078
1081
  global = false
@@ -1146,7 +1149,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
1146
1149
  };
1147
1150
  const fileContent = stringifyFrontmatter(this.body, rulesyncFrontmatter);
1148
1151
  return new RulesyncCommand({
1149
- baseDir: ".",
1152
+ baseDir: process.cwd(),
1150
1153
  // RulesyncCommand baseDir is always the project root directory
1151
1154
  frontmatter: rulesyncFrontmatter,
1152
1155
  body: this.body,
@@ -1157,7 +1160,7 @@ var GeminiCliCommand = class _GeminiCliCommand extends ToolCommand {
1157
1160
  });
1158
1161
  }
1159
1162
  static fromRulesyncCommand({
1160
- baseDir = ".",
1163
+ baseDir = process.cwd(),
1161
1164
  rulesyncCommand,
1162
1165
  validate = true,
1163
1166
  global = false
@@ -1181,7 +1184,7 @@ ${geminiFrontmatter.prompt}
1181
1184
  });
1182
1185
  }
1183
1186
  static async fromFile({
1184
- baseDir = ".",
1187
+ baseDir = process.cwd(),
1185
1188
  relativeFilePath,
1186
1189
  validate = true,
1187
1190
  global = false
@@ -1268,7 +1271,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1268
1271
  });
1269
1272
  }
1270
1273
  static fromRulesyncCommand({
1271
- baseDir = ".",
1274
+ baseDir = process.cwd(),
1272
1275
  rulesyncCommand,
1273
1276
  validate = true
1274
1277
  }) {
@@ -1311,7 +1314,7 @@ var RooCommand = class _RooCommand extends ToolCommand {
1311
1314
  });
1312
1315
  }
1313
1316
  static async fromFile({
1314
- baseDir = ".",
1317
+ baseDir = process.cwd(),
1315
1318
  relativeFilePath,
1316
1319
  validate = true
1317
1320
  }) {
@@ -1654,9 +1657,28 @@ var CommandsProcessor = class extends FeatureProcessor {
1654
1657
 
1655
1658
  // src/config/config-resolver.ts
1656
1659
  var import_node_path13 = require("path");
1657
- var import_c12 = require("c12");
1660
+ var import_jsonc_parser = require("jsonc-parser");
1658
1661
 
1659
1662
  // src/config/config.ts
1663
+ var import_mini10 = require("zod/mini");
1664
+ var ConfigParamsSchema = import_mini10.z.object({
1665
+ baseDirs: import_mini10.z.array(import_mini10.z.string()),
1666
+ targets: RulesyncTargetsSchema,
1667
+ features: RulesyncFeaturesSchema,
1668
+ verbose: import_mini10.z.boolean(),
1669
+ delete: import_mini10.z.boolean(),
1670
+ // New non-experimental options
1671
+ global: (0, import_mini10.optional)(import_mini10.z.boolean()),
1672
+ simulatedCommands: (0, import_mini10.optional)(import_mini10.z.boolean()),
1673
+ simulatedSubagents: (0, import_mini10.optional)(import_mini10.z.boolean()),
1674
+ modularMcp: (0, import_mini10.optional)(import_mini10.z.boolean()),
1675
+ // Deprecated experimental options (for backward compatibility)
1676
+ experimentalGlobal: (0, import_mini10.optional)(import_mini10.z.boolean()),
1677
+ experimentalSimulateCommands: (0, import_mini10.optional)(import_mini10.z.boolean()),
1678
+ experimentalSimulateSubagents: (0, import_mini10.optional)(import_mini10.z.boolean())
1679
+ });
1680
+ var PartialConfigParamsSchema = import_mini10.z.partial(ConfigParamsSchema);
1681
+ var RequiredConfigParamsSchema = import_mini10.z.required(ConfigParamsSchema);
1660
1682
  var Config = class {
1661
1683
  baseDirs;
1662
1684
  targets;
@@ -1745,7 +1767,7 @@ var defaults = {
1745
1767
  features: ["rules"],
1746
1768
  verbose: false,
1747
1769
  delete: false,
1748
- baseDirs: ["."],
1770
+ baseDirs: [process.cwd()],
1749
1771
  configPath: "rulesync.jsonc",
1750
1772
  global: false,
1751
1773
  simulatedCommands: false,
@@ -1771,46 +1793,18 @@ var ConfigResolver = class {
1771
1793
  experimentalSimulateCommands,
1772
1794
  experimentalSimulateSubagents
1773
1795
  }) {
1774
- if (!await fileExists(configPath)) {
1775
- if (experimentalGlobal !== void 0) {
1776
- warnDeprecatedOptions({ experimentalGlobal });
1777
- }
1778
- if (experimentalSimulateCommands !== void 0) {
1779
- warnDeprecatedOptions({ experimentalSimulateCommands });
1780
- }
1781
- if (experimentalSimulateSubagents !== void 0) {
1782
- warnDeprecatedOptions({ experimentalSimulateSubagents });
1796
+ const validatedConfigPath = resolvePath(configPath, process.cwd());
1797
+ let configByFile = {};
1798
+ if (await fileExists(validatedConfigPath)) {
1799
+ try {
1800
+ const fileContent = await readFileContent(validatedConfigPath);
1801
+ const jsonData = (0, import_jsonc_parser.parse)(fileContent);
1802
+ configByFile = PartialConfigParamsSchema.parse(jsonData);
1803
+ } catch (error) {
1804
+ logger.error(`Failed to load config file: ${formatError(error)}`);
1805
+ throw error;
1783
1806
  }
1784
- const resolvedGlobal2 = global ?? experimentalGlobal ?? defaults.global;
1785
- const resolvedSimulatedCommands2 = simulatedCommands ?? experimentalSimulateCommands ?? defaults.simulatedCommands;
1786
- const resolvedSimulatedSubagents2 = simulatedSubagents ?? experimentalSimulateSubagents ?? defaults.simulatedSubagents;
1787
- return new Config({
1788
- targets: targets ?? defaults.targets,
1789
- features: features ?? defaults.features,
1790
- verbose: verbose ?? defaults.verbose,
1791
- delete: isDelete ?? defaults.delete,
1792
- baseDirs: getBaseDirsInLightOfGlobal({
1793
- baseDirs: baseDirs ?? defaults.baseDirs,
1794
- global: resolvedGlobal2
1795
- }),
1796
- global: resolvedGlobal2,
1797
- simulatedCommands: resolvedSimulatedCommands2,
1798
- simulatedSubagents: resolvedSimulatedSubagents2,
1799
- modularMcp: modularMcp ?? defaults.modularMcp
1800
- });
1801
- }
1802
- const loadOptions = {
1803
- name: "rulesync",
1804
- cwd: process.cwd(),
1805
- rcFile: false,
1806
- // Disable rc file lookup
1807
- configFile: "rulesync"
1808
- // Will look for rulesync.jsonc, rulesync.ts, etc.
1809
- };
1810
- if (configPath) {
1811
- loadOptions.configFile = configPath;
1812
1807
  }
1813
- const { config: configByFile } = await (0, import_c12.loadConfig)(loadOptions);
1814
1808
  const deprecatedGlobal = experimentalGlobal ?? configByFile.experimentalGlobal;
1815
1809
  const deprecatedCommands = experimentalSimulateCommands ?? configByFile.experimentalSimulateCommands;
1816
1810
  const deprecatedSubagents = experimentalSimulateSubagents ?? configByFile.experimentalSimulateSubagents;
@@ -1866,29 +1860,28 @@ function getBaseDirsInLightOfGlobal({
1866
1860
  baseDirs,
1867
1861
  global
1868
1862
  }) {
1869
- if (isEnvTest) {
1870
- return baseDirs.map((baseDir) => (0, import_node_path13.join)(".", baseDir));
1871
- }
1872
1863
  if (global) {
1873
1864
  return [getHomeDirectory()];
1874
1865
  }
1875
- baseDirs.forEach((baseDir) => {
1866
+ const resolvedBaseDirs = baseDirs.map((baseDir) => (0, import_node_path13.resolve)(baseDir));
1867
+ resolvedBaseDirs.forEach((baseDir) => {
1876
1868
  validateBaseDir(baseDir);
1877
1869
  });
1878
- return baseDirs;
1870
+ return resolvedBaseDirs;
1879
1871
  }
1880
1872
 
1881
1873
  // src/ignore/ignore-processor.ts
1882
- var import_mini10 = require("zod/mini");
1874
+ var import_mini11 = require("zod/mini");
1883
1875
 
1884
1876
  // src/ignore/amazonqcli-ignore.ts
1885
- var import_node_path14 = require("path");
1877
+ var import_node_path15 = require("path");
1886
1878
 
1887
1879
  // src/types/tool-file.ts
1888
1880
  var ToolFile = class extends AiFile {
1889
1881
  };
1890
1882
 
1891
1883
  // src/ignore/rulesync-ignore.ts
1884
+ var import_node_path14 = require("path");
1892
1885
  var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
1893
1886
  validate() {
1894
1887
  return { success: true, error: null };
@@ -1900,9 +1893,11 @@ var RulesyncIgnore = class _RulesyncIgnore extends RulesyncFile {
1900
1893
  };
1901
1894
  }
1902
1895
  static async fromFile() {
1903
- const fileContent = await readFileContent(this.getSettablePaths().relativeFilePath);
1896
+ const baseDir = process.cwd();
1897
+ const filePath = (0, import_node_path14.join)(baseDir, this.getSettablePaths().relativeFilePath);
1898
+ const fileContent = await readFileContent(filePath);
1904
1899
  return new _RulesyncIgnore({
1905
- baseDir: ".",
1900
+ baseDir,
1906
1901
  relativeDirPath: this.getSettablePaths().relativeDirPath,
1907
1902
  relativeFilePath: this.getSettablePaths().relativeFilePath,
1908
1903
  fileContent
@@ -1970,7 +1965,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
1970
1965
  * Supports conversion from unified rulesync format to Amazon Q CLI specific format
1971
1966
  */
1972
1967
  static fromRulesyncIgnore({
1973
- baseDir = ".",
1968
+ baseDir = process.cwd(),
1974
1969
  rulesyncIgnore
1975
1970
  }) {
1976
1971
  const body = rulesyncIgnore.getFileContent();
@@ -1986,11 +1981,11 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
1986
1981
  * Supports both proposed .q-ignore and .amazonqignore formats
1987
1982
  */
1988
1983
  static async fromFile({
1989
- baseDir = ".",
1984
+ baseDir = process.cwd(),
1990
1985
  validate = true
1991
1986
  }) {
1992
1987
  const fileContent = await readFileContent(
1993
- (0, import_node_path14.join)(
1988
+ (0, import_node_path15.join)(
1994
1989
  baseDir,
1995
1990
  this.getSettablePaths().relativeDirPath,
1996
1991
  this.getSettablePaths().relativeFilePath
@@ -2007,7 +2002,7 @@ var AmazonqcliIgnore = class _AmazonqcliIgnore extends ToolIgnore {
2007
2002
  };
2008
2003
 
2009
2004
  // src/ignore/augmentcode-ignore.ts
2010
- var import_node_path15 = require("path");
2005
+ var import_node_path16 = require("path");
2011
2006
  var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
2012
2007
  static getSettablePaths() {
2013
2008
  return {
@@ -2026,7 +2021,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
2026
2021
  * Supports conversion from unified rulesync format to AugmentCode specific format
2027
2022
  */
2028
2023
  static fromRulesyncIgnore({
2029
- baseDir = ".",
2024
+ baseDir = process.cwd(),
2030
2025
  rulesyncIgnore
2031
2026
  }) {
2032
2027
  return new _AugmentcodeIgnore({
@@ -2041,11 +2036,11 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
2041
2036
  * Reads and parses .augmentignore file
2042
2037
  */
2043
2038
  static async fromFile({
2044
- baseDir = ".",
2039
+ baseDir = process.cwd(),
2045
2040
  validate = true
2046
2041
  }) {
2047
2042
  const fileContent = await readFileContent(
2048
- (0, import_node_path15.join)(
2043
+ (0, import_node_path16.join)(
2049
2044
  baseDir,
2050
2045
  this.getSettablePaths().relativeDirPath,
2051
2046
  this.getSettablePaths().relativeFilePath
@@ -2062,7 +2057,7 @@ var AugmentcodeIgnore = class _AugmentcodeIgnore extends ToolIgnore {
2062
2057
  };
2063
2058
 
2064
2059
  // src/ignore/claudecode-ignore.ts
2065
- var import_node_path16 = require("path");
2060
+ var import_node_path17 = require("path");
2066
2061
  var import_es_toolkit = require("es-toolkit");
2067
2062
  var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
2068
2063
  constructor(params) {
@@ -2092,13 +2087,13 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
2092
2087
  });
2093
2088
  }
2094
2089
  static async fromRulesyncIgnore({
2095
- baseDir = ".",
2090
+ baseDir = process.cwd(),
2096
2091
  rulesyncIgnore
2097
2092
  }) {
2098
2093
  const fileContent = rulesyncIgnore.getFileContent();
2099
2094
  const patterns = fileContent.split(/\r?\n|\r/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
2100
2095
  const deniedValues = patterns.map((pattern) => `Read(${pattern})`);
2101
- const filePath = (0, import_node_path16.join)(
2096
+ const filePath = (0, import_node_path17.join)(
2102
2097
  baseDir,
2103
2098
  this.getSettablePaths().relativeDirPath,
2104
2099
  this.getSettablePaths().relativeFilePath
@@ -2122,11 +2117,11 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
2122
2117
  });
2123
2118
  }
2124
2119
  static async fromFile({
2125
- baseDir = ".",
2120
+ baseDir = process.cwd(),
2126
2121
  validate = true
2127
2122
  }) {
2128
2123
  const fileContent = await readFileContent(
2129
- (0, import_node_path16.join)(
2124
+ (0, import_node_path17.join)(
2130
2125
  baseDir,
2131
2126
  this.getSettablePaths().relativeDirPath,
2132
2127
  this.getSettablePaths().relativeFilePath
@@ -2143,7 +2138,7 @@ var ClaudecodeIgnore = class _ClaudecodeIgnore extends ToolIgnore {
2143
2138
  };
2144
2139
 
2145
2140
  // src/ignore/cline-ignore.ts
2146
- var import_node_path17 = require("path");
2141
+ var import_node_path18 = require("path");
2147
2142
  var ClineIgnore = class _ClineIgnore extends ToolIgnore {
2148
2143
  static getSettablePaths() {
2149
2144
  return {
@@ -2161,7 +2156,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
2161
2156
  * Create ClineIgnore from RulesyncIgnore
2162
2157
  */
2163
2158
  static fromRulesyncIgnore({
2164
- baseDir = ".",
2159
+ baseDir = process.cwd(),
2165
2160
  rulesyncIgnore
2166
2161
  }) {
2167
2162
  const body = rulesyncIgnore.getFileContent();
@@ -2176,11 +2171,11 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
2176
2171
  * Load ClineIgnore from .clineignore file
2177
2172
  */
2178
2173
  static async fromFile({
2179
- baseDir = ".",
2174
+ baseDir = process.cwd(),
2180
2175
  validate = true
2181
2176
  }) {
2182
2177
  const fileContent = await readFileContent(
2183
- (0, import_node_path17.join)(
2178
+ (0, import_node_path18.join)(
2184
2179
  baseDir,
2185
2180
  this.getSettablePaths().relativeDirPath,
2186
2181
  this.getSettablePaths().relativeFilePath
@@ -2197,7 +2192,7 @@ var ClineIgnore = class _ClineIgnore extends ToolIgnore {
2197
2192
  };
2198
2193
 
2199
2194
  // src/ignore/cursor-ignore.ts
2200
- var import_node_path18 = require("path");
2195
+ var import_node_path19 = require("path");
2201
2196
  var CursorIgnore = class _CursorIgnore extends ToolIgnore {
2202
2197
  static getSettablePaths() {
2203
2198
  return {
@@ -2214,7 +2209,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
2214
2209
  });
2215
2210
  }
2216
2211
  static fromRulesyncIgnore({
2217
- baseDir = ".",
2212
+ baseDir = process.cwd(),
2218
2213
  rulesyncIgnore
2219
2214
  }) {
2220
2215
  const body = rulesyncIgnore.getFileContent();
@@ -2226,11 +2221,11 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
2226
2221
  });
2227
2222
  }
2228
2223
  static async fromFile({
2229
- baseDir = ".",
2224
+ baseDir = process.cwd(),
2230
2225
  validate = true
2231
2226
  }) {
2232
2227
  const fileContent = await readFileContent(
2233
- (0, import_node_path18.join)(
2228
+ (0, import_node_path19.join)(
2234
2229
  baseDir,
2235
2230
  this.getSettablePaths().relativeDirPath,
2236
2231
  this.getSettablePaths().relativeFilePath
@@ -2247,7 +2242,7 @@ var CursorIgnore = class _CursorIgnore extends ToolIgnore {
2247
2242
  };
2248
2243
 
2249
2244
  // src/ignore/geminicli-ignore.ts
2250
- var import_node_path19 = require("path");
2245
+ var import_node_path20 = require("path");
2251
2246
  var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
2252
2247
  static getSettablePaths() {
2253
2248
  return {
@@ -2259,7 +2254,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
2259
2254
  return this.toRulesyncIgnoreDefault();
2260
2255
  }
2261
2256
  static fromRulesyncIgnore({
2262
- baseDir = ".",
2257
+ baseDir = process.cwd(),
2263
2258
  rulesyncIgnore
2264
2259
  }) {
2265
2260
  return new _GeminiCliIgnore({
@@ -2270,11 +2265,11 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
2270
2265
  });
2271
2266
  }
2272
2267
  static async fromFile({
2273
- baseDir = ".",
2268
+ baseDir = process.cwd(),
2274
2269
  validate = true
2275
2270
  }) {
2276
2271
  const fileContent = await readFileContent(
2277
- (0, import_node_path19.join)(
2272
+ (0, import_node_path20.join)(
2278
2273
  baseDir,
2279
2274
  this.getSettablePaths().relativeDirPath,
2280
2275
  this.getSettablePaths().relativeFilePath
@@ -2291,7 +2286,7 @@ var GeminiCliIgnore = class _GeminiCliIgnore extends ToolIgnore {
2291
2286
  };
2292
2287
 
2293
2288
  // src/ignore/junie-ignore.ts
2294
- var import_node_path20 = require("path");
2289
+ var import_node_path21 = require("path");
2295
2290
  var JunieIgnore = class _JunieIgnore extends ToolIgnore {
2296
2291
  static getSettablePaths() {
2297
2292
  return {
@@ -2303,7 +2298,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
2303
2298
  return this.toRulesyncIgnoreDefault();
2304
2299
  }
2305
2300
  static fromRulesyncIgnore({
2306
- baseDir = ".",
2301
+ baseDir = process.cwd(),
2307
2302
  rulesyncIgnore
2308
2303
  }) {
2309
2304
  return new _JunieIgnore({
@@ -2314,11 +2309,11 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
2314
2309
  });
2315
2310
  }
2316
2311
  static async fromFile({
2317
- baseDir = ".",
2312
+ baseDir = process.cwd(),
2318
2313
  validate = true
2319
2314
  }) {
2320
2315
  const fileContent = await readFileContent(
2321
- (0, import_node_path20.join)(
2316
+ (0, import_node_path21.join)(
2322
2317
  baseDir,
2323
2318
  this.getSettablePaths().relativeDirPath,
2324
2319
  this.getSettablePaths().relativeFilePath
@@ -2335,7 +2330,7 @@ var JunieIgnore = class _JunieIgnore extends ToolIgnore {
2335
2330
  };
2336
2331
 
2337
2332
  // src/ignore/kiro-ignore.ts
2338
- var import_node_path21 = require("path");
2333
+ var import_node_path22 = require("path");
2339
2334
  var KiroIgnore = class _KiroIgnore extends ToolIgnore {
2340
2335
  static getSettablePaths() {
2341
2336
  return {
@@ -2347,7 +2342,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
2347
2342
  return this.toRulesyncIgnoreDefault();
2348
2343
  }
2349
2344
  static fromRulesyncIgnore({
2350
- baseDir = ".",
2345
+ baseDir = process.cwd(),
2351
2346
  rulesyncIgnore
2352
2347
  }) {
2353
2348
  return new _KiroIgnore({
@@ -2358,11 +2353,11 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
2358
2353
  });
2359
2354
  }
2360
2355
  static async fromFile({
2361
- baseDir = ".",
2356
+ baseDir = process.cwd(),
2362
2357
  validate = true
2363
2358
  }) {
2364
2359
  const fileContent = await readFileContent(
2365
- (0, import_node_path21.join)(
2360
+ (0, import_node_path22.join)(
2366
2361
  baseDir,
2367
2362
  this.getSettablePaths().relativeDirPath,
2368
2363
  this.getSettablePaths().relativeFilePath
@@ -2379,7 +2374,7 @@ var KiroIgnore = class _KiroIgnore extends ToolIgnore {
2379
2374
  };
2380
2375
 
2381
2376
  // src/ignore/qwencode-ignore.ts
2382
- var import_node_path22 = require("path");
2377
+ var import_node_path23 = require("path");
2383
2378
  var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
2384
2379
  static getSettablePaths() {
2385
2380
  return {
@@ -2391,7 +2386,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
2391
2386
  return this.toRulesyncIgnoreDefault();
2392
2387
  }
2393
2388
  static fromRulesyncIgnore({
2394
- baseDir = ".",
2389
+ baseDir = process.cwd(),
2395
2390
  rulesyncIgnore
2396
2391
  }) {
2397
2392
  return new _QwencodeIgnore({
@@ -2402,11 +2397,11 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
2402
2397
  });
2403
2398
  }
2404
2399
  static async fromFile({
2405
- baseDir = ".",
2400
+ baseDir = process.cwd(),
2406
2401
  validate = true
2407
2402
  }) {
2408
2403
  const fileContent = await readFileContent(
2409
- (0, import_node_path22.join)(
2404
+ (0, import_node_path23.join)(
2410
2405
  baseDir,
2411
2406
  this.getSettablePaths().relativeDirPath,
2412
2407
  this.getSettablePaths().relativeFilePath
@@ -2423,7 +2418,7 @@ var QwencodeIgnore = class _QwencodeIgnore extends ToolIgnore {
2423
2418
  };
2424
2419
 
2425
2420
  // src/ignore/roo-ignore.ts
2426
- var import_node_path23 = require("path");
2421
+ var import_node_path24 = require("path");
2427
2422
  var RooIgnore = class _RooIgnore extends ToolIgnore {
2428
2423
  static getSettablePaths() {
2429
2424
  return {
@@ -2435,7 +2430,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
2435
2430
  return this.toRulesyncIgnoreDefault();
2436
2431
  }
2437
2432
  static fromRulesyncIgnore({
2438
- baseDir = ".",
2433
+ baseDir = process.cwd(),
2439
2434
  rulesyncIgnore
2440
2435
  }) {
2441
2436
  return new _RooIgnore({
@@ -2446,11 +2441,11 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
2446
2441
  });
2447
2442
  }
2448
2443
  static async fromFile({
2449
- baseDir = ".",
2444
+ baseDir = process.cwd(),
2450
2445
  validate = true
2451
2446
  }) {
2452
2447
  const fileContent = await readFileContent(
2453
- (0, import_node_path23.join)(
2448
+ (0, import_node_path24.join)(
2454
2449
  baseDir,
2455
2450
  this.getSettablePaths().relativeDirPath,
2456
2451
  this.getSettablePaths().relativeFilePath
@@ -2467,7 +2462,7 @@ var RooIgnore = class _RooIgnore extends ToolIgnore {
2467
2462
  };
2468
2463
 
2469
2464
  // src/ignore/windsurf-ignore.ts
2470
- var import_node_path24 = require("path");
2465
+ var import_node_path25 = require("path");
2471
2466
  var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
2472
2467
  static getSettablePaths() {
2473
2468
  return {
@@ -2479,7 +2474,7 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
2479
2474
  return this.toRulesyncIgnoreDefault();
2480
2475
  }
2481
2476
  static fromRulesyncIgnore({
2482
- baseDir = ".",
2477
+ baseDir = process.cwd(),
2483
2478
  rulesyncIgnore
2484
2479
  }) {
2485
2480
  return new _WindsurfIgnore({
@@ -2490,11 +2485,11 @@ var WindsurfIgnore = class _WindsurfIgnore extends ToolIgnore {
2490
2485
  });
2491
2486
  }
2492
2487
  static async fromFile({
2493
- baseDir = ".",
2488
+ baseDir = process.cwd(),
2494
2489
  validate = true
2495
2490
  }) {
2496
2491
  const fileContent = await readFileContent(
2497
- (0, import_node_path24.join)(
2492
+ (0, import_node_path25.join)(
2498
2493
  baseDir,
2499
2494
  this.getSettablePaths().relativeDirPath,
2500
2495
  this.getSettablePaths().relativeFilePath
@@ -2524,7 +2519,7 @@ var ignoreProcessorToolTargets = [
2524
2519
  "roo",
2525
2520
  "windsurf"
2526
2521
  ];
2527
- var IgnoreProcessorToolTargetSchema = import_mini10.z.enum(ignoreProcessorToolTargets);
2522
+ var IgnoreProcessorToolTargetSchema = import_mini11.z.enum(ignoreProcessorToolTargets);
2528
2523
  var IgnoreProcessor = class extends FeatureProcessor {
2529
2524
  toolTarget;
2530
2525
  constructor({
@@ -2699,45 +2694,45 @@ var IgnoreProcessor = class extends FeatureProcessor {
2699
2694
  };
2700
2695
 
2701
2696
  // src/mcp/mcp-processor.ts
2702
- var import_mini12 = require("zod/mini");
2697
+ var import_mini13 = require("zod/mini");
2703
2698
 
2704
2699
  // src/mcp/amazonqcli-mcp.ts
2705
- var import_node_path26 = require("path");
2700
+ var import_node_path27 = require("path");
2706
2701
 
2707
2702
  // src/mcp/rulesync-mcp.ts
2708
- var import_node_path25 = require("path");
2703
+ var import_node_path26 = require("path");
2709
2704
  var import_object = require("es-toolkit/object");
2710
- var import_mini11 = require("zod/mini");
2711
- var McpTransportTypeSchema = import_mini11.z.enum(["stdio", "sse", "http"]);
2712
- var McpServerBaseSchema = import_mini11.z.object({
2713
- type: import_mini11.z.optional(import_mini11.z.enum(["stdio", "sse", "http"])),
2714
- command: import_mini11.z.optional(import_mini11.z.union([import_mini11.z.string(), import_mini11.z.array(import_mini11.z.string())])),
2715
- args: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
2716
- url: import_mini11.z.optional(import_mini11.z.string()),
2717
- httpUrl: import_mini11.z.optional(import_mini11.z.string()),
2718
- env: import_mini11.z.optional(import_mini11.z.record(import_mini11.z.string(), import_mini11.z.string())),
2719
- disabled: import_mini11.z.optional(import_mini11.z.boolean()),
2720
- networkTimeout: import_mini11.z.optional(import_mini11.z.number()),
2721
- timeout: import_mini11.z.optional(import_mini11.z.number()),
2722
- trust: import_mini11.z.optional(import_mini11.z.boolean()),
2723
- cwd: import_mini11.z.optional(import_mini11.z.string()),
2724
- transport: import_mini11.z.optional(McpTransportTypeSchema),
2725
- alwaysAllow: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
2726
- tools: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
2727
- kiroAutoApprove: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
2728
- kiroAutoBlock: import_mini11.z.optional(import_mini11.z.array(import_mini11.z.string())),
2729
- headers: import_mini11.z.optional(import_mini11.z.record(import_mini11.z.string(), import_mini11.z.string()))
2705
+ var import_mini12 = require("zod/mini");
2706
+ var McpTransportTypeSchema = import_mini12.z.enum(["stdio", "sse", "http"]);
2707
+ var McpServerBaseSchema = import_mini12.z.object({
2708
+ type: import_mini12.z.optional(import_mini12.z.enum(["stdio", "sse", "http"])),
2709
+ command: import_mini12.z.optional(import_mini12.z.union([import_mini12.z.string(), import_mini12.z.array(import_mini12.z.string())])),
2710
+ args: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2711
+ url: import_mini12.z.optional(import_mini12.z.string()),
2712
+ httpUrl: import_mini12.z.optional(import_mini12.z.string()),
2713
+ env: import_mini12.z.optional(import_mini12.z.record(import_mini12.z.string(), import_mini12.z.string())),
2714
+ disabled: import_mini12.z.optional(import_mini12.z.boolean()),
2715
+ networkTimeout: import_mini12.z.optional(import_mini12.z.number()),
2716
+ timeout: import_mini12.z.optional(import_mini12.z.number()),
2717
+ trust: import_mini12.z.optional(import_mini12.z.boolean()),
2718
+ cwd: import_mini12.z.optional(import_mini12.z.string()),
2719
+ transport: import_mini12.z.optional(McpTransportTypeSchema),
2720
+ alwaysAllow: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2721
+ tools: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2722
+ kiroAutoApprove: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2723
+ kiroAutoBlock: import_mini12.z.optional(import_mini12.z.array(import_mini12.z.string())),
2724
+ headers: import_mini12.z.optional(import_mini12.z.record(import_mini12.z.string(), import_mini12.z.string()))
2730
2725
  });
2731
- var ModularMcpServerSchema = import_mini11.z.extend(McpServerBaseSchema, {
2732
- description: import_mini11.z.string().check(import_mini11.z.minLength(1))
2726
+ var ModularMcpServerSchema = import_mini12.z.extend(McpServerBaseSchema, {
2727
+ description: import_mini12.z.string().check(import_mini12.z.minLength(1))
2733
2728
  });
2734
- var ModularMcpServersSchema = import_mini11.z.record(import_mini11.z.string(), ModularMcpServerSchema);
2735
- var RulesyncMcpServersSchema = import_mini11.z.extend(McpServerBaseSchema, {
2736
- description: import_mini11.z.optional(import_mini11.z.string()),
2737
- targets: import_mini11.z.optional(RulesyncTargetsSchema)
2729
+ var ModularMcpServersSchema = import_mini12.z.record(import_mini12.z.string(), ModularMcpServerSchema);
2730
+ var RulesyncMcpServersSchema = import_mini12.z.extend(McpServerBaseSchema, {
2731
+ description: import_mini12.z.optional(import_mini12.z.string()),
2732
+ targets: import_mini12.z.optional(RulesyncTargetsSchema)
2738
2733
  });
2739
- var RulesyncMcpConfigSchema = import_mini11.z.object({
2740
- mcpServers: import_mini11.z.record(import_mini11.z.string(), RulesyncMcpServersSchema)
2734
+ var RulesyncMcpConfigSchema = import_mini12.z.object({
2735
+ mcpServers: import_mini12.z.record(import_mini12.z.string(), RulesyncMcpServersSchema)
2741
2736
  });
2742
2737
  var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2743
2738
  json;
@@ -2783,16 +2778,18 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2783
2778
  validate = true,
2784
2779
  modularMcp = false
2785
2780
  }) {
2781
+ const baseDir = process.cwd();
2786
2782
  const paths = this.getSettablePaths();
2787
- const recommendedPath = (0, import_node_path25.join)(
2783
+ const recommendedPath = (0, import_node_path26.join)(
2784
+ baseDir,
2788
2785
  paths.recommended.relativeDirPath,
2789
2786
  paths.recommended.relativeFilePath
2790
2787
  );
2791
- const legacyPath = (0, import_node_path25.join)(paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
2788
+ const legacyPath = (0, import_node_path26.join)(baseDir, paths.legacy.relativeDirPath, paths.legacy.relativeFilePath);
2792
2789
  if (await fileExists(recommendedPath)) {
2793
2790
  const fileContent2 = await readFileContent(recommendedPath);
2794
2791
  return new _RulesyncMcp({
2795
- baseDir: ".",
2792
+ baseDir,
2796
2793
  relativeDirPath: paths.recommended.relativeDirPath,
2797
2794
  relativeFilePath: paths.recommended.relativeFilePath,
2798
2795
  fileContent: fileContent2,
@@ -2806,7 +2803,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2806
2803
  );
2807
2804
  const fileContent2 = await readFileContent(legacyPath);
2808
2805
  return new _RulesyncMcp({
2809
- baseDir: ".",
2806
+ baseDir,
2810
2807
  relativeDirPath: paths.legacy.relativeDirPath,
2811
2808
  relativeFilePath: paths.legacy.relativeFilePath,
2812
2809
  fileContent: fileContent2,
@@ -2816,7 +2813,7 @@ var RulesyncMcp = class _RulesyncMcp extends RulesyncFile {
2816
2813
  }
2817
2814
  const fileContent = await readFileContent(recommendedPath);
2818
2815
  return new _RulesyncMcp({
2819
- baseDir: ".",
2816
+ baseDir,
2820
2817
  relativeDirPath: paths.recommended.relativeDirPath,
2821
2818
  relativeFilePath: paths.recommended.relativeFilePath,
2822
2819
  fileContent,
@@ -2903,11 +2900,11 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
2903
2900
  };
2904
2901
  }
2905
2902
  static async fromFile({
2906
- baseDir = ".",
2903
+ baseDir = process.cwd(),
2907
2904
  validate = true
2908
2905
  }) {
2909
2906
  const fileContent = await readFileContent(
2910
- (0, import_node_path26.join)(
2907
+ (0, import_node_path27.join)(
2911
2908
  baseDir,
2912
2909
  this.getSettablePaths().relativeDirPath,
2913
2910
  this.getSettablePaths().relativeFilePath
@@ -2922,7 +2919,7 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
2922
2919
  });
2923
2920
  }
2924
2921
  static fromRulesyncMcp({
2925
- baseDir = ".",
2922
+ baseDir = process.cwd(),
2926
2923
  rulesyncMcp,
2927
2924
  validate = true
2928
2925
  }) {
@@ -2943,10 +2940,10 @@ var AmazonqcliMcp = class _AmazonqcliMcp extends ToolMcp {
2943
2940
  };
2944
2941
 
2945
2942
  // src/mcp/claudecode-mcp.ts
2946
- var import_node_path28 = require("path");
2943
+ var import_node_path29 = require("path");
2947
2944
 
2948
2945
  // src/mcp/modular-mcp.ts
2949
- var import_node_path27 = require("path");
2946
+ var import_node_path28 = require("path");
2950
2947
  var ModularMcp = class _ModularMcp extends AiFile {
2951
2948
  json;
2952
2949
  constructor(params) {
@@ -2977,7 +2974,7 @@ var ModularMcp = class _ModularMcp extends AiFile {
2977
2974
  global,
2978
2975
  relativeDirPath
2979
2976
  } = {
2980
- baseDir: ".",
2977
+ baseDir: process.cwd(),
2981
2978
  global: false,
2982
2979
  relativeDirPath: void 0
2983
2980
  }) {
@@ -3001,14 +2998,14 @@ var ModularMcp = class _ModularMcp extends AiFile {
3001
2998
  args: [
3002
2999
  "-y",
3003
3000
  "@kimuson/modular-mcp",
3004
- (0, import_node_path27.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3001
+ (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3005
3002
  ],
3006
3003
  env: {}
3007
3004
  }
3008
3005
  };
3009
3006
  }
3010
3007
  static fromRulesyncMcp({
3011
- baseDir = ".",
3008
+ baseDir = process.cwd(),
3012
3009
  rulesyncMcp,
3013
3010
  validate = true,
3014
3011
  global = false,
@@ -3056,13 +3053,13 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
3056
3053
  };
3057
3054
  }
3058
3055
  static async fromFile({
3059
- baseDir = ".",
3056
+ baseDir = process.cwd(),
3060
3057
  validate = true,
3061
3058
  global = false
3062
3059
  }) {
3063
3060
  const paths = this.getSettablePaths({ global });
3064
3061
  const fileContent = await readOrInitializeFileContent(
3065
- (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
3062
+ (0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
3066
3063
  JSON.stringify({ mcpServers: {} }, null, 2)
3067
3064
  );
3068
3065
  const json = JSON.parse(fileContent);
@@ -3076,7 +3073,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
3076
3073
  });
3077
3074
  }
3078
3075
  static async fromRulesyncMcp({
3079
- baseDir = ".",
3076
+ baseDir = process.cwd(),
3080
3077
  rulesyncMcp,
3081
3078
  validate = true,
3082
3079
  global = false,
@@ -3084,7 +3081,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
3084
3081
  }) {
3085
3082
  const paths = this.getSettablePaths({ global });
3086
3083
  const fileContent = await readOrInitializeFileContent(
3087
- (0, import_node_path28.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
3084
+ (0, import_node_path29.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
3088
3085
  JSON.stringify({ mcpServers: {} }, null, 2)
3089
3086
  );
3090
3087
  const json = JSON.parse(fileContent);
@@ -3115,7 +3112,7 @@ var ClaudecodeMcp = class _ClaudecodeMcp extends ToolMcp {
3115
3112
  };
3116
3113
 
3117
3114
  // src/mcp/cline-mcp.ts
3118
- var import_node_path29 = require("path");
3115
+ var import_node_path30 = require("path");
3119
3116
  var ClineMcp = class _ClineMcp extends ToolMcp {
3120
3117
  json;
3121
3118
  constructor(params) {
@@ -3132,11 +3129,11 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
3132
3129
  };
3133
3130
  }
3134
3131
  static async fromFile({
3135
- baseDir = ".",
3132
+ baseDir = process.cwd(),
3136
3133
  validate = true
3137
3134
  }) {
3138
3135
  const fileContent = await readFileContent(
3139
- (0, import_node_path29.join)(
3136
+ (0, import_node_path30.join)(
3140
3137
  baseDir,
3141
3138
  this.getSettablePaths().relativeDirPath,
3142
3139
  this.getSettablePaths().relativeFilePath
@@ -3151,7 +3148,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
3151
3148
  });
3152
3149
  }
3153
3150
  static fromRulesyncMcp({
3154
- baseDir = ".",
3151
+ baseDir = process.cwd(),
3155
3152
  rulesyncMcp,
3156
3153
  validate = true
3157
3154
  }) {
@@ -3172,7 +3169,7 @@ var ClineMcp = class _ClineMcp extends ToolMcp {
3172
3169
  };
3173
3170
 
3174
3171
  // src/mcp/codexcli-mcp.ts
3175
- var import_node_path30 = require("path");
3172
+ var import_node_path31 = require("path");
3176
3173
  var smolToml = __toESM(require("smol-toml"), 1);
3177
3174
  var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
3178
3175
  toml;
@@ -3202,13 +3199,13 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
3202
3199
  };
3203
3200
  }
3204
3201
  static async fromFile({
3205
- baseDir = ".",
3202
+ baseDir = process.cwd(),
3206
3203
  validate = true,
3207
3204
  global = false
3208
3205
  }) {
3209
3206
  const paths = this.getSettablePaths({ global });
3210
3207
  const fileContent = await readFileContent(
3211
- (0, import_node_path30.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3208
+ (0, import_node_path31.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath)
3212
3209
  );
3213
3210
  return new _CodexcliMcp({
3214
3211
  baseDir,
@@ -3219,13 +3216,13 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
3219
3216
  });
3220
3217
  }
3221
3218
  static async fromRulesyncMcp({
3222
- baseDir = ".",
3219
+ baseDir = process.cwd(),
3223
3220
  rulesyncMcp,
3224
3221
  validate = true,
3225
3222
  global = false
3226
3223
  }) {
3227
3224
  const paths = this.getSettablePaths({ global });
3228
- const configTomlFilePath = (0, import_node_path30.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3225
+ const configTomlFilePath = (0, import_node_path31.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath);
3229
3226
  const configTomlFileContent = await readOrInitializeFileContent(
3230
3227
  configTomlFilePath,
3231
3228
  smolToml.stringify({})
@@ -3266,7 +3263,7 @@ var CodexcliMcp = class _CodexcliMcp extends ToolMcp {
3266
3263
  };
3267
3264
 
3268
3265
  // src/mcp/copilot-mcp.ts
3269
- var import_node_path31 = require("path");
3266
+ var import_node_path32 = require("path");
3270
3267
  var CopilotMcp = class _CopilotMcp extends ToolMcp {
3271
3268
  json;
3272
3269
  constructor(params) {
@@ -3283,11 +3280,11 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
3283
3280
  };
3284
3281
  }
3285
3282
  static async fromFile({
3286
- baseDir = ".",
3283
+ baseDir = process.cwd(),
3287
3284
  validate = true
3288
3285
  }) {
3289
3286
  const fileContent = await readFileContent(
3290
- (0, import_node_path31.join)(
3287
+ (0, import_node_path32.join)(
3291
3288
  baseDir,
3292
3289
  this.getSettablePaths().relativeDirPath,
3293
3290
  this.getSettablePaths().relativeFilePath
@@ -3302,7 +3299,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
3302
3299
  });
3303
3300
  }
3304
3301
  static fromRulesyncMcp({
3305
- baseDir = ".",
3302
+ baseDir = process.cwd(),
3306
3303
  rulesyncMcp,
3307
3304
  validate = true
3308
3305
  }) {
@@ -3323,7 +3320,7 @@ var CopilotMcp = class _CopilotMcp extends ToolMcp {
3323
3320
  };
3324
3321
 
3325
3322
  // src/mcp/cursor-mcp.ts
3326
- var import_node_path32 = require("path");
3323
+ var import_node_path33 = require("path");
3327
3324
  var CursorMcp = class _CursorMcp extends ToolMcp {
3328
3325
  json;
3329
3326
  constructor(params) {
@@ -3340,11 +3337,11 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
3340
3337
  };
3341
3338
  }
3342
3339
  static async fromFile({
3343
- baseDir = ".",
3340
+ baseDir = process.cwd(),
3344
3341
  validate = true
3345
3342
  }) {
3346
3343
  const fileContent = await readFileContent(
3347
- (0, import_node_path32.join)(
3344
+ (0, import_node_path33.join)(
3348
3345
  baseDir,
3349
3346
  this.getSettablePaths().relativeDirPath,
3350
3347
  this.getSettablePaths().relativeFilePath
@@ -3359,7 +3356,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
3359
3356
  });
3360
3357
  }
3361
3358
  static fromRulesyncMcp({
3362
- baseDir = ".",
3359
+ baseDir = process.cwd(),
3363
3360
  rulesyncMcp,
3364
3361
  validate = true
3365
3362
  }) {
@@ -3391,7 +3388,7 @@ var CursorMcp = class _CursorMcp extends ToolMcp {
3391
3388
  };
3392
3389
 
3393
3390
  // src/mcp/geminicli-mcp.ts
3394
- var import_node_path33 = require("path");
3391
+ var import_node_path34 = require("path");
3395
3392
  var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
3396
3393
  json;
3397
3394
  constructor(params) {
@@ -3414,13 +3411,13 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
3414
3411
  };
3415
3412
  }
3416
3413
  static async fromFile({
3417
- baseDir = ".",
3414
+ baseDir = process.cwd(),
3418
3415
  validate = true,
3419
3416
  global = false
3420
3417
  }) {
3421
3418
  const paths = this.getSettablePaths({ global });
3422
3419
  const fileContent = await readOrInitializeFileContent(
3423
- (0, import_node_path33.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
3420
+ (0, import_node_path34.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
3424
3421
  JSON.stringify({ mcpServers: {} }, null, 2)
3425
3422
  );
3426
3423
  const json = JSON.parse(fileContent);
@@ -3434,14 +3431,14 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
3434
3431
  });
3435
3432
  }
3436
3433
  static async fromRulesyncMcp({
3437
- baseDir = ".",
3434
+ baseDir = process.cwd(),
3438
3435
  rulesyncMcp,
3439
3436
  validate = true,
3440
3437
  global = false
3441
3438
  }) {
3442
3439
  const paths = this.getSettablePaths({ global });
3443
3440
  const fileContent = await readOrInitializeFileContent(
3444
- (0, import_node_path33.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
3441
+ (0, import_node_path34.join)(baseDir, paths.relativeDirPath, paths.relativeFilePath),
3445
3442
  JSON.stringify({ mcpServers: {} }, null, 2)
3446
3443
  );
3447
3444
  const json = JSON.parse(fileContent);
@@ -3465,7 +3462,7 @@ var GeminiCliMcp = class _GeminiCliMcp extends ToolMcp {
3465
3462
  };
3466
3463
 
3467
3464
  // src/mcp/roo-mcp.ts
3468
- var import_node_path34 = require("path");
3465
+ var import_node_path35 = require("path");
3469
3466
  var RooMcp = class _RooMcp extends ToolMcp {
3470
3467
  json;
3471
3468
  constructor(params) {
@@ -3482,11 +3479,11 @@ var RooMcp = class _RooMcp extends ToolMcp {
3482
3479
  };
3483
3480
  }
3484
3481
  static async fromFile({
3485
- baseDir = ".",
3482
+ baseDir = process.cwd(),
3486
3483
  validate = true
3487
3484
  }) {
3488
3485
  const fileContent = await readFileContent(
3489
- (0, import_node_path34.join)(
3486
+ (0, import_node_path35.join)(
3490
3487
  baseDir,
3491
3488
  this.getSettablePaths().relativeDirPath,
3492
3489
  this.getSettablePaths().relativeFilePath
@@ -3501,7 +3498,7 @@ var RooMcp = class _RooMcp extends ToolMcp {
3501
3498
  });
3502
3499
  }
3503
3500
  static fromRulesyncMcp({
3504
- baseDir = ".",
3501
+ baseDir = process.cwd(),
3505
3502
  rulesyncMcp,
3506
3503
  validate = true
3507
3504
  }) {
@@ -3532,7 +3529,7 @@ var mcpProcessorToolTargets = [
3532
3529
  "geminicli",
3533
3530
  "roo"
3534
3531
  ];
3535
- var McpProcessorToolTargetSchema = import_mini12.z.enum(
3532
+ var McpProcessorToolTargetSchema = import_mini13.z.enum(
3536
3533
  // 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
3537
3534
  mcpProcessorToolTargets.concat("codexcli")
3538
3535
  );
@@ -3543,7 +3540,7 @@ var McpProcessor = class extends FeatureProcessor {
3543
3540
  global;
3544
3541
  modularMcp;
3545
3542
  constructor({
3546
- baseDir = ".",
3543
+ baseDir = process.cwd(),
3547
3544
  toolTarget,
3548
3545
  global = false,
3549
3546
  modularMcp = false
@@ -3769,16 +3766,16 @@ var McpProcessor = class extends FeatureProcessor {
3769
3766
  };
3770
3767
 
3771
3768
  // src/rules/rules-processor.ts
3772
- var import_node_path64 = require("path");
3769
+ var import_node_path65 = require("path");
3773
3770
  var import_fast_xml_parser = require("fast-xml-parser");
3774
- var import_mini21 = require("zod/mini");
3771
+ var import_mini22 = require("zod/mini");
3775
3772
 
3776
3773
  // src/subagents/agentsmd-subagent.ts
3777
- var import_node_path36 = require("path");
3774
+ var import_node_path37 = require("path");
3778
3775
 
3779
3776
  // src/subagents/simulated-subagent.ts
3780
- var import_node_path35 = require("path");
3781
- var import_mini13 = require("zod/mini");
3777
+ var import_node_path36 = require("path");
3778
+ var import_mini14 = require("zod/mini");
3782
3779
 
3783
3780
  // src/subagents/tool-subagent.ts
3784
3781
  var ToolSubagent = class extends ToolFile {
@@ -3813,9 +3810,9 @@ var ToolSubagent = class extends ToolFile {
3813
3810
  };
3814
3811
 
3815
3812
  // src/subagents/simulated-subagent.ts
3816
- var SimulatedSubagentFrontmatterSchema = import_mini13.z.object({
3817
- name: import_mini13.z.string(),
3818
- description: import_mini13.z.string()
3813
+ var SimulatedSubagentFrontmatterSchema = import_mini14.z.object({
3814
+ name: import_mini14.z.string(),
3815
+ description: import_mini14.z.string()
3819
3816
  });
3820
3817
  var SimulatedSubagent = class extends ToolSubagent {
3821
3818
  frontmatter;
@@ -3825,7 +3822,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3825
3822
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
3826
3823
  if (!result.success) {
3827
3824
  throw new Error(
3828
- `Invalid frontmatter in ${(0, import_node_path35.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
3825
+ `Invalid frontmatter in ${(0, import_node_path36.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
3829
3826
  );
3830
3827
  }
3831
3828
  }
@@ -3846,7 +3843,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3846
3843
  throw new Error("Not implemented because it is a SIMULATED file.");
3847
3844
  }
3848
3845
  static fromRulesyncSubagentDefault({
3849
- baseDir = ".",
3846
+ baseDir = process.cwd(),
3850
3847
  rulesyncSubagent,
3851
3848
  validate = true
3852
3849
  }) {
@@ -3876,17 +3873,17 @@ var SimulatedSubagent = class extends ToolSubagent {
3876
3873
  return {
3877
3874
  success: false,
3878
3875
  error: new Error(
3879
- `Invalid frontmatter in ${(0, import_node_path35.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
3876
+ `Invalid frontmatter in ${(0, import_node_path36.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
3880
3877
  )
3881
3878
  };
3882
3879
  }
3883
3880
  }
3884
3881
  static async fromFileDefault({
3885
- baseDir = ".",
3882
+ baseDir = process.cwd(),
3886
3883
  relativeFilePath,
3887
3884
  validate = true
3888
3885
  }) {
3889
- const filePath = (0, import_node_path35.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
3886
+ const filePath = (0, import_node_path36.join)(baseDir, this.getSettablePaths().relativeDirPath, relativeFilePath);
3890
3887
  const fileContent = await readFileContent(filePath);
3891
3888
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
3892
3889
  const result = SimulatedSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -3896,7 +3893,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3896
3893
  return {
3897
3894
  baseDir,
3898
3895
  relativeDirPath: this.getSettablePaths().relativeDirPath,
3899
- relativeFilePath: (0, import_node_path35.basename)(relativeFilePath),
3896
+ relativeFilePath: (0, import_node_path36.basename)(relativeFilePath),
3900
3897
  frontmatter: result.data,
3901
3898
  body: content.trim(),
3902
3899
  validate
@@ -3908,7 +3905,7 @@ var SimulatedSubagent = class extends ToolSubagent {
3908
3905
  var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
3909
3906
  static getSettablePaths() {
3910
3907
  return {
3911
- relativeDirPath: (0, import_node_path36.join)(".agents", "subagents")
3908
+ relativeDirPath: (0, import_node_path37.join)(".agents", "subagents")
3912
3909
  };
3913
3910
  }
3914
3911
  static async fromFile(params) {
@@ -3928,11 +3925,11 @@ var AgentsmdSubagent = class _AgentsmdSubagent extends SimulatedSubagent {
3928
3925
  };
3929
3926
 
3930
3927
  // src/subagents/codexcli-subagent.ts
3931
- var import_node_path37 = require("path");
3928
+ var import_node_path38 = require("path");
3932
3929
  var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
3933
3930
  static getSettablePaths() {
3934
3931
  return {
3935
- relativeDirPath: (0, import_node_path37.join)(".codex", "subagents")
3932
+ relativeDirPath: (0, import_node_path38.join)(".codex", "subagents")
3936
3933
  };
3937
3934
  }
3938
3935
  static async fromFile(params) {
@@ -3952,11 +3949,11 @@ var CodexCliSubagent = class _CodexCliSubagent extends SimulatedSubagent {
3952
3949
  };
3953
3950
 
3954
3951
  // src/subagents/copilot-subagent.ts
3955
- var import_node_path38 = require("path");
3952
+ var import_node_path39 = require("path");
3956
3953
  var CopilotSubagent = class _CopilotSubagent extends SimulatedSubagent {
3957
3954
  static getSettablePaths() {
3958
3955
  return {
3959
- relativeDirPath: (0, import_node_path38.join)(".github", "subagents")
3956
+ relativeDirPath: (0, import_node_path39.join)(".github", "subagents")
3960
3957
  };
3961
3958
  }
3962
3959
  static async fromFile(params) {
@@ -3976,11 +3973,11 @@ var CopilotSubagent = class _CopilotSubagent extends SimulatedSubagent {
3976
3973
  };
3977
3974
 
3978
3975
  // src/subagents/cursor-subagent.ts
3979
- var import_node_path39 = require("path");
3976
+ var import_node_path40 = require("path");
3980
3977
  var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
3981
3978
  static getSettablePaths() {
3982
3979
  return {
3983
- relativeDirPath: (0, import_node_path39.join)(".cursor", "subagents")
3980
+ relativeDirPath: (0, import_node_path40.join)(".cursor", "subagents")
3984
3981
  };
3985
3982
  }
3986
3983
  static async fromFile(params) {
@@ -4000,11 +3997,11 @@ var CursorSubagent = class _CursorSubagent extends SimulatedSubagent {
4000
3997
  };
4001
3998
 
4002
3999
  // src/subagents/geminicli-subagent.ts
4003
- var import_node_path40 = require("path");
4000
+ var import_node_path41 = require("path");
4004
4001
  var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
4005
4002
  static getSettablePaths() {
4006
4003
  return {
4007
- relativeDirPath: (0, import_node_path40.join)(".gemini", "subagents")
4004
+ relativeDirPath: (0, import_node_path41.join)(".gemini", "subagents")
4008
4005
  };
4009
4006
  }
4010
4007
  static async fromFile(params) {
@@ -4024,11 +4021,11 @@ var GeminiCliSubagent = class _GeminiCliSubagent extends SimulatedSubagent {
4024
4021
  };
4025
4022
 
4026
4023
  // src/subagents/roo-subagent.ts
4027
- var import_node_path41 = require("path");
4024
+ var import_node_path42 = require("path");
4028
4025
  var RooSubagent = class _RooSubagent extends SimulatedSubagent {
4029
4026
  static getSettablePaths() {
4030
4027
  return {
4031
- relativeDirPath: (0, import_node_path41.join)(".roo", "subagents")
4028
+ relativeDirPath: (0, import_node_path42.join)(".roo", "subagents")
4032
4029
  };
4033
4030
  }
4034
4031
  static async fromFile(params) {
@@ -4048,23 +4045,23 @@ var RooSubagent = class _RooSubagent extends SimulatedSubagent {
4048
4045
  };
4049
4046
 
4050
4047
  // src/subagents/subagents-processor.ts
4048
+ var import_node_path45 = require("path");
4049
+ var import_mini17 = require("zod/mini");
4050
+
4051
+ // src/subagents/claudecode-subagent.ts
4051
4052
  var import_node_path44 = require("path");
4052
4053
  var import_mini16 = require("zod/mini");
4053
4054
 
4054
- // src/subagents/claudecode-subagent.ts
4055
+ // src/subagents/rulesync-subagent.ts
4055
4056
  var import_node_path43 = require("path");
4056
4057
  var import_mini15 = require("zod/mini");
4057
-
4058
- // src/subagents/rulesync-subagent.ts
4059
- var import_node_path42 = require("path");
4060
- var import_mini14 = require("zod/mini");
4061
- var RulesyncSubagentModelSchema = import_mini14.z.enum(["opus", "sonnet", "haiku", "inherit"]);
4062
- var RulesyncSubagentFrontmatterSchema = import_mini14.z.object({
4058
+ var RulesyncSubagentModelSchema = import_mini15.z.enum(["opus", "sonnet", "haiku", "inherit"]);
4059
+ var RulesyncSubagentFrontmatterSchema = import_mini15.z.object({
4063
4060
  targets: RulesyncTargetsSchema,
4064
- name: import_mini14.z.string(),
4065
- description: import_mini14.z.string(),
4066
- claudecode: import_mini14.z.optional(
4067
- import_mini14.z.object({
4061
+ name: import_mini15.z.string(),
4062
+ description: import_mini15.z.string(),
4063
+ claudecode: import_mini15.z.optional(
4064
+ import_mini15.z.object({
4068
4065
  model: RulesyncSubagentModelSchema
4069
4066
  })
4070
4067
  )
@@ -4077,7 +4074,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4077
4074
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
4078
4075
  if (!result.success) {
4079
4076
  throw new Error(
4080
- `Invalid frontmatter in ${(0, import_node_path42.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
4077
+ `Invalid frontmatter in ${(0, import_node_path43.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
4081
4078
  );
4082
4079
  }
4083
4080
  }
@@ -4089,7 +4086,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4089
4086
  }
4090
4087
  static getSettablePaths() {
4091
4088
  return {
4092
- relativeDirPath: (0, import_node_path42.join)(".rulesync", "subagents")
4089
+ relativeDirPath: (0, import_node_path43.join)(".rulesync", "subagents")
4093
4090
  };
4094
4091
  }
4095
4092
  getFrontmatter() {
@@ -4109,7 +4106,7 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4109
4106
  return {
4110
4107
  success: false,
4111
4108
  error: new Error(
4112
- `Invalid frontmatter in ${(0, import_node_path42.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
4109
+ `Invalid frontmatter in ${(0, import_node_path43.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
4113
4110
  )
4114
4111
  };
4115
4112
  }
@@ -4117,15 +4114,17 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4117
4114
  static async fromFile({
4118
4115
  relativeFilePath
4119
4116
  }) {
4120
- const fileContent = await readFileContent((0, import_node_path42.join)(".rulesync", "subagents", relativeFilePath));
4117
+ const fileContent = await readFileContent(
4118
+ (0, import_node_path43.join)(process.cwd(), ".rulesync", "subagents", relativeFilePath)
4119
+ );
4121
4120
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4122
4121
  const result = RulesyncSubagentFrontmatterSchema.safeParse(frontmatter);
4123
4122
  if (!result.success) {
4124
4123
  throw new Error(`Invalid frontmatter in ${relativeFilePath}: ${formatError(result.error)}`);
4125
4124
  }
4126
- const filename = (0, import_node_path42.basename)(relativeFilePath);
4125
+ const filename = (0, import_node_path43.basename)(relativeFilePath);
4127
4126
  return new _RulesyncSubagent({
4128
- baseDir: ".",
4127
+ baseDir: process.cwd(),
4129
4128
  relativeDirPath: this.getSettablePaths().relativeDirPath,
4130
4129
  relativeFilePath: filename,
4131
4130
  frontmatter: result.data,
@@ -4136,10 +4135,10 @@ var RulesyncSubagent = class _RulesyncSubagent extends RulesyncFile {
4136
4135
  };
4137
4136
 
4138
4137
  // src/subagents/claudecode-subagent.ts
4139
- var ClaudecodeSubagentFrontmatterSchema = import_mini15.z.object({
4140
- name: import_mini15.z.string(),
4141
- description: import_mini15.z.string(),
4142
- model: import_mini15.z.optional(import_mini15.z.enum(["opus", "sonnet", "haiku", "inherit"]))
4138
+ var ClaudecodeSubagentFrontmatterSchema = import_mini16.z.object({
4139
+ name: import_mini16.z.string(),
4140
+ description: import_mini16.z.string(),
4141
+ model: import_mini16.z.optional(import_mini16.z.enum(["opus", "sonnet", "haiku", "inherit"]))
4143
4142
  });
4144
4143
  var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4145
4144
  frontmatter;
@@ -4149,7 +4148,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4149
4148
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
4150
4149
  if (!result.success) {
4151
4150
  throw new Error(
4152
- `Invalid frontmatter in ${(0, import_node_path43.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
4151
+ `Invalid frontmatter in ${(0, import_node_path44.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
4153
4152
  );
4154
4153
  }
4155
4154
  }
@@ -4161,7 +4160,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4161
4160
  }
4162
4161
  static getSettablePaths(_options = {}) {
4163
4162
  return {
4164
- relativeDirPath: (0, import_node_path43.join)(".claude", "agents")
4163
+ relativeDirPath: (0, import_node_path44.join)(".claude", "agents")
4165
4164
  };
4166
4165
  }
4167
4166
  getFrontmatter() {
@@ -4187,14 +4186,14 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4187
4186
  // RulesyncCommand baseDir is always the project root directory
4188
4187
  frontmatter: rulesyncFrontmatter,
4189
4188
  body: this.body,
4190
- relativeDirPath: (0, import_node_path43.join)(".rulesync", "subagents"),
4189
+ relativeDirPath: (0, import_node_path44.join)(".rulesync", "subagents"),
4191
4190
  relativeFilePath: this.getRelativeFilePath(),
4192
4191
  fileContent,
4193
4192
  validate: true
4194
4193
  });
4195
4194
  }
4196
4195
  static fromRulesyncSubagent({
4197
- baseDir = ".",
4196
+ baseDir = process.cwd(),
4198
4197
  rulesyncSubagent,
4199
4198
  validate = true,
4200
4199
  global = false
@@ -4229,7 +4228,7 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4229
4228
  return {
4230
4229
  success: false,
4231
4230
  error: new Error(
4232
- `Invalid frontmatter in ${(0, import_node_path43.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
4231
+ `Invalid frontmatter in ${(0, import_node_path44.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
4233
4232
  )
4234
4233
  };
4235
4234
  }
@@ -4241,13 +4240,13 @@ var ClaudecodeSubagent = class _ClaudecodeSubagent extends ToolSubagent {
4241
4240
  });
4242
4241
  }
4243
4242
  static async fromFile({
4244
- baseDir = ".",
4243
+ baseDir = process.cwd(),
4245
4244
  relativeFilePath,
4246
4245
  validate = true,
4247
4246
  global = false
4248
4247
  }) {
4249
4248
  const paths = this.getSettablePaths({ global });
4250
- const filePath = (0, import_node_path43.join)(baseDir, paths.relativeDirPath, relativeFilePath);
4249
+ const filePath = (0, import_node_path44.join)(baseDir, paths.relativeDirPath, relativeFilePath);
4251
4250
  const fileContent = await readFileContent(filePath);
4252
4251
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4253
4252
  const result = ClaudecodeSubagentFrontmatterSchema.safeParse(frontmatter);
@@ -4285,12 +4284,12 @@ var subagentsProcessorToolTargetsSimulated = [
4285
4284
  "roo"
4286
4285
  ];
4287
4286
  var subagentsProcessorToolTargetsGlobal = ["claudecode"];
4288
- var SubagentsProcessorToolTargetSchema = import_mini16.z.enum(subagentsProcessorToolTargets);
4287
+ var SubagentsProcessorToolTargetSchema = import_mini17.z.enum(subagentsProcessorToolTargets);
4289
4288
  var SubagentsProcessor = class extends FeatureProcessor {
4290
4289
  toolTarget;
4291
4290
  global;
4292
4291
  constructor({
4293
- baseDir = ".",
4292
+ baseDir = process.cwd(),
4294
4293
  toolTarget,
4295
4294
  global = false
4296
4295
  }) {
@@ -4401,7 +4400,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
4401
4400
  * Load and parse rulesync subagent files from .rulesync/subagents/ directory
4402
4401
  */
4403
4402
  async loadRulesyncFiles() {
4404
- const subagentsDir = (0, import_node_path44.join)(RulesyncSubagent.getSettablePaths().relativeDirPath);
4403
+ const subagentsDir = (0, import_node_path45.join)(this.baseDir, RulesyncSubagent.getSettablePaths().relativeDirPath);
4405
4404
  const dirExists = await directoryExists(subagentsDir);
4406
4405
  if (!dirExists) {
4407
4406
  logger.debug(`Rulesync subagents directory not found: ${subagentsDir}`);
@@ -4416,7 +4415,7 @@ var SubagentsProcessor = class extends FeatureProcessor {
4416
4415
  logger.info(`Found ${mdFiles.length} subagent files in ${subagentsDir}`);
4417
4416
  const rulesyncSubagents = [];
4418
4417
  for (const mdFile of mdFiles) {
4419
- const filepath = (0, import_node_path44.join)(subagentsDir, mdFile);
4418
+ const filepath = (0, import_node_path45.join)(subagentsDir, mdFile);
4420
4419
  try {
4421
4420
  const rulesyncSubagent = await RulesyncSubagent.fromFile({
4422
4421
  relativeFilePath: mdFile,
@@ -4535,8 +4534,8 @@ var SubagentsProcessor = class extends FeatureProcessor {
4535
4534
  relativeDirPath,
4536
4535
  fromFile
4537
4536
  }) {
4538
- const paths = await findFilesByGlobs((0, import_node_path44.join)(this.baseDir, relativeDirPath, "*.md"));
4539
- const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0, import_node_path44.basename)(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
4537
+ const paths = await findFilesByGlobs((0, import_node_path45.join)(this.baseDir, relativeDirPath, "*.md"));
4538
+ const subagents = (await Promise.allSettled(paths.map((path2) => fromFile((0, import_node_path45.basename)(path2))))).filter((r) => r.status === "fulfilled").map((r) => r.value);
4540
4539
  logger.info(`Successfully loaded ${subagents.length} ${relativeDirPath} subagents`);
4541
4540
  return subagents;
4542
4541
  }
@@ -4563,30 +4562,30 @@ var SubagentsProcessor = class extends FeatureProcessor {
4563
4562
  };
4564
4563
 
4565
4564
  // src/rules/agentsmd-rule.ts
4566
- var import_node_path47 = require("path");
4565
+ var import_node_path48 = require("path");
4567
4566
 
4568
4567
  // src/rules/tool-rule.ts
4569
- var import_node_path46 = require("path");
4568
+ var import_node_path47 = require("path");
4570
4569
 
4571
4570
  // src/rules/rulesync-rule.ts
4572
- var import_node_path45 = require("path");
4573
- var import_mini17 = require("zod/mini");
4574
- var RulesyncRuleFrontmatterSchema = import_mini17.z.object({
4575
- root: import_mini17.z.optional(import_mini17.z.optional(import_mini17.z.boolean())),
4576
- targets: import_mini17.z.optional(RulesyncTargetsSchema),
4577
- description: import_mini17.z.optional(import_mini17.z.string()),
4578
- globs: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string())),
4579
- agentsmd: import_mini17.z.optional(
4580
- import_mini17.z.object({
4571
+ var import_node_path46 = require("path");
4572
+ var import_mini18 = require("zod/mini");
4573
+ var RulesyncRuleFrontmatterSchema = import_mini18.z.object({
4574
+ root: import_mini18.z.optional(import_mini18.z.optional(import_mini18.z.boolean())),
4575
+ targets: import_mini18.z.optional(RulesyncTargetsSchema),
4576
+ description: import_mini18.z.optional(import_mini18.z.string()),
4577
+ globs: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string())),
4578
+ agentsmd: import_mini18.z.optional(
4579
+ import_mini18.z.object({
4581
4580
  // @example "path/to/subproject"
4582
- subprojectPath: import_mini17.z.optional(import_mini17.z.string())
4581
+ subprojectPath: import_mini18.z.optional(import_mini18.z.string())
4583
4582
  })
4584
4583
  ),
4585
- cursor: import_mini17.z.optional(
4586
- import_mini17.z.object({
4587
- alwaysApply: import_mini17.z.optional(import_mini17.z.boolean()),
4588
- description: import_mini17.z.optional(import_mini17.z.string()),
4589
- globs: import_mini17.z.optional(import_mini17.z.array(import_mini17.z.string()))
4584
+ cursor: import_mini18.z.optional(
4585
+ import_mini18.z.object({
4586
+ alwaysApply: import_mini18.z.optional(import_mini18.z.boolean()),
4587
+ description: import_mini18.z.optional(import_mini18.z.string()),
4588
+ globs: import_mini18.z.optional(import_mini18.z.array(import_mini18.z.string()))
4590
4589
  })
4591
4590
  )
4592
4591
  });
@@ -4598,7 +4597,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4598
4597
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
4599
4598
  if (!result.success) {
4600
4599
  throw new Error(
4601
- `Invalid frontmatter in ${(0, import_node_path45.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
4600
+ `Invalid frontmatter in ${(0, import_node_path46.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
4602
4601
  );
4603
4602
  }
4604
4603
  }
@@ -4612,7 +4611,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4612
4611
  static getSettablePaths() {
4613
4612
  return {
4614
4613
  recommended: {
4615
- relativeDirPath: (0, import_node_path45.join)(".rulesync", "rules")
4614
+ relativeDirPath: (0, import_node_path46.join)(".rulesync", "rules")
4616
4615
  },
4617
4616
  legacy: {
4618
4617
  relativeDirPath: ".rulesync"
@@ -4633,7 +4632,7 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4633
4632
  return {
4634
4633
  success: false,
4635
4634
  error: new Error(
4636
- `Invalid frontmatter in ${(0, import_node_path45.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
4635
+ `Invalid frontmatter in ${(0, import_node_path46.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
4637
4636
  )
4638
4637
  };
4639
4638
  }
@@ -4642,8 +4641,12 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4642
4641
  relativeFilePath,
4643
4642
  validate = true
4644
4643
  }) {
4645
- const legacyPath = (0, import_node_path45.join)(this.getSettablePaths().legacy.relativeDirPath, relativeFilePath);
4646
- const recommendedPath = (0, import_node_path45.join)(
4644
+ const legacyPath = (0, import_node_path46.join)(
4645
+ process.cwd(),
4646
+ this.getSettablePaths().legacy.relativeDirPath,
4647
+ relativeFilePath
4648
+ );
4649
+ const recommendedPath = (0, import_node_path46.join)(
4647
4650
  this.getSettablePaths().recommended.relativeDirPath,
4648
4651
  relativeFilePath
4649
4652
  );
@@ -4662,9 +4665,9 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4662
4665
  agentsmd: result.data.agentsmd,
4663
4666
  cursor: result.data.cursor
4664
4667
  };
4665
- const filename = (0, import_node_path45.basename)(legacyPath);
4668
+ const filename = (0, import_node_path46.basename)(legacyPath);
4666
4669
  return new _RulesyncRule({
4667
- baseDir: ".",
4670
+ baseDir: process.cwd(),
4668
4671
  relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
4669
4672
  relativeFilePath: filename,
4670
4673
  frontmatter: validatedFrontmatter,
@@ -4676,7 +4679,11 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4676
4679
  relativeFilePath,
4677
4680
  validate = true
4678
4681
  }) {
4679
- const filePath = (0, import_node_path45.join)(this.getSettablePaths().recommended.relativeDirPath, relativeFilePath);
4682
+ const filePath = (0, import_node_path46.join)(
4683
+ process.cwd(),
4684
+ this.getSettablePaths().recommended.relativeDirPath,
4685
+ relativeFilePath
4686
+ );
4680
4687
  const fileContent = await readFileContent(filePath);
4681
4688
  const { frontmatter, body: content } = parseFrontmatter(fileContent);
4682
4689
  const result = RulesyncRuleFrontmatterSchema.safeParse(frontmatter);
@@ -4691,9 +4698,9 @@ var RulesyncRule = class _RulesyncRule extends RulesyncFile {
4691
4698
  agentsmd: result.data.agentsmd,
4692
4699
  cursor: result.data.cursor
4693
4700
  };
4694
- const filename = (0, import_node_path45.basename)(filePath);
4701
+ const filename = (0, import_node_path46.basename)(filePath);
4695
4702
  return new _RulesyncRule({
4696
- baseDir: ".",
4703
+ baseDir: process.cwd(),
4697
4704
  relativeDirPath: this.getSettablePaths().recommended.relativeDirPath,
4698
4705
  relativeFilePath: filename,
4699
4706
  frontmatter: validatedFrontmatter,
@@ -4727,7 +4734,7 @@ var ToolRule = class extends ToolFile {
4727
4734
  throw new Error("Please implement this method in the subclass.");
4728
4735
  }
4729
4736
  static buildToolRuleParamsDefault({
4730
- baseDir = ".",
4737
+ baseDir = process.cwd(),
4731
4738
  rulesyncRule,
4732
4739
  validate = true,
4733
4740
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
@@ -4762,11 +4769,11 @@ var ToolRule = class extends ToolFile {
4762
4769
  };
4763
4770
  }
4764
4771
  static buildToolRuleParamsAgentsmd({
4765
- baseDir = ".",
4772
+ baseDir = process.cwd(),
4766
4773
  rulesyncRule,
4767
4774
  validate = true,
4768
4775
  rootPath = { relativeDirPath: ".", relativeFilePath: "AGENTS.md" },
4769
- nonRootPath = { relativeDirPath: (0, import_node_path46.join)(".agents", "memories") }
4776
+ nonRootPath = { relativeDirPath: (0, import_node_path47.join)(".agents", "memories") }
4770
4777
  }) {
4771
4778
  const params = this.buildToolRuleParamsDefault({
4772
4779
  baseDir,
@@ -4777,7 +4784,7 @@ var ToolRule = class extends ToolFile {
4777
4784
  });
4778
4785
  const rulesyncFrontmatter = rulesyncRule.getFrontmatter();
4779
4786
  if (!rulesyncFrontmatter.root && rulesyncFrontmatter.agentsmd?.subprojectPath) {
4780
- params.relativeDirPath = (0, import_node_path46.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
4787
+ params.relativeDirPath = (0, import_node_path47.join)(rulesyncFrontmatter.agentsmd.subprojectPath);
4781
4788
  params.relativeFilePath = "AGENTS.md";
4782
4789
  }
4783
4790
  return params;
@@ -4786,7 +4793,7 @@ var ToolRule = class extends ToolFile {
4786
4793
  return new RulesyncRule({
4787
4794
  baseDir: ".",
4788
4795
  // RulesyncRule baseDir is always the project root directory
4789
- relativeDirPath: (0, import_node_path46.join)(".rulesync", "rules"),
4796
+ relativeDirPath: (0, import_node_path47.join)(".rulesync", "rules"),
4790
4797
  relativeFilePath: this.getRelativeFilePath(),
4791
4798
  frontmatter: {
4792
4799
  root: this.isRoot(),
@@ -4843,18 +4850,18 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
4843
4850
  relativeFilePath: "AGENTS.md"
4844
4851
  },
4845
4852
  nonRoot: {
4846
- relativeDirPath: (0, import_node_path47.join)(".agents", "memories")
4853
+ relativeDirPath: (0, import_node_path48.join)(".agents", "memories")
4847
4854
  }
4848
4855
  };
4849
4856
  }
4850
4857
  static async fromFile({
4851
- baseDir = ".",
4858
+ baseDir = process.cwd(),
4852
4859
  relativeFilePath,
4853
4860
  validate = true
4854
4861
  }) {
4855
4862
  const isRoot = relativeFilePath === "AGENTS.md";
4856
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path47.join)(".agents", "memories", relativeFilePath);
4857
- const fileContent = await readFileContent((0, import_node_path47.join)(baseDir, relativePath));
4863
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path48.join)(".agents", "memories", relativeFilePath);
4864
+ const fileContent = await readFileContent((0, import_node_path48.join)(baseDir, relativePath));
4858
4865
  return new _AgentsMdRule({
4859
4866
  baseDir,
4860
4867
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -4865,7 +4872,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
4865
4872
  });
4866
4873
  }
4867
4874
  static fromRulesyncRule({
4868
- baseDir = ".",
4875
+ baseDir = process.cwd(),
4869
4876
  rulesyncRule,
4870
4877
  validate = true
4871
4878
  }) {
@@ -4894,22 +4901,22 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
4894
4901
  };
4895
4902
 
4896
4903
  // src/rules/amazonqcli-rule.ts
4897
- var import_node_path48 = require("path");
4904
+ var import_node_path49 = require("path");
4898
4905
  var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
4899
4906
  static getSettablePaths() {
4900
4907
  return {
4901
4908
  nonRoot: {
4902
- relativeDirPath: (0, import_node_path48.join)(".amazonq", "rules")
4909
+ relativeDirPath: (0, import_node_path49.join)(".amazonq", "rules")
4903
4910
  }
4904
4911
  };
4905
4912
  }
4906
4913
  static async fromFile({
4907
- baseDir = ".",
4914
+ baseDir = process.cwd(),
4908
4915
  relativeFilePath,
4909
4916
  validate = true
4910
4917
  }) {
4911
4918
  const fileContent = await readFileContent(
4912
- (0, import_node_path48.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4919
+ (0, import_node_path49.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
4913
4920
  );
4914
4921
  return new _AmazonQCliRule({
4915
4922
  baseDir,
@@ -4921,7 +4928,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
4921
4928
  });
4922
4929
  }
4923
4930
  static fromRulesyncRule({
4924
- baseDir = ".",
4931
+ baseDir = process.cwd(),
4925
4932
  rulesyncRule,
4926
4933
  validate = true
4927
4934
  }) {
@@ -4949,7 +4956,7 @@ var AmazonQCliRule = class _AmazonQCliRule extends ToolRule {
4949
4956
  };
4950
4957
 
4951
4958
  // src/rules/augmentcode-legacy-rule.ts
4952
- var import_node_path49 = require("path");
4959
+ var import_node_path50 = require("path");
4953
4960
  var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
4954
4961
  toRulesyncRule() {
4955
4962
  const rulesyncFrontmatter = {
@@ -4963,7 +4970,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
4963
4970
  // RulesyncRule baseDir is always the project root directory
4964
4971
  frontmatter: rulesyncFrontmatter,
4965
4972
  body: this.getFileContent(),
4966
- relativeDirPath: (0, import_node_path49.join)(".rulesync", "rules"),
4973
+ relativeDirPath: (0, import_node_path50.join)(".rulesync", "rules"),
4967
4974
  relativeFilePath: this.getRelativeFilePath(),
4968
4975
  validate: true
4969
4976
  });
@@ -4975,12 +4982,12 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
4975
4982
  relativeFilePath: ".augment-guidelines"
4976
4983
  },
4977
4984
  nonRoot: {
4978
- relativeDirPath: (0, import_node_path49.join)(".augment", "rules")
4985
+ relativeDirPath: (0, import_node_path50.join)(".augment", "rules")
4979
4986
  }
4980
4987
  };
4981
4988
  }
4982
4989
  static fromRulesyncRule({
4983
- baseDir = ".",
4990
+ baseDir = process.cwd(),
4984
4991
  rulesyncRule,
4985
4992
  validate = true
4986
4993
  }) {
@@ -5004,14 +5011,14 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
5004
5011
  });
5005
5012
  }
5006
5013
  static async fromFile({
5007
- baseDir = ".",
5014
+ baseDir = process.cwd(),
5008
5015
  relativeFilePath,
5009
5016
  validate = true
5010
5017
  }) {
5011
5018
  const settablePaths = this.getSettablePaths();
5012
5019
  const isRoot = relativeFilePath === settablePaths.root.relativeFilePath;
5013
- const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path49.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
5014
- const fileContent = await readFileContent((0, import_node_path49.join)(baseDir, relativePath));
5020
+ const relativePath = isRoot ? settablePaths.root.relativeFilePath : (0, import_node_path50.join)(settablePaths.nonRoot.relativeDirPath, relativeFilePath);
5021
+ const fileContent = await readFileContent((0, import_node_path50.join)(baseDir, relativePath));
5015
5022
  return new _AugmentcodeLegacyRule({
5016
5023
  baseDir,
5017
5024
  relativeDirPath: isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath,
@@ -5024,7 +5031,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
5024
5031
  };
5025
5032
 
5026
5033
  // src/rules/augmentcode-rule.ts
5027
- var import_node_path50 = require("path");
5034
+ var import_node_path51 = require("path");
5028
5035
  var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
5029
5036
  toRulesyncRule() {
5030
5037
  return this.toRulesyncRuleDefault();
@@ -5032,12 +5039,12 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
5032
5039
  static getSettablePaths() {
5033
5040
  return {
5034
5041
  nonRoot: {
5035
- relativeDirPath: (0, import_node_path50.join)(".augment", "rules")
5042
+ relativeDirPath: (0, import_node_path51.join)(".augment", "rules")
5036
5043
  }
5037
5044
  };
5038
5045
  }
5039
5046
  static fromRulesyncRule({
5040
- baseDir = ".",
5047
+ baseDir = process.cwd(),
5041
5048
  rulesyncRule,
5042
5049
  validate = true
5043
5050
  }) {
@@ -5051,12 +5058,12 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
5051
5058
  );
5052
5059
  }
5053
5060
  static async fromFile({
5054
- baseDir = ".",
5061
+ baseDir = process.cwd(),
5055
5062
  relativeFilePath,
5056
5063
  validate = true
5057
5064
  }) {
5058
5065
  const fileContent = await readFileContent(
5059
- (0, import_node_path50.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5066
+ (0, import_node_path51.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5060
5067
  );
5061
5068
  const { body: content } = parseFrontmatter(fileContent);
5062
5069
  return new _AugmentcodeRule({
@@ -5079,7 +5086,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
5079
5086
  };
5080
5087
 
5081
5088
  // src/rules/claudecode-rule.ts
5082
- var import_node_path51 = require("path");
5089
+ var import_node_path52 = require("path");
5083
5090
  var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
5084
5091
  static getSettablePaths({
5085
5092
  global
@@ -5098,12 +5105,12 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
5098
5105
  relativeFilePath: "CLAUDE.md"
5099
5106
  },
5100
5107
  nonRoot: {
5101
- relativeDirPath: (0, import_node_path51.join)(".claude", "memories")
5108
+ relativeDirPath: (0, import_node_path52.join)(".claude", "memories")
5102
5109
  }
5103
5110
  };
5104
5111
  }
5105
5112
  static async fromFile({
5106
- baseDir = ".",
5113
+ baseDir = process.cwd(),
5107
5114
  relativeFilePath,
5108
5115
  validate = true,
5109
5116
  global = false
@@ -5113,7 +5120,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
5113
5120
  if (isRoot) {
5114
5121
  const relativePath2 = paths.root.relativeFilePath;
5115
5122
  const fileContent2 = await readFileContent(
5116
- (0, import_node_path51.join)(baseDir, paths.root.relativeDirPath, relativePath2)
5123
+ (0, import_node_path52.join)(baseDir, paths.root.relativeDirPath, relativePath2)
5117
5124
  );
5118
5125
  return new _ClaudecodeRule({
5119
5126
  baseDir,
@@ -5127,8 +5134,8 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
5127
5134
  if (!paths.nonRoot) {
5128
5135
  throw new Error("nonRoot path is not set");
5129
5136
  }
5130
- const relativePath = (0, import_node_path51.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
5131
- const fileContent = await readFileContent((0, import_node_path51.join)(baseDir, relativePath));
5137
+ const relativePath = (0, import_node_path52.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
5138
+ const fileContent = await readFileContent((0, import_node_path52.join)(baseDir, relativePath));
5132
5139
  return new _ClaudecodeRule({
5133
5140
  baseDir,
5134
5141
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -5139,7 +5146,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
5139
5146
  });
5140
5147
  }
5141
5148
  static fromRulesyncRule({
5142
- baseDir = ".",
5149
+ baseDir = process.cwd(),
5143
5150
  rulesyncRule,
5144
5151
  validate = true,
5145
5152
  global = false
@@ -5170,10 +5177,10 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
5170
5177
  };
5171
5178
 
5172
5179
  // src/rules/cline-rule.ts
5173
- var import_node_path52 = require("path");
5174
- var import_mini18 = require("zod/mini");
5175
- var ClineRuleFrontmatterSchema = import_mini18.z.object({
5176
- description: import_mini18.z.string()
5180
+ var import_node_path53 = require("path");
5181
+ var import_mini19 = require("zod/mini");
5182
+ var ClineRuleFrontmatterSchema = import_mini19.z.object({
5183
+ description: import_mini19.z.string()
5177
5184
  });
5178
5185
  var ClineRule = class _ClineRule extends ToolRule {
5179
5186
  static getSettablePaths() {
@@ -5187,7 +5194,7 @@ var ClineRule = class _ClineRule extends ToolRule {
5187
5194
  return this.toRulesyncRuleDefault();
5188
5195
  }
5189
5196
  static fromRulesyncRule({
5190
- baseDir = ".",
5197
+ baseDir = process.cwd(),
5191
5198
  rulesyncRule,
5192
5199
  validate = true
5193
5200
  }) {
@@ -5210,12 +5217,12 @@ var ClineRule = class _ClineRule extends ToolRule {
5210
5217
  });
5211
5218
  }
5212
5219
  static async fromFile({
5213
- baseDir = ".",
5220
+ baseDir = process.cwd(),
5214
5221
  relativeFilePath,
5215
5222
  validate = true
5216
5223
  }) {
5217
5224
  const fileContent = await readFileContent(
5218
- (0, import_node_path52.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5225
+ (0, import_node_path53.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5219
5226
  );
5220
5227
  return new _ClineRule({
5221
5228
  baseDir,
@@ -5228,7 +5235,7 @@ var ClineRule = class _ClineRule extends ToolRule {
5228
5235
  };
5229
5236
 
5230
5237
  // src/rules/codexcli-rule.ts
5231
- var import_node_path53 = require("path");
5238
+ var import_node_path54 = require("path");
5232
5239
  var CodexcliRule = class _CodexcliRule extends ToolRule {
5233
5240
  static getSettablePaths({
5234
5241
  global
@@ -5247,12 +5254,12 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
5247
5254
  relativeFilePath: "AGENTS.md"
5248
5255
  },
5249
5256
  nonRoot: {
5250
- relativeDirPath: (0, import_node_path53.join)(".codex", "memories")
5257
+ relativeDirPath: (0, import_node_path54.join)(".codex", "memories")
5251
5258
  }
5252
5259
  };
5253
5260
  }
5254
5261
  static async fromFile({
5255
- baseDir = ".",
5262
+ baseDir = process.cwd(),
5256
5263
  relativeFilePath,
5257
5264
  validate = true,
5258
5265
  global = false
@@ -5262,7 +5269,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
5262
5269
  if (isRoot) {
5263
5270
  const relativePath2 = paths.root.relativeFilePath;
5264
5271
  const fileContent2 = await readFileContent(
5265
- (0, import_node_path53.join)(baseDir, paths.root.relativeDirPath, relativePath2)
5272
+ (0, import_node_path54.join)(baseDir, paths.root.relativeDirPath, relativePath2)
5266
5273
  );
5267
5274
  return new _CodexcliRule({
5268
5275
  baseDir,
@@ -5276,8 +5283,8 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
5276
5283
  if (!paths.nonRoot) {
5277
5284
  throw new Error("nonRoot path is not set");
5278
5285
  }
5279
- const relativePath = (0, import_node_path53.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
5280
- const fileContent = await readFileContent((0, import_node_path53.join)(baseDir, relativePath));
5286
+ const relativePath = (0, import_node_path54.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
5287
+ const fileContent = await readFileContent((0, import_node_path54.join)(baseDir, relativePath));
5281
5288
  return new _CodexcliRule({
5282
5289
  baseDir,
5283
5290
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -5288,7 +5295,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
5288
5295
  });
5289
5296
  }
5290
5297
  static fromRulesyncRule({
5291
- baseDir = ".",
5298
+ baseDir = process.cwd(),
5292
5299
  rulesyncRule,
5293
5300
  validate = true,
5294
5301
  global = false
@@ -5319,11 +5326,11 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
5319
5326
  };
5320
5327
 
5321
5328
  // src/rules/copilot-rule.ts
5322
- var import_node_path54 = require("path");
5323
- var import_mini19 = require("zod/mini");
5324
- var CopilotRuleFrontmatterSchema = import_mini19.z.object({
5325
- description: import_mini19.z.optional(import_mini19.z.string()),
5326
- applyTo: import_mini19.z.optional(import_mini19.z.string())
5329
+ var import_node_path55 = require("path");
5330
+ var import_mini20 = require("zod/mini");
5331
+ var CopilotRuleFrontmatterSchema = import_mini20.z.object({
5332
+ description: import_mini20.z.optional(import_mini20.z.string()),
5333
+ applyTo: import_mini20.z.optional(import_mini20.z.string())
5327
5334
  });
5328
5335
  var CopilotRule = class _CopilotRule extends ToolRule {
5329
5336
  frontmatter;
@@ -5335,7 +5342,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5335
5342
  relativeFilePath: "copilot-instructions.md"
5336
5343
  },
5337
5344
  nonRoot: {
5338
- relativeDirPath: (0, import_node_path54.join)(".github", "instructions")
5345
+ relativeDirPath: (0, import_node_path55.join)(".github", "instructions")
5339
5346
  }
5340
5347
  };
5341
5348
  }
@@ -5344,7 +5351,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5344
5351
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
5345
5352
  if (!result.success) {
5346
5353
  throw new Error(
5347
- `Invalid frontmatter in ${(0, import_node_path54.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
5354
+ `Invalid frontmatter in ${(0, import_node_path55.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
5348
5355
  );
5349
5356
  }
5350
5357
  }
@@ -5375,13 +5382,13 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5375
5382
  baseDir: this.getBaseDir(),
5376
5383
  frontmatter: rulesyncFrontmatter,
5377
5384
  body: this.body,
5378
- relativeDirPath: (0, import_node_path54.join)(".rulesync", "rules"),
5385
+ relativeDirPath: (0, import_node_path55.join)(".rulesync", "rules"),
5379
5386
  relativeFilePath,
5380
5387
  validate: true
5381
5388
  });
5382
5389
  }
5383
5390
  static fromRulesyncRule({
5384
- baseDir = ".",
5391
+ baseDir = process.cwd(),
5385
5392
  rulesyncRule,
5386
5393
  validate = true
5387
5394
  }) {
@@ -5417,16 +5424,16 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5417
5424
  });
5418
5425
  }
5419
5426
  static async fromFile({
5420
- baseDir = ".",
5427
+ baseDir = process.cwd(),
5421
5428
  relativeFilePath,
5422
5429
  validate = true
5423
5430
  }) {
5424
5431
  const isRoot = relativeFilePath === "copilot-instructions.md";
5425
- const relativePath = isRoot ? (0, import_node_path54.join)(
5432
+ const relativePath = isRoot ? (0, import_node_path55.join)(
5426
5433
  this.getSettablePaths().root.relativeDirPath,
5427
5434
  this.getSettablePaths().root.relativeFilePath
5428
- ) : (0, import_node_path54.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
5429
- const fileContent = await readFileContent((0, import_node_path54.join)(baseDir, relativePath));
5435
+ ) : (0, import_node_path55.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
5436
+ const fileContent = await readFileContent((0, import_node_path55.join)(baseDir, relativePath));
5430
5437
  if (isRoot) {
5431
5438
  return new _CopilotRule({
5432
5439
  baseDir,
@@ -5445,7 +5452,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5445
5452
  const result = CopilotRuleFrontmatterSchema.safeParse(frontmatter);
5446
5453
  if (!result.success) {
5447
5454
  throw new Error(
5448
- `Invalid frontmatter in ${(0, import_node_path54.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
5455
+ `Invalid frontmatter in ${(0, import_node_path55.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
5449
5456
  );
5450
5457
  }
5451
5458
  return new _CopilotRule({
@@ -5469,7 +5476,7 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5469
5476
  return {
5470
5477
  success: false,
5471
5478
  error: new Error(
5472
- `Invalid frontmatter in ${(0, import_node_path54.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
5479
+ `Invalid frontmatter in ${(0, import_node_path55.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
5473
5480
  )
5474
5481
  };
5475
5482
  }
@@ -5489,12 +5496,12 @@ var CopilotRule = class _CopilotRule extends ToolRule {
5489
5496
  };
5490
5497
 
5491
5498
  // src/rules/cursor-rule.ts
5492
- var import_node_path55 = require("path");
5493
- var import_mini20 = require("zod/mini");
5494
- var CursorRuleFrontmatterSchema = import_mini20.z.object({
5495
- description: import_mini20.z.optional(import_mini20.z.string()),
5496
- globs: import_mini20.z.optional(import_mini20.z.string()),
5497
- alwaysApply: import_mini20.z.optional(import_mini20.z.boolean())
5499
+ var import_node_path56 = require("path");
5500
+ var import_mini21 = require("zod/mini");
5501
+ var CursorRuleFrontmatterSchema = import_mini21.z.object({
5502
+ description: import_mini21.z.optional(import_mini21.z.string()),
5503
+ globs: import_mini21.z.optional(import_mini21.z.string()),
5504
+ alwaysApply: import_mini21.z.optional(import_mini21.z.boolean())
5498
5505
  });
5499
5506
  var CursorRule = class _CursorRule extends ToolRule {
5500
5507
  frontmatter;
@@ -5502,7 +5509,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5502
5509
  static getSettablePaths() {
5503
5510
  return {
5504
5511
  nonRoot: {
5505
- relativeDirPath: (0, import_node_path55.join)(".cursor", "rules")
5512
+ relativeDirPath: (0, import_node_path56.join)(".cursor", "rules")
5506
5513
  }
5507
5514
  };
5508
5515
  }
@@ -5511,7 +5518,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5511
5518
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
5512
5519
  if (!result.success) {
5513
5520
  throw new Error(
5514
- `Invalid frontmatter in ${(0, import_node_path55.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
5521
+ `Invalid frontmatter in ${(0, import_node_path56.join)(rest.relativeDirPath, rest.relativeFilePath)}: ${formatError(result.error)}`
5515
5522
  );
5516
5523
  }
5517
5524
  }
@@ -5583,7 +5590,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5583
5590
  return new RulesyncRule({
5584
5591
  frontmatter: rulesyncFrontmatter,
5585
5592
  body: this.body,
5586
- relativeDirPath: (0, import_node_path55.join)(".rulesync", "rules"),
5593
+ relativeDirPath: (0, import_node_path56.join)(".rulesync", "rules"),
5587
5594
  relativeFilePath: this.relativeFilePath.replace(/\.mdc$/, ".md"),
5588
5595
  validate: true
5589
5596
  });
@@ -5599,7 +5606,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5599
5606
  return targetGlobs && targetGlobs.length > 0 ? targetGlobs.join(",") : void 0;
5600
5607
  }
5601
5608
  static fromRulesyncRule({
5602
- baseDir = ".",
5609
+ baseDir = process.cwd(),
5603
5610
  rulesyncRule,
5604
5611
  validate = true
5605
5612
  }) {
@@ -5623,24 +5630,24 @@ var CursorRule = class _CursorRule extends ToolRule {
5623
5630
  });
5624
5631
  }
5625
5632
  static async fromFile({
5626
- baseDir = ".",
5633
+ baseDir = process.cwd(),
5627
5634
  relativeFilePath,
5628
5635
  validate = true
5629
5636
  }) {
5630
5637
  const fileContent = await readFileContent(
5631
- (0, import_node_path55.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5638
+ (0, import_node_path56.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5632
5639
  );
5633
5640
  const { frontmatter, body: content } = _CursorRule.parseCursorFrontmatter(fileContent);
5634
5641
  const result = CursorRuleFrontmatterSchema.safeParse(frontmatter);
5635
5642
  if (!result.success) {
5636
5643
  throw new Error(
5637
- `Invalid frontmatter in ${(0, import_node_path55.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
5644
+ `Invalid frontmatter in ${(0, import_node_path56.join)(baseDir, relativeFilePath)}: ${formatError(result.error)}`
5638
5645
  );
5639
5646
  }
5640
5647
  return new _CursorRule({
5641
5648
  baseDir,
5642
5649
  relativeDirPath: this.getSettablePaths().nonRoot.relativeDirPath,
5643
- relativeFilePath: (0, import_node_path55.basename)(relativeFilePath),
5650
+ relativeFilePath: (0, import_node_path56.basename)(relativeFilePath),
5644
5651
  frontmatter: result.data,
5645
5652
  body: content.trim(),
5646
5653
  validate
@@ -5657,7 +5664,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5657
5664
  return {
5658
5665
  success: false,
5659
5666
  error: new Error(
5660
- `Invalid frontmatter in ${(0, import_node_path55.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
5667
+ `Invalid frontmatter in ${(0, import_node_path56.join)(this.relativeDirPath, this.relativeFilePath)}: ${formatError(result.error)}`
5661
5668
  )
5662
5669
  };
5663
5670
  }
@@ -5677,7 +5684,7 @@ var CursorRule = class _CursorRule extends ToolRule {
5677
5684
  };
5678
5685
 
5679
5686
  // src/rules/geminicli-rule.ts
5680
- var import_node_path56 = require("path");
5687
+ var import_node_path57 = require("path");
5681
5688
  var GeminiCliRule = class _GeminiCliRule extends ToolRule {
5682
5689
  static getSettablePaths({
5683
5690
  global
@@ -5696,12 +5703,12 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
5696
5703
  relativeFilePath: "GEMINI.md"
5697
5704
  },
5698
5705
  nonRoot: {
5699
- relativeDirPath: (0, import_node_path56.join)(".gemini", "memories")
5706
+ relativeDirPath: (0, import_node_path57.join)(".gemini", "memories")
5700
5707
  }
5701
5708
  };
5702
5709
  }
5703
5710
  static async fromFile({
5704
- baseDir = ".",
5711
+ baseDir = process.cwd(),
5705
5712
  relativeFilePath,
5706
5713
  validate = true,
5707
5714
  global = false
@@ -5711,7 +5718,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
5711
5718
  if (isRoot) {
5712
5719
  const relativePath2 = paths.root.relativeFilePath;
5713
5720
  const fileContent2 = await readFileContent(
5714
- (0, import_node_path56.join)(baseDir, paths.root.relativeDirPath, relativePath2)
5721
+ (0, import_node_path57.join)(baseDir, paths.root.relativeDirPath, relativePath2)
5715
5722
  );
5716
5723
  return new _GeminiCliRule({
5717
5724
  baseDir,
@@ -5725,8 +5732,8 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
5725
5732
  if (!paths.nonRoot) {
5726
5733
  throw new Error("nonRoot path is not set");
5727
5734
  }
5728
- const relativePath = (0, import_node_path56.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
5729
- const fileContent = await readFileContent((0, import_node_path56.join)(baseDir, relativePath));
5735
+ const relativePath = (0, import_node_path57.join)(paths.nonRoot.relativeDirPath, relativeFilePath);
5736
+ const fileContent = await readFileContent((0, import_node_path57.join)(baseDir, relativePath));
5730
5737
  return new _GeminiCliRule({
5731
5738
  baseDir,
5732
5739
  relativeDirPath: paths.nonRoot.relativeDirPath,
@@ -5737,7 +5744,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
5737
5744
  });
5738
5745
  }
5739
5746
  static fromRulesyncRule({
5740
- baseDir = ".",
5747
+ baseDir = process.cwd(),
5741
5748
  rulesyncRule,
5742
5749
  validate = true,
5743
5750
  global = false
@@ -5768,7 +5775,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
5768
5775
  };
5769
5776
 
5770
5777
  // src/rules/junie-rule.ts
5771
- var import_node_path57 = require("path");
5778
+ var import_node_path58 = require("path");
5772
5779
  var JunieRule = class _JunieRule extends ToolRule {
5773
5780
  static getSettablePaths() {
5774
5781
  return {
@@ -5777,18 +5784,18 @@ var JunieRule = class _JunieRule extends ToolRule {
5777
5784
  relativeFilePath: "guidelines.md"
5778
5785
  },
5779
5786
  nonRoot: {
5780
- relativeDirPath: (0, import_node_path57.join)(".junie", "memories")
5787
+ relativeDirPath: (0, import_node_path58.join)(".junie", "memories")
5781
5788
  }
5782
5789
  };
5783
5790
  }
5784
5791
  static async fromFile({
5785
- baseDir = ".",
5792
+ baseDir = process.cwd(),
5786
5793
  relativeFilePath,
5787
5794
  validate = true
5788
5795
  }) {
5789
5796
  const isRoot = relativeFilePath === "guidelines.md";
5790
- const relativePath = isRoot ? "guidelines.md" : (0, import_node_path57.join)(".junie", "memories", relativeFilePath);
5791
- const fileContent = await readFileContent((0, import_node_path57.join)(baseDir, relativePath));
5797
+ const relativePath = isRoot ? "guidelines.md" : (0, import_node_path58.join)(".junie", "memories", relativeFilePath);
5798
+ const fileContent = await readFileContent((0, import_node_path58.join)(baseDir, relativePath));
5792
5799
  return new _JunieRule({
5793
5800
  baseDir,
5794
5801
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -5799,7 +5806,7 @@ var JunieRule = class _JunieRule extends ToolRule {
5799
5806
  });
5800
5807
  }
5801
5808
  static fromRulesyncRule({
5802
- baseDir = ".",
5809
+ baseDir = process.cwd(),
5803
5810
  rulesyncRule,
5804
5811
  validate = true
5805
5812
  }) {
@@ -5828,22 +5835,22 @@ var JunieRule = class _JunieRule extends ToolRule {
5828
5835
  };
5829
5836
 
5830
5837
  // src/rules/kiro-rule.ts
5831
- var import_node_path58 = require("path");
5838
+ var import_node_path59 = require("path");
5832
5839
  var KiroRule = class _KiroRule extends ToolRule {
5833
5840
  static getSettablePaths() {
5834
5841
  return {
5835
5842
  nonRoot: {
5836
- relativeDirPath: (0, import_node_path58.join)(".kiro", "steering")
5843
+ relativeDirPath: (0, import_node_path59.join)(".kiro", "steering")
5837
5844
  }
5838
5845
  };
5839
5846
  }
5840
5847
  static async fromFile({
5841
- baseDir = ".",
5848
+ baseDir = process.cwd(),
5842
5849
  relativeFilePath,
5843
5850
  validate = true
5844
5851
  }) {
5845
5852
  const fileContent = await readFileContent(
5846
- (0, import_node_path58.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5853
+ (0, import_node_path59.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
5847
5854
  );
5848
5855
  return new _KiroRule({
5849
5856
  baseDir,
@@ -5855,7 +5862,7 @@ var KiroRule = class _KiroRule extends ToolRule {
5855
5862
  });
5856
5863
  }
5857
5864
  static fromRulesyncRule({
5858
- baseDir = ".",
5865
+ baseDir = process.cwd(),
5859
5866
  rulesyncRule,
5860
5867
  validate = true
5861
5868
  }) {
@@ -5883,7 +5890,7 @@ var KiroRule = class _KiroRule extends ToolRule {
5883
5890
  };
5884
5891
 
5885
5892
  // src/rules/opencode-rule.ts
5886
- var import_node_path59 = require("path");
5893
+ var import_node_path60 = require("path");
5887
5894
  var OpenCodeRule = class _OpenCodeRule extends ToolRule {
5888
5895
  static getSettablePaths() {
5889
5896
  return {
@@ -5892,18 +5899,18 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
5892
5899
  relativeFilePath: "AGENTS.md"
5893
5900
  },
5894
5901
  nonRoot: {
5895
- relativeDirPath: (0, import_node_path59.join)(".opencode", "memories")
5902
+ relativeDirPath: (0, import_node_path60.join)(".opencode", "memories")
5896
5903
  }
5897
5904
  };
5898
5905
  }
5899
5906
  static async fromFile({
5900
- baseDir = ".",
5907
+ baseDir = process.cwd(),
5901
5908
  relativeFilePath,
5902
5909
  validate = true
5903
5910
  }) {
5904
5911
  const isRoot = relativeFilePath === "AGENTS.md";
5905
- const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path59.join)(".opencode", "memories", relativeFilePath);
5906
- const fileContent = await readFileContent((0, import_node_path59.join)(baseDir, relativePath));
5912
+ const relativePath = isRoot ? "AGENTS.md" : (0, import_node_path60.join)(".opencode", "memories", relativeFilePath);
5913
+ const fileContent = await readFileContent((0, import_node_path60.join)(baseDir, relativePath));
5907
5914
  return new _OpenCodeRule({
5908
5915
  baseDir,
5909
5916
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -5914,7 +5921,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
5914
5921
  });
5915
5922
  }
5916
5923
  static fromRulesyncRule({
5917
- baseDir = ".",
5924
+ baseDir = process.cwd(),
5918
5925
  rulesyncRule,
5919
5926
  validate = true
5920
5927
  }) {
@@ -5943,7 +5950,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
5943
5950
  };
5944
5951
 
5945
5952
  // src/rules/qwencode-rule.ts
5946
- var import_node_path60 = require("path");
5953
+ var import_node_path61 = require("path");
5947
5954
  var QwencodeRule = class _QwencodeRule extends ToolRule {
5948
5955
  static getSettablePaths() {
5949
5956
  return {
@@ -5952,18 +5959,18 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
5952
5959
  relativeFilePath: "QWEN.md"
5953
5960
  },
5954
5961
  nonRoot: {
5955
- relativeDirPath: (0, import_node_path60.join)(".qwen", "memories")
5962
+ relativeDirPath: (0, import_node_path61.join)(".qwen", "memories")
5956
5963
  }
5957
5964
  };
5958
5965
  }
5959
5966
  static async fromFile({
5960
- baseDir = ".",
5967
+ baseDir = process.cwd(),
5961
5968
  relativeFilePath,
5962
5969
  validate = true
5963
5970
  }) {
5964
5971
  const isRoot = relativeFilePath === "QWEN.md";
5965
- const relativePath = isRoot ? "QWEN.md" : (0, import_node_path60.join)(".qwen", "memories", relativeFilePath);
5966
- const fileContent = await readFileContent((0, import_node_path60.join)(baseDir, relativePath));
5972
+ const relativePath = isRoot ? "QWEN.md" : (0, import_node_path61.join)(".qwen", "memories", relativeFilePath);
5973
+ const fileContent = await readFileContent((0, import_node_path61.join)(baseDir, relativePath));
5967
5974
  return new _QwencodeRule({
5968
5975
  baseDir,
5969
5976
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : this.getSettablePaths().nonRoot.relativeDirPath,
@@ -5974,7 +5981,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
5974
5981
  });
5975
5982
  }
5976
5983
  static fromRulesyncRule(params) {
5977
- const { baseDir = ".", rulesyncRule, validate = true } = params;
5984
+ const { baseDir = process.cwd(), rulesyncRule, validate = true } = params;
5978
5985
  return new _QwencodeRule(
5979
5986
  this.buildToolRuleParamsDefault({
5980
5987
  baseDir,
@@ -6000,22 +6007,22 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
6000
6007
  };
6001
6008
 
6002
6009
  // src/rules/roo-rule.ts
6003
- var import_node_path61 = require("path");
6010
+ var import_node_path62 = require("path");
6004
6011
  var RooRule = class _RooRule extends ToolRule {
6005
6012
  static getSettablePaths() {
6006
6013
  return {
6007
6014
  nonRoot: {
6008
- relativeDirPath: (0, import_node_path61.join)(".roo", "rules")
6015
+ relativeDirPath: (0, import_node_path62.join)(".roo", "rules")
6009
6016
  }
6010
6017
  };
6011
6018
  }
6012
6019
  static async fromFile({
6013
- baseDir = ".",
6020
+ baseDir = process.cwd(),
6014
6021
  relativeFilePath,
6015
6022
  validate = true
6016
6023
  }) {
6017
6024
  const fileContent = await readFileContent(
6018
- (0, import_node_path61.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
6025
+ (0, import_node_path62.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
6019
6026
  );
6020
6027
  return new _RooRule({
6021
6028
  baseDir,
@@ -6027,7 +6034,7 @@ var RooRule = class _RooRule extends ToolRule {
6027
6034
  });
6028
6035
  }
6029
6036
  static fromRulesyncRule({
6030
- baseDir = ".",
6037
+ baseDir = process.cwd(),
6031
6038
  rulesyncRule,
6032
6039
  validate = true
6033
6040
  }) {
@@ -6070,7 +6077,7 @@ var RooRule = class _RooRule extends ToolRule {
6070
6077
  };
6071
6078
 
6072
6079
  // src/rules/warp-rule.ts
6073
- var import_node_path62 = require("path");
6080
+ var import_node_path63 = require("path");
6074
6081
  var WarpRule = class _WarpRule extends ToolRule {
6075
6082
  constructor({ fileContent, root, ...rest }) {
6076
6083
  super({
@@ -6086,18 +6093,18 @@ var WarpRule = class _WarpRule extends ToolRule {
6086
6093
  relativeFilePath: "WARP.md"
6087
6094
  },
6088
6095
  nonRoot: {
6089
- relativeDirPath: (0, import_node_path62.join)(".warp", "memories")
6096
+ relativeDirPath: (0, import_node_path63.join)(".warp", "memories")
6090
6097
  }
6091
6098
  };
6092
6099
  }
6093
6100
  static async fromFile({
6094
- baseDir = ".",
6101
+ baseDir = process.cwd(),
6095
6102
  relativeFilePath,
6096
6103
  validate = true
6097
6104
  }) {
6098
6105
  const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
6099
- const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path62.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
6100
- const fileContent = await readFileContent((0, import_node_path62.join)(baseDir, relativePath));
6106
+ const relativePath = isRoot ? this.getSettablePaths().root.relativeFilePath : (0, import_node_path63.join)(this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath);
6107
+ const fileContent = await readFileContent((0, import_node_path63.join)(baseDir, relativePath));
6101
6108
  return new _WarpRule({
6102
6109
  baseDir,
6103
6110
  relativeDirPath: isRoot ? this.getSettablePaths().root.relativeDirPath : ".warp",
@@ -6108,7 +6115,7 @@ var WarpRule = class _WarpRule extends ToolRule {
6108
6115
  });
6109
6116
  }
6110
6117
  static fromRulesyncRule({
6111
- baseDir = ".",
6118
+ baseDir = process.cwd(),
6112
6119
  rulesyncRule,
6113
6120
  validate = true
6114
6121
  }) {
@@ -6137,22 +6144,22 @@ var WarpRule = class _WarpRule extends ToolRule {
6137
6144
  };
6138
6145
 
6139
6146
  // src/rules/windsurf-rule.ts
6140
- var import_node_path63 = require("path");
6147
+ var import_node_path64 = require("path");
6141
6148
  var WindsurfRule = class _WindsurfRule extends ToolRule {
6142
6149
  static getSettablePaths() {
6143
6150
  return {
6144
6151
  nonRoot: {
6145
- relativeDirPath: (0, import_node_path63.join)(".windsurf", "rules")
6152
+ relativeDirPath: (0, import_node_path64.join)(".windsurf", "rules")
6146
6153
  }
6147
6154
  };
6148
6155
  }
6149
6156
  static async fromFile({
6150
- baseDir = ".",
6157
+ baseDir = process.cwd(),
6151
6158
  relativeFilePath,
6152
6159
  validate = true
6153
6160
  }) {
6154
6161
  const fileContent = await readFileContent(
6155
- (0, import_node_path63.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
6162
+ (0, import_node_path64.join)(baseDir, this.getSettablePaths().nonRoot.relativeDirPath, relativeFilePath)
6156
6163
  );
6157
6164
  return new _WindsurfRule({
6158
6165
  baseDir,
@@ -6163,7 +6170,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
6163
6170
  });
6164
6171
  }
6165
6172
  static fromRulesyncRule({
6166
- baseDir = ".",
6173
+ baseDir = process.cwd(),
6167
6174
  rulesyncRule,
6168
6175
  validate = true
6169
6176
  }) {
@@ -6210,7 +6217,7 @@ var rulesProcessorToolTargets = [
6210
6217
  "warp",
6211
6218
  "windsurf"
6212
6219
  ];
6213
- var RulesProcessorToolTargetSchema = import_mini21.z.enum(rulesProcessorToolTargets);
6220
+ var RulesProcessorToolTargetSchema = import_mini22.z.enum(rulesProcessorToolTargets);
6214
6221
  var rulesProcessorToolTargetsGlobal = [
6215
6222
  "claudecode",
6216
6223
  "codexcli",
@@ -6222,7 +6229,7 @@ var RulesProcessor = class extends FeatureProcessor {
6222
6229
  simulateSubagents;
6223
6230
  global;
6224
6231
  constructor({
6225
- baseDir = ".",
6232
+ baseDir = process.cwd(),
6226
6233
  toolTarget,
6227
6234
  simulateCommands = false,
6228
6235
  simulateSubagents = false,
@@ -6552,10 +6559,10 @@ var RulesProcessor = class extends FeatureProcessor {
6552
6559
  * Load and parse rulesync rule files from .rulesync/rules/ directory
6553
6560
  */
6554
6561
  async loadRulesyncFiles() {
6555
- const files = await findFilesByGlobs((0, import_node_path64.join)(".rulesync", "rules", "*.md"));
6562
+ const files = await findFilesByGlobs((0, import_node_path65.join)(".rulesync", "rules", "*.md"));
6556
6563
  logger.debug(`Found ${files.length} rulesync files`);
6557
6564
  const rulesyncRules = await Promise.all(
6558
- files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path64.basename)(file) }))
6565
+ files.map((file) => RulesyncRule.fromFile({ relativeFilePath: (0, import_node_path65.basename)(file) }))
6559
6566
  );
6560
6567
  const rootRules = rulesyncRules.filter((rule) => rule.getFrontmatter().root);
6561
6568
  if (rootRules.length > 1) {
@@ -6573,10 +6580,10 @@ var RulesProcessor = class extends FeatureProcessor {
6573
6580
  return rulesyncRules;
6574
6581
  }
6575
6582
  async loadRulesyncFilesLegacy() {
6576
- const legacyFiles = await findFilesByGlobs((0, import_node_path64.join)(".rulesync", "*.md"));
6583
+ const legacyFiles = await findFilesByGlobs((0, import_node_path65.join)(".rulesync", "*.md"));
6577
6584
  logger.debug(`Found ${legacyFiles.length} legacy rulesync files`);
6578
6585
  return Promise.all(
6579
- legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path64.basename)(file) }))
6586
+ legacyFiles.map((file) => RulesyncRule.fromFileLegacy({ relativeFilePath: (0, import_node_path65.basename)(file) }))
6580
6587
  );
6581
6588
  }
6582
6589
  /**
@@ -6640,13 +6647,13 @@ var RulesProcessor = class extends FeatureProcessor {
6640
6647
  return [];
6641
6648
  }
6642
6649
  const rootFilePaths = await findFilesByGlobs(
6643
- (0, import_node_path64.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
6650
+ (0, import_node_path65.join)(this.baseDir, root.relativeDirPath ?? ".", root.relativeFilePath)
6644
6651
  );
6645
6652
  return await Promise.all(
6646
6653
  rootFilePaths.map(
6647
6654
  (filePath) => root.fromFile({
6648
6655
  baseDir: this.baseDir,
6649
- relativeFilePath: (0, import_node_path64.basename)(filePath),
6656
+ relativeFilePath: (0, import_node_path65.basename)(filePath),
6650
6657
  global: this.global
6651
6658
  })
6652
6659
  )
@@ -6658,13 +6665,13 @@ var RulesProcessor = class extends FeatureProcessor {
6658
6665
  return [];
6659
6666
  }
6660
6667
  const nonRootFilePaths = await findFilesByGlobs(
6661
- (0, import_node_path64.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
6668
+ (0, import_node_path65.join)(this.baseDir, nonRoot.relativeDirPath, `*.${nonRoot.extension}`)
6662
6669
  );
6663
6670
  return await Promise.all(
6664
6671
  nonRootFilePaths.map(
6665
6672
  (filePath) => nonRoot.fromFile({
6666
6673
  baseDir: this.baseDir,
6667
- relativeFilePath: (0, import_node_path64.basename)(filePath),
6674
+ relativeFilePath: (0, import_node_path65.basename)(filePath),
6668
6675
  global: this.global
6669
6676
  })
6670
6677
  )
@@ -7034,14 +7041,14 @@ s/<command> [arguments]
7034
7041
  This syntax employs a double slash (\`s/\`) to prevent conflicts with built-in slash commands.
7035
7042
  The \`s\` in \`s/\` stands for *simulate*. Because custom slash commands are not built-in, this syntax provides a pseudo way to invoke them.
7036
7043
 
7037
- When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path64.join)(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
7044
+ When users call a custom slash command, you have to look for the markdown file, \`${(0, import_node_path65.join)(commands.relativeDirPath, "{command}.md")}\`, then execute the contents of that file as the block of operations.` : "";
7038
7045
  const subagentsSection = subagents ? `## Simulated Subagents
7039
7046
 
7040
7047
  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.
7041
7048
 
7042
- When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path64.join)(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
7049
+ When users call a simulated subagent, it will look for the corresponding markdown file, \`${(0, import_node_path65.join)(subagents.relativeDirPath, "{subagent}.md")}\`, and execute its contents as the block of operations.
7043
7050
 
7044
- For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path64.join)(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.` : "";
7051
+ For example, if the user instructs \`Call planner subagent to plan the refactoring\`, you have to look for the markdown file, \`${(0, import_node_path65.join)(subagents.relativeDirPath, "planner.md")}\`, and execute its contents as the block of operations.` : "";
7045
7052
  const result = [
7046
7053
  overview,
7047
7054
  ...this.simulateCommands && CommandsProcessor.getToolTargetsSimulated().includes(this.toolTarget) ? [commandsSection] : [],
@@ -7255,9 +7262,9 @@ async function generateSubagents(config) {
7255
7262
  }
7256
7263
 
7257
7264
  // src/cli/commands/gitignore.ts
7258
- var import_node_path65 = require("path");
7265
+ var import_node_path66 = require("path");
7259
7266
  var gitignoreCommand = async () => {
7260
- const gitignorePath = (0, import_node_path65.join)(process.cwd(), ".gitignore");
7267
+ const gitignorePath = (0, import_node_path66.join)(process.cwd(), ".gitignore");
7261
7268
  const rulesFilesToIgnore = [
7262
7269
  "# Generated by rulesync - AI tool configuration files",
7263
7270
  // AGENTS.md
@@ -7498,7 +7505,7 @@ async function importSubagents(config, tool) {
7498
7505
  }
7499
7506
 
7500
7507
  // src/cli/commands/init.ts
7501
- var import_node_path66 = require("path");
7508
+ var import_node_path67 = require("path");
7502
7509
  async function initCommand() {
7503
7510
  logger.info("Initializing rulesync...");
7504
7511
  await ensureDir(".rulesync");
@@ -7659,14 +7666,14 @@ Attention, again, you are just the planner, so though you can read any files and
7659
7666
  await ensureDir(commandPaths.relativeDirPath);
7660
7667
  await ensureDir(subagentPaths.relativeDirPath);
7661
7668
  await ensureDir(ignorePaths.relativeDirPath);
7662
- const ruleFilepath = (0, import_node_path66.join)(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
7669
+ const ruleFilepath = (0, import_node_path67.join)(rulePaths.recommended.relativeDirPath, sampleRuleFile.filename);
7663
7670
  if (!await fileExists(ruleFilepath)) {
7664
7671
  await writeFileContent(ruleFilepath, sampleRuleFile.content);
7665
7672
  logger.success(`Created ${ruleFilepath}`);
7666
7673
  } else {
7667
7674
  logger.info(`Skipped ${ruleFilepath} (already exists)`);
7668
7675
  }
7669
- const mcpFilepath = (0, import_node_path66.join)(
7676
+ const mcpFilepath = (0, import_node_path67.join)(
7670
7677
  mcpPaths.recommended.relativeDirPath,
7671
7678
  mcpPaths.recommended.relativeFilePath
7672
7679
  );
@@ -7676,21 +7683,21 @@ Attention, again, you are just the planner, so though you can read any files and
7676
7683
  } else {
7677
7684
  logger.info(`Skipped ${mcpFilepath} (already exists)`);
7678
7685
  }
7679
- const commandFilepath = (0, import_node_path66.join)(commandPaths.relativeDirPath, sampleCommandFile.filename);
7686
+ const commandFilepath = (0, import_node_path67.join)(commandPaths.relativeDirPath, sampleCommandFile.filename);
7680
7687
  if (!await fileExists(commandFilepath)) {
7681
7688
  await writeFileContent(commandFilepath, sampleCommandFile.content);
7682
7689
  logger.success(`Created ${commandFilepath}`);
7683
7690
  } else {
7684
7691
  logger.info(`Skipped ${commandFilepath} (already exists)`);
7685
7692
  }
7686
- const subagentFilepath = (0, import_node_path66.join)(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
7693
+ const subagentFilepath = (0, import_node_path67.join)(subagentPaths.relativeDirPath, sampleSubagentFile.filename);
7687
7694
  if (!await fileExists(subagentFilepath)) {
7688
7695
  await writeFileContent(subagentFilepath, sampleSubagentFile.content);
7689
7696
  logger.success(`Created ${subagentFilepath}`);
7690
7697
  } else {
7691
7698
  logger.info(`Skipped ${subagentFilepath} (already exists)`);
7692
7699
  }
7693
- const ignoreFilepath = (0, import_node_path66.join)(ignorePaths.relativeDirPath, ignorePaths.relativeFilePath);
7700
+ const ignoreFilepath = (0, import_node_path67.join)(ignorePaths.relativeDirPath, ignorePaths.relativeFilePath);
7694
7701
  if (!await fileExists(ignoreFilepath)) {
7695
7702
  await writeFileContent(ignoreFilepath, sampleIgnoreFile.content);
7696
7703
  logger.success(`Created ${ignoreFilepath}`);
@@ -7700,7 +7707,7 @@ Attention, again, you are just the planner, so though you can read any files and
7700
7707
  }
7701
7708
 
7702
7709
  // src/cli/index.ts
7703
- var getVersion = () => "3.13.0";
7710
+ var getVersion = () => "3.15.0";
7704
7711
  var main = async () => {
7705
7712
  const program = new import_commander.Command();
7706
7713
  const version = getVersion();