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
423 lines
15 KiB
TypeScript
423 lines
15 KiB
TypeScript
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
|
|
|
|
// The contract of the seat "mesh-module-assigner", defined whole (seats/mesh-module-assigner/seat.json): The seat that places modules on nodes (ADR 0567): the state of assignments and the proposals that change it.
|
|
|
|
export declare const seat: "mesh-module-assigner";
|
|
|
|
export declare const verbs: {
|
|
readonly assignments: "assignments";
|
|
readonly proposals: "proposals";
|
|
readonly propose: "propose";
|
|
readonly withdraw: "withdraw";
|
|
readonly again: "again";
|
|
};
|
|
|
|
export declare const events: {
|
|
readonly assignmentsProposed: "assignments-proposed";
|
|
readonly assignmentsWithdrawn: "assignments-withdrawn";
|
|
readonly assignmentsJudged: "assignments-judged";
|
|
readonly assignmentsChanged: "assignments-changed";
|
|
};
|
|
|
|
export declare const family: { readonly name: "mesh-module-assigner.events"; readonly maxAgeDays: 7 };
|
|
|
|
export declare const assignmentsProposedSubject: "mesh.seat.mesh-module-assigner.event.assignments-proposed";
|
|
|
|
export declare const assignmentsWithdrawnSubject: "mesh.seat.mesh-module-assigner.event.assignments-withdrawn";
|
|
|
|
export declare const assignmentsJudgedSubject: "mesh.seat.mesh-module-assigner.event.assignments-judged";
|
|
|
|
export declare const assignmentsChangedSubject: "mesh.seat.mesh-module-assigner.event.assignments-changed";
|
|
|
|
export declare const states: {
|
|
readonly assignments: "assignments";
|
|
readonly proposals: "proposals";
|
|
readonly candidates: "candidates";
|
|
readonly pulses: "pulses";
|
|
readonly seatHolders: "seat-holders";
|
|
};
|
|
|
|
/** The key of one value of the state assignments under the form "<node>.node". */
|
|
export declare function assignmentsByNodeNodeKey(node: string): string;
|
|
|
|
/** The parts of a key of the form "<node>.node", or undefined for a key of another form. */
|
|
export declare function parseAssignmentsByNodeNodeKey(_key: string): { node: string } | undefined;
|
|
|
|
/** The key of one value of the state assignments under the form "<node>.<module>". */
|
|
export declare function assignmentsByNodeModuleKey(node: string, module: string): string;
|
|
|
|
/** The parts of a key of the form "<node>.<module>", or undefined for a key of another form. */
|
|
export declare function parseAssignmentsByNodeModuleKey(_key: string): { node: string; module: string } | undefined;
|
|
|
|
/** The key of one value of the state proposals under the form "<proposal>". */
|
|
export declare function proposalsByProposalKey(proposal: string): string;
|
|
|
|
/** The parts of a key of the form "<proposal>", or undefined for a key of another form. */
|
|
export declare function parseProposalsByProposalKey(_key: string): { proposal: string } | undefined;
|
|
|
|
/** The key of one value of the state candidates under the form "<proposal>.<node>". */
|
|
export declare function candidatesByProposalNodeKey(proposal: string, node: string): string;
|
|
|
|
/** The parts of a key of the form "<proposal>.<node>", or undefined for a key of another form. */
|
|
export declare function parseCandidatesByProposalNodeKey(_key: string): { proposal: string; node: string } | undefined;
|
|
|
|
/** The key of one value of the state pulses under the form "answer.<proposal>.<node>". */
|
|
export declare function pulsesByAnswerProposalNodeKey(proposal: string, node: string): string;
|
|
|
|
/** The parts of a key of the form "answer.<proposal>.<node>", or undefined for a key of another form. */
|
|
export declare function parsePulsesByAnswerProposalNodeKey(_key: string): { proposal: string; node: string } | undefined;
|
|
|
|
/** The key of one value of the state pulses under the form "ask.<proposal>". */
|
|
export declare function pulsesByAskProposalKey(proposal: string): string;
|
|
|
|
/** The parts of a key of the form "ask.<proposal>", or undefined for a key of another form. */
|
|
export declare function parsePulsesByAskProposalKey(_key: string): { proposal: string } | undefined;
|
|
|
|
/** The key of one value of the state seat-holders under the form "<seat>". */
|
|
export declare function seatHoldersBySeatKey(seat: string): string;
|
|
|
|
/** The parts of a key of the form "<seat>", or undefined for a key of another form. */
|
|
export declare function parseSeatHoldersBySeatKey(_key: string): { seat: string } | undefined;
|
|
|
|
/** The key of one value of the state seat-holders under the form "<seat>.<node>". */
|
|
export declare function seatHoldersBySeatNodeKey(seat: string, node: string): string;
|
|
|
|
/** The parts of a key of the form "<seat>.<node>", or undefined for a key of another form. */
|
|
export declare function parseSeatHoldersBySeatNodeKey(_key: string): { seat: string; node: string } | undefined;
|
|
|
|
/** one node's assignments assembled */
|
|
export interface Assignments {
|
|
"decided": NodeDecided;
|
|
"holds"?: Holding[];
|
|
"modules": PlacedModule[];
|
|
"node": string;
|
|
/** by provision, the provider chosen for the node */
|
|
"pins"?: Record<string, Provider>;
|
|
"revision"?: string;
|
|
"v"?: number;
|
|
}
|
|
|
|
/** who approved it, through which channel, when */
|
|
export interface AssignmentsEventWarrant {
|
|
"at": string;
|
|
"warrant": string;
|
|
"words": string;
|
|
}
|
|
|
|
/** what each assignments event carries */
|
|
export interface AssignmentsEvent {
|
|
/** for assignments-withdrawn, why it ended */
|
|
"ended"?: string;
|
|
/** for assignments-changed, by node the revisions before and after and the modules added, removed or changed */
|
|
"nodes"?: Record<string, unknown>[];
|
|
"proposal": Proposal;
|
|
/** who approved it, through which channel, when */
|
|
"warrant"?: AssignmentsEventWarrant;
|
|
}
|
|
|
|
/** a tunnel found on the machine when it was adopted: everything but its private key */
|
|
export interface FoundTunnel {
|
|
"address"?: string;
|
|
"config"?: string;
|
|
"interface": string;
|
|
"mtu"?: number;
|
|
"peers"?: FoundTunnelPeer[];
|
|
"port"?: number;
|
|
"public-key"?: string;
|
|
"range"?: string;
|
|
"unit"?: string;
|
|
}
|
|
|
|
/** one peer of a found tunnel */
|
|
export interface FoundTunnelPeer {
|
|
"address"?: string;
|
|
"public-key": string;
|
|
}
|
|
|
|
/** one seat a module placed on the node holds */
|
|
export interface Holding {
|
|
"claim": string;
|
|
"kind"?: string;
|
|
"module": string;
|
|
"scope"?: string;
|
|
"site"?: string;
|
|
}
|
|
|
|
/** what a person decides of a node; no secret and no key material */
|
|
export interface NodeDecided {
|
|
"account"?: string;
|
|
"account-home"?: string;
|
|
"address"?: string;
|
|
"adopted"?: boolean;
|
|
"agent-account"?: string;
|
|
"agent-account-home"?: string;
|
|
"endpoint"?: string;
|
|
"hub"?: boolean;
|
|
/** on the hub, the name a person gave a peer of that tunnel, by its public key */
|
|
"peer-names"?: Record<string, string>;
|
|
"public-domain"?: string;
|
|
"site"?: string;
|
|
"taken"?: string[];
|
|
/** the tunnel found on the node when it was adopted */
|
|
"tunnel"?: FoundTunnel;
|
|
}
|
|
|
|
/** one module placed on a node */
|
|
export interface PlacedModule {
|
|
/** by provision, the provider each requirement that keeps data is bound to */
|
|
"bindings"?: Record<string, Provider>;
|
|
/** the watched branch this node runs the module from; absent, the first watched branch of the module's registration (design 47 G 14) */
|
|
"branch"?: string;
|
|
/** the fingerprint of the build the node runs; absent, the newest delivered of the branch (design 47 G 78, 402) */
|
|
"build"?: string;
|
|
"has-layer"?: boolean;
|
|
"has-mesh-wide"?: boolean;
|
|
/** this node's settings layer of the module's assignments */
|
|
"layer"?: Record<string, unknown>;
|
|
/** the whole mesh's settings layer of the module's assignments */
|
|
"mesh-wide"?: Record<string, unknown>;
|
|
/** config values a person set in the whole mesh's layer, for a module in the settings form */
|
|
"mesh-wide-values"?: Record<string, unknown>;
|
|
"module": string;
|
|
/** the host port each declared port is published on, by the port the software listens on */
|
|
"ports"?: Record<string, number>;
|
|
/** config values a person set in this node's layer, for a module in the settings form */
|
|
"values"?: Record<string, unknown>;
|
|
}
|
|
|
|
/** an open proposal */
|
|
export interface Proposal {
|
|
"again"?: string;
|
|
"ask"?: string;
|
|
"at": string;
|
|
/** by node whose key it changes, the revision of the key it was laid over (0: none) */
|
|
"base": Record<string, number>;
|
|
"by": string;
|
|
"changes": ProposalChange[];
|
|
"export-digest"?: string;
|
|
"hand-back"?: boolean;
|
|
"id": string;
|
|
"must"?: string[];
|
|
"seed"?: boolean;
|
|
/** answering, failed or asked */
|
|
"state": string;
|
|
"v"?: number;
|
|
"verdict"?: Verdict;
|
|
"warrant"?: Warrant;
|
|
"why": string;
|
|
"withdrawn"?: string;
|
|
"words"?: string;
|
|
"written"?: string;
|
|
}
|
|
|
|
/** the public halves of a joining node's keys */
|
|
export interface ProposalChangeKeys {
|
|
"identity": string;
|
|
"overlay"?: string;
|
|
"sealing": string;
|
|
"serving"?: string;
|
|
}
|
|
|
|
/** one change of a proposal */
|
|
export interface ProposalChange {
|
|
"bindings"?: Record<string, Provider>;
|
|
/** for place, the watched branch the node runs the module from; absent, the first watched branch of the module's registration (design 47 G 14) */
|
|
"branch"?: string;
|
|
/** for place, the build of that branch the node runs, a return to an earlier build being this one value; absent, the newest delivered of the branch (ADR 0666 section 24) */
|
|
"build"?: string;
|
|
"claim"?: string;
|
|
"decided"?: NodeDecided;
|
|
"field"?: string;
|
|
/** the public halves of a joining node's keys */
|
|
"keys"?: ProposalChangeKeys;
|
|
"kind"?: string;
|
|
"layer"?: Record<string, unknown>;
|
|
"mesh-wide"?: Record<string, unknown>;
|
|
"mesh-wide-values"?: Record<string, unknown>;
|
|
"module"?: string;
|
|
"node": string;
|
|
/** place, take-off, pin, unpin, hold, unhold, decide, config, seed, add-node or remove-node */
|
|
"op": string;
|
|
"ports"?: Record<string, number>;
|
|
"provider"?: Provider;
|
|
"provision"?: string;
|
|
"scope"?: string;
|
|
"site"?: string;
|
|
/** a decided field's value */
|
|
"value"?: unknown;
|
|
"values"?: Record<string, unknown>;
|
|
/** the node's whole assignments, for a seed */
|
|
"whole"?: Assignments;
|
|
}
|
|
|
|
/** the module on a node that answers a requirement or holds a seat */
|
|
export interface Provider {
|
|
"module": string;
|
|
"node": string;
|
|
}
|
|
|
|
export interface SeatHoldersHoldersItem {
|
|
"module": string;
|
|
"node": string;
|
|
}
|
|
|
|
/** one key of seat-holders */
|
|
export interface SeatHolders {
|
|
"holders": SeatHoldersHoldersItem[];
|
|
"node"?: string;
|
|
/** the claim names no seat of the seat list */
|
|
"outside"?: boolean;
|
|
"scope": string;
|
|
"seat": string;
|
|
"v"?: number;
|
|
}
|
|
|
|
/** the holder's judgement of a proposal's answers */
|
|
export interface Verdict {
|
|
/** every node's answer to its candidate, by node */
|
|
"answers"?: Record<string, Record<string, unknown>>;
|
|
"at": string;
|
|
"carried"?: Record<string, string[]>;
|
|
"fails"?: string[];
|
|
"intended"?: Record<string, string[]>;
|
|
"notes"?: string[];
|
|
"silent"?: string[];
|
|
/** waits, pass or fail */
|
|
"state": string;
|
|
"unintended"?: Record<string, string[]>;
|
|
"until"?: string;
|
|
}
|
|
|
|
/** the enrolment's warrant an add-node carries */
|
|
export interface Warrant {
|
|
"address": string;
|
|
"ask": string;
|
|
"node": string;
|
|
"warrant": string;
|
|
}
|
|
|
|
/** is what assignments takes. */
|
|
export interface AssignmentsInput {
|
|
/** "true": the changes in order, from the stream and the state's revisions */
|
|
"history"?: "true" | "false";
|
|
/** one module: the nodes it is placed on */
|
|
"module"?: string;
|
|
/** one node */
|
|
"node"?: string;
|
|
/** "true": who holds each seat, and on which node (the state seat-holders); with node, that node's */
|
|
"seats"?: "true" | "false";
|
|
}
|
|
|
|
/** is what assignments answers. */
|
|
export type AssignmentsAnswer = Record<string, unknown>;
|
|
|
|
/** is what proposals takes. */
|
|
export interface ProposalsInput {
|
|
/** one proposal's id */
|
|
"id"?: string;
|
|
}
|
|
|
|
/** is what proposals answers. */
|
|
export type ProposalsAnswer = Record<string, unknown>;
|
|
|
|
/** is what propose takes. */
|
|
export interface ProposeInput {
|
|
/** the changes, each an object with `op`: place (node, module, ports, bindings), take-off (node, module), pin (node, provision, provider {node, module}), unpin (node, provision), hold (node, module, claim, scope, kind, site), unhold (node, module, claim), decide (node, field, value: a decided field of the node, its address among them), config (node, module, mesh-wide, layer, mesh-wide-values, values), add-node (node, decided, keys: a joining node, mesh-enrolment's alone, the proposal's one change, with the enrolment's warrant, its tunnel key alone at the operator's yes; ADR 0587 §7), remove-node (node: a joining node never confirmed, taken off when its enrolment ends; mesh-enrolment's alone, on the same warrant) */
|
|
"changes": Record<string, unknown>[];
|
|
/** for an add-node alone: the enrolment's warrant {node, address, ask, warrant}, naming the change's node and address */
|
|
"warrant"?: Record<string, unknown>;
|
|
/** why, shown to the operator with the proposal */
|
|
"why": string;
|
|
}
|
|
|
|
/** is what propose answers. */
|
|
export type ProposeAnswer = Record<string, unknown>;
|
|
|
|
/** is what withdraw takes. */
|
|
export interface WithdrawInput {
|
|
/** the proposal's id */
|
|
"id": string;
|
|
/** why, kept in the event */
|
|
"why": string;
|
|
}
|
|
|
|
/** is what withdraw answers. */
|
|
export type WithdrawAnswer = Record<string, unknown>;
|
|
|
|
/** is what again takes. */
|
|
export interface AgainInput {
|
|
/** the proposal's id */
|
|
"id": string;
|
|
}
|
|
|
|
/** is what again answers. */
|
|
export type AgainAnswer = Record<string, unknown>;
|
|
|
|
/** is the body of the event assignments-proposed. */
|
|
export type AssignmentsProposedEvent = AssignmentsEvent;
|
|
|
|
/** is the body of the event assignments-withdrawn. */
|
|
export type AssignmentsWithdrawnEvent = AssignmentsEvent;
|
|
|
|
/** is the body of the event assignments-judged. */
|
|
export type AssignmentsJudgedEvent = AssignmentsEvent;
|
|
|
|
/** is the body of the event assignments-changed. */
|
|
export type AssignmentsChangedEvent = AssignmentsEvent;
|
|
|
|
export interface AssignmentsByNodeNodeValueModulesItem {
|
|
/** the digest of the module key's value it stands for */
|
|
"digest": string;
|
|
"module": string;
|
|
}
|
|
|
|
/** is one value of the state assignments under the key <node>.node. */
|
|
export interface AssignmentsByNodeNodeValue {
|
|
"decided": NodeDecided;
|
|
"holds"?: Holding[];
|
|
/** the modules placed, in the order the composition reads them */
|
|
"modules": AssignmentsByNodeNodeValueModulesItem[];
|
|
"node": string;
|
|
"pins"?: Record<string, Provider>;
|
|
"v"?: number;
|
|
}
|
|
|
|
/** is one value of the state assignments under the key <node>.<module>. */
|
|
export interface AssignmentsByNodeModuleValue {
|
|
"node": string;
|
|
"placed": PlacedModule;
|
|
/** the value it replaces while a write is under way */
|
|
"previous"?: PlacedModule;
|
|
"v"?: number;
|
|
}
|
|
|
|
/** is one value of the state proposals under the key <proposal>. */
|
|
export type ProposalsByProposalValue = Proposal;
|
|
|
|
/** is one value of the state candidates under the key <proposal>.<node>. */
|
|
export interface CandidatesByProposalNodeValue {
|
|
/** the node's assignments with the proposal laid over it; absent when the proposal takes its key away */
|
|
"assignments"?: Assignments;
|
|
"proposal": string;
|
|
/** the proposal changes this node's composition through another's key */
|
|
"reached"?: boolean;
|
|
"v"?: number;
|
|
}
|
|
|
|
/** is one value of the state pulses under the key answer.<proposal>.<node>. */
|
|
export interface PulsesByAnswerProposalNodeValue {
|
|
"v"?: number;
|
|
}
|
|
|
|
/** is one value of the state pulses under the key ask.<proposal>. */
|
|
export interface PulsesByAskProposalValue {
|
|
"v"?: number;
|
|
}
|
|
|
|
/** is one value of the state seat-holders under the key <seat>. */
|
|
export type SeatHoldersBySeatValue = SeatHolders;
|
|
|
|
/** is one value of the state seat-holders under the key <seat>.<node>. */
|
|
export type SeatHoldersBySeatNodeValue = SeatHolders;
|
|
|