@joe-broadhead/messaging 0.7.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +214 -2
- package/dist/bin/messaging-mcp.js +5043 -4054
- package/dist/bin/messaging-relay.js +8263 -5425
- package/dist/bin/messaging.js +5982 -4906
- package/dist/bin/messagingd.js +19956 -13716
- package/dist/lib/modules/core/agent/operations.js +19 -327
- package/dist/lib/modules/core/agent/present.js +15 -55
- package/dist/lib/modules/core/agent-tools.js +23 -139
- package/dist/lib/modules/core/consent.js +1 -1
- package/dist/lib/modules/core/conversation/event.js +29 -4
- package/dist/lib/modules/core/conversation/guest-invitation.js +42 -0
- package/dist/lib/modules/core/conversation/log.js +287 -65
- package/dist/lib/modules/core/conversation/request-log.js +158 -0
- package/dist/lib/modules/core/conversation/request-seal.js +41 -0
- package/dist/lib/modules/core/conversation/requests.js +87 -0
- package/dist/lib/modules/core/conversation/seal.js +90 -37
- package/dist/lib/modules/core/conversation-agent-tools.js +69 -0
- package/dist/lib/modules/core/federation/directory-proof.js +83 -0
- package/dist/lib/modules/core/federation/proof-state.js +167 -0
- package/dist/lib/modules/core/federation/roster-proof.js +74 -0
- package/dist/lib/modules/core/index.js +8 -3
- package/dist/lib/modules/core/jelly-host.js +5 -5
- package/dist/lib/modules/core/schema/common.js +31 -5
- package/dist/lib/modules/core/schema/consent.js +5 -4
- package/dist/lib/modules/core/schema/contact-request.js +22 -0
- package/dist/lib/modules/core/schema/conv-frames.js +94 -0
- package/dist/lib/modules/core/schema/conversation.js +67 -33
- package/dist/lib/modules/core/schema/envelope.js +8 -24
- package/dist/lib/modules/core/schema/errors.js +4 -3
- package/dist/lib/modules/core/schema/guest-invitation.js +13 -0
- package/dist/lib/modules/core/schema/index.js +5 -0
- package/dist/lib/modules/core/schema/ipc/consent.js +13 -9
- package/dist/lib/modules/core/schema/ipc/conversation-views.js +80 -0
- package/dist/lib/modules/core/schema/ipc/conversations.js +128 -0
- package/dist/lib/modules/core/schema/ipc/device.js +2 -0
- package/dist/lib/modules/core/schema/ipc/jelly.js +3 -38
- package/dist/lib/modules/core/schema/ipc/shapes.js +14 -72
- package/dist/lib/modules/core/schema/ipc/surfaces.js +12 -195
- package/dist/lib/modules/core/schema/ipc/tasks.js +31 -0
- package/dist/lib/modules/core/schema/ipc.js +18 -44
- package/dist/lib/modules/core/testing.js +1 -1
- package/dist/lib/modules/core/version.js +1 -1
- package/dist/lib/modules/ipc/client.js +10 -2
- package/dist/lib/modules/ipc/server.js +14 -5
- package/dist/lib/modules/ipc/testing.js +13 -23
- package/dist/spec/messaging-v1.md +546 -409
- package/dist/third-party-notices.md +1 -1
- package/dist/third-party.json +1 -1
- package/dist/types/core/agent/operations.d.ts +5 -52
- package/dist/types/core/agent/present.d.ts +6 -21
- package/dist/types/core/agent-tools.d.ts +263 -442
- package/dist/types/core/conversation/event.d.ts +6 -6
- package/dist/types/core/conversation/guest-invitation.d.ts +8 -0
- package/dist/types/core/conversation/log.d.ts +28 -13
- package/dist/types/core/conversation/request-log.d.ts +24 -0
- package/dist/types/core/conversation/request-seal.d.ts +6 -0
- package/dist/types/core/conversation/requests.d.ts +14 -0
- package/dist/types/core/conversation/seal.d.ts +32 -9
- package/dist/types/core/conversation-agent-tools.d.ts +918 -0
- package/dist/types/core/federation/directory-proof.d.ts +8 -0
- package/dist/types/core/federation/proof-state.d.ts +114 -0
- package/dist/types/core/federation/roster-proof.d.ts +7 -0
- package/dist/types/core/index.d.ts +10 -5
- package/dist/types/core/jelly-host.d.ts +1 -1
- package/dist/types/core/schema/common.d.ts +31 -6
- package/dist/types/core/schema/consent.d.ts +7 -7
- package/dist/types/core/schema/contact-request.d.ts +264 -0
- package/dist/types/core/schema/conv-frames.d.ts +1200 -0
- package/dist/types/core/schema/conversation.d.ts +1410 -264
- package/dist/types/core/schema/envelope.d.ts +83 -130
- package/dist/types/core/schema/errors.d.ts +3 -1
- package/dist/types/core/schema/guest-invitation.d.ts +51 -0
- package/dist/types/core/schema/index.d.ts +5 -0
- package/dist/types/core/schema/ipc/consent.d.ts +89 -49
- package/dist/types/core/schema/ipc/conversation-views.d.ts +1023 -0
- package/dist/types/core/schema/ipc/conversations.d.ts +3987 -0
- package/dist/types/core/schema/ipc/device.d.ts +4 -0
- package/dist/types/core/schema/ipc/jelly.d.ts +2 -105
- package/dist/types/core/schema/ipc/shapes.d.ts +13 -95
- package/dist/types/core/schema/ipc/surfaces.d.ts +25 -427
- package/dist/types/core/schema/ipc/tasks.d.ts +208 -0
- package/dist/types/core/schema/ipc.d.ts +2671 -525
- package/dist/types/core/schema/relay.d.ts +8 -4
- package/dist/types/core/testing.d.ts +1 -1
- package/dist/types/core/version.d.ts +1 -1
- package/dist/types/ipc/client.d.ts +4 -1
- package/dist/types/ipc/server.d.ts +10 -1
- package/dist/types/ipc/testing.d.ts +21 -8
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Identity } from "../identity.js";
|
|
2
2
|
import { type Hash } from "../schema/common.js";
|
|
3
|
-
import { type
|
|
3
|
+
import { type ConvAnyEvent, type ConvEventHeader, type ConvId, type UnsignedConvEvent } from "../schema/conversation.js";
|
|
4
4
|
/** h(0) of `cid`'s log: SHA-256(DOMAIN.convGenesis ‖ JCS(cid)), base64url. */
|
|
5
5
|
export declare function convGenesisHash(cid: ConvId): Hash;
|
|
6
6
|
/** SHA-256(JCS(event)), the raw digest, as the chain links it. Throws `invalid_request` for non-I-JSON. */
|
|
@@ -10,13 +10,13 @@ export declare function convEntryHash(prev: Hash, event: unknown): Hash;
|
|
|
10
10
|
/** `convEntryHash` from the event's digest: what a member checks for an entry whose content has expired. */
|
|
11
11
|
export declare function convLinkHash(prev: Hash, digest: Uint8Array): Hash;
|
|
12
12
|
/** The header of an event: everything but `body` and `sig`. JCS of it is the AAD of a sealed body. */
|
|
13
|
-
export declare function convEventHeader(event:
|
|
13
|
+
export declare function convEventHeader(event: ConvAnyEvent | Omit<ConvAnyEvent, "sig"> | ConvEventHeader): ConvEventHeader;
|
|
14
14
|
/**
|
|
15
15
|
* Checks that `raw` is I-JSON within `LIMITS.jsonDepth` and at most `LIMITS.convEventBytes` (`too_large`), that it
|
|
16
|
-
* matches `
|
|
16
|
+
* matches `ConvAnyEvent` (an op, a msg or a key share), and that `by.device` is a usable Ed25519 key. Returns a frozen JSON copy of the raw value, so
|
|
17
17
|
* the signature and the hash cover exactly what was received. The signature is not checked.
|
|
18
18
|
*/
|
|
19
|
-
export declare function admitConvEvent(raw: unknown):
|
|
19
|
+
export declare function admitConvEvent(raw: unknown): ConvAnyEvent;
|
|
20
20
|
/**
|
|
21
21
|
* Signs an event (spec §16.4): `sig = Ed25519(by.device, DOMAIN.convEvent ‖ JCS(event without sig))`. `by.device`
|
|
22
22
|
* must be `identity`'s machine. Refuses an event that fails the schema (`invalid_request`) or is over
|
|
@@ -26,11 +26,11 @@ export declare function signConvEvent<E extends UnsignedConvEvent>(identity: Ide
|
|
|
26
26
|
sig: string;
|
|
27
27
|
};
|
|
28
28
|
/** True only for a valid signature by `event.by.device` over the event without `sig`. Never throws. */
|
|
29
|
-
export declare function convEventSigned(event:
|
|
29
|
+
export declare function convEventSigned(event: ConvAnyEvent): boolean;
|
|
30
30
|
/**
|
|
31
31
|
* Admits `raw` (`admitConvEvent`) and checks its signature over the raw value (`bad_signature`). Membership and
|
|
32
32
|
* authority are `ConvLog.apply`'s. Throws only MessagingError.
|
|
33
33
|
*/
|
|
34
|
-
export declare function verifyConvEvent(raw: unknown):
|
|
34
|
+
export declare function verifyConvEvent(raw: unknown): ConvAnyEvent;
|
|
35
35
|
/** Freezes a JSON value and everything in it, iteratively. */
|
|
36
36
|
export declare function deepFreeze<T>(value: T): T;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Identity } from "../identity.js";
|
|
2
|
+
import { GuestInvitation } from "../schema/guest-invitation.js";
|
|
3
|
+
import type { ConvLog } from "./log.js";
|
|
4
|
+
/** The inviting device seals this preview to the invitee. No history or sender keys accompany it. */
|
|
5
|
+
export declare function createGuestInvitation(log: ConvLog, to: string, identity: Identity, issuedAt: number, expiresAt: number): GuestInvitation;
|
|
6
|
+
/** The accept event signs this same preview. Changed audience/policy/head requires a fresh preview. */
|
|
7
|
+
export declare function verifyGuestInvitation(log: ConvLog, raw: unknown, to: string, at: number): GuestInvitation;
|
|
8
|
+
export declare function guestHistoryExposure(history: "none" | "shared"): string;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AnchorRelation } from "../realm.js";
|
|
2
2
|
import { type Hash, type MachineId, type PersonId } from "../schema/common.js";
|
|
3
|
-
import { type AgentContext, type BridgePolicy, type ConvEvent, type ConvHead, type ConvId, type ConvKind, type ConvLogEntry, type ConvRole, type HistoryPolicy, type MsgKind, type ParticipantId, type Permit, type RekeyCause, type RespondTo, type Visibility } from "../schema/conversation.js";
|
|
3
|
+
import { type AgentContext, type BridgePolicy, type ConvEvent, type ConvExpiredEntry, type ConvHead, type ConvId, type ConvKeysEvent, type ConvKind, type ConvLogEntry, type ConvRole, type HistoryPolicy, type MsgKind, type ParticipantId, type Permit, type RekeyCause, type RespondTo, type Visibility } from "../schema/conversation.js";
|
|
4
4
|
import type { RealmId } from "../schema/realm.js";
|
|
5
|
+
import type { RequestBinding } from "./requests.js";
|
|
5
6
|
/** A participant at one position. */
|
|
6
7
|
export interface ConvParticipant {
|
|
7
8
|
p: ParticipantId;
|
|
@@ -80,6 +81,10 @@ export interface ConvLiveChecks {
|
|
|
80
81
|
skewMs?: number;
|
|
81
82
|
/** True when `device` is a current device of `person` in the realm (`unknown_device` otherwise). */
|
|
82
83
|
isDevice?: (person: PersonId, device: MachineId) => boolean;
|
|
84
|
+
/** True only when the verified realm has removed this device. */
|
|
85
|
+
isRemovedDevice?: (device: MachineId) => boolean;
|
|
86
|
+
/** Retained identity history for portable request proofs, including historical devices. */
|
|
87
|
+
requestBinding?: RequestBinding;
|
|
83
88
|
/** The org of `person`, for `join`, and for an add of a person who is not a guest (`forbidden`). */
|
|
84
89
|
orgOf?: (person: PersonId) => string | undefined;
|
|
85
90
|
}
|
|
@@ -88,11 +93,11 @@ export interface ConvApplyOptions {
|
|
|
88
93
|
body?: unknown;
|
|
89
94
|
live?: ConvLiveChecks;
|
|
90
95
|
}
|
|
91
|
-
/**
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
/** Local admission metadata, never part of an entry's signed wire representation. */
|
|
97
|
+
interface ReplayEntry {
|
|
98
|
+
entry: unknown;
|
|
99
|
+
body?: unknown;
|
|
100
|
+
held?: boolean;
|
|
96
101
|
}
|
|
97
102
|
/**
|
|
98
103
|
* A verified conversation log. Every method throws only MessagingError. Entries are kept as frozen copies of the
|
|
@@ -105,17 +110,16 @@ export declare class ConvLog {
|
|
|
105
110
|
private constructor();
|
|
106
111
|
/** An empty log of `cid` in `realm`: its head is {0, h(0)}. */
|
|
107
112
|
static open(cid: ConvId, realm: RealmId): ConvLog;
|
|
108
|
-
/** Replays
|
|
109
|
-
static fromEntries(cid: ConvId, realm: RealmId, entries:
|
|
110
|
-
entry: unknown;
|
|
111
|
-
body?: unknown;
|
|
112
|
-
}[]): ConvLog;
|
|
113
|
+
/** Replays a prefix; callers with a verified realm supply its removed-device check for every device rekey. */
|
|
114
|
+
static fromEntries(cid: ConvId, realm: RealmId, entries: ReplayEntry[], checks?: Pick<ConvLiveChecks, "isRemovedDevice" | "requestBinding">, onInvalidBody?: (seq: number) => void): ConvLog;
|
|
113
115
|
head(): ConvHead;
|
|
114
116
|
/** The last op's seq and hash, or {0, h(0)}: what an author puts in `opHead`. */
|
|
115
117
|
opHead(): ConvHead;
|
|
116
118
|
/** h(seq), for 0 ≤ seq ≤ head. */
|
|
117
119
|
hashAt(seq: number): Hash | undefined;
|
|
118
120
|
entries(): (ConvLogEntry | ConvExpiredEntry)[];
|
|
121
|
+
/** Held links are in the hash chain, but contribute neither state nor messages. */
|
|
122
|
+
held(): number[];
|
|
119
123
|
/** The state at the head; undefined before `create`. */
|
|
120
124
|
state(): ConvSnapshot | undefined;
|
|
121
125
|
/** The state after the entry at `seq`, as a log holding only entries 1..seq has it. */
|
|
@@ -135,8 +139,19 @@ export declare class ConvLog {
|
|
|
135
139
|
*/
|
|
136
140
|
apply(raw: unknown, options?: ConvApplyOptions): Hash;
|
|
137
141
|
/**
|
|
138
|
-
* Appends
|
|
139
|
-
* verifiable and the state does not change.
|
|
142
|
+
* Appends a `msg` entry whose content the relay expired (spec §16.4, "Retention"), by its digest: the chain stays
|
|
143
|
+
* verifiable and the state does not change. The create (seq 1) never expires (`invalid_request`), nor does any op:
|
|
144
|
+
* a later op head that names this seq fails.
|
|
140
145
|
*/
|
|
141
146
|
applyExpired(raw: ConvExpiredEntry): Hash;
|
|
147
|
+
/**
|
|
148
|
+
* Checks a key share against this log (spec §16.6); a share is not an entry, so nothing changes. In order: I-JSON,
|
|
149
|
+
* size and schema, realm and cid (`invalid_request`, `too_large`); the signature (`bad_signature`); the live checks
|
|
150
|
+
* given (`expired`, `unknown_device`); `by.agent` absent (`forbidden`); `opHead` names an op of this log
|
|
151
|
+
* (`conv_conflict`); then, in the state at `opHead`, the author's person is a member participant person
|
|
152
|
+
* (`not_member`) and the recipient's person a participant person (`forbidden`), and live, the recipient device is a
|
|
153
|
+
* current device of that person (`unknown_device`). Returns the frozen event.
|
|
154
|
+
*/
|
|
155
|
+
checkShare(raw: unknown, live?: ConvLiveChecks): ConvKeysEvent;
|
|
142
156
|
}
|
|
157
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type RequestActivation } from "../schema/contact-request.js";
|
|
2
|
+
import { type ConvLogEntry } from "../schema/conversation.js";
|
|
3
|
+
import { type ConvApplyOptions, type ConvLog } from "./log.js";
|
|
4
|
+
import { type RequestBinding } from "./requests.js";
|
|
5
|
+
export interface RequestReservation {
|
|
6
|
+
proof: RequestActivation;
|
|
7
|
+
completed?: {
|
|
8
|
+
seq: number;
|
|
9
|
+
digest: string;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface RequestLogState {
|
|
13
|
+
required: boolean;
|
|
14
|
+
active: boolean;
|
|
15
|
+
reservations: Map<string, RequestReservation>;
|
|
16
|
+
}
|
|
17
|
+
/** Rebuilds permanent activation state even when imported messages have expired. */
|
|
18
|
+
export declare function requestLogState(log: ConvLog, binding: RequestBinding): RequestLogState;
|
|
19
|
+
/** Checks before appending. The relay also checks live org admission on create. No mutation on failure. */
|
|
20
|
+
export declare function checkRequestEvent(log: ConvLog, raw: unknown, binding: RequestBinding, body?: unknown): void;
|
|
21
|
+
/** Member admission seam for the cut-over engine; preserves wrapper authorship and verifies source separately. */
|
|
22
|
+
export declare function applyRequestEntry(log: ConvLog, entry: ConvLogEntry, binding: RequestBinding, options?: ConvApplyOptions): string;
|
|
23
|
+
/** Public author for a verified import, never the importing device. The renderer uses this only after admission. */
|
|
24
|
+
export declare function importedRequestAuthor(log: ConvLog, id: string, binding: RequestBinding): string | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Identity } from "../identity.js";
|
|
2
|
+
import { RequestImport } from "../schema/contact-request.js";
|
|
3
|
+
import { type ConvMsgEvent } from "../schema/conversation.js";
|
|
4
|
+
import type { UnsealedMsg } from "./seal.js";
|
|
5
|
+
export declare function sealRequestImport(identity: Identity, header: UnsealedMsg, body: RequestImport, mk: Uint8Array): ConvMsgEvent;
|
|
6
|
+
export declare function openRequestImport(raw: unknown, mk: Uint8Array): RequestImport;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Identity } from "../identity.js";
|
|
2
|
+
import { ContactAuthorization, PortableRequest, RequestActivation, RequestDecision, RequestDescriptor, RequestOpening } from "../schema/contact-request.js";
|
|
3
|
+
/** Retained, verified identity history must bind every proof's device to its person; absence fails closed. */
|
|
4
|
+
export type RequestBinding = (person: string, device: string) => boolean;
|
|
5
|
+
export declare const requestCommitment: (opening: RequestOpening) => string;
|
|
6
|
+
export declare const requestDigest: (descriptor: RequestDescriptor) => string;
|
|
7
|
+
export declare function verifyRequestDescriptor(raw: unknown, binding: RequestBinding): RequestDescriptor;
|
|
8
|
+
export declare function verifyPortableRequest(raw: unknown, binding: RequestBinding): PortableRequest;
|
|
9
|
+
export declare function createPortableRequest(identity: Identity, args: Omit<RequestDescriptor, "by" | "sig" | "commitment">, text: string): PortableRequest;
|
|
10
|
+
export declare function verifyRequestDecision(raw: unknown, descriptor: RequestDescriptor, binding: RequestBinding): RequestDecision;
|
|
11
|
+
export declare function signRequestDecision(identity: Identity, d: RequestDescriptor, answer: RequestDecision["answer"], at: number): RequestDecision;
|
|
12
|
+
export declare function verifyRequestActivation(raw: unknown, binding: RequestBinding): RequestActivation;
|
|
13
|
+
export declare function signContactAuthorization(identity: Identity, args: Omit<ContactAuthorization, "sig" | "by">): ContactAuthorization;
|
|
14
|
+
export declare function verifyContactAuthorization(raw: unknown, binding: RequestBinding): ContactAuthorization;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Identity } from "../identity.js";
|
|
2
2
|
import { type EncKey, type MachineId, type PersonId } from "../schema/common.js";
|
|
3
|
-
import { type ConvKeysEvent, ConvMeta, type ConvMsgEvent, type ConvOpEvent, type KeyShare, MsgBody } from "../schema/conversation.js";
|
|
3
|
+
import { type ConvKeysEvent, ConvMeta, type ConvMsgEvent, type ConvOp, type ConvOpEvent, type KeyShare, MsgBody, SettingBody } from "../schema/conversation.js";
|
|
4
4
|
/** A message event before its body: the header its author signs, with `class: "msg"`. */
|
|
5
5
|
export type UnsealedMsg = Omit<ConvMsgEvent, "body" | "sig">;
|
|
6
6
|
/** A keys event before its body. */
|
|
@@ -33,15 +33,38 @@ export declare function sealConvMetaWith(header: Omit<ConvOpEvent, "body" | "sig
|
|
|
33
33
|
/** Opens a `create` event's `sealedMeta`. Errors as for `openConvMsg`; `not_found` when it has none. */
|
|
34
34
|
export declare function openConvMeta(event: ConvOpEvent, mk0: Uint8Array): ConvMeta;
|
|
35
35
|
/**
|
|
36
|
-
* Seals `shares` to
|
|
37
|
-
* device
|
|
36
|
+
* Seals `shares` to one recipient device as the body of `unsealed`, and signs the event: one `keys` event per
|
|
37
|
+
* recipient device (spec §16.6), at most `LIMITS.keyShares` chain keys. Throws only MessagingError.
|
|
38
38
|
*/
|
|
39
|
-
export declare function
|
|
40
|
-
/** `
|
|
41
|
-
export declare function
|
|
39
|
+
export declare function sealKeyShare(identity: Identity, unsealed: UnsealedKeys, recipient: ShareRecipient, shares: KeyShare[]): ConvKeysEvent;
|
|
40
|
+
/** `sealKeyShare` with fixed randomness: for test vectors only. */
|
|
41
|
+
export declare function sealKeyShareWith(identity: Identity, unsealed: UnsealedKeys, recipient: ShareRecipient, shares: KeyShare[], randomness: ShareRandomness): ConvKeysEvent;
|
|
42
42
|
/**
|
|
43
|
-
* Opens
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* Opens a `keys` event sealed to `identity`'s device: `not_found` when it is another device's, `bad_signature` when it
|
|
44
|
+
* fails to open, `invalid_request` when the plaintext is not a share payload. The caller has checked the event
|
|
45
|
+
* (`ConvLog.checkShare`).
|
|
46
46
|
*/
|
|
47
47
|
export declare function openKeyShares(event: ConvKeysEvent, identity: Identity): KeyShare[];
|
|
48
|
+
/** A sealed op as its author builds it: the op without `sealed`. */
|
|
49
|
+
export type UnsealedStateOp = Omit<Extract<ConvOp, {
|
|
50
|
+
op: "meta";
|
|
51
|
+
}>, "sealed"> | Omit<Extract<ConvOp, {
|
|
52
|
+
op: "setting";
|
|
53
|
+
}>, "sealed">;
|
|
54
|
+
/** An op event before its body is sealed: the header and the op without `sealed`. */
|
|
55
|
+
export type UnsealedOpEvent = Omit<ConvOpEvent, "body" | "sig"> & {
|
|
56
|
+
body: UnsealedStateOp;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Seals `content` (a `ConvMeta` for `meta`, a `SettingBody` of the op's kind for `setting`) under `mk`, the author's
|
|
60
|
+
* message key at the op's (`epoch`, `idx`), and signs the op event. Throws only MessagingError.
|
|
61
|
+
*/
|
|
62
|
+
export declare function sealConvState(identity: Identity, unsealed: UnsealedOpEvent, content: unknown, mk: Uint8Array): ConvOpEvent;
|
|
63
|
+
/** `sealConvState` with a caller-chosen nonce: for test vectors only. */
|
|
64
|
+
export declare function sealConvStateWith(identity: Identity, unsealed: UnsealedOpEvent, content: unknown, mk: Uint8Array, nonce: Uint8Array): ConvOpEvent;
|
|
65
|
+
/**
|
|
66
|
+
* Opens a `meta` or `setting` op with the author's message key at its (`epoch`, `idx`): a `ConvMeta`, or a
|
|
67
|
+
* `SettingBody` whose `s` is the op's `kind` (`invalid_request` otherwise). `not_found` for another op; errors as
|
|
68
|
+
* for `openConvMsg`. The caller has applied the event to the log.
|
|
69
|
+
*/
|
|
70
|
+
export declare function openConvState(event: ConvOpEvent, mk: Uint8Array): ConvMeta | SettingBody;
|