import type { OwnedBytes } from "../lib/bundle/pack.js"; /** Exit code for "credentials or configuration are missing" (EX_CONFIG). */ export declare const EX_CONFIG = 78; export declare class BundleCliError extends Error { readonly code: string; readonly exitCode: number; constructor(code: string, message: string, exitCode: number); } /** * HTTP status to CLI exit code. * * Distinct codes for integrity (2), conflict (3), not-found (4) and scope (5) * so a shell script can branch without parsing a message: "the bundle is * corrupt" and "someone else pushed first" want different automation. */ export declare function exitCodeForStatus(status: number, errorCode?: string): number; export interface BundleApiClient { readonly baseUrl: string; listVersions(loopId: string, limit?: number): Promise>; getVersion(loopId: string, version: number | "latest"): Promise>; download(loopId: string, version: number | "latest"): Promise<{ bytes: OwnedBytes; digest: string; archiveSha256: string; version: number; }>; upload(loopId: string, manifestJson: string, archive: Uint8Array, opts?: { adopt?: boolean; }): Promise>; rollback(loopId: string, body: Record): Promise>; pin(loopId: string, version: number | null): Promise>; listBundles(query?: { machine?: string; limit?: number; }): Promise>; getLoop(idOrName: string): Promise>; listLoops(query?: { name?: string; limit?: number; offset?: number; }): Promise>; } /** * Build the client, or refuse. * * Bundles are a control-plane feature: versions are allocated by the server and * objects live in the artifact store. There is no local-only mode for `push`, * `pull`, `versions` or `pin`, so missing credentials are EX_CONFIG (78) rather * than a silent fall back to something that would appear to work. */ export declare function createBundleApiClient(env?: NodeJS.ProcessEnv, fetchImpl?: typeof fetch): BundleApiClient;