/** * Workflow, agent, and tool version tuple utilities. * * Captures a `(workflowVersion, agentVersion, toolVersions[])` tuple on every * event-log entry and provides diff utilities to detect mismatches between * stored tuples and currently-registered definitions when resuming workflows. * * @module core/workflow-version-tuple */ /** Version tuple captured at workflow start and on every event-log entry. */ export type WorkflowVersionTuple = { workflowVersion: string; agentVersion?: string; /** Sorted `"${name}@${version}"` strings, one per tool. */ toolVersions?: string[]; }; /** A single tool-level version change surfaced by {@link diffWorkflowVersionTuples}. */ export type WorkflowToolVersionChange = { tool: string; change: 'added'; to: string; } | { tool: string; change: 'removed'; from: string; } | { tool: string; change: 'changed'; from: string; to: string; }; /** Structured field-level diff between two {@link WorkflowVersionTuple}s. */ export type WorkflowVersionDiff = { workflowVersion?: [string, string]; agentVersion?: [string, string]; toolVersions?: WorkflowToolVersionChange[]; }; /** * Collect sorted `"${name}@${version}"` version strings from a tool array. * * Each element exposes a `name` plus an optional `version`. Missing versions * default to `"0.0.0"`. The returned array is sorted alphabetically so * comparisons are order-independent. */ export declare function collectToolVersions(tools: Array<{ name: string; version?: string | undefined; }>): string[]; /** * Compare two {@link WorkflowVersionTuple}s and return structured field-level diffs. * * Only fields that actually differ are included in the output. An empty * object means the tuples are identical. */ export declare function diffWorkflowVersionTuples(stored: WorkflowVersionTuple, registered: WorkflowVersionTuple): WorkflowVersionDiff; /** * Format a human-readable summary of a {@link WorkflowVersionDiff} for error messages. * * Returns an empty string when the diff has no changes. */ export declare function formatWorkflowVersionDiff(diff: WorkflowVersionDiff): string;