import { ConfigStore, type ConfigMutationResult } from "../config/store.js"; import type { RouteConfigV1, StableId } from "../config/types.js"; import { CatalogCacheStore } from "../ninerouter/cache.js"; import { type CatalogCacheV1 } from "../ninerouter/types.js"; /** The only execution pools supported by the configuration schema. */ export declare const POOL_IDS: readonly ["investigation", "implementation", "verification"]; export type PoolId = (typeof POOL_IDS)[number]; export declare const POOL_LABELS: Readonly>; export type PoolManagementState = "active" | "global-disabled" | "missing" | "provider-unavailable" | "unknown"; export type PoolCatalogState = "fresh" | "stale" | "missing" | "unknown"; export interface PoolEntryView { /** Stable local route identity. */ readonly routeId: StableId; readonly displayName: string; /** Exact remote model ID sent to the gateway. */ readonly remoteModelId: string; /** Zero-based position in the persisted priority array. */ readonly index: number; readonly globalEnabled: boolean; readonly poolEnabled: boolean; readonly state: PoolManagementState; readonly catalogState: PoolCatalogState; readonly gatewayId?: StableId; readonly resourceClass: RouteConfigV1["resource"]["class"]; readonly resourceId?: StableId; readonly sourceLabel?: string; readonly underlyingFamily?: string; readonly underlyingVersion?: string; readonly provenance?: CatalogCacheV1["entries"][number]["provenance"]; /** Whether the bound last-known-good catalog contains this remote ID. */ readonly presentInCatalog?: boolean; } export interface PoolView { readonly id: PoolId; readonly poolId: PoolId; readonly label: string; readonly entries: readonly PoolEntryView[]; } export interface PoolStatus { readonly id: PoolId; readonly poolId: PoolId; readonly label: string; readonly total: number; readonly active: number; readonly poolDisabled: number; readonly globallyDisabled: number; readonly missing: number; readonly providerUnavailable: number; readonly unknown: number; readonly stale: number; } export interface PoolRouteCandidate extends Omit { readonly poolEnabled: false; } export interface PoolManagerOptions { readonly configStore: ConfigStore; readonly cacheStore?: CatalogCacheStore; } export interface PoolMutationResult extends ConfigMutationResult { readonly poolId: PoolId; readonly routeId: StableId; } export type PoolManagerErrorCode = "invalid-pool" | "configuration-unavailable" | "route-not-found" | "duplicate-route" | "route-not-in-pool" | "invalid-target-index"; export declare class PoolManagerError extends Error { readonly code: PoolManagerErrorCode; readonly poolId?: string; readonly routeId?: string; constructor(code: PoolManagerErrorCode, message: string, details?: { poolId?: string; routeId?: string; }); } export type PoolFilter = string | { readonly filter?: string; } | undefined; /** * Configuration-only execution pool manager. It deliberately has no route * selection or provider-registration behavior; M4 owns those concerns. */ export declare class PoolManager { private readonly configStore; private readonly cacheStore; constructor(options: PoolManagerOptions); constructor(configStore: ConfigStore, cacheStore?: CatalogCacheStore); listPools(): Promise; getPool(poolId: PoolId): Promise; listMembers(poolId: PoolId): Promise; getPoolStatus(poolId: PoolId): Promise; getAvailableCandidatesToAdd(poolId: PoolId, filter?: PoolFilter): Promise; addRoute(poolId: PoolId, routeId: StableId): Promise; removeRoute(poolId: PoolId, routeId: StableId): Promise; moveRouteUp(poolId: PoolId, routeId: StableId): Promise; moveRouteDown(poolId: PoolId, routeId: StableId): Promise; moveRoute(poolId: PoolId, routeId: StableId, targetIndex: number): Promise; setPoolEntryEnabled(poolId: PoolId, routeId: StableId, enabled: boolean): Promise; private reorder; private mutate; private loadContext; private viewPool; private viewCandidate; private viewEntry; } export declare function createPoolManager(root: string, configStore?: ConfigStore): PoolManager; export declare function isPoolId(value: unknown): value is PoolId;