/** * Version compatibility check for running workflows against registered versions. * * Scans storage for active (running/pending) workflows, groups by type, * and compares stored versions with currently registered versions to * determine deployment safety. * * @module diagnostics/version-check */ import type { WorkflowDefinition } from '../core/types.ts'; import type { Storage } from '../storage/interface.ts'; import type { VersionCheckReport } from './types.ts'; /** * Scans active (running and pending) workflows in `storage`, groups them by * type, and compares stored workflow versions against currently registered * versions to determine deployment safety. * * Returns a {@link VersionCheckReport} with a per-type breakdown and an * `overallVerdict` of `'safe'` or `'unsafe'`. Typically * called by the `weft version:check` CLI command. * * @example * ```ts * import { MemoryStorage, runVersionCheck, workflow } from '@lostgradient/weft'; * * await using storage = new MemoryStorage(); * * const ping = workflow({ name: 'ping', version: '1.0.0' }) * .execute(async function* () { return 'pong'; }); * const report = await runVersionCheck(storage, { ping }); * console.log(report.overallVerdict); // 'safe' * ``` */ export declare function runVersionCheck(storage: Storage, registrations: Record): Promise;