/**
 * CloudflarePagesProvider
 *
 * Live ICloudDeploymentProvider adapter for Cloudflare Pages.
 *
 * Deploy pipeline (happy path):
 *   1. Verify token + discover account id
 *   2. Ensure project exists (create if missing)
 *   3. Upload build output via wrangler CLI fallback
 *      (the Cloudflare direct-upload multi-part HTTP protocol is handled by
 *      wrangler internally; calling it from our ExecFunction lets us stay
 *      zero-dep and correct.)
 *   4. Poll the newly-created deployment until success/failure
 *   5. Emit Uploading → Deploying → Deployed via onProgress
 *
 * Spec 089 — research §1 + §7.
 */
import type { ExecFunction } from '../git/worktree.service.js';
import type { ICloudProviderTokensRepository } from '../../../application/ports/output/repositories/cloud-provider-tokens.repository.interface.js';
import type { CloudDeployInput, CloudDeployLogEmitter, CloudDeployProgressHandler, CloudDeployResult, ICloudDeploymentProvider } from '../../../application/ports/output/services/cloud-deployment-provider.interface.js';
import { CloudDeploymentProvider, CloudDeploymentStatus } from '../../../domain/generated/output.js';
export type FetchFunction = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
export declare class CloudflarePagesProvider implements ICloudDeploymentProvider {
    private readonly tokens;
    private readonly fetchFn;
    private readonly execFile;
    private readonly clock;
    readonly providerId = CloudDeploymentProvider.CloudflarePages;
    readonly displayName = "Cloudflare Pages";
    readonly enabled = true;
    constructor(tokens: ICloudProviderTokensRepository, fetchFn: FetchFunction, execFile: ExecFunction, clock?: {
        now: () => number;
        sleep: (ms: number) => Promise<void>;
    });
    isConnected(): Promise<boolean>;
    validateToken(token: string): Promise<void>;
    deploy(input: CloudDeployInput, onProgress: CloudDeployProgressHandler, onLog?: CloudDeployLogEmitter): Promise<CloudDeployResult>;
    getStatus(deploymentId: string): Promise<{
        status: CloudDeploymentStatus;
        url?: string;
        error?: string;
    }>;
    /**
     * Build the stable alias URL for a Cloudflare Pages project.
     *
     * Cloudflare serves every successful production deploy at
     * `<project-name>.pages.dev` in addition to the per-commit preview URL
     * (`<hash>.<project-name>.pages.dev`). The alias is what we surface in
     * the app card — it doesn't change between deploys, so users can
     * bookmark it and share it without worrying about stale commit hashes.
     *
     * Project names are already validated by Cloudflare's own API (lowercase
     * alphanumerics + hyphens, 1–58 chars), and our `cleanDeployName`
     * helper produces strings that satisfy those rules, so no further
     * sanitisation is needed here.
     */
    private deriveAliasUrl;
    private verifyToken;
    private discoverAccountId;
    private ensureProject;
    private listProjects;
    private getDeployment;
    private pollUntilFinished;
    /**
     * Result of a wrangler subprocess invocation. Modern wrangler (4.x+)
     * prints a URL banner on success but NO explicit "Deployment ID:" line,
     * so we return whichever signals we could parse. The caller decides
     * whether to skip polling based on which fields are populated.
     */
    private runWranglerDeploy;
    /**
     * Fetch the single newest deployment for a project. Used right after a
     * wrangler success banner to look up the real deployment id so we can
     * persist it on the Application row for later status re-hydration.
     */
    private fetchNewestDeployment;
    private request;
}
//# sourceMappingURL=cloudflare-pages.provider.d.ts.map