rulesync 20.0.0 → 21.0.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.
@@ -45011,14 +45011,14 @@ const COMMANDCODE_TOOL_TO_CATEGORY = {
45011
45011
  web_fetch: "webfetch",
45012
45012
  web_search: "websearch"
45013
45013
  };
45014
- const ACTION_RANK$1 = {
45014
+ const ACTION_RANK$2 = {
45015
45015
  allow: 0,
45016
45016
  ask: 1,
45017
45017
  deny: 2
45018
45018
  };
45019
45019
  /** Whether `action` outranks `existing` (deny > ask > allow). */
45020
45020
  function isStricterAction({ action, existing }) {
45021
- return existing === void 0 || ACTION_RANK$1[action] > ACTION_RANK$1[existing];
45021
+ return existing === void 0 || ACTION_RANK$2[action] > ACTION_RANK$2[existing];
45022
45022
  }
45023
45023
  /**
45024
45024
  * Why a padded `Shell( * )` cannot stand in for the bare `Shell` in `allow`:
@@ -48366,20 +48366,22 @@ function convertFactorydroidToRulesyncPermissions({ allow, deny }) {
48366
48366
  const GOOSE_GLOBAL_ONLY_MESSAGE = "Goose permissions are global-only; use --global to sync ~/.config/goose/permission.yaml";
48367
48367
  const GOOSE_USER_KEY = "user";
48368
48368
  const CATCH_ALL_PATTERN$4 = "*";
48369
- const RULESYNC_TO_GOOSE_TOOL_NAME = {
48370
- bash: "developer__shell",
48371
- edit: "developer__text_editor",
48372
- write: "developer__text_editor"
48373
- };
48374
- const GOOSE_TO_RULESYNC_TOOL_NAME = {
48375
- developer__shell: "bash",
48376
- developer__text_editor: "edit"
48369
+ const RULESYNC_TO_GOOSE_TOOL_NAME = { bash: "shell" };
48370
+ const GOOSE_TO_RULESYNC_TOOL_NAMES = {
48371
+ shell: ["bash"],
48372
+ developer__shell: ["bash"],
48373
+ developer__text_editor: ["edit", "write"]
48377
48374
  };
48378
48375
  const ACTION_TO_GOOSE_LIST = {
48379
48376
  allow: "always_allow",
48380
48377
  ask: "ask_before",
48381
48378
  deny: "never_allow"
48382
48379
  };
48380
+ const ACTION_RANK$1 = {
48381
+ allow: 0,
48382
+ ask: 1,
48383
+ deny: 2
48384
+ };
48383
48385
  const GOOSE_LIST_TO_ACTION = {
48384
48386
  always_allow: "allow",
48385
48387
  ask_before: "ask",
@@ -48404,10 +48406,11 @@ const GOOSE_PERMISSION_LIST_KEYS = [
48404
48406
  *
48405
48407
  * Mapping (rulesync canonical -> Goose):
48406
48408
  * - Action: `allow` -> `always_allow`, `ask` -> `ask_before`, `deny` -> `never_allow`.
48407
- * - Tool name: `bash` -> `developer__shell`, `edit` -> `developer__text_editor`;
48408
- * any other category passes through verbatim as the Goose tool name (mirrors
48409
- * the Gemini CLI adapter). `write` collapses onto `developer__text_editor`
48410
- * too, so a conflicting `edit`/`write` catch-all is reported and `edit` wins.
48409
+ * - Tool name: `bash` -> `shell`; any other category (including `edit` and
48410
+ * `write`) passes through verbatim as the Goose tool name (mirrors the
48411
+ * Gemini CLI adapter). The legacy `developer__shell` /
48412
+ * `developer__text_editor` names are still accepted on import, the latter
48413
+ * as both `edit` and `write`.
48411
48414
  * - Granularity: Goose lists hold whole tool names, so only a category's
48412
48415
  * catch-all `*` pattern is representable. Non-catch-all patterns cannot be
48413
48416
  * expressed per-tool and are reported via `logger.warn` and skipped.
@@ -48523,8 +48526,7 @@ function convertRulesyncToGoosePermissionConfig({ config, logger }) {
48523
48526
  never_allow: []
48524
48527
  };
48525
48528
  const assigned = /* @__PURE__ */ new Map();
48526
- const orderedEntries = Object.entries(honorAllToolsOnBash(config.permission)).toSorted(([a], [b]) => (a === "edit" ? 1 : 0) - (b === "edit" ? 1 : 0));
48527
- for (const [category, rules] of orderedEntries) {
48529
+ for (const [category, rules] of Object.entries(honorAllToolsOnBash(config.permission))) {
48528
48530
  const toolName = RULESYNC_TO_GOOSE_TOOL_NAME[category] ?? category;
48529
48531
  for (const [pattern, action] of Object.entries(rules)) {
48530
48532
  if (pattern !== CATCH_ALL_PATTERN$4) {
@@ -48532,12 +48534,15 @@ function convertRulesyncToGoosePermissionConfig({ config, logger }) {
48532
48534
  continue;
48533
48535
  }
48534
48536
  const previous = assigned.get(toolName);
48535
- if (previous !== void 0 && previous !== action) {
48536
- logger?.warn(`Goose maps "${category}" onto the "${toolName}" tool, which already has a conflicting permission ("${previous}"). The "${action}" value takes precedence.`);
48537
+ if (previous === action) continue;
48538
+ if (previous !== void 0) {
48539
+ const stricter = ACTION_RANK$1[action] > ACTION_RANK$1[previous] ? action : previous;
48540
+ logger?.warn(`Goose maps "${category}" onto the "${toolName}" tool, which already has a conflicting permission ("${previous}"). Keeping the stricter "${stricter}" (deny > ask > allow).`);
48541
+ if (stricter === previous) continue;
48537
48542
  const previousList = lists[ACTION_TO_GOOSE_LIST[previous]];
48538
48543
  const index = previousList.indexOf(toolName);
48539
48544
  if (index !== -1) previousList.splice(index, 1);
48540
- } else if (previous === action) continue;
48545
+ }
48541
48546
  lists[ACTION_TO_GOOSE_LIST[action]].push(toolName);
48542
48547
  assigned.set(toolName, action);
48543
48548
  }
@@ -48553,8 +48558,7 @@ function convertGoosePermissionConfigToRulesync(userPermission) {
48553
48558
  for (const key of GOOSE_PERMISSION_LIST_KEYS) {
48554
48559
  const toolNames = isStringArray$2(userPermission[key]) ? userPermission[key] : [];
48555
48560
  const action = GOOSE_LIST_TO_ACTION[key];
48556
- for (const toolName of toolNames) {
48557
- const category = GOOSE_TO_RULESYNC_TOOL_NAME[toolName] ?? toolName;
48561
+ for (const toolName of toolNames) for (const category of GOOSE_TO_RULESYNC_TOOL_NAMES[toolName] ?? [toolName]) {
48558
48562
  permission[category] ??= {};
48559
48563
  permission[category][CATCH_ALL_PATTERN$4] = action;
48560
48564
  }
@@ -44986,14 +44986,14 @@ const COMMANDCODE_TOOL_TO_CATEGORY = {
44986
44986
  web_fetch: "webfetch",
44987
44987
  web_search: "websearch"
44988
44988
  };
44989
- const ACTION_RANK$1 = {
44989
+ const ACTION_RANK$2 = {
44990
44990
  allow: 0,
44991
44991
  ask: 1,
44992
44992
  deny: 2
44993
44993
  };
44994
44994
  /** Whether `action` outranks `existing` (deny > ask > allow). */
44995
44995
  function isStricterAction({ action, existing }) {
44996
- return existing === void 0 || ACTION_RANK$1[action] > ACTION_RANK$1[existing];
44996
+ return existing === void 0 || ACTION_RANK$2[action] > ACTION_RANK$2[existing];
44997
44997
  }
44998
44998
  /**
44999
44999
  * Why a padded `Shell( * )` cannot stand in for the bare `Shell` in `allow`:
@@ -48341,20 +48341,22 @@ function convertFactorydroidToRulesyncPermissions({ allow, deny }) {
48341
48341
  const GOOSE_GLOBAL_ONLY_MESSAGE = "Goose permissions are global-only; use --global to sync ~/.config/goose/permission.yaml";
48342
48342
  const GOOSE_USER_KEY = "user";
48343
48343
  const CATCH_ALL_PATTERN$4 = "*";
48344
- const RULESYNC_TO_GOOSE_TOOL_NAME = {
48345
- bash: "developer__shell",
48346
- edit: "developer__text_editor",
48347
- write: "developer__text_editor"
48348
- };
48349
- const GOOSE_TO_RULESYNC_TOOL_NAME = {
48350
- developer__shell: "bash",
48351
- developer__text_editor: "edit"
48344
+ const RULESYNC_TO_GOOSE_TOOL_NAME = { bash: "shell" };
48345
+ const GOOSE_TO_RULESYNC_TOOL_NAMES = {
48346
+ shell: ["bash"],
48347
+ developer__shell: ["bash"],
48348
+ developer__text_editor: ["edit", "write"]
48352
48349
  };
48353
48350
  const ACTION_TO_GOOSE_LIST = {
48354
48351
  allow: "always_allow",
48355
48352
  ask: "ask_before",
48356
48353
  deny: "never_allow"
48357
48354
  };
48355
+ const ACTION_RANK$1 = {
48356
+ allow: 0,
48357
+ ask: 1,
48358
+ deny: 2
48359
+ };
48358
48360
  const GOOSE_LIST_TO_ACTION = {
48359
48361
  always_allow: "allow",
48360
48362
  ask_before: "ask",
@@ -48379,10 +48381,11 @@ const GOOSE_PERMISSION_LIST_KEYS = [
48379
48381
  *
48380
48382
  * Mapping (rulesync canonical -> Goose):
48381
48383
  * - Action: `allow` -> `always_allow`, `ask` -> `ask_before`, `deny` -> `never_allow`.
48382
- * - Tool name: `bash` -> `developer__shell`, `edit` -> `developer__text_editor`;
48383
- * any other category passes through verbatim as the Goose tool name (mirrors
48384
- * the Gemini CLI adapter). `write` collapses onto `developer__text_editor`
48385
- * too, so a conflicting `edit`/`write` catch-all is reported and `edit` wins.
48384
+ * - Tool name: `bash` -> `shell`; any other category (including `edit` and
48385
+ * `write`) passes through verbatim as the Goose tool name (mirrors the
48386
+ * Gemini CLI adapter). The legacy `developer__shell` /
48387
+ * `developer__text_editor` names are still accepted on import, the latter
48388
+ * as both `edit` and `write`.
48386
48389
  * - Granularity: Goose lists hold whole tool names, so only a category's
48387
48390
  * catch-all `*` pattern is representable. Non-catch-all patterns cannot be
48388
48391
  * expressed per-tool and are reported via `logger.warn` and skipped.
@@ -48498,8 +48501,7 @@ function convertRulesyncToGoosePermissionConfig({ config, logger }) {
48498
48501
  never_allow: []
48499
48502
  };
48500
48503
  const assigned = /* @__PURE__ */ new Map();
48501
- const orderedEntries = Object.entries(honorAllToolsOnBash(config.permission)).toSorted(([a], [b]) => (a === "edit" ? 1 : 0) - (b === "edit" ? 1 : 0));
48502
- for (const [category, rules] of orderedEntries) {
48504
+ for (const [category, rules] of Object.entries(honorAllToolsOnBash(config.permission))) {
48503
48505
  const toolName = RULESYNC_TO_GOOSE_TOOL_NAME[category] ?? category;
48504
48506
  for (const [pattern, action] of Object.entries(rules)) {
48505
48507
  if (pattern !== CATCH_ALL_PATTERN$4) {
@@ -48507,12 +48509,15 @@ function convertRulesyncToGoosePermissionConfig({ config, logger }) {
48507
48509
  continue;
48508
48510
  }
48509
48511
  const previous = assigned.get(toolName);
48510
- if (previous !== void 0 && previous !== action) {
48511
- logger?.warn(`Goose maps "${category}" onto the "${toolName}" tool, which already has a conflicting permission ("${previous}"). The "${action}" value takes precedence.`);
48512
+ if (previous === action) continue;
48513
+ if (previous !== void 0) {
48514
+ const stricter = ACTION_RANK$1[action] > ACTION_RANK$1[previous] ? action : previous;
48515
+ logger?.warn(`Goose maps "${category}" onto the "${toolName}" tool, which already has a conflicting permission ("${previous}"). Keeping the stricter "${stricter}" (deny > ask > allow).`);
48516
+ if (stricter === previous) continue;
48512
48517
  const previousList = lists[ACTION_TO_GOOSE_LIST[previous]];
48513
48518
  const index = previousList.indexOf(toolName);
48514
48519
  if (index !== -1) previousList.splice(index, 1);
48515
- } else if (previous === action) continue;
48520
+ }
48516
48521
  lists[ACTION_TO_GOOSE_LIST[action]].push(toolName);
48517
48522
  assigned.set(toolName, action);
48518
48523
  }
@@ -48528,8 +48533,7 @@ function convertGoosePermissionConfigToRulesync(userPermission) {
48528
48533
  for (const key of GOOSE_PERMISSION_LIST_KEYS) {
48529
48534
  const toolNames = isStringArray$2(userPermission[key]) ? userPermission[key] : [];
48530
48535
  const action = GOOSE_LIST_TO_ACTION[key];
48531
- for (const toolName of toolNames) {
48532
- const category = GOOSE_TO_RULESYNC_TOOL_NAME[toolName] ?? toolName;
48536
+ for (const toolName of toolNames) for (const category of GOOSE_TO_RULESYNC_TOOL_NAMES[toolName] ?? [toolName]) {
48533
48537
  permission[category] ??= {};
48534
48538
  permission[category][CATCH_ALL_PATTERN$4] = action;
48535
48539
  }
@@ -82612,4 +82616,4 @@ async function importChecksCore(params) {
82612
82616
  //#endregion
82613
82617
  export { RulesyncCommand as $, toPosixPath as $t, CLAUDECODE_MEMORIES_DIR_NAME as A, RULESYNC_XDG_CONFIG_HOME_DEFAULT_DIR_NAME as An, checkPathTraversal as At, RulesyncSubagent as B, stripControlCharacters as Bn, listDirectoryEntryNames as Bt, COMMANDCODE_DIR as C, RULESYNC_PERMISSIONS_SCHEMA_URL as Cn, withWarnOnceScope as Ct, CODEXCLI_DIR as D, RULESYNC_SOURCES_LOCK_RELATIVE_FILE_PATH as Dn, assertDirectoryIfExists as Dt, CODEXCLI_BASH_RULES_FILE_NAME as E, RULESYNC_SKILLS_RELATIVE_DIR_PATH as En, applyFileMode as Et, caseFoldIdentity as F, formatError as Fn, getFileSize as Ft, RulesyncRuleFrontmatterSchema as G, readFileContentOrNull as Gt, RulesyncSkill as H, stripHiddenCharacters as Hn, listSubdirectoryNames as Ht, groupSpellingsByCaseFoldedIdentity as I, truncateText as In, getHomeDirectory as It, RulesyncIgnore as J, removeFile as Jt, RulesyncPermissions as K, removeDirectory as Kt, AUGMENTCODE_DIR as L, hasDeceptiveHiddenCharacters as Ln, isFileNotFoundError as Lt, CLAUDECODE_SKILLS_DIR_PATH as M, ALL_FEATURES as Mn, directoryExists as Mt, FACTORYDROID_DIR as N, ALL_FEATURES_WITH_WILDCARD as Nn, ensureDir as Nt, CLAUDECODE_DIR as O, RULESYNC_SUBAGENTS_RELATIVE_DIR_PATH as On, assertTreeContainsNoSymlinks as Ot, FACTORYDROID_SETTINGS_LOCAL_FILE_NAME as P, DEPRECATED_FEATURE_REPLACEMENTS as Pn, fileExists as Pt, parseJsonc as Q, runWithDirectoryRollback as Qt, AUGMENTCODE_SETTINGS_LOCAL_FILE_NAME as R, hasEnclosingMarkOutsideKeycap as Rn, isFileSystemError as Rt, QWENCODE_LOCAL_RULE_FILE_NAME as S, RULESYNC_PERMISSIONS_RELATIVE_FILE_PATH as Sn, resetRunWarningState as St, ChecksProcessor as T, RULESYNC_RULES_RELATIVE_DIR_PATH as Tn, ErrorCodes as Tt, RulesyncSkillFrontmatterSchema as U, pathEscapesRoot as Ut, RulesyncSubagentFrontmatterSchema as V, stripControlCharactersKeepingLineFeeds as Vn, listFilePathsRecursively as Vt, RulesyncRule as W, readFileContent as Wt, getRulesyncSourceCandidates as X, removeTempDirectory as Xt, RulesyncHooks as Y, removeFileStrict as Yt, resolveRulesyncSourceWritePath as Z, resolvePath as Zt, IgnoreProcessor as _, RULESYNC_IGNORE_RELATIVE_FILE_PATH as _n, JsonLogger as _t, getProcessorRegistryEntry as a, ToolTargetSchema as an, SHARED_USER_MANAGED_CONFIG_PATHS as at, CommandsProcessor as b, RULESYNC_MCP_SCHEMA_URL as bn, warnOnConflictingFlags as bt, RulesProcessor as c, MAX_FILE_SIZE as cn, mergeInputRootConfigs as ct, CODEBUDDY_DIR as d, RULESYNC_COMMANDS_RELATIVE_DIR_PATH as dn, ConfigFileSchema as dt, writeFileBuffer as en, RulesyncCommandFrontmatterSchema as et, CODEBUDDY_LOCAL_RULE_FILE_NAME as f, RULESYNC_CONFIG_RELATIVE_FILE_PATH as fn, GITIGNORE_DESTINATION_KEY as ft, McpProcessor as g, RULESYNC_HOOKS_RELATIVE_FILE_PATH as gn, ConsoleLogger as gt, shortenToWidth as h, RULESYNC_CURATED_SKILLS_RELATIVE_DIR_PATH as hn, findControlCharacter as ht, inspectInputRoots as i, PACKAGING_TOOL_TARGETS as in, loadYaml as it, CLAUDECODE_SETTINGS_LOCAL_FILE_NAME as j, parseCommaSeparatedList as jn, createTempDirectory as jt, CLAUDECODE_LOCAL_RULE_FILE_NAME as k, RULESYNC_USER_CONFIG_DIR_NAME as kn, assertWritablePathInsideRoot as kt, SubagentsProcessor as l, RULESYNC_AIIGNORE_RELATIVE_FILE_PATH as ln, resolveEffectiveInputRoots as lt, displayWidthOf as m, RULESYNC_CURATED_RULES_RELATIVE_DIR_PATH as mn, assertTargetsFeaturesExclusive as mt, formatSourceLoadFailure as n, ALL_TOOL_TARGETS as nn, RulesyncCheckFrontmatterSchema as nt, convertFromTool as o, CURATED_RULES_FEATURE_SUBDIR as on, SKILL_FILE_NAME as ot, ELLIPSIS_WIDTH as p, RULESYNC_CONFIG_SCHEMA_URL as pn, SourceEntrySchema as pt, RulesyncMcp as q, removeDirectoryStrict as qt, generate as r, ALL_TOOL_TARGETS_WITH_WILDCARD as rn, stringifyFrontmatter as rt, isPackagingToolTarget as s, FEATURE_SOURCE_TREE_ENTRIES as sn, ConfigResolver as st, importFromTool as t, writeFileContent as tn, RulesyncCheck as tt, SkillsProcessor as u, RULESYNC_CHECKS_RELATIVE_DIR_PATH as un, CONFLICTING_TARGET_PAIRS as ut, HooksProcessor as v, RULESYNC_LOCAL_CONFIG_RELATIVE_FILE_PATH as vn, WarningCollectingLogger as vt, COMMANDCODE_SETTINGS_LOCAL_FILE_NAME as w, RULESYNC_RELATIVE_DIR_PATH as wn, CLIError as wt, QWENCODE_DIR as x, RULESYNC_NPM_SOURCES_LOCK_RELATIVE_FILE_PATH as xn, withFallbackLoggerTarget as xt, CRUSH_LOCAL_RULE_FILE_NAME as y, RULESYNC_MCP_RELATIVE_FILE_PATH as yn, fallbackLogger as yt, getLocalSkillDirNames as z, quoteForLog as zn, isSymlink as zt };
82614
82618
 
82615
- //# sourceMappingURL=import-_UbLpXUZ.js.map
82619
+ //# sourceMappingURL=import-CSKYRGa5.js.map