/** * The settings that belong to a provider rather than to you: its address, and which of its models * you use. * * Reported: "for ollama i wanted to change the base url but it still stick to the already set * ollama, and does not allow me to update/edit it". Both halves were true, for two separate * reasons. * * `/provider ollama` rebuilt the session with `baseURL: PROVIDERS.ollama.baseURL` — the built-in * localhost address, written in as a literal. Any endpoint that had been configured, and * OLLAMA_BASE_URL along with it, was discarded by the act of naming the provider. And the whole * setting was one global slot, so it could only ever be correct for one provider: pointing it at * a remote Ollama broke OmniRoute, and switching back silently threw the Ollama address away. * * An endpoint is not a global preference. It is one provider's address, so it is stored per * provider and resolved per provider. The source is returned alongside the URL because the * question that arrives with this bug is never only "what is it" — it is "why is it that, when I * set something else". * * The model turned out to be the same shape of mistake, reported the same way: "koneck keeps * reverting the model to codellama". `codellama` is the Ollama provider definition's hardcoded * default. Naming a provider set the model to that default and wrote it to disk, while `/model` * changed only the running session and persisted nothing — so any chosen model survived until the * next provider switch or the next start, whichever came first. A model belongs to a provider too: * qwen3-coder:30b is meaningless to Anthropic and claude-sonnet-4.5 is meaningless to Ollama. */ /** One place a setting can come from: a project file, the store, `~/.koneckrc`. */ export interface EndpointLayer { /** Which provider this layer is describing, if it says. */ provider?: string; /** The legacy single-slot endpoint. */ baseURL?: string; /** Endpoints by provider name — what /endpoint and the settings pane now write. */ endpoints?: Record; /** The legacy single model. */ model?: string; /** Models by provider name — what /model and the model picker now write. */ models?: Record; } export interface ResolvedEndpoint { url: string; /** Where it came from, phrased for a person reading it in the terminal. */ source: string; } export interface ResolveEndpointOptions { /** `--base-url`, or anything else said explicitly for this one run. */ override?: string | undefined; /** The provider's own address: a providers.json entry, else the built-in. */ fallback: string; /** The provider-specific variable, e.g. `OLLAMA_BASE_URL`. */ baseURLEnv?: string | undefined; env?: NodeJS.ProcessEnv; /** Whether `fallback` came from the user's own providers.json, for an honest label. */ fallbackIsUserDeclared?: boolean; } /** How a layer is described when it turns out to be the answer. */ export declare const LAYER_NAMES: readonly ["this project", "your settings", "~/.koneckrc"]; /** * The endpoint in force for a provider, and where it came from. * * Order: what was said for this run, then what was saved for this provider, then a legacy * `baseURL` that applies to it, then the environment, then the provider's own address. Saved * beats environment deliberately — typing `/endpoint` is a more recent and more specific act * than a variable exported into a shell weeks ago, and the setting names the provider. */ export declare function resolveEndpoint(provider: string, layers: readonly EndpointLayer[], opts: ResolveEndpointOptions): ResolvedEndpoint; /** * A typed endpoint, tidied, or the reason it cannot be used. * * `192.168.1.50:11434` is what somebody types when asked for a host, and refusing it over a * missing scheme is pedantry — http is the only thing it could mean. A missing `/v1` is a * different matter: it is a real path that some gateways use and some do not, so it is mentioned * rather than added. */ export declare function normaliseEndpoint(raw: string): { url?: string; problem?: string; note?: string; }; /** The config with one provider's endpoint set, or removed when the URL is empty. */ export declare function withEndpoint(config: T, provider: string, url: string | undefined): T; /** Every endpoint saved anywhere, nearest layer winning, for showing the whole picture at once. */ export declare function savedEndpoints(layers: readonly EndpointLayer[]): Record; /** * The source in a few characters, for a table row that has no space for a sentence. * * The full phrasing belongs in /endpoint, where it is the answer to a question. In the settings * pane it is a column, and a column that wraps breaks the row beneath it. */ export declare function shortSource(source: string): string; /** * Which model to use for a provider, and where the choice came from. * * Same order as the endpoint, and for the same reason: what was said for this run, then what was * saved against this provider, then a legacy single setting that applies to it, then the * provider's own default. The default is last because it is a guess written into KONECK — for * Ollama it is `codellama`, which almost nobody is running. */ export declare function resolveModelChoice(provider: string, layers: readonly EndpointLayer[], fallback: string, override?: string): { model: string; source: string; }; /** The config with one provider's model set, or removed when the model is empty. */ export declare function withModel(config: T, provider: string, model: string | undefined): T; /** Every model saved anywhere, nearest layer winning. */ export declare function savedModels(layers: readonly EndpointLayer[]): Record; //# sourceMappingURL=endpoints.d.ts.map