Regenerate the domain contracts; hand-acts and conditions clients; operator-channel client moves; the seat-set package ends (ADR 0634, ADR 0635; issue 1966)
Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
@@ -43,6 +43,121 @@ export function manifestReadsChangedSubject(caller: string): string {
|
||||
return "mesh.seat.node-engine.event.manifest-reads-changed." + caller;
|
||||
}
|
||||
|
||||
export const states = {
|
||||
have: "have",
|
||||
composed: "composed",
|
||||
data: "data",
|
||||
packages: "packages",
|
||||
health: "health",
|
||||
} as const;
|
||||
|
||||
/** The key of one value of the state have under the form "<node>.<module>". */
|
||||
export function haveByNodeModuleKey(node: string, module: string): string {
|
||||
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: string): { node: string; module: string } | undefined {
|
||||
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: string): string {
|
||||
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: string): { node: string } | undefined {
|
||||
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: string, module: string, fingerprint: string): string {
|
||||
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: string): { node: string; module: string; fingerprint: string } | undefined {
|
||||
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 data under the form "<node>.<module>". */
|
||||
export function dataByNodeModuleKey(node: string, module: string): string {
|
||||
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: string): { node: string; module: string } | undefined {
|
||||
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: string): string {
|
||||
return node;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<node>", or undefined for a key of another form. */
|
||||
export function parsePackagesByNodeKey(key: string): { node: string } | undefined {
|
||||
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: string): string {
|
||||
return node;
|
||||
}
|
||||
|
||||
/** The parts of a key of the form "<node>", or undefined for a key of another form. */
|
||||
export function parseHealthByNodeKey(key: string): { node: string } | undefined {
|
||||
let rest = key;
|
||||
if (rest === "") return undefined;
|
||||
const node = rest;
|
||||
rest = "";
|
||||
if (rest !== "") return undefined;
|
||||
return { node };
|
||||
}
|
||||
|
||||
/** one act asked through the seat, as acts reads it (ADR 0563 §9) */
|
||||
export interface Act {
|
||||
/** the act: hand-over, access-act, judge-directories or setuid-search */
|
||||
@@ -505,3 +620,103 @@ export type RefusedEvent = ActSaid;
|
||||
/** is the body of the event manifest-reads-changed. */
|
||||
export type ManifestReadsChangedEvent = ManifestReadsChanged;
|
||||
|
||||
/** is one value of the state have under the key <node>.<module>. */
|
||||
export interface HaveByNodeModuleValue {
|
||||
"build"?: string;
|
||||
"build-alone"?: boolean;
|
||||
/** the composition's digest */
|
||||
"composed"?: string;
|
||||
"detail"?: string;
|
||||
/** the fingerprint held */
|
||||
"fp"?: string;
|
||||
/** the accounts handed */
|
||||
"handed"?: Record<string, unknown>;
|
||||
/** how it is */
|
||||
"health": string;
|
||||
"judgement"?: string;
|
||||
"kept"?: string[];
|
||||
/** how far it has come */
|
||||
"phase": string;
|
||||
/** a pull the engine waits for */
|
||||
"pull-wait"?: Record<string, unknown>;
|
||||
"sealed"?: string[];
|
||||
"sealed-at"?: Record<string, unknown>;
|
||||
/** the user list written */
|
||||
"user-list"?: Record<string, unknown>;
|
||||
"v": number;
|
||||
/** what it waits for */
|
||||
"waits"?: string;
|
||||
}
|
||||
|
||||
/** is one value of the state have under the key <node>.node. */
|
||||
export interface HaveByNodeNodeValue {
|
||||
"busy"?: Record<string, unknown>;
|
||||
"candidates"?: Record<string, Record<string, unknown>>;
|
||||
"composed"?: string;
|
||||
/** own, or the controller's */
|
||||
"composes"?: string;
|
||||
"composes-why"?: string;
|
||||
"filters"?: Record<string, unknown>;
|
||||
"profile"?: Record<string, unknown>;
|
||||
/** the node's record: its tunnel and certificate */
|
||||
"record"?: Record<string, unknown>;
|
||||
"sealed"?: string[];
|
||||
"sealed-at"?: Record<string, unknown>;
|
||||
"strays"?: Record<string, unknown>;
|
||||
"v": number;
|
||||
"windows"?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
/** is one value of the state composed under the key <node>.<module>.<fingerprint>. */
|
||||
export interface ComposedByNodeModuleFingerprintValue {
|
||||
"Data"?: boolean;
|
||||
"FP": string;
|
||||
"Filled"?: string[];
|
||||
"Module": string;
|
||||
"Node": string;
|
||||
/** the node's own adoption, identities, groups, libraries and provisioner account */
|
||||
"Own"?: Record<string, unknown>;
|
||||
/** the module's plan */
|
||||
"Plan"?: Record<string, unknown>;
|
||||
/** why the composition was refused */
|
||||
"Refused"?: string;
|
||||
"Resources"?: Record<string, unknown>[];
|
||||
"V"?: number;
|
||||
}
|
||||
|
||||
/** is one value of the state data under the key <node>.<module>. */
|
||||
export interface DataByNodeModuleValue {
|
||||
"digest": string;
|
||||
"items": Record<string, unknown>[];
|
||||
"module": string;
|
||||
"node": string;
|
||||
"v"?: number;
|
||||
}
|
||||
|
||||
export interface PackagesByNodeValuePackagesItem {
|
||||
"absent"?: boolean;
|
||||
"modules"?: string[];
|
||||
"package"?: string;
|
||||
}
|
||||
|
||||
/** is one value of the state packages under the key <node>. */
|
||||
export interface PackagesByNodeValue {
|
||||
"node": string;
|
||||
"packages": PackagesByNodeValuePackagesItem[];
|
||||
}
|
||||
|
||||
/** is one value of the state health under the key <node>. */
|
||||
export interface HealthByNodeValue {
|
||||
"at": string;
|
||||
"contract"?: number;
|
||||
"fallback"?: Record<string, unknown>;
|
||||
"found"?: Record<string, unknown>[];
|
||||
"network"?: Record<string, unknown>;
|
||||
"node": string;
|
||||
"peers"?: Record<string, unknown>[];
|
||||
"relogin"?: Record<string, unknown>[];
|
||||
"root"?: Record<string, unknown>[];
|
||||
"units"?: Record<string, unknown>;
|
||||
"v": number;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user