/** * Fail-soft loaders for optional feature dependencies * (change: extend-api-for-supervising-hosts, cli: OptionalFeatureDependenciesDegradeAtTheirOwnCommand). * * The graph viewer's toolchain and the stdio MCP transport SDK are needed by exactly one command * each. Declaring them required makes every embedding host carry React, a Vite toolchain and an MCP * SDK it never loads — the same concern as not dragging the analyzer through the package's main * entry. They are therefore `optionalDependencies`, loaded at the point of use. * * `optionalDependencies` still install by default: absence is an installer choice * (`--omit=optional`, an offline mirror), not a broken installation, and the message must say so. * A raw `ERR_MODULE_NOT_FOUND` stack reads as corruption and tells the user nothing actionable, so * every loader here converts it into the missing package plus the exact command that fixes it — * the posture the optional tree-sitter grammars and the local embedding service already take. */ /** An optional feature package could not be resolved. Carries its own remediation. */ export declare class OptionalFeatureError extends Error { /** The npm package names the feature needs. */ readonly packages: readonly string[]; constructor( /** The npm package names the feature needs. */ packages: readonly string[], message: string); } /** `npm install a b c` — the exact line that makes the feature work. */ export declare function installCommandFor(packages: readonly string[]): string; /** * Run a dynamic import, converting a resolution failure into an {@link OptionalFeatureError}. * Any OTHER failure (a package that is installed but throws while initializing) is rethrown * untouched: that is a real fault, and reporting it as "not installed" would send the user to * reinstall something they already have. * * Exported so absence can be tested against a rejecting import: a test runner's module mock cannot * reproduce a real `ERR_MODULE_NOT_FOUND` faithfully, and the classification is the behaviour here. */ export declare function loadOptionalFeature(load: () => Promise, feature: string, packages: readonly string[], alternative?: string): Promise; /** The remediation line for the stdio SDK: the daemon transport needs none of it. */ export declare const MCP_SDK_ALTERNATIVE = "The HTTP daemon transport remains available without it: run `openlore serve` and point your client at the daemon."; /** The viewer's build toolchain. `react` / `react-dom` are resolved by vite when it serves the UI. */ export declare const VIEWER_PACKAGES: readonly ["vite", "@vitejs/plugin-react", "react", "react-dom"]; /** The stdio MCP transport SDK. The HTTP daemon (`openlore serve`) does not use it. */ export declare const MCP_SDK_PACKAGES: readonly ["@modelcontextprotocol/sdk"]; export interface ViewerToolchain { createServer: typeof import('vite')['createServer']; react: typeof import('@vitejs/plugin-react')['default']; } /** Load vite and the React plugin for `openlore view`. */ export declare function loadViewerToolchain(): Promise; export interface McpSdk { Server: typeof import('@modelcontextprotocol/sdk/server/index.js')['Server']; StdioServerTransport: typeof import('@modelcontextprotocol/sdk/server/stdio.js')['StdioServerTransport']; types: typeof import('@modelcontextprotocol/sdk/types.js'); } /** Load the stdio transport SDK for `openlore mcp`. */ export declare function loadMcpSdk(): Promise; //# sourceMappingURL=optional-features.d.ts.map