import { Spinner } from "~/components/ui/spinner"; import { AlertTriangleIcon, CheckIcon, ArrowUpCircleIcon, CopyIcon, DownloadIcon, ExternalLinkIcon, LayersIcon, PlusIcon, Trash2Icon, XIcon, } from "lucide-react"; import { Lock as LockGlyph, LockOpen } from "lucide"; import * as Arr from "effect/Array"; import * as Result from "effect/Result"; import { Fragment, useState, type ReactElement, type ReactNode } from "react"; import { isProviderDriverKind, resolveProviderInstanceEnabled, type ProviderInstanceConfig, type ProviderInstanceEnvironmentVariable, type ProviderInstanceId, type AcpRegistryUrlAuthAction, type EnvironmentId, type ProjectId, type ProviderDriverKind, type SecretReference, type ServerProvider, type ServerProviderModel, } from "@t3tools/contracts"; import { type CustomModelDefinition, readCustomModelEntries, toCustomModelSetting, } from "@t3tools/shared/model"; import { cn } from "../../lib/utils"; import { useCopyToClipboard } from "../../hooks/useCopyToClipboard"; import { useStableCallback } from "../../hooks/useStableCallback"; import { normalizeProviderAccentColor } from "../../providerInstances"; import { Badge } from "../ui/badge"; import { Button } from "../ui/button"; import { MorphIcon } from "~/components/MorphIcon"; import { DraftInput } from "../ui/draft-input"; import { SecretSourceInput, type SecretSource } from "./SecretSourceInput"; import { Popover, PopoverPopup, PopoverTrigger } from "../ui/popover"; import { Switch } from "../ui/switch"; import { ManagedControl, ManagedNotice } from "../ManagedPolicy"; import { managedInstanceLocks, useManagedPolicy } from "../../state/managedPolicy"; import { disallowedProviderMessage, isManagedDriverAllowed } from "@t3tools/contracts"; import { stackedThreadToast, toastManager } from "../ui/toast"; import { Tooltip, TooltipPopup, TooltipTrigger } from "../ui/tooltip"; import type { ProviderClientDefinition, ProviderEnvironmentField, } from "@t3tools/provider-core/client"; import { deriveProviderSettingsFields, ProviderSettingsForm, reconcileRowsDraft, seedRowsDraft, } from "./ProviderSettingsForm"; import { ProviderModelsSection } from "./ProviderModelsSection"; import { ProviderInstanceIcon } from "../chat/ProviderInstanceIcon"; import { ProviderAccentColorPicker } from "./ProviderAccentColorPicker"; import { RedactedSensitiveText } from "./RedactedSensitiveText"; import { SettingResetButton, SettingsRow, SettingsSection } from "./settingsLayout"; import { AcpSessionManagementSection } from "./AcpSessionManagementSection"; import { FoldedSettingsSection } from "./FoldedSettingsSection"; import { readCodexSetupMode } from "./CodexSetupSection.logic"; import { getProviderVersionAdvisoryPresentation, PROVIDER_STATUS_STYLES, getProviderStatusKey, getProviderSummary, getProviderVersionLabel, } from "./providerStatus"; const ENVIRONMENT_VARIABLE_NAME_PATTERN = /^[a-zA-Z_][a-zA-Z0-9_]*$/; function ProviderStatusDiagnostic({ detail, children, }: { detail: string | null; children: ReactElement; }) { if (!detail) return children; return ( {detail} ); } let environmentVariableDraftId = 0; const nextEnvironmentVariableDraftId = () => `provider-env-${environmentVariableDraftId++}`; type EnvironmentDraftRow = { readonly id: string; readonly name: string; readonly value: ProviderInstanceEnvironmentVariable["value"]; readonly sensitive: boolean; readonly valueRedacted?: boolean; }; function makeEnvironmentDraftRow( variable: ProviderInstanceEnvironmentVariable, index: number, ): EnvironmentDraftRow { return { id: `${index}:${variable.name}`, name: variable.name, value: variable.value, sensitive: variable.sensitive, ...(variable.valueRedacted !== undefined ? { valueRedacted: variable.valueRedacted } : {}), }; } const toEnvironmentDraftRows = (environment: ReadonlyArray) => environment.map(makeEnvironmentDraftRow); function environmentValuesEqual( left: ProviderInstanceEnvironmentVariable["value"], right: ProviderInstanceEnvironmentVariable["value"], ): boolean { if (typeof left === "string" || typeof right === "string") return left === right; return left.provider === right.provider && left.reference === right.reference; } function providerEnvironmentsEqual( left: ReadonlyArray, right: ReadonlyArray, ): boolean { return ( left.length === right.length && left.every((variable, index) => { const other = right[index]; return ( other !== undefined && variable.name === other.name && environmentValuesEqual(variable.value, other.value) && variable.sensitive === other.sensitive && variable.valueRedacted === other.valueRedacted ); }) ); } function readConfigString(config: unknown, key: string): string | null { if (config === null || typeof config !== "object") return null; const value = (config as Record)[key]; return typeof value === "string" && value.trim().length > 0 ? value.trim() : null; } /** Preserve explicit empty arrays/objects; clearing a custom list differs from selecting driver defaults. */ function nextConfigBlobWithValue( config: unknown, key: string, value: unknown, ): Record { const base: Record = config !== null && typeof config === "object" ? { ...(config as Record) } : {}; base[key] = value; return base; } export function deriveProviderModelsForDisplay(input: { readonly liveModels: ReadonlyArray | undefined; readonly customModels: ReadonlyArray; }): ReadonlyArray { const liveCustomModelsBySlug = new Map( Arr.filterMap(input.liveModels ?? [], (model) => model.isCustom ? Result.succeed([model.slug, model] as const) : Result.failVoid, ), ); const serverModels = input.liveModels?.filter((model) => !model.isCustom) ?? []; const serverSlugs = new Set(serverModels.map((model) => model.slug)); const customModels = input.customModels.flatMap((entry) => serverSlugs.has(entry.slug) ? [] : [ { slug: entry.slug, name: entry.name, isCustom: true, capabilities: entry.capabilities ?? liveCustomModelsBySlug.get(entry.slug)?.capabilities ?? null, }, ], ); return [...serverModels, ...customModels]; } function ProviderAuthEmail(props: { readonly email: string | undefined }) { const email = props.email?.trim(); if (!email) return null; return ( ); } function readProviderEnvironmentVariable( environment: ReadonlyArray | undefined, name: string, ): ProviderInstanceEnvironmentVariable | undefined { return environment?.find((variable) => variable.name === name); } function providerEnvironmentWithoutNames( environment: ReadonlyArray | undefined, names: ReadonlySet, ): ReadonlyArray { return (environment ?? []).filter((variable) => !names.has(variable.name)); } export function nextProviderEnvironmentWithFieldValue( environment: ReadonlyArray | undefined, field: ProviderEnvironmentField, value: string, ): ReadonlyArray { const trimmed = value.trim(); const next: ProviderInstanceEnvironmentVariable[] = []; let found = false; for (const variable of environment ?? []) { if (variable.name !== field.name) { next.push(variable); continue; } found = true; if (trimmed.length > 0) { next.push({ name: variable.name, value: trimmed, sensitive: field.sensitive ?? true, }); } } if (!found && trimmed.length > 0) { next.push({ name: field.name, value: trimmed, sensitive: field.sensitive ?? true, }); } return next; } export function nextProviderEnvironmentWithFieldSecret( environment: ReadonlyArray | undefined, field: ProviderEnvironmentField, secret: SecretReference | undefined, ): ReadonlyArray { const others = providerEnvironmentWithoutNames(environment, new Set([field.name])); return secret === undefined ? others : [...others, { name: field.name, value: secret, sensitive: true }]; } function ProviderEnvironmentFieldRow(props: { readonly field: ProviderEnvironmentField; readonly variable: ProviderInstanceEnvironmentVariable | undefined; readonly idPrefix: string; readonly onCommit: (field: ProviderEnvironmentField, value: string) => void; readonly onSecretChange: ( field: ProviderEnvironmentField, secret: SecretReference | undefined, ) => void; readonly onRemove: (field: ProviderEnvironmentField) => void; readonly managedReason?: string | undefined; readonly secretSources: ReadonlyArray; }) { const inputId = `${props.idPrefix}-environment-${props.field.name}`; const value = props.variable?.valueRedacted ? "" : (props.variable?.value ?? ""); return ( {props.field.label}} description={props.field.description} managed={props.managedReason} control={
{props.field.sensitive === false ? ( props.onCommit(props.field, next)} placeholder={props.field.placeholder} spellCheck={false} /> ) : ( props.onCommit(props.field, next)} placeholder={props.field.placeholder} configured={props.variable?.valueRedacted === true} spellCheck={false} aria-label={props.field.label} sources={props.secretSources} onSecretChange={(secret) => props.onSecretChange(props.field, secret)} /> )} {props.variable ? ( ) : null}
} /> ); } export function ProviderEnvironmentSection(props: { readonly environment: ReadonlyArray; readonly onChange: (environment: ReadonlyArray) => void; /** Variables an administrator's policy pins: listed by name, never editable or removable. */ readonly managed?: { readonly names: ReadonlySet; readonly reason: string } | undefined; readonly secretSources?: ReadonlyArray; }) { const [storedDraft, setDraft] = useState(() => seedRowsDraft(props.environment, toEnvironmentDraftRows), ); const draft = reconcileRowsDraft( storedDraft, props.environment, providerEnvironmentsEqual, toEnvironmentDraftRows, ); if (draft !== storedDraft) setDraft(draft); const rows = draft.rows; const setRows = (nextRows: ReadonlyArray) => setDraft({ ...draft, rows: nextRows }); const publishRows = (nextRows: ReadonlyArray) => { const published: ProviderInstanceEnvironmentVariable[] = []; for (const row of nextRows) { const name = row.name.trim(); if (!ENVIRONMENT_VARIABLE_NAME_PATTERN.test(name)) { if ( name.length > 0 || row.value !== "" || row.sensitive !== true || row.valueRedacted !== undefined ) { return; } continue; } const { id: _id, ...rest } = row; published.push({ ...rest, name }); } setDraft({ rows: nextRows, seen: draft.seen, lastPublished: published }); props.onChange(published); }; const updateVariable = (id: string, patch: Partial>) => { // A row named like a pinned variable renders as the policy's, with no way to edit or remove it. if (patch.name !== undefined && props.managed?.names.has(patch.name)) return; const nextRows = rows.map((row) => row.id === id ? { ...row, ...patch, ...(patch.value !== undefined ? { valueRedacted: false } : {}), } : row, ); setRows(nextRows); publishRows(nextRows); }; const setVariableSecret = (id: string, secret: SecretReference | undefined) => { const nextRows = rows.map((row) => { if (row.id !== id) return row; const { valueRedacted: _valueRedacted, ...rest } = row; return { ...rest, value: secret ?? "" }; }); setRows(nextRows); publishRows(nextRows); }; const removeVariable = (id: string) => { const nextRows = rows.filter((row) => row.id !== id); setRows(nextRows); publishRows(nextRows); }; const addVariable = () => setRows([ ...rows, { id: nextEnvironmentVariableDraftId(), name: "", value: "", sensitive: true, }, ]); return ( Add variable } > {rows.length > 0 ? (
{rows.map((variable, index) => { if (props.managed?.names.has(variable.name)) { return (
{variable.name} {props.managed.reason}
); } const nameInput = ( updateVariable(variable.id, { name: name.trim() })} disabled={variable.valueRedacted === true} placeholder="VARIABLE_NAME" spellCheck={false} aria-label={`Environment variable name ${index + 1}`} /> ); const removeButton = ( ); const sensitiveToggle = typeof variable.value === "string" ? ( { const sensitive = !variable.sensitive; updateVariable(variable.id, { sensitive, ...(sensitive && variable.valueRedacted === undefined ? {} : { valueRedacted: sensitive ? variable.valueRedacted : false }), }); }} aria-pressed={variable.sensitive} aria-label={`Mark environment variable ${variable.name || index + 1} as sensitive`} > } /> {variable.sensitive ? "Sensitive, stored separately" : "Plain text"} ) : null; const layout = (source: ReactNode, value: ReactNode) => (
{nameInput} {source} {removeButton}
{value} {sensitiveToggle}
); return ( {variable.sensitive ? ( updateVariable(variable.id, { value })} placeholder="value" configured={variable.valueRedacted === true} spellCheck={false} aria-label={`Environment variable value ${index + 1}`} sources={props.secretSources ?? []} onSecretChange={(secret) => setVariableSecret(variable.id, secret)} > {(parts) => layout(parts.source, parts.value)} ) : ( layout( null, updateVariable(variable.id, { value })} autoComplete="off" placeholder="value" spellCheck={false} aria-label={`Environment variable value ${index + 1}`} />, ) )} ); })}

