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.
@@ -36610,30 +36610,31 @@ var RovodevRule = class RovodevRule extends ToolRule {
36610
36610
  });
36611
36611
  }
36612
36612
  /**
36613
- * Mirror the primary `.rovodev/AGENTS.md` root rule to `./AGENTS.md` so project
36614
- * memory stays discoverable at the repo root. Empty when `rootRule` is not the primary root.
36613
+ * Root-mirror contract: rovodev mirrors its primary `.rovodev/AGENTS.md` root
36614
+ * rule to `./AGENTS.md` so project memory stays discoverable at the repo root.
36615
+ * Generation (`getMirrorFiles`) and deletion (`getMirrorDeletionGlobs`) are
36616
+ * bundled in one object so they cannot drift out of symmetry. The processor
36617
+ * keys off this method's mere presence to decide the tool mirrors at all.
36615
36618
  */
36616
- static getRootMirrorFiles({ outputRoot, rootRule, content }) {
36617
- if (!(rootRule instanceof RovodevRule)) return [];
36618
- const primary = this.getSettablePaths({ global: false }).root;
36619
- if (rootRule.getRelativeDirPath() !== primary.relativeDirPath || rootRule.getRelativeFilePath() !== primary.relativeFilePath) return [];
36620
- return [new RovodevRule({
36621
- outputRoot,
36622
- relativeDirPath: ".",
36623
- relativeFilePath: ROVODEV_RULE_FILE_NAME,
36624
- fileContent: content,
36625
- validate: true,
36626
- root: true
36627
- })];
36628
- }
36629
- /**
36630
- * Globs for mirror deletion: the `./AGENTS.md` mirror (`mirrorGlob`) is deleted
36631
- * only when the primary `.rovodev/AGENTS.md` (`primaryGlob`) still exists.
36632
- */
36633
- static getRootMirrorDeletionGlobs({ outputRoot }) {
36619
+ static getRootMirror() {
36634
36620
  return {
36635
- primaryGlob: join(outputRoot, ROVODEV_DIR, ROVODEV_RULE_FILE_NAME),
36636
- mirrorGlob: join(outputRoot, ROVODEV_RULE_FILE_NAME)
36621
+ getMirrorFiles: ({ outputRoot, rootRule, content }) => {
36622
+ if (!(rootRule instanceof RovodevRule)) return [];
36623
+ const primary = RovodevRule.getSettablePaths({ global: false }).root;
36624
+ if (rootRule.getRelativeDirPath() !== primary.relativeDirPath || rootRule.getRelativeFilePath() !== primary.relativeFilePath) return [];
36625
+ return [new RovodevRule({
36626
+ outputRoot,
36627
+ relativeDirPath: ".",
36628
+ relativeFilePath: ROVODEV_RULE_FILE_NAME,
36629
+ fileContent: content,
36630
+ validate: true,
36631
+ root: true
36632
+ })];
36633
+ },
36634
+ getMirrorDeletionGlobs: ({ outputRoot }) => ({
36635
+ primaryGlob: join(outputRoot, ROVODEV_DIR, ROVODEV_RULE_FILE_NAME),
36636
+ mirrorGlob: join(outputRoot, ROVODEV_RULE_FILE_NAME)
36637
+ })
36637
36638
  };
36638
36639
  }
36639
36640
  /** Glob for the `separate-local-file` deletion; rovodev writes it at project root, not under `.rovodev/`. */
@@ -37256,8 +37257,7 @@ const toolRuleFactories = /* @__PURE__ */ new Map([
37256
37257
  skills: { skillClass: RovodevSkill }
37257
37258
  },
37258
37259
  localRootMode: "separate-local-file",
37259
- localRootFileName: "AGENTS.local.md",
37260
- mirrorsRootToAgentsMd: true
37260
+ localRootFileName: "AGENTS.local.md"
37261
37261
  }
37262
37262
  }],
