The builder's reserved version reaches the build in the ask; a holder says when it takes and ends any ask, a builder's build included, so the watchman times every ask; the toolchains key names its program's digest; the checker may drop its own asks until its removal. step-progress and ask-taken name no keep and go on the shared events stream. The delivery SDK's neutral forms follow the part. Builds: design 47 G §472, §548, §549, §552, §573, §602, §603 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
212 lines
6.5 KiB
JavaScript
212 lines
6.5 KiB
JavaScript
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
|
|
|
|
// The contract of the seat "node-build-go", defined whole (seats/node-build-go/seat.json): The Go build module on a node: it takes the asks of the builder and the checker, runs them as steps and answers.
|
|
|
|
export const seat = "node-build-go";
|
|
|
|
export const verbs = {
|
|
current: "current",
|
|
pause: "pause",
|
|
resume: "resume",
|
|
drop: "drop",
|
|
keptArtifact: "kept-artifact",
|
|
steps: "steps",
|
|
};
|
|
|
|
export const accepts = {
|
|
delivery: "delivery",
|
|
check: "check",
|
|
checkStep: "check.step",
|
|
deliveryStep: "delivery.step",
|
|
recheck: "recheck",
|
|
checkRun: "check.run",
|
|
};
|
|
|
|
export const events = {
|
|
stepEnded: "step-ended",
|
|
toolchainReported: "toolchain-reported",
|
|
stepProgress: "step-progress",
|
|
askTaken: "ask-taken",
|
|
};
|
|
|
|
export const family = { name: "node-build-go.events", maxAgeDays: 7 };
|
|
|
|
export const stepEndedStream = "SEAT_node-build-go_step-ended";
|
|
|
|
export function stepEndedSubject(node) {
|
|
return "mesh.seat.node-build-go.event.step-ended." + node;
|
|
}
|
|
|
|
export const stepEndedSubjectAll = "mesh.seat.node-build-go.event.step-ended.*";
|
|
|
|
export const toolchainReportedStream = "SEAT_node-build-go_toolchain-reported";
|
|
|
|
export function toolchainReportedSubject(node) {
|
|
return "mesh.seat.node-build-go.event.toolchain-reported." + node;
|
|
}
|
|
|
|
export const toolchainReportedSubjectAll = "mesh.seat.node-build-go.event.toolchain-reported.*";
|
|
|
|
export function stepProgressSubject(node) {
|
|
return "mesh.seat.node-build-go.event.step-progress." + node;
|
|
}
|
|
|
|
export const stepProgressSubjectAll = "mesh.seat.node-build-go.event.step-progress.*";
|
|
|
|
export function askTakenSubject(node) {
|
|
return "mesh.seat.node-build-go.event.ask-taken." + node;
|
|
}
|
|
|
|
export const askTakenSubjectAll = "mesh.seat.node-build-go.event.ask-taken.*";
|
|
|
|
export const deliverySubject = "mesh.seat.node-build-go.accept.delivery";
|
|
|
|
export const checkSubject = "mesh.seat.node-build-go.accept.check";
|
|
|
|
export const checkStepSubject = "mesh.seat.node-build-go.accept.check.step";
|
|
|
|
export const deliveryStepSubject = "mesh.seat.node-build-go.accept.delivery.step";
|
|
|
|
export const recheckSubject = "mesh.seat.node-build-go.accept.recheck";
|
|
|
|
export const checkRunSubject = "mesh.seat.node-build-go.accept.check.run";
|
|
|
|
export const states = {
|
|
steps: "steps",
|
|
pauses: "pauses",
|
|
toolchains: "toolchains",
|
|
detectedSteps: "detected-steps",
|
|
};
|
|
|
|
/** The key of one value of the state steps under the form "<asker>.<node>.<id>". */
|
|
export function stepsByAskerNodeIDKey(asker, node, id) {
|
|
return asker + "." + node + "." + id;
|
|
}
|
|
|
|
/** The parts of a key of the form "<asker>.<node>.<id>", or undefined for a key of another form. */
|
|
export function parseStepsByAskerNodeIDKey(_key) {
|
|
let _rest = _key;
|
|
const _at0 = _rest.indexOf(".");
|
|
if (_at0 <= 0) return undefined;
|
|
const asker = _rest.slice(0, _at0);
|
|
_rest = _rest.slice(_at0 + 1);
|
|
const _at2 = _rest.indexOf(".");
|
|
if (_at2 <= 0) return undefined;
|
|
const node = _rest.slice(0, _at2);
|
|
_rest = _rest.slice(_at2 + 1);
|
|
if (_rest === "") return undefined;
|
|
const id = _rest;
|
|
_rest = "";
|
|
if (_rest !== "") return undefined;
|
|
return { asker, node, id };
|
|
}
|
|
|
|
/** The key of one value of the state steps under the form "<node>.<id>". */
|
|
export function stepsByNodeIDKey(node, id) {
|
|
return node + "." + id;
|
|
}
|
|
|
|
/** The parts of a key of the form "<node>.<id>", or undefined for a key of another form. */
|
|
export function parseStepsByNodeIDKey(_key) {
|
|
let _rest = _key;
|
|
const _at0 = _rest.indexOf(".");
|
|
if (_at0 <= 0) return undefined;
|
|
const node = _rest.slice(0, _at0);
|
|
_rest = _rest.slice(_at0 + 1);
|
|
if (_rest === "") return undefined;
|
|
const id = _rest;
|
|
_rest = "";
|
|
if (_rest !== "") return undefined;
|
|
return { node, id };
|
|
}
|
|
|
|
/** The key of one value of the state pauses under the form "paused.<node>". */
|
|
export function pausesByPausedNodeKey(node) {
|
|
return "paused." + node;
|
|
}
|
|
|
|
/** The parts of a key of the form "paused.<node>", or undefined for a key of another form. */
|
|
export function parsePausesByPausedNodeKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("paused.")) return undefined;
|
|
_rest = _rest.slice(7);
|
|
if (_rest === "") return undefined;
|
|
const node = _rest;
|
|
_rest = "";
|
|
if (_rest !== "") return undefined;
|
|
return { node };
|
|
}
|
|
|
|
/** The key of one value of the state pauses under the form "dropped.<id>". */
|
|
export function pausesByDroppedIDKey(id) {
|
|
return "dropped." + id;
|
|
}
|
|
|
|
/** The parts of a key of the form "dropped.<id>", or undefined for a key of another form. */
|
|
export function parsePausesByDroppedIDKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("dropped.")) return undefined;
|
|
_rest = _rest.slice(8);
|
|
if (_rest === "") return undefined;
|
|
const id = _rest;
|
|
_rest = "";
|
|
if (_rest !== "") return undefined;
|
|
return { id };
|
|
}
|
|
|
|
/** The key of one value of the state pauses under the form "capacity.<node>". */
|
|
export function pausesByCapacityNodeKey(node) {
|
|
return "capacity." + node;
|
|
}
|
|
|
|
/** The parts of a key of the form "capacity.<node>", or undefined for a key of another form. */
|
|
export function parsePausesByCapacityNodeKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("capacity.")) return undefined;
|
|
_rest = _rest.slice(9);
|
|
if (_rest === "") return undefined;
|
|
const node = _rest;
|
|
_rest = "";
|
|
if (_rest !== "") return undefined;
|
|
return { node };
|
|
}
|
|
|
|
/** The key of one value of the state toolchains under the form "<node>.<language>". */
|
|
export function toolchainsByNodeLanguageKey(node, language) {
|
|
return node + "." + language;
|
|
}
|
|
|
|
/** The parts of a key of the form "<node>.<language>", or undefined for a key of another form. */
|
|
export function parseToolchainsByNodeLanguageKey(_key) {
|
|
let _rest = _key;
|
|
const _at0 = _rest.indexOf(".");
|
|
if (_at0 <= 0) return undefined;
|
|
const node = _rest.slice(0, _at0);
|
|
_rest = _rest.slice(_at0 + 1);
|
|
if (_rest === "") return undefined;
|
|
const language = _rest;
|
|
_rest = "";
|
|
if (_rest !== "") return undefined;
|
|
return { node, language };
|
|
}
|
|
|
|
/** The key of one value of the state detected-steps under the form "<module>.<artifact>". */
|
|
export function detectedStepsByModuleArtifactKey(module, artifact) {
|
|
return module + "." + artifact;
|
|
}
|
|
|
|
/** The parts of a key of the form "<module>.<artifact>", or undefined for a key of another form. */
|
|
export function parseDetectedStepsByModuleArtifactKey(_key) {
|
|
let _rest = _key;
|
|
const _at0 = _rest.indexOf(".");
|
|
if (_at0 <= 0) return undefined;
|
|
const module = _rest.slice(0, _at0);
|
|
_rest = _rest.slice(_at0 + 1);
|
|
if (_rest === "") return undefined;
|
|
const artifact = _rest;
|
|
_rest = "";
|
|
if (_rest !== "") return undefined;
|
|
return { module, artifact };
|
|
}
|
|
|