import { SubscriptionPersonalAuthorityV2 } from "@opengeni/contracts"; import type { ProviderId } from "@opengeni/subscriptions"; import { type Database } from "./database.js"; export declare function subscriptionAuthorityV2ForAcceptanceInTransaction(tx: Database, provider: ProviderId, input: { accountId: string; workspaceId: string; sessionId: string; /** The exact human whose acceptance this is; null for non-human acceptance. */ acceptingSubjectId: string | null; }): Promise; /** * The v2 value a new acceptance freezes, for every provider on the shared * core: each registered provider's entry (its own owner and generation * rules), merged into the one value the carrier stores; `null` when no * provider wrote one. */ export declare function coreSubscriptionAuthorityV2ForAcceptanceInTransaction(tx: Database, input: Parameters[2]): Promise; /** The v2 value that grants no personal authority (shared capacity only). */ export declare const EMPTY_SUBSCRIPTION_AUTHORITY_V2: SubscriptionPersonalAuthorityV2; /** * A carrier's frozen value verbatim (every provider's entries), or the empty * value when it froze none: a missing value never widens to personal * authority. */ export declare function subscriptionAuthorityV2OrEmpty(frozen: SubscriptionPersonalAuthorityV2 | null | undefined): SubscriptionPersonalAuthorityV2; /** * A scheduled task's frozen v2 value at creation (M3 PR 3b, EP-T15), from * `subscription_core_task_authority_v2`: the acceptance rule for the exact * accepting human. */ export declare function subscriptionAuthorityV2ForScheduledTaskInTransaction(tx: Database, provider: ProviderId, input: { accountId: string; workspaceId: string; reusableSessionId: string | null; acceptingSubjectId: string | null; }): Promise; /** A scheduled task's frozen v2 value at creation, merged over every registered provider. */ export declare function coreSubscriptionAuthorityV2ForScheduledTaskInTransaction(tx: Database, input: Parameters[2]): Promise; /** A carrier of delivered inbox input (0716 carrier kinds). */ export type InboxAuthorityCarrier = { kind: "session_turn" | "session_system_update"; id: string; }; /** A carrier of accepted authority (the compatibility migration's carrier kinds). */ export type SubscriptionAuthorityCarrier = { kind: "session_initial" | "session_turn" | "scheduled_task" | "scheduled_task_revision" | "session_system_update" | "session_system_update_outbox"; workspaceId: string; id: string; /** The revision of a `scheduled_task_revision` carrier; null for every other kind. */ taskAuthorityRevision?: number | null; }; /** * Copy each provider's compatibility record into carriers (design 5.3, * "Accepted authority across the cutover", Writing), for every provider whose * drained cutover committed a receipt. The database routine resolves each * carrier's source itself and accepts no content; the commit-time trigger * then requires exactly that copy. Call it once the carrier and every row its * source resolver reads (for a delivering turn, its delivered updates) are * written. A named carrier this transaction did not insert (an upsert that * updated an existing row, a task revision an earlier transaction inserted * and a replayed or detached materialization returned) is * skipped: its record, if any, was copied when it was inserted. Inert, after * one read, while no provider has such a receipt. */ export declare function copySubscriptionAuthorityCompatInTransaction(tx: Database, carriers: readonly SubscriptionAuthorityCarrier[]): Promise; /** * The effective accepted authority of each inbox carrier (0716's reader), per * provider whose own drained cutover holds compatibility records (design 5.3, * inbox batching): keyed `kind:id`, one value per provider. Empty while no * provider has a receipt with a real commit time, so batching keys are * unchanged until then. */ export declare function subscriptionAuthorityCompatForCarriersInTransaction(tx: Database, input: { workspaceId: string; carriers: readonly InboxAuthorityCarrier[]; }): Promise>>>;