@salesforce/graphiti 10.15.1 → 10.17.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.
- package/CHANGELOG.md +10 -0
- package/dist/cli.js +21 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/mcp-mirror/commands.d.ts +16 -0
- package/dist/commands/mcp-mirror/commands.js +38 -0
- package/dist/commands/mcp-mirror/commands.js.map +1 -0
- package/dist/commands/mcp-mirror/run-mirror.d.ts +42 -0
- package/dist/commands/mcp-mirror/run-mirror.js +105 -0
- package/dist/commands/mcp-mirror/run-mirror.js.map +1 -0
- package/dist/lib/graphql-name.d.ts +2 -2
- package/dist/lib/graphql-name.js +2 -2
- package/dist/mcp/stdio.js +0 -0
- package/dist/mcp/tools/sf-gql-aggregate.js +2 -55
- package/dist/mcp/tools/sf-gql-aggregate.js.map +1 -1
- package/dist/mcp/tools/sf-gql-connect.js +2 -9
- package/dist/mcp/tools/sf-gql-connect.js.map +1 -1
- package/dist/mcp/tools/sf-gql-create.js +2 -15
- package/dist/mcp/tools/sf-gql-create.js.map +1 -1
- package/dist/mcp/tools/sf-gql-delete.js +2 -11
- package/dist/mcp/tools/sf-gql-delete.js.map +1 -1
- package/dist/mcp/tools/sf-gql-detail.js +2 -30
- package/dist/mcp/tools/sf-gql-detail.js.map +1 -1
- package/dist/mcp/tools/sf-gql-discover.js +2 -33
- package/dist/mcp/tools/sf-gql-discover.js.map +1 -1
- package/dist/mcp/tools/sf-gql-list.js +2 -32
- package/dist/mcp/tools/sf-gql-list.js.map +1 -1
- package/dist/mcp/tools/sf-gql-raw.js +2 -19
- package/dist/mcp/tools/sf-gql-raw.js.map +1 -1
- package/dist/mcp/tools/sf-gql-update.js +2 -15
- package/dist/mcp/tools/sf-gql-update.js.map +1 -1
- package/dist/{mcp/tools/shared/zod-schemas.js → schemas/fields.js} +2 -2
- package/dist/schemas/fields.js.map +1 -0
- package/dist/schemas/input-schemas.d.ts +318 -0
- package/dist/schemas/input-schemas.js +230 -0
- package/dist/schemas/input-schemas.js.map +1 -0
- package/package.json +1 -1
- package/src/cli.ts +23 -1
- package/src/commands/mcp-mirror/__tests__/commands.spec.ts +146 -0
- package/src/commands/mcp-mirror/__tests__/run-mirror.spec.ts +251 -0
- package/src/commands/mcp-mirror/commands.ts +92 -0
- package/src/commands/mcp-mirror/run-mirror.ts +149 -0
- package/src/lib/graphql-name.ts +2 -2
- package/src/mcp/tools/sf-gql-aggregate.ts +2 -68
- package/src/mcp/tools/sf-gql-connect.ts +2 -11
- package/src/mcp/tools/sf-gql-create.ts +2 -21
- package/src/mcp/tools/sf-gql-delete.ts +2 -15
- package/src/mcp/tools/sf-gql-detail.ts +2 -42
- package/src/mcp/tools/sf-gql-discover.ts +2 -36
- package/src/mcp/tools/sf-gql-list.ts +2 -41
- package/src/mcp/tools/sf-gql-raw.ts +2 -25
- package/src/mcp/tools/sf-gql-update.ts +2 -21
- package/src/{mcp/tools/shared/zod-schemas.ts → schemas/fields.ts} +1 -1
- package/src/schemas/input-schemas.ts +305 -0
- package/dist/mcp/tools/shared/zod-schemas.js.map +0 -1
- package/dist/{mcp/tools/shared/zod-schemas.d.ts → schemas/fields.d.ts} +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sf-gql-detail.js","sourceRoot":"","sources":["../../../src/mcp/tools/sf-gql-detail.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sf-gql-detail.js","sourceRoot":"","sources":["../../../src/mcp/tools/sf-gql-detail.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAM9D,MAAM,WAAW,GAAG,YAAY,CAAC;AAEjC,MAAM,UAAU,uBAAuB,CACtC,MAAiB,EACjB,OAA+B,EAAE;IAEjC,MAAM,CAAC,YAAY,CAClB,eAAe,EACf;QACC,WAAW,EAAE;YACZ,iGAAiG;YACjG,kKAAkK;YAClK,sGAAsG;YACtG,kFAAkF;YAClF,EAAE;YACF,WAAW;YACX,uFAAuF;YACvF,oIAAoI;YACpI,mOAAmO;SACnO,CAAC,IAAI,CAAC,IAAI,CAAC;QACZ,WAAW;KACX,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACd,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACvD,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;SACzD,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -3,40 +3,9 @@
|
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
6
|
import { buildDiscover } from "../../intent/build-discover.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// to safe API-name charsets so downstream layers can trust them.
|
|
11
|
-
const ORG_ALIAS_RE = /^[A-Za-z0-9_-]{1,80}$/;
|
|
12
|
-
const SOBJECT_NAME_RE = /^[A-Za-z][A-Za-z0-9_]{0,79}$/;
|
|
13
|
-
// eslint-disable-next-line no-control-regex -- intentionally rejects control chars
|
|
14
|
-
const SEARCH_RE = /^[^\x00-\x1f\x7f]*$/;
|
|
15
|
-
const inputSchema = {
|
|
16
|
-
org: z
|
|
17
|
-
.string()
|
|
18
|
-
.regex(ORG_ALIAS_RE, "org must match /^[A-Za-z0-9_-]{1,80}$/")
|
|
19
|
-
.describe("Org alias resolved via local Salesforce CLI auth (~/.sf, ~/.sfdx)."),
|
|
20
|
-
mode: z
|
|
21
|
-
.enum(["list_objects", "describe_object", "describe_field"])
|
|
22
|
-
.describe('Discovery mode. "list_objects" enumerates queryable SObjects; "describe_object" and "describe_field" return ObjectInfo metadata.'),
|
|
23
|
-
object: z
|
|
24
|
-
.string()
|
|
25
|
-
.regex(SOBJECT_NAME_RE, "object must match /^[A-Za-z][A-Za-z0-9_]{0,79}$/")
|
|
26
|
-
.optional()
|
|
27
|
-
.describe('SObject API name. Required for "describe_object" and "describe_field".'),
|
|
28
|
-
field: z
|
|
29
|
-
.string()
|
|
30
|
-
.regex(SOBJECT_NAME_RE, "field must match /^[A-Za-z][A-Za-z0-9_]{0,79}$/")
|
|
31
|
-
.optional()
|
|
32
|
-
.describe('Field API name. Required for "describe_field".'),
|
|
33
|
-
search: z
|
|
34
|
-
.string()
|
|
35
|
-
.max(100, "search must be 100 characters or fewer")
|
|
36
|
-
.regex(SEARCH_RE, "search must not contain control characters")
|
|
37
|
-
.optional()
|
|
38
|
-
.describe('Optional substring filter applied to "list_objects" results.'),
|
|
39
|
-
};
|
|
7
|
+
import { DISCOVER_INPUT } from "../../schemas/input-schemas.js";
|
|
8
|
+
const inputSchema = DISCOVER_INPUT.shape;
|
|
40
9
|
export function registerSfGqlDiscoverTool(server, opts = {}) {
|
|
41
10
|
server.registerTool("sf_gql_discover", {
|
|
42
11
|
description: "Discover Salesforce UIAPI schema metadata: list queryable SObjects, describe an object's fields/picklists/child relationships, or describe a single field. Returns mode-specific metadata (not the standard ToolOutput envelope).",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sf-gql-discover.js","sourceRoot":"","sources":["../../../src/mcp/tools/sf-gql-discover.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sf-gql-discover.js","sourceRoot":"","sources":["../../../src/mcp/tools/sf-gql-discover.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,aAAa,EAAqB,MAAM,gCAAgC,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAIhE,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,CAAC;AAEzC,MAAM,UAAU,yBAAyB,CACxC,MAAiB,EACjB,OAAiC,EAAE;IAEnC,MAAM,CAAC,YAAY,CAClB,iBAAiB,EACjB;QACC,WAAW,EACV,mOAAmO;QACpO,WAAW;KACX,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACd,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC/C,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;SACzD,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -3,39 +3,9 @@
|
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { childRelationshipSchema, graphqlName, orderByObject } from "./shared/zod-schemas.js";
|
|
8
6
|
import { buildList } from "../../intent/build-list.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const orderBySchema = z.union([orderByObject, z.array(orderByObject)]);
|
|
12
|
-
const inputSchema = {
|
|
13
|
-
org: z.string().describe("Org alias resolved via local Salesforce CLI auth (~/.sf, ~/.sfdx)."),
|
|
14
|
-
object: graphqlName('SObject API name, e.g. "Account", "Case". Must be a valid GraphQL Name.'),
|
|
15
|
-
fields: z
|
|
16
|
-
.array(z.string())
|
|
17
|
-
.describe('Scalar field API names to select on the node. Dot-paths like "Owner.Name" are allowed.'),
|
|
18
|
-
parentFields: z
|
|
19
|
-
.array(z.string())
|
|
20
|
-
.optional()
|
|
21
|
-
.describe('Dotted parent-relationship paths, e.g. "Account.Name".'),
|
|
22
|
-
childRelationships: z.array(childRelationshipSchema(orderBySchema)).optional(),
|
|
23
|
-
filter: z
|
|
24
|
-
.record(z.unknown())
|
|
25
|
-
.optional()
|
|
26
|
-
.describe("<Object>_Filter shape. String leaves matching $varName promote to typed query variables."),
|
|
27
|
-
orderBy: orderBySchema
|
|
28
|
-
.optional()
|
|
29
|
-
.describe("<Object>_OrderBy. Singleton object preferred; arrays are collapsed to the first entry."),
|
|
30
|
-
first: z
|
|
31
|
-
.number()
|
|
32
|
-
.int()
|
|
33
|
-
.positive()
|
|
34
|
-
.optional()
|
|
35
|
-
.describe("Top-level connection page size; defaults to 10."),
|
|
36
|
-
scope: z.string().optional().describe('Scope enum (e.g. "MINE", "EVERYTHING") or $varName.'),
|
|
37
|
-
operationName: graphqlName("Override the GraphQL operation name. Defaults to <Object>List.").optional(),
|
|
38
|
-
};
|
|
7
|
+
import { LIST_INPUT } from "../../schemas/input-schemas.js";
|
|
8
|
+
const inputSchema = LIST_INPUT.shape;
|
|
39
9
|
export function registerSfGqlListTool(server, opts = {}) {
|
|
40
10
|
server.registerTool("sf_gql_list", {
|
|
41
11
|
description: "Build a UIAPI list query against a Salesforce org. Returns rendered GraphQL, declared variables, generated TypeScript types, and validation warnings.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sf-gql-list.js","sourceRoot":"","sources":["../../../src/mcp/tools/sf-gql-list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sf-gql-list.js","sourceRoot":"","sources":["../../../src/mcp/tools/sf-gql-list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAM5D,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC;AAErC,MAAM,UAAU,qBAAqB,CAAC,MAAiB,EAAE,OAA6B,EAAE;IACvF,MAAM,CAAC,YAAY,CAClB,aAAa,EACb;QACC,WAAW,EACV,uJAAuJ;QACxJ,WAAW;KACX,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACd,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACrD,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;SACzD,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -3,26 +3,9 @@
|
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { graphqlName } from "./shared/zod-schemas.js";
|
|
8
6
|
import { buildRaw } from "../../intent/build-raw.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
commands: z
|
|
12
|
-
.array(z.string())
|
|
13
|
-
.min(1)
|
|
14
|
-
.describe("CLI-style commands applied in order to a transient session. Supported verbs:\n" +
|
|
15
|
-
" select <path[:alias]> e.g. select uiapi/query/Case/edges/node/Subject/value\n" +
|
|
16
|
-
" set [<path>] <key>=<value> e.g. set uiapi/query/Case first=10 | set uiapi/query/Case where.Status=New\n" +
|
|
17
|
-
" var $name <path> [default] e.g. var $id uiapi/query/Case/@args/where/Id/eq (type inferred from path)\n" +
|
|
18
|
-
'Each command is tokenized on spaces and a value MUST NOT contain a space — quoting does not help once a token has started (key=\'a b\' still splits). A filter value that contains a space (e.g. "New York", "In Progress") cannot be expressed via set in v1; use sf_gql_list with a JSON filter, or pass the value through a variable bound with var.\n' +
|
|
19
|
-
"Fails fast: a bad command aborts the whole call. Other CLI verbs (cd, drop, alias, optional, unset) are NOT supported in v1."),
|
|
20
|
-
operation: z
|
|
21
|
-
.enum(["query", "mutation", "aggregate"])
|
|
22
|
-
.optional()
|
|
23
|
-
.describe('Operation root. "query" (default) → uiapi.query; "mutation" → mutation root; "aggregate" → uiapi.aggregate.'),
|
|
24
|
-
typeName: graphqlName("Override the GraphQL operation name. Defaults to Raw<Operation>.").optional(),
|
|
25
|
-
};
|
|
7
|
+
import { RAW_INPUT } from "../../schemas/input-schemas.js";
|
|
8
|
+
const inputSchema = RAW_INPUT.shape;
|
|
26
9
|
export function registerSfGqlRawTool(server, opts = {}) {
|
|
27
10
|
server.registerTool("sf_gql_raw", {
|
|
28
11
|
description: "Low-level escape hatch: build an arbitrary UIAPI query, mutation, or aggregate from CLI-style commands (select/set/var) when the typed tools don't model the case (cross-union selections, custom mutations). Returns rendered GraphQL, declared variables, generated TypeScript types, and validation warnings. Fails fast on a bad command.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sf-gql-raw.js","sourceRoot":"","sources":["../../../src/mcp/tools/sf-gql-raw.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sf-gql-raw.js","sourceRoot":"","sources":["../../../src/mcp/tools/sf-gql-raw.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAM3D,MAAM,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC;AAEpC,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,OAA4B,EAAE;IACrF,MAAM,CAAC,YAAY,CAClB,YAAY,EACZ;QACC,WAAW,EACV,+UAA+U;QAChV,WAAW;KACX,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACd,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACpD,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;SACzD,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -3,22 +3,9 @@
|
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { graphqlName } from "./shared/zod-schemas.js";
|
|
8
6
|
import { buildUpdate } from "../../intent/build-update.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
object: graphqlName('SObject API name, e.g. "Account", "Order". Must be a valid GraphQL Name.'),
|
|
12
|
-
returnFields: z
|
|
13
|
-
.array(z.string())
|
|
14
|
-
.optional()
|
|
15
|
-
.describe('Scalar field API names to read back on the updated Record. Defaults to ["Id"]. Dot-paths like Owner.Name are not supported in mutation results; passing them produces a warning and the field is skipped.'),
|
|
16
|
-
inputVariable: z
|
|
17
|
-
.string()
|
|
18
|
-
.optional()
|
|
19
|
-
.describe('Variable name (without "$") for the update input. Defaults to "input". Declared as $<name>: <Object>UpdateInput!.'),
|
|
20
|
-
operationName: graphqlName("Override the GraphQL operation name. Defaults to Update<Object>.").optional(),
|
|
21
|
-
};
|
|
7
|
+
import { UPDATE_INPUT } from "../../schemas/input-schemas.js";
|
|
8
|
+
const inputSchema = UPDATE_INPUT.shape;
|
|
22
9
|
export function registerSfGqlUpdateTool(server, opts = {}) {
|
|
23
10
|
server.registerTool("sf_gql_update", {
|
|
24
11
|
description: "Build a UIAPI update mutation against a Salesforce org. Declares a typed input variable ($input: <Object>UpdateInput!) and selects return fields on the updated record. Returns rendered GraphQL, declared variables, generated TypeScript types, and validation warnings.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sf-gql-update.js","sourceRoot":"","sources":["../../../src/mcp/tools/sf-gql-update.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"sf-gql-update.js","sourceRoot":"","sources":["../../../src/mcp/tools/sf-gql-update.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAM9D,MAAM,WAAW,GAAG,YAAY,CAAC,KAAK,CAAC;AAEvC,MAAM,UAAU,uBAAuB,CACtC,MAAiB,EACjB,OAA+B,EAAE;IAEjC,MAAM,CAAC,YAAY,CAClB,eAAe,EACf;QACC,WAAW,EACV,4QAA4Q;QAC7Q,WAAW;KACX,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACd,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACvD,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;SACzD,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the LICENSE.txt file
|
|
5
5
|
*/
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
import { GRAPHQL_NAME_RE } from "
|
|
7
|
+
import { GRAPHQL_NAME_RE } from "../lib/graphql-name.js";
|
|
8
8
|
/**
|
|
9
9
|
* Zod string validator that enforces the GraphQL Name production. Returned
|
|
10
10
|
* schema is `.describe()`-tagged with the supplied description so it appears
|
|
@@ -43,4 +43,4 @@ export const childRelationshipSchema = (orderBy) => z.object({
|
|
|
43
43
|
filter: z.record(z.unknown()).optional(),
|
|
44
44
|
orderBy: orderBy.optional(),
|
|
45
45
|
});
|
|
46
|
-
//# sourceMappingURL=
|
|
46
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../src/schemas/fields.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,WAAmB,EAAe,EAAE,CAC/D,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,8BAA8B,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAEzF;;;;;GAKG;AACH,MAAM,YAAY,GAAG,uCAAuC,CAAC;AAC7D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,WAAmB,EAAe,EAAE,CAC5D,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,YAAY,EAAE,uCAAuC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAE/F;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAAqB,EAAE,EAAE,CAChE,CAAC,CAAC,MAAM,CAAC;IACR,gBAAgB,EAAE,WAAW,CAC5B,8FAA8F,CAC9F;IACD,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC7C,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxC,OAAO,EAAE,OAAO,CAAC,QAAQ,EAAE;CAC3B,CAAC,CAAC"}
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026, Salesforce, Inc.,
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* For full license text, see the LICENSE.txt file
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Per-tool Zod input schemas, extracted so the MCP server and the CLI mirror
|
|
8
|
+
* (`src/commands/mcp-mirror/`) validate identical argument shapes. The MCP
|
|
9
|
+
* tools consume `<TOOL>_INPUT.shape` (raw-shape registration) or the object
|
|
10
|
+
* directly (`detail`, which is `.strict()`); the CLI adapters call
|
|
11
|
+
* `<TOOL>_INPUT.parse()` on the incoming JSON. Single source of truth keeps
|
|
12
|
+
* the two transports arg-for-arg symmetric.
|
|
13
|
+
*
|
|
14
|
+
* Descriptions and validation are preserved verbatim from the original inline
|
|
15
|
+
* schemas; behavior is unchanged — this is a pure extraction.
|
|
16
|
+
*/
|
|
17
|
+
import { z } from "zod";
|
|
18
|
+
export declare const LIST_INPUT: z.ZodObject<{
|
|
19
|
+
org: z.ZodString;
|
|
20
|
+
object: z.ZodString;
|
|
21
|
+
fields: z.ZodArray<z.ZodString, "many">;
|
|
22
|
+
parentFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
23
|
+
childRelationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
24
|
+
relationshipName: z.ZodString;
|
|
25
|
+
fields: z.ZodArray<z.ZodString, "many">;
|
|
26
|
+
first: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
28
|
+
orderBy: z.ZodOptional<z.ZodTypeAny>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
relationshipName: string;
|
|
31
|
+
fields: string[];
|
|
32
|
+
filter?: Record<string, unknown> | undefined;
|
|
33
|
+
orderBy?: any;
|
|
34
|
+
first?: number | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
relationshipName: string;
|
|
37
|
+
fields: string[];
|
|
38
|
+
filter?: Record<string, unknown> | undefined;
|
|
39
|
+
orderBy?: any;
|
|
40
|
+
first?: number | undefined;
|
|
41
|
+
}>, "many">>;
|
|
42
|
+
filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
43
|
+
orderBy: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">]>>;
|
|
44
|
+
first: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
46
|
+
operationName: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
object: string;
|
|
49
|
+
org: string;
|
|
50
|
+
fields: string[];
|
|
51
|
+
filter?: Record<string, unknown> | undefined;
|
|
52
|
+
operationName?: string | undefined;
|
|
53
|
+
orderBy?: Record<string, unknown> | Record<string, unknown>[] | undefined;
|
|
54
|
+
first?: number | undefined;
|
|
55
|
+
scope?: string | undefined;
|
|
56
|
+
parentFields?: string[] | undefined;
|
|
57
|
+
childRelationships?: {
|
|
58
|
+
relationshipName: string;
|
|
59
|
+
fields: string[];
|
|
60
|
+
filter?: Record<string, unknown> | undefined;
|
|
61
|
+
orderBy?: any;
|
|
62
|
+
first?: number | undefined;
|
|
63
|
+
}[] | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
object: string;
|
|
66
|
+
org: string;
|
|
67
|
+
fields: string[];
|
|
68
|
+
filter?: Record<string, unknown> | undefined;
|
|
69
|
+
operationName?: string | undefined;
|
|
70
|
+
orderBy?: Record<string, unknown> | Record<string, unknown>[] | undefined;
|
|
71
|
+
first?: number | undefined;
|
|
72
|
+
scope?: string | undefined;
|
|
73
|
+
parentFields?: string[] | undefined;
|
|
74
|
+
childRelationships?: {
|
|
75
|
+
relationshipName: string;
|
|
76
|
+
fields: string[];
|
|
77
|
+
filter?: Record<string, unknown> | undefined;
|
|
78
|
+
orderBy?: any;
|
|
79
|
+
first?: number | undefined;
|
|
80
|
+
}[] | undefined;
|
|
81
|
+
}>;
|
|
82
|
+
export declare const DETAIL_INPUT: z.ZodObject<{
|
|
83
|
+
org: z.ZodString;
|
|
84
|
+
object: z.ZodString;
|
|
85
|
+
fields: z.ZodArray<z.ZodString, "many">;
|
|
86
|
+
parentFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
87
|
+
childRelationships: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
88
|
+
relationshipName: z.ZodString;
|
|
89
|
+
fields: z.ZodArray<z.ZodString, "many">;
|
|
90
|
+
first: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
92
|
+
orderBy: z.ZodOptional<z.ZodTypeAny>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
relationshipName: string;
|
|
95
|
+
fields: string[];
|
|
96
|
+
filter?: Record<string, unknown> | undefined;
|
|
97
|
+
orderBy?: any;
|
|
98
|
+
first?: number | undefined;
|
|
99
|
+
}, {
|
|
100
|
+
relationshipName: string;
|
|
101
|
+
fields: string[];
|
|
102
|
+
filter?: Record<string, unknown> | undefined;
|
|
103
|
+
orderBy?: any;
|
|
104
|
+
first?: number | undefined;
|
|
105
|
+
}>, "many">>;
|
|
106
|
+
idVariable: z.ZodOptional<z.ZodString>;
|
|
107
|
+
operationName: z.ZodOptional<z.ZodString>;
|
|
108
|
+
}, "strict", z.ZodTypeAny, {
|
|
109
|
+
object: string;
|
|
110
|
+
org: string;
|
|
111
|
+
fields: string[];
|
|
112
|
+
operationName?: string | undefined;
|
|
113
|
+
parentFields?: string[] | undefined;
|
|
114
|
+
childRelationships?: {
|
|
115
|
+
relationshipName: string;
|
|
116
|
+
fields: string[];
|
|
117
|
+
filter?: Record<string, unknown> | undefined;
|
|
118
|
+
orderBy?: any;
|
|
119
|
+
first?: number | undefined;
|
|
120
|
+
}[] | undefined;
|
|
121
|
+
idVariable?: string | undefined;
|
|
122
|
+
}, {
|
|
123
|
+
object: string;
|
|
124
|
+
org: string;
|
|
125
|
+
fields: string[];
|
|
126
|
+
operationName?: string | undefined;
|
|
127
|
+
parentFields?: string[] | undefined;
|
|
128
|
+
childRelationships?: {
|
|
129
|
+
relationshipName: string;
|
|
130
|
+
fields: string[];
|
|
131
|
+
filter?: Record<string, unknown> | undefined;
|
|
132
|
+
orderBy?: any;
|
|
133
|
+
first?: number | undefined;
|
|
134
|
+
}[] | undefined;
|
|
135
|
+
idVariable?: string | undefined;
|
|
136
|
+
}>;
|
|
137
|
+
export declare const DISCOVER_INPUT: z.ZodObject<{
|
|
138
|
+
org: z.ZodString;
|
|
139
|
+
mode: z.ZodEnum<["list_objects", "describe_object", "describe_field"]>;
|
|
140
|
+
object: z.ZodOptional<z.ZodString>;
|
|
141
|
+
field: z.ZodOptional<z.ZodString>;
|
|
142
|
+
search: z.ZodOptional<z.ZodString>;
|
|
143
|
+
}, "strip", z.ZodTypeAny, {
|
|
144
|
+
org: string;
|
|
145
|
+
mode: "list_objects" | "describe_object" | "describe_field";
|
|
146
|
+
object?: string | undefined;
|
|
147
|
+
search?: string | undefined;
|
|
148
|
+
field?: string | undefined;
|
|
149
|
+
}, {
|
|
150
|
+
org: string;
|
|
151
|
+
mode: "list_objects" | "describe_object" | "describe_field";
|
|
152
|
+
object?: string | undefined;
|
|
153
|
+
search?: string | undefined;
|
|
154
|
+
field?: string | undefined;
|
|
155
|
+
}>;
|
|
156
|
+
export declare const AGGREGATE_INPUT: z.ZodObject<{
|
|
157
|
+
org: z.ZodString;
|
|
158
|
+
object: z.ZodString;
|
|
159
|
+
groupBy: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
160
|
+
field: z.ZodString;
|
|
161
|
+
function: z.ZodEnum<["CALENDAR_MONTH", "CALENDAR_QUARTER", "CALENDAR_YEAR", "DAY_IN_MONTH", "DAY_IN_WEEK", "DAY_IN_YEAR", "FISCAL_MONTH", "FISCAL_QUARTER", "FISCAL_YEAR", "HOUR_IN_DAY", "CALENDAR_MONTH_IN_YEAR", "FISCAL_MONTH_IN_YEAR", "WEEK_IN_YEAR"]>;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
function: "CALENDAR_MONTH" | "CALENDAR_QUARTER" | "CALENDAR_YEAR" | "DAY_IN_MONTH" | "DAY_IN_WEEK" | "DAY_IN_YEAR" | "FISCAL_MONTH" | "FISCAL_QUARTER" | "FISCAL_YEAR" | "HOUR_IN_DAY" | "CALENDAR_MONTH_IN_YEAR" | "FISCAL_MONTH_IN_YEAR" | "WEEK_IN_YEAR";
|
|
164
|
+
field: string;
|
|
165
|
+
}, {
|
|
166
|
+
function: "CALENDAR_MONTH" | "CALENDAR_QUARTER" | "CALENDAR_YEAR" | "DAY_IN_MONTH" | "DAY_IN_WEEK" | "DAY_IN_YEAR" | "FISCAL_MONTH" | "FISCAL_QUARTER" | "FISCAL_YEAR" | "HOUR_IN_DAY" | "CALENDAR_MONTH_IN_YEAR" | "FISCAL_MONTH_IN_YEAR" | "WEEK_IN_YEAR";
|
|
167
|
+
field: string;
|
|
168
|
+
}>]>, "many">>;
|
|
169
|
+
aggregations: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"function", [z.ZodObject<{
|
|
170
|
+
function: z.ZodEnum<["count", "countDistinct"]>;
|
|
171
|
+
field: z.ZodOptional<z.ZodString>;
|
|
172
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
function: "count" | "countDistinct";
|
|
175
|
+
alias?: string | undefined;
|
|
176
|
+
field?: string | undefined;
|
|
177
|
+
}, {
|
|
178
|
+
function: "count" | "countDistinct";
|
|
179
|
+
alias?: string | undefined;
|
|
180
|
+
field?: string | undefined;
|
|
181
|
+
}>, z.ZodObject<{
|
|
182
|
+
function: z.ZodEnum<["sum", "avg", "min", "max"]>;
|
|
183
|
+
field: z.ZodString;
|
|
184
|
+
alias: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, "strip", z.ZodTypeAny, {
|
|
186
|
+
function: "sum" | "avg" | "min" | "max";
|
|
187
|
+
field: string;
|
|
188
|
+
alias?: string | undefined;
|
|
189
|
+
}, {
|
|
190
|
+
function: "sum" | "avg" | "min" | "max";
|
|
191
|
+
field: string;
|
|
192
|
+
alias?: string | undefined;
|
|
193
|
+
}>]>, "many">>;
|
|
194
|
+
filter: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
195
|
+
orderBy: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">]>>;
|
|
196
|
+
first: z.ZodOptional<z.ZodNumber>;
|
|
197
|
+
operationName: z.ZodOptional<z.ZodString>;
|
|
198
|
+
}, "strip", z.ZodTypeAny, {
|
|
199
|
+
object: string;
|
|
200
|
+
org: string;
|
|
201
|
+
filter?: Record<string, unknown> | undefined;
|
|
202
|
+
operationName?: string | undefined;
|
|
203
|
+
orderBy?: Record<string, unknown> | Record<string, unknown>[] | undefined;
|
|
204
|
+
first?: number | undefined;
|
|
205
|
+
groupBy?: (string | {
|
|
206
|
+
function: "CALENDAR_MONTH" | "CALENDAR_QUARTER" | "CALENDAR_YEAR" | "DAY_IN_MONTH" | "DAY_IN_WEEK" | "DAY_IN_YEAR" | "FISCAL_MONTH" | "FISCAL_QUARTER" | "FISCAL_YEAR" | "HOUR_IN_DAY" | "CALENDAR_MONTH_IN_YEAR" | "FISCAL_MONTH_IN_YEAR" | "WEEK_IN_YEAR";
|
|
207
|
+
field: string;
|
|
208
|
+
})[] | undefined;
|
|
209
|
+
aggregations?: ({
|
|
210
|
+
function: "count" | "countDistinct";
|
|
211
|
+
alias?: string | undefined;
|
|
212
|
+
field?: string | undefined;
|
|
213
|
+
} | {
|
|
214
|
+
function: "sum" | "avg" | "min" | "max";
|
|
215
|
+
field: string;
|
|
216
|
+
alias?: string | undefined;
|
|
217
|
+
})[] | undefined;
|
|
218
|
+
}, {
|
|
219
|
+
object: string;
|
|
220
|
+
org: string;
|
|
221
|
+
filter?: Record<string, unknown> | undefined;
|
|
222
|
+
operationName?: string | undefined;
|
|
223
|
+
orderBy?: Record<string, unknown> | Record<string, unknown>[] | undefined;
|
|
224
|
+
first?: number | undefined;
|
|
225
|
+
groupBy?: (string | {
|
|
226
|
+
function: "CALENDAR_MONTH" | "CALENDAR_QUARTER" | "CALENDAR_YEAR" | "DAY_IN_MONTH" | "DAY_IN_WEEK" | "DAY_IN_YEAR" | "FISCAL_MONTH" | "FISCAL_QUARTER" | "FISCAL_YEAR" | "HOUR_IN_DAY" | "CALENDAR_MONTH_IN_YEAR" | "FISCAL_MONTH_IN_YEAR" | "WEEK_IN_YEAR";
|
|
227
|
+
field: string;
|
|
228
|
+
})[] | undefined;
|
|
229
|
+
aggregations?: ({
|
|
230
|
+
function: "count" | "countDistinct";
|
|
231
|
+
alias?: string | undefined;
|
|
232
|
+
field?: string | undefined;
|
|
233
|
+
} | {
|
|
234
|
+
function: "sum" | "avg" | "min" | "max";
|
|
235
|
+
field: string;
|
|
236
|
+
alias?: string | undefined;
|
|
237
|
+
})[] | undefined;
|
|
238
|
+
}>;
|
|
239
|
+
export declare const RAW_INPUT: z.ZodObject<{
|
|
240
|
+
org: z.ZodString;
|
|
241
|
+
commands: z.ZodArray<z.ZodString, "many">;
|
|
242
|
+
operation: z.ZodOptional<z.ZodEnum<["query", "mutation", "aggregate"]>>;
|
|
243
|
+
typeName: z.ZodOptional<z.ZodString>;
|
|
244
|
+
}, "strip", z.ZodTypeAny, {
|
|
245
|
+
org: string;
|
|
246
|
+
commands: string[];
|
|
247
|
+
operation?: "query" | "mutation" | "aggregate" | undefined;
|
|
248
|
+
typeName?: string | undefined;
|
|
249
|
+
}, {
|
|
250
|
+
org: string;
|
|
251
|
+
commands: string[];
|
|
252
|
+
operation?: "query" | "mutation" | "aggregate" | undefined;
|
|
253
|
+
typeName?: string | undefined;
|
|
254
|
+
}>;
|
|
255
|
+
export declare const CREATE_INPUT: z.ZodObject<{
|
|
256
|
+
org: z.ZodString;
|
|
257
|
+
object: z.ZodString;
|
|
258
|
+
returnFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
259
|
+
inputVariable: z.ZodOptional<z.ZodString>;
|
|
260
|
+
operationName: z.ZodOptional<z.ZodString>;
|
|
261
|
+
}, "strip", z.ZodTypeAny, {
|
|
262
|
+
object: string;
|
|
263
|
+
org: string;
|
|
264
|
+
operationName?: string | undefined;
|
|
265
|
+
inputVariable?: string | undefined;
|
|
266
|
+
returnFields?: string[] | undefined;
|
|
267
|
+
}, {
|
|
268
|
+
object: string;
|
|
269
|
+
org: string;
|
|
270
|
+
operationName?: string | undefined;
|
|
271
|
+
inputVariable?: string | undefined;
|
|
272
|
+
returnFields?: string[] | undefined;
|
|
273
|
+
}>;
|
|
274
|
+
export declare const UPDATE_INPUT: z.ZodObject<{
|
|
275
|
+
org: z.ZodString;
|
|
276
|
+
object: z.ZodString;
|
|
277
|
+
returnFields: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
278
|
+
inputVariable: z.ZodOptional<z.ZodString>;
|
|
279
|
+
operationName: z.ZodOptional<z.ZodString>;
|
|
280
|
+
}, "strip", z.ZodTypeAny, {
|
|
281
|
+
object: string;
|
|
282
|
+
org: string;
|
|
283
|
+
operationName?: string | undefined;
|
|
284
|
+
inputVariable?: string | undefined;
|
|
285
|
+
returnFields?: string[] | undefined;
|
|
286
|
+
}, {
|
|
287
|
+
object: string;
|
|
288
|
+
org: string;
|
|
289
|
+
operationName?: string | undefined;
|
|
290
|
+
inputVariable?: string | undefined;
|
|
291
|
+
returnFields?: string[] | undefined;
|
|
292
|
+
}>;
|
|
293
|
+
export declare const DELETE_INPUT: z.ZodObject<{
|
|
294
|
+
org: z.ZodString;
|
|
295
|
+
object: z.ZodString;
|
|
296
|
+
inputVariable: z.ZodOptional<z.ZodString>;
|
|
297
|
+
operationName: z.ZodOptional<z.ZodString>;
|
|
298
|
+
}, "strip", z.ZodTypeAny, {
|
|
299
|
+
object: string;
|
|
300
|
+
org: string;
|
|
301
|
+
operationName?: string | undefined;
|
|
302
|
+
inputVariable?: string | undefined;
|
|
303
|
+
}, {
|
|
304
|
+
object: string;
|
|
305
|
+
org: string;
|
|
306
|
+
operationName?: string | undefined;
|
|
307
|
+
inputVariable?: string | undefined;
|
|
308
|
+
}>;
|
|
309
|
+
export declare const CONNECT_INPUT: z.ZodObject<{
|
|
310
|
+
org: z.ZodString;
|
|
311
|
+
forceRefresh: z.ZodOptional<z.ZodBoolean>;
|
|
312
|
+
}, "strip", z.ZodTypeAny, {
|
|
313
|
+
org: string;
|
|
314
|
+
forceRefresh?: boolean | undefined;
|
|
315
|
+
}, {
|
|
316
|
+
org: string;
|
|
317
|
+
forceRefresh?: boolean | undefined;
|
|
318
|
+
}>;
|