/**
 * Install bundled Chrome extension artifacts into {resolveBinDir()}/browser-ext/.
 * Fixed path — gateway upgrades overwrite in place so Chrome sideload paths stay stable.
 */
export declare const BROWSER_EXT_REQUIRED_FILES: readonly ["manifest.json", "popup.html", "dist/background.js", "dist/content.js", "dist/popup.js"];
export type BrowserExtBundledFrom = 'npm-dist' | 'git-dev' | 'electron-asar' | 'env-override';
export interface BrowserExtInstallMeta {
    xopcVersion: string;
    manifestVersion: string;
    source: 'bundled';
    bundledFrom: BrowserExtBundledFrom;
    installedAt: string;
    installPath: string;
}
export interface BrowserExtDoctor {
    bundledAvailable: boolean;
    installed: boolean;
    xopcVersion: string;
    installedVersion?: string;
    manifestVersion?: string;
    extensionDir?: string;
    cacheDir: string;
    needsRefresh: boolean;
    needsChromeReload?: boolean;
    bundledFrom?: BrowserExtBundledFrom;
    runtimeExtensionVersion?: string;
}
export interface EnsureBrowserExtResult {
    extensionDir: string;
    xopcVersion: string;
    copied: boolean;
}
/** Validate a directory contains a loadable extension tree. */
export declare function validateBrowserExtLayout(dir: string): boolean;
/** Resolve the installed extension directory (fixed `browser-ext/` root). */
export declare function resolveInstalledExtensionPath(cacheDir: string, _meta: BrowserExtInstallMeta | null): string | null;
/**
 * Resolve the bundled extension source directory (read-only).
 */
export declare function resolveBundledBrowserExtDir(): Promise<{
    dir: string;
    bundledFrom: BrowserExtBundledFrom;
} | null>;
export declare function computeNeedsRefresh(params: {
    force?: boolean;
    bundledManifestVersion: string;
    installedPath: string | null;
    meta: BrowserExtInstallMeta | null;
}): boolean;
export declare function browserExtDoctor(opts?: {
    cacheDir?: string;
    runtimeExtensionVersion?: string;
}): Promise<BrowserExtDoctor>;
export declare function ensureBrowserExtensionArtifacts(opts?: {
    force?: boolean;
    cacheDir?: string;
}): Promise<EnsureBrowserExtResult>;
/**
 * Gateway startup hook: ensure artifacts when extension backend is enabled or prior install exists.
 */
export declare function ensureBrowserExtensionOnStartup(config: {
    agents?: {
        defaults?: {
            browser?: {
                backend?: string;
            };
        };
    };
}): Promise<void>;
export declare function readInstalledExtensionDir(cacheDir?: string): Promise<string | null>;
export type BrowserExtensionOpenAction = 'chrome' | 'folder' | 'both';
/**
 * Open chrome://extensions and/or reveal the installed extension folder on the gateway host.
 */
export declare function openBrowserExtensionInstallUi(opts: {
    action: BrowserExtensionOpenAction;
    cacheDir?: string;
}): Promise<{
    extensionDir: string;
}>;
