import type { CatalogApi } from "@opencode-ai/client/effect/api" import { Model } from "@opencode-ai/schema/model" import { Provider } from "@opencode-ai/schema/provider" import type { Effect, Types } from "effect" import type { Transform } from "./registration.js" export interface CatalogProviderRecord { readonly provider: Types.DeepMutable readonly models: ReadonlyMap> } export interface CatalogDraft { readonly provider: { list(): readonly CatalogProviderRecord[] get(providerID: string): CatalogProviderRecord | undefined update(providerID: string, update: (provider: Types.DeepMutable) => void): void remove(providerID: string): void } readonly model: { get(providerID: string, modelID: string): Types.DeepMutable | undefined update(providerID: string, modelID: string, update: (model: Types.DeepMutable) => void): void remove(providerID: string, modelID: string): void readonly default: { get(): { providerID: string; modelID: string } | undefined set(providerID: string, modelID: string): void } } } export interface CatalogDomain extends CatalogApi { readonly transform: Transform readonly reload: () => Effect.Effect }