import { type PersistentCoordinatorOptions } from "./persistence.ts"; import { type CanonicalLeaseKey, type ExecutionOwner } from "./types.ts"; export type PermitState = "issued" | "active" | "settled" | "expired"; export interface MutationPermit { readonly permitId: string; readonly intentId: string; readonly journalEpoch: number; readonly owner: ExecutionOwner; readonly issuedAt: string; readonly expiresAt: string; readonly nonce: string; readonly scopes: readonly CanonicalLeaseKey[]; } export interface DurablePendingIntent { intentId: string; intentSequence: number; journalEpoch: number; owner: ExecutionOwner; scopes: readonly CanonicalLeaseKey[]; } export interface PermitRegistryOptions extends PersistentCoordinatorOptions { journalEpoch: number; } export interface PermitActivation { owner: ExecutionOwner; pendingIntents: readonly DurablePendingIntent[]; } export declare class PermitValidationError extends Error { readonly code = "TFWS_PERMIT_INVALID"; constructor(message: string); } /** Runtime-only brand check for SandboxPlan sealing. Serialized/reconstructed * lookalikes deliberately fail even when every public field is identical. */ export declare function isIssuedMutationPermit(value: unknown): value is MutationPermit; export declare class MutationPermitRegistry { #private; readonly statePath: string; readonly journalEpoch: number; readonly now: () => number; constructor(options: PermitRegistryOptions); /** Internal durability-plane hook. Call only after the matching intent WAL * record has been appended and fsynced. JournalManager is the public issuer. */ issueForDurableIntent(intent: DurablePendingIntent, ttlMs: number): Promise; /** Atomically activate every permit in a sealed execution plan exactly once. */ activateMany(permits: readonly MutationPermit[], activation: PermitActivation): Promise; assertIntentActive(intentId: string, owner: ExecutionOwner): Promise; assertActive(permit: MutationPermit, owner: ExecutionOwner): Promise; settleIntent(intentId: string): Promise; stateOf(permitId: string): Promise; invalidateOlderEpochs(): Promise; } //# sourceMappingURL=permits.d.ts.map