/** * Where a dry run's key lands: the `agent`, `check`, `commit`, `ask` or * `flow` node it names, and the most answers a list under it can be asked for. * * A node's address (`review/code`) is answered within its enclosing path, so * every iteration of every loop around it draws on one list, and each attempt * `retry:` allows takes one answer. An exact visit path * (`deliver#2/work[1]/review#3/code`) is one visit, and walking it holds each * iteration and each item to the bound its block has. A `flow` node is * answered whole by a key on it, or walked into by keys under it, whose * addresses go through the call: `spec/ask_next`. */ import type { CheckedAgentNode, CheckedAskNode, CheckedCallNode, CheckedCheckNode, CheckedCommitNode, CheckedNode } from "../checked.ts"; /** A node a script answers: an agent turn, a check's script run, a commit, a question, or a call whole. */ export type AnsweredNode = CheckedAgentNode | CheckedCheckNode | CheckedCommitNode | CheckedAskNode | CheckedCallNode; /** The node a key names, its address through the calls, and how many answers its list can be asked for. */ export type Keyed = { readonly node: AnsweredNode; readonly at: string; readonly most: number; }; /** Why a key names no visit: a path that leads nowhere, or an iteration or item past its bound. */ export type Unkeyed = { readonly code: "answer-unknown-node" | "answer-past-max"; readonly why?: string; }; /** * Every answered node by address, each asked at most once per attempt per * iteration of the loops around it, a callee's inside its call's `prefix`. */ export declare function answeredNodes(nodes: readonly CheckedNode[], loops?: number, into?: Map, prefix?: string): Map; /** The visit `path` names, walked down from `nodes`, when it is one a script answers. */ export declare function visitAt(nodes: readonly CheckedNode[], path: string): Keyed | Unkeyed; /** * The node whose visit `path` names, of any kind, and its address through the * calls. Each loop the path goes through numbers its iteration `#n` and each * `map` its item `[i]`, within their bounds; a loop's or a map's own visit is * named without. */ export declare function nodeAt(nodes: readonly CheckedNode[], path: string): { readonly node: CheckedNode; readonly at: string; } | Unkeyed; /** The keys under a call another key answers whole, each with that key: none of them would be asked. */ export declare function overlaps(keys: ReadonlyMap): { readonly key: string; readonly whole: string; }[]; /** Why `key` names no visit, offering the address meant when it can. */ export declare function unkeyed(key: string, { code, why }: Unkeyed, nodes: ReadonlyMap): string; //# sourceMappingURL=keys.d.ts.map