import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; /** * Lightweight read-only mode (issue #154) — an interim, additive gate that * blocks all mutation without the structural read/write/destroy refactor * (#106, deferred to 0.5.0). * * Strategy: fail-closed allowlist. Only a small, stable set of read actions * is permitted; everything else is denied by default, so a new/renamed/ * unknown action can never "escape" the gate. */ /** The only actions allowed to execute in read-only mode. */ export declare const READ_ACTIONS: ReadonlySet; export declare function isReadOnlyMode(raw?: string | undefined): boolean; export declare function manageHasMutatingFields(params: Record): boolean; /** * Structured rejection returned instead of executing a blocked action. * Not an error — a controlled refusal, in the pass-through/structured style * of the rest of the server (no prose message). */ export declare function readOnlyRejection(action: string): CallToolResult; /** * Best-effort extraction of an `action` enum's options from a tool's Zod * schema, tolerant of ZodDefault/ZodOptional wrappers and zod-version shape * differences. Returns null when there is no `action` param or introspection * fails — callers treat null conservatively. */ export declare function getActionOptions(schema: unknown): string[] | null; export type ReadOnlyClass = "read" | "gated" | "mutation"; /** * Classifies a tool for read-only mode: * - "read" — declares readOnlyHint, always exposed. * - "gated" — multi-action tool with at least one read action (or * `manage`); stays registered, gated per-action at dispatch. * - "mutation" — single-purpose write/destroy tool; skipped in read-only. */ export declare function classifyTool(readOnlyHint: boolean | undefined, actionOptions: string[] | null): ReadOnlyClass; /** Duck-typed access to a tool's read-only classification. */ export declare function toolReadOnlyClass(tool: unknown): ReadOnlyClass; /** * Drops single-purpose mutation tools in read-only mode, keeping read and * gated tools. Returns the kept tools plus per-class counts for logging. */ export declare function applyReadOnlyFilter(tools: Tool[]): { tools: Tool[]; read: number; gated: number; skipped: number; }; export declare function readOnlySummary(read: number, gated: number, skipped: number): string; //# sourceMappingURL=readOnly.d.ts.map