/** Same-origin HTTP bridge used by the plugin's browser settings card. */ import type { IncomingHttpHeaders, IncomingMessage, ServerResponse } from 'node:http'; /** Exact same-origin route owned by this plugin. */ export declare const SETTINGS_PATH = "/lemoncat7-web-search/settings"; /** Credential status safe to render in a browser. */ export interface CredentialStatus { readonly configured: boolean; readonly writable: boolean; } /** Complete browser settings snapshot; it never contains credential values. */ export interface BrowserSettingsSnapshot { readonly config: unknown; readonly credentials: { readonly brave: CredentialStatus; readonly tavily: CredentialStatus; readonly gemini: CredentialStatus; }; } /** Safe summary returned after exercising one provider with a real query. */ export interface SettingsTestResult { readonly provider: string; readonly resultCount: number; readonly durationMs: number; readonly firstTitle?: string | undefined; } export interface EngineProbeResult { readonly name: string; readonly categories: readonly string[]; readonly enabledByDefault: boolean; readonly tested: boolean; readonly available: boolean; readonly resultCount: number; readonly truncated: boolean; readonly durationMs: number; readonly error?: string; } /** Server operations exposed through the same-origin settings route. */ export interface SettingsApi { readonly read: () => Promise; readonly write: (config: unknown, apiKey: string | undefined) => Promise; readonly test: (config: unknown, apiKey: string | undefined) => Promise; readonly discoverEngines: (config: unknown, query: string) => Promise; } interface RequestHeaders { readonly headers: IncomingHttpHeaders; } /** Browser same-host requests, or the official Desktop origin on loopback. */ export declare function isTrustedSettingsRequest(request: RequestHeaders, requireOrigin: boolean): boolean; /** Build the GET/PUT route handler without exposing DSH services to HTTP code. */ export declare function settingsHandler(api: SettingsApi): (request: IncomingMessage, response: ServerResponse) => Promise; export {};