import { type ResultFailure, type ResultSuccess } from "../../runtime/result.js"; import { type Diagnostic } from "./problems.js"; import type { Owner, Problem, Range, Signature, ToolRef } from "./types.js"; export { _workflowNameProblem } from "./parse.js"; export { catalogEntries as _catalogEntries } from "./catalog.js"; export type Compiled = { source: string; ranges: Range[]; typeOwners: Record; warnings: Problem[]; /** The subprocess limit for a run, or null for `run`'s default. */ wallClock: number | null; }; export type CompileResult = { compiled: Compiled; problems: []; } | { compiled: null; problems: Problem[]; }; /** Parse, resolve, lower, and render, stopping at the first stage with problems. * Render finds none: everything it writes passed parse. */ export declare function compileWorkflowSource(value: unknown, refs: ToolRef[], signatures: Record): CompileResult; /** One problem as a line: `step add, args.listId: `. */ export declare function describeProblem({ step, field, message }: Problem): string; /** A failure whose message lists the problems and whose data carries them. */ export declare function _problemsFailure(problems: Problem[]): ResultFailure; /** The tools as import references, or a failure naming every tool that * cannot be imported. */ export declare function _toolRefs(tools: unknown[], dir: string): ResultSuccess | ResultFailure; /** One module's tools. `reExport` is the line `describe` reads for a shared * module; a local file has none and is read from disk. */ export type SignatureSource = { module: string; names: string[]; reExport: string | null; }; export declare function _signatureSources(refs: ToolRef[]): SignatureSource[]; type DescribedExport = { name: string; kind: string; } & Signature; /** Each of `source`'s names, keyed by module and name, from what `describe` * said about the module. A name the module re-exports from another local * file is refused: `describe` cannot read that file, so the return type * would be unknown. */ export declare function _pickSignatures(source: SignatureSource, exports: DescribedExport[]): ResultSuccess | ResultFailure; export declare function _compileWorkflowSource(value: unknown, refs: ToolRef[], signatures: Record): ResultSuccess | ResultFailure; /** A failure for one problem that belongs to the whole workflow. */ export declare function _workflowFailure(message: string): ResultFailure; export declare function _problemsFromDiagnostics(diagnostics: Diagnostic[], ranges: Range[], typeOwners: Record): Problem[]; export { _compileTrusted, _typecheckTrusted, _describeTrusted } from "./trusted.js";