/** * The sync/async boundary glue between `engine.register()` (synchronous, * cannot itself build a manifest — that requires `crypto.subtle`) and the * durable workflow catalog (async, WFT-9/WFT-10). * * `register()` stays byte-for-byte synchronous; `commitWorkflowDefinition` * (`registration.ts`) only pushes the workflow's name onto * `EngineInternals.pendingCatalogInstalls`. {@link ensureWorkflowCatalogReady} * is the memoized function that, on first call, restores the catalog from * storage, then drains `pendingCatalogInstalls` — building each pending * workflow's manifest via the already-existing * `buildWorkflowManifestForType` (`registry-workflow-manifest.ts`, reused * rather than reimplemented) and unconditionally activating it via * `WorkflowCatalog.activateRegistered`. * * Awaited at every entry point that can observe catalog state — see the * call sites in `index.ts` — so "restore catalog state before recovery or * any new start" holds. * * @module core/engine/catalog-readiness */ import type { Engine } from './index.ts'; export { getWorkflowCatalog } from './internals.ts'; /** * Synchronous fast-path check: `true` once the catalog is restored and * nothing is pending, `false` when {@link ensureWorkflowCatalogReady} would * need to do real work. Every `ensureWorkflowCatalogReady` call site in * `index.ts` guards its `await` with this check first — `await`ing an * `async` function always costs one microtask tick even when the function's * own body takes the fast path internally (JS's `await` semantics, not an * implementation detail), so skipping the call entirely on an already-warm * engine is what "avoid promise-machinery overhead on the hot path" (the * WFT-9/WFT-10 design) actually requires — not just an early return inside * the async function. */ export declare function isWorkflowCatalogReady(engine: Engine): boolean; /** * Restore the workflow catalog from storage (once per engine instance) and * drain any workflow names `engine.register()` has queued since the last * drain. Memoized: concurrent callers await the same in-flight promise, and * a call after a prior drain resolved with newly queued names starts a * fresh drain rather than re-scanning storage. * * Also checks the {@link isWorkflowCatalogReady} fast path itself, so a * direct call (bypassing a call site's own guard — as in * `buildRegistrySnapshot`, or any future caller) is still cheap and correct * without relying on every caller remembering to pre-check. */ export declare function ensureWorkflowCatalogReady(engine: Engine): Promise;