/** * The digests of the specification `mcp-tool-set-digest/1`: one way to hash a `tools/list` * result that tools which never exchanged the tool text can compare. The specification's * vectors are in test/fixtures/tool-set-digest-vectors.json and run in test/interceptor.test.ts. * * - The **contract digest** covers `name`, `description`, `inputSchema` and (when the server * sent one) `outputSchema`: what a model reads and a call must satisfy. It is the digest * {@link mtlToolSetDigest} already computes and HISTOR's public log keys tool sets by. * - The **extras digest** covers everything else a tool carries (`title`, `annotations`, `icons`, * `_meta`, vendor members), so it moves when an annotation flips or a title is edited. A set in * which no tool has extras has none. * * Neither is {@link pinToolsHash}: a pin is WARDEN's local state and is compared only with * itself. These two are for comparing with someone else. */ export declare const TOOL_SET_DIGEST_SPEC = "mcp-tool-set-digest/1"; /** A digest the specification says cannot be computed: `TSD-TOOL`, `TSD-NUMBER`, `TSD-TEXT`, `TSD-NAME`. */ export declare class ToolSetDigestError extends Error { readonly code: 'TSD-TOOL' | 'TSD-NUMBER' | 'TSD-TEXT' | 'TSD-NAME'; constructor(code: 'TSD-TOOL' | 'TSD-NUMBER' | 'TSD-TEXT' | 'TSD-NAME', detail: string); } /** `sha256-` over the contract members of every tool (SPEC.md sections 4 to 7). */ export declare function contractDigest(tools: readonly unknown[]): string; /** * `{"tools": {name: extras}}` for the tools that carry a member outside the contract, or * undefined when none does (SPEC.md section 8). Two tools with one name that both carry extras * are `TSD-NAME`: an object keyed by name cannot hold both. */ export declare function extrasObject(tools: readonly unknown[]): { tools: Record; } | undefined; /** `sha256-` over the extras object (SPEC.md section 8); undefined when no tool has extras. */ export declare function extrasDigest(tools: readonly unknown[]): string | undefined; /** Per tool, lowercase hex SHA-256 of its canonical contract entry (SPEC.md section 9), in digest order. */ export declare function perToolContract(tools: readonly unknown[]): Array<{ name: string; contract: string; }>; /** The canonical text of one whole tool definition, or the code of the reason it has none. */ export declare function definitionText(tool: unknown): { text?: string; code?: string; }; /** Read `sha256-` or `sha256:` as the 32 bytes both name; undefined when it is neither. */ export declare function digestBytes(text: unknown): Buffer | undefined; /** True when two digest strings, in either form, name the same 32 bytes. */ export declare function sameDigest(a: unknown, b: unknown): boolean; //# sourceMappingURL=tool-set-digest.d.ts.map