Files
mesh-contracts/ts/seats/nodeengine/index.js
T
jschoubben e529c372d0 C14: the generated Go and TypeScript of every seat follow the definitions
Written by seatgen at c62650e4 (GEN3) with mesh-sdk b19fc7fa (reader release): the seat mesh-grants new,
every TypeScript contract as index.js with index.d.ts, events with subject and stream. mesh-watchdogs gains
its family, which a definition with events needs. Written with the reader as it is: the field needs-approval
(node-login-shell) and the section bodies (mesh-conditions) are unknown to it, so they were laid aside for
the run; nothing generated carries either.

Builds: design 47 G §339, §341, §261, §389

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
2026-11-11 10:45:30 +01:00

219 lines
7.0 KiB
JavaScript

// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "node-engine", defined whole (seats/node-engine/seat.json): The node seat every node's engine holds (novox/hq ADR 0563, ADR 0618 §3, §4): its hand acts on the operator's warrant, its read-only judgements, its compositions and what it reads of a manifest. Each verb is answered on this node's subject, mesh.seat.node-engine.tool.<verb>.<node>, and each event is published on mesh.seat.node-engine.event.<event>.<node>, the node's name its last token, or, for an event whose subject names <node>, there (composed.<node>, running.<node>.<module>): the grants part grants a node's account only its own node's subjects (ADR 0363 §2).
export const seat = "node-engine";
export const verbs = {
handOver: "hand-over",
accessAct: "access-act",
judgeDirectories: "judge-directories",
setuidSearch: "setuid-search",
rootFree: "root-free",
acts: "acts",
packages: "packages",
composition: "composition",
compose: "compose",
composeCandidate: "compose-candidate",
manifestReads: "manifest-reads",
seatList: "seat-list",
seatListAgain: "seat-list-again",
processBuilds: "process-builds",
};
export const events = {
asked: "asked",
done: "done",
refused: "refused",
manifestReadsChanged: "manifest-reads-changed",
composed: "composed",
running: "running",
capabilitiesChanged: "capabilities-changed",
};
export const family = { name: "node-engine.events", maxAgeDays: 7 };
export function askedSubject(caller) {
return "mesh.seat.node-engine.event.asked." + caller;
}
export function doneSubject(caller) {
return "mesh.seat.node-engine.event.done." + caller;
}
export function refusedSubject(caller) {
return "mesh.seat.node-engine.event.refused." + caller;
}
export function manifestReadsChangedSubject(caller) {
return "mesh.seat.node-engine.event.manifest-reads-changed." + caller;
}
export function composedSubject(node) {
return "mesh.seat.node-engine.event.composed." + node;
}
export const composedSubjectAll = "mesh.seat.node-engine.event.composed.*";
export const runningStream = "SEAT_node-engine_running";
export function runningSubject(node, module) {
return "mesh.seat.node-engine.event.running." + node + "." + module;
}
export const runningSubjectAll = "mesh.seat.node-engine.event.running.*.*";
export function capabilitiesChangedSubject(node) {
return "mesh.seat.node-engine.event.capabilities-changed." + node;
}
export const capabilitiesChangedSubjectAll = "mesh.seat.node-engine.event.capabilities-changed.*";
export const states = {
have: "have",
composed: "composed",
data: "data",
packages: "packages",
health: "health",
findings: "findings",
};
/** The key of one value of the state have under the form "<node>.<module>". */
export function haveByNodeModuleKey(node, module) {
return node + "." + module;
}
/** The parts of a key of the form "<node>.<module>", or undefined for a key of another form. */
export function parseHaveByNodeModuleKey(_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 module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, module };
}
/** The key of one value of the state have under the form "<node>.node". */
export function haveByNodeNodeKey(node) {
return node + ".node";
}
/** The parts of a key of the form "<node>.node", or undefined for a key of another form. */
export function parseHaveByNodeNodeKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".node");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 5);
if (_rest !== "") return undefined;
return { node };
}
/** The key of one value of the state composed under the form "<node>.<module>.<fingerprint>". */
export function composedByNodeModuleFingerprintKey(node, module, fingerprint) {
return node + "." + module + "." + fingerprint;
}
/** The parts of a key of the form "<node>.<module>.<fingerprint>", or undefined for a key of another form. */
export function parseComposedByNodeModuleFingerprintKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 1);
const _at2 = _rest.indexOf(".");
if (_at2 <= 0) return undefined;
const module = _rest.slice(0, _at2);
_rest = _rest.slice(_at2 + 1);
if (_rest === "") return undefined;
const fingerprint = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, module, fingerprint };
}
/** The key of one value of the state composed under the form "<node>.node". */
export function composedByNodeNodeKey(node) {
return node + ".node";
}
/** The parts of a key of the form "<node>.node", or undefined for a key of another form. */
export function parseComposedByNodeNodeKey(_key) {
let _rest = _key;
const _at0 = _rest.indexOf(".node");
if (_at0 <= 0) return undefined;
const node = _rest.slice(0, _at0);
_rest = _rest.slice(_at0 + 5);
if (_rest !== "") return undefined;
return { node };
}
/** The key of one value of the state data under the form "<node>.<module>". */
export function dataByNodeModuleKey(node, module) {
return node + "." + module;
}
/** The parts of a key of the form "<node>.<module>", or undefined for a key of another form. */
export function parseDataByNodeModuleKey(_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 module = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node, module };
}
/** The key of one value of the state packages under the form "<node>". */
export function packagesByNodeKey(node) {
return node;
}
/** The parts of a key of the form "<node>", or undefined for a key of another form. */
export function parsePackagesByNodeKey(_key) {
let _rest = _key;
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
/** The key of one value of the state health under the form "<node>". */
export function healthByNodeKey(node) {
return node;
}
/** The parts of a key of the form "<node>", or undefined for a key of another form. */
export function parseHealthByNodeKey(_key) {
let _rest = _key;
if (_rest === "") return undefined;
const node = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { node };
}
/** The key of one value of the state findings under the form "<key>". */
export function findingsByKeyKey(key) {
return key;
}
/** The parts of a key of the form "<key>", or undefined for a key of another form. */
export function parseFindingsByKeyKey(_key) {
let _rest = _key;
if (_rest === "") return undefined;
const key = _rest;
_rest = "";
if (_rest !== "") return undefined;
return { key };
}