import { BosConfig, JsonValue } from "../../types.cjs";
import "../../index.cjs";
import { z } from "zod";
//#region src/services/snapshot/schema.d.ts
/** The immutable descriptor a pinned remote composes — the release manifest's
 * `remotes:` entry shape (ADR 0040), reused verbatim: one vocabulary for the
 * same bytes. */
declare const RemoteDigestSchema: z.ZodObject<{
  base: z.ZodString;
  digest: z.ZodObject<{
    manifest: z.ZodString;
    integrity: z.ZodString;
  }, z.core.$strip>;
}, z.core.$strip>;
type RemoteDigest = z.infer<typeof RemoteDigestSchema>;
declare const BootSnapshotSchema: z.ZodObject<{
  schemaVersion: z.ZodLiteral<1>;
  kind: z.ZodLiteral<"everything-dev/boot-snapshot">;
  runtimeRef: z.ZodString;
  manifestTag: z.ZodNullable<z.ZodObject<{
    version: z.ZodString;
    digest: z.ZodString;
  }, z.core.$strip>>;
  fingerprint: z.ZodString;
  config: z.ZodObject<{
    account: z.ZodString;
    extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
      development: z.ZodOptional<z.ZodString>;
      production: z.ZodOptional<z.ZodString>;
      staging: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>]>>;
    domain: z.ZodOptional<z.ZodString>;
    title: z.ZodOptional<z.ZodString>;
    description: z.ZodOptional<z.ZodString>;
    testnet: z.ZodOptional<z.ZodString>;
    staging: z.ZodOptional<z.ZodObject<{
      domain: z.ZodString;
      account: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    repository: z.ZodOptional<z.ZodString>;
    publish: z.ZodOptional<z.ZodObject<{
      auth: z.ZodOptional<z.ZodEnum<{
        custody: "custody";
        key: "key";
        session: "session";
      }>>;
      sourcePublish: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>>;
    release: z.ZodOptional<z.ZodString>;
    ci: z.ZodOptional<z.ZodObject<{
      railway: z.ZodOptional<z.ZodObject<{
        service: z.ZodString;
      }, z.core.$strip>>;
    }, z.core.$strip>>;
    cdn: z.ZodOptional<z.ZodObject<{
      origin: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
    rolledBackFrom: z.ZodOptional<z.ZodString>;
    starter: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
      levels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
        include: z.ZodOptional<z.ZodArray<z.ZodString>>;
        exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
      }, z.core.$strip>>>;
      exclude: z.ZodOptional<z.ZodArray<z.ZodString>>;
    }, z.core.$strip>, z.ZodEnum<{
      advanced: "advanced";
      simple: "simple";
    }>]>>;
    plugins: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
      extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
        development: z.ZodOptional<z.ZodString>;
        production: z.ZodOptional<z.ZodString>;
        staging: z.ZodOptional<z.ZodString>;
      }, z.core.$strip>]>>;
      name: z.ZodOptional<z.ZodString>;
      development: z.ZodOptional<z.ZodString>;
      production: z.ZodOptional<z.ZodString>;
      integrity: z.ZodOptional<z.ZodString>;
      proxy: z.ZodOptional<z.ZodString>;
      variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
      secrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
      routes: z.ZodOptional<z.ZodArray<z.ZodString>>;
      shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
        version: z.ZodString;
        requiredVersion: z.ZodOptional<z.ZodString>;
        singleton: z.ZodOptional<z.ZodBoolean>;
        eager: z.ZodOptional<z.ZodBoolean>;
        strictVersion: z.ZodOptional<z.ZodBoolean>;
        shareScope: z.ZodOptional<z.ZodString>;
      }, z.core.$strip>>>;
      connectSrc: z.ZodOptional<z.ZodArray<z.ZodString>>;
      ui: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
        name: z.ZodOptional<z.ZodString>;
        development: z.ZodOptional<z.ZodString>;
        production: z.ZodOptional<z.ZodString>;
        publicUrl: z.ZodOptional<z.ZodString>;
        integrity: z.ZodOptional<z.ZodString>;
        ssr: z.ZodOptional<z.ZodString>;
        ssrIntegrity: z.ZodOptional<z.ZodString>;
        digest: z.ZodOptional<z.ZodObject<{
          manifest: z.ZodString;
          integrity: z.ZodString;
        }, z.core.$strip>>;
      }, z.core.$strip>, z.ZodLiteral<false>]>>;
      digest: z.ZodOptional<z.ZodObject<{
        manifest: z.ZodString;
        integrity: z.ZodString;
      }, z.core.$strip>>;
      version: z.ZodOptional<z.ZodString>;
      app: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
      plugins: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
      dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
    }, z.core.$strip>]>>>;
    app: z.ZodObject<{
      host: z.ZodObject<{
        development: z.ZodOptional<z.ZodString>;
        production: z.ZodOptional<z.ZodString>;
        integrity: z.ZodOptional<z.ZodString>;
        secrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
        digest: z.ZodOptional<z.ZodObject<{
          manifest: z.ZodString;
          integrity: z.ZodString;
        }, z.core.$strip>>;
      }, z.core.$strip>;
      ui: z.ZodObject<{
        name: z.ZodOptional<z.ZodString>;
        development: z.ZodOptional<z.ZodString>;
        production: z.ZodOptional<z.ZodString>;
        publicUrl: z.ZodOptional<z.ZodString>;
        integrity: z.ZodOptional<z.ZodString>;
        ssr: z.ZodOptional<z.ZodString>;
        ssrIntegrity: z.ZodOptional<z.ZodString>;
        digest: z.ZodOptional<z.ZodObject<{
          manifest: z.ZodString;
          integrity: z.ZodString;
        }, z.core.$strip>>;
      }, z.core.$strict>;
      api: z.ZodObject<{
        extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
          development: z.ZodOptional<z.ZodString>;
          production: z.ZodOptional<z.ZodString>;
          staging: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>]>>;
        name: z.ZodOptional<z.ZodString>;
        development: z.ZodOptional<z.ZodString>;
        production: z.ZodOptional<z.ZodString>;
        integrity: z.ZodOptional<z.ZodString>;
        proxy: z.ZodOptional<z.ZodString>;
        variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
        secrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
        routes: z.ZodOptional<z.ZodArray<z.ZodString>>;
        shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
          version: z.ZodString;
          requiredVersion: z.ZodOptional<z.ZodString>;
          singleton: z.ZodOptional<z.ZodBoolean>;
          eager: z.ZodOptional<z.ZodBoolean>;
          strictVersion: z.ZodOptional<z.ZodBoolean>;
          shareScope: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>>;
        connectSrc: z.ZodOptional<z.ZodArray<z.ZodString>>;
        ui: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
          name: z.ZodOptional<z.ZodString>;
          development: z.ZodOptional<z.ZodString>;
          production: z.ZodOptional<z.ZodString>;
          publicUrl: z.ZodOptional<z.ZodString>;
          integrity: z.ZodOptional<z.ZodString>;
          ssr: z.ZodOptional<z.ZodString>;
          ssrIntegrity: z.ZodOptional<z.ZodString>;
          digest: z.ZodOptional<z.ZodObject<{
            manifest: z.ZodString;
            integrity: z.ZodString;
          }, z.core.$strip>>;
        }, z.core.$strip>, z.ZodLiteral<false>]>>;
        digest: z.ZodOptional<z.ZodObject<{
          manifest: z.ZodString;
          integrity: z.ZodString;
        }, z.core.$strip>>;
        dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
      }, z.core.$strip>;
      auth: z.ZodOptional<z.ZodObject<{
        extends: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
          development: z.ZodOptional<z.ZodString>;
          production: z.ZodOptional<z.ZodString>;
          staging: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>]>>;
        name: z.ZodOptional<z.ZodString>;
        development: z.ZodOptional<z.ZodString>;
        production: z.ZodOptional<z.ZodString>;
        integrity: z.ZodOptional<z.ZodString>;
        proxy: z.ZodOptional<z.ZodString>;
        variables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
        secrets: z.ZodOptional<z.ZodArray<z.ZodString>>;
        routes: z.ZodOptional<z.ZodArray<z.ZodString>>;
        shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
          version: z.ZodString;
          requiredVersion: z.ZodOptional<z.ZodString>;
          singleton: z.ZodOptional<z.ZodBoolean>;
          eager: z.ZodOptional<z.ZodBoolean>;
          strictVersion: z.ZodOptional<z.ZodBoolean>;
          shareScope: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>>;
        connectSrc: z.ZodOptional<z.ZodArray<z.ZodString>>;
        ui: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
          name: z.ZodOptional<z.ZodString>;
          development: z.ZodOptional<z.ZodString>;
          production: z.ZodOptional<z.ZodString>;
          publicUrl: z.ZodOptional<z.ZodString>;
          integrity: z.ZodOptional<z.ZodString>;
          ssr: z.ZodOptional<z.ZodString>;
          ssrIntegrity: z.ZodOptional<z.ZodString>;
          digest: z.ZodOptional<z.ZodObject<{
            manifest: z.ZodString;
            integrity: z.ZodString;
          }, z.core.$strip>>;
        }, z.core.$strip>, z.ZodLiteral<false>]>>;
        digest: z.ZodOptional<z.ZodObject<{
          manifest: z.ZodString;
          integrity: z.ZodString;
        }, z.core.$strip>>;
      }, z.core.$strip>>;
    }, z.core.$strip>;
  }, z.core.$strip>;
  remotes: z.ZodRecord<z.ZodString, z.ZodObject<{
    base: z.ZodString;
    digest: z.ZodObject<{
      manifest: z.ZodString;
      integrity: z.ZodString;
    }, z.core.$strip>;
  }, z.core.$strip>>;
  deployRecordKey: z.ZodNullable<z.ZodString>;
  lockfileDigest: z.ZodOptional<z.ZodString>;
  writtenAt: z.ZodString;
}, z.core.$strict>;
type BootSnapshot = z.infer<typeof BootSnapshotSchema>;
declare function snapshotRoot(input?: {
  dir?: string;
}): string;
declare function snapshotPath(account: string, gateway: string, input?: {
  dir?: string;
}): string;
declare function bootSnapshotOf(input: {
  account: string;
  gateway: string;
  config: BosConfig;
  manifestTag?: {
    version: string;
    digest: string;
  } | null;
  deployRecordKey?: string | null;
  lockfileDigest?: string;
  writtenAt?: string;
}): BootSnapshot;
/** The load-side integrity check: recompute the fingerprint from the stored
 * config and compare. A mismatch means the file was hand-edited or written by
 * a different fingerprint implementation — refuse, loud. */
