import type { Db } from "@rudderhq/db";
import { invites } from "@rudderhq/db";
import type { DeploymentExposure, DeploymentMode } from "@rudderhq/shared";
import { PERMISSION_KEYS } from "@rudderhq/shared";
import type { Request } from "express";
import { JoinDiagnostic } from "./access.helpers.js";
export declare function normalizeAgentDefaultsForJoin(input: {
    agentRuntimeType: string | null;
    defaultsPayload: unknown;
    deploymentMode: DeploymentMode;
    deploymentExposure: DeploymentExposure;
    bindHost: string;
    allowedHostnames: string[];
}): {
    normalized: Record<string, unknown> | null;
    diagnostics: JoinDiagnostic[];
    fatalErrors: string[];
};
export declare function toInviteSummaryResponse(req: Request, token: string, invite: typeof invites.$inferSelect): {
    id: string;
    orgId: string | null;
    inviteType: string;
    allowedJoinTypes: string;
    expiresAt: Date;
    onboardingPath: string;
    onboardingUrl: string;
    onboardingTextPath: string;
    onboardingTextUrl: string;
    skillIndexPath: string;
    skillIndexUrl: string;
    inviteMessage: string | null;
};
export declare function buildOnboardingDiscoveryDiagnostics(input: {
    apiBaseUrl: string;
    deploymentMode: DeploymentMode;
    deploymentExposure: DeploymentExposure;
    bindHost: string;
    allowedHostnames: string[];
}): JoinDiagnostic[];
export declare function buildOnboardingConnectionCandidates(input: {
    apiBaseUrl: string;
    bindHost: string;
    allowedHostnames: string[];
}): string[];
export declare function buildInviteOnboardingManifest(req: Request, token: string, invite: typeof invites.$inferSelect, opts: {
    deploymentMode: DeploymentMode;
    deploymentExposure: DeploymentExposure;
    bindHost: string;
    allowedHostnames: string[];
}): {
    invite: {
        id: string;
        orgId: string | null;
        inviteType: string;
        allowedJoinTypes: string;
        expiresAt: Date;
        onboardingPath: string;
        onboardingUrl: string;
        onboardingTextPath: string;
        onboardingTextUrl: string;
        skillIndexPath: string;
        skillIndexUrl: string;
        inviteMessage: string | null;
    };
    onboarding: {
        instructions: string;
        inviteMessage: string | null;
        recommendedAdapterType: string;
        requiredFields: {
            requestType: string;
            agentName: string;
            agentRuntimeType: string;
            capabilities: string;
            agentDefaultsPayload: string;
        };
        registrationEndpoint: {
            method: string;
            path: string;
            url: string;
        };
        claimEndpointTemplate: {
            method: string;
            path: string;
            body: {
                claimSecret: string;
            };
        };
        connectivity: {
            deploymentMode: "local_trusted" | "authenticated";
            deploymentExposure: "private" | "public";
            bindHost: string;
            allowedHostnames: string[];
            connectionCandidates: string[];
            diagnostics: JoinDiagnostic[];
            guidance: string;
        };
        textInstructions: {
            path: string;
            url: string;
            contentType: string;
        };
        skill: {
            name: string;
            path: string;
            url: string;
            installPath: string;
        };
    };
};
export declare function buildInviteOnboardingTextDocument(req: Request, token: string, invite: typeof invites.$inferSelect, opts: {
    deploymentMode: DeploymentMode;
    deploymentExposure: DeploymentExposure;
    bindHost: string;
    allowedHostnames: string[];
}): string;
export declare function extractInviteMessage(invite: typeof invites.$inferSelect): string | null;
export declare function mergeInviteDefaults(defaultsPayload: Record<string, unknown> | null | undefined, agentMessage: string | null): Record<string, unknown> | null;
export declare function requestIp(req: Request): string;
export declare function inviteExpired(invite: typeof invites.$inferSelect): boolean;
export declare function isLocalImplicit(req: Request): boolean;
export declare function resolveActorEmail(db: Db, req: Request): Promise<string | null>;
export declare function grantsFromDefaults(defaultsPayload: Record<string, unknown> | null | undefined, key: "human" | "agent"): Array<{
    permissionKey: (typeof PERMISSION_KEYS)[number];
    scope: Record<string, unknown> | null;
}>;
export type JoinRequestManagerCandidate = {
    id: string;
    role: string;
    reportsTo: string | null;
};
export declare function resolveJoinRequestAgentManagerId(candidates: JoinRequestManagerCandidate[]): string | null;
export declare function isInviteTokenHashCollisionError(error: unknown): boolean;
export declare function isAbortError(error: unknown): boolean;
export type InviteResolutionProbe = {
    status: "reachable" | "timeout" | "unreachable";
    method: "HEAD";
    durationMs: number;
    httpStatus: number | null;
    message: string;
};
export declare function probeInviteResolutionTarget(url: URL, timeoutMs: number): Promise<InviteResolutionProbe>;
//# sourceMappingURL=access-onboarding.helpers.d.ts.map