import type { BuiltinWorkflowCatalog } from "./catalog.js"; import type { WorkflowDefinition, WorkflowMountedSource, WorkflowSource } from "./types.js"; export type DiscoveredWorkflow = { name: string; ref: string; source: "project" | "global" | "builtin" | "path"; }; export type WorkflowSearchPaths = { cwd: string; homeDir?: string; }; export type ResolvedWorkflow = { definition: WorkflowDefinition; source: WorkflowSource; sources: WorkflowMountedSource[]; sourceKind: DiscoveredWorkflow["source"]; }; /** Directories scanned for user workflow files, in precedence order. */ export declare function workflowSearchDirs(options: WorkflowSearchPaths): { dir: string; source: "project" | "global"; }[]; /** SHA-256 of a user workflow source file. */ export declare function hashWorkflowSource(filePath: string): Promise; export declare function workflowFileStem(filePath: string): string; /** Load a user workflow module from disk. */ export declare function loadWorkflowFile(filePath: string): Promise; /** Discover user workflows first, then unshadowed catalog built-ins. */ export declare function discoverWorkflows(options: WorkflowSearchPaths, catalog?: BuiltinWorkflowCatalog): Promise; /** Resolve a workflow and every nested include before returning it. */ export declare function resolveWorkflowRef(ref: string, options: WorkflowSearchPaths, catalog?: BuiltinWorkflowCatalog): Promise; /** Resolve an already persisted canonical source and its includes. */ export declare function resolveWorkflowSource(source: WorkflowSource, catalog?: BuiltinWorkflowCatalog, runId?: string, options?: WorkflowSearchPaths): Promise;