import type { Request, Router } from 'express'; import type { ExportVisibility } from './routeVisibility'; import type { Callspec, RouteFailure } from './types'; import { type OnCall } from './callObservability'; export type MountSpecOptions = { basePath?: string; /** * Default true — serves `/docs`, `/callspec.json`, and `/openapi.json` at the mount root. * Pass `false` to disable all docs/spec surfaces. */ docs?: boolean; /** * Which routes appear on `/docs`, `/callspec.json`, `/openapi.json`, and MCP `tools/list`. * Default `public`. Pass `all` in dev/stage so `scope: 'private'` routes are documented on this mount. */ visibility?: ExportVisibility; /** Docs UI mount path on this router. Default `/docs`. `callspec.json` and `openapi.json` stay fixed. */ docsPath?: string; /** MCP HTTP path on this router. Default `/mcp`. */ mcpPath?: string; /** * Request logging (jsout-express) and unhandled-error logging (jsout) on this router. * Default true — pass `false` in tests to silence output. */ logging?: boolean; /** * Structured per-call events (MCP `tools/call` today). Default: jsout `call` info * when `logging` is enabled. Pass a custom sink for Logfox, or `() => {}` to disable * call events while keeping HTTP access logs. */ onCall?: OnCall; /** * Map unexpected throws to intentional `RouteFailure` responses before log + * `INTERNAL_ERROR`. Return undefined to fall through to the default path. */ handleUnhandledError?: (err: unknown, req: Request) => RouteFailure | undefined; /** Override unhandled-error logging. Default uses jsout `logger.error`. */ logUnhandledError?: (err: unknown, req: Request) => void; }; export declare function mountSpec(router: Router, spec: Callspec, options?: MountSpecOptions): void;