37263
37263
  ["takt", {
@@ -37444,7 +37444,8 @@ var RulesProcessor = class extends FeatureProcessor {
37444
37444
  if (!rootRule) return;
37445
37445
  const newContent = this.generateReferenceSectionFromMeta(meta, toolRules) + (!meta.createsSeparateConventionsRule && meta.additionalConventions ? this.generateAdditionalConventionsSectionFromMeta(meta) : "") + rootRule.getFileContent();
37446
37446
  rootRule.setFileContent(newContent);
37447
- if (meta.mirrorsRootToAgentsMd && !this.global && factory.class.getRootMirrorFiles) toolRules.push(...factory.class.getRootMirrorFiles({
37447
+ const rootMirror = factory.class.getRootMirror?.();
37448
+ if (rootMirror && !this.global) toolRules.push(...rootMirror.getMirrorFiles({
37448
37449
  outputRoot: this.outputRoot,
37449
37450
  rootRule,
37450
37451
  content: newContent
@@ -37686,8 +37687,9 @@ As this project's AI coding tool, you must follow the additional conventions bel
37686
37687
  })();
37687
37688
  this.logger.debug(`Found ${localRootToolRules.length} local root tool rule files for deletion`);
37688
37689
  const rootMirrorDeletionRules = await (async () => {
37689
- if (!forDeletion || this.global || !factory.meta.mirrorsRootToAgentsMd || !factory.class.getRootMirrorDeletionGlobs) return [];
37690
- const { primaryGlob, mirrorGlob } = factory.class.getRootMirrorDeletionGlobs({ outputRoot: this.outputRoot });
37690
+ const rootMirror = factory.class.getRootMirror?.();
37691
+ if (!forDeletion || this.global || !rootMirror) return [];
37692
+ const { primaryGlob, mirrorGlob } = rootMirror.getMirrorDeletionGlobs({ outputRoot: this.outputRoot });
37691
37693
  if ((await findFilesByGlobs(primaryGlob)).length === 0) return [];
37692
37694
  const mirrorPaths = await findFilesByGlobs(mirrorGlob);
37693
37695
  return buildDeletionRulesFromPaths(mirrorPaths);
@@ -38125,13 +38127,13 @@ const sharedFileKey = (path) => {
38125
38127
  const file = path.relativeFilePath.replace(/\\/g, "/");
38126
38128
  return dir === "" || dir === "." ? file : `${dir}/${file}`;
38127
38129
  };
38128
- const settablePathsForScope = (cls, global) => {
38130
+ const settablePathsForScope = ({ cls, global }) => {
38129
38131
  const paths = [];
38130
38132
  let settable;
38131
38133
  try {
38132
38134
  settable = cls.getSettablePaths?.({ global });
38133
38135
  } catch {
38134
- return paths;
38136
+ settable = void 0;
38135
38137
  }
38136
38138
  if (settable?.relativeFilePath) paths.push({
38137
38139
  relativeDirPath: settable.relativeDirPath ?? ".",
@@ -38141,16 +38143,22 @@ const settablePathsForScope = (cls, global) => {
38141
38143
  paths.push(settable.root);
38142
38144
  for (const alt of settable.alternativeRoots ?? []) paths.push(alt);
38143
38145
  }
38144
- let extra;
38146
+ let extra = [];
38145
38147
  try {
38146
38148
  extra = cls.getExtraSharedWritePaths?.({ global }) ?? [];
38147
38149
  } catch {
38148
- return paths;
38150
+ extra = [];
38149
38151
  }
38150
38152
  for (const path of extra) if (path.relativeFilePath) paths.push(path);
38151
38153
  return paths;
38152
38154
  };
38153
- const collectFactoryPaths = (factory) => [...settablePathsForScope(factory.class, false), ...settablePathsForScope(factory.class, true)];
38155
+ const collectFactoryPaths = (factory) => [...settablePathsForScope({
38156
+ cls: factory.class,
38157
+ global: false
38158
+ }), ...settablePathsForScope({
38159
+ cls: factory.class,
38160
+ global: true
38161
+ })];
38154
38162
  /**
38155
38163
  * Derive, from the processor registry, every on-disk file that two or more
38156
38164
  * features read-modify-write. Source of truth the generation step graph's
@@ -38526,7 +38534,7 @@ function computeRootFileOwnership(params) {
38526
38534
  const paths = factory.class.getSettablePaths({ global: params.global });
38527
38535
  if ("root" in paths && paths.root) register(paths.root.relativeDirPath, paths.root.relativeFilePath, target);
38528
38536
  if ("alternativeRoots" in paths && paths.alternativeRoots) for (const alt of paths.alternativeRoots) register(alt.relativeDirPath, alt.relativeFilePath, target);
38529
- if (!params.global && factory.meta.mirrorsRootToAgentsMd) register(".", AGENTSMD_RULE_FILE_NAME, target);
38537
+ if (!params.global && factory.class.getRootMirror) register(".", AGENTSMD_RULE_FILE_NAME, target);
38530
38538
  }
38531
38539
  return ownerByPath;
38532
38540
  }
@@ -39127,4 +39135,4 @@ async function importPermissionsCore(params) {
39127
39135
  //#endregion
39128
39136
  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 };
39129
39137
 
39130
- //# sourceMappingURL=import-tTMN0WRi.js.map
39138
+ //# sourceMappingURL=import-CUHHL2_P.js.map