rulesync 9.6.1 → 9.6.2

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.
@@ -36637,30 +36637,31 @@ var RovodevRule = class RovodevRule extends ToolRule {
36637
36637
  });
36638
36638
  }
36639
36639
  /**
36640
- * Mirror the primary `.rovodev/AGENTS.md` root rule to `./AGENTS.md` so project
36641
- * memory stays discoverable at the repo root. Empty when `rootRule` is not the primary root.
36640
+ * Root-mirror contract: rovodev mirrors its primary `.rovodev/AGENTS.md` root
36641
+ * rule to `./AGENTS.md` so project memory stays discoverable at the repo root.
36642
+ * Generation (`getMirrorFiles`) and deletion (`getMirrorDeletionGlobs`) are
36643
+ * bundled in one object so they cannot drift out of symmetry. The processor
36644
+ * keys off this method's mere presence to decide the tool mirrors at all.
36642
36645
  */
36643
- static getRootMirrorFiles({ outputRoot, rootRule, content }) {
36644
- if (!(rootRule instanceof RovodevRule)) return [];
36645
- const primary = this.getSettablePaths({ global: false }).root;
36646
- if (rootRule.getRelativeDirPath() !== primary.relativeDirPath || rootRule.getRelativeFilePath() !== primary.relativeFilePath) return [];
36647
- return [new RovodevRule({
36648
- outputRoot,
36649
- relativeDirPath: ".",
36650
- relativeFilePath: ROVODEV_RULE_FILE_NAME,
36651
- fileContent: content,
36652
- validate: true,
36653
- root: true
36654
- })];
36655
- }
36656
- /**
36657
- * Globs for mirror deletion: the `./AGENTS.md` mirror (`mirrorGlob`) is deleted
36658
- * only when the primary `.rovodev/AGENTS.md` (`primaryGlob`) still exists.
36659
- */
36660
- static getRootMirrorDeletionGlobs({ outputRoot }) {
36646
+ static getRootMirror() {
36661
36647
  return {
36662
- primaryGlob: (0, node_path.join)(outputRoot, ROVODEV_DIR, ROVODEV_RULE_FILE_NAME),
36663
- mirrorGlob: (0, node_path.join)(outputRoot, ROVODEV_RULE_FILE_NAME)
36648
+ getMirrorFiles: ({ outputRoot, rootRule, content }) => {
36649
+ if (!(rootRule instanceof RovodevRule)) return [];
36650
+ const primary = RovodevRule.getSettablePaths({ global: false }).root;
36651
+ if (rootRule.getRelativeDirPath() !== primary.relativeDirPath || rootRule.getRelativeFilePath() !== primary.relativeFilePath) return [];
36652
+ return [new RovodevRule({
36653
+ outputRoot,
36654
+ relativeDirPath: ".",
36655
+ relativeFilePath: ROVODEV_RULE_FILE_NAME,
36656
+ fileContent: content,
36657
+ validate: true,
36658
+ root: true
36659
+ })];
36660
+ },
36661
+ getMirrorDeletionGlobs: ({ outputRoot }) => ({
36662
+ primaryGlob: (0, node_path.join)(outputRoot, ROVODEV_DIR, ROVODEV_RULE_FILE_NAME),
36663
+ mirrorGlob: (0, node_path.join)(outputRoot, ROVODEV_RULE_FILE_NAME)
36664
+ })
36664
36665
  };
36665
36666
  }
36666
36667
  /** Glob for the `separate-local-file` deletion; rovodev writes it at project root, not under `.rovodev/`. */
@@ -37283,8 +37284,7 @@ const toolRuleFactories = /* @__PURE__ */ new Map([
37283
37284
  skills: { skillClass: RovodevSkill }
37284
37285
  },
37285
37286
  localRootMode: "separate-local-file",
37286
- localRootFileName: "AGENTS.local.md",
37287
- mirrorsRootToAgentsMd: true
37287
+ localRootFileName: "AGENTS.local.md"
37288
37288
  }
37289
37289
  }],
