import type { SystemTaskJsonObject } from '@happier-dev/protocol';
import { type InteractiveSystemTaskKind } from '../interactiveTaskKinds.js';
import { type SystemTaskSshConnectionConfig } from './relayRuntimeKinds.js';
type RemoteCommandResult = Readonly<{
    ok: boolean;
    data: Record<string, unknown>;
}>;
type CanonicalRemoteHostTrustPromptKind = 'ssh.trustHost' | 'ssh.replaceHostKey';
type RemoteHostTrustPromptKind = CanonicalRemoteHostTrustPromptKind | 'sshHostTrust';
type RemoteSshAuth = Readonly<{
    mode: 'agent';
}> | Readonly<{
    mode: 'keyFile';
    privateKeyPath: string;
}>;
export interface RemoteBootstrapMachineParams {
    ssh: SystemTaskSshConnectionConfig;
    relay: Readonly<{
        relayUrl: string;
        webappUrl?: string;
        publicRelayUrl?: string;
    }>;
    channel?: 'stable' | 'preview' | 'dev';
    serviceMode?: 'user' | 'none';
    knownHostsMode?: 'app' | 'system';
    relayRuntime?: Readonly<{
        enabled: boolean;
        mode?: 'user' | 'system';
        env?: Record<string, string>;
        selfHostRelayBinaryOverride?: string;
    }>;
    promptResolution?: Readonly<{
        hostTrust?: Readonly<{
            kind: 'ssh.trustHost' | 'ssh.replaceHostKey';
            fingerprint: string;
            existingFingerprint?: string | null;
        }>;
        authApproval?: Readonly<{
            publicKey: string;
        }>;
    }>;
}
export type RemoteHostTrustResolution = Readonly<{
    status: 'trusted';
}> | Readonly<{
    status: 'prompt';
    promptKind: RemoteHostTrustPromptKind;
    promptMessage: string;
    promptData: SystemTaskJsonObject;
    accept: () => Promise<void>;
    decline?: () => Promise<void>;
}>;
export type RemoteSshBootstrapMachineDeps = Readonly<{
    resolveHostTrust: (params: Readonly<{
        ssh: SystemTaskSshConnectionConfig;
        knownHostsMode: 'app' | 'system';
    }>) => Promise<RemoteHostTrustResolution>;
    installRemoteCli: (params: Readonly<{
        parsed: RemoteBootstrapMachineParams;
        auth: RemoteSshAuth;
        knownHostsMode: 'app' | 'system';
    }>) => Promise<void>;
    approveLocalAuthRequest: (params: Readonly<{
        publicKey: string;
        parsed: RemoteBootstrapMachineParams;
    }>) => Promise<void>;
    runRemoteCommand: (params: Readonly<{
        label: 'auth.status' | 'server.configure' | 'auth.request' | 'auth.wait' | 'daemon.service.install' | 'daemon.service.start' | 'relay.runtime.install';
        parsed: RemoteBootstrapMachineParams;
        auth: RemoteSshAuth;
        knownHostsMode: 'app' | 'system';
        data?: Record<string, unknown>;
    }>) => Promise<RemoteCommandResult>;
}>;
export declare function createRemoteSshBootstrapMachineTaskKind(deps: RemoteSshBootstrapMachineDeps): InteractiveSystemTaskKind<Readonly<{
    publicKey: string;
    machineId: string | null;
    relayRuntime?: Readonly<{
        relayUrl: string;
        mode: 'user' | 'system';
    }>;
}>>;
export declare function parseRemoteBootstrapMachineParams(params: unknown): RemoteBootstrapMachineParams;
export declare function redactRemoteBootstrapPayload(params: Record<string, unknown>): SystemTaskJsonObject;
export {};
//# sourceMappingURL=remoteSshBootstrapMachineKind.d.ts.map