import type { CloudConfig, EnvironmentType } from '@ts-cloud/core';
import type { OidcFetch } from '../auth';
import type { AuthorizationCapability, JsonValue } from '../control-plane';
import type { ReleaseDriverResolver } from '../release';
import type { DashboardUser } from './dashboard-auth';
export interface LocalDashboardServerOptions {
    host?: string;
    port?: number;
    cwd?: string;
    environment?: EnvironmentType;
    cliEntry?: string;
    verbose?: boolean;
    /**
     * Box mode: the dashboard runs ON the provisioned server. Data resolution and
     * operations execute against localhost (the {@link LocalBoxDriver}) instead of
     * reaching out over SSH/SSM.
     */
    box?: boolean;
    /** Explicit config for embedded/test callers; CLI callers load the project config. */
    config?: CloudConfig;
    /** Injectable OIDC transport for deterministic integration tests. */
    oidcFetch?: OidcFetch;
    /** Run the persistent deployment worker in this process. Defaults off in tests. */
    queueWorker?: boolean;
    /** Maximum number of operations this process may execute in parallel. */
    queueParallelism?: number;
    /** Resolve the provider-specific immutable activation primitive for release jobs. */
    releaseDriver?: ReleaseDriverResolver;
}
export interface LocalDashboardServer {
    url: string;
    server: ReturnType<typeof Bun.serve>;
}
export interface DashboardAction {
    id: string;
    label: string;
    description: string;
    command: string[];
    mutates: boolean;
    confirm?: string;
}
export declare function pruneDashboardTempRoots(root?: string, running?: (pid: number) => boolean): number;
export declare function dashboardMutationAuditPayload(method: string, path: string, input: unknown, status: number, durationMs: number): {
    [key: string]: JsonValue;
};
export declare function resolveOidcDashboardOrigin(host: string, port: number, env?: NodeJS.ProcessEnv): string | undefined;
export declare function resolveDashboardEnvironment(available: readonly string[], fallback: EnvironmentType, requested?: string | null): EnvironmentType;
/** Reject browser cross-site mutations while retaining header-light CLI access. */
export declare function isTrustedMutationRequest(req: Request): boolean;
export declare function sanitizeCloudConfig(config: CloudConfig): Record<string, any>;
export declare function dashboardActions(environment: EnvironmentType): DashboardAction[];
export declare function resolveDashboardAction(id: string, environment: EnvironmentType): DashboardAction | undefined;
export declare function runDashboardAction(action: DashboardAction, options: Required<Pick<LocalDashboardServerOptions, 'cwd' | 'cliEntry'>> & {
    signal?: AbortSignal;
    onOutput?: (kind: 'stdout' | 'stderr', chunk: string) => void;
    env?: Record<string, string>;
}): Promise<Record<string, any>>;
export declare function isBoxOnlyPage(pathname: string): boolean;
export declare function canOpenDashboardPage(pathname: string, user: DashboardUser & {
    capabilities?: AuthorizationCapability[];
    organizationSource?: string;
}): boolean;
export declare function startLocalDashboardServer(options?: LocalDashboardServerOptions): Promise<LocalDashboardServer>;
