export interface OwuiConnection { url: string; path?: string; type?: string | null; auth_type?: string | null; key?: string | null; headers?: Record | string | null; forward_cookies?: boolean; config?: Record | null; info?: { id?: string; name?: string; [k: string]: unknown; } | null; [k: string]: unknown; } /** OpenWebUI fills these per call (utils/headers.py, shared by MCP and OpenAPI connections). */ export declare const CHAT_HEADERS: Record; export declare const TESTED_OWUI: string[]; /** OpenWebUI's own tools as the Filter's guard_builtin_tools names them (search_web/fetch_url are WebSearch/WebFetch). */ export declare const BUILTIN_LABELS: Record; export interface PlannedServer { name: string; type: 'mcp-http' | 'openapi'; url: string; specPath?: string; /** Header values as the gateway config writes them: secrets as ${VAR}. */ headers: Record; /** VAR → secret value, for .env. */ env: Record; /** The connection's index in OpenWebUI's list, its original and its replacement. */ index: number; original: OwuiConnection; routed: OwuiConnection; } export interface Skipped { index: number; id: string; reason: string; } export interface Plan { servers: PlannedServer[]; skipped: Skipped[]; already: { index: number; name: string; }[]; } /** Where a routed connection points: `/mcp/` or `/openapi/`. */ export declare function routedName(conn: OwuiConnection, gatewayUrl: string): string | undefined; export declare function planConnections(conns: OwuiConnection[], opts: { gatewayUrl: string; gatewayToken: string; gatewayInDocker: boolean; taken?: Iterable; earlierGateways?: string[]; }): Plan; export declare function parseEnv(text: string): Record; export interface SetupState { owuiUrl: string; gatewayUrl: string; runtime: 'docker' | 'local'; network?: string; createdNetwork?: boolean; container?: string; port: number; project: string; package: string; version: string; pid?: number; } export declare function composeFile(s: SetupState, pkgFile?: string, user?: string): string; export declare class OwuiError extends Error { readonly status: number; constructor(status: number, message: string); } export declare class Owui { readonly base: string; private token; constructor(base: string, token: string); static signin(base: string, email: string, password: string): Promise; req(method: string, path: string, body?: unknown): Promise; connections(): Promise; setConnections(list: OwuiConnection[]): Promise; /** OpenWebUI connects to the server itself, from where it runs: the path a chat will take. */ verify(conn: OwuiConnection): Promise; } export declare function connect(url: string, email: string | undefined, env?: NodeJS.ProcessEnv): Promise; export interface OwuiContainer { id: string; name: string; networks: string[]; } export interface CheckLine { status: 'ok' | 'fail' | 'warn' | 'info'; text: string; } /** Two chats the gateway judges for real: one where a fetched page asks to send the chat out, one where the person * asks for a page themselves. In `audit` the first is let through and answers `wouldRefuse`. */ export declare function canary(port: number, token: string): Promise; export declare function check(owui: Owui, dir: string): Promise; export declare function printCheck(lines: CheckLine[], write?: (m: string) => void): boolean; export interface SetupOptions { url: string; dir: string; email?: string; gatewayUrl?: string; network?: string; container?: string; local?: boolean; port: number; project: string; /** npm spec or a local .tgz (tests, unpublished builds). */ package?: string; start: boolean; dryRun: boolean; } /** Tests start the gateway in-process instead of Docker or a child process. */ export interface SetupHooks { start?: (state: SetupState, dir: string, env: Record) => Promise; } export declare function setup(o: SetupOptions, owui: Owui, log?: (m: string) => void, hooks?: SetupHooks): Promise; export declare function undo(owui: Owui, dir: string, log?: (m: string) => void): Promise; export declare function runOpenwebuiCli(argv: string[]): Promise; //# sourceMappingURL=openwebui-setup.d.ts.map