How a verb of repoctl is declared on Headless (commons repoctl 0006-repoctl-surfacesFR-001, FR-004; commons headless 0003-headless-output, 0004-headless-cli): a verb is declared once with its words, options, operands and examples, and its action's traits come from the facts table of Governance (VERBS), so that what the command line, the tool server and the documentation say of it is one fact. The body returns the findings and the data of the run; this turns them into Headless' outcome, with the code and the fix of each finding as the problem it is.
typeHost= {
readonlyenv: (name:string) =>string|undefined;
readonlyworld: () =>Result<World, string>;
/** The repository's configuration, read and checked: everything the verbs know of it. Where there is none (or it is wrong) it is the bare one and `configProblem` says why. */readonlyconfig:Config;
/** Why the configuration could not be had: a verb that needs it ends with this, and `doctor` reports it. */readonlyconfigProblem?: { readonlycode:"E-CONFIG-MISSING"|"E-CONFIG-LOAD"|"E-CONFIG-INVALID"; readonlymessage:string };
/** What `release apply` runs besides the planner (the generators of the release and the tests that pack): the real ones where it is not given. */readonlyreleasing?:ReleasingHost;
};
What the program holds for every run of its verbs: the environment, and the world, made where it is needed (it needs the repository's root, which a documentation lens has not got).
type VerbDefinition<S extends Spec> = {
readonly name: string;
readonly id: VerbId;
readonly options: S & SpecChec…(492 characters)
typeVerbDefinition<SextendsSpec> = {
readonlyname:string;
readonlyid:VerbId;
readonlyoptions:S&SpecCheck<S>;
readonlyoperands?:readonlyOperand[];
readonlyexamples:readonlyExample[];
readonlyrun: (args:Args<S>, ctx:Context, world:World, host:Host) =>Promise<Outcome>;
/** Whether the verb is run only where the repository has a valid configuration (the default); `doctor` is not, since it is what says there is none. */readonlyneedsConfig?:boolean;
};
A verb from its declaration: its summary and traits are the table's, and its body runs in the world of the host, or ends with the sentence that says the checkout was not found.
typeHost= {
readonlyenv: (name:string) =>string|undefined;
readonlyworld: () =>Result<World, string>;
/** The repository's configuration, read and checked: everything the verbs know of it. Where there is none (or it is wrong) it is the bare one and `configProblem` says why. */readonlyconfig:Config;
/** Why the configuration could not be had: a verb that needs it ends with this, and `doctor` reports it. */readonlyconfigProblem?: { readonlycode:"E-CONFIG-MISSING"|"E-CONFIG-LOAD"|"E-CONFIG-INVALID"; readonlymessage:string };
/** What `release apply` runs besides the planner (the generators of the release and the tests that pack): the real ones where it is not given. */readonlyreleasing?:ReleasingHost;
};
What the program holds for every run of its verbs: the environment, and the world, made where it is needed (it needs the repository's root, which a documentation lens has not got).
type VerbDefinition<S extends Spec> = {
readonly name: string;
readonly id: VerbId;
readonly options: S & SpecChec…(492 characters)
typeVerbDefinition<SextendsSpec> = {
readonlyname:string;
readonlyid:VerbId;
readonlyoptions:S&SpecCheck<S>;
readonlyoperands?:readonlyOperand[];
readonlyexamples:readonlyExample[];
readonlyrun: (args:Args<S>, ctx:Context, world:World, host:Host) =>Promise<Outcome>;
/** Whether the verb is run only where the repository has a valid configuration (the default); `doctor` is not, since it is what says there is none. */readonlyneedsConfig?:boolean;
};
A verb from its declaration: its summary and traits are the table's, and its body runs in the world of the host, or ends with the sentence that says the checkout was not found.