import type { DefineSandboxOptions } from '../sandbox.js';
import type { SandboxClientConfig, SandboxKitDescriptor } from '../sandbox-kit.js';
import { type GenuiSandboxKitApi } from './plugin.js';
export interface SandboxKitDiscoveryOptions {
    /** The app root (relative paths below resolve against it). */
    root: string;
    /**
     * The kit's name (`genuiSandboxKit({ name })`): its manifest keys. `descriptor` and `plugin` are
     * given for that kit already. Unnamed: the app's one kit.
     */
    name?: string;
    /** The descriptor the dev plugin (or a docs generator) writes. */
    descriptor?: string;
    /** The production manifest, and the directory its `file`s are relative to. */
    manifest?: {
        file: string;
        outDir: string;
    };
    /** The plugin's live API, when Vite runs in this process (the Adonis dev server). */
    plugin?: () => GenuiSandboxKitApi | undefined;
    /**
     * Production: the manifest first. Otherwise the in-process dev server, else whichever of the dev
     * descriptor and the build's descriptor was written last. Default: `NODE_ENV === 'production'`.
     */
    production?: boolean;
    /**
     * Explicit asset urls, over what is found: for an app whose Vite does not run in the server
     * process (an SPA built and served elsewhere), where the descriptor the assembler hook / codegen
     * writes has docs but no urls. `kitUrl`: the kit bundle (React, the components); `cssUrl`: the
     * compiled styles; `tailwindUrl`: the Tailwind browser runtime.
     */
    kitUrl?: string;
    cssUrl?: string;
    tailwindUrl?: string;
}
export interface SandboxKitDiscovery {
    /** The kit's name, for a named kit. */
    readonly name?: string;
    /** What is known now: docs, theme names, asset urls — `null` when nothing was found. */
    descriptor(): SandboxKitDescriptor | null;
}
/** Find the kit (re-read when the files change — dev rewrites them). */
export declare function sandboxKitDiscovery(options: SandboxKitDiscoveryOptions): SandboxKitDiscovery;
/** The server's sandbox options, resolved against what was discovered. */
export interface ResolvedSandboxServer {
    /** For `defineSandbox`: the kit's docs and the theme's names read from the discovery each time. */
    define: DefineSandboxOptions;
    /** For `GET <agent>/config` → `genui.sandbox`. */
    client(): SandboxClientConfig;
}
/**
 * `sandbox: { kit: true }` (or `true`) as the definition and the browser need it: docs and theme
 * names from the discovery, asset urls for the client. What was asked for but not found is left out
 * of what the browser is told (and of what the model is told), so a missing build degrades to the
 * plain sandbox.
 */
export declare function resolveSandboxServer(sandbox: true | DefineSandboxOptions, discovery: SandboxKitDiscovery): ResolvedSandboxServer;
//# sourceMappingURL=discover.d.ts.map