export declare const WEB_BRIDGE_SCHEMA_VERSION: 1;
export declare const WEB_BRIDGE_NATIVE_HOST_NAME = "io.ohmykimi.web_bridge";
export declare const WEB_BRIDGE_MCP_SERVER_NAME = "omk-web-bridge";
export declare const WEB_BRIDGE_MAX_TEXT_CHARS = 120000;
export declare const WEB_BRIDGE_MAX_PAYLOAD_BYTES = 1000000;
export type WebBridgeReadMethod = "bridge.ping" | "bridge.status" | "bridge.capabilities" | "browser.tabs.list" | "browser.page.read" | "browser.selection.read" | "browser.dom.query" | "browser.screenshot.capture" | "orchestration.context.write";
export type WebBridgeMutationMethod = "browser.action.request";
export type WebBridgeMethod = WebBridgeReadMethod | WebBridgeMutationMethod;
export type WebBridgeActionKind = "click" | "formFill" | "download" | "upload" | "post" | "clipboardWrite" | "navigate";
export interface WebBridgeApproval {
    token: string;
    expiresAt: string;
    method: WebBridgeMutationMethod;
    target: string;
    argsDigest: string;
}
export interface WebBridgeRequestEnvelope<TParams = unknown> {
    schemaVersion: typeof WEB_BRIDGE_SCHEMA_VERSION;
    requestId: string;
    method: WebBridgeMethod;
    params?: TParams;
    origin?: string;
    nonce?: string;
    approval?: WebBridgeApproval;
}
export interface WebBridgeError {
    code: "invalid_schema" | "unknown_method" | "payload_too_large" | "unsafe_mutation" | "approval_required" | "not_connected" | "internal_error";
    message: string;
    retryable?: boolean;
}
export interface WebBridgeResponseEnvelope<TResult = unknown> {
    schemaVersion: typeof WEB_BRIDGE_SCHEMA_VERSION;
    requestId: string;
    ok: boolean;
    result?: TResult;
    error?: WebBridgeError;
}
export interface WebBridgeTabInfo {
    id: string | number;
    url?: string;
    title?: string;
    active?: boolean;
    windowId?: string | number;
}
export interface WebBridgePageMetadata {
    url?: string;
    title?: string;
    description?: string;
    language?: string;
    contentType?: string;
    capturedAt?: string;
    source?: "chrome-extension" | "native-host" | "mock" | "artifact";
    [key: string]: unknown;
}
export interface WebBridgeScreenshotRef {
    mimeType: "image/png" | "image/jpeg";
    bytes?: string;
    artifactPath?: string;
    redacted?: boolean;
}
export interface WebBridgePageSnapshot {
    tab?: WebBridgeTabInfo;
    tabs?: WebBridgeTabInfo[];
    metadata?: WebBridgePageMetadata;
    text?: string;
    selectedText?: string;
    dom?: string;
    screenshot?: WebBridgeScreenshotRef;
    warnings?: string[];
}
export interface WebBridgeCapabilities {
    schemaVersion: typeof WEB_BRIDGE_SCHEMA_VERSION;
    readOnlyDefault: true;
    supportsTabs: boolean;
    supportsPageText: boolean;
    supportsSelection: boolean;
    supportsDom: boolean;
    supportsScreenshot: boolean;
    supportsMutations: false;
    mutationsRequireApproval: true;
    forbiddenData: string[];
    methods: WebBridgeMethod[];
}
export declare function getDefaultWebBridgeCapabilities(): WebBridgeCapabilities;
export declare function isWebBridgeMethod(value: string): value is WebBridgeMethod;
export declare function isWebBridgeMutation(method: WebBridgeMethod): method is WebBridgeMutationMethod;
export declare function createWebBridgeErrorResponse(requestId: string, code: WebBridgeError["code"], message: string, options?: {
    retryable?: boolean;
}): WebBridgeResponseEnvelope;
export declare function createWebBridgeOkResponse<TResult>(requestId: string, result: TResult): WebBridgeResponseEnvelope<TResult>;
export declare function validateWebBridgeRequest(input: unknown): WebBridgeRequestEnvelope;
export declare function assertReadOnlyWebBridgeRequest(request: WebBridgeRequestEnvelope): void;
export declare function sanitizeWebBridgePageSnapshot(snapshot: WebBridgePageSnapshot): WebBridgePageSnapshot;
export declare function redactWebBridgeValue<T>(value: T): T;
export declare function truncateBridgeText(value: string | undefined, maxChars?: number): string | undefined;
