rulesync 6.6.0 → 6.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -10409,6 +10409,9 @@ var ToolRule = class extends ToolFile {
10409
10409
  return false;
10410
10410
  }
10411
10411
  };
10412
+ function buildToolPath(toolDir, subDir, excludeToolDir) {
10413
+ return excludeToolDir ? subDir : (0, import_node_path84.join)(toolDir, subDir);
10414
+ }
10412
10415
 
10413
10416
  // src/features/rules/agentsmd-rule.ts
10414
10417
  var AgentsMdRule = class _AgentsMdRule extends ToolRule {
@@ -10426,7 +10429,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
10426
10429
  relativeFilePath: "AGENTS.md"
10427
10430
  },
10428
10431
  nonRoot: {
10429
- relativeDirPath: _options.excludeToolDir ? "memories" : (0, import_node_path85.join)(".agents", "memories")
10432
+ relativeDirPath: buildToolPath(".agents", "memories", _options.excludeToolDir)
10430
10433
  }
10431
10434
  };
10432
10435
  }
@@ -10666,7 +10669,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
10666
10669
  static getSettablePaths(_options = {}) {
10667
10670
  return {
10668
10671
  nonRoot: {
10669
- relativeDirPath: _options.excludeToolDir ? "rules" : (0, import_node_path86.join)(".agent", "rules")
10672
+ relativeDirPath: buildToolPath(".agent", "rules", _options.excludeToolDir)
10670
10673
  }
10671
10674
  };
10672
10675
  }
@@ -10842,7 +10845,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
10842
10845
  relativeFilePath: ".augment-guidelines"
10843
10846
  },
10844
10847
  nonRoot: {
10845
- relativeDirPath: _options.excludeToolDir ? "rules" : (0, import_node_path87.join)(".augment", "rules")
10848
+ relativeDirPath: buildToolPath(".augment", "rules", _options.excludeToolDir)
10846
10849
  }
10847
10850
  };
10848
10851
  }
@@ -10915,7 +10918,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
10915
10918
  static getSettablePaths(_options = {}) {
10916
10919
  return {
10917
10920
  nonRoot: {
10918
- relativeDirPath: _options.excludeToolDir ? "rules" : (0, import_node_path88.join)(".augment", "rules")
10921
+ relativeDirPath: buildToolPath(".augment", "rules", _options.excludeToolDir)
10919
10922
  }
10920
10923
  };
10921
10924
  }
@@ -10984,7 +10987,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
10984
10987
  if (global) {
10985
10988
  return {
10986
10989
  root: {
10987
- relativeDirPath: excludeToolDir ? "." : ".claude",
10990
+ relativeDirPath: buildToolPath(".claude", ".", excludeToolDir),
10988
10991
  relativeFilePath: "CLAUDE.md"
10989
10992
  }
10990
10993
  };
@@ -10995,7 +10998,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
10995
10998
  relativeFilePath: "CLAUDE.md"
10996
10999
  },
10997
11000
  nonRoot: {
10998
- relativeDirPath: excludeToolDir ? "memories" : (0, import_node_path89.join)(".claude", "memories")
11001
+ relativeDirPath: buildToolPath(".claude", "memories", excludeToolDir)
10999
11002
  }
11000
11003
  };
11001
11004
  }
@@ -11099,7 +11102,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
11099
11102
  if (global) {
11100
11103
  return {
11101
11104
  root: {
11102
- relativeDirPath: excludeToolDir ? "." : ".claude",
11105
+ relativeDirPath: buildToolPath(".claude", ".", excludeToolDir),
11103
11106
  relativeFilePath: "CLAUDE.md"
11104
11107
  }
11105
11108
  };
@@ -11110,7 +11113,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
11110
11113
  relativeFilePath: "CLAUDE.md"
11111
11114
  },
11112
11115
  nonRoot: {
11113
- relativeDirPath: excludeToolDir ? "rules" : (0, import_node_path90.join)(".claude", "rules")
11116
+ relativeDirPath: buildToolPath(".claude", "rules", excludeToolDir)
11114
11117
  }
