The Delivery contracts module defines the seat mesh-delivery-view (scope mesh, grain whole, ADR 0540): no verb, no seat event, no family, one state answers (template state, history 5, view), one key form per kind of mesh-wants' asks with .view after it (A-299), its value the answer (v, asking, option, words); seatgen writes its Go and TypeScript packages, and the module's artifacts name them. The status view claims the seat (scope mesh, serves none), its first-view tool answers (views.FirstViewTool, callers the teller, A-301) replaces view_read_answers, and it deletes its answer once the ask's key has left asks. The teller follows the answers by seat:mesh-delivery-view.views.answers and invokes nothing of the view's. Builds: design 47 G §717, A-299, A-301 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
181 lines
7.3 KiB
JavaScript
181 lines
7.3 KiB
JavaScript
// Code generated by seatgen from the seat definitions; DO NOT EDIT.
|
|
|
|
// The contract of the seat "mesh-delivery-view", defined whole (seats/mesh-delivery-view/seat.json): The status view of deliveries (ADR 0540): it serves no verb and says no seat event; its tools and its events delivered, moving, settled and stuck stay its holder's own, and it keeps the person's answers given in the web view.
|
|
|
|
export const seat = "mesh-delivery-view";
|
|
|
|
export const states = {
|
|
answers: "answers",
|
|
};
|
|
|
|
/** The key of one value of the state answers under the form "hold.<module>.<fingerprint>.view". */
|
|
export function answersByHoldModuleFingerprintViewKey(module, fingerprint) {
|
|
return "hold." + module + "." + fingerprint + ".view";
|
|
}
|
|
|
|
/** The parts of a key of the form "hold.<module>.<fingerprint>.view", or undefined for a key of another form. */
|
|
export function parseAnswersByHoldModuleFingerprintViewKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("hold.")) return undefined;
|
|
_rest = _rest.slice(5);
|
|
const _at1 = _rest.indexOf(".");
|
|
if (_at1 <= 0) return undefined;
|
|
const module = _rest.slice(0, _at1);
|
|
_rest = _rest.slice(_at1 + 1);
|
|
const _at3 = _rest.indexOf(".view");
|
|
if (_at3 <= 0) return undefined;
|
|
const fingerprint = _rest.slice(0, _at3);
|
|
_rest = _rest.slice(_at3 + 5);
|
|
if (_rest !== "") return undefined;
|
|
return { module, fingerprint };
|
|
}
|
|
|
|
/** The key of one value of the state answers under the form "restore.<node>.<module>.<fingerprint>.view". */
|
|
export function answersByRestoreNodeModuleFingerprintViewKey(node, module, fingerprint) {
|
|
return "restore." + node + "." + module + "." + fingerprint + ".view";
|
|
}
|
|
|
|
/** The parts of a key of the form "restore.<node>.<module>.<fingerprint>.view", or undefined for a key of another form. */
|
|
export function parseAnswersByRestoreNodeModuleFingerprintViewKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("restore.")) return undefined;
|
|
_rest = _rest.slice(8);
|
|
const _at1 = _rest.indexOf(".");
|
|
if (_at1 <= 0) return undefined;
|
|
const node = _rest.slice(0, _at1);
|
|
_rest = _rest.slice(_at1 + 1);
|
|
const _at3 = _rest.indexOf(".");
|
|
if (_at3 <= 0) return undefined;
|
|
const module = _rest.slice(0, _at3);
|
|
_rest = _rest.slice(_at3 + 1);
|
|
const _at5 = _rest.indexOf(".view");
|
|
if (_at5 <= 0) return undefined;
|
|
const fingerprint = _rest.slice(0, _at5);
|
|
_rest = _rest.slice(_at5 + 5);
|
|
if (_rest !== "") return undefined;
|
|
return { node, module, fingerprint };
|
|
}
|
|
|
|
/** The key of one value of the state answers under the form "backup.<node>.<module>.<fingerprint>.view". */
|
|
export function answersByBackupNodeModuleFingerprintViewKey(node, module, fingerprint) {
|
|
return "backup." + node + "." + module + "." + fingerprint + ".view";
|
|
}
|
|
|
|
/** The parts of a key of the form "backup.<node>.<module>.<fingerprint>.view", or undefined for a key of another form. */
|
|
export function parseAnswersByBackupNodeModuleFingerprintViewKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("backup.")) return undefined;
|
|
_rest = _rest.slice(7);
|
|
const _at1 = _rest.indexOf(".");
|
|
if (_at1 <= 0) return undefined;
|
|
const node = _rest.slice(0, _at1);
|
|
_rest = _rest.slice(_at1 + 1);
|
|
const _at3 = _rest.indexOf(".");
|
|
if (_at3 <= 0) return undefined;
|
|
const module = _rest.slice(0, _at3);
|
|
_rest = _rest.slice(_at3 + 1);
|
|
const _at5 = _rest.indexOf(".view");
|
|
if (_at5 <= 0) return undefined;
|
|
const fingerprint = _rest.slice(0, _at5);
|
|
_rest = _rest.slice(_at5 + 5);
|
|
if (_rest !== "") return undefined;
|
|
return { node, module, fingerprint };
|
|
}
|
|
|
|
/** The key of one value of the state answers under the form "record.<node>.<module>.<digest>.view". */
|
|
export function answersByRecordNodeModuleDigestViewKey(node, module, digest) {
|
|
return "record." + node + "." + module + "." + digest + ".view";
|
|
}
|
|
|
|
/** The parts of a key of the form "record.<node>.<module>.<digest>.view", or undefined for a key of another form. */
|
|
export function parseAnswersByRecordNodeModuleDigestViewKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("record.")) return undefined;
|
|
_rest = _rest.slice(7);
|
|
const _at1 = _rest.indexOf(".");
|
|
if (_at1 <= 0) return undefined;
|
|
const node = _rest.slice(0, _at1);
|
|
_rest = _rest.slice(_at1 + 1);
|
|
const _at3 = _rest.indexOf(".");
|
|
if (_at3 <= 0) return undefined;
|
|
const module = _rest.slice(0, _at3);
|
|
_rest = _rest.slice(_at3 + 1);
|
|
const _at5 = _rest.indexOf(".view");
|
|
if (_at5 <= 0) return undefined;
|
|
const digest = _rest.slice(0, _at5);
|
|
_rest = _rest.slice(_at5 + 5);
|
|
if (_rest !== "") return undefined;
|
|
return { node, module, digest };
|
|
}
|
|
|
|
/** The key of one value of the state answers under the form "outside.<node>.<module>.<fingerprint>.view". */
|
|
export function answersByOutsideNodeModuleFingerprintViewKey(node, module, fingerprint) {
|
|
return "outside." + node + "." + module + "." + fingerprint + ".view";
|
|
}
|
|
|
|
/** The parts of a key of the form "outside.<node>.<module>.<fingerprint>.view", or undefined for a key of another form. */
|
|
export function parseAnswersByOutsideNodeModuleFingerprintViewKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("outside.")) return undefined;
|
|
_rest = _rest.slice(8);
|
|
const _at1 = _rest.indexOf(".");
|
|
if (_at1 <= 0) return undefined;
|
|
const node = _rest.slice(0, _at1);
|
|
_rest = _rest.slice(_at1 + 1);
|
|
const _at3 = _rest.indexOf(".");
|
|
if (_at3 <= 0) return undefined;
|
|
const module = _rest.slice(0, _at3);
|
|
_rest = _rest.slice(_at3 + 1);
|
|
const _at5 = _rest.indexOf(".view");
|
|
if (_at5 <= 0) return undefined;
|
|
const fingerprint = _rest.slice(0, _at5);
|
|
_rest = _rest.slice(_at5 + 5);
|
|
if (_rest !== "") return undefined;
|
|
return { node, module, fingerprint };
|
|
}
|
|
|
|
/** The key of one value of the state answers under the form "revert.<node>.<module>.<fingerprint>.view". */
|
|
export function answersByRevertNodeModuleFingerprintViewKey(node, module, fingerprint) {
|
|
return "revert." + node + "." + module + "." + fingerprint + ".view";
|
|
}
|
|
|
|
/** The parts of a key of the form "revert.<node>.<module>.<fingerprint>.view", or undefined for a key of another form. */
|
|
export function parseAnswersByRevertNodeModuleFingerprintViewKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("revert.")) return undefined;
|
|
_rest = _rest.slice(7);
|
|
const _at1 = _rest.indexOf(".");
|
|
if (_at1 <= 0) return undefined;
|
|
const node = _rest.slice(0, _at1);
|
|
_rest = _rest.slice(_at1 + 1);
|
|
const _at3 = _rest.indexOf(".");
|
|
if (_at3 <= 0) return undefined;
|
|
const module = _rest.slice(0, _at3);
|
|
_rest = _rest.slice(_at3 + 1);
|
|
const _at5 = _rest.indexOf(".view");
|
|
if (_at5 <= 0) return undefined;
|
|
const fingerprint = _rest.slice(0, _at5);
|
|
_rest = _rest.slice(_at5 + 5);
|
|
if (_rest !== "") return undefined;
|
|
return { node, module, fingerprint };
|
|
}
|
|
|
|
/** The key of one value of the state answers under the form "assignments.<proposal>.view". */
|
|
export function answersByAssignmentsProposalViewKey(proposal) {
|
|
return "assignments." + proposal + ".view";
|
|
}
|
|
|
|
/** The parts of a key of the form "assignments.<proposal>.view", or undefined for a key of another form. */
|
|
export function parseAnswersByAssignmentsProposalViewKey(_key) {
|
|
let _rest = _key;
|
|
if (!_rest.startsWith("assignments.")) return undefined;
|
|
_rest = _rest.slice(12);
|
|
const _at1 = _rest.indexOf(".view");
|
|
if (_at1 <= 0) return undefined;
|
|
const proposal = _rest.slice(0, _at1);
|
|
_rest = _rest.slice(_at1 + 5);
|
|
if (_rest !== "") return undefined;
|
|
return { proposal };
|
|
}
|
|
|