import type { WorkflowValidationIssue } from './issues.js'; import { type JsonValue } from './model.js'; export type WorkflowRepositoryErrorCode = 'not-found' | 'id-conflict' | 'revision-conflict' | 'idempotency-conflict' | 'retired' | 'bad-cursor' | 'bad-input' | 'already-submitted' | 'corrupt-record'; export declare class WorkflowRepositoryError extends Error { readonly code: WorkflowRepositoryErrorCode; /** What exactly was wrong. Authoring a 20-node graph against a bare * "definition is invalid" means bisecting it by hand, so every surface * that can name a node, edge, or field path does. */ readonly issues?: readonly WorkflowValidationIssue[]; constructor(code: WorkflowRepositoryErrorCode, message: string, issues?: readonly WorkflowValidationIssue[]); } export declare function repositoryError(code: WorkflowRepositoryErrorCode, message: string, issues?: readonly WorkflowValidationIssue[]): never; export declare function isCanonicalInstant(value: unknown): value is string; export declare function canonicalStamp(value: unknown, stored?: boolean): string; export declare function parseWorkflowId(value: unknown): string; export declare function parseNodeId(value: unknown): string; export declare function isRunId(value: unknown): value is string; export declare function parseRunId(value: unknown): string; export declare function newRunId(): string; export declare function parseExpectedRevision(subject: string, value: unknown): number; export declare function parseLimit(value: JsonValue | undefined, subject: string): number; export declare function parseBoundedString(value: JsonValue | undefined, label: string, max?: number): string | undefined; export declare function isThenable(value: unknown): boolean; export declare function parseJsonRecord(value: unknown, message: string): Record; export declare function assertExactKeys(value: Record, allowed: readonly string[], message: string): void; export declare function parseStoredJson(value: unknown, subject: string): JsonValue; export declare function canonicalJson(value: JsonValue): string; interface CursorSpec { endpoint: string; instantKey: 'updatedAt' | 'startedAt'; validateId: (value: unknown) => string; } export declare function encodeCursor(spec: CursorSpec, instant: string, id: string): string; export declare function decodeCursor(value: unknown, spec: CursorSpec): { instant: string; id: string; }; export {}; //# sourceMappingURL=repository-support.d.ts.map