import type { PipelineConfig, RawPipelineConfig } from './types'; /** * D8: task and track ids must match this pattern. No dots: the `.` is the * qualified-id separator ("trackId.taskId"), so allowing it inside either * part would make qid parsing ambiguous and break every resolver below. */ export declare const TASK_ID_RE: RegExp; /** * Canonical "why is this id invalid" reason string. Single source of truth * for every validator that reports a bad task / track id (sdk schema.ts, * sdk validate-raw.ts, editor frontend) so the wording stays uniform * across parse-time errors, edit-time diagnostics, and UI tooltips. */ export declare const INVALID_TASK_ID_REASON: string; export declare function isValidTaskId(id: unknown): id is string; /** Canonical qualified form used throughout the engine. */ export declare function qualifyTaskId(trackId: string, taskId: string): string; /** Does the reference already include a track prefix? */ export declare function isQualifiedRef(ref: string): boolean; /** * Sentinel stored in `TaskIndex.bareToQualified` when a bare task id is * shared by more than one track, making it unresolvable without a prefix. * Exposed so callers that want to inspect the index directly know what to * look for — but prefer `resolveTaskRef` which returns a typed `kind`. */ export declare const AMBIGUOUS = "__ambiguous__"; export interface TaskIndex { /** All fully-qualified ids ("trackId.taskId") present in the config. */ readonly allQualified: ReadonlySet; /** bare taskId → qid, or the {@link AMBIGUOUS} sentinel. */ readonly bareToQualified: ReadonlyMap; } /** * Build the index used by {@link resolveTaskRef}. Tolerant of partially * malformed configs: tracks or tasks missing an `id` are skipped so the * editor can call this during real-time validation on in-progress edits. */ export declare function buildTaskIndex(config: RawPipelineConfig | PipelineConfig): TaskIndex; export type RefResolution = { readonly kind: 'resolved'; readonly qid: string; } | { readonly kind: 'ambiguous'; readonly ref: string; } | { readonly kind: 'not_found'; readonly ref: string; }; /** * Resolve a dependency / continue_from reference to a canonical qid. * * 1. If the ref already contains a `.`, treat it as fully qualified — * return `resolved` when the qid exists, `not_found` otherwise. * 2. Otherwise, prefer the same-track shorthand (`fromTrackId.ref`). * 3. Fall back to a global bare lookup. Returns `ambiguous` when more * than one track has a task with that bare name. * * Callers decide the policy: `buildDag` throws on non-resolved, `buildRawDag` * skips silently, `validateRaw` emits a structured ValidationError. */ export declare function resolveTaskRef(ref: string, fromTrackId: string, index: TaskIndex): RefResolution; //# sourceMappingURL=task-ref.d.ts.map