declare function snapshotFingerprintMatches(snapshot: BootSnapshot): boolean;
declare class BootSnapshotIntegrityError extends Error {
  constructor(message: string);
}
/** Verified load: refuses a snapshot whose recomputed fingerprint mismatches
 * — the degraded boot rung serves this file, so it must be the exact
 * composition the coordinator verified when it wrote it. */
declare function verifiedBootSnapshot(snapshot: BootSnapshot): BootSnapshot;
/** Absent → null; present-but-invalid → throws (the caller distinguishes a
 * missing snapshot from a corrupt one — both refuse, with different causes). */
declare function readBootSnapshot(account: string, gateway: string, input?: {
  dir?: string;
}): Promise<BootSnapshot | null>;
declare function serializeBootSnapshot(snapshot: BootSnapshot): string;
declare function parseBootSnapshot(bytes: string): BootSnapshot;
/** Atomic persist (temp + rename) — a reader never observes a partial write.
 * The account/gateway always derive from the snapshot's runtime ref. */
declare function writeBootSnapshot(snapshot: BootSnapshot, input?: {
  dir?: string;
}): Promise<string>;
//#endregion
export { BootSnapshot, BootSnapshotIntegrityError, BootSnapshotSchema, RemoteDigest, RemoteDigestSchema, bootSnapshotOf, parseBootSnapshot, readBootSnapshot, serializeBootSnapshot, snapshotFingerprintMatches, snapshotPath, snapshotRoot, verifiedBootSnapshot, writeBootSnapshot };
//# sourceMappingURL=schema.d.cts.map