import { type Manifest, type Section } from "./ethos.js"; import { type Author } from "./author.js"; import { type Identity } from "./identity.js"; import { type Sphere } from "./did.js"; import { type ManifestV03, type SectionRecipient } from "./bundle-v03.js"; /** True for a v0.1.x / v0.2.x bundle marker (the compat-read regime). */ export declare function isV02Aithos(aithos: unknown): boolean; export interface DecodedV02Bundle { manifest: Manifest; /** Decrypted, parsed sections per zone. */ zones: Record; } /** * Read a v0.2 (monolithic) bundle directory into per-zone sections, decrypting * `circle` / `self` with the v0.2 zone-DEK construction (§3.4.2). `who` is the * owner identity (or an authorised Author) holding the sphere secrets. */ export declare function decodeBundleV02(dir: string, who: Identity | Author): DecodedV02Bundle; /** * Read any bundle directory (v0.2 or v0.3) into per-zone sections. Dispatches * on the top-level `aithos` marker. For v0.3, encrypted-zone sections are * decrypted with the subject sphere readers derived from `owner`; sections the * reader is not entitled to are simply omitted (§3.4.2′). For v0.2, defers to * {@link decodeBundleV02}. */ export declare function readBundleSections(dir: string, owner: Identity): Record; export interface MigrateV02ToV03Args { /** Owner identity (must hold the sphere secrets to decrypt the v0.2 zones). */ identity: Identity; /** Directory of the v0.2 bundle to migrate. */ v02Dir: string; /** Directory to write the v0.3 migration edition into. */ outDir: string; now?: Date; /** Override recipients per encrypted zone (default: subject only). */ recipientsFor?: (zone: "circle" | "self") => SectionRecipient[]; } /** * Migrate a v0.2 bundle to a v0.3 migration edition (§3.10.3′). Decrypts and * splits each v0.2 zone into per-section blobs, freshly encrypting `circle` / * `self` sections under independent per-section DEKs and writing `public` * sections as plaintext files. The new edition's `supersedes` / `prev_hash` * point back at the unchanged v0.2 predecessor (computed via the v0.2 * canonicalizer), so the chain cross-validates across the version boundary. * * Note: the migration's `bundle.migrate.v0.3` gamma entry (§3.10.3′) is part of * the gamma-v0.3 op vocabulary, tracked separately; this function produces the * bundle-layer migration edition only. */ export declare function migrateBundleV02ToV03(args: MigrateV02ToV03Args): ManifestV03;