Files
mesh-contracts/operator-and-conversation/ts/seats/operatorchannel/index.d.ts
T
jschoubben 9db2e1d08c contracts-every-ask-offered: the seat operator-channel loses held-back and ask-again
Builds: design 47 H §764 (The operator channel's limit), H-A-57
2026-11-20 02:30:03 +01:00

430 lines
12 KiB
TypeScript

// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// The contract of the seat "operator-channel", defined whole (seats/operator-channel/seat.json): Asking a person and answering on a channel (ADR 0259): held by the router, the messenger module, whose manifest declares the seat; written from that seat entry (design 26).
export declare const seat: "operator-channel";
export declare const verbs: {
readonly open: "open";
readonly history: "history";
readonly notify: "notify";
readonly tell: "tell";
readonly asks: "asks";
};
export declare const accepts: {
readonly ask: "ask";
readonly cancel: "cancel";
readonly condition: "condition";
};
export declare const events: {
readonly decided: "decided";
};
export declare const family: { readonly name: "operator-channel.decided"; readonly maxAgeDays: 7 };
export declare function decidedSubject(caller: string): string;
export declare function askSubject(caller: string): string;
export declare function cancelSubject(caller: string): string;
export declare function conditionSubject(caller: string): string;
export declare const holderEvents: {
readonly refused: "refused";
readonly offered: "offered";
readonly closed: "closed";
};
export declare function refusedHolderSubject(holder: string): string;
export declare function offeredHolderSubject(holder: string): string;
export declare function closedHolderSubject(holder: string): string;
export declare const states: {
readonly asks: "asks";
};
/** The key of one value of the state asks under the form "<asker>.<id>". */
export declare function asksByAskerIDKey(asker: string, id: string): string;
/** The parts of a key of the form "<asker>.<id>", or undefined for a key of another form. */
export declare function parseAsksByAskerIDKey(_key: string): { asker: string; id: string } | undefined;
export interface Ask {
/** what it is about: a newer ask about it replaces the older */
"about"?: string;
/** its secondary words */
"details"?: string;
/** when it ends unanswered, RFC 3339 */
"expires": string;
/** what happened and what it means */
"explanation": string;
/** a few plain words */
"headline": string;
/** the asker's own id */
"id": string;
/** what the asker then does */
"on-expiry": string;
/** the answers it offers */
"options": Option[];
/** urgent */
"urgent"?: boolean;
/** who may answer: operator */
"who": string;
/** the explanation with its values whole */
"whole"?: string;
/** the details whole */
"whole-details"?: string;
}
/** one answer a channel offers: its label and the router's one-time ticket for it */
export interface Button {
/** the button's label */
"label": string;
/** the router's one-time ticket for it */
"ticket": string;
}
/** a button chosen on a channel, said on the bench intake as the event `choice` */
export interface Choice {
/** when, RFC 3339 */
"at": string;
/** the message's handle */
"handle"?: string;
/** the channel's own for this arrival, unique, so the router acts on it once */
"id": string;
"sender": Sender;
/** the ticket of the button */
"ticket": string;
}
/** a code a person typed on a channel, asked as the proof `code` on the bench intake by request and reply: never in an event, never kept */
export interface Code {
/** the code */
"code": string;
/** what it is for */
"purpose": string;
"sender": Sender;
}
export interface ConditionActionsItem {
"arguments"?: Record<string, string>;
/** label */
"label": string;
/** level */
"level"?: string;
/** machine */
"machine"?: string;
/** verb */
"verb": string;
}
export interface ConditionSubject {
/** id */
"id": string;
/** machine */
"machine"?: string;
/** scope */
"scope": string;
}
export interface Condition {
/** the answers it offers */
"actions"?: ConditionActionsItem[];
/** plain words */
"explanation"?: string;
/** plain words */
"headline"?: string;
/** the condition's key */
"key": string;
/** what it needs */
"needs"?: string;
/** the line said when it is over */
"resolved"?: string;
/** urgent or warning */
"severity"?: string;
/** raised or cleared */
"state": string;
"subject": ConditionSubject;
/** one line */
"summary"?: string;
/** the form's version, 1 */
"v": number;
}
/** a message a channel could not deliver, said on the bench intake as the event `failed` */
export interface Failed {
/** when, RFC 3339 */
"at": string;
/** the message's handle */
"handle": string;
/** trying again cannot help */
"permanent"?: boolean;
/** why */
"why": string;
}
/** somebody on a channel asking to be linked as the operator, said on the bench intake as the event `link` */
export interface LinkAsked {
/** when, RFC 3339 */
"at": string;
/** the channel's own for this arrival */
"id": string;
"sender": Sender;
}
/** the work a channel takes on the bench channel: shown with buttons (show), shown again in place (edit) or said (send); the words are the router's, shown as given */
export interface Message {
/** its body */
"body": string;
/** the answers it offers (none for a send) */
"buttons"?: Button[];
/** the router's name for it, the same across a show and its edits */
"handle": string;
/** its secondary words after the body and the buttons: who asked and when, what each answer does, when it expires, the ask's details */
"note"?: string;
/** the choice or link request this answers, by its id: the channel shows it where that was made */
"reply"?: string;
/** the words carry something shown once (a link's code): the channel keeps no copy */
"secret"?: boolean;
/** shown without notifying */
"silent"?: boolean;
/** its title */
"title": string;
/** the account linked as the operator on this kind, where the channel sends what is not a reply; empty when none is linked */
"to"?: string;
/** urgent */
"urgent"?: boolean;
}
export interface Option {
/** the digest of exactly what the asker performs when it is chosen */
"binds"?: string;
/** what it does, in plain words */
"does": string;
/** the option's id */
"id": string;
/** the button's label */
"label": string;
/** the proof its answer needs */
"level": string;
}
export interface Person {
/** the name shown */
"display"?: string;
/** the account */
"identity": string;
/** the channel kind */
"kind": string;
/** how the router knew */
"verified": string;
/** the role */
"who": string;
}
/** the router's answer to a proof */
export interface ProofAnswer {
/** whether it was taken */
"accepted": boolean;
/** words to say to the person */
"words": string;
}
/** who a channel's service says sent something; the router alone judges whether that is the operator */
export interface Sender {
/** whether the service authenticated it */
"authenticated": boolean;
/** the name it shows */
"display"?: string;
/** the account */
"identity": string;
}
/** what a channel says of itself at least every five minutes and whenever it changes, on the bench intake as the event `standing` */
export interface Standing {
/** when, RFC 3339 */
"at": string;
/** its edits notify nobody */
"edits-silently"?: boolean;
/** it can send now */
"ready": boolean;
/** why not */
"why"?: string;
}
export interface Warrant {
/** what it was about */
"about"?: string;
/** the ask */
"ask": string;
/** the digest of the ask as the router took it */
"ask-digest"?: string;
/** its asker */
"asker": string;
/** when, RFC 3339 */
"at": string;
"by"?: Person;
/** the module it came through */
"channel"?: string;
/** its label */
"label"?: string;
/** its level */
"level"?: string;
/** the option chosen */
"option"?: string;
"outcome": "chosen" | "expired" | "cancelled" | "replaced" | "refused";
/** the proofs present */
"proofs"?: string[];
/** why it ended without a choice, or what refused it */
"words"?: string;
}
/** is what open takes. */
export interface OpenInput {
}
/** is what open answers. */
export type OpenAnswer = Record<string, unknown>;
/** is what history takes. */
export interface HistoryInput {
/** at most this many of each (default 50) */
"limit"?: number;
}
/** is what history answers. */
export type HistoryAnswer = Record<string, unknown>;
/** is what notify takes. */
export interface NotifyInput {
/** it is over */
"clear"?: boolean;
/** send it on every channel's send, as a break-glass act is announced, not on the operator's chosen channel alone (design 47 G 514) */
"every-channel"?: boolean;
/** one or two plain sentences */
"explanation"?: string;
/** plain words */
"headline"?: string;
/** the message's key */
"key"?: string;
/** the line said when it is over */
"resolved"?: string;
"severity"?: "urgent" | "warning";
/** what it is about */
"subject"?: string;
/** one line */
"summary"?: string;
}
/** is what notify answers. */
export type NotifyAnswer = Record<string, unknown>;
/** is what tell takes. */
export interface TellInput {
/** plain words */
"headline"?: string;
/** one or two plain lines */
"lines"?: string[];
/** what it is about */
"subject"?: string;
}
/** is what tell answers. */
export type TellAnswer = Record<string, unknown>;
/** is what asks takes. */
export interface AsksInput {
/** the most bytes of the asks in the answer; said when it cuts the answer short */
"bound"?: number;
/** one ask, by its key (<asker>.<id>); none for the open asks */
"key"?: string;
/** only the asks opened at or after this time, RFC 3339 */
"since"?: string;
/** open (open and held), ended or all; none is open when no key or since is given, else all */
"state"?: string;
}
export interface AsksAnswerAsksItem {
/** <asker>.<id> */
"key": string;
/** how the ask stands: open, held (no ready channel), or how it ended (answered, expired, cancelled) */
"state": string;
}
/** is what asks answers. */
export interface AsksAnswer {
/** each ask the router holds, as its state asks holds it */
"asks": AsksAnswerAsksItem[];
/** what the bound cut, and how to ask for more; empty when nothing was cut */
"cut"?: string;
/** how many asks the arguments matched */
"matched"?: number;
}
/** is the body of ask. */
export type AskAccept = Ask;
/** is the body of cancel. */
export interface CancelAccept {
/** the ask's id */
"id": string;
}
/** is the body of condition. */
export type ConditionAccept = Condition;
/** is the body of the event decided. */
export type DecidedEvent = Warrant;
/** is the body of the holder's event offered. */
export interface OfferedHolderEvent {
/** its asker */
"asker": string;
/** the channels it was offered on */
"channels"?: string[];
/** its headline */
"headline"?: string;
/** the ask's id */
"id": string;
}
/** is the body of the holder's event closed. */
export interface ClosedHolderEvent {
/** its asker */
"asker": string;
"how": "answered" | "expired" | "cancelled" | "replaced" | "unlinked";
/** the ask's id */
"id": string;
}
/** is one value of the state asks under the key <asker>.<id>. */
export interface AsksByAskerIDValue {
/** how it ended, in words */
"answer"?: string;
/** its asker */
"asker": string;
/** its asker has been told how it ended */
"asker_told"?: boolean;
/** when it ended, RFC 3339; present once it ended, a refused ask's refusal time (design 47 G 570, 638) */
"at"?: string;
/** when it ends unanswered, RFC 3339 */
"expires": string;
/** its headline */
"headline": string;
/** <asker>.<id> */
"key": string;
/** the channels it was offered on */
"offered_on"?: string[];
/** when it was opened, RFC 3339 */
"opened": string;
/** how it stands: open, chosen, expired, cancelled, replaced or refused */
"state": string;
"warrant"?: Warrant;
}