rulesync 9.1.0 → 9.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_import = require("../import-CNtfs80W.cjs");
2
+ const require_import = require("../import-H0MKtu9x.cjs");
3
3
  let commander = require("commander");
4
4
  let zod_mini = require("zod/mini");
5
5
  let node_path = require("node:path");
@@ -3880,10 +3880,9 @@ function groupRemoteFilesBySkillRoot(params) {
3880
3880
  });
3881
3881
  grouped.set(skillName, groupedFiles);
3882
3882
  }
3883
- if (grouped.size === 0 && !isWildcard && skillFilter.length === 1) {
3884
- const [singleSkillName] = skillFilter;
3885
- if (singleSkillName !== void 0 && rootLevelFiles.length > 0) grouped.set(singleSkillName, rootLevelFiles);
3886
- }
3883
+ const [singleSkillName] = skillFilter;
3884
+ const hasRootSkillFile = rootLevelFiles.some((file) => file.relativePath === require_import.SKILL_FILE_NAME);
3885
+ if (!isWildcard && skillFilter.length === 1 && singleSkillName !== void 0 && hasRootSkillFile && !grouped.has(singleSkillName)) grouped.set(singleSkillName, rootLevelFiles);
3887
3886
  return grouped;
3888
3887
  }
3889
3888
  /**
@@ -3912,10 +3911,9 @@ async function resolveGithubFetchRef(params) {
3912
3911
  };
3913
3912
  }
3914
3913
  /**
3915
- * Fallback path used when the skills directory has no subdirectories but does
3916
- * contain a single flat skill (root-level files). Fetches and writes that skill
3917
- * into `fetchedSkills`. Returns whether the fallback fired and the resulting
3918
- * remote skill names.
3914
+ * Fallback path used when an explicit single-skill source points at a flat skill
3915
+ * with root-level files. Fetches and writes that skill into `fetchedSkills`.
3916
+ * Returns whether the fallback fired and the resulting remote skill names.
3919
3917
  */
3920
3918
  async function fetchRootLevelFallbackSkill(params) {
3921
3919
  const { entries, parsed, ref, resolvedSha, skillFilter, isWildcard, curatedDir, locked, sourceKey, localSkillNames, alreadyFetchedSkillNames, client, semaphore, fetchedSkills, logger } = params;
@@ -4019,7 +4017,9 @@ async function discoverGithubSkillDirs(params) {
4019
4017
  name: e.name,
4020
4018
  path: e.path
4021
4019
  }));
