rulesync 9.6.0 → 9.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.
@@ -1293,7 +1293,8 @@ var ConfigResolver = class {
1293
1293
  const validatedConfigPath = resolvePath(configPath, resolve(inputRoot ?? cwd));
1294
1294
  const baseConfig = await loadConfigFromFile(validatedConfigPath);
1295
1295
  const localConfigPath = join(dirname(validatedConfigPath), RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH);
1296
- const configByFile = mergeConfigs(baseConfig, await loadConfigFromFile(localConfigPath));
1296
+ const localConfig = await loadConfigFromFile(localConfigPath);
1297
+ const configByFile = mergeConfigs(baseConfig, localConfig);
1297
1298
  if (inputRoot === void 0 && configByFile.inputRoot !== void 0) validateOutputRoot(configByFile.inputRoot);
1298
1299
  assertMergedTargetsFeaturesExclusive({
1299
1300
  configByFile,
@@ -2381,14 +2382,17 @@ var AugmentcodeCommand = class AugmentcodeCommand extends ToolCommand {
2381
2382
  static fromRulesyncCommand({ outputRoot = process.cwd(), rulesyncCommand, validate = true, global = false }) {
2382
2383
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
2383
2384
  const augmentcodeFields = rulesyncFrontmatter.augmentcode ?? {};
2385
+ const augmentcodeFrontmatter = {
2386
+ description: rulesyncFrontmatter.description,
2387
+ ...augmentcodeFields
2388
+ };
2389
+ const body = rulesyncCommand.getBody();
2390
+ const paths = this.getSettablePaths({ global });
2384
2391
  return new AugmentcodeCommand({
2385
2392
  outputRoot,
2386
- frontmatter: {
2387
- description: rulesyncFrontmatter.description,
2388
- ...augmentcodeFields
2389
- },
2390
- body: rulesyncCommand.getBody(),
2391
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
2393
+ frontmatter: augmentcodeFrontmatter,
2394
+ body,
2395
+ relativeDirPath: paths.relativeDirPath,
2392
2396
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
2393
2397
  validate
2394
2398
  });
@@ -2522,14 +2526,17 @@ var ClaudecodeCommand = class ClaudecodeCommand extends ToolCommand {
2522
2526
  static fromRulesyncCommand({ outputRoot = process.cwd(), rulesyncCommand, validate = true, global = false }) {
2523
2527
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
2524
2528
  const claudecodeFields = rulesyncFrontmatter.claudecode ?? {};
2529
+ const claudecodeFrontmatter = {
2530
+ description: rulesyncFrontmatter.description,
2531
+ ...claudecodeFields
2532
+ };
2533
+ const body = rulesyncCommand.getBody();
2534
+ const paths = this.getSettablePaths({ global });
2525
2535
  return new ClaudecodeCommand({
2526
2536
  outputRoot,
2527
- frontmatter: {
2528
- description: rulesyncFrontmatter.description,
2529
- ...claudecodeFields
2530
- },
2531
- body: rulesyncCommand.getBody(),
2532
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
2537
+ frontmatter: claudecodeFrontmatter,
2538
+ body,
2539
+ relativeDirPath: paths.relativeDirPath,
2533
2540
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
2534
2541
  validate
2535
2542
  });
@@ -2730,12 +2737,13 @@ var CodexcliCommand = class CodexcliCommand extends ToolCommand {
2730
2737
  const paths = this.getSettablePaths({ global });
2731
2738
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
2732
2739
  const codexcliFields = rulesyncFrontmatter.codexcli ?? {};
2740
+ const codexcliFrontmatter = {
2741
+ ...rulesyncFrontmatter.description !== void 0 && { description: rulesyncFrontmatter.description },
2742
+ ...codexcliFields
2743
+ };
2733
2744
  return new CodexcliCommand({
2734
2745
  outputRoot,
2735
- frontmatter: {
2736
- ...rulesyncFrontmatter.description !== void 0 && { description: rulesyncFrontmatter.description },
2737
- ...codexcliFields
2738
- },
2746
+ frontmatter: codexcliFrontmatter,
2739
2747
  body: rulesyncCommand.getBody(),
2740
2748
  relativeDirPath: paths.relativeDirPath,
2741
2749
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
@@ -2997,14 +3005,17 @@ var CursorCommand = class CursorCommand extends ToolCommand {
2997
3005
  static fromRulesyncCommand({ outputRoot = process.cwd(), rulesyncCommand, validate = true, global = false }) {
2998
3006
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
2999
3007
  const cursorFields = rulesyncFrontmatter.cursor ?? {};
3008
+ const cursorFrontmatter = {
3009
+ ...rulesyncFrontmatter.description && { description: rulesyncFrontmatter.description },
3010
+ ...cursorFields
3011
+ };
3012
+ const body = rulesyncCommand.getBody();
3013
+ const paths = this.getSettablePaths({ global });
3000
3014
  return new CursorCommand({
3001
3015
  outputRoot,
3002
- frontmatter: {
3003
- ...rulesyncFrontmatter.description && { description: rulesyncFrontmatter.description },
3004
- ...cursorFields
3005
- },
3006
- body: rulesyncCommand.getBody(),
3007
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
3016
+ frontmatter: cursorFrontmatter,
3017
+ body,
3018
+ relativeDirPath: paths.relativeDirPath,
3008
3019
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
3009
3020
  validate
3010
3021
  });
@@ -3128,14 +3139,17 @@ var DevinCommand = class DevinCommand extends ToolCommand {
3128
3139
  static fromRulesyncCommand({ outputRoot = process.cwd(), rulesyncCommand, validate = true, global = false }) {
3129
3140
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
3130
3141
  const devinFields = rulesyncFrontmatter.devin ?? {};
3142
+ const devinFrontmatter = {
3143
+ description: rulesyncFrontmatter.description,
3144
+ ...devinFields
3145
+ };
3146
+ const body = rulesyncCommand.getBody();
3147
+ const paths = this.getSettablePaths({ global });
3131
3148
  return new DevinCommand({
3132
3149
  outputRoot,
3133
- frontmatter: {
3134
- description: rulesyncFrontmatter.description,
3135
- ...devinFields
3136
- },
3137
- body: rulesyncCommand.getBody(),
3138
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
3150
+ frontmatter: devinFrontmatter,
3151
+ body,
3152
+ relativeDirPath: paths.relativeDirPath,
3139
3153
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
3140
3154
  validate
3141
3155
  });
@@ -3249,14 +3263,17 @@ var FactorydroidCommand = class FactorydroidCommand extends ToolCommand {
3249
3263
  static fromRulesyncCommand({ outputRoot = process.cwd(), rulesyncCommand, validate = true, global = false }) {
3250
3264
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
3251
3265
  const factorydroidFields = rulesyncFrontmatter.factorydroid ?? {};
3266
+ const factorydroidFrontmatter = {
3267
+ description: rulesyncFrontmatter.description,
3268
+ ...factorydroidFields
3269
+ };
3270
+ const body = rulesyncCommand.getBody();
3271
+ const paths = this.getSettablePaths({ global });
3252
3272
  return new FactorydroidCommand({
3253
3273
  outputRoot,
3254
- frontmatter: {
3255
- description: rulesyncFrontmatter.description,
3256
- ...factorydroidFields
3257
- },
3258
- body: rulesyncCommand.getBody(),
3259
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
3274
+ frontmatter: factorydroidFrontmatter,
3275
+ body,
3276
+ relativeDirPath: paths.relativeDirPath,
3260
3277
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
3261
3278
  validate
3262
3279
  });
@@ -3417,9 +3434,10 @@ var GooseCommand = class GooseCommand extends ToolCommand {
3417
3434
  prompt,
3418
3435
  ...extraFields
3419
3436
  };
3437
+ const paths = this.getSettablePaths({ global });
3420
3438
  return new GooseCommand({
3421
3439
  outputRoot,
3422
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
3440
+ relativeDirPath: paths.relativeDirPath,
3423
3441
  relativeFilePath,
3424
3442
  fileContent: dump(recipe, {
3425
3443
  lineWidth: -1,
@@ -3460,19 +3478,20 @@ var GooseCommand = class GooseCommand extends ToolCommand {
3460
3478
  });
3461
3479
  }
3462
3480
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath }) {
3481
+ const placeholder = dump({
3482
+ version: RECIPE_VERSION$1,
3483
+ title: "",
3484
+ description: "",
3485
+ prompt: ""
3486
+ }, {
3487
+ lineWidth: -1,
3488
+ noRefs: true
3489
+ });
3463
3490
  return new GooseCommand({
3464
3491
  outputRoot,
3465
3492
  relativeDirPath,
3466
3493
  relativeFilePath,
3467
- fileContent: dump({
3468
- version: RECIPE_VERSION$1,
3469
- title: "",
3470
- description: "",
3471
- prompt: ""
3472
- }, {
3473
- lineWidth: -1,
3474
- noRefs: true
3475
- }),
3494
+ fileContent: placeholder,
3476
3495
  validate: false
3477
3496
  });
3478
3497
  }
@@ -3629,14 +3648,17 @@ var JunieCommand = class JunieCommand extends ToolCommand {
3629
3648
  static fromRulesyncCommand({ outputRoot = process.cwd(), rulesyncCommand, validate = true, global = false }) {
3630
3649
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
3631
3650
  const junieFields = rulesyncFrontmatter.junie ?? {};
3651
+ const junieFrontmatter = {
3652
+ description: rulesyncFrontmatter.description,
3653
+ ...junieFields
3654
+ };
3655
+ const body = rulesyncCommand.getBody();
3656
+ const paths = this.getSettablePaths({ global });
3632
3657
  return new JunieCommand({
3633
3658
  outputRoot,
3634
- frontmatter: {
3635
- description: rulesyncFrontmatter.description,
3636
- ...junieFields
3637
- },
3638
- body: rulesyncCommand.getBody(),
3639
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
3659
+ frontmatter: junieFrontmatter,
3660
+ body,
3661
+ relativeDirPath: paths.relativeDirPath,
3640
3662
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
3641
3663
  validate
3642
3664
  });
@@ -3760,14 +3782,17 @@ var KiloCommand = class KiloCommand extends ToolCommand {
3760
3782
  static fromRulesyncCommand({ outputRoot = process.cwd(), rulesyncCommand, validate = true, global = false }) {
3761
3783
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
3762
3784
  const kiloFields = rulesyncFrontmatter.kilo ?? {};
3785
+ const kiloFrontmatter = {
3786
+ description: rulesyncFrontmatter.description,
3787
+ ...kiloFields
3788
+ };
3789
+ const body = rulesyncCommand.getBody();
3790
+ const paths = this.getSettablePaths({ global });
3763
3791
  return new KiloCommand({
3764
3792
  outputRoot,
3765
- frontmatter: {
3766
- description: rulesyncFrontmatter.description,
3767
- ...kiloFields
3768
- },
3769
- body: rulesyncCommand.getBody(),
3770
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
3793
+ frontmatter: kiloFrontmatter,
3794
+ body,
3795
+ relativeDirPath: paths.relativeDirPath,
3771
3796
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
3772
3797
  validate
3773
3798
  });
@@ -4355,14 +4380,17 @@ var OpenCodeCommand = class OpenCodeCommand extends ToolCommand {
4355
4380
  static fromRulesyncCommand({ outputRoot = process.cwd(), rulesyncCommand, validate = true, global = false }) {
4356
4381
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
4357
4382
  const opencodeFields = rulesyncFrontmatter.opencode ?? {};
4383
+ const opencodeFrontmatter = {
4384
+ description: rulesyncFrontmatter.description,
4385
+ ...opencodeFields
4386
+ };
4387
+ const body = rulesyncCommand.getBody();
4388
+ const paths = this.getSettablePaths({ global });
4358
4389
  return new OpenCodeCommand({
4359
4390
  outputRoot,
4360
- frontmatter: {
4361
- description: rulesyncFrontmatter.description,
4362
- ...opencodeFields
4363
- },
4364
- body: rulesyncCommand.getBody(),
4365
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
4391
+ frontmatter: opencodeFrontmatter,
4392
+ body,
4393
+ relativeDirPath: paths.relativeDirPath,
4366
4394
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
4367
4395
  validate
4368
4396
  });
@@ -4650,14 +4678,17 @@ var QwencodeCommand = class QwencodeCommand extends ToolCommand {
4650
4678
  static fromRulesyncCommand({ outputRoot = process.cwd(), rulesyncCommand, validate = true, global = false }) {
4651
4679
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
4652
4680
  const qwencodeFields = rulesyncFrontmatter.qwencode ?? {};
4681
+ const qwencodeFrontmatter = {
4682
+ description: rulesyncFrontmatter.description,
4683
+ ...qwencodeFields
4684
+ };
4685
+ const body = rulesyncCommand.getBody();
4686
+ const paths = this.getSettablePaths({ global });
4653
4687
  return new QwencodeCommand({
4654
4688
  outputRoot,
4655
- frontmatter: {
4656
- description: rulesyncFrontmatter.description,
4657
- ...qwencodeFields
4658
- },
4659
- body: rulesyncCommand.getBody(),
4660
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
4689
+ frontmatter: qwencodeFrontmatter,
4690
+ body,
4691
+ relativeDirPath: paths.relativeDirPath,
4661
4692
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
4662
4693
  validate
4663
4694
  });
@@ -4781,14 +4812,17 @@ var ReasonixCommand = class ReasonixCommand extends ToolCommand {
4781
4812
  static fromRulesyncCommand({ outputRoot = process.cwd(), rulesyncCommand, validate = true, global = false }) {
4782
4813
  const rulesyncFrontmatter = rulesyncCommand.getFrontmatter();
4783
4814
  const reasonixFields = rulesyncFrontmatter.reasonix ?? {};
4815
+ const reasonixFrontmatter = {
4816
+ description: rulesyncFrontmatter.description,
4817
+ ...reasonixFields
4818
+ };
4819
+ const body = rulesyncCommand.getBody();
4820
+ const paths = this.getSettablePaths({ global });
4784
4821
  return new ReasonixCommand({
4785
4822
  outputRoot,
4786
- frontmatter: {
4787
- description: rulesyncFrontmatter.description,
4788
- ...reasonixFields
4789
- },
4790
- body: rulesyncCommand.getBody(),
4791
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
4823
+ frontmatter: reasonixFrontmatter,
4824
+ body,
4825
+ relativeDirPath: paths.relativeDirPath,
4792
4826
  relativeFilePath: rulesyncCommand.getRelativeFilePath(),
4793
4827
  validate
4794
4828
  });
@@ -5086,14 +5120,15 @@ var RovodevCommand = class RovodevCommand extends ToolCommand {
5086
5120
  const paths = this.getSettablePaths({ global });
5087
5121
  const body = (await readFileContent(join(outputRoot, paths.relativeDirPath, relativeFilePath))).trim();
5088
5122
  const name = basename(relativeFilePath, ".md");
5123
+ const description = await lookupPromptDescription({
5124
+ outputRoot,
5125
+ relativeFilePath,
5126
+ name
5127
+ });
5089
5128
  return new RovodevCommand({
5090
5129
  outputRoot,
5091
5130
  name,
5092
- description: await lookupPromptDescription({
5093
- outputRoot,
5094
- relativeFilePath,
5095
- name
5096
- }),
5131
+ description,
5097
5132
  body,
5098
5133
  relativeDirPath: paths.relativeDirPath,
5099
5134
  relativeFilePath,
@@ -5292,14 +5327,15 @@ var TaktCommand = class TaktCommand extends ToolCommand {
5292
5327
  });
5293
5328
  const relativeFilePath = `${stem}.md`;
5294
5329
  const paths = this.getSettablePaths({ global });
5330
+ const body = prependTaktExtends({
5331
+ extendsName: typeof taktSection?.extends === "string" ? taktSection.extends : void 0,
5332
+ body: rulesyncCommand.getBody(),
5333
+ featureLabel: "command",
5334
+ sourceLabel
5335
+ });
5295
5336
  return new TaktCommand({
5296
5337
  outputRoot,
5297
- body: prependTaktExtends({
5298
- extendsName: typeof taktSection?.extends === "string" ? taktSection.extends : void 0,
5299
- body: rulesyncCommand.getBody(),
5300
- featureLabel: "command",
5301
- sourceLabel
5302
- }),
5338
+ body,
5303
5339
  relativeDirPath: paths.relativeDirPath,
5304
5340
  relativeFilePath,
5305
5341
  validate
@@ -7450,11 +7486,12 @@ var CodexcliConfigToml = class CodexcliConfigToml extends ToolFile {
7450
7486
  };
7451
7487
  }
7452
7488
  static async fromOutputRoot({ outputRoot }) {
7489
+ const fileContent = await buildCodexConfigTomlContent({ outputRoot });
7453
7490
  return new CodexcliConfigToml({
7454
7491
  outputRoot,
7455
7492
  relativeDirPath: CODEXCLI_DIR,
7456
7493
  relativeFilePath: CODEXCLI_MCP_FILE_NAME,
7457
- fileContent: await buildCodexConfigTomlContent({ outputRoot })
7494
+ fileContent
7458
7495
  });
7459
7496
  }
7460
7497
  };
@@ -8745,15 +8782,16 @@ var HermesagentHooks = class HermesagentHooks extends ToolHooks {
8745
8782
  }
8746
8783
  static fromRulesyncHooks({ outputRoot, rulesyncHooks, logger }) {
8747
8784
  const config = rulesyncHooks.getJson();
8785
+ const hermesHooks = canonicalToHermesHooks({
8786
+ config,
8787
+ toolOverrideHooks: config.hermesagent?.hooks,
8788
+ logger
8789
+ });
8748
8790
  return new HermesagentHooks({
8749
8791
  outputRoot,
8750
8792
  fileContent: stringifySharedConfig({
8751
8793
  format: "yaml",
8752
- document: { hooks: canonicalToHermesHooks({
8753
- config,
8754
- toolOverrideHooks: config.hermesagent?.hooks,
8755
- logger
8756
- }) }
8794
+ document: { hooks: hermesHooks }
8757
8795
  })
8758
8796
  });
8759
8797
  }
@@ -10028,11 +10066,12 @@ var VibeConfigToml = class VibeConfigToml extends ToolFile {
10028
10066
  };
10029
10067
  }
10030
10068
  static async fromOutputRoot({ outputRoot }) {
10069
+ const fileContent = await buildVibeConfigTomlContent({ outputRoot });
10031
10070
  return new VibeConfigToml({
10032
10071
  outputRoot,
10033
10072
  relativeDirPath: VIBE_DIR,
10034
10073
  relativeFilePath: VIBE_CONFIG_FILE_NAME,
10035
- fileContent: await buildVibeConfigTomlContent({ outputRoot })
10074
+ fileContent
10036
10075
  });
10037
10076
  }
10038
10077
  };
@@ -10809,9 +10848,10 @@ var ClaudecodeIgnore = class ClaudecodeIgnore extends ToolIgnore {
10809
10848
  this.patterns = jsonValue.permissions?.deny ?? [];
10810
10849
  }
10811
10850
  static getSettablePaths(params) {
10851
+ const fileMode = resolveFileMode(params?.options);
10812
10852
  return {
10813
10853
  relativeDirPath: CLAUDECODE_DIR,
10814
- relativeFilePath: fileNameForMode(resolveFileMode(params?.options))
10854
+ relativeFilePath: fileNameForMode(fileMode)
10815
10855
  };
10816
10856
  }
10817
10857
  /**
@@ -11044,11 +11084,12 @@ var DevinIgnore = class DevinIgnore extends ToolIgnore {
11044
11084
  const primaryPath = join(outputRoot, relativeDirPath, relativeFilePath);
11045
11085
  const legacyPath = join(outputRoot, relativeDirPath, DEVIN_LEGACY_IGNORE_FILE_NAME);
11046
11086
  const resolvedFilePath = !await fileExists(primaryPath) && await fileExists(legacyPath) ? DEVIN_LEGACY_IGNORE_FILE_NAME : relativeFilePath;
11087
+ const fileContent = await readFileContent(join(outputRoot, relativeDirPath, resolvedFilePath));
11047
11088
  return new DevinIgnore({
11048
11089
  outputRoot,
11049
11090
  relativeDirPath,
11050
11091
  relativeFilePath: resolvedFilePath,
11051
- fileContent: await readFileContent(join(outputRoot, relativeDirPath, resolvedFilePath)),
11092
+ fileContent,
11052
11093
  validate
11053
11094
  });
11054
11095
  }
@@ -18793,7 +18834,11 @@ function toCursorPattern(canonical, pattern) {
18793
18834
  function toCanonicalCategory$1(cursorType, pattern) {
18794
18835
  if (cursorType === "Mcp") {
18795
18836
  const match = pattern.match(/^([^:()]+):([^:()]+)$/);
18796
- if (match) return `${MCP_CANONICAL_PREFIX$1}${match[1] ?? "*"}__${match[2] ?? "*"}`;
18837
+ if (match) {
18838
+ const server = match[1] ?? "*";
18839
+ const tool = match[2] ?? "*";
18840
+ return `${MCP_CANONICAL_PREFIX$1}${server}__${tool}`;
18841
+ }
18797
18842
  return CURSOR_TYPE_TO_CANONICAL[cursorType] ?? cursorType.toLowerCase();
18798
18843
  }
18799
18844
  return CURSOR_TYPE_TO_CANONICAL[cursorType] ?? cursorType.toLowerCase();
@@ -23136,13 +23181,15 @@ var AgentsmdSkill = class AgentsmdSkill extends SimulatedSkill {
23136
23181
  return { relativeDirPath: AGENTSMD_SKILLS_DIR_PATH };
23137
23182
  }
23138
23183
  static async fromDir(params) {
23139
- return new AgentsmdSkill(await this.fromDirDefault(params));
23184
+ const baseParams = await this.fromDirDefault(params);
23185
+ return new AgentsmdSkill(baseParams);
23140
23186
  }
23141
23187
  static fromRulesyncSkill(params) {
23142
- return new AgentsmdSkill({
23188
+ const baseParams = {
23143
23189
  ...this.fromRulesyncSkillDefault(params),
23144
23190
  relativeDirPath: this.getSettablePaths().relativeDirPath
23145
- });
23191
+ };
23192
+ return new AgentsmdSkill(baseParams);
23146
23193
  }
23147
23194
  static isTargetedByRulesyncSkill(rulesyncSkill) {
23148
23195
  return this.isTargetedByRulesyncSkillDefault({
@@ -23151,7 +23198,8 @@ var AgentsmdSkill = class AgentsmdSkill extends SimulatedSkill {
23151
23198
  });
23152
23199
  }
23153
23200
  static forDeletion(params) {
23154
- return new AgentsmdSkill(this.forDeletionDefault(params));
23201
+ const baseParams = this.forDeletionDefault(params);
23202
+ return new AgentsmdSkill(baseParams);
23155
23203
  }
23156
23204
  };
23157
23205
  const RulesyncSkillFrontmatterSchema = z.looseObject({
@@ -24558,9 +24606,10 @@ var ClaudecodeSkill = class ClaudecodeSkill extends ToolSkill {
24558
24606
  })
24559
24607
  });
24560
24608
  const settablePaths = ClaudecodeSkill.getSettablePaths({ global });
24609
+ const relativeDirPath = rulesyncFrontmatter.claudecode?.["scheduled-task"] ? CLAUDECODE_SCHEDULED_TASKS_DIR_PATH : settablePaths.relativeDirPath;
24561
24610
  return new ClaudecodeSkill({
24562
24611
  outputRoot,
24563
- relativeDirPath: rulesyncFrontmatter.claudecode?.["scheduled-task"] ? CLAUDECODE_SCHEDULED_TASKS_DIR_PATH : settablePaths.relativeDirPath,
24612
+ relativeDirPath,
24564
24613
  dirName: rulesyncSkill.getDirName(),
24565
24614
  frontmatter: claudecodeFrontmatter,
24566
24615
  body: rulesyncSkill.getBody(),
@@ -26349,9 +26398,10 @@ var KiloSkill = class KiloSkill extends ToolSkill {
26349
26398
  ...kiloSection?.compatibility !== void 0 && { compatibility: kiloSection.compatibility },
26350
26399
  ...kiloSection?.metadata !== void 0 && { metadata: kiloSection.metadata }
26351
26400
  };
26401
+ const settablePaths = KiloSkill.getSettablePaths({ global });
26352
26402
  return new KiloSkill({
26353
26403
  outputRoot,
26354
- relativeDirPath: KiloSkill.getSettablePaths({ global }).relativeDirPath,
26404
+ relativeDirPath: settablePaths.relativeDirPath,
26355
26405
  dirName: rulesyncSkill.getDirName(),
26356
26406
  frontmatter: kiloFrontmatter,
26357
26407
  body: rulesyncSkill.getBody(),
@@ -26674,9 +26724,10 @@ var OpenCodeSkill = class OpenCodeSkill extends ToolSkill {
26674
26724
  ...metadata !== void 0 && { metadata },
26675
26725
  ...opencodeSection?.["allowed-tools"] !== void 0 && { "allowed-tools": opencodeSection["allowed-tools"] }
26676
26726
  };
26727
+ const settablePaths = OpenCodeSkill.getSettablePaths({ global });
26677
26728
  return new OpenCodeSkill({
26678
26729
  outputRoot,
26679
- relativeDirPath: OpenCodeSkill.getSettablePaths({ global }).relativeDirPath,
26730
+ relativeDirPath: settablePaths.relativeDirPath,
26680
26731
  dirName: rulesyncSkill.getDirName(),
26681
26732
  frontmatter: opencodeFrontmatter,
26682
26733
  body: rulesyncSkill.getBody(),
@@ -26991,9 +27042,10 @@ var QwencodeSkill = class QwencodeSkill extends ToolSkill {
26991
27042
  ...resolvedUserInvocable !== void 0 && { "user-invocable": resolvedUserInvocable },
26992
27043
  ...resolvedDisableModelInvocation !== void 0 && { "disable-model-invocation": resolvedDisableModelInvocation }
26993
27044
  };
27045
+ const settablePaths = QwencodeSkill.getSettablePaths({ global });
26994
27046
  return new QwencodeSkill({
26995
27047
  outputRoot,
26996
- relativeDirPath: QwencodeSkill.getSettablePaths({ global }).relativeDirPath,
27048
+ relativeDirPath: settablePaths.relativeDirPath,
26997
27049
  dirName: rulesyncSkill.getDirName(),
26998
27050
  frontmatter: qwencodeFrontmatter,
26999
27051
  body: rulesyncSkill.getBody(),
@@ -27124,9 +27176,10 @@ var ReasonixSkill = class ReasonixSkill extends ToolSkill {
27124
27176
  name: rulesyncFrontmatter.name,
27125
27177
  description: rulesyncFrontmatter.description
27126
27178
  };
27179
+ const settablePaths = ReasonixSkill.getSettablePaths({ global });
27127
27180
  return new ReasonixSkill({
27128
27181
  outputRoot,
27129
- relativeDirPath: ReasonixSkill.getSettablePaths({ global }).relativeDirPath,
27182
+ relativeDirPath: settablePaths.relativeDirPath,
27130
27183
  dirName: rulesyncSkill.getDirName(),
27131
27184
  frontmatter: reasonixFrontmatter,
27132
27185
  body: rulesyncSkill.getBody(),
@@ -27545,17 +27598,20 @@ var TaktSkill = class TaktSkill extends ToolSkill {
27545
27598
  featureLabel: "skill",
27546
27599
  sourceLabel
27547
27600
  });
27601
+ const fileName = `${stem}.md`;
27602
+ const relativeDirPath = TAKT_SKILLS_DIR_PATH;
27603
+ const body = prependTaktExtends({
27604
+ extendsName: typeof taktSection?.extends === "string" ? taktSection.extends : void 0,
27605
+ body: rulesyncSkill.getBody(),
27606
+ featureLabel: "skill",
27607
+ sourceLabel
27608
+ });
27548
27609
  return new TaktSkill({
27549
27610
  outputRoot,
27550
- relativeDirPath: TAKT_SKILLS_DIR_PATH,
27611
+ relativeDirPath,
27551
27612
  dirName: stem,
27552
- fileName: `${stem}.md`,
27553
- body: prependTaktExtends({
27554
- extendsName: typeof taktSection?.extends === "string" ? taktSection.extends : void 0,
27555
- body: rulesyncSkill.getBody(),
27556
- featureLabel: "skill",
27557
- sourceLabel
27558
- }),
27613
+ fileName,
27614
+ body,
27559
27615
  otherFiles: rulesyncSkill.getOtherFiles(),
27560
27616
  validate,
27561
27617
  global
@@ -27853,9 +27909,10 @@ var WarpSkill = class WarpSkill extends ToolSkill {
27853
27909
  name: rulesyncFrontmatter.name,
27854
27910
  description: rulesyncFrontmatter.description
27855
27911
  };
27912
+ const settablePaths = WarpSkill.getSettablePaths({ global });
27856
27913
  return new WarpSkill({
27857
27914
  outputRoot,
27858
- relativeDirPath: WarpSkill.getSettablePaths({ global }).relativeDirPath,
27915
+ relativeDirPath: settablePaths.relativeDirPath,
27859
27916
  dirName: rulesyncSkill.getDirName(),
27860
27917
  frontmatter: warpFrontmatter,
27861
27918
  body: rulesyncSkill.getBody(),
@@ -28672,10 +28729,12 @@ var AgentsmdSubagent = class AgentsmdSubagent extends SimulatedSubagent {
28672
28729
  return { relativeDirPath: AGENTSMD_SUBAGENTS_DIR_PATH };
28673
28730
  }
28674
28731
  static async fromFile(params) {
28675
- return new AgentsmdSubagent(await this.fromFileDefault(params));
28732
+ const baseParams = await this.fromFileDefault(params);
28733
+ return new AgentsmdSubagent(baseParams);
28676
28734
  }
28677
28735
  static fromRulesyncSubagent(params) {
28678
- return new AgentsmdSubagent(this.fromRulesyncSubagentDefault(params));
28736
+ const baseParams = this.fromRulesyncSubagentDefault(params);
28737
+ return new AgentsmdSubagent(baseParams);
28679
28738
  }
28680
28739
  static isTargetedByRulesyncSubagent(rulesyncSubagent) {
28681
28740
  return this.isTargetedByRulesyncSubagentDefault({
@@ -28840,11 +28899,12 @@ var QwencodeSubagent = class QwencodeSubagent extends ToolSubagent {
28840
28899
  };
28841
28900
  const body = rulesyncSubagent.getBody();
28842
28901
  const fileContent = stringifyFrontmatter(body, qwencodeSubagentFrontmatter, { avoidBlockScalars: true });
28902
+ const paths = this.getSettablePaths({ global });
28843
28903
  return new QwencodeSubagent({
28844
28904
  outputRoot,
28845
28905
  frontmatter: qwencodeSubagentFrontmatter,
28846
28906
  body,
28847
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
28907
+ relativeDirPath: paths.relativeDirPath,
28848
28908
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
28849
28909
  fileContent,
28850
28910
  validate,
@@ -28968,11 +29028,12 @@ var RovodevSubagent = class RovodevSubagent extends ToolSubagent {
28968
29028
  };
28969
29029
  const body = rulesyncSubagent.getBody();
28970
29030
  const fileContent = stringifyFrontmatter(body, rovodevFrontmatter, { avoidBlockScalars: true });
29031
+ const paths = this.getSettablePaths({ global });
28971
29032
  return new RovodevSubagent({
28972
29033
  outputRoot,
28973
29034
  frontmatter: rovodevFrontmatter,
28974
29035
  body,
28975
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
29036
+ relativeDirPath: paths.relativeDirPath,
28976
29037
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
28977
29038
  fileContent,
28978
29039
  validate,
@@ -29103,11 +29164,12 @@ var AugmentcodeSubagent = class AugmentcodeSubagent extends ToolSubagent {
29103
29164
  };
29104
29165
  const body = rulesyncSubagent.getBody();
29105
29166
  const fileContent = stringifyFrontmatter(body, augmentcodeFrontmatter, { avoidBlockScalars: true });
29167
+ const paths = this.getSettablePaths({ global });
29106
29168
  return new AugmentcodeSubagent({
29107
29169
  outputRoot,
29108
29170
  frontmatter: augmentcodeFrontmatter,
29109
29171
  body,
29110
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
29172
+ relativeDirPath: paths.relativeDirPath,
29111
29173
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
29112
29174
  fileContent,
29113
29175
  validate,
@@ -29242,11 +29304,12 @@ var ClaudecodeSubagent = class ClaudecodeSubagent extends ToolSubagent {
29242
29304
  const claudecodeFrontmatter = result.data;
29243
29305
  const body = rulesyncSubagent.getBody();
29244
29306
  const fileContent = stringifyFrontmatter(body, claudecodeFrontmatter);
29307
+ const paths = this.getSettablePaths({ global });
29245
29308
  return new ClaudecodeSubagent({
29246
29309
  outputRoot,
29247
29310
  frontmatter: claudecodeFrontmatter,
29248
29311
  body,
29249
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
29312
+ relativeDirPath: paths.relativeDirPath,
29250
29313
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
29251
29314
  fileContent,
29252
29315
  validate
@@ -29372,11 +29435,12 @@ var ClineSubagent = class ClineSubagent extends ToolSubagent {
29372
29435
  };
29373
29436
  const body = rulesyncSubagent.getBody();
29374
29437
  const fileContent = stringifyFrontmatter(body, clineFrontmatter, { avoidBlockScalars: true });
29438
+ const paths = this.getSettablePaths({ global });
29375
29439
  return new ClineSubagent({
29376
29440
  outputRoot,
29377
29441
  frontmatter: clineFrontmatter,
29378
29442
  body,
29379
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
29443
+ relativeDirPath: paths.relativeDirPath,
29380
29444
  relativeFilePath: rulesyncSubagent.getRelativeFilePath().replace(/\.md$/, ".yaml"),
29381
29445
  fileContent,
29382
29446
  validate,
@@ -29642,7 +29706,8 @@ var CopilotSubagent = class CopilotSubagent extends ToolSubagent {
29642
29706
  const rulesyncFrontmatter = rulesyncSubagent.getFrontmatter();
29643
29707
  const copilotSection = rulesyncFrontmatter.copilot ?? {};
29644
29708
  const toolsField = copilotSection.tools;
29645
- const mergedTools = ensureRequiredTool(normalizeTools(Array.isArray(toolsField) || typeof toolsField === "string" ? toolsField : void 0));
29709
+ const userTools = normalizeTools(Array.isArray(toolsField) || typeof toolsField === "string" ? toolsField : void 0);
29710
+ const mergedTools = ensureRequiredTool(userTools);
29646
29711
  const copilotFrontmatter = {
29647
29712
  name: rulesyncFrontmatter.name,
29648
29713
  description: rulesyncFrontmatter.description,
@@ -29651,11 +29716,12 @@ var CopilotSubagent = class CopilotSubagent extends ToolSubagent {
29651
29716
  };
29652
29717
  const body = rulesyncSubagent.getBody();
29653
29718
  const fileContent = stringifyFrontmatter(body, copilotFrontmatter);
29719
+ const paths = this.getSettablePaths({ global });
29654
29720
  return new CopilotSubagent({
29655
29721
  outputRoot,
29656
29722
  frontmatter: copilotFrontmatter,
29657
29723
  body,
29658
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
29724
+ relativeDirPath: paths.relativeDirPath,
29659
29725
  relativeFilePath: toCopilotAgentFilePath(rulesyncSubagent.getRelativeFilePath()),
29660
29726
  fileContent,
29661
29727
  validate,
@@ -29828,11 +29894,12 @@ var CopilotcliSubagent = class CopilotcliSubagent extends ToolSubagent {
29828
29894
  const copilotCliFrontmatter = result.data;
29829
29895
  const body = rulesyncSubagent.getBody();
29830
29896
  const fileContent = stringifyFrontmatter(body, copilotCliFrontmatter);
29897
+ const paths = this.getSettablePaths({ global });
29831
29898
  return new CopilotcliSubagent({
29832
29899
  outputRoot,
29833
29900
  frontmatter: copilotCliFrontmatter,
29834
29901
  body,
29835
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
29902
+ relativeDirPath: paths.relativeDirPath,
29836
29903
  relativeFilePath: toCopilotCliAgentFilePath(rulesyncSubagent.getRelativeFilePath()),
29837
29904
  fileContent,
29838
29905
  validate,
@@ -29946,11 +30013,12 @@ var CursorSubagent = class CursorSubagent extends ToolSubagent {
29946
30013
  };
29947
30014
  const body = rulesyncSubagent.getBody();
29948
30015
  const fileContent = stringifyFrontmatter(body, cursorFrontmatter, { avoidBlockScalars: true });
30016
+ const paths = this.getSettablePaths({ global });
29949
30017
  return new CursorSubagent({
29950
30018
  outputRoot,
29951
30019
  frontmatter: cursorFrontmatter,
29952
30020
  body,
29953
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
30021
+ relativeDirPath: paths.relativeDirPath,
29954
30022
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
29955
30023
  fileContent,
29956
30024
  validate,
@@ -30384,11 +30452,12 @@ var FactorydroidSubagent = class FactorydroidSubagent extends ToolSubagent {
30384
30452
  const factorydroidFrontmatter = result.data;
30385
30453
  const body = rulesyncSubagent.getBody();
30386
30454
  const fileContent = stringifyFrontmatter(body, factorydroidFrontmatter);
30455
+ const paths = this.getSettablePaths({ global });
30387
30456
  return new FactorydroidSubagent({
30388
30457
  outputRoot,
30389
30458
  frontmatter: factorydroidFrontmatter,
30390
30459
  body,
30391
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
30460
+ relativeDirPath: paths.relativeDirPath,
30392
30461
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
30393
30462
  fileContent,
30394
30463
  validate,
@@ -30526,10 +30595,11 @@ var GooseSubagent = class GooseSubagent extends ToolSubagent {
30526
30595
  instructions,
30527
30596
  ...extraFields
30528
30597
  };
30598
+ const paths = this.getSettablePaths({ global });
30529
30599
  return new GooseSubagent({
30530
30600
  outputRoot,
30531
30601
  recipe,
30532
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
30602
+ relativeDirPath: paths.relativeDirPath,
30533
30603
  relativeFilePath,
30534
30604
  fileContent: dump(recipe, {
30535
30605
  lineWidth: -1,
@@ -30664,11 +30734,12 @@ var GrokcliSubagent = class GrokcliSubagent extends ToolSubagent {
30664
30734
  };
30665
30735
  const body = rulesyncSubagent.getBody();
30666
30736
  const fileContent = stringifyFrontmatter(body, grokcliSubagentFrontmatter, { avoidBlockScalars: true });
30737
+ const paths = this.getSettablePaths({ global });
30667
30738
  return new GrokcliSubagent({
30668
30739
  outputRoot,
30669
30740
  frontmatter: grokcliSubagentFrontmatter,
30670
30741
  body,
30671
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
30742
+ relativeDirPath: paths.relativeDirPath,
30672
30743
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
30673
30744
  fileContent,
30674
30745
  validate,
@@ -30904,9 +30975,10 @@ var HermesagentSubagent = class HermesagentSubagent extends ToolSubagent {
30904
30975
  }
30905
30976
  static fromRulesyncSubagent({ rulesyncSubagent, outputRoot }) {
30906
30977
  const spec = getSubagentSpec(rulesyncSubagent);
30978
+ const slug = String(spec.slug);
30907
30979
  return new HermesagentSubagent({
30908
30980
  relativeDirPath: HERMESAGENT_RULESYNC_SUBAGENTS_DIR_PATH,
30909
- relativeFilePath: `${String(spec.slug)}.json`,
30981
+ relativeFilePath: `${slug}.json`,
30910
30982
  fileContent: `${JSON.stringify(spec, null, 2)}\n`,
30911
30983
  outputRoot
30912
30984
  });
@@ -31040,11 +31112,12 @@ var JunieSubagent = class JunieSubagent extends ToolSubagent {
31040
31112
  const junieFrontmatter = result.data;
31041
31113
  const body = rulesyncSubagent.getBody();
31042
31114
  const fileContent = stringifyFrontmatter(body, junieFrontmatter);
31115
+ const paths = this.getSettablePaths({ global });
31043
31116
  return new JunieSubagent({
31044
31117
  outputRoot,
31045
31118
  frontmatter: junieFrontmatter,
31046
31119
  body,
31047
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
31120
+ relativeDirPath: paths.relativeDirPath,
31048
31121
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
31049
31122
  fileContent,
31050
31123
  validate,
@@ -31235,11 +31308,12 @@ var KiloSubagent = class KiloSubagent extends OpenCodeStyleSubagent {
31235
31308
  const kiloFrontmatter = parseResult.data;
31236
31309
  const body = rulesyncSubagent.getBody();
31237
31310
  const fileContent = stringifyFrontmatter(body, kiloFrontmatter);
31311
+ const paths = this.getSettablePaths({ global });
31238
31312
  return new KiloSubagent({
31239
31313
  outputRoot,
31240
31314
  frontmatter: kiloFrontmatter,
31241
31315
  body,
31242
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
31316
+ relativeDirPath: paths.relativeDirPath,
31243
31317
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
31244
31318
  fileContent,
31245
31319
  validate,
@@ -31511,11 +31585,12 @@ var KiroIdeSubagent = class KiroIdeSubagent extends ToolSubagent {
31511
31585
  const frontmatter = result.data;
31512
31586
  const body = rulesyncSubagent.getBody();
31513
31587
  const fileContent = stringifyFrontmatter(body, frontmatter);
31588
+ const paths = this.getSettablePaths({ global });
31514
31589
  return new KiroIdeSubagent({
31515
31590
  outputRoot,
31516
31591
  frontmatter,
31517
31592
  body,
31518
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
31593
+ relativeDirPath: paths.relativeDirPath,
31519
31594
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
31520
31595
  fileContent,
31521
31596
  validate,
@@ -31659,11 +31734,12 @@ var OpenCodeSubagent = class OpenCodeSubagent extends OpenCodeStyleSubagent {
31659
31734
  const opencodeFrontmatter = parseResult.data;
31660
31735
  const body = rulesyncSubagent.getBody();
31661
31736
  const fileContent = stringifyFrontmatter(body, opencodeFrontmatter);
31737
+ const paths = this.getSettablePaths({ global });
31662
31738
  return new OpenCodeSubagent({
31663
31739
  outputRoot,
31664
31740
  frontmatter: opencodeFrontmatter,
31665
31741
  body,
31666
- relativeDirPath: this.getSettablePaths({ global }).relativeDirPath,
31742
+ relativeDirPath: paths.relativeDirPath,
31667
31743
  relativeFilePath: rulesyncSubagent.getRelativeFilePath(),
31668
31744
  fileContent,
31669
31745
  validate,
@@ -32952,11 +33028,12 @@ var AiassistantRule = class AiassistantRule extends ToolRule {
32952
33028
  }
32953
33029
  static async fromFile({ outputRoot = process.cwd(), relativeFilePath, validate = true }) {
32954
33030
  const relativeDirPath = this.getSettablePaths().nonRoot.relativeDirPath;
33031
+ const fileContent = await readFileContent(join(outputRoot, relativeDirPath, relativeFilePath));
32955
33032
  return new AiassistantRule({
32956
33033
  outputRoot,
32957
33034
  relativeDirPath,
32958
33035
  relativeFilePath,
32959
- fileContent: (await readFileContent(join(outputRoot, relativeDirPath, relativeFilePath))).trim(),
33036
+ fileContent: fileContent.trim(),
32960
33037
  validate,
32961
33038
  root: false
32962
33039
  });
@@ -33057,13 +33134,14 @@ var AmpRule = class AmpRule extends ToolRule {
33057
33134
  };
33058
33135
  }
33059
33136
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
33137
+ const isRoot = relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath;
33060
33138
  return new AmpRule({
33061
33139
  outputRoot,
33062
33140
  relativeDirPath,
33063
33141
  relativeFilePath,
33064
33142
  fileContent: "",
33065
33143
  validate: false,
33066
- root: relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath
33144
+ root: isRoot
33067
33145
  });
33068
33146
  }
33069
33147
  static isTargetedByRulesyncRule(rulesyncRule) {
@@ -33146,13 +33224,14 @@ var AntigravityCliRule = class AntigravityCliRule extends ToolRule {
33146
33224
  };
33147
33225
  }
33148
33226
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
33227
+ const isRoot = relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath;
33149
33228
  return new AntigravityCliRule({
33150
33229
  outputRoot,
33151
33230
  relativeDirPath,
33152
33231
  relativeFilePath,
33153
33232
  fileContent: "",
33154
33233
  validate: false,
33155
- root: relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath
33234
+ root: isRoot
33156
33235
  });
33157
33236
  }
33158
33237
  static isTargetedByRulesyncRule(rulesyncRule) {
@@ -33566,13 +33645,14 @@ var AugmentcodeLegacyRule = class AugmentcodeLegacyRule extends ToolRule {
33566
33645
  });
33567
33646
  }
33568
33647
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath }) {
33648
+ const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
33569
33649
  return new AugmentcodeLegacyRule({
33570
33650
  outputRoot,
33571
33651
  relativeDirPath,
33572
33652
  relativeFilePath,
33573
33653
  fileContent: "",
33574
33654
  validate: false,
33575
- root: relativeFilePath === this.getSettablePaths().root.relativeFilePath
33655
+ root: isRoot
33576
33656
  });
33577
33657
  }
33578
33658
  };
@@ -33808,13 +33888,14 @@ var ClaudecodeLegacyRule = class ClaudecodeLegacyRule extends ToolRule {
33808
33888
  };
33809
33889
  }
33810
33890
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
33891
+ const isRoot = relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath;
33811
33892
  return new ClaudecodeLegacyRule({
33812
33893
  outputRoot,
33813
33894
  relativeDirPath,
33814
33895
  relativeFilePath,
33815
33896
  fileContent: "",
33816
33897
  validate: false,
33817
- root: relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath
33898
+ root: isRoot
33818
33899
  });
33819
33900
  }
33820
33901
  static isTargetedByRulesyncRule(rulesyncRule) {
@@ -33913,6 +33994,7 @@ var ClaudecodeRule = class ClaudecodeRule extends ToolRule {
33913
33994
  });
33914
33995
  }
33915
33996
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
33997
+ const isRoot = relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath;
33916
33998
  return new ClaudecodeRule({
33917
33999
  outputRoot,
33918
34000
  relativeDirPath,
@@ -33920,7 +34002,7 @@ var ClaudecodeRule = class ClaudecodeRule extends ToolRule {
33920
34002
  frontmatter: {},
33921
34003
  body: "",
33922
34004
  validate: false,
33923
- root: relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath
34005
+ root: isRoot
33924
34006
  });
33925
34007
  }
33926
34008
  static fromRulesyncRule({ outputRoot = process.cwd(), rulesyncRule, validate = true, global = false }) {
@@ -34436,6 +34518,13 @@ var CopilotRule = class CopilotRule extends ToolRule {
34436
34518
  }
34437
34519
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
34438
34520
  const paths = this.getSettablePaths({ global });
34521
+ const isRoot = sameRelativePath({
34522
+ dir: relativeDirPath,
34523
+ file: relativeFilePath
34524
+ }, {
34525
+ dir: paths.root.relativeDirPath,
34526
+ file: paths.root.relativeFilePath
34527
+ });
34439
34528
  return new CopilotRule({
34440
34529
  outputRoot,
34441
34530
  relativeDirPath,
@@ -34443,13 +34532,7 @@ var CopilotRule = class CopilotRule extends ToolRule {
34443
34532
  frontmatter: {},
34444
34533
  body: "",
34445
34534
  validate: false,
34446
- root: sameRelativePath({
34447
- dir: relativeDirPath,
34448
- file: relativeFilePath
34449
- }, {
34450
- dir: paths.root.relativeDirPath,
34451
- file: paths.root.relativeFilePath
34452
- })
34535
+ root: isRoot
34453
34536
  });
34454
34537
  }
34455
34538
  validate() {
@@ -35113,13 +35196,14 @@ var FactorydroidRule = class FactorydroidRule extends ToolRule {
35113
35196
  }
35114
35197
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
35115
35198
  const paths = this.getSettablePaths({ global });
35199
+ const isRoot = relativeFilePath === paths.root.relativeFilePath && relativeDirPath === paths.root.relativeDirPath;
35116
35200
  return new FactorydroidRule({
35117
35201
  outputRoot,
35118
35202
  relativeDirPath,
35119
35203
  relativeFilePath,
35120
35204
  fileContent: "",
35121
35205
  validate: false,
35122
- root: relativeFilePath === paths.root.relativeFilePath && relativeDirPath === paths.root.relativeDirPath
35206
+ root: isRoot
35123
35207
  });
35124
35208
  }
35125
35209
  static fromRulesyncRule({ outputRoot = process.cwd(), rulesyncRule, validate = true, global = false }) {
@@ -35215,13 +35299,14 @@ var GooseRule = class GooseRule extends ToolRule {
35215
35299
  }
35216
35300
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
35217
35301
  const paths = this.getSettablePaths({ global });
35302
+ const isRoot = relativeFilePath === paths.root.relativeFilePath && (relativeDirPath === "." || relativeDirPath === paths.root.relativeDirPath);
35218
35303
  return new GooseRule({
35219
35304
  outputRoot,
35220
35305
  relativeDirPath,
35221
35306
  relativeFilePath,
35222
35307
  fileContent: "",
35223
35308
  validate: false,
35224
- root: relativeFilePath === paths.root.relativeFilePath && (relativeDirPath === "." || relativeDirPath === paths.root.relativeDirPath)
35309
+ root: isRoot
35225
35310
  });
35226
35311
  }
35227
35312
  static isTargetedByRulesyncRule(rulesyncRule) {
@@ -35425,11 +35510,12 @@ var JunieRule = class JunieRule extends ToolRule {
35425
35510
  const settablePaths = this.getSettablePaths();
35426
35511
  if (!settablePaths.nonRoot) throw new Error("JunieRule project settable paths must include a nonRoot path");
35427
35512
  const relativeDirPath = isRoot ? settablePaths.root.relativeDirPath : settablePaths.nonRoot.relativeDirPath;
35513
+ const fileContent = await readFileContent(join(outputRoot, join(relativeDirPath, relativeFilePath)));
35428
35514
  return new JunieRule({
35429
35515
  outputRoot,
35430
35516
  relativeDirPath,
35431
35517
  relativeFilePath,
35432
- fileContent: await readFileContent(join(outputRoot, join(relativeDirPath, relativeFilePath))),
35518
+ fileContent,
35433
35519
  validate,
35434
35520
  root: isRoot
35435
35521
  });
@@ -35464,13 +35550,14 @@ var JunieRule = class JunieRule extends ToolRule {
35464
35550
  };
35465
35551
  }
35466
35552
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath }) {
35553
+ const isRoot = JunieRule.isRootRelativeFilePath(relativeFilePath);
35467
35554
  return new JunieRule({
35468
35555
  outputRoot,
35469
35556
  relativeDirPath,
35470
35557
  relativeFilePath,
35471
35558
  fileContent: "",
35472
35559
  validate: false,
35473
- root: JunieRule.isRootRelativeFilePath(relativeFilePath)
35560
+ root: isRoot
35474
35561
  });
35475
35562
  }
35476
35563
  static isTargetedByRulesyncRule(rulesyncRule) {
@@ -35544,13 +35631,14 @@ var KiloRule = class KiloRule extends ToolRule {
35544
35631
  };
35545
35632
  }
35546
35633
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
35634
+ const isRoot = relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath;
35547
35635
  return new KiloRule({
35548
35636
  outputRoot,
35549
35637
  relativeDirPath,
35550
35638
  relativeFilePath,
35551
35639
  fileContent: "",
35552
35640
  validate: false,
35553
- root: relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath
35641
+ root: isRoot
35554
35642
  });
35555
35643
  }
35556
35644
  static isTargetedByRulesyncRule(rulesyncRule) {
@@ -35639,11 +35727,12 @@ var KiroRule = class KiroRule extends ToolRule {
35639
35727
  const paths = this.getSettablePaths({ global });
35640
35728
  const isRoot = "root" in paths && relativeFilePath === paths.root.relativeFilePath;
35641
35729
  const relativeDirPath = paths.nonRoot?.relativeDirPath ?? buildToolPath(".kiro", "steering");
35730
+ const fileContent = await readFileContent(join(outputRoot, relativeDirPath, relativeFilePath));
35642
35731
  return new KiroRule({
35643
35732
  outputRoot,
35644
35733
  relativeDirPath,
35645
35734
  relativeFilePath,
35646
- fileContent: await readFileContent(join(outputRoot, relativeDirPath, relativeFilePath)),
35735
+ fileContent,
35647
35736
  validate,
35648
35737
  root: isRoot
35649
35738
  });
@@ -35818,13 +35907,14 @@ var OpenCodeRule = class OpenCodeRule extends ToolRule {
35818
35907
  };
35819
35908
  }
35820
35909
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
35910
+ const isRoot = relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath;
35821
35911
  return new OpenCodeRule({
35822
35912
  outputRoot,
35823
35913
  relativeDirPath,
35824
35914
  relativeFilePath,
35825
35915
  fileContent: "",
35826
35916
  validate: false,
35827
- root: relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath
35917
+ root: isRoot
35828
35918
  });
35829
35919
  }
35830
35920
  static isTargetedByRulesyncRule(rulesyncRule) {
@@ -35909,13 +35999,14 @@ var PiRule = class PiRule extends ToolRule {
35909
35999
  }
35910
36000
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
35911
36001
  const { root } = this.getSettablePaths({ global });
36002
+ const isRoot = relativeFilePath === "AGENTS.md" && (relativeDirPath === "." || relativeDirPath === root.relativeDirPath);
35912
36003
  return new PiRule({
35913
36004
  outputRoot,
35914
36005
  relativeDirPath,
35915
36006
  relativeFilePath,
35916
36007
  fileContent: "",
35917
36008
  validate: false,
35918
- root: relativeFilePath === "AGENTS.md" && (relativeDirPath === "." || relativeDirPath === root.relativeDirPath)
36009
+ root: isRoot
35919
36010
  });
35920
36011
  }
35921
36012
  static isTargetedByRulesyncRule(rulesyncRule) {
@@ -36259,13 +36350,14 @@ var ReplitRule = class ReplitRule extends ToolRule {
36259
36350
  };
36260
36351
  }
36261
36352
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath }) {
36353
+ const isRoot = relativeFilePath === this.getSettablePaths().root.relativeFilePath;
36262
36354
  return new ReplitRule({
36263
36355
  outputRoot,
36264
36356
  relativeDirPath,
36265
36357
  relativeFilePath,
36266
36358
  fileContent: "",
36267
36359
  validate: false,
36268
- root: relativeFilePath === this.getSettablePaths().root.relativeFilePath
36360
+ root: isRoot
36269
36361
  });
36270
36362
  }
36271
36363
  static isTargetedByRulesyncRule(rulesyncRule) {
@@ -36416,11 +36508,12 @@ var RovodevRule = class RovodevRule extends ToolRule {
36416
36508
  }
36417
36509
  static async fromModularFile({ outputRoot, relativeFilePath, relativeDirPath, validate, global }) {
36418
36510
  if (!this.isAllowedModularRulesRelativePath(relativeFilePath)) throw new Error(`Reserved Rovodev memory basename under modular-rules (not a modular rule): ${join(relativeDirPath, relativeFilePath)}`);
36511
+ const fileContent = await readFileContent(join(outputRoot, relativeDirPath, relativeFilePath));
36419
36512
  return new RovodevRule({
36420
36513
  outputRoot,
36421
36514
  relativeDirPath,
36422
36515
  relativeFilePath,
36423
- fileContent: await readFileContent(join(outputRoot, relativeDirPath, relativeFilePath)),
36516
+ fileContent,
36424
36517
  validate,
36425
36518
  global,
36426
36519
  root: false
@@ -36431,11 +36524,12 @@ var RovodevRule = class RovodevRule extends ToolRule {
36431
36524
  const agentsMdExpectedLocationsDescription = "alternativeRoots" in paths && paths.alternativeRoots && paths.alternativeRoots.length > 0 ? `${join(paths.root.relativeDirPath, paths.root.relativeFilePath)} or project root` : join(paths.root.relativeDirPath, paths.root.relativeFilePath);
36432
36525
  if (relativeFilePath !== "AGENTS.md") throw new Error(`Rovodev rules support only AGENTS.md at ${agentsMdExpectedLocationsDescription}, got: ${join(relativeDirPath, relativeFilePath)}`);
36433
36526
  if (!(relativeDirPath === paths.root.relativeDirPath || "alternativeRoots" in paths && paths.alternativeRoots?.some((alt) => alt.relativeDirPath === relativeDirPath && alt.relativeFilePath === relativeFilePath))) throw new Error(`Rovodev AGENTS.md must be at ${agentsMdExpectedLocationsDescription}, got: ${join(relativeDirPath, relativeFilePath)}`);
36527
+ const fileContent = await readFileContent(join(outputRoot, relativeDirPath, relativeFilePath));
36434
36528
  return new RovodevRule({
36435
36529
  outputRoot,
36436
36530
  relativeDirPath,
36437
36531
  relativeFilePath,
36438
- fileContent: await readFileContent(join(outputRoot, relativeDirPath, relativeFilePath)),
36532
+ fileContent,
36439
36533
  validate,
36440
36534
  global,
36441
36535
  root: true
@@ -36626,16 +36720,18 @@ var TaktRule = class TaktRule extends ToolRule {
36626
36720
  sourceLabel
36627
36721
  });
36628
36722
  const relativeFilePath = `${stem}.md`;
36723
+ const relativeDirPath = resolveTaktRuleFacet(taktSection?.facet) === "output-contracts" ? TAKT_OUTPUT_CONTRACTS_DIR_PATH : TAKT_RULES_DIR_PATH;
36724
+ const body = prependTaktExtends({
36725
+ extendsName: typeof taktSection?.extends === "string" ? taktSection.extends : void 0,
36726
+ body: rulesyncRule.getBody(),
36727
+ featureLabel: "rule",
36728
+ sourceLabel
36729
+ });
36629
36730
  return new TaktRule({
36630
36731
  outputRoot,
36631
- relativeDirPath: resolveTaktRuleFacet(taktSection?.facet) === "output-contracts" ? TAKT_OUTPUT_CONTRACTS_DIR_PATH : TAKT_RULES_DIR_PATH,
36732
+ relativeDirPath,
36632
36733
  relativeFilePath,
36633
- body: prependTaktExtends({
36634
- extendsName: typeof taktSection?.extends === "string" ? taktSection.extends : void 0,
36635
- body: rulesyncRule.getBody(),
36636
- featureLabel: "rule",
36637
- sourceLabel
36638
- }),
36734
+ body,
36639
36735
  validate,
36640
36736
  root: false
36641
36737
  });
@@ -36703,13 +36799,14 @@ var VibeRule = class VibeRule extends ToolRule {
36703
36799
  };
36704
36800
  }
36705
36801
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
36802
+ const isRoot = relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath;
36706
36803
  return new VibeRule({
36707
36804
  outputRoot,
36708
36805
  relativeDirPath,
36709
36806
  relativeFilePath,
36710
36807
  fileContent: "",
36711
36808
  validate: false,
36712
- root: relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath
36809
+ root: isRoot
36713
36810
  });
36714
36811
  }
36715
36812
  static isTargetedByRulesyncRule(rulesyncRule) {
@@ -36771,13 +36868,14 @@ var WarpRule = class WarpRule extends ToolRule {
36771
36868
  }
36772
36869
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath }) {
36773
36870
  const { root } = this.getSettablePaths();
36871
+ const isRoot = relativeFilePath === root.relativeFilePath && relativeDirPath === root.relativeDirPath;
36774
36872
  return new WarpRule({
36775
36873
  outputRoot,
36776
36874
  relativeDirPath,
36777
36875
  relativeFilePath,
36778
36876
  fileContent: "",
36779
36877
  validate: false,
36780
- root: relativeFilePath === root.relativeFilePath && relativeDirPath === root.relativeDirPath
36878
+ root: isRoot
36781
36879
  });
36782
36880
  }
36783
36881
  static isTargetedByRulesyncRule(rulesyncRule) {
@@ -36842,13 +36940,14 @@ var ZedRule = class ZedRule extends ToolRule {
36842
36940
  };
36843
36941
  }
36844
36942
  static forDeletion({ outputRoot = process.cwd(), relativeDirPath, relativeFilePath, global = false }) {
36943
+ const isRoot = relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath;
36845
36944
  return new ZedRule({
36846
36945
  outputRoot,
36847
36946
  relativeDirPath,
36848
36947
  relativeFilePath,
36849
36948
  fileContent: "",
36850
36949
  validate: false,
36851
- root: relativeFilePath === this.getSettablePaths({ global }).root.relativeFilePath
36950
+ root: isRoot
36852
36951
  });
36853
36952
  }
36854
36953
  static isTargetedByRulesyncRule(rulesyncRule) {
@@ -37574,19 +37673,24 @@ As this project's AI coding tool, you must follow the additional conventions bel
37574
37673
  const localRootToolRules = await (async () => {
37575
37674
  if (!forDeletion || this.global || factory.meta.localRootMode !== "separate-local-file" || !factory.meta.localRootFileName) return [];
37576
37675
  const fileName = factory.meta.localRootFileName;
37577
- if (factory.class.getLocalRootDeletionGlob) return buildDeletionRulesFromPaths(await findFilesByGlobs(factory.class.getLocalRootDeletionGlob({
37578
- outputRoot: this.outputRoot,
37579
- fileName
37580
- })));
37676
+ if (factory.class.getLocalRootDeletionGlob) {
37677
+ const filePaths = await findFilesByGlobs(factory.class.getLocalRootDeletionGlob({
37678
+ outputRoot: this.outputRoot,
37679
+ fileName
37680
+ }));
37681
+ return buildDeletionRulesFromPaths(filePaths);
37682
+ }
37581
37683
  if (!settablePaths.root) return [];
37582
- return buildDeletionRulesFromPaths(await findFilesWithFallback(join(this.outputRoot, settablePaths.root.relativeDirPath ?? ".", fileName), settablePaths.alternativeRoots, (alt) => join(this.outputRoot, alt.relativeDirPath, fileName)));
37684
+ const filePaths = await findFilesWithFallback(join(this.outputRoot, settablePaths.root.relativeDirPath ?? ".", fileName), settablePaths.alternativeRoots, (alt) => join(this.outputRoot, alt.relativeDirPath, fileName));
37685
+ return buildDeletionRulesFromPaths(filePaths);
37583
37686
  })();
37584
37687
  this.logger.debug(`Found ${localRootToolRules.length} local root tool rule files for deletion`);
37585
37688
  const rootMirrorDeletionRules = await (async () => {
37586
37689
  if (!forDeletion || this.global || !factory.meta.mirrorsRootToAgentsMd || !factory.class.getRootMirrorDeletionGlobs) return [];
37587
37690
  const { primaryGlob, mirrorGlob } = factory.class.getRootMirrorDeletionGlobs({ outputRoot: this.outputRoot });
37588
37691
  if ((await findFilesByGlobs(primaryGlob)).length === 0) return [];
37589
- return buildDeletionRulesFromPaths(await findFilesByGlobs(mirrorGlob));
37692
+ const mirrorPaths = await findFilesByGlobs(mirrorGlob);
37693
+ return buildDeletionRulesFromPaths(mirrorPaths);
37590
37694
  })();
37591
37695
  const nonRootToolRules = await (async () => {
37592
37696
  if (!settablePaths.nonRoot) return [];
@@ -39023,4 +39127,4 @@ async function importPermissionsCore(params) {
39023
39127
  //#endregion
39024
39128
  export { removeTempDirectory as $, RulesyncCommand as A, checkPathTraversal as B, RulesyncHooks as C, RULESYNC_RULES_RELATIVE_DIR_PATH as Ct, CLAUDECODE_MEMORIES_DIR_NAME as D, formatError as Dt, CLAUDECODE_LOCAL_RULE_FILE_NAME as E, RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH as Et, findControlCharacter as F, findFilesByGlobs as G, directoryExists as H, ConsoleLogger as I, isSymlink as J, getFileSize as K, JsonLogger as L, stringifyFrontmatter as M, loadYaml as N, CLAUDECODE_SETTINGS_LOCAL_FILE_NAME as O, ALL_FEATURES as Ot, ConfigResolver as P, removeFile as Q, CLIError as R, HooksProcessor as S, RULESYNC_RELATIVE_DIR_PATH as St, CLAUDECODE_DIR as T, RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH as Tt, ensureDir as U, createTempDirectory as V, fileExists as W, readFileContent as X, listDirectoryFiles as Y, removeDirectory as Z, RulesyncPermissions as _, RULESYNC_MCP_RELATIVE_FILE_PATH as _t, convertFromTool as a, MAX_FILE_SIZE as at, IgnoreProcessor as b, RULESYNC_PERMISSIONS_FILE_NAME as bt, RulesyncRuleFrontmatterSchema as c, RULESYNC_COMMANDS_RELATIVE_DIR_PATH as ct, RulesyncSubagentFrontmatterSchema as d, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH as dt, toPosixPath as et, SkillsProcessor as f, RULESYNC_HOOKS_FILE_NAME as ft, SKILL_FILE_NAME as g, RULESYNC_MCP_FILE_NAME as gt, RulesyncSkillFrontmatterSchema as h, RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH as ht, getProcessorRegistryEntry as i, ToolTargetSchema as it, RulesyncCommandFrontmatterSchema as j, CLAUDECODE_SKILLS_DIR_PATH as k, ALL_FEATURES_WITH_WILDCARD as kt, SubagentsProcessor as l, RULESYNC_CONFIG_RELATIVE_FILE_PATH as lt, RulesyncSkill as m, RULESYNC_IGNORE_RELATIVE_FILE_PATH as mt, checkRulesyncDirExists as n, ALL_TOOL_TARGETS as nt, RulesProcessor as o, RULESYNC_AIIGNORE_FILE_NAME as ot, getLocalSkillDirNames as p, RULESYNC_HOOKS_RELATIVE_FILE_PATH as pt, getHomeDirectory as q, generate as r, ALL_TOOL_TARGETS_WITH_WILDCARD as rt, RulesyncRule as s, RULESYNC_AIIGNORE_RELATIVE_FILE_PATH as st, importFromTool as t, writeFileContent as tt, RulesyncSubagent as u, RULESYNC_CONFIG_SCHEMA_URL as ut, McpProcessor as v, RULESYNC_MCP_SCHEMA_URL as vt, CommandsProcessor as w, RULESYNC_SKILLS_RELATIVE_DIR_PATH as wt, RulesyncIgnore as x, RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH as xt, RulesyncMcp as y, RULESYNC_OVERVIEW_FILE_NAME as yt, ErrorCodes as z };
39025
39129
 
39026
- //# sourceMappingURL=import-B6nwZmGl.js.map
39130
+ //# sourceMappingURL=import-tTMN0WRi.js.map