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.
@@ -12644,6 +12644,13 @@ function mapOauthFromCodex(oauth) {
12644
12644
  }
12645
12645
  return result;
12646
12646
  }
12647
+ const CODEX_MCP_SERVER_NAME_PATTERN = /^[a-zA-Z0-9_-]+$/;
12648
+ function normalizeCodexMcpServerName(name) {
12649
+ if (PROTOTYPE_POLLUTION_KEYS.has(name)) return null;
12650
+ if (CODEX_MCP_SERVER_NAME_PATTERN.test(name)) return name;
12651
+ const normalizedName = name.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
12652
+ return normalizedName && !PROTOTYPE_POLLUTION_KEYS.has(normalizedName) ? normalizedName : null;
12653
+ }
12647
12654
  function convertFromCodexFormat(codexMcp) {
12648
12655
  const result = {};
12649
12656
  for (const [name, config] of Object.entries(codexMcp)) {
@@ -12666,8 +12673,13 @@ function convertFromCodexFormat(codexMcp) {
12666
12673
  }
12667
12674
  function convertToCodexFormat(mcpServers) {
12668
12675
  const result = {};
12676
+ const originalNames = /* @__PURE__ */ new Map();
12669
12677
  for (const [name, config] of Object.entries(mcpServers)) {
12670
- if (PROTOTYPE_POLLUTION_KEYS.has(name)) continue;
12678
+ const codexName = normalizeCodexMcpServerName(name);
12679
+ if (codexName === null) {
12680
+ warnWithFallback(void 0, `MCP server "${name}" could not be normalized to a valid Codex MCP server name and was skipped.`);
12681
+ continue;
12682
+ }
12671
12683
  if (!isRecord(config)) continue;
12672
12684
  const converted = {};
12673
12685
  for (const [key, value] of Object.entries(config)) {
@@ -12681,7 +12693,10 @@ function convertToCodexFormat(mcpServers) {
12681
12693
  else warnWithFallback(void 0, `[CodexCliMcp] Skipping invalid value type for mapped key '${key}': expected string array, got ${typeof value}`);
12682
12694
  } else converted[key] = value;
12683
12695
  }
12684
- result[name] = converted;
12696
+ const previousName = originalNames.get(codexName);
12697
+ 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.`);
12698
+ originalNames.set(codexName, name);
12699
+ result[codexName] = converted;
12685
12700
  }
12686
12701
  return result;
12687
12702
  }
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_import = require("./import-rMBf0tf2.cjs");
2
+ const require_import = require("./import-DnpMhZOY.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-CUHHL2_P.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-A1yGuzwv.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.2",
3
+ "version": "9.6.3",
4
4
  "description": "Unified AI rules management CLI tool that generates configuration files for various AI development tools",
5
5
  "keywords": [
6
6
  "ai",