11115
11118
  };
11116
11119
  }
@@ -11376,7 +11379,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
11376
11379
  if (global) {
11377
11380
  return {
11378
11381
  root: {
11379
- relativeDirPath: excludeToolDir ? "." : ".codex",
11382
+ relativeDirPath: buildToolPath(".codex", ".", excludeToolDir),
11380
11383
  relativeFilePath: "AGENTS.md"
11381
11384
  }
11382
11385
  };
@@ -11387,7 +11390,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
11387
11390
  relativeFilePath: "AGENTS.md"
11388
11391
  },
11389
11392
  nonRoot: {
11390
- relativeDirPath: excludeToolDir ? "memories" : (0, import_node_path92.join)(".codex", "memories")
11393
+ relativeDirPath: buildToolPath(".codex", "memories", excludeToolDir)
11391
11394
  }
11392
11395
  };
11393
11396
  }
@@ -11489,11 +11492,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
11489
11492
  static getSettablePaths(_options = {}) {
11490
11493
  return {
11491
11494
  root: {
11492
- relativeDirPath: _options.excludeToolDir ? "." : ".github",
11495
+ relativeDirPath: buildToolPath(".github", ".", _options.excludeToolDir),
11493
11496
  relativeFilePath: "copilot-instructions.md"
11494
11497
  },
11495
11498
  nonRoot: {
11496
- relativeDirPath: _options.excludeToolDir ? "instructions" : (0, import_node_path93.join)(".github", "instructions")
11499
+ relativeDirPath: buildToolPath(".github", "instructions", _options.excludeToolDir)
11497
11500
  }
11498
11501
  };
11499
11502
  }
@@ -11677,7 +11680,7 @@ var CursorRule = class _CursorRule extends ToolRule {
11677
11680
  static getSettablePaths(_options = {}) {
11678
11681
  return {
11679
11682
  nonRoot: {
11680
- relativeDirPath: _options.excludeToolDir ? "rules" : (0, import_node_path94.join)(".cursor", "rules")
11683
+ relativeDirPath: buildToolPath(".cursor", "rules", _options.excludeToolDir)
11681
11684
  }
11682
11685
  };
11683
11686
  }
@@ -11879,21 +11882,21 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
11879
11882
  if (options?.global) {
11880
11883
  return {
11881
11884
  root: {
11882
- relativeDirPath: options.excludeToolDir ? "." : ".factorydroid",
11885
+ relativeDirPath: buildToolPath(".factorydroid", ".", options.excludeToolDir),
11883
11886
  relativeFilePath: "AGENTS.md"
11884
11887
  },
11885
11888
  nonRoot: {
11886
- relativeDirPath: options.excludeToolDir ? "memories" : (0, import_node_path95.join)(".factorydroid", "memories")
11889
+ relativeDirPath: buildToolPath(".factorydroid", "memories", options.excludeToolDir)
11887
11890
  }
11888
11891
  };
11889
11892
  }
11890
11893
  return {
11891
11894
  root: {
11892
- relativeDirPath: options?.excludeToolDir ? "." : ".factorydroid",
11895
+ relativeDirPath: buildToolPath(".factorydroid", ".", options?.excludeToolDir),
11893
11896
  relativeFilePath: "AGENTS.md"
11894
11897
  },
11895
11898
  nonRoot: {
11896
- relativeDirPath: options?.excludeToolDir ? "memories" : (0, import_node_path95.join)(".factorydroid", "memories")
11899
+ relativeDirPath: buildToolPath(".factorydroid", "memories", options?.excludeToolDir)
11897
11900
  }
11898
11901
  };
11899
11902
  }
@@ -11974,7 +11977,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
11974
11977
  if (global) {
11975
11978
  return {
11976
11979
  root: {
11977
- relativeDirPath: excludeToolDir ? "." : ".gemini",
11980
+ relativeDirPath: buildToolPath(".gemini", ".", excludeToolDir),
11978
11981
  relativeFilePath: "GEMINI.md"
11979
11982
  }
11980
11983
  };
@@ -11985,7 +11988,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
11985
11988
  relativeFilePath: "GEMINI.md"
11986
11989
  },
