import { readAuthFor, type DelegateReaderArgs, type EthosV04Snapshot, type ManifestV03, type SignedMandate, type StoredIdentity, type ZoneGrantTarget } from "@aithos/protocol-client"; import type { ManifestV04 } from "@aithos/protocol-core"; export type ZoneNameB = "public" | "circle" | "self"; export interface BridgeSection { readonly id: string; readonly title: string; readonly body: string; readonly tags?: readonly string[]; readonly gamma_ref: string; } export interface BridgeIndexRow { readonly id: string; readonly title?: string; readonly tags?: readonly string[]; readonly readable: boolean; readonly approx_size_bytes?: number; } export interface V04State { manifest: ManifestV04; snap: EthosV04Snapshot; } /** Probe the subject's current format. `none` = no edition yet. */ export declare function probeFormat(did: string): Promise<{ kind: "v04"; manifest: ManifestV04; } | { kind: "v03"; manifest: ManifestV03; } | { kind: "none"; }>; export declare function loadV04State(did: string, manifest: ManifestV04, owner?: StoredIdentity, delegate?: DelegateReaderArgs): Promise; export declare function indexRows(state: V04State, zone: ZoneNameB): BridgeIndexRow[]; export declare function readSection(did: string, state: V04State, zone: ZoneNameB, sectionId: string, owner?: StoredIdentity, delegate?: DelegateReaderArgs): Promise; interface GrantSplit { zone: Partial>; /** Narrow scopes: section targets resolved against the CURRENT index. */ section: Partial>; } /** Split mandates into keyring grants (whole-zone read-bearing scopes) and * per-section grants (#id=/#prefix=/#tag=). Tag selectors resolve against the * index rows of THIS (owner-loaded) state: circle tags are clear; self tags * are decrypted from title_cipher by the owner reader. The resulting self * ExtraWraps wrap is the §3.5.7″ capability the server gate honors — the * selector is evaluated HERE, where the tags are readable. */ export declare function splitGrants(state: V04State, mandates: readonly SignedMandate[]): GrantSplit; /** Active zone grants per zone (for migration carry + rotate keepRecipients). */ export declare function activeZoneGrants(did: string): Promise>>; export interface OwnerPublishArgs { readonly did: string; readonly owner: StoredIdentity; readonly patches: Partial>; readonly addZoneGrants?: Partial>; readonly addSectionGrants?: Partial>; readonly pruneLabels?: ReadonlySet; readonly rotate?: { mode: "rotate" | "rotate-deep"; zones: readonly ("circle" | "self")[]; }; } /** Owner publish against a v0.4 subject (state REQUIRED — migrate first). */ export declare function ownerPublish(state: V04State, args: OwnerPublishArgs): Promise<{ manifest: ManifestV04; height: number; }>; /** The migration edition (owner, spec N10) — carries active zone grants. */ export declare function migrate(did: string, owner: StoredIdentity, prevV03: ManifestV03): Promise<{ manifest: ManifestV04; height: number; }>; export interface DelegatePublishArgs { readonly did: string; readonly delegate: { granteeId: string; pubkeyMultibase: string; seed: Uint8Array; mandate: SignedMandate; mandateId: string; }; readonly zone: ZoneNameB; readonly upserts?: BridgeSection[]; readonly deletes?: string[]; /** did.json — required only on the fence path (no zone key). */ readonly didDoc?: unknown; } export declare function delegatePublish(state: V04State, args: DelegatePublishArgs): Promise<{ manifest: ManifestV04; height: number; }>; /** Whether the delegate holds the zone key for its sphere (fence detection). */ export declare function delegateHasZoneKey(state: V04State, zone: ZoneNameB): boolean; /** Recipient labels PRESENT in the state's keyrings + extrawraps, owner kex * labels excluded — the prune candidates. */ export declare function presentRecipientLabels(state: V04State, did: string): Set; /** Labels of EVERY active read-bearing grant (zone-wide AND narrow) — the * prune keep-set. */ export declare function activeRecipientLabels(did: string): Promise>; /** Eager zone read (the legacy sections() surface): every READABLE section's * body through the lazy reader, bounded fan-out. Unreadable rows are skipped * silently — the v0.3 eager contract. */ export declare function readZone(did: string, state: V04State, zone: ZoneNameB, owner?: StoredIdentity, delegate?: DelegateReaderArgs): Promise; export { readAuthFor }; export type { DelegateReaderArgs, ManifestV04, StoredIdentity, ZoneGrantTarget }; //# sourceMappingURL=v04-bridge.d.ts.map