/** * Copyright (c) 2026, Salesforce, Inc., * All rights reserved. * For full license text, see the LICENSE.txt file */ import { type AggregateSpec, type ToolOutput } from "./types.js"; import { type PrimeDeps } from "../lib/prime-schema.js"; /** * Build a UIAPI aggregate query against a Salesforce org. Implements * `sf_gql_aggregate` intent for the graphiti MCP server (FR-8). * * Implicit behaviors not visible in the signature: * - `aggregations[]` projects each entry under the SObject's aggregate node * using `` as the default GraphQL alias; pass * `alias` to override. Default field is `Id` for `count`/`countDistinct`; * `sum`/`avg`/`min`/`max` require a field (FR-8.3). * - Duplicate result keys (default or explicit) throw — the caller must * disambiguate with aliases (FR-8.4). * - `groupBy` accepts flat field names only in v1; each renders as * `{Field: {group: true}}` and selects `Field { value }` on the * aggregate node so the grouping leaf comes back in the response. * Dotted paths throw. * - `filter` applies to every aggregation in the call. `$varName` leaves * in the filter promote to typed query variables. Per-aggregation * filters are not supported (FR-8.6). * - Operation name defaults to `Aggregate`. * * Throws on invalid `object` or `operationName` (must be valid GraphQL Names), * auth-missing or introspection failure (via `getSchemaWithPriming`), on * FR-8.3/8.4 spec violations, and on dotted groupBy paths. Never throws on * validation or codegen failure (those surface as `warnings[]`). */ export declare function buildAggregate(spec: AggregateSpec, deps?: PrimeDeps): Promise;