Sensitive values are stored separately and never returned to the app. {rows.some((row) => row.valueRedacted === true) ? " Enter a new value to rename a saved one or make it plain text." : null}

) : null}
); } function ProjectOverrideInheritance({ projectEnabled, deviceEnabled, }: { readonly projectEnabled: boolean; readonly deviceEnabled: boolean; }) { const layers = [ { key: "project", label: "Project", enabled: projectEnabled, effective: true }, { key: "device", label: "Device", enabled: deviceEnabled, effective: false }, ]; return ( } /> } > Overridden for this project
    {layers.map((layer) => (
  1. {layer.label} {layer.enabled ? "On" : "Off"} {layer.effective ? ( ) : ( )}
  2. ))}
); } interface ProjectOverrideControl { readonly value: boolean | undefined; readonly effectiveEnabled: boolean; readonly onChange: (next: boolean) => void; readonly onReset: () => void; } interface ProviderInstanceCardProps { readonly instanceId: ProviderInstanceId; readonly instance: ProviderInstanceConfig; readonly driverOption: ProviderClientDefinition | undefined; readonly liveProvider: ServerProvider | undefined; readonly mode: "list" | "editor"; readonly selected?: boolean | undefined; readonly onSelect?: (() => void) | undefined; readonly readOnly?: boolean | undefined; readonly canWriteSettings?: boolean; readonly onUpdate: (nextInstance: ProviderInstanceConfig) => void; readonly onDelete?: (() => void) | undefined; readonly headerAction?: ReactNode | undefined; readonly setup?: ReactNode; readonly runtime?: ReactNode; readonly hiddenModels: ReadonlyArray; readonly favoriteModels: ReadonlyArray; readonly modelOrder: ReadonlyArray; readonly onHiddenModelsChange: ( next: ReadonlyArray, affectedModels: ReadonlyArray, ) => void; readonly onFavoriteModelsChange: (next: ReadonlyArray) => void; readonly onToggleFavorite: (model: string) => void; readonly onModelOrderChange: (next: ReadonlyArray) => void; readonly onRunUpdate?: (() => void) | undefined; readonly onInstallRecommended?: (() => void) | undefined; readonly isUpdating?: boolean | undefined; readonly onAcceptUrlAuth?: ((action: AcpRegistryUrlAuthAction) => void) | undefined; readonly environmentId?: EnvironmentId | undefined; readonly secretSources?: ReadonlyArray; readonly projectOverride?: ProjectOverrideControl | undefined; readonly acpProjects?: | ReadonlyArray<{ readonly id: ProjectId; readonly title: string; readonly workspaceRoot: string; }> | undefined; } const EMPTY_ACP_PROJECTS: NonNullable = []; const NO_SECRET_SOURCES: ReadonlyArray = []; const NO_CUSTOM_MODELS: ReadonlyArray = []; /** Unknown drivers stay read-only to preserve fork config. projectOverride switches affect only the * project, not instance.enabled. */ export function ProviderInstanceCard({ instanceId, instance, driverOption, liveProvider, mode, selected = false, onSelect, readOnly = false, canWriteSettings = true, onUpdate, onDelete, headerAction, setup, runtime, hiddenModels, favoriteModels, modelOrder, onHiddenModelsChange, onFavoriteModelsChange, onToggleFavorite, onModelOrderChange, onRunUpdate, onInstallRecommended, isUpdating = false, onAcceptUrlAuth, environmentId, acpProjects = EMPTY_ACP_PROJECTS, secretSources = NO_SECRET_SOURCES, projectOverride, }: ProviderInstanceCardProps) { const enabled = projectOverride?.effectiveEnabled ?? resolveProviderInstanceEnabled(instance); const effectiveProvider = liveProvider && { ...liveProvider, enabled }; const compatibility = enabled ? liveProvider?.compatibilityAdvisory : undefined; const statusKey = enabled ? getProviderStatusKey(effectiveProvider) : "disabled"; const statusStyle = PROVIDER_STATUS_STYLES[statusKey]; const summary = enabled ? getProviderSummary(effectiveProvider) : { headline: "Disabled", detail: null }; const authEmail = liveProvider?.auth.email?.trim(); const isAuthenticated = enabled && liveProvider?.auth.status === "authenticated"; const authLabel = enabled && liveProvider?.auth.status === "authenticated" ? (liveProvider.auth.label ?? liveProvider.auth.type ?? null) : null; const versionLabel = getProviderVersionLabel(liveProvider?.version); const versionAdvisory = getProviderVersionAdvisoryPresentation( liveProvider?.versionAdvisory, liveProvider?.compatibilityAdvisory, enabled, ); const updateCommand = versionAdvisory?.updateCommand ?? null; const updateState = liveProvider?.updateState; const updateProgress = isUpdating ? ((updateState?.status === "queued" || updateState?.status === "running" ? updateState.message : null) ?? "Starting update") : null; const updateProblem = !isUpdating && (updateState?.status === "failed" || updateState?.status === "unchanged") ? updateState.message : null; const hasCompatibilityWarning = compatibility !== undefined && compatibility.status !== "supported" && compatibility.status !== "unknown"; const VersionAdvisoryIcon = hasCompatibilityWarning ? AlertTriangleIcon : ArrowUpCircleIcon; const onRunVersionAction = readOnly ? undefined : versionAdvisory?.targetVersion ? onInstallRecommended : onRunUpdate; const urlAuthAction = liveProvider?.auth.action; const displayName = instance.displayName?.trim() || driverOption?.label || String(instance.driver); const accentColor = normalizeProviderAccentColor(instance.accentColor); const managedPolicy = useManagedPolicy(environmentId); const instanceLocks = managedInstanceLocks(managedPolicy, instance.driver); const managedDriverReason = isManagedDriverAllowed(managedPolicy, instance.driver) ? undefined : disallowedProviderMessage( managedPolicy?.organization, driverOption?.label ?? String(instance.driver), ); const { copyToClipboard } = useCopyToClipboard<{ providerName: string }>({ onCopy: ({ providerName }) => { toastManager.add({ type: "success", title: `${providerName} update command copied`, description: "Run it in a terminal when you are ready to update.", }); }, onError: (error, { providerName }) => { toastManager.add( stackedThreadToast({ type: "error", title: `Could not copy ${providerName} update command`, description: error.message, }), ); }, }); const driverKind: ProviderDriverKind | null = isProviderDriverKind(instance.driver) ? instance.driver : null; const storedCustomModels = instance.config !== null && typeof instance.config === "object" ? (instance.config as Record).customModels : undefined; const customModels = instance.driver === "antigravity" ? NO_CUSTOM_MODELS : readCustomModelEntries(storedCustomModels); const modelsForDisplay = deriveProviderModelsForDisplay({ liveModels: liveProvider?.models, customModels, }); const updateDisplayName = (value: string) => { const trimmed = value.trim(); const { displayName: _omit, ...rest } = instance; onUpdate( trimmed.length > 0 ? ({ ...rest, displayName: trimmed } as ProviderInstanceConfig) : (rest as ProviderInstanceConfig), ); }; const updateEnabled = (value: boolean) => { if (projectOverride) { projectOverride.onChange(value); return; } onUpdate({ ...instance, enabled: value }); }; const updateAccentColor = (value: string) => { const normalized = normalizeProviderAccentColor(value); const { accentColor: _omit, ...rest } = instance; onUpdate( normalized ? ({ ...rest, accentColor: normalized } as ProviderInstanceConfig) : (rest as ProviderInstanceConfig), ); }; const updateConfig = (nextConfig: Record | undefined) => { const { config: _omit, ...rest } = instance; onUpdate( nextConfig !== undefined ? ({ ...rest, config: nextConfig } as ProviderInstanceConfig) : (rest as ProviderInstanceConfig), ); }; const updateCustomModels = useStableCallback((next: ReadonlyArray) => { const nextConfig = nextConfigBlobWithValue( instance.config, "customModels", next.map(toCustomModelSetting), ); const { config: _omit, ...rest } = instance; onUpdate({ ...rest, config: nextConfig } as ProviderInstanceConfig); }); const updateEnvironment = (environment: ReadonlyArray) => { const cleaned = environment.filter((variable) => variable.name.trim().length > 0); const { environment: _omit, ...rest } = instance; onUpdate( cleaned.length > 0 ? ({ ...rest, environment: cleaned } as ProviderInstanceConfig) : (rest as ProviderInstanceConfig), ); }; const environmentFields = driverOption?.environmentFields ?? []; const environmentFieldNames = new Set(environmentFields.map((field) => field.name)); const genericEnvironment = providerEnvironmentWithoutNames( instance.environment, environmentFieldNames, ); const updateGenericEnvironment = ( environment: ReadonlyArray, ) => { const dedicatedEnvironment = (instance.environment ?? []).filter((variable) => environmentFieldNames.has(variable.name), ); updateEnvironment([...dedicatedEnvironment, ...environment]); }; const updateEnvironmentField = (field: ProviderEnvironmentField, value: string) => { updateEnvironment(nextProviderEnvironmentWithFieldValue(instance.environment, field, value)); }; const updateEnvironmentFieldSecret = ( field: ProviderEnvironmentField, secret: SecretReference | undefined, ) => { updateEnvironment(nextProviderEnvironmentWithFieldSecret(instance.environment, field, secret)); }; const removeEnvironmentField = (field: ProviderEnvironmentField) => { updateEnvironment(providerEnvironmentWithoutNames(instance.environment, new Set([field.name]))); }; const titleIconNode = ( ); const titleTailNode = headerAction ? ( {headerAction} ) : null; const versionCodeNode = versionLabel ? ( {versionLabel} ) : null; const statusDotNode = statusKey === "warning" || statusKey === "error" ? ( ) : null; const needsAttention = statusKey === "warning" || statusKey === "error"; const statusDiagnostic = hasCompatibilityWarning && needsAttention ? summary.detail : null; const inlineStatusDetail = hasCompatibilityWarning ? compatibility?.status === "broken" ? "Incompatible" : compatibility?.status === "unsupported" ? "Unsupported" : "Limited support" : summary.detail; const editorStatusNode = isAuthenticated && authEmail ? ( <> {needsAttention ? statusDotNode : null} Authenticated as {authLabel ? · {authLabel} : null} {inlineStatusDetail ? ( · {inlineStatusDetail} ) : null} ) : ( <> {statusDotNode} {summary.headline} {inlineStatusDetail ? ( · {inlineStatusDetail} ) : null} ); const versionAdvisoryNode = versionAdvisory ? ( {updateProgress ? ( ) : ( )} } /> } /> {updateProgress ? "Updating" : versionAdvisory.title}

