import type { BuildCancelResponse, BuildDelegatedReviewCapabilityResponse, BuildEventsResponse, BuildGateDecisionResponse, BuildGetResponse, BuildListResponse, BuildReviewAudience, BuildReviewCapabilityRefreshResponse, BuildsApiErrorDetails, BuildSubmitResponse, BuildTopupResponse } from './types'; type BuildIdempotencyOptions = { /** Caller-minted wire key (1-256 characters), passed through unchanged. */ idempotencyKey: string; /** When also supplied, persists the caller-minted key for this logical action. */ intentKey?: string; } | { /** Omit to let the SDK mint and persist a wire key before the request. */ idempotencyKey?: undefined; /** Stable logical-action key used to reuse the minted key across page refreshes. */ intentKey: string; }; /** * Build submission plus one idempotency strategy: provide `idempotencyKey`, or * provide a stable client-only `intentKey` and let the SDK mint/persist the wire key. */ export type BuildSubmitOptions = { prompt: string; /** 'edit' (default) or 'create' — a genesis/rebuild of THIS app (parentless * create: the app already exists; the run targets it in place). */ operation?: 'edit' | 'create'; /** Submitting surface, for billing attribution ('web' = the bounded.sh site). */ surface?: 'web'; constraints?: object; effort?: string; profile?: string; baseDeploymentId?: string; } & BuildIdempotencyOptions; /** * Gate decision plus one idempotency strategy. A client-only `intentKey` can * replace a caller-minted `idempotencyKey` and survives refresh replays. */ export type BuildGateDecisionOptions = { decision: 'approve' | 'reject'; note?: string; } & BuildIdempotencyOptions; /** * Exact owner-rendered approval review capability plus one durable * idempotency strategy. The server chooses the refreshed expiry window. */ export type BuildReviewCapabilityRefreshOptions = { expectedGeneration: number; expectedExpiresAtMs: number; expectedRecoveryUntilMs: number; expectedAudience: BuildReviewAudience; expectedReviewerBindingHash: string; } & BuildIdempotencyOptions; /** Exact preview rendered by a sealed delegated reviewer. */ export interface BuildDelegatedReviewCapabilityOptions { expectedPreviewUrl: string; } export interface BuildTopupOptions { dimension: string; amountMicroUsd: number; idempotencyKey: string; } interface DevApiRequest { method?: string; body?: unknown; } interface BuildsApiErrorInit { code: string; message: string; retryable: boolean; status: number; details?: TDetails; retryAfterMs?: number; } /** A structured non-2xx response from the developer API. */ export declare class BuildsApiError extends Error { readonly code: string; readonly retryable: boolean; readonly status: number; /** * Developer-api error details, preserved verbatim. For * `project_limit_exceeded`, `usage`, `limit`, and `dimension` are all present * (the exact shape is exported as `ProjectLimitExceededDetails`). */ readonly details?: TDetails; /** Parsed Retry-After delay, when a 429 response supplied one. */ readonly retryAfterMs?: number; constructor(init: BuildsApiErrorInit); } /** @internal Shared authenticated developer-api transport for builds and apps. */ export declare function requestDevApi(path: string, request?: DevApiRequest): Promise; export declare function submit(appId: string, options: BuildSubmitOptions): Promise; export declare function get(appId: string, runId: string): Promise; export declare function events(appId: string, runId: string, after?: number): Promise; export declare function cancel(appId: string, runId: string): Promise; export declare function decideGate(appId: string, runId: string, gateId: string, options: BuildGateDecisionOptions): Promise; export declare function refreshReviewCapability(appId: string, runId: string, gateId: string, options: BuildReviewCapabilityRefreshOptions): Promise; /** * Read one exact delegated-review capability and its narrow lifecycle result. * This does not refresh or extend the window and exposes no generic run-view * authority. */ export declare function getReviewCapability(appId: string, runId: string, gateId: string, options: BuildDelegatedReviewCapabilityOptions): Promise; export declare function topup(appId: string, runId: string, options: BuildTopupOptions): Promise; export declare function list(appId: string, limit?: number): Promise; export {};