import type { ModelConnectionAccessResponse } from "@opengeni/sdk"; import { type ComponentProps, type ReactNode } from "react"; import { FlushFormPage } from "../../../ui/flush-form-page.js"; import type { ModelsView } from "../../lib/models-route.js"; import { type ReturnTo } from "../../lib/return-to.js"; /** * Where a Models page lives: Organization settings > Models, opened through * `anchorWorkspaceId` (the settings URL's workspace), and the workspace whose * model page it is or was opened from, if any (`?workspace=`). */ export type ModelsScope = { anchorWorkspaceId: string; workspaceId?: string | undefined; }; export declare const ModelsListLabelProvider: import("react").Provider; export declare function useModelsListLabel(): string; export { ProviderMark, ProviderTile, type ModelProviderId } from "./provider-mark.js"; /** * Who an account is for, as the one tag on its row and page: the * organization's workspaces (all, or the ones it was limited to), this * workspace, or only the person who connected it. */ export interface ModelsScopeLabels { /** "Shared by Acme": an organization account whose "Available in" this viewer can't read. */ organization: string; /** "Everyone in Acme": an organization account every workspace can use. */ everyone: string; /** "Selected workspaces": an organization account limited to some workspaces. */ selected: string; /** "No workspaces": an organization account that no workspace can use yet. */ none: string; /** "Design preview only", "This workspace only", or "Personal workspace only". */ workspace: string; /** "Only you". */ user: string; } export declare function modelsScopeLabels(organizationName: string, personal: boolean, /** Names the workspace in its own accounts' tag ("Design preview only"). */ workspaceName?: string): ModelsScopeLabels; /** * The tag of an organization account, from its "Available in": everyone, * one named workspace, selected workspaces or people, or none. "Shared by * Acme" is never guessed while the policy is unknown. */ export declare function organizationReachLabel(labels: ModelsScopeLabels, access: ModelConnectionAccessResponse | null | undefined): ReactNode; /** "Not in use", in the usage column of an account new work here doesn't use. */ export declare const NOT_IN_USE: import("react").JSX.Element; /** Who an account in the organization's list reaches, as the list reports it. */ export interface AccountReach { ownerWorkspaceId: string | null; everyWorkspace: boolean; workspaceIds: readonly string[]; personalWorkspaces: boolean; people: number | null; } /** * The tag of an account in the organization's list, from the reach the list * reports: "Belongs to Design" for a workspace's own account, else everyone, * one or two named workspaces, a count of workspaces or of chosen people. */ export declare function accountReachLabel(labels: ModelsScopeLabels, reach: AccountReach, workspaceName: (id: string) => string | undefined): string; /** A full-page form with a back link and a sticky Cancel + primary footer. */ export declare function ModelsFormPage({ backLabel, ...props }: Omit, "backLabel"> & { backLabel?: string | undefined; }): import("react").JSX.Element; /** * Who pays, in one or two words, for the muted part of a model control: * "GPT-6 Astra" + "Codex". API-key models name their provider. */ export declare function payerShortLabel(row: { billingClass: string; providerLabel: string; }): string; /** Who pays for a model, in product words: "Codex plan", "Opengeni credits". */ export declare function payerLabel(billingClass: string, fallback?: string): string; /** "3 usage limit resets", or nothing. */ export declare function resetsLabel(count: number | null | undefined): string | null; /** One line for a failed action: advice for an API error, never its raw message. */ export declare function errorText(error: unknown, fallback: string): string; export interface ModelsNavigation { account: string | undefined; view: ModelsView | undefined; /** * Where this page was opened from in another scope. It stays in the URL * while an account and its forms are open; the list drops it. */ returnTo: ReturnTo | undefined; /** Opens an account's page, or the list with `undefined`. `from` crosses scopes. */ openAccount: (account: string | undefined, from?: ReturnTo) => void; /** Opens a form page, optionally for an account. */ openView: (view: ModelsView | undefined, account?: string) => void; /** Opens a workspace's model page, or the organization's list with `undefined`. */ openWorkspace: (workspaceId: string | undefined, account?: string, view?: ModelsView) => void; /** Returns to where a cross-scope link came from. */ goBack: (returnTo: ReturnTo) => void; } export declare function useModelsNavigation(scope: ModelsScope, current: { account?: string | undefined; view?: ModelsView | undefined; returnTo?: ReturnTo | undefined; }): ModelsNavigation; /** Rename an account: a one-field prompt. `onSave` throws a user-facing error. */ export declare function RenameAccountDialog({ open, onOpenChange, name, label, provider, onSave, }: { open: boolean; onOpenChange: (open: boolean) => void; /** The name shown today. */ name: string; /** The saved label (empty when the name falls back to the email). */ label: string | null | undefined; provider: string; onSave: (label: string) => Promise; }): import("react").JSX.Element;