export type CustomModelProtocol = 'openai-completions' | 'openai-responses' | 'anthropic-messages'; export type CustomModelKeyChange = 'keep' | 'replace'; /** Non-secret projection of one model in a user-declared provider. */ export interface CustomModelConfigEntry { readonly sourceIndex: number; readonly provider?: string; readonly modelIndex?: number; readonly providerModelCount?: number; readonly revision?: number; readonly catalog?: boolean; readonly model: string; readonly baseUrl: string; /** Model display name, serialized as models[].name; not the provider name. */ readonly description?: string; readonly protocol: string; readonly contextWindow?: number; readonly maxTokens?: number; readonly apiKeyConfigured: boolean; } /** Validated values supplied by the TUI form. */ export interface CustomModelConfigInput { /** Stable provider ID shared with Web; required when creating a model. */ readonly provider?: string; /** Creating a provider refuses an existing ID; adding a model reuses it. */ readonly providerMode?: 'create' | 'existing'; readonly model: string; readonly baseUrl: string; /** Model display name, serialized as models[].name; empty inherits the model ID. */ readonly description: string; /** Effective protocol shown in the form; catalog defaults need no stored override. */ readonly protocol: string; /** Explicit protocol selection overrides a catalog route's native default. */ readonly protocolOverride?: boolean; /** Appending alone preserves shared settings; explicit form edits may update them. */ readonly providerFieldsChanged?: boolean; readonly contextWindow?: number; readonly maxTokens?: number; readonly keyChange: CustomModelKeyChange; readonly apiKey?: string; } export interface CustomModelSettingsStore { readonly path: string; list(): readonly CustomModelConfigEntry[]; /** Include inherited catalog models without writing their defaults to disk. */ listResolved?(): Promise; readApiKey(target: CustomModelConfigEntry): string | undefined | Promise; write(input: CustomModelConfigInput, target?: CustomModelConfigEntry): Promise; remove(target: CustomModelConfigEntry): Promise; } type ProfileOp = { op: 'set'; path: readonly string[]; value: unknown; } | { op: 'unset'; path: readonly string[]; }; /** Host-only operations; credentials never enter model list projections. */ export interface CustomModelStoreHost { snapshot(): { providers: Record; revision: number | undefined; catalog: ReadonlySet; }; mutate(ops: readonly ProfileOp[], revision?: number): Promise; readCredential(ref: string): Promise; writeCredential(ref: string, value: string): Promise; removeCredential(ref: string): Promise; /** Installed catalog metadata, without querying a remote endpoint or credentials. */ catalogModels?(provider: string): Promise[]>; } /** Use native provider settings for persistence, validation, locking, and live activation. */ export declare function createCustomModelSettingsStore(path: string, host: CustomModelStoreHost): CustomModelSettingsStore; export {}; //# sourceMappingURL=customModelSettings.d.ts.map