import type { AcquiredRunResources, CleanupScope } from "./run-contracts.js"; /** * Create a run resource ledger. The ledger starts `open`. `register` fills at * most one slot per resource id. `seal` validates the required set and promotes * promotable `startup_rollback` entries to `per_run`. `takeForSettlement` makes * the one-time settlement claim. */ export declare function createRunResourceLedger(): AcquiredRunResources; /** * A registry of cleanup thunks, grouped by lifetime scope. The coordinator adds * a cleanup under a scope, promotes a scope's cleanups to another scope, and * runs a scope's cleanups. */ export interface ScopedCleanupRegistry { /** Add a cleanup under a scope. */ add(scope: CleanupScope, cleanup: () => void | Promise): void; /** Move every cleanup from one scope to another, in registration order. */ promote(from: CleanupScope, to: CleanupScope): void; /** The count of cleanups in a scope. */ size(scope: CleanupScope): number; /** * Run and clear a scope's cleanups in reverse registration order. Run every * cleanup even when one fails. Throw an `AggregateError` at the end when one * or more failed, so no error is lost and no cleanup is skipped. */ run(scope: CleanupScope): Promise; } /** Create an empty scoped cleanup registry. */ export declare function createScopedCleanupRegistry(): ScopedCleanupRegistry; //# sourceMappingURL=run-resource-ledger.d.ts.map