{versionAdvisory.title}

{versionAdvisory.detail}

{onRunVersionAction ? ( ) : null} {updateProgress || updateProblem ? (

{updateProgress ?? updateProblem}

) : null} {onRunVersionAction && updateCommand ? (
or, update manually using
) : null} {updateCommand ? (
{updateCommand} copyToClipboard(updateCommand, { providerName: displayName })} aria-label="Copy update command" > } /> Copy command
) : null}
) : null; if (mode === "list") { return (
{projectOverride?.value !== undefined ? ( ) : null} {/* The policy refuses switching it on; switching it off stays the user's call. */} updateEnabled(Boolean(checked))} aria-label={`Enable ${displayName}`} />
); } const editorHeaderAction = (
{driverOption?.badgeLabel ? ( {driverOption.badgeLabel} ) : null} {versionCodeNode} {versionAdvisoryNode} {titleTailNode} {onDelete ? ( ) : null}
); // Provider status gets its own row instead of hanging under the name field. const statusContent = ( <>
{editorStatusNode}
{urlAuthAction && onAcceptUrlAuth ? (

{urlAuthAction.message}

{urlAuthAction.url}
) : null} ); const runtimeFields = driverOption ? ( ) : ( This instance uses {String(instance.driver)}, which is not available in this build. Its configuration is preserved.
} /> ); return ( <> } /> {setup || environmentFields.length > 0 ? ( {setup} {environmentFields.length > 0 ? (
{environmentFields.map((field) => ( ))}
) : null}
) : null} {instance.driver === "codex" && readCodexSetupMode(instance.config) === "managed" ? (
{runtime ?? runtimeFields}
) : !driverOption || deriveProviderSettingsFields(driverOption).length > 0 ? ( {runtimeFields} ) : null} {instanceLocks?.wholeEnvironment ? ( {instanceLocks.reason} ) : null}
{environmentId !== undefined && liveProvider?.driver === "acpRegistry" ? ( ) : null} {driverOption !== undefined ? (

Model preferences and custom models are saved on the selected environment and shared across connected devices.

) : null} ); }