11987
11990
  nonRoot: {
11988
- relativeDirPath: excludeToolDir ? "memories" : (0, import_node_path96.join)(".gemini", "memories")
11991
+ relativeDirPath: buildToolPath(".gemini", "memories", excludeToolDir)
11989
11992
  }
11990
11993
  };
11991
11994
  }
@@ -12079,11 +12082,11 @@ var JunieRule = class _JunieRule extends ToolRule {
12079
12082
  static getSettablePaths(_options = {}) {
12080
12083
  return {
12081
12084
  root: {
12082
- relativeDirPath: _options.excludeToolDir ? "." : ".junie",
12085
+ relativeDirPath: buildToolPath(".junie", ".", _options.excludeToolDir),
12083
12086
  relativeFilePath: "guidelines.md"
12084
12087
  },
12085
12088
  nonRoot: {
12086
- relativeDirPath: _options.excludeToolDir ? "memories" : (0, import_node_path97.join)(".junie", "memories")
12089
+ relativeDirPath: buildToolPath(".junie", "memories", _options.excludeToolDir)
12087
12090
  }
12088
12091
  };
12089
12092
  }
@@ -12154,7 +12157,7 @@ var KiloRule = class _KiloRule extends ToolRule {
12154
12157
  static getSettablePaths(_options = {}) {
12155
12158
  return {
12156
12159
  nonRoot: {
12157
- relativeDirPath: _options.excludeToolDir ? "rules" : (0, import_node_path98.join)(".kilocode", "rules")
12160
+ relativeDirPath: buildToolPath(".kilocode", "rules", _options.excludeToolDir)
12158
12161
  }
12159
12162
  };
12160
12163
  }
@@ -12221,7 +12224,7 @@ var KiroRule = class _KiroRule extends ToolRule {
12221
12224
  static getSettablePaths(_options = {}) {
12222
12225
  return {
12223
12226
  nonRoot: {
12224
- relativeDirPath: _options.excludeToolDir ? "steering" : (0, import_node_path99.join)(".kiro", "steering")
12227
+ relativeDirPath: buildToolPath(".kiro", "steering", _options.excludeToolDir)
12225
12228
  }
12226
12229
  };
12227
12230
  }
@@ -12294,7 +12297,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
12294
12297
  relativeFilePath: "AGENTS.md"
12295
12298
  },
12296
12299
  nonRoot: {
12297
- relativeDirPath: _options.excludeToolDir ? "memories" : (0, import_node_path100.join)(".opencode", "memories")
12300
+ relativeDirPath: buildToolPath(".opencode", "memories", _options.excludeToolDir)
12298
12301
  }
12299
12302
  };
12300
12303
  }
@@ -12369,7 +12372,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
12369
12372
  relativeFilePath: "QWEN.md"
12370
12373
  },
12371
12374
  nonRoot: {
12372
- relativeDirPath: _options.excludeToolDir ? "memories" : (0, import_node_path101.join)(".qwen", "memories")
12375
+ relativeDirPath: buildToolPath(".qwen", "memories", _options.excludeToolDir)
12373
12376
  }
12374
12377
  };
12375
12378
  }
@@ -12525,7 +12528,7 @@ var RooRule = class _RooRule extends ToolRule {
12525
12528
  static getSettablePaths(_options = {}) {
12526
12529
  return {
12527
12530
  nonRoot: {
12528
- relativeDirPath: _options.excludeToolDir ? "rules" : (0, import_node_path103.join)(".roo", "rules")
12531
+ relativeDirPath: buildToolPath(".roo", "rules", _options.excludeToolDir)
12529
12532
  }
12530
12533
  };
12531
12534
  }
@@ -12620,7 +12623,7 @@ var WarpRule = class _WarpRule extends ToolRule {
12620
12623
  relativeFilePath: "WARP.md"
12621
12624
  },
12622
12625
  nonRoot: {
12623
- relativeDirPath: _options.excludeToolDir ? "memories" : (0, import_node_path104.join)(".warp", "memories")
12626
+ relativeDirPath: buildToolPath(".warp", "memories", _options.excludeToolDir)
12624
12627
  }
12625
12628
  };
