import fs from 'node:fs'; import path from 'node:path'; import type { InitProviderTemplate } from '../../config/init-provider-catalog.js'; import type { ConfigState, LoggerLike, ProviderV2Payload, RoutingConfig, UnknownRecord } from './shared.js'; export declare function isRecord(value: unknown): value is UnknownRecord; export declare function asRecord(value: unknown): UnknownRecord; export declare function normalizeHost(input: string | undefined): string | undefined; export declare function normalizePort(input: string | number | undefined): number | undefined; export declare function getProviderRoot(pathImpl: typeof path, homeDir: string): string; export declare function getProviderV2Path(pathImpl: typeof path, providerRoot: string, providerId: string): string; export declare function inferDefaultModel(providerNode: UnknownRecord): string; export declare function buildRouting(defaultTarget: string, overrides?: Partial>): RoutingConfig; export declare function readPrimaryTargetFromRoute(routeNode: unknown): string | null; export declare function readRoutingFromConfig(config: UnknownRecord): RoutingConfig; export declare function readProvidersFromV1(config: UnknownRecord): Record; export declare function inspectConfigState(fsImpl: typeof fs, configPath: string): ConfigState; export declare function ensureDir(fsImpl: typeof fs, dirPath: string): void; export declare function mergeRecordsPreferExisting(baseFromV1: UnknownRecord, existing: UnknownRecord): UnknownRecord; export declare function readProviderV2Payload(fsImpl: typeof fs, filePath: string): ProviderV2Payload | null; export declare function backupFileBestEffort(fsImpl: typeof fs, filePath: string): string | null; export declare function computeBackupPath(fsImpl: typeof fs, filePath: string): string; export declare function writeJsonFile(fsImpl: typeof fs, filePath: string, payload: unknown): void; export declare function writeProviderV2(fsImpl: typeof fs, pathImpl: typeof path, providerRoot: string, providerId: string, providerNode: UnknownRecord): string; export declare function loadProviderV2Map(fsImpl: typeof fs, pathImpl: typeof path, providerRoot: string): Record; export declare function maskSecretTail3(raw: string): string; export declare function collectProviderKeyMasks(providerNode: UnknownRecord): string[]; export declare function collectOauthTokenNames(providerNode: UnknownRecord): string[]; export declare function getProviderSummaryLine(providerId: string, payload: ProviderV2Payload): string; export declare function printConfiguredProviders(logger: LoggerLike, providerMap: Record): void; export declare function normalizeEnvVarName(providerId: string): string; export declare function isBackInput(value: string): boolean; export declare function resolveSelectedTemplates(providerIds: string[], catalogById: Map, options?: { allowExternal?: boolean; defaultModel?: string; }): InitProviderTemplate[]; export declare function ensureTargetProvidersExist(routing: RoutingConfig, providerIds: Set): string[]; export declare function buildV2ConfigFromExisting(existing: UnknownRecord, routing: RoutingConfig, host: string, port: number): UnknownRecord;