/** * `registerSource()` — the synchronous entry point for a dynamic workflow * source (WFT-13/14). Mirrors `engine.register()`'s own "stays synchronous, * defers the real work" contract: this records a catalog candidate keyed * `(name, revision)` and returns — it never invokes the source's loader and * never touches storage. The loader runs only inside a later, explicit * `resolveWorkflowSource()` call (`source-resolution.ts`). * * @module core/engine/source-registration */ import type { WorkflowSourceHandle } from '../source/index.ts'; import type { EngineInternals } from './internals.ts'; /** * Record `source` as a lazily-resolvable candidate for * `(source.descriptor.name, source.descriptor.revision)`. Synchronous and * side-effect-free beyond the in-memory record: never invokes * `source.load`, never reads or writes storage. * * Collision rules, checked in both directions against `engine.register()`'s * own state so a workflow name can never be simultaneously eager and lazy: * * - A name already eagerly registered (`internals.registrations` — set by * BOTH branches of `engine.register()`, unlike `workflowDefinitionsByName`, * which only the builder-produced branch populates; checking that narrower * map here would let a plain `{ name, handler }` `WorkflowDefinition` * registered via `engine.register()` collide silently with a same-named * `registerSource()` call) cannot also be registered as a source — throws. * - Re-registering the identical `source` object reference for the same * `(name, revision)` is idempotent (a no-op), mirroring `engine.register()`'s * own same-reference-is-idempotent rule for eager definitions. * - Registering a *different* handle under the same `(name, revision)` key * throws — a revision identity, once claimed, names exactly one source. * - Multiple *different* revisions of the same lazy name may coexist * unregistered — this is the direct lazy analog of the catalog already * supporting multiple installed revisions per name (WFT-9/10); nothing in * this batch's acceptance criteria forbids it. * * The symmetric check — an eager `engine.register()` call for a name * already claimed by a source — lives in `registration.ts`'s * `commitWorkflowDefinition`. */ export declare function registerSource(internals: EngineInternals, source: WorkflowSourceHandle): void;