export declare const NON_TERMINAL_STATES: readonly ["queued", "admitted", "executing", "preview_ready", "parked", "resuming", "promoting", "quarantined"]; export declare const TERMINAL_STATES: readonly ["promoted", "failed", "canceled", "rejected", "expired", "rebase_required", "reported"]; export declare const RUN_STATES: readonly ["queued", "admitted", "executing", "preview_ready", "parked", "resuming", "promoting", "quarantined", "promoted", "failed", "canceled", "rejected", "expired", "rebase_required", "reported"]; export declare const PARK_REASONS: readonly ["gate", "funding"]; export declare const FAILURE_REASONS: readonly ["admission_rejected", "dispatch_timeout", "auth_revoked", "owner_changed", "policy_changed", "quarantine_forced", "bind_failed", "internal_error"]; export type NonTerminalState = (typeof NON_TERMINAL_STATES)[number]; export type TerminalState = (typeof TERMINAL_STATES)[number]; export type RunState = (typeof RUN_STATES)[number]; export type ParkReason = (typeof PARK_REASONS)[number]; export type FailureReason = (typeof FAILURE_REASONS)[number]; export declare const BUILD_REVIEW_CAPABILITY_SCHEMA: "bounded.build-review-capability.v1"; export declare const BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA: "bounded.build-review-capability-refresh.v1"; export declare const BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA: "bounded.build-delegated-review-capability.v1"; export type BuildReviewAudience = 'owner' | 'admin' | 'delegated-reviewer'; export type BuildReviewCapabilityState = 'pending' | 'active' | 'expired' | 'decided' | 'terminal'; export interface BuildReviewCapabilityRefreshReceipt { schemaVersion: typeof BUILD_REVIEW_CAPABILITY_REFRESH_SCHEMA; runId: string; targetAppId: string; gateId: string; gateType: 'approval'; audience: BuildReviewAudience; reviewerBindingHash: string; previousGeneration: number; generation: number; previousExpiresAtMs: number; expiresAtMs: number; previousRecoveryUntilMs: number; recoveryUntilMs: number; refreshedAtMs: number; refreshedBy: string; idempotencyKeyHash: string; receiptHash: string; } export interface BuildReviewCapabilityView { schemaVersion: typeof BUILD_REVIEW_CAPABILITY_SCHEMA; audience: BuildReviewAudience; reviewerBindingHash: string; generation: number; expiresAtMs: number; recoveryUntilMs: number; state: BuildReviewCapabilityState; lastRefresh?: BuildReviewCapabilityRefreshReceipt; } export interface BuildDelegatedReviewCapabilityBase { schemaVersion: typeof BUILD_DELEGATED_REVIEW_CAPABILITY_SCHEMA; runId: string; targetAppId: string; gateId: string; gateType: 'approval'; audience: 'delegated-reviewer'; previewUrl: string; expiresAtMs: number; observedAtMs: number; } export type BuildDelegatedReviewCapabilityView = BuildDelegatedReviewCapabilityBase & ({ state: 'active' | 'expired' | 'terminal'; decision?: never; } | { state: 'decided'; decision: 'approve' | 'reject'; }); /** Additive wire:1 build projection returned by developer-api. */ export interface BuildRunClientView { runId: string; /** Known values are in RUN_STATES; unknown values must flow through unchanged. */ state: string; parkReason?: string; failureReason?: string; failureDetail?: string; quarantineReason?: string; quarantinedAtMs?: number; quarantineDetail?: { code: string; message: string; }; operation: string; /** The developer-api app this run targets. */ appId: string; targetAppId: string; /** Full submitted prompt, when retained by the owner-only developer-api view. */ prompt?: string; appUrl?: string; previewUrl?: string; gates: Array<{ gateId: string; type: string; expiresAtMs?: number; decided: boolean; decision?: string; reviewCapability?: BuildReviewCapabilityView; }>; stageSummaries: Array<{ stage: string; at: number; note?: string; }>; usage?: { aiMicroUsd: number; infraMicroUsd: number; }; createdAtMs: number; updatedAtMs: number; } export interface RunEventView { seq: number; type: string; atMs: number; data?: unknown; } export interface BuildRunListRow { runId: string; appId: string; createdAtMs: number; state?: string; /** 'create' (genesis/rebuild) or 'edit'. */ operation?: string; promptExcerpt?: string; updatedAtMs?: number; /** Newest non-terminal run only: live-enriched worker stage summaries. */ stageSummaries?: Array>; failureReason?: string; failureDetail?: { code?: string; message?: string; }; } /** * Extensible developer-api error details. Project-limit errors populate the * typed fields below; other error codes may add arbitrary fields. */ export interface BuildsApiErrorDetails { /** Current usage when `code === "project_limit_exceeded"`. */ usage?: number; /** Allowed usage when `code === "project_limit_exceeded"`. */ limit?: number; /** Limit axis (for example, `maxProjects`) when a quota gate rejects. */ dimension?: string; [key: string]: unknown; } /** Exact details supplied with a `project_limit_exceeded` error. */ export interface ProjectLimitExceededDetails extends BuildsApiErrorDetails { usage: number; limit: number; dimension: string; } export interface BuildsApiErrorEnvelope { error: { code: string; message: string; retryable: boolean; details?: BuildsApiErrorDetails; }; } export interface BuildSubmitResponse { wire: 1; runId: string; targetAppId: string; status: string; } export interface BuildGetResponse { wire: 1; run: BuildRunClientView; } export interface BuildEventsResponse { wire: 1; events: RunEventView[]; } export interface BuildCancelResponse { wire: 1; runId: string; state: string; } export interface BuildGateDecisionResponse { wire: 1; runId: string; targetAppId: string; gateId: string; decision: 'approve' | 'reject'; state: string; } export interface BuildDelegatedReviewCapabilityResponse { wire: 1; capability: BuildDelegatedReviewCapabilityView; } export interface BuildReviewCapabilityRefreshResponse { wire: 1; runId: string; gateId: string; state: string; replay: boolean; receipt: BuildReviewCapabilityRefreshReceipt; } export interface BuildTopupResponse { wire: 1; runId: string; state: string; } export interface BuildListResponse { wire: 1; runs: BuildRunListRow[]; }