12626
12629
  }
@@ -12691,7 +12694,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
12691
12694
  static getSettablePaths(_options = {}) {
12692
12695
  return {
12693
12696
  nonRoot: {
12694
- relativeDirPath: _options.excludeToolDir ? "rules" : (0, import_node_path105.join)(".windsurf", "rules")
12697
+ relativeDirPath: buildToolPath(".windsurf", "rules", _options.excludeToolDir)
12695
12698
  }
12696
12699
  };
12697
12700
  }
@@ -13857,13 +13860,16 @@ function parseSource(source) {
13857
13860
  }
13858
13861
  return { provider: "github", ...parseShorthand(source) };
13859
13862
  }
13863
+ var GITHUB_HOSTS = /* @__PURE__ */ new Set(["github.com", "www.github.com"]);
13864
+ var GITLAB_HOSTS = /* @__PURE__ */ new Set(["gitlab.com", "www.gitlab.com"]);
13865
+ var MAX_RECURSION_DEPTH = 15;
13860
13866
  function parseUrl(url) {
13861
13867
  const urlObj = new URL(url);
13862
13868
  const host = urlObj.hostname.toLowerCase();
13863
13869
  let provider;
13864
- if (host === "github.com" || host.endsWith(".github.com")) {
13870
+ if (GITHUB_HOSTS.has(host)) {
13865
13871
  provider = "github";
13866
- } else if (host === "gitlab.com" || host.endsWith(".gitlab.com")) {
13872
+ } else if (GITLAB_HOSTS.has(host)) {
13867
13873
  provider = "gitlab";
13868
13874
  } else {
13869
13875
  throw new Error(
@@ -14104,14 +14110,26 @@ async function collectFeatureFiles(params) {
14104
14110
  }
14105
14111
  return filesToFetch;
14106
14112
  }
14107
- async function listDirectoryRecursive(client, owner, repo, path4, ref) {
14113
+ async function listDirectoryRecursive(client, owner, repo, path4, ref, depth = 0) {
14114
+ if (depth > MAX_RECURSION_DEPTH) {
14115
+ throw new Error(
14116
+ `Maximum recursion depth (${MAX_RECURSION_DEPTH}) exceeded while listing directory: ${path4}`
14117
+ );
14118
+ }
14108
14119
  const entries = await client.listDirectory(owner, repo, path4, ref);
14109
14120
  const files = [];
14110
14121
  for (const entry of entries) {
14111
14122
  if (entry.type === "file") {
14112
14123
  files.push(entry);
14113
14124
  } else if (entry.type === "dir") {
14114
- const subFiles = await listDirectoryRecursive(client, owner, repo, entry.path, ref);
14125
+ const subFiles = await listDirectoryRecursive(
14126
+ client,
14127
+ owner,
14128
+ repo,
14129
+ entry.path,
14130
+ ref,
14131
+ depth + 1
14132
+ );
14115
14133
  files.push(...subFiles);
14116
14134
  }
14117
14135
  }
@@ -17526,7 +17544,7 @@ async function updateCommand(currentVersion, options) {
17526
17544
  }
17527
17545
 
17528
17546
  // src/cli/index.ts
17529
- var getVersion = () => "6.6.0";
17547
+ var getVersion = () => "6.6.1";
17530
17548
  var main = async () => {
17531
17549
  const program = new import_commander.Command();
17532
17550
  const version = getVersion();
package/dist/index.js CHANGED
@@ -10386,6 +10386,9 @@ var ToolRule = class extends ToolFile {
10386
10386
  return false;
10387
10387
  }
10388
10388
  };
10389
+ function buildToolPath(toolDir, subDir, excludeToolDir) {
10390
+ return excludeToolDir ? subDir : join83(toolDir, subDir);
10391
+ }
10389
10392
 
10390
10393
  // src/features/rules/agentsmd-rule.ts
10391
10394
  var AgentsMdRule = class _AgentsMdRule extends ToolRule {
@@ -10403,7 +10406,7 @@ var AgentsMdRule = class _AgentsMdRule extends ToolRule {
10403
10406
  relativeFilePath: "AGENTS.md"
10404
10407
  },
10405
10408
  nonRoot: {
10406
- relativeDirPath: _options.excludeToolDir ? "memories" : join84(".agents", "memories")
10409
+ relativeDirPath: buildToolPath(".agents", "memories", _options.excludeToolDir)
10407
10410
  }
10408
10411
  };
10409
10412
  }
@@ -10643,7 +10646,7 @@ var AntigravityRule = class _AntigravityRule extends ToolRule {
10643
10646
  static getSettablePaths(_options = {}) {
10644
10647
  return {
10645
10648
  nonRoot: {
10646
- relativeDirPath: _options.excludeToolDir ? "rules" : join85(".agent", "rules")
10649
+ relativeDirPath: buildToolPath(".agent", "rules", _options.excludeToolDir)
10647
10650
  }
10648
10651
  };
10649
10652
  }
@@ -10819,7 +10822,7 @@ var AugmentcodeLegacyRule = class _AugmentcodeLegacyRule extends ToolRule {
10819
10822
  relativeFilePath: ".augment-guidelines"
10820
10823
  },
10821
10824
  nonRoot: {
10822
- relativeDirPath: _options.excludeToolDir ? "rules" : join86(".augment", "rules")
10825
+ relativeDirPath: buildToolPath(".augment", "rules", _options.excludeToolDir)
10823
10826
  }
10824
10827
  };
10825
10828
  }
@@ -10892,7 +10895,7 @@ var AugmentcodeRule = class _AugmentcodeRule extends ToolRule {
10892
10895
  static getSettablePaths(_options = {}) {
10893
10896
  return {
10894
10897
  nonRoot: {
10895
- relativeDirPath: _options.excludeToolDir ? "rules" : join87(".augment", "rules")
10898
+ relativeDirPath: buildToolPath(".augment", "rules", _options.excludeToolDir)
10896
10899
  }
10897
10900
  };
10898
10901
  }
@@ -10961,7 +10964,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
10961
10964
  if (global) {
10962
10965
  return {
10963
10966
  root: {
10964
- relativeDirPath: excludeToolDir ? "." : ".claude",
10967
+ relativeDirPath: buildToolPath(".claude", ".", excludeToolDir),
10965
10968
  relativeFilePath: "CLAUDE.md"
10966
10969
  }
10967
10970
  };
@@ -10972,7 +10975,7 @@ var ClaudecodeLegacyRule = class _ClaudecodeLegacyRule extends ToolRule {
10972
10975
  relativeFilePath: "CLAUDE.md"
10973
10976
  },
10974
10977
  nonRoot: {
10975
- relativeDirPath: excludeToolDir ? "memories" : join88(".claude", "memories")
10978
+ relativeDirPath: buildToolPath(".claude", "memories", excludeToolDir)
10976
10979
  }
10977
10980
  };
10978
10981
  }
@@ -11076,7 +11079,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
11076
11079
  if (global) {
11077
11080
  return {
11078
11081
  root: {
11079
- relativeDirPath: excludeToolDir ? "." : ".claude",
11082
+ relativeDirPath: buildToolPath(".claude", ".", excludeToolDir),
11080
11083
  relativeFilePath: "CLAUDE.md"
11081
11084
  }
11082
11085
  };
@@ -11087,7 +11090,7 @@ var ClaudecodeRule = class _ClaudecodeRule extends ToolRule {
11087
11090
  relativeFilePath: "CLAUDE.md"
11088
11091
  },
11089
11092
  nonRoot: {
11090
- relativeDirPath: excludeToolDir ? "rules" : join89(".claude", "rules")
11093
+ relativeDirPath: buildToolPath(".claude", "rules", excludeToolDir)
11091
11094
  }
11092
11095
  };
11093
11096
  }
@@ -11353,7 +11356,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
11353
11356
  if (global) {
11354
11357
  return {
11355
11358
  root: {
11356
- relativeDirPath: excludeToolDir ? "." : ".codex",
11359
+ relativeDirPath: buildToolPath(".codex", ".", excludeToolDir),
11357
11360
  relativeFilePath: "AGENTS.md"
11358
11361
  }
11359
11362
  };
@@ -11364,7 +11367,7 @@ var CodexcliRule = class _CodexcliRule extends ToolRule {
11364
11367
  relativeFilePath: "AGENTS.md"
11365
11368
  },
11366
11369
  nonRoot: {
11367
- relativeDirPath: excludeToolDir ? "memories" : join91(".codex", "memories")
11370
+ relativeDirPath: buildToolPath(".codex", "memories", excludeToolDir)
11368
11371
  }
11369
11372
  };
11370
11373
  }
@@ -11466,11 +11469,11 @@ var CopilotRule = class _CopilotRule extends ToolRule {
11466
11469
  static getSettablePaths(_options = {}) {
11467
11470
  return {
11468
11471
  root: {
11469
- relativeDirPath: _options.excludeToolDir ? "." : ".github",
11472
+ relativeDirPath: buildToolPath(".github", ".", _options.excludeToolDir),
11470
11473
  relativeFilePath: "copilot-instructions.md"
11471
11474
  },
11472
11475
  nonRoot: {
11473
- relativeDirPath: _options.excludeToolDir ? "instructions" : join92(".github", "instructions")
11476
+ relativeDirPath: buildToolPath(".github", "instructions", _options.excludeToolDir)
11474
11477
  }
11475
11478
  };
11476
11479
  }
@@ -11654,7 +11657,7 @@ var CursorRule = class _CursorRule extends ToolRule {
11654
11657
  static getSettablePaths(_options = {}) {
11655
11658
  return {
11656
11659
  nonRoot: {
11657
- relativeDirPath: _options.excludeToolDir ? "rules" : join93(".cursor", "rules")
11660
+ relativeDirPath: buildToolPath(".cursor", "rules", _options.excludeToolDir)
11658
11661
  }
11659
11662
  };
11660
11663
  }
@@ -11856,21 +11859,21 @@ var FactorydroidRule = class _FactorydroidRule extends ToolRule {
11856
11859
  if (options?.global) {
11857
11860
  return {
11858
11861
  root: {
11859
- relativeDirPath: options.excludeToolDir ? "." : ".factorydroid",
11862
+ relativeDirPath: buildToolPath(".factorydroid", ".", options.excludeToolDir),
11860
11863
  relativeFilePath: "AGENTS.md"
11861
11864
  },
11862
11865
  nonRoot: {
11863
- relativeDirPath: options.excludeToolDir ? "memories" : join94(".factorydroid", "memories")
11866
+ relativeDirPath: buildToolPath(".factorydroid", "memories", options.excludeToolDir)
11864
11867
  }
11865
11868
  };
11866
11869
  }
11867
11870
  return {
11868
11871
  root: {
11869
- relativeDirPath: options?.excludeToolDir ? "." : ".factorydroid",
11872
+ relativeDirPath: buildToolPath(".factorydroid", ".", options?.excludeToolDir),
11870
11873
  relativeFilePath: "AGENTS.md"
11871
11874
  },
11872
11875
  nonRoot: {
11873
- relativeDirPath: options?.excludeToolDir ? "memories" : join94(".factorydroid", "memories")
11876
+ relativeDirPath: buildToolPath(".factorydroid", "memories", options?.excludeToolDir)
11874
11877
  }
11875
11878
  };
11876
11879
  }
@@ -11951,7 +11954,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
11951
11954
  if (global) {
11952
11955
  return {
11953
11956
  root: {
11954
- relativeDirPath: excludeToolDir ? "." : ".gemini",
11957
+ relativeDirPath: buildToolPath(".gemini", ".", excludeToolDir),
11955
11958
  relativeFilePath: "GEMINI.md"
11956
11959
  }
11957
11960
  };
@@ -11962,7 +11965,7 @@ var GeminiCliRule = class _GeminiCliRule extends ToolRule {
11962
11965
  relativeFilePath: "GEMINI.md"
11963
11966
  },
11964
11967
  nonRoot: {
11965
- relativeDirPath: excludeToolDir ? "memories" : join95(".gemini", "memories")
11968
+ relativeDirPath: buildToolPath(".gemini", "memories", excludeToolDir)
11966
11969
  }
11967
11970
  };
11968
11971
  }
@@ -12056,11 +12059,11 @@ var JunieRule = class _JunieRule extends ToolRule {
12056
12059
  static getSettablePaths(_options = {}) {
12057
12060
  return {
12058
12061
  root: {
12059
- relativeDirPath: _options.excludeToolDir ? "." : ".junie",
12062
+ relativeDirPath: buildToolPath(".junie", ".", _options.excludeToolDir),
12060
12063
  relativeFilePath: "guidelines.md"
12061
12064
  },
12062
12065
  nonRoot: {
12063
- relativeDirPath: _options.excludeToolDir ? "memories" : join96(".junie", "memories")
12066
+ relativeDirPath: buildToolPath(".junie", "memories", _options.excludeToolDir)
12064
12067
  }
12065
12068
  };
12066
12069
  }
@@ -12131,7 +12134,7 @@ var KiloRule = class _KiloRule extends ToolRule {
12131
12134
  static getSettablePaths(_options = {}) {
12132
12135
  return {
12133
12136
  nonRoot: {
12134
- relativeDirPath: _options.excludeToolDir ? "rules" : join97(".kilocode", "rules")
12137
+ relativeDirPath: buildToolPath(".kilocode", "rules", _options.excludeToolDir)
12135
12138
  }
12136
12139
  };
12137
12140
  }
@@ -12198,7 +12201,7 @@ var KiroRule = class _KiroRule extends ToolRule {
12198
12201
  static getSettablePaths(_options = {}) {
12199
12202
  return {
12200
12203
  nonRoot: {
12201
- relativeDirPath: _options.excludeToolDir ? "steering" : join98(".kiro", "steering")
12204
+ relativeDirPath: buildToolPath(".kiro", "steering", _options.excludeToolDir)
12202
12205
  }
12203
12206
  };
12204
12207
  }
@@ -12271,7 +12274,7 @@ var OpenCodeRule = class _OpenCodeRule extends ToolRule {
12271
12274
  relativeFilePath: "AGENTS.md"
12272
12275
  },
12273
12276
  nonRoot: {
12274
- relativeDirPath: _options.excludeToolDir ? "memories" : join99(".opencode", "memories")
12277
+ relativeDirPath: buildToolPath(".opencode", "memories", _options.excludeToolDir)
12275
12278
  }
12276
12279
  };
12277
12280
  }
@@ -12346,7 +12349,7 @@ var QwencodeRule = class _QwencodeRule extends ToolRule {
12346
12349
  relativeFilePath: "QWEN.md"
12347
12350
  },
12348
12351
  nonRoot: {
12349
- relativeDirPath: _options.excludeToolDir ? "memories" : join100(".qwen", "memories")
12352
+ relativeDirPath: buildToolPath(".qwen", "memories", _options.excludeToolDir)
12350
12353
  }
12351
12354
  };
12352
12355
  }
@@ -12502,7 +12505,7 @@ var RooRule = class _RooRule extends ToolRule {
12502
12505
  static getSettablePaths(_options = {}) {
12503
12506
  return {
12504
12507
  nonRoot: {
12505
- relativeDirPath: _options.excludeToolDir ? "rules" : join102(".roo", "rules")
12508
+ relativeDirPath: buildToolPath(".roo", "rules", _options.excludeToolDir)
12506
12509
  }
12507
12510
  };
12508
12511
  }
@@ -12597,7 +12600,7 @@ var WarpRule = class _WarpRule extends ToolRule {
12597
12600
  relativeFilePath: "WARP.md"
12598
12601
  },
12599
12602
  nonRoot: {
12600
- relativeDirPath: _options.excludeToolDir ? "memories" : join103(".warp", "memories")
12603
+ relativeDirPath: buildToolPath(".warp", "memories", _options.excludeToolDir)
12601
12604
  }
12602
12605
  };
12603
12606
  }
