import type { ServiceRegistry } from '../../config/service-registry.js';
import { type FetchOutput, type FetchUrlResult } from '../../tools/fetch/index.js';
import type { FetchAuthInput, FetchInput } from '@pellux/goodvibes-sdk/platform/tools/fetch/schema';
import type { WebSearchEvidence, WebSearchProviderDescriptor, WebSearchResult } from '@pellux/goodvibes-sdk/platform/web-search/types';
type EnvMap = Record<string, string | undefined>;
type FetchExecutor = (input: FetchInput) => Promise<FetchOutput>;
export interface SearchProviderContext {
    readonly fetcher?: FetchExecutor;
    readonly env: EnvMap;
    readonly serviceRegistry: Pick<ServiceRegistry, 'get'>;
}
export interface SearchProviderConfig {
    readonly id: string;
    readonly label: string;
    readonly note: string;
    readonly envKeyCandidates?: readonly string[];
    readonly serviceName?: string;
    readonly baseUrlEnvCandidates?: readonly string[];
    readonly defaultBaseUrl?: string;
    readonly requiresAuth?: boolean;
}
export interface JsonRequestConfig {
    readonly url: string;
    readonly method?: 'GET' | 'POST';
    readonly params?: Record<string, string>;
    readonly body?: Record<string, unknown>;
    readonly headers?: Record<string, string>;
    readonly service?: string;
    readonly auth?: FetchAuthInput;
    readonly fetcher?: FetchExecutor;
    readonly maxContentLength?: number;
}
export interface JsonRequestResult<T = unknown> {
    readonly payload: T;
    readonly response: FetchUrlResult;
}
export declare function resolveDomain(url: string): string | undefined;
export declare function trimSnippet(value: unknown, limit?: number): string | undefined;
export declare function makeEvidence(url: string, content: unknown, metadata?: Record<string, unknown>, extract?: 'raw' | 'text' | 'json' | 'markdown' | 'readable' | 'code_blocks' | 'links' | 'metadata' | 'structured' | 'tables' | 'pdf' | 'summary'): WebSearchEvidence[] | undefined;
export declare function withInlineApiKey(env: EnvMap, envKeys: readonly string[] | undefined, headerName: string): FetchAuthInput | undefined;
export declare function withInlineBearer(env: EnvMap, envKeys: readonly string[] | undefined): FetchAuthInput | undefined;
export declare function hasConfiguredCredential(serviceRegistry: Pick<ServiceRegistry, 'get'>, env: EnvMap, envKeys: readonly string[] | undefined, serviceName?: string): boolean;
export declare function resolveBaseUrl(serviceRegistry: Pick<ServiceRegistry, 'get'>, env: EnvMap, envKeys: readonly string[] | undefined, serviceName: string | undefined, defaultBaseUrl?: string): string | null;
export declare function buildDescriptor(config: SearchProviderConfig, context: SearchProviderContext): WebSearchProviderDescriptor;
export declare function executeJsonRequest<T = unknown>(config: JsonRequestConfig): Promise<JsonRequestResult<T>>;
export declare function resultFromRecord(providerId: string, rank: number, record: Record<string, unknown>, options?: {
    readonly urlKeys?: readonly string[];
    readonly titleKeys?: readonly string[];
    readonly snippetKeys?: readonly string[];
    readonly displayUrlKeys?: readonly string[];
    readonly evidenceKeys?: readonly string[];
    readonly metadata?: Record<string, unknown>;
}): WebSearchResult | null;
export declare function firstString(record: Record<string, unknown>, keys: readonly string[]): string | undefined;
export {};
//# sourceMappingURL=shared.d.ts.map