@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.
- package/CHANGELOG.md +10 -0
- package/dist/commands/mcp-mirror/run-mirror.js +15 -5
- package/dist/commands/mcp-mirror/run-mirror.js.map +1 -1
- package/dist/intent/build-discover.js +16 -3
- package/dist/intent/build-discover.js.map +1 -1
- package/dist/lib/control-chars.d.ts +25 -0
- package/dist/lib/control-chars.js +38 -0
- package/dist/lib/control-chars.js.map +1 -1
- package/dist/lib/query-builder.js +21 -3
- package/dist/lib/query-builder.js.map +1 -1
- package/dist/schemas/input-schemas.js +11 -2
- package/dist/schemas/input-schemas.js.map +1 -1
- package/dist/schemas/tool-adapter.d.ts +9 -0
- package/dist/schemas/tool-adapter.js +5 -2
- package/dist/schemas/tool-adapter.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/mcp-mirror/__tests__/run-mirror.spec.ts +115 -0
- package/src/commands/mcp-mirror/run-mirror.ts +15 -5
- package/src/intent/__tests__/build-discover.spec.ts +162 -0
- package/src/intent/build-discover.ts +16 -3
- package/src/lib/__tests__/control-chars.spec.ts +68 -0
- package/src/lib/__tests__/query-builder.spec.ts +128 -0
- package/src/lib/control-chars.ts +38 -0
- package/src/lib/query-builder.ts +21 -3
- package/src/schemas/__tests__/input-schemas.spec.ts +67 -0
- package/src/schemas/input-schemas.ts +11 -2
- package/src/schemas/tool-adapter.ts +5 -2
|
@@ -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
|
-
//
|
|
136
|
-
|
|
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.
|