@salesforce/graphiti 11.35.1 → 11.35.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.
@@ -132,8 +132,17 @@ export const DETAIL_INPUT = z
132
132
  // to safe API-name charsets so downstream layers can trust them.
133
133
  const DISCOVER_ORG_ALIAS_RE = /^[A-Za-z0-9_-]{1,80}$/;
134
134
  const DISCOVER_SOBJECT_NAME_RE = /^[A-Za-z][A-Za-z0-9_]{0,79}$/;
135
- // eslint-disable-next-line no-control-regex -- intentionally rejects control chars
136
- const DISCOVER_SEARCH_RE = /^[^\x00-\x1f\x7f]*$/;
135
+ // Mirrors CONTROL_CHAR_RE's Cc/Cf class (lib/control-chars.ts): a search
136
+ // string carrying bidi overrides / zero-width / tag chars (all Cf) is the same
137
+ // host-reflection threat as the C0/DEL (Cc) chars the earlier range caught —
138
+ // `search` is reflected verbatim through the SUCCESS envelope
139
+ // (tool-adapter.ts runTool), which neutralizes neither Cc nor Cf (W-23336442).
140
+ // The Unicode property escape tracks future Cc/Cf additions so this guard
141
+ // cannot drift from the canonical class. Unlike the enum-rejection stripper,
142
+ // this REJECTS rather than strips: `search` is a free-text substring filter,
143
+ // not an enum, so there is no allowed-value round-trip to preserve. The `u`
144
+ // flag is REQUIRED for the \p escapes.
145
+ const DISCOVER_SEARCH_RE = /^[^\p{Cc}\p{Cf}]*$/u;
137
146
 
138
147
  export const DISCOVER_INPUT = z.object({
139
148
  org: z
@@ -128,9 +128,12 @@ export function neutralizeControlChars(s: string): string {
128
128
  /**
129
129
  * Redact local filesystem layout from error text so the MCP host never sees the
130
130
  * developer's home dir, OS username, repo checkout location, or schema-cache
131
- * path (W-22697673 info-disclosure). Applied to every category's message.
131
+ * path (W-22697673 info-disclosure). Applied to every category's message. Also
132
+ * neutralizes Cc/Cf control chars (via `neutralizeControlChars`, LAST) so it is
133
+ * the single primitive the CLI mirror's error path reuses to sanitize a raw
134
+ * `err.message`/stack before emitting it (W-23336442, N2).
132
135
  */
133
- function sanitizePaths(s: string): string {
136
+ export function sanitizePaths(s: string): string {
134
137
  let out = stripLineSeparators(s).replace(/file:\/\//g, "");
135
138
  // 1) Repo-internal: drop any absolute prefix before packages/ or node_modules/
136
139
  // so a frame relativizes to `packages/graphiti/...` regardless of checkout.