Foundtypeno test imports ittype Found = "path" | "store" | "manager";Where an installed copy of a tool was found.
The plan of tools: for each resolved tool and what is observed of it, whether it is as pinned (none), absent (install) or different (replace). A copy found on the path counts only where the policy allows a system copy and the fleet does not ask for exact, hashed tools, and then at the least version the tool states (the version of its pin where it states none); a copy of the store or of a manager counts at the pinned version only, and any version counts where nothing pins one.
import { planTools } from "./plan.ts";
// planTools(resolution, new Map(), context) gives an entry `install` for each resolved toolFoundtypeno test imports ittype Found = "path" | "store" | "manager";Where an installed copy of a tool was found.
ObservedTooltypeno test imports ittype ObservedTool = { readonly version: string; readonly from: Found };What is observed of one tool.
ObservedToolstypeno test imports ittype ObservedTools = ReadonlyMap<ToolName, ObservedTool>;What is observed of the tools of a computer, by name; a tool with no entry is absent.
ToolActiontypeno test imports ittype ToolAction = "none" | "install" | "replace";What must be done about a tool.
ToolPlanEntrytypeno test imports ittype ToolPlanEntry = {
readonly tool: ToolName;
/** The version it is carried out at; none where nothing pins one. */
readonly version: string | undefined;
readonly dialect: DialectId;
readonly action: ToolAction;
readonly observed: ObservedTool | undefined;
};One entry of the plan.
ToolPlantypeno test imports ittype ToolPlan = { readonly platform: string; readonly entries: readonly ToolPlanEntry[] };The plan of tools.
ActionInputtypeno test imports ittype ActionInput = {
readonly seen: ObservedTool | undefined;
/** The version the tool is carried out at; none where nothing pins one. */
readonly version: string | undefined;
/** The least version of a copy found on the path that may be taken. */
readonly minimum: string | undefined;
readonly systemCopy: Context["systemCopy"];
readonly integrity: Context["integrity"];
};What the rule that decides an action reads.
actionForfunctionfunction actionFor(i: ActionInput): ToolActionThe action for one tool: absent is install; a copy on the path counts only where the policy allows a system copy and the fleet does not ask for exact, hashed tools, and then at the least version (the pinned version where none is stated); a copy of the store or of a manager counts at the pinned version only, and any version counts where nothing pins one. The one rule, used by the plan and by the dialects.
planToolsfunctionfunction planTools(resolution: Resolution, observed: ObservedTools, ctx: Context): ToolPlanThe plan for a resolution and what is observed.