import { type FetchedServer } from './mcp-client.js'; import type { McpServerRef } from './types.js'; export declare const PUBLISHER_PROVIDED = "io.modelcontextprotocol.registry/publisher-provided"; export declare const DECLARATION_FIELD = "dev.modelmarket.histor/tool-sets"; /** In the registry entry: the registry keeps ~4 KB of publisher-provided metadata. */ export declare const MAX_ENTRY_SETS = 8; /** In a file on the publisher's domain: runner versions × operating systems. */ export declare const MAX_FILE_SETS = 64; export declare const MAX_WHEN = 200; export declare const MAX_FILE_BYTES: number; export interface DeclaredSet { digest: string; count?: number; when?: string; } export interface DeclarationFile { mtl: '1'; sets: DeclaredSet[]; } export declare class DeclareError extends Error { constructor(message: string); } /** The condition as one line of visible text: control and format characters (zero-width, bidi overrides) dropped. */ export declare function cleanWhen(value: unknown): string | undefined; /** * Why HISTOR will not read a declaration file at `url` for `serverName`, or undefined. The file must * be on the domain the registry verified for the server's namespace or a subdomain (`ai.acme/x` → * acme.ai); for `io.github./x`, on `.github.io` or under `//` on raw or gist files. */ export declare function urlRefusal(url: unknown, serverName: string): string | undefined; /** Validated sets from a `sets` list, and why any entry was skipped — HISTOR's rules. */ export declare function parseSets(entries: unknown, limit: number): { sets: DeclaredSet[]; ignored: string[]; }; /** A declaration file, read the way HISTOR reads it. Throws when HISTOR would take nothing from it. */ export declare function parseDeclarationFile(text: string): { sets: DeclaredSet[]; ignored: string[]; }; /** `file` with `set` in it: a set with the same digest is replaced, the others are kept in order. */ export declare function withSet(file: DeclarationFile | undefined, set: DeclaredSet, limit?: number): DeclarationFile; /** The server.json `_meta` block for the registry entry. */ export declare function serverJsonBlock(sets: DeclaredSet[], url?: string): Record; /** The set this machine gets from a server, ready to declare. */ export declare function setFrom(fetched: FetchedServer, when?: string): DeclaredSet; export interface DeclareOptions { mode: 'set' | 'check'; when?: string; out?: string; serverJson?: boolean; link?: string; /** The server to read: a stdio command or an http(s) URL. */ ref?: McpServerRef; timeoutMs: number; /** --check: a file URL (with `name`) or a local path. */ check?: string; name?: string; } export declare const DECLARE_USAGE = "Usage:\n warden-mcp declare [--when TEXT] [--out FILE] -- COMMAND [ARGS...]\n warden-mcp declare [--when TEXT] [--out FILE] --url URL\n warden-mcp declare --server-json [--link URL] [--when TEXT] [-- COMMAND ... | --url URL]\n warden-mcp declare --check URL --name SERVER_NAME\n warden-mcp declare --check FILE\n\nStarts the server the way a client would, digests its tools/list (MTL/1) and prints the set to\ndeclare, so HISTOR and WARDEN can tell it apart from a set nobody has seen.\n\n --when TEXT the condition this set needs, in your words (at most 200 characters),\n e.g. \"runner 1.4, macOS\"\n --out FILE add the set to this declaration file (created if missing; other sets kept,\n the same digest replaced). Publish it on your own domain and link it from\n server.json with \"url\" (--server-json --link prints that block)\n --server-json print the server.json _meta block instead (sets inline, at most 8)\n --link URL with --server-json: point the entry at your declaration file\n --check URL --name SERVER_NAME\n read a published declaration file the way HISTOR will: the domain must be the\n one the registry verified for SERVER_NAME, https, no redirects, at most 64 KiB\n --check FILE check a local declaration file's format\n --timeout MS how long to wait for the server (default 60000)\n\nDetails: https://github.com/alexar76/histor/blob/main/docs/api.md#declaring-tool-sets-publishers"; export declare class DeclareUsage extends Error { } export declare function parseDeclareArgs(argv: string[]): DeclareOptions; export interface DeclareDeps { fetch?: (ref: McpServerRef, timeoutMs: number) => Promise; /** --check URL: GET without redirects; returns status and at most MAX_FILE_BYTES + 1 bytes of body. */ get?: (url: string, timeoutMs: number) => Promise<{ status: number; body: string; }>; readFile?: (path: string) => Promise; writeFile?: (path: string, text: string) => Promise; out?: (text: string) => void; err?: (text: string) => void; } /** Runs one `declare`; returns the exit code (0 ok, 1 refused or failed). */ export declare function runDeclare(opts: DeclareOptions, deps?: DeclareDeps): Promise; /** `warden-mcp declare …` — returns the process exit code. */ export declare function runDeclareCli(argv: string[]): Promise; //# sourceMappingURL=declare.d.ts.map