4022
- if (remoteSkillDirs.length === 0 && !isWildcard && skillFilter.length === 1) {
4020
+ const [singleSkillName] = skillFilter;
4021
+ const hasRequestedSkillDir = singleSkillName !== void 0 && remoteSkillDirs.some((d) => d.name === singleSkillName);
4022
+ if (!isWildcard && skillFilter.length === 1 && !hasRequestedSkillDir) {
4023
4023
  const fallback = await fetchRootLevelFallbackSkill({
4024
4024
  entries,
4025
4025
  parsed,
@@ -6485,7 +6485,7 @@ function wrapCommand$1({ name, errorCode, handler, getVersion, loggerFactory = c
6485
6485
  }
6486
6486
  //#endregion
6487
6487
  //#region src/cli/index.ts
6488
- const getVersion = () => "9.1.0";
6488
+ const getVersion = () => "9.2.0";
6489
6489
  function wrapCommand(name, errorCode, handler) {
6490
6490
  return wrapCommand$1({
6491
6491
  name,
package/dist/cli/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { $ as CLIError, A as IgnoreProcessor, At as RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH, B as toolCommandFactories, Bt as RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH, C as PermissionsProcessorToolTargetSchema, Ct as RULESYNC_COMMANDS_RELATIVE_DIR_PATH, D as McpProcessorToolTargetSchema, Dt as RULESYNC_HOOKS_FILE_NAME, E as McpProcessor, Et as RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH, F as HooksProcessorToolTargetSchema, Ft as RULESYNC_PERMISSIONS_FILE_NAME, G as CLAUDECODE_SKILLS_DIR_PATH, H as CLAUDECODE_LOCAL_RULE_FILE_NAME, Ht as formatError, I as toolHooksFactories, It as RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH, J as stringifyFrontmatter, K as RulesyncCommand, L as RulesyncHooks, Lt as RULESYNC_RELATIVE_DIR_PATH, M as toolIgnoreFactories, Mt as RULESYNC_MCP_RELATIVE_FILE_PATH, N as RulesyncIgnore, Nt as RULESYNC_MCP_SCHEMA_URL, O as toolMcpFactories, Ot as RULESYNC_HOOKS_RELATIVE_FILE_PATH, P as HooksProcessor, Pt as RULESYNC_OVERVIEW_FILE_NAME, Q as JsonLogger, R as CommandsProcessor, Rt as RULESYNC_RULES_RELATIVE_DIR_PATH, S as PermissionsProcessor, St as RULESYNC_AIIGNORE_RELATIVE_FILE_PATH, T as RulesyncPermissions, Tt as RULESYNC_CONFIG_SCHEMA_URL, U as CLAUDECODE_MEMORIES_DIR_NAME, Ut as ALL_FEATURES, V as CLAUDECODE_DIR, Vt as RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, W as CLAUDECODE_SETTINGS_LOCAL_FILE_NAME, Wt as ALL_FEATURES_WITH_WILDCARD, X as findControlCharacter, Y as ConfigResolver, Z as ConsoleLogger, _ as toolSkillFactories, _t as ALL_TOOL_TARGETS, a as RulesProcessor, at as fileExists, b as RulesyncSkillFrontmatterSchema, bt as MAX_FILE_SIZE, c as RulesyncRule, ct as getHomeDirectory, d as SubagentsProcessorToolTargetSchema, dt as readFileContent, et as ErrorCodes, f as toolSubagentFactories, ft as removeDirectory, g as SkillsProcessorToolTargetSchema, gt as writeFileContent, h as SkillsProcessor, ht as toPosixPath, i as convertFromTool, it as ensureDir, j as IgnoreProcessorToolTargetSchema, jt as RULESYNC_MCP_FILE_NAME, k as RulesyncMcp, kt as RULESYNC_IGNORE_RELATIVE_FILE_PATH, l as RulesyncRuleFrontmatterSchema, lt as isSymlink, m as RulesyncSubagentFrontmatterSchema, mt as removeTempDirectory, n as checkRulesyncDirExists, nt as createTempDirectory, o as RulesProcessorToolTargetSchema, ot as findFilesByGlobs, p as RulesyncSubagent, pt as removeFile, q as RulesyncCommandFrontmatterSchema, r as generate, rt as directoryExists, s as toolRuleFactories, st as getFileSize, t as importFromTool, tt as checkPathTraversal, u as SubagentsProcessor, ut as listDirectoryFiles, v as getLocalSkillDirNames, vt as ALL_TOOL_TARGETS_WITH_WILDCARD, w as toolPermissionsFactories, wt as RULESYNC_CONFIG_RELATIVE_FILE_PATH, x as SKILL_FILE_NAME$1, xt as RULESYNC_AIIGNORE_FILE_NAME, y as RulesyncSkill, yt as ToolTargetSchema, z as CommandsProcessorToolTargetSchema, zt as RULESYNC_SKILLS_RELATIVE_DIR_PATH } from "../import-ylOvQDpE.js";
2
+ import { $ as CLIError, A as IgnoreProcessor, At as RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH, B as toolCommandFactories, Bt as RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH, C as PermissionsProcessorToolTargetSchema, Ct as RULESYNC_COMMANDS_RELATIVE_DIR_PATH, D as McpProcessorToolTargetSchema, Dt as RULESYNC_HOOKS_FILE_NAME, E as McpProcessor, Et as RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH, F as HooksProcessorToolTargetSchema, Ft as RULESYNC_PERMISSIONS_FILE_NAME, G as CLAUDECODE_SKILLS_DIR_PATH, H as CLAUDECODE_LOCAL_RULE_FILE_NAME, Ht as formatError, I as toolHooksFactories, It as RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH, J as stringifyFrontmatter, K as RulesyncCommand, L as RulesyncHooks, Lt as RULESYNC_RELATIVE_DIR_PATH, M as toolIgnoreFactories, Mt as RULESYNC_MCP_RELATIVE_FILE_PATH, N as RulesyncIgnore, Nt as RULESYNC_MCP_SCHEMA_URL, O as toolMcpFactories, Ot as RULESYNC_HOOKS_RELATIVE_FILE_PATH, P as HooksProcessor, Pt as RULESYNC_OVERVIEW_FILE_NAME, Q as JsonLogger, R as CommandsProcessor, Rt as RULESYNC_RULES_RELATIVE_DIR_PATH, S as PermissionsProcessor, St as RULESYNC_AIIGNORE_RELATIVE_FILE_PATH, T as RulesyncPermissions, Tt as RULESYNC_CONFIG_SCHEMA_URL, U as CLAUDECODE_MEMORIES_DIR_NAME, Ut as ALL_FEATURES, V as CLAUDECODE_DIR, Vt as RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH, W as CLAUDECODE_SETTINGS_LOCAL_FILE_NAME, Wt as ALL_FEATURES_WITH_WILDCARD, X as findControlCharacter, Y as ConfigResolver, Z as ConsoleLogger, _ as toolSkillFactories, _t as ALL_TOOL_TARGETS, a as RulesProcessor, at as fileExists, b as RulesyncSkillFrontmatterSchema, bt as MAX_FILE_SIZE, c as RulesyncRule, ct as getHomeDirectory, d as SubagentsProcessorToolTargetSchema, dt as readFileContent, et as ErrorCodes, f as toolSubagentFactories, ft as removeDirectory, g as SkillsProcessorToolTargetSchema, gt as writeFileContent, h as SkillsProcessor, ht as toPosixPath, i as convertFromTool, it as ensureDir, j as IgnoreProcessorToolTargetSchema, jt as RULESYNC_MCP_FILE_NAME, k as RulesyncMcp, kt as RULESYNC_IGNORE_RELATIVE_FILE_PATH, l as RulesyncRuleFrontmatterSchema, lt as isSymlink, m as RulesyncSubagentFrontmatterSchema, mt as removeTempDirectory, n as checkRulesyncDirExists, nt as createTempDirectory, o as RulesProcessorToolTargetSchema, ot as findFilesByGlobs, p as RulesyncSubagent, pt as removeFile, q as RulesyncCommandFrontmatterSchema, r as generate, rt as directoryExists, s as toolRuleFactories, st as getFileSize, t as importFromTool, tt as checkPathTraversal, u as SubagentsProcessor, ut as listDirectoryFiles, v as getLocalSkillDirNames, vt as ALL_TOOL_TARGETS_WITH_WILDCARD, w as toolPermissionsFactories, wt as RULESYNC_CONFIG_RELATIVE_FILE_PATH, x as SKILL_FILE_NAME$1, xt as RULESYNC_AIIGNORE_FILE_NAME, y as RulesyncSkill, yt as ToolTargetSchema, z as CommandsProcessorToolTargetSchema, zt as RULESYNC_SKILLS_RELATIVE_DIR_PATH } from "../import-BkxwFCDM.js";
3
3
  import { Command } from "commander";
4
4
  import { nonnegative, optional, refine, z } from "zod/mini";
5
5
  import * as path$1 from "node:path";
@@ -3878,10 +3878,9 @@ function groupRemoteFilesBySkillRoot(params) {
3878
3878
  });
3879
3879
  grouped.set(skillName, groupedFiles);
3880
3880
  }
3881
- if (grouped.size === 0 && !isWildcard && skillFilter.length === 1) {
3882
- const [singleSkillName] = skillFilter;
3883
- if (singleSkillName !== void 0 && rootLevelFiles.length > 0) grouped.set(singleSkillName, rootLevelFiles);
3884
- }
3881
+ const [singleSkillName] = skillFilter;
3882
+ const hasRootSkillFile = rootLevelFiles.some((file) => file.relativePath === SKILL_FILE_NAME$1);
3883
+ if (!isWildcard && skillFilter.length === 1 && singleSkillName !== void 0 && hasRootSkillFile && !grouped.has(singleSkillName)) grouped.set(singleSkillName, rootLevelFiles);
3885
3884
  return grouped;
3886
3885
  }
3887
3886
  /**
@@ -3910,10 +3909,9 @@ async function resolveGithubFetchRef(params) {
3910
3909
  };
3911
3910
  }
3912
3911
  /**
3913
- * Fallback path used when the skills directory has no subdirectories but does
3914
- * contain a single flat skill (root-level files). Fetches and writes that skill
3915
- * into `fetchedSkills`. Returns whether the fallback fired and the resulting
3916
- * remote skill names.
3912
+ * Fallback path used when an explicit single-skill source points at a flat skill
3913
+ * with root-level files. Fetches and writes that skill into `fetchedSkills`.
3914
+ * Returns whether the fallback fired and the resulting remote skill names.
3917
3915
  */
3918
3916
  async function fetchRootLevelFallbackSkill(params) {
3919
3917
  const { entries, parsed, ref, resolvedSha, skillFilter, isWildcard, curatedDir, locked, sourceKey, localSkillNames, alreadyFetchedSkillNames, client, semaphore, fetchedSkills, logger } = params;
@@ -4017,7 +4015,9 @@ async function discoverGithubSkillDirs(params) {
4017
4015
  name: e.name,
4018
4016
  path: e.path
4019
4017
  }));
4020
- if (remoteSkillDirs.length === 0 && !isWildcard && skillFilter.length === 1) {
4018
+ const [singleSkillName] = skillFilter;
4019
+ const hasRequestedSkillDir = singleSkillName !== void 0 && remoteSkillDirs.some((d) => d.name === singleSkillName);
4020
+ if (!isWildcard && skillFilter.length === 1 && !hasRequestedSkillDir) {
4021
4021
  const fallback = await fetchRootLevelFallbackSkill({
4022
4022
  entries,
4023
4023
  parsed,
@@ -6483,7 +6483,7 @@ function wrapCommand$1({ name, errorCode, handler, getVersion, loggerFactory = c
6483
6483
  }
6484
6484
  //#endregion
6485
6485
  //#region src/cli/index.ts
6486
- const getVersion = () => "9.1.0";
6486
+ const getVersion = () => "9.2.0";
6487
6487
  function wrapCommand(name, errorCode, handler) {
6488
6488
  return wrapCommand$1({
6489
6489
  name,