import type { ServerMode, ToolSet } from '../types/index.js'; import type { ModuleLoader } from 'toolception'; /** * Minimal structural view of ServerModeEnforcer required by the mapper. * Defined here to avoid the adapters layer importing the server-mode-enforcer module * (which would invert the architectural layering). */ interface ModeEnforcerView { readonly serverModeOverride: ServerMode | null; readonly toolSets: ToolSet[]; } /** * Session context configuration for per-session token support * Enables users to provide their own FMP_ACCESS_TOKEN via query param */ interface SessionContextConfig { enabled: boolean; queryParam: { name: string; encoding: 'base64' | 'json'; allowedKeys: string[]; }; merge: 'shallow' | 'deep'; } /** * Toolception configuration options * Based on toolception's CreateMcpServerOptions type */ interface ToolceptionConfig { catalog: ToolSetCatalog; moduleLoaders: Record; startup: { mode: 'DYNAMIC' | 'STATIC'; toolsets?: string[] | 'ALL'; }; context: { accessToken?: string; [key: string]: any; }; sessionContext?: SessionContextConfig; exposurePolicy: { namespaceToolsWithSetKey: boolean; maxActiveToolsets?: number; allowlist?: ToolSet[]; }; } /** * Toolception toolset catalog */ interface ToolSetCatalog { [key: string]: { name: string; description: string; decisionCriteria?: string; modules?: string[]; }; } /** * Maps FMP's ServerMode to toolception configuration * * This class translates between FMP's three modes (DYNAMIC_TOOL_DISCOVERY, * STATIC_TOOL_SETS, ALL_TOOLS) and toolception's configuration format. */ export declare class ModeConfigMapper { /** * Convert FMP ServerMode to toolception configuration * * @param mode - FMP server mode * @param enforcer - Server mode enforcer instance * @param accessToken - FMP API access token * @param moduleLoaders - Record of module name to loader function * @returns Toolception configuration object */ static toToolceptionConfig(mode: ServerMode, enforcer: ModeEnforcerView, accessToken?: string, moduleLoaders?: Record): ToolceptionConfig; /** * Build session context configuration for per-session token support * Only allows FMP_ACCESS_TOKEN to be overridden per-session */ private static buildSessionContextConfig; /** * Build toolception catalog from FMP TOOL_SETS */ private static buildCatalog; /** * Resolve tool sets from enforcer (server-level configuration only) */ private static resolveToolSets; } export {};