import { type Tool } from '@modelcontextprotocol/sdk/types.js'; export interface PublishOptions { name?: string; description?: string; subdomain?: string; rotate?: boolean; allTools?: boolean; only?: string; exclude?: string; ttl: string; /** False with --no-record: do not keep a local log of tool calls. */ record?: boolean; /** Run in the background: the command returns once the link is live. */ daemon?: boolean; /** With --daemon: print the result as one JSON line. */ json?: boolean; } /** What the background child reports to the launching command over IPC. */ interface DaemonReady { type: 'ready'; name: string; subdomain: string; url: string; tools: string[]; held: string[]; pid: number; ttl: string; expiresAt: string; } export interface PublishDaemonResult extends Omit { mode: 'mcp'; logPath: string; } /** * `mcp publish --daemon`: start the same command as a detached process with * its output in a log file, wait until it reports the link is live, and * return. The child is found again through the session registry, so * `otterkit status` lists it and `otterkit stop ` ends it. */ export declare function launchPublishDaemon(parts: string[], options: PublishOptions): Promise; export declare class PublishDaemonError extends Error { /** The last lines the background process printed. */ readonly output: string; readonly logPath: string; constructor(message: string, /** The last lines the background process printed. */ output: string, logPath: string); } type Target = { kind: 'http'; url: URL; display: string; } | { kind: 'stdio'; command: string; args: string[]; display: string; }; /** * What to publish: a local MCP URL, a script file (the runner is inferred * from its extension), or a full command line. */ export declare function resolveTarget(parts: string[]): Target; interface Selection { published: Tool[]; /** Tools the server has that are not published, with the reason. */ held: { name: string; reason: 'destructive' | 'excluded'; }[]; } /** * Decide which tools go public. A tool the server itself marks destructive * stays private unless named in --only or --all-tools is given. (Only an * explicit `destructiveHint: true` counts: the spec's default for an * unannotated tool is also "destructive", which would hide everything.) */ export declare function selectTools(all: Tool[], opts: { only: string[]; exclude: string[]; allTools: boolean; }): Selection; export declare function publishMcp(parts: string[], options: PublishOptions): Promise; export {};