import { type Database } from "../database.js"; import { type SubscriptionCoreProvider } from "./provider.js"; export type SubscriptionCoreServingConnection = { connectionId: string; ownership: "shared" | "personal"; planType: string | null; /** The connection's own model allowlist (null: every model). */ allowedModelIds: string[] | null; /** Models the connection excludes. */ excludedModelIds: string[]; /** * Product models with a live per-model cooldown on this connection (a * proven plan refusal). Read for personal connections, whose live model * list cannot be read outside an exact accepted turn. */ cooledDownModelIds: string[]; /** * The latest shared catalog observed under the connection's current * credential generation. It may have expired: only `expiresAt > now` * proves it fresh. */ modelCatalog?: { slugs: string[]; observedAt: number; expiresAt: number; } | null; }; type ModelPolicy = Pick; /** * Placement's static model admission for one connection (allowlists and * exclusions). Lists are read in every id form of their models * (`withSubscriptionCoreModelIdForms`), so any form of a listed model matches. */ export declare function subscriptionCoreConnectionAllowsModel(connection: ModelPolicy, modelId: string): boolean; /** * The connection's admitted models as one allowlist (null: every model), for * the catalog's per-provider restriction union. Exclusions without an * allowlist cannot be listed; placement still refuses those models. */ export declare function subscriptionCoreConnectionAllowlist(connection: ModelPolicy): string[] | null; /** * The core connections of this provider that can serve new work of * `subjectId` in this workspace (see the module comment). A null or * non-human subject sees shared capacity only. */ export declare function listSubscriptionCoreServingConnections(db: Database, provider: SubscriptionCoreProvider, input: { accountId: string; workspaceId: string; subjectId: string | null; }, now?: Date): Promise; /** * The provider's readiness on the core: at least one connection can serve * new work of this subject here. */ export declare function subscriptionCoreWorkspaceReady(db: Database, provider: SubscriptionCoreProvider, input: { accountId: string; workspaceId: string; subjectId: string | null; }): Promise; export {};