Public declaration syntax from forge-ts/packages/forge-core/src/topology.ts Original source SHA-256: 539a27285463b50e4b2859fd2c189d0e17fd1ab193658138cecba9185cb621b3 Function bodies and constant values are omitted. This is not the complete implementation. Source line 27 export const DEFAULT_ROLE /* type inferred in source */; Source line 35 export const CostPreference /* type inferred in source */; Source line 45 export type CostPreference = (typeof CostPreference)[keyof typeof CostPreference]; Source line 53 export const LatencyPreference /* type inferred in source */; Source line 63 export type LatencyPreference = (typeof LatencyPreference)[keyof typeof LatencyPreference]; Source line 75 export interface ModelSlot { /** The role name for this slot (e.g., "planner", "coder", "default"). */ readonly role: string; /** Primary model for this slot. */ readonly primary: ProviderRef; /** Ordered fallback models. Tried in sequence when the primary is unavailable. */ readonly fallbacks: readonly ProviderRef[]; /** Runtime capabilities required for this slot. */ readonly requiredCapabilities: readonly RuntimeCapability[]; /** Optional cost preference for the router. */ readonly costPreference?: CostPreference; /** Optional latency preference for the router. */ readonly latencyPreference?: LatencyPreference; /** * Optional Arsenal scope narrowing applied when this slot is selected. * If set, the agent's ACT is intersected with these scopes before * the model call. The intersection can only narrow, never widen. */ readonly arsenalScopeNarrowing?: readonly string[]; } Source line 114 export class ModelTopology { constructor( name: string, slots: Map, defaultRole: string, ); static single(providerRef: ProviderRef): ModelTopology; static builder(): TopologyBuilder; name(): string; defaultRole(): string; defaultSlot(): ModelSlot; slotForRole(role: string): ModelSlot; slots(): ReadonlyMap; allProviderRefs(): readonly ProviderRef[]; hasRole(role: string): boolean; slotCount(): number; toJSON(): Record; } Source line 325 export class TopologyBuilder { name(name: string): this; slot(role: string, primary: ProviderRef): this; withFallback(role: string, fallback: ProviderRef): this; withRequiredCapability(role: string, cap: RuntimeCapability): this; withCostPreference(role: string, pref: CostPreference): this; withLatencyPreference(role: string, pref: LatencyPreference): this; withScopeNarrowing(role: string, scopes: string[]): this; build(): ModelTopology; }