import type { FlowDefinition } from './types.js'; export declare const FLOW_DEFINITION_VERSION_STATUSES: readonly ["active", "superseded", "archived"]; export type FlowDefinitionVersionStatus = (typeof FLOW_DEFINITION_VERSION_STATUSES)[number]; export interface FlowDefinitionVersion { versionId: string; name: string; description: string; definition: FlowDefinition; digest: string; status: FlowDefinitionVersionStatus; authorId?: string; createdAt: Date; /** Model id used to compile natural-language `when` clauses. Server-set. */ compilerModelId?: string; /** SHA-256 of the NL→predicate compiler system prompt. Server-set. */ compilerPromptHash?: string; /** NL→predicate compiler version pin. Server-set. */ compilerVersion?: string; } export interface CreateVersionOptions { authorId?: string; compilerModelId?: string; compilerPromptHash?: string; compilerVersion?: string; } export interface FlowDefinitionListFilter { status?: FlowDefinitionVersionStatus; authorId?: string; name?: string; } export declare class FlowDefinitionConflictError extends Error { readonly name = "FlowDefinitionConflictError"; readonly flowName: string; readonly digest: string; constructor(flowName: string, digest: string); } export declare class FlowDefinitionNotFoundError extends Error { readonly name = "FlowDefinitionNotFoundError"; readonly versionId?: string; readonly flowName?: string; constructor(key: { versionId?: string; name?: string; }); } export declare class FlowDefinitionNameMismatchError extends Error { readonly name = "FlowDefinitionNameMismatchError"; readonly versionId: string; readonly expectedName: string; readonly actualName: string; constructor(versionId: string, expectedName: string, actualName: string); } /** * Immutable versioned catalog of flow definitions. * * Publishing is two steps: `createVersion` inserts a row and does **not** * change the active pointer; `setActive(name, version.versionId)` is what * publishes. `status` and `digest` are server-computed — callers cannot * supply them. `authorId` is stored metadata, never an authorization check. */ export interface FlowDefinitionsStore { createVersion(def: FlowDefinition, options?: CreateVersionOptions): Promise; setActive(name: string, versionId: string): Promise; getActive(name: string): Promise; getVersion(versionId: string): Promise; list(filter?: FlowDefinitionListFilter): Promise; archive(name: string): Promise; } export declare function cloneFlowDefinitionVersion(row: FlowDefinitionVersion): FlowDefinitionVersion; export declare function reviveFlowDefinitionVersion(raw: { versionId: string; name: string; description: string; definition: FlowDefinition; digest: string; status: FlowDefinitionVersionStatus; authorId?: string | null; createdAt: Date | string; compilerModelId?: string | null; compilerPromptHash?: string | null; compilerVersion?: string | null; }): FlowDefinitionVersion; export declare function isArchivedFlowName(rows: readonly FlowDefinitionVersion[], name: string): boolean; export declare function matchesFlowDefinitionListFilter(row: FlowDefinitionVersion, all: readonly FlowDefinitionVersion[], filter?: FlowDefinitionListFilter): boolean; export declare function stampNewFlowDefinitionVersion(def: FlowDefinition, options?: CreateVersionOptions): Promise;