@@ -12668,7 +12671,7 @@ var WindsurfRule = class _WindsurfRule extends ToolRule {
12668
12671
  static getSettablePaths(_options = {}) {
12669
12672
  return {
12670
12673
  nonRoot: {
12671
- relativeDirPath: _options.excludeToolDir ? "rules" : join104(".windsurf", "rules")
12674
+ relativeDirPath: buildToolPath(".windsurf", "rules", _options.excludeToolDir)
12672
12675
  }
12673
12676
  };
12674
12677
  }
@@ -13834,13 +13837,16 @@ function parseSource(source) {
13834
13837
  }
13835
13838
  return { provider: "github", ...parseShorthand(source) };
13836
13839
  }
13840
+ var GITHUB_HOSTS = /* @__PURE__ */ new Set(["github.com", "www.github.com"]);
13841
+ var GITLAB_HOSTS = /* @__PURE__ */ new Set(["gitlab.com", "www.gitlab.com"]);
13842
+ var MAX_RECURSION_DEPTH = 15;
13837
13843
  function parseUrl(url) {
13838
13844
  const urlObj = new URL(url);
13839
13845
  const host = urlObj.hostname.toLowerCase();
13840
13846
  let provider;
13841
- if (host === "github.com" || host.endsWith(".github.com")) {
13847
+ if (GITHUB_HOSTS.has(host)) {
13842
13848
  provider = "github";
13843
- } else if (host === "gitlab.com" || host.endsWith(".gitlab.com")) {
13849
+ } else if (GITLAB_HOSTS.has(host)) {
13844
13850
  provider = "gitlab";
13845
13851
  } else {
13846
13852
  throw new Error(
@@ -14081,14 +14087,26 @@ async function collectFeatureFiles(params) {
14081
14087
  }
14082
14088
  return filesToFetch;
14083
14089
  }
14084
- async function listDirectoryRecursive(client, owner, repo, path4, ref) {
14090
+ async function listDirectoryRecursive(client, owner, repo, path4, ref, depth = 0) {
14091
+ if (depth > MAX_RECURSION_DEPTH) {
14092
+ throw new Error(
14093
+ `Maximum recursion depth (${MAX_RECURSION_DEPTH}) exceeded while listing directory: ${path4}`
14094
+ );
14095
+ }
14085
14096
  const entries = await client.listDirectory(owner, repo, path4, ref);
14086
14097
  const files = [];
14087
14098
  for (const entry of entries) {
14088
14099
  if (entry.type === "file") {
14089
14100
  files.push(entry);
14090
14101
  } else if (entry.type === "dir") {
14091
- const subFiles = await listDirectoryRecursive(client, owner, repo, entry.path, ref);
14102
+ const subFiles = await listDirectoryRecursive(
14103
+ client,
14104
+ owner,
14105
+ repo,
14106
+ entry.path,
14107
+ ref,
14108
+ depth + 1
14109
+ );
14092
14110
  files.push(...subFiles);
14093
14111
  }
14094
14112
  }
@@ -17503,7 +17521,7 @@ async function updateCommand(currentVersion, options) {
17503
17521
  }
17504
17522
 
17505
17523
  // src/cli/index.ts
17506
- var getVersion = () => "6.6.0";
17524
+ var getVersion = () => "6.6.1";
17507
17525
  var main = async () => {
17508
17526
  const program = new Command();
17509
17527
  const version = getVersion();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "6.6.0",
3
+ "version": "6.6.1",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",
@@ -72,6 +72,7 @@
72
72
  "eslint-plugin-zod-import": "0.3.0",
73
73
  "knip": "5.82.1",
74
74
  "lint-staged": "16.2.7",
75
+ "marked": "17.0.1",
75
76
  "oxfmt": "0.27.0",
76
77
  "oxlint": "1.42.0",
77
78
  "repomix": "1.11.1",