37290
37290
  ["takt", {
@@ -37471,7 +37471,8 @@ var RulesProcessor = class extends FeatureProcessor {
37471
37471
  if (!rootRule) return;
37472
37472
  const newContent = this.generateReferenceSectionFromMeta(meta, toolRules) + (!meta.createsSeparateConventionsRule && meta.additionalConventions ? this.generateAdditionalConventionsSectionFromMeta(meta) : "") + rootRule.getFileContent();
37473
37473
  rootRule.setFileContent(newContent);
37474
- if (meta.mirrorsRootToAgentsMd && !this.global && factory.class.getRootMirrorFiles) toolRules.push(...factory.class.getRootMirrorFiles({
37474
+ const rootMirror = factory.class.getRootMirror?.();
37475
+ if (rootMirror && !this.global) toolRules.push(...rootMirror.getMirrorFiles({
37475
37476
  outputRoot: this.outputRoot,
37476
37477
  rootRule,
37477
37478
  content: newContent
@@ -37713,8 +37714,9 @@ As this project's AI coding tool, you must follow the additional conventions bel
37713
37714
  })();
37714
37715
  this.logger.debug(`Found ${localRootToolRules.length} local root tool rule files for deletion`);
37715
37716
  const rootMirrorDeletionRules = await (async () => {
37716
- if (!forDeletion || this.global || !factory.meta.mirrorsRootToAgentsMd || !factory.class.getRootMirrorDeletionGlobs) return [];
37717
- const { primaryGlob, mirrorGlob } = factory.class.getRootMirrorDeletionGlobs({ outputRoot: this.outputRoot });
37717
+ const rootMirror = factory.class.getRootMirror?.();
37718
+ if (!forDeletion || this.global || !rootMirror) return [];
37719
+ const { primaryGlob, mirrorGlob } = rootMirror.getMirrorDeletionGlobs({ outputRoot: this.outputRoot });
37718
37720
  if ((await findFilesByGlobs(primaryGlob)).length === 0) return [];
37719
37721
  const mirrorPaths = await findFilesByGlobs(mirrorGlob);
37720
37722
  return buildDeletionRulesFromPaths(mirrorPaths);
@@ -38152,13 +38154,13 @@ const sharedFileKey = (path) => {
38152
38154
  const file = path.relativeFilePath.replace(/\\/g, "/");
38153
38155
  return dir === "" || dir === "." ? file : `${dir}/${file}`;
38154
38156
  };
38155
- const settablePathsForScope = (cls, global) => {
38157
+ const settablePathsForScope = ({ cls, global }) => {
38156
38158
  const paths = [];
38157
38159
  let settable;
38158
38160
  try {
38159
38161
  settable = cls.getSettablePaths?.({ global });
38160
38162
  } catch {
38161
- return paths;
38163
+ settable = void 0;
38162
38164
  }
38163
38165
  if (settable?.relativeFilePath) paths.push({
38164
38166
  relativeDirPath: settable.relativeDirPath ?? ".",
@@ -38168,16 +38170,22 @@ const settablePathsForScope = (cls, global) => {
38168
38170
  paths.push(settable.root);
38169
38171
  for (const alt of settable.alternativeRoots ?? []) paths.push(alt);
38170
38172
  }
38171
- let extra;
38173
+ let extra = [];
38172
38174
  try {
38173
38175
  extra = cls.getExtraSharedWritePaths?.({ global }) ?? [];
38174
38176
  } catch {
38175
- return paths;
38177
+ extra = [];
38176
38178
  }
38177
38179
  for (const path of extra) if (path.relativeFilePath) paths.push(path);
38178
38180
  return paths;
38179
38181
  };
38180
- const collectFactoryPaths = (factory) => [...settablePathsForScope(factory.class, false), ...settablePathsForScope(factory.class, true)];
38182
+ const collectFactoryPaths = (factory) => [...settablePathsForScope({
38183
+ cls: factory.class,
38184
+ global: false
38185
+ }), ...settablePathsForScope({
38186
+ cls: factory.class,
38187
+ global: true
38188
+ })];
38181
38189
  /**
38182
38190
  * Derive, from the processor registry, every on-disk file that two or more
38183
38191
  * features read-modify-write. Source of truth the generation step graph's
@@ -38553,7 +38561,7 @@ function computeRootFileOwnership(params) {
38553
38561
  const paths = factory.class.getSettablePaths({ global: params.global });
38554
38562
  if ("root" in paths && paths.root) register(paths.root.relativeDirPath, paths.root.relativeFilePath, target);
38555
38563
  if ("alternativeRoots" in paths && paths.alternativeRoots) for (const alt of paths.alternativeRoots) register(alt.relativeDirPath, alt.relativeFilePath, target);
38556
- if (!params.global && factory.meta.mirrorsRootToAgentsMd) register(".", AGENTSMD_RULE_FILE_NAME, target);
38564
+ if (!params.global && factory.class.getRootMirror) register(".", AGENTSMD_RULE_FILE_NAME, target);
38557
38565
  }
38558
38566
  return ownerByPath;
38559
38567
  }
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_import = require("./import-DW-a1SJq.cjs");
2
+ const require_import = require("./import-rMBf0tf2.cjs");
3
3
  //#region src/index.ts
4
4
  async function generate(options = {}) {
5
5
  const { silent = true, verbose = false, ...rest } = options;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { I as ConsoleLogger, Ot as ALL_FEATURES, P as ConfigResolver, a as convertFromTool$1, n as checkRulesyncDirExists, nt as ALL_TOOL_TARGETS, r as generate$1, t as importFromTool$1 } from "./import-tTMN0WRi.js";
1
+ import { I as ConsoleLogger, Ot as ALL_FEATURES, P as ConfigResolver, a as convertFromTool$1, n as checkRulesyncDirExists, nt as ALL_TOOL_TARGETS, r as generate$1, t as importFromTool$1 } from "./import-CUHHL2_P.js";
2
2
  //#region src/index.ts
3
3
  async function generate(options = {}) {
4
4
  const { silent = true, verbose = false, ...rest } = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rulesync",
3
- "version": "9.6.1",
3
+ "version": "9.6.2",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",