import type { TrustedModules } from "../../compiler/trustedModules.js"; import { type Problem, type Signature } from "../../stdlib/workflow/types.js"; /** A standard module, as a step's `module` field names one. `isStdlibImport` * checks only the prefix, so `std::../../x` would pass it and `MODULE_PATH`. */ export declare const STD_MODULE: RegExp; export type DescribedModule = { /** As a step's `module` field writes it: `std::math`, or `./tools/notes.agency`. */ module: string; /** Each exported def's Signature, keyed by its name. */ signatures: Record; }; /** Why a module could not be described. `reachable` is false for a module * that is missing, outside `dir`, or not a module path at all: those are * left for `checkWorkflow` to report on the step. A reachable module that * still fails, such as one that does not parse, is reported here. */ export type DescribeError = { error: string; reachable: boolean; }; /** `trustedModules` is the project's resolved list, so a tool module whose * body calls TypeScript describes (docs/dev/runtime/trusted-modules.md). */ export declare function describeModule(module: string, dir: string, trustedModules: TrustedModules[]): DescribedModule | DescribeError; export type ToolImport = { module: string; names: string[]; }; export type ImportPlan = { /** One import line's worth per module, in first-use order. */ imports: ToolImport[]; /** Signatures of every imported tool, keyed by signatureKey(module, name). */ signatures: Record; problems: Problem[]; }; /** `check`, `compile`, and `run`: the tools the steps name. */ export declare function importsForSteps(workflow: unknown, dir: string, trustedModules: TrustedModules[]): ImportPlan; /** `tools`: every def of each source. A source is a .agency path or a std:: * module. A local source is written as `./`. */ export declare function importsForSources(sources: string[], dir: string, cwd: string, trustedModules: TrustedModules[]): ImportPlan | { error: string; };