import { AuthStorage, type LocalEndpoint } from "@kenkaiiii/gg-core";
/** What the caller supplies when adding an endpoint. */
export interface LocalEndpointInput {
    label?: string;
    baseUrl: string;
    apiKey?: string;
}
export declare class LocalEndpointError extends Error {
}
/**
 * Where this store reads and writes. Both default to the real user's files;
 * tests inject a temp directory so they never touch `~/.gg` — note that
 * overriding `$HOME` is NOT a portable way to do that, since `os.homedir()`
 * reads `USERPROFILE` on Windows.
 */
export interface LocalEndpointStoreOptions {
    /** Path to the gg-app settings file (defaults to `~/.gg/gg-app.json`). */
    settingsFile?: string;
    /** Auth storage holding the `local:<id>` credentials. */
    auth?: AuthStorage;
}
/**
 * Normalize a user-typed URL into the OpenAI-compatible base we call.
 * Accepts `host:port`, a bare root, or a full `/v1` URL, and tolerates a pasted
 * `/v1/chat/completions` or `/v1/models` (people copy from docs).
 */
export declare function normalizeLocalBaseUrl(input: string): string;
/** User-added endpoints, in insertion order. Never throws on a corrupt file. */
export declare function listCustomEndpoints(options?: LocalEndpointStoreOptions): Promise<LocalEndpoint[]>;
/** Well-known endpoints first, then the user's own — the probe/scan order. */
export declare function listAllEndpoints(options?: LocalEndpointStoreOptions): Promise<LocalEndpoint[]>;
/**
 * Add a custom endpoint and write its `local:<id>` credential. Re-adding the
 * same host updates it (that's how a user fixes a mistyped key) instead of
 * creating a second row for the same server.
 */
export declare function addCustomEndpoint(input: LocalEndpointInput, options?: LocalEndpointStoreOptions): Promise<LocalEndpoint>;
/**
 * Remove a custom endpoint and its credential. Built-in endpoints can't be
 * removed (they're discovered, not configured) — that's an error, not a no-op,
 * so a UI bug doesn't silently do nothing.
 */
export declare function removeCustomEndpoint(id: string, options?: LocalEndpointStoreOptions): Promise<void>;
/**
 * Make sure every endpoint we're about to serve models from has a credential
 * carrying its baseUrl — otherwise `stream()` has no endpoint to talk to.
 * Called after each scan, so a fresh install works with zero setup.
 */
export declare function syncEndpointCredentials(endpoints: readonly LocalEndpoint[], options?: LocalEndpointStoreOptions): Promise<void>;
//# sourceMappingURL=local-endpoint-store.d.ts.map