Candidatestypetype Candidates = {
readonly [S in ModuleSource as Uncapitalize<S>]: readonly Found[];
};The modules each source holds.
Finding a module (commons 0001-ergonex FR-003, FR-004, FR-011): the typed built-in modules first, then the modules the workspace registers in <home>/.ergonex/modules.auto.json, then the executables named ergonex-* on the PATH, as Git finds git-foo for git foo. The first found runs; a module of a later source that it hides is an informational finding.
Pure: the three lists are read by the host layer and handed over; this module orders them, picks the first of each name and names what is hidden. A registered module may carry the SHA-256 of its program, which ergonex checks before running it (the check is programMatches, the read of the program is the host's).
Candidatestypetype Candidates = {
readonly [S in ModuleSource as Uncapitalize<S>]: readonly Found[];
};The modules each source holds.
decodeRegisteredfunctionfunction decodeRegistered(text: string): Result<readonly RegisteredModule[], string>The modules a modules.auto.json registers, or why it cannot be read (a name that is not a module name, a hash that is not a SHA-256, the same name twice).
findModulefunctionfunction findModule(c: Candidates, name: string): Found | undefinedThe module a name finds, or undefined.
Foundtypetype Found = {
readonly name: string;
readonly source: ModuleSource;
readonly summary: string;
readonly where: string;
readonly sha256?: Sha256;
};A module found: its name, where it was found, what it says it does and where its program is (built-in for a typed module).
resolveAllfunctionfunction resolveAll(c: Candidates): ResolvedThe first module of each name in the order of the sources, in the order of the names, and every later one it hides.