import { z } from 'zod'; import type { RegisteredTool } from '@modelcontextprotocol/sdk/server/mcp.js'; /** * Highest manifest schema version this client knows how to read. A manifest * with `manifest_version > MAX_KNOWN_MANIFEST_VERSION` is rejected outright — * future schemas (handler refs, new tools, signed payloads) require a newer * client, never a silent forward-upgrade. Bump this only when src/lib/manifest.ts * actually handles the new fields. */ export declare const MAX_KNOWN_MANIFEST_VERSION = 1; declare const ToolOverrideSchema: z.ZodObject<{ description: z.ZodOptional; title: z.ZodOptional; annotations: z.ZodOptional; readOnlyHint: z.ZodOptional; idempotentHint: z.ZodOptional; destructiveHint: z.ZodOptional; openWorldHint: z.ZodOptional; }, z.core.$strip>>; enabled: z.ZodOptional; deprecated: z.ZodOptional; deprecationMessage: z.ZodOptional; category: z.ZodOptional; }, z.core.$strip>; declare const NoticeSchema: z.ZodObject<{ level: z.ZodEnum<{ warn: "warn"; info: "info"; }>; message: z.ZodString; showUntil: z.ZodOptional; }, z.core.$strip>; declare const ManifestSchema: z.ZodObject<{ manifestVersion: z.ZodNumber; generatedAt: z.ZodOptional; minClientVersion: z.ZodOptional; tools: z.ZodOptional; title: z.ZodOptional; annotations: z.ZodOptional; readOnlyHint: z.ZodOptional; idempotentHint: z.ZodOptional; destructiveHint: z.ZodOptional; openWorldHint: z.ZodOptional; }, z.core.$strip>>; enabled: z.ZodOptional; deprecated: z.ZodOptional; deprecationMessage: z.ZodOptional; category: z.ZodOptional; }, z.core.$strip>>>; globalNotices: z.ZodOptional; message: z.ZodString; showUntil: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; export type Manifest = z.infer; export type ToolOverride = z.infer; export type ManifestNotice = z.infer; /** * Look up a tool's package-default metadata (title, description, * annotations). Throws if the tool isn't in the manifest — that's a * build-time error: index.ts is registering a tool whose metadata * was never extracted into default-manifest.json. */ export declare function getPackageDefaultTool(name: string): ToolOverride; /** Read-only access to the package default manifest. Tests use this. */ export declare function getPackageDefaultManifest(): Manifest; /** * Fetch the remote manifest (with on-disk cache fallback) and validate it * against the schema + version pins. Idempotent — repeated calls return the * already-loaded manifest without re-fetching. Stores the result in a * module-level singleton; reads via `getManifest()`. */ export declare function loadManifest(clientVersion: string): Promise; /** Return whatever was loaded by the most recent `loadManifest` call. */ export declare function getManifest(): Manifest | null; /** Resets the module-level cache. Tests only. */ export declare function _resetForTests(): void; /** * Filter notices that have an explicit `showUntil` in the past. Notices * without `showUntil` are always shown. */ export declare function activeNotices(m: Manifest | null): ManifestNotice[]; /** * Patch already-registered tools with manifest-supplied metadata. Called * exactly once during boot, after every `server.registerTool(...)` has run * and the registry map is fully populated. Tools the manifest names but the * package doesn't ship are logged + skipped (forward-compat: a future * manifest can mention tools that exist in a newer client). * * `enabled: false` calls `.disable()` on the SDK's RegisteredTool, which hides * the tool from `tools/list` so the LLM never sees it. * * `deprecated: true` prefixes the description with a `[DEPRECATED]` marker * (plus the manifest-supplied reason if any) — the tool stays callable but * the LLM is steered toward the recommended replacement via the description. */ export declare function applyManifestToTools(manifest: Manifest, registry: Map): void; /** * Read this package's version from package.json by walking up from this * module's location. Used to enforce `min_client_version` in manifests. * * Returns `'unknown'` on any failure — the manifest validator treats * an unparseable client version as "satisfies any requirement" (fail-open), * matching how unknown semver comparisons resolve in `semverGte`. */ export declare function readClientVersion(): string; export {};