Public declaration syntax from forge-ts/packages/forge-core/src/routing.ts Original source SHA-256: c38e318ccfffcb016d8bad82b59dd5ec5b34bf990035e529ccde98465d270530 Function bodies and constant values are omitted. This is not the complete implementation. Source line 28 export const TaskMode /* type inferred in source */; Source line 40 export type TaskMode = (typeof TaskMode)[keyof typeof TaskMode]; Source line 50 export function taskModeAsRoleName(mode: TaskMode): string; Source line 60 export const ExecutionTopology /* type inferred in source */; Source line 72 export type ExecutionTopology = (typeof ExecutionTopology)[keyof typeof ExecutionTopology]; Source line 80 export interface RoutingContext { /** The domain classification for this call (e.g., "code", "math"). */ readonly domain?: string; /** The task mode for this call. */ readonly taskMode?: TaskMode; /** The execution topology for this call. */ readonly executionTopology?: ExecutionTopology; /** Tool capabilities required for the model selected by this route. */ readonly toolRequirements?: readonly string[]; /** Explicit role override. When set, the router returns that slot directly. */ readonly roleOverride?: string; } Source line 96 export function defaultRoutingContext(): RoutingContext; Source line 105 export interface ModelCapabilities { readonly textGeneration: boolean; readonly toolCalling: boolean; } Source line 113 export function defaultModelCapabilities(): ModelCapabilities; Source line 122 export interface ResolvedRoute { /** The role name of the selected slot. */ readonly slotRole: string; /** The specific `ProviderRef` to use (primary or one of the fallbacks). */ readonly provider: ProviderRef; /** The model capabilities of the selected provider. */ readonly modelCapabilities: ModelCapabilities; /** Whether a fallback model was selected instead of the primary. */ readonly fallbackUsed: boolean; } Source line 141 export interface ModelRouter { /** Returns the name of this routing strategy (for telemetry and debugging). */ name(): string; /** * Selects a slot from the topology. * * @param context - The routing context describing the current task. * @param topology - The model topology to select from. * @returns A `ResolvedRoute` identifying the selected slot and provider. * @throws {ForgeError} If routing fails. */ route(context: RoutingContext, topology: ModelTopology): ResolvedRoute; } Source line 176 export class DefaultModelRouter implements ModelRouter { name(): string; route(context: RoutingContext, topology: ModelTopology): ResolvedRoute; }