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:
2026-11-05 13:19:37 +01:00
parent 23a759c78b
commit 211bdcaa5e
62 changed files with 3808 additions and 8976 deletions
@@ -0,0 +1,285 @@
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// Package meshprovisioner is the contract of the seat "mesh-provisioner", defined whole (seats/mesh-provisioner/seat.json): The provisioner (ADR 0349): which domain answers which kind of placeholder, what each module needs, what is applied where.
package meshprovisioner
import (
"bytes"
"encoding/json"
"errors"
"strings"
)
// Seat is the seat's name.
const Seat = "mesh-provisioner"
const (
VerbProvisioning = "provisioning"
)
// Verbs is every verb the seat serves, in its definition's order: a new copy each call.
func Verbs() []string {
return []string{VerbProvisioning}
}
const (
StatePlans = "plans"
StateProvisions = "provisions"
)
// PlansByNodeModuleKey is the key of one value of the state plans under the form "<node>.<module>".
func PlansByNodeModuleKey(node, module string) string { return node + "." + module }
// ParsePlansByNodeModuleKey reads the parts of a key of the form "<node>.<module>", in the order of the form; the last result is false for a key of another form.
func ParsePlansByNodeModuleKey(key string) (string, string, bool) {
rest := key
v0, after0, found0 := strings.Cut(rest, ".")
if !found0 || v0 == "" {
return "", "", false
}
rest = after0
if rest == "" {
return "", "", false
}
v2 := rest
rest = ""
if rest != "" {
return "", "", false
}
return v0, v2, true
}
// DecodePlansByNodeModuleValue reads one value of the state plans under the form "<node>.<module>", refusing a field PlansByNodeModuleValue does not know and any text after the value.
func DecodePlansByNodeModuleValue(raw []byte) (PlansByNodeModuleValue, error) {
var v PlansByNodeModuleValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// ProvisionsByNodeConsumerProvisionKey is the key of one value of the state provisions under the form "<node>.<consumer>.<provision>".
func ProvisionsByNodeConsumerProvisionKey(node, consumer, provision string) string {
return node + "." + consumer + "." + provision
}
// ParseProvisionsByNodeConsumerProvisionKey reads the parts of a key of the form "<node>.<consumer>.<provision>", in the order of the form; the last result is false for a key of another form.
func ParseProvisionsByNodeConsumerProvisionKey(key string) (string, string, string, bool) {
rest := key
v0, after0, found0 := strings.Cut(rest, ".")
if !found0 || v0 == "" {
return "", "", "", false
}
rest = after0
v2, after2, found2 := strings.Cut(rest, ".")
if !found2 || v2 == "" {
return "", "", "", false
}
rest = after2
if rest == "" {
return "", "", "", false
}
v4 := rest
rest = ""
if rest != "" {
return "", "", "", false
}
return v0, v2, v4, true
}
// DecodeProvisionsByNodeConsumerProvisionValue reads one value of the state provisions under the form "<node>.<consumer>.<provision>", refusing a field ProvisionsByNodeConsumerProvisionValue does not know and any text after the value.
func DecodeProvisionsByNodeConsumerProvisionValue(raw []byte) (ProvisionsByNodeConsumerProvisionValue, error) {
var v ProvisionsByNodeConsumerProvisionValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// ProvisionsByNodeConsumerProvisionLocalKey is the key of one value of the state provisions under the form "<node>.<consumer>.<provision>.<local>".
func ProvisionsByNodeConsumerProvisionLocalKey(node, consumer, provision, local string) string {
return node + "." + consumer + "." + provision + "." + local
}
// ParseProvisionsByNodeConsumerProvisionLocalKey reads the parts of a key of the form "<node>.<consumer>.<provision>.<local>", in the order of the form; the last result is false for a key of another form.
func ParseProvisionsByNodeConsumerProvisionLocalKey(key string) (string, string, string, string, bool) {
rest := key
v0, after0, found0 := strings.Cut(rest, ".")
if !found0 || v0 == "" {
return "", "", "", "", false
}
rest = after0
v2, after2, found2 := strings.Cut(rest, ".")
if !found2 || v2 == "" {
return "", "", "", "", false
}
rest = after2
v4, after4, found4 := strings.Cut(rest, ".")
if !found4 || v4 == "" {
return "", "", "", "", false
}
rest = after4
if rest == "" {
return "", "", "", "", false
}
v6 := rest
rest = ""
if rest != "" {
return "", "", "", "", false
}
return v0, v2, v4, v6, true
}
// DecodeProvisionsByNodeConsumerProvisionLocalValue reads one value of the state provisions under the form "<node>.<consumer>.<provision>.<local>", refusing a field ProvisionsByNodeConsumerProvisionLocalValue does not know and any text after the value.
func DecodeProvisionsByNodeConsumerProvisionLocalValue(raw []byte) (ProvisionsByNodeConsumerProvisionLocalValue, error) {
var v ProvisionsByNodeConsumerProvisionLocalValue
dec := json.NewDecoder(bytes.NewReader(raw))
dec.DisallowUnknownFields()
if err := dec.Decode(&v); err != nil {
return v, err
}
if dec.More() {
return v, errors.New("text after the value")
}
return v, nil
}
// ProvisioningInput is what provisioning takes.
type ProvisioningInput struct {
// for collect: a collection
Collection string `json:"collection,omitempty"`
// a module: for collect, a contributor
Module string `json:"module,omitempty"`
// a node
Node string `json:"node,omitempty"`
// registry (when not given), needs, applied or collect
What string `json:"what,omitempty"`
}
// ProvisioningAnswer is what provisioning answers.
type ProvisioningAnswer = map[string]any
// PlansByNodeModuleValue is one value of the state plans under the key <node>.<module>.
type PlansByNodeModuleValue struct {
Module string `json:"module"`
Node string `json:"node"`
// the module's plan
Plan map[string]any `json:"plan"`
V int64 `json:"v,omitempty"`
}
// ProvisionsByNodeConsumerProvisionValueConsumer is a type of the contract.
type ProvisionsByNodeConsumerProvisionValueConsumer struct {
Module string `json:"module,omitempty"`
Node string `json:"node,omitempty"`
}
// ProvisionsByNodeConsumerProvisionValueProvider is a type of the contract.
type ProvisionsByNodeConsumerProvisionValueProvider struct {
Module string `json:"module,omitempty"`
Node string `json:"node,omitempty"`
}
// ProvisionsByNodeConsumerProvisionValueReference is a type of the contract.
type ProvisionsByNodeConsumerProvisionValueReference struct {
Generation int64 `json:"generation,omitempty"`
ID string `json:"id,omitempty"`
}
// ProvisionsByNodeConsumerProvisionValueWarrant is a type of the contract.
type ProvisionsByNodeConsumerProvisionValueWarrant struct {
Ask string `json:"ask,omitempty"`
At string `json:"at,omitempty"`
By string `json:"by,omitempty"`
Option string `json:"option,omitempty"`
}
// ProvisionsByNodeConsumerProvisionValue is one value of the state provisions under the key <node>.<consumer>.<provision>.
type ProvisionsByNodeConsumerProvisionValue struct {
Ask string `json:"ask,omitempty"`
At string `json:"at"`
Consumer ProvisionsByNodeConsumerProvisionValueConsumer `json:"consumer"`
DependsOn []string `json:"depends-on,omitempty"`
Local string `json:"local,omitempty"`
// the plan's provision
Plan map[string]any `json:"plan,omitempty"`
Provider ProvisionsByNodeConsumerProvisionValueProvider `json:"provider"`
Provision string `json:"provision"`
Reference *ProvisionsByNodeConsumerProvisionValueReference `json:"reference,omitempty"`
State string `json:"state"`
V int64 `json:"v,omitempty"`
Warrant *ProvisionsByNodeConsumerProvisionValueWarrant `json:"warrant,omitempty"`
Why string `json:"why,omitempty"`
}
// The values of ProvisionsByNodeConsumerProvisionValue's state.
const (
ProvisionsByNodeConsumerProvisionValueStateAsked = "asked"
ProvisionsByNodeConsumerProvisionValueStateProvided = "provided"
ProvisionsByNodeConsumerProvisionValueStateWaits = "waits"
ProvisionsByNodeConsumerProvisionValueStateFailed = "failed"
ProvisionsByNodeConsumerProvisionValueStateRetiring = "retiring"
)
// ProvisionsByNodeConsumerProvisionLocalValueConsumer is a type of the contract.
type ProvisionsByNodeConsumerProvisionLocalValueConsumer struct {
Module string `json:"module,omitempty"`
Node string `json:"node,omitempty"`
}
// ProvisionsByNodeConsumerProvisionLocalValueProvider is a type of the contract.
type ProvisionsByNodeConsumerProvisionLocalValueProvider struct {
Module string `json:"module,omitempty"`
Node string `json:"node,omitempty"`
}
// ProvisionsByNodeConsumerProvisionLocalValueReference is a type of the contract.
type ProvisionsByNodeConsumerProvisionLocalValueReference struct {
Generation int64 `json:"generation,omitempty"`
ID string `json:"id,omitempty"`
}
// ProvisionsByNodeConsumerProvisionLocalValueWarrant is a type of the contract.
type ProvisionsByNodeConsumerProvisionLocalValueWarrant struct {
Ask string `json:"ask,omitempty"`
At string `json:"at,omitempty"`
By string `json:"by,omitempty"`
Option string `json:"option,omitempty"`
}
// ProvisionsByNodeConsumerProvisionLocalValue is one value of the state provisions under the key <node>.<consumer>.<provision>.<local>.
type ProvisionsByNodeConsumerProvisionLocalValue struct {
Ask string `json:"ask,omitempty"`
At string `json:"at"`
Consumer ProvisionsByNodeConsumerProvisionLocalValueConsumer `json:"consumer"`
DependsOn []string `json:"depends-on,omitempty"`
Local string `json:"local,omitempty"`
// the plan's provision
Plan map[string]any `json:"plan,omitempty"`
Provider ProvisionsByNodeConsumerProvisionLocalValueProvider `json:"provider"`
Provision string `json:"provision"`
Reference *ProvisionsByNodeConsumerProvisionLocalValueReference `json:"reference,omitempty"`
State string `json:"state"`
V int64 `json:"v,omitempty"`
Warrant *ProvisionsByNodeConsumerProvisionLocalValueWarrant `json:"warrant,omitempty"`
Why string `json:"why,omitempty"`
}
// The values of ProvisionsByNodeConsumerProvisionLocalValue's state.
const (
ProvisionsByNodeConsumerProvisionLocalValueStateAsked = "asked"
ProvisionsByNodeConsumerProvisionLocalValueStateProvided = "provided"
ProvisionsByNodeConsumerProvisionLocalValueStateWaits = "waits"
ProvisionsByNodeConsumerProvisionLocalValueStateFailed = "failed"
ProvisionsByNodeConsumerProvisionLocalValueStateRetiring = "retiring"
)
@@ -0,0 +1,3 @@
module git.novox.be/novox/mesh-contracts/provisioning/go/seats/meshprovisioner
go 1.26.0
+9
View File
@@ -0,0 +1,9 @@
{
"format": 1,
"seats": [
"mesh-provisioner",
"node-mounts",
"node-nfs-server",
"node-provisioner"
]
}
@@ -0,0 +1,19 @@
{
"description": "The contract of the seat mesh-provisioner, generated from its definition.",
"devDependencies": {
"typescript": "^5.6.0"
},
"exports": {
".": "./dist/index.js"
},
"files": [
"dist"
],
"name": "@novox/mesh-provisioning-contracts-mesh-provisioner",
"scripts": {
"build": "tsc",
"prepare": "tsc"
},
"type": "module",
"version": "0.1.0"
}
@@ -0,0 +1,188 @@
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "mesh-provisioner", defined whole (seats/mesh-provisioner/seat.json): The provisioner (ADR 0349): which domain answers which kind of placeholder, what each module needs, what is applied where.
export const seat = "mesh-provisioner";
export const verbs = {
provisioning: "provisioning",
} as const;
export const states = {
plans: "plans",
provisions: "provisions",
} as const;
/** The key of one value of the state plans under the form "<node>.<module>". */
export function plansByNodeModuleKey(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 parsePlansByNodeModuleKey(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 provisions under the form "<node>.<consumer>.<provision>". */
export function provisionsByNodeConsumerProvisionKey(node: string, consumer: string, provision: string): string {
return node + "." + consumer + "." + provision;
}
/** The parts of a key of the form "<node>.<consumer>.<provision>", or undefined for a key of another form. */
export function parseProvisionsByNodeConsumerProvisionKey(key: string): { node: string; consumer: string; provision: 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 consumer = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
if (rest === "") return undefined;
const provision = rest;
rest = "";
if (rest !== "") return undefined;
return { node, consumer, provision };
}
/** The key of one value of the state provisions under the form "<node>.<consumer>.<provision>.<local>". */
export function provisionsByNodeConsumerProvisionLocalKey(node: string, consumer: string, provision: string, local: string): string {
return node + "." + consumer + "." + provision + "." + local;
}
/** The parts of a key of the form "<node>.<consumer>.<provision>.<local>", or undefined for a key of another form. */
export function parseProvisionsByNodeConsumerProvisionLocalKey(key: string): { node: string; consumer: string; provision: string; local: 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 consumer = rest.slice(0, at2);
rest = rest.slice(at2 + 1);
const at4 = rest.indexOf(".");
if (at4 <= 0) return undefined;
const provision = rest.slice(0, at4);
rest = rest.slice(at4 + 1);
if (rest === "") return undefined;
const local = rest;
rest = "";
if (rest !== "") return undefined;
return { node, consumer, provision, local };
}
/** is what provisioning takes. */
export interface ProvisioningInput {
/** for collect: a collection */
"collection"?: string;
/** a module: for collect, a contributor */
"module"?: string;
/** a node */
"node"?: string;
/** registry (when not given), needs, applied or collect */
"what"?: string;
}
/** is what provisioning answers. */
export type ProvisioningAnswer = Record<string, unknown>;
/** is one value of the state plans under the key <node>.<module>. */
export interface PlansByNodeModuleValue {
"module": string;
"node": string;
/** the module's plan */
"plan": Record<string, unknown>;
"v"?: number;
}
export interface ProvisionsByNodeConsumerProvisionValueConsumer {
"module"?: string;
"node"?: string;
}
export interface ProvisionsByNodeConsumerProvisionValueProvider {
"module"?: string;
"node"?: string;
}
export interface ProvisionsByNodeConsumerProvisionValueReference {
"generation"?: number;
"id"?: string;
}
export interface ProvisionsByNodeConsumerProvisionValueWarrant {
"ask"?: string;
"at"?: string;
"by"?: string;
"option"?: string;
}
/** is one value of the state provisions under the key <node>.<consumer>.<provision>. */
export interface ProvisionsByNodeConsumerProvisionValue {
"ask"?: string;
"at": string;
"consumer": ProvisionsByNodeConsumerProvisionValueConsumer;
"depends-on"?: string[];
"local"?: string;
/** the plan's provision */
"plan"?: Record<string, unknown>;
"provider": ProvisionsByNodeConsumerProvisionValueProvider;
"provision": string;
"reference"?: ProvisionsByNodeConsumerProvisionValueReference;
"state": "asked" | "provided" | "waits" | "failed" | "retiring";
"v"?: number;
"warrant"?: ProvisionsByNodeConsumerProvisionValueWarrant;
"why"?: string;
}
export interface ProvisionsByNodeConsumerProvisionLocalValueConsumer {
"module"?: string;
"node"?: string;
}
export interface ProvisionsByNodeConsumerProvisionLocalValueProvider {
"module"?: string;
"node"?: string;
}
export interface ProvisionsByNodeConsumerProvisionLocalValueReference {
"generation"?: number;
"id"?: string;
}
export interface ProvisionsByNodeConsumerProvisionLocalValueWarrant {
"ask"?: string;
"at"?: string;
"by"?: string;
"option"?: string;
}
/** is one value of the state provisions under the key <node>.<consumer>.<provision>.<local>. */
export interface ProvisionsByNodeConsumerProvisionLocalValue {
"ask"?: string;
"at": string;
"consumer": ProvisionsByNodeConsumerProvisionLocalValueConsumer;
"depends-on"?: string[];
"local"?: string;
/** the plan's provision */
"plan"?: Record<string, unknown>;
"provider": ProvisionsByNodeConsumerProvisionLocalValueProvider;
"provision": string;
"reference"?: ProvisionsByNodeConsumerProvisionLocalValueReference;
"state": "asked" | "provided" | "waits" | "failed" | "retiring";
"v"?: number;
"warrant"?: ProvisionsByNodeConsumerProvisionLocalValueWarrant;
"why"?: string;
}
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"declaration": true,
"outDir": "dist",
"rootDir": "src",
"strict": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"include": ["src/**/*.ts"]
}