/** * @fileoverview Shared builder for the BrAPI orientation envelope returned * by both `brapi_connect` (inlined after registration) and * `brapi_server_info` (on-demand). Pulls from CapabilityRegistry and the * active ServerRegistry entry, then layers in cheap opportunistic counts via * `pageSize=1` probes. Counts degrade silently — a server that doesn't * honor the probe just omits the field rather than failing the whole call. * * @module mcp-server/tools/shared/orientation-envelope */ import { type Context, z } from '@cyanheads/mcp-ts-core'; import type { BrapiClient } from '../../../services/brapi-client/index.js'; import type { CapabilityRegistry } from '../../../services/capability-registry/index.js'; import type { RegisteredServer } from '../../../services/server-registry/index.js'; export declare const ServerIdentitySchema: z.ZodObject<{ name: z.ZodOptional; description: z.ZodOptional; organizationName: z.ZodOptional; organizationURL: z.ZodOptional; documentationURL: z.ZodOptional; contactEmail: z.ZodOptional; brapiVersion: z.ZodOptional; }, z.core.$strip>; export declare const OrientationAuthSchema: z.ZodObject<{ mode: z.ZodEnum<{ none: "none"; sgn: "sgn"; oauth2: "oauth2"; api_key: "api_key"; bearer: "bearer"; }>; headerName: z.ZodOptional; expiresAt: z.ZodOptional; }, z.core.$strip>; export declare const OrientationCapabilitiesSchema: z.ZodObject<{ supportedCount: z.ZodNumber; supported: z.ZodArray; notableGaps: z.ZodArray; }, z.core.$strip>; export declare const OrientationDialectSchema: z.ZodObject<{ id: z.ZodString; source: z.ZodEnum<{ "env-override": "env-override"; "url-pattern": "url-pattern"; "server-name": "server-name"; "organization-name": "organization-name"; fallback: "fallback"; }>; envVar: z.ZodString; disabledSearchEndpoints: z.ZodArray; notes: z.ZodArray; verifiedMappingCount: z.ZodOptional; inferredMappingCount: z.ZodOptional; }, z.core.$strip>; export declare const OrientationContentSchema: z.ZodObject<{ crops: z.ZodArray; studyCount: z.ZodOptional; germplasmCount: z.ZodOptional; programCount: z.ZodOptional; locationCount: z.ZodOptional; }, z.core.$strip>; export declare const OrientationAttributionSchema: z.ZodObject<{ homepage: z.ZodString; license: z.ZodString; citation: z.ZodString; isDemo: z.ZodOptional; }, z.core.$strip>; export declare const OrientationEnvelopeSchema: z.ZodObject<{ alias: z.ZodString; baseUrl: z.ZodString; server: z.ZodObject<{ name: z.ZodOptional; description: z.ZodOptional; organizationName: z.ZodOptional; organizationURL: z.ZodOptional; documentationURL: z.ZodOptional; contactEmail: z.ZodOptional; brapiVersion: z.ZodOptional; }, z.core.$strip>; auth: z.ZodObject<{ mode: z.ZodEnum<{ none: "none"; sgn: "sgn"; oauth2: "oauth2"; api_key: "api_key"; bearer: "bearer"; }>; headerName: z.ZodOptional; expiresAt: z.ZodOptional; }, z.core.$strip>; capabilities: z.ZodObject<{ supportedCount: z.ZodNumber; supported: z.ZodArray; notableGaps: z.ZodArray; }, z.core.$strip>; dialect: z.ZodObject<{ id: z.ZodString; source: z.ZodEnum<{ "env-override": "env-override"; "url-pattern": "url-pattern"; "server-name": "server-name"; "organization-name": "organization-name"; fallback: "fallback"; }>; envVar: z.ZodString; disabledSearchEndpoints: z.ZodArray; notes: z.ZodArray; verifiedMappingCount: z.ZodOptional; inferredMappingCount: z.ZodOptional; }, z.core.$strip>; content: z.ZodObject<{ crops: z.ZodArray; studyCount: z.ZodOptional; germplasmCount: z.ZodOptional; programCount: z.ZodOptional; locationCount: z.ZodOptional; }, z.core.$strip>; attribution: z.ZodOptional; }, z.core.$strip>>; notes: z.ZodArray; fetchedAt: z.ZodString; }, z.core.$strip>; export type OrientationEnvelope = z.infer; export interface BuildEnvelopeDeps { client: BrapiClient; registry: CapabilityRegistry; } /** * Compose the orientation envelope for a connected server. Runs the * CapabilityRegistry profile (cached after the first call) plus a parallel * set of cheap `pageSize=1` probes for totals. BrAPI v2.1 mandates * `pageSize >= 1` — strict servers reject `pageSize=0` with HTTP 400, so * we ask for one row and ignore it; only `metadata.pagination.totalCount` * matters here. */ export declare function buildOrientationEnvelope(ctx: Context, connection: RegisteredServer, deps: BuildEnvelopeDeps): Promise; export declare function formatOrientationEnvelope(envelope: OrientationEnvelope): string; //# sourceMappingURL=orientation-envelope.d.ts.map