rulesync 9.6.2 → 9.6.3

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.
@@ -12617,6 +12617,13 @@ function mapOauthFromCodex(oauth) {
12617
12617
  }
12618
12618
  return result;
12619
12619
  }
12620
+ const CODEX_MCP_SERVER_NAME_PATTERN = /^[a-zA-Z0-9_-]+$/;
12621
+ function normalizeCodexMcpServerName(name) {
12622
+ if (PROTOTYPE_POLLUTION_KEYS.has(name)) return null;
12623
+ if (CODEX_MCP_SERVER_NAME_PATTERN.test(name)) return name;
12624
+ const normalizedName = name.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
12625
+ return normalizedName && !PROTOTYPE_POLLUTION_KEYS.has(normalizedName) ? normalizedName : null;
12626
+ }
12620
12627
  function convertFromCodexFormat(codexMcp) {
12621
12628
  const result = {};
12622
12629
  for (const [name, config] of Object.entries(codexMcp)) {
@@ -12639,8 +12646,13 @@ function convertFromCodexFormat(codexMcp) {
12639
12646
  }
12640
12647
  function convertToCodexFormat(mcpServers) {
12641
12648
  const result = {};
12649
+ const originalNames = /* @__PURE__ */ new Map();
12642
12650
  for (const [name, config] of Object.entries(mcpServers)) {
12643
- if (PROTOTYPE_POLLUTION_KEYS.has(name)) continue;
12651
+ const codexName = normalizeCodexMcpServerName(name);
12652
+ if (codexName === null) {
12653
+ warnWithFallback(void 0, `MCP server "${name}" could not be normalized to a valid Codex MCP server name and was skipped.`);
12654
+ continue;
12655
+ }
12644
12656
  if (!isRecord(config)) continue;
12645
12657
  const converted = {};
12646
12658
  for (const [key, value] of Object.entries(config)) {
@@ -12654,7 +12666,10 @@ function convertToCodexFormat(mcpServers) {
12654
12666
  else warnWithFallback(void 0, `[CodexCliMcp] Skipping invalid value type for mapped key '${key}': expected string array, got ${typeof value}`);
12655
12667
  } else converted[key] = value;
12656
12668
  }
12657
- result[name] = converted;
12669
+ const previousName = originalNames.get(codexName);
12670
+ if (previousName !== void 0) warnWithFallback(void 0, `Codex MCP server name collision: "${previousName}" and "${name}" both normalize to "${codexName}". Only the last processed server will be used.`);
12671
+ originalNames.set(codexName, name);
12672
+ result[codexName] = converted;
12658
12673
  }
12659
12674
  return result;
12660
12675
  }
@@ -39135,4 +39150,4 @@ async function importPermissionsCore(params) {
39135
39150
  //#endregion
39136
39151
  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 };
39137
39152
 
39138
- //# sourceMappingURL=import-CUHHL2_P.js.map
39153
+ //# sourceMappingURL=import-A1yGuzwv.js.map