/**
 * Upload phase
 * ------------
 *
 * Takes the build artifacts produced by the Build phase, encrypts the
 * code zip with the deployment's public key, and uploads everything
 * (encrypted zip + static assets) to the URLs the server handed back in
 * the build phase's `DeploymentInstructions`.
 *
 * Two `Step` factories are exposed so the deploy command's `runSteps()`
 * pipeline keeps its existing visual progression:
 *   - `buildEncryptUploadStep`  — zips, encrypts, uploads code + assets.
 *   - `buildProvisionStep`      — calls `projectDeploymentComplete` and
 *                                 stashes the result on pipelineState so
 *                                 the wait phase can read the stream id.
 *
 * Failure modes flush the build report (when `--report-file` is set) so
 * CI always gets the diagnostics on disk before we abort.
 */
import { type Deployment, type DeploymentComplete } from '@agentuity/server';
import type { APIClient } from '../../../api.ts';
import type { BuildReportCollector } from '../../../build-report.ts';
import { type Step } from '../../../steps.ts';
import type { DeployPipelineState } from './types.ts';
/**
 * Path-segment filter applied to every entry going into the deploy
 * zip. `rel` is posix-style, relative to the staging dir.
 *
 * The staging dir is curated by the adapter — it intentionally places
 * `node_modules/` there for layouts that ship traced runtime
 * dependencies (Next.js standalone, future bundlers). So we don't
 * drop `node_modules` here; the adapters' copy steps already exclude
 * *the user's* node_modules when mirroring source into staging.
 *
 * What we still defensively reject at the zip layer:
 *   - `.git`, `.ssh` at any depth — VCS / credentials should never ship
 *   - `.DS_Store` — macOS clutter
 *   - `.agentuity` at any depth — prevents zipping the staging dir
 *     into itself when an adapter accidentally nests output
 *   - any file whose basename starts with `.env` — secrets land on the
 *     deploy host through the platform's env injection, never through
 *     a developer dotfile we accidentally bundled
 *
 * Exported so it can be unit-tested directly.
 */
export declare function deployZipFilter(_filename: string, rel: string): boolean;
export interface UploadStepParams {
    projectDir: string;
    collector: BuildReportCollector;
    deployment: Deployment | undefined;
    hasReportFile: boolean;
    state: DeployPipelineState;
    /** Logger to thread through. */
    logger: {
        trace: (msg: string) => void;
        debug: (msg: string) => void;
    };
}
/**
 * Render the final "Uploaded N assets ..." line after a successful CDN
 * upload pass. Reports both the original and on-the-wire totals when gzip
 * compressed at least one file, so the user can see the real transfer cost.
 *
 * Exported so the deploy command can reuse the same formatting if needed.
 */
export declare function formatUploadSummary(count: number, rawBytes: number, transferredBytes: number): string;
/**
 * Build the "Encrypt and Upload Deployment" step.
 *
 * Reads the Build phase's outputs (`build`, `buildOutputDir`,
 * `instructions`) from `state`, zips the build output dir, encrypts it
 * with the deployment public key, uploads the encrypted zip to the
 * server-provided URL, then fans out parallel uploads of every static
 * asset (gzipping compressible types on the fly).
 */
export declare function buildEncryptUploadStep(params: UploadStepParams): Step;
export interface ProvisionStepParams {
    apiClient: APIClient;
    deployment: Deployment | undefined;
    /** Mutable: written to once `projectDeploymentComplete` returns. */
    completeRef: {
        current?: DeploymentComplete;
    };
}
/**
 * Build the "Provision Deployment" step.
 *
 * Tells the server we're done uploading; the server then schedules the
 * deployment for warmup and returns the stream id we'll use to tail
 * build/run logs in the wait phase.
 *
 * The result is stashed via a small `completeRef` ref-cell instead of
 * being returned, so the surrounding handler still has access to it
 * after `runSteps()` returns. We use a ref-cell rather than the shared
 * `DeployPipelineState` because `complete` is consumed by the wait phase
 * which lives outside the step pipeline today.
 */
export declare function buildProvisionStep(params: ProvisionStepParams): Step;
//# sourceMappingURL=upload.d.ts.map