/** * Checking a `flow` node: its callee resolved in the run's catalogue and * checked whole, the call graph held free of cycles, and what crosses the * boundary, `input` in and the callee's last root node's output back. * * Nothing else crosses it: a callee sees none of its caller's scopes, ledgers * or prose, so it is checked on its own, once however many nodes call it, * and every flow is valid on its own. The world does cross. What a callee * does to the tree counts where the call stands, so a commit it holds is * refused inside a `copies: true` block, the fault naming the call path. */ import { AgentNames } from "./agents.ts"; import type { FlowCatalogue, FoundFlow } from "./catalogue.ts"; import type { CheckedOne, Checker, CheckFlow } from "./check.ts"; import type { CheckedFlow } from "./checked.ts"; import type { FaultList } from "./fault.ts"; import { type ReadFlow } from "./file.ts"; import { type CallNode } from "./node.ts"; import type { Scope } from "./scope.ts"; /** How a flow file is checked, given the callees its calls resolve through. */ export type CheckFile = (source: FoundFlow, read: ReadFlow, callees: Callees) => CheckFlow; /** * The flows of one catalogue, each read once and checked once, whoever calls * it: the root of a check and every flow it reaches share one. */ export declare class Callees { readonly agents: AgentNames; private readonly catalogue; private readonly checkFile; private readonly read; private readonly checked; constructor(catalogue: FlowCatalogue, checkFile: CheckFile); /** The flow file named `name`, when the catalogue has one. */ source(name: string): FoundFlow | undefined; /** The flow in `source` checked, the first time it is asked for. */ check(source: FoundFlow): CheckFlow; /** * The flow `name`, called at `at` by the flow `caller`, checked; or * `undefined` after saying why not. A call that leads back to its caller, * however far down, is refused before the callee is checked, so the check * itself always ends. */ resolve(name: string, caller: string, at: string, faults: FaultList): CheckedFlow | undefined; /** The call path from `from` to `to`, `[from, ..., to]`, when `from` reaches it through the calls written in the files. */ private path; /** The names the flow `name` calls, behind a `choice` or not: a cycle is refused whether it would be taken or not. */ private callsOf; private readOf; } /** A `flow` node: its callee, what it hands in, and what the callee does that its place refuses. */ export declare function checkCall(checker: Checker, node: CallNode, scope: Scope): CheckedOne; //# sourceMappingURL=check-call.d.ts.map