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; }, "strip", z.ZodTypeAny, { title?: string | undefined; readOnlyHint?: boolean | undefined; idempotentHint?: boolean | undefined; destructiveHint?: boolean | undefined; openWorldHint?: boolean | undefined; }, { title?: string | undefined; readOnlyHint?: boolean | undefined; idempotentHint?: boolean | undefined; destructiveHint?: boolean | undefined; openWorldHint?: boolean | undefined; }>>; enabled: z.ZodOptional; deprecated: z.ZodOptional; /** Free-form note appended to the description when `deprecated: true`. */ deprecationMessage: z.ZodOptional; /** * Operator-facing category tag. Drives `LOG10X_MCP_ENABLED_CATEGORIES` / * `LOG10X_MCP_DISABLED_CATEGORIES` env-var gates at boot — operator can * hide whole categories of tools without code changes. Matches the * mksite docs nav (cost / identify / investigate / detect / drop / * retrieve / install / account / poc / diagnostics). */ category: z.ZodOptional; }, "strip", z.ZodTypeAny, { title?: string | undefined; description?: string | undefined; annotations?: { title?: string | undefined; readOnlyHint?: boolean | undefined; idempotentHint?: boolean | undefined; destructiveHint?: boolean | undefined; openWorldHint?: boolean | undefined; } | undefined; enabled?: boolean | undefined; deprecated?: boolean | undefined; deprecationMessage?: string | undefined; category?: string | undefined; }, { title?: string | undefined; description?: string | undefined; annotations?: { title?: string | undefined; readOnlyHint?: boolean | undefined; idempotentHint?: boolean | undefined; destructiveHint?: boolean | undefined; openWorldHint?: boolean | undefined; } | undefined; enabled?: boolean | undefined; deprecated?: boolean | undefined; deprecationMessage?: string | undefined; category?: string | undefined; }>; declare const NoticeSchema: z.ZodObject<{ level: z.ZodEnum<["info", "warn"]>; message: z.ZodString; /** ISO-8601 timestamp; notices past this are dropped at apply time. */ showUntil: z.ZodOptional; }, "strip", z.ZodTypeAny, { message: string; level: "warn" | "info"; showUntil?: string | undefined; }, { message: string; level: "warn" | "info"; showUntil?: string | undefined; }>; declare const ManifestSchema: z.ZodObject<{ manifestVersion: z.ZodNumber; generatedAt: z.ZodOptional; /** Semver string. If our client's version is below this, manifest is dropped. */ minClientVersion: z.ZodOptional; tools: z.ZodOptional; title: z.ZodOptional; annotations: z.ZodOptional; readOnlyHint: z.ZodOptional; idempotentHint: z.ZodOptional; destructiveHint: z.ZodOptional; openWorldHint: z.ZodOptional; }, "strip", z.ZodTypeAny, { title?: string | undefined; readOnlyHint?: boolean | undefined; idempotentHint?: boolean | undefined; destructiveHint?: boolean | undefined; openWorldHint?: boolean | undefined; }, { title?: string | undefined; readOnlyHint?: boolean | undefined; idempotentHint?: boolean | undefined; destructiveHint?: boolean | undefined; openWorldHint?: boolean | undefined; }>>; enabled: z.ZodOptional; deprecated: z.ZodOptional; /** Free-form note appended to the description when `deprecated: true`. */ deprecationMessage: z.ZodOptional; /** * Operator-facing category tag. Drives `LOG10X_MCP_ENABLED_CATEGORIES` / * `LOG10X_MCP_DISABLED_CATEGORIES` env-var gates at boot — operator can * hide whole categories of tools without code changes. Matches the * mksite docs nav (cost / identify / investigate / detect / drop / * retrieve / install / account / poc / diagnostics). */ category: z.ZodOptional; }, "strip", z.ZodTypeAny, { title?: string | undefined; description?: string | undefined; annotations?: { title?: string | undefined; readOnlyHint?: boolean | undefined; idempotentHint?: boolean | undefined; destructiveHint?: boolean | undefined; openWorldHint?: boolean | undefined; } | undefined; enabled?: boolean | undefined; deprecated?: boolean | undefined; deprecationMessage?: string | undefined; category?: string | undefined; }, { title?: string | undefined; description?: string | undefined; annotations?: { title?: string | undefined; readOnlyHint?: boolean | undefined; idempotentHint?: boolean | undefined; destructiveHint?: boolean | undefined; openWorldHint?: boolean | undefined; } | undefined; enabled?: boolean | undefined; deprecated?: boolean | undefined; deprecationMessage?: string | undefined; category?: string | undefined; }>>>; globalNotices: z.ZodOptional; message: z.ZodString; /** ISO-8601 timestamp; notices past this are dropped at apply time. */ showUntil: z.ZodOptional; }, "strip", z.ZodTypeAny, { message: string; level: "warn" | "info"; showUntil?: string | undefined; }, { message: string; level: "warn" | "info"; showUntil?: string | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { manifestVersion: number; generatedAt?: string | undefined; minClientVersion?: string | undefined; tools?: Record | undefined; globalNotices?: { message: string; level: "warn" | "info"; showUntil?: string | undefined; }[] | undefined; }, { manifestVersion: number; generatedAt?: string | undefined; minClientVersion?: string | undefined; tools?: Record | undefined; globalNotices?: { message: string; level: "warn" | "info"; showUntil?: string | undefined; }[] | undefined; }>; 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 {};