import type { IAddonHttpRoute, IAddonRouteProvider } from '../interfaces/addon-routes.js';
/**
 * Cross-process bridge envelope returned by the cap's `invoke` method.
 * The hub's Fastify catch-all reads this and reproduces the intent
 * onto the real reply (status, headers, body, or redirect).
 */
export interface AddonRouteInvokeRequest {
    readonly method: string;
    readonly path: string;
    readonly params: Record<string, string>;
    readonly query: Record<string, string>;
    readonly body: unknown;
    readonly headers: Record<string, string>;
    readonly user?: {
        readonly id: string;
        readonly username: string;
        readonly isAdmin: boolean;
    };
    readonly scopedToken?: unknown;
}
export interface AddonRouteReplyEnvelope {
    status: number;
    headers: Record<string, string>;
    redirectUrl: string | null;
    body?: unknown;
    contentType?: string;
}
/**
 * Build an `IAddonRouteProvider` from a list of routes. Implements
 * both the operator-facing `getRoutes` (returning route descriptors
 * minus the handlers, which can't cross JSON) and the framework-
 * private `invoke` method that the hub calls when this provider lives
 * in a forked worker.
 *
 * Co-located addons use the returned `getRoutes` directly because
 * their handlers don't need to cross any wire. The `invoke` method
 * is present anyway so the bridge code on the hub is uniform — it
 * doesn't need to switch on "local vs remote provider" at the call
 * site.
 *
 * Example:
 *   const routes: IAddonHttpRoute[] = [
 *     { method: 'GET', path: '/start', access: 'public', handler: this.handleStart },
 *   ]
 *   return [
 *     {
 *       capability: addonRoutesCapability,
 *       provider: buildAddonRouteProvider('auth-oidc', routes),
 *     },
 *   ]
 */
export declare function buildAddonRouteProvider(id: string, routes: readonly IAddonHttpRoute[]): IAddonRouteProvider & {
    invoke(input: AddonRouteInvokeRequest): Promise<AddonRouteReplyEnvelope>;
};
//# sourceMappingURL=build-addon-route-provider.d.ts.map