import { ClaudeProviderAccountAuthoritySnapshotV1, type ConnectionMetadata } from "@opengeni/contracts"; import { type Database } from "./database.js"; export type ConnectionModelRestrictions = Record; /** Claude's model restrictions per id form, as its core route projects them (one answer). */ export type ClaudeCoreModelRestrictions = { readonly "claude/": readonly string[] | null; readonly "organization-claude-subscription/": readonly string[] | null; readonly "workspace-claude-subscription/": readonly string[] | null; }; /** * Public model-id restrictions only. Never returns connection or private owner * identifiers. `supergrok/` is closed here: SuperGrok runs only on the shared * core, whose readiness projection replaces it (`withCoreRoutedXaiRestriction`). */ export declare function getWorkspaceConnectionModelRestrictions(db: Database, workspaceId: string, subjectId: string, codex: ReadonlyArray<{ status: string; allocatorEnabled: boolean; allowedModelIds?: string[] | null; }>, claudeAuthoritySnapshot?: ClaudeProviderAccountAuthoritySnapshotV1, /** * Claude's restrictions on its core route (design 5.3, C2a): when given, * no legacy Claude pool or v1 snapshot is read and these are used. */ claudeCoreRestrictions?: ClaudeCoreModelRestrictions, /** * An already authorized public-workspace metadata read from this invocation. * Its owner still observes the original failure; unavailable metadata keeps * the independent scoped read and its original error behavior. */ workspaceConnections?: Promise): Promise; export declare function modelAllowedByConnections(restrictions: ConnectionModelRestrictions, modelId: string): boolean; /** Authoritative turn gate after allocation, including pins and recovered leases. */ export declare function assertModelConnectionAllowsTurn(db: Database, input: { workspaceId: string; subjectId: string; modelId: string; codexCredentialId?: string | null; workspaceProviderConnectionId?: string; }): Promise;