/**
 * Deployment Orchestrator Service
 *
 * Bridges ProvisioningService (DigitalOcean API) with the Crewly node
 * provisioning script. Orchestrates the full deployment pipeline:
 * create Droplet → wait for ready → SSH provision → install Pro → register Cloud.
 *
 * Each phase is independently retriable and emits status events through
 * the DeploymentStatusService.
 *
 * @module services/provisioning/deployment-orchestrator.service
 */
import { type DeploymentConfig, type DeploymentResult, type SshCommandResult, type ISshExecutor, type IProvisioningService, type DeploymentApiKeys, type ProAddonConfig } from './deployment-orchestrator.types.js';
import type { DeploymentStatusService } from './deployment-status.service.js';
/**
 * Production SSH executor using Node.js child_process.exec.
 * Runs `ssh root@host 'command'` with standard options.
 */
export declare class ChildProcessSshExecutor implements ISshExecutor {
    /**
     * Execute a command on a remote host via SSH.
     *
     * @param host - Remote host IP or hostname
     * @param command - Shell command to execute remotely
     * @param timeoutMs - Maximum execution time (default: 300s)
     * @returns Command result with exit code, stdout, stderr
     */
    execute(host: string, command: string, timeoutMs?: number): Promise<SshCommandResult>;
}
/**
 * Orchestrates the full Crewly node deployment pipeline.
 *
 * Coordinates DigitalOcean Droplet creation with remote provisioning,
 * Pro addon installation, and Cloud registration. Each phase is tracked
 * independently and can be retried.
 *
 * @example
 * ```typescript
 * const orchestrator = new DeploymentOrchestratorService(
 *   provisioningService,
 *   statusService,
 * );
 * const result = await orchestrator.deployFullStack({
 *   dropletName: 'customer-node-1',
 *   apiKeys: { anthropicApiKey: 'sk-xxx' },
 *   customerId: 'cust_123',
 *   installPro: true,
 *   registerCloud: true,
 * });
 * ```
 */
export declare class DeploymentOrchestratorService {
    private readonly provisioningService;
    private readonly statusService;
    private readonly sshExecutor;
    /**
     * Create a new DeploymentOrchestratorService.
     *
     * @param provisioningService - DigitalOcean API wrapper for Droplet CRUD
     * @param statusService - Optional status tracking service for real-time updates
     * @param sshExecutor - Optional SSH executor (defaults to ChildProcessSshExecutor)
     */
    constructor(provisioningService: IProvisioningService, statusService?: DeploymentStatusService | null, sshExecutor?: ISshExecutor);
    /**
     * Execute the full-stack deployment pipeline.
     *
     * Orchestrates all phases: create Droplet → wait ready → provision base
     * → install OSS → (optional) install Pro → (optional) configure account
     * → (optional) register with Cloud.
     *
     * @param config - Deployment configuration
     * @returns Deployment result with phase details
     */
    deployFullStack(config: DeploymentConfig): Promise<DeploymentResult>;
    /**
     * Provision the base system on a remote Droplet.
     * Uploads and executes provision-crewly-node.sh via SSH.
     *
     * @param dropletIp - Public IP of the Droplet
     * @param apiKeys - Optional API keys to pass as environment variables
     * @param scriptPath - Path to the provisioning script (default: deploy/provision-crewly-node.sh)
     * @returns Human-readable result message
     * @throws {DeploymentError} On SSH or provisioning failure
     */
    provisionBase(dropletIp: string, apiKeys?: DeploymentApiKeys, scriptPath?: string): Promise<string>;
    /**
     * Install the Crewly OSS stack on a provisioned Droplet.
     *
     * @param dropletIp - Public IP of the Droplet
     * @returns Human-readable result message
     * @throws {DeploymentError} On SSH or installation failure
     */
    installOss(dropletIp: string): Promise<string>;
    /**
     * Install Pro-specific addon components on a provisioned Droplet.
     *
     * @param dropletIp - Public IP of the Droplet
     * @param proConfig - Pro addon configuration
     * @returns Human-readable result message
     * @throws {DeploymentError} On SSH or installation failure
     */
    installProAddon(dropletIp: string, proConfig: ProAddonConfig): Promise<string>;
    /**
     * Register a deployed node with the Crewly Cloud API.
     *
     * @param dropletIp - Public IP of the deployed node
     * @param customerId - Customer identifier for Cloud registration
     * @returns Human-readable result message
     * @throws {DeploymentError} On registration failure
     */
    registerWithCloud(dropletIp: string, customerId: string): Promise<string>;
    /**
     * Execute a deployment phase with timing and status tracking.
     *
     * @param deploymentId - Unique deployment identifier
     * @param phase - Phase being executed
     * @param fn - Async function implementing the phase logic
     * @returns Phase result with timing and success/failure info
     */
    private executePhase;
    /**
     * Configure a customer account on a deployed node.
     *
     * @param dropletIp - Public IP of the Droplet
     * @param customerId - Customer identifier
     * @returns Human-readable result message
     */
    private configureAccount;
    /**
     * Build an environment variable string for SSH commands.
     *
     * @param apiKeys - API keys to include
     * @returns Space-separated KEY=VALUE string (empty string if no keys)
     */
    private buildEnvVarsString;
}
//# sourceMappingURL=deployment-orchestrator.service.d.ts.map