Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-tool-command FR-001
What a fleet gives the plugin: the catalog of tools it needs, the dialects it chose with the way each is run and observed, the pins, the policy tools are resolved under, which computer this is and the folder the rendered files go in. The plugin holds none of it, so that two fleets with different tools and different dialects use the same plugin.
importtype { ToolPluginConfig } from"./config.ts";
// a fleet builds a ToolPluginConfig in its composition root and passes it to toolPlugin
type ToolRuntime = {
/** How Toolchain reads it: its id, its manager, what it guarantees. */
readonly tool: ToolDial…(643 characters)
typeToolRuntime= {
/** How Toolchain reads it: its id, its manager, what it guarantees. */readonlytool:ToolDialect;
/** How Archon renders and steps it. */readonlydialect:Dialect;
/** What is installed, as the desired state itself for a tool that is as asked and a state that differs for one that is not. */readonlyobserve: (requirements:readonlyRequirement[]) =>Promise<ReadonlyMap<RequirementId, JsonValue>>;
/** Removes what can be got again; the lines say what was removed. A dialect with nothing to clean leaves it out. */readonlyclean?: (o: { readonlyprograms:boolean }) =>Promise<readonlystring[]>;
};
A dialect the fleet chose, with what the plugin needs to resolve, carry out, observe and clean with it.
type ToolPluginConfig = {
/** The version of the plugin as published. */
readonly version: string;
/** The program…(1010 characters)
typeToolPluginConfig= {
/** The version of the plugin as published. */readonlyversion:string;
/** The program the plugin extends: `archon` by default; another command (a fleet's own) may use the same plugin. */readonlyprogram?:string;
readonlycatalog:Catalog;
readonlyruntimes:readonlyToolRuntime[];
/** The dialects, most preferred first. */readonlypreference:readonlyDialectId[];
readonlypins:PinSource;
/** The policy tools are resolved under (the platform, the control `toolIntegrity`, whether a copy on the path counts, whether source builds are approved). */readonlypolicy:Omit<Context, "preference"|"platform"> & { readonlyplatform:Platform };
/** The name of this computer, as the fleet names it. */readonlysubject:string;
/** The assurance profile of the fleet. */readonlyassurance:ProfileName;
/** The folder the rendered files go in, under `.archon/<digest>/`, and the working folder of every step. */readonlyworkFolder:string;
};