@kumiai/rpc 0.9.1 → 0.10.1
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/README.md +120 -13
- package/lib/app-aad.d.ts +8 -0
- package/lib/app-aad.js +28 -0
- package/lib/app-lane.d.ts +37 -20
- package/lib/app-lane.js +404 -67
- package/lib/commit-frame.js +3 -0
- package/lib/crypto.d.ts +106 -31
- package/lib/crypto.js +49 -7
- package/lib/cursor.d.ts +4 -0
- package/lib/cursor.js +10 -0
- package/lib/directed.d.ts +3 -4
- package/lib/directed.js +9 -3
- package/lib/handlers.d.ts +12 -1
- package/lib/handlers.js +6 -2
- package/lib/handshake.d.ts +3 -6
- package/lib/handshake.js +13 -6
- package/lib/host-notice.d.ts +1 -0
- package/lib/host-notice.js +12 -0
- package/lib/index.d.ts +5 -2
- package/lib/index.js +3 -2
- package/lib/open-once.d.ts +11 -9
- package/lib/open-once.js +18 -12
- package/lib/peer.d.ts +49 -4
- package/lib/peer.js +796 -305
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -6,15 +6,21 @@ the whole group (events), a subgroup, anycast a request, gather replies, or run
|
|
|
6
6
|
directed 1:1 RPC (request/stream/channel) to a single member — all over
|
|
7
7
|
epoch-rotating opaque topics, with an authenticated sender on every surface.
|
|
8
8
|
|
|
9
|
+
`peer.protocol(name).gather(prc, { param, quorum?, timeoutMs?, onReply?, signal? })` resolves with
|
|
10
|
+
the collected replies. `onReply` runs once per accepted reply as it arrives, with its authenticated
|
|
11
|
+
`senderDID` and the same object stored in the result array. Treat that object as read-only. A
|
|
12
|
+
throwing callback is ignored. Aborting `signal` resolves with replies collected so far. A signal
|
|
13
|
+
already aborted resolves `[]` without sending, including while the peer waits for initial readiness.
|
|
14
|
+
|
|
9
15
|
## The two consumer ports
|
|
10
16
|
|
|
11
17
|
group-rpc never imports MLS. It owns transport and orchestration; the consumer supplies the crypto
|
|
12
18
|
half through two ports:
|
|
13
19
|
|
|
14
|
-
- **`GroupCrypto`** —
|
|
20
|
+
- **`GroupCrypto`** — a synchronous epoch hint, `exportSecret(label, length?)` for as many epoch-bound,
|
|
15
21
|
domain-separated exported secrets as there are labels, `wrap`/`unwrap` for app traffic,
|
|
16
|
-
`frameEpoch` to read a sealed frame's
|
|
17
|
-
for a commit's ledger-entry blob.
|
|
22
|
+
`frameEpoch` and `frameAAD` to read a sealed frame's cleartext metadata, optional `pending`
|
|
23
|
+
storage for durable app delivery, and `sealEntries`/`openEntries` for a commit's ledger-entry blob.
|
|
18
24
|
- **`GroupMLS`** — the lifecycle half: read a Commit's own claims before touching it, apply the ones
|
|
19
25
|
this member is in a position to apply, report the roster the apply left behind, and drive the
|
|
20
26
|
recovery/ledger rendezvous.
|
|
@@ -32,23 +38,31 @@ quiet — while an evicted member can still name and read the app topic, which d
|
|
|
32
38
|
hand-rolled seal keyed off anything but the epoch secret round-trips, throws nothing, and lets a
|
|
33
39
|
removed member open the ledger-entry blobs of commits enacted after its removal.
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
Four constraints a port implementation is most likely to get wrong, all of which the suite pins:
|
|
36
42
|
|
|
43
|
+
- **`epoch()` is a hint; decisions use the epoch a result reports.** A host's published epoch can
|
|
44
|
+
lag its handle or, after a rolled-back transaction, run ahead of it. So every port result that
|
|
45
|
+
acted on the handle carries the epoch it acted at, read under the host's handle lock:
|
|
46
|
+
`exportSecret` returns `{ secret, epoch }`, `sealEntries` returns `{ sealed, epoch }`, `unwrap`
|
|
47
|
+
returns `epoch`, `processCommit` returns `{ advanced, epochBefore, epochAfter }`, and
|
|
48
|
+
`GroupMLS.readEpoch()` answers when no operation runs. The suite's epoch clauses set the hint one
|
|
49
|
+
behind and one ahead and expect the same answers.
|
|
37
50
|
- **`unwrap` throwing is ordinary control flow**, not an error: it is how a retained frame says "not
|
|
38
|
-
my epoch".
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
time, so nothing may depend on the window.
|
|
51
|
+
my epoch". A readable frame at another epoch must throw `FrameEpochError { frameEpoch,
|
|
52
|
+
handleEpoch }` before anything is decrypted. The lane retains a frame only on that error's
|
|
53
|
+
"ahead" answer; any other refusal marks it dead.
|
|
42
54
|
- **`readCommitHeader` returning `null` means "these bytes are not a Commit at all"** — never "a
|
|
43
55
|
Commit I could not read". The lane files `null` as poison and steps over it, so a port answering
|
|
44
56
|
`null` for every commit framed away from its own epoch makes a peer that fell behind read the
|
|
45
57
|
group's entire future as garbage, walk to the end of the log, and report itself fully reconciled at
|
|
46
58
|
a dead epoch.
|
|
47
|
-
- **`processCommit` returns `
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
- **`processCommit` returns `advanced: false` for anything it cannot apply, and throws only for a
|
|
60
|
+
Commit it may yet apply**: one whose named ledger entries will not resolve from the Commit's own
|
|
61
|
+
frame (a `MissingLedgerEntriesError`), or a fault that says nothing about the Commit, such as a
|
|
62
|
+
resolver or store failure. A commit at another epoch, including one the handle moved past while
|
|
63
|
+
entries resolved, is `advanced: false` with the handle's epoch. A fault makes the lane re-read
|
|
64
|
+
the frame, so a port that throws on a commit it was never in a position to apply wedges the lane
|
|
65
|
+
there forever — a late joiner would wedge on its own add-commit, the first frame it reads.
|
|
52
66
|
|
|
53
67
|
`sealEntries`/`openEntries` are deliberately not `wrap`/`unwrap`. The entry blob is opened from
|
|
54
68
|
inside the apply of the commit that carries it, and a ratchet-backed open mutates the handle, which
|
|
@@ -57,6 +71,60 @@ when it is safe to open stops existing rather than being managed.
|
|
|
57
71
|
|
|
58
72
|
## The app lane: logged events
|
|
59
73
|
|
|
74
|
+
### Durable delivery (opt-in)
|
|
75
|
+
|
|
76
|
+
Supplying `GroupCrypto.pending` enables acknowledged delivery for events declared `retain: 'log'`.
|
|
77
|
+
For a conforming hub that appends and retains the frame until it is durably opened, the peer
|
|
78
|
+
delivers these events **at least once**, in log order per protocol, across process restarts and
|
|
79
|
+
handler failures. A successful handler return acknowledges the event; a thrown handler or failed
|
|
80
|
+
`pending.complete` retries the same record with backoff, holding later events in that protocol.
|
|
81
|
+
An event handler that never settles holds its protocol indefinitely. Disposing the peer does not
|
|
82
|
+
cancel an active handler; the host must settle its work or restart the peer to retry the record.
|
|
83
|
+
The handler context's `frame: AppFrameRef` identifies a logged delivery. Store a deduplication
|
|
84
|
+
entry keyed by `frame.id` in the same transaction as the handler's effect before returning.
|
|
85
|
+
External effects must be idempotent or reconciled by that id. A record may be delivered again if
|
|
86
|
+
the process crashes after the effect but before completion.
|
|
87
|
+
|
|
88
|
+
`AppFrameRef` includes `id`, `topicID`, `protocol`, anchor `segment`, and log `position`. The id
|
|
89
|
+
is derived from the topic and ciphertext, so it stays stable across replay. `pending.list()`
|
|
90
|
+
restores records at startup in `(segment, position)` order; `pending.complete(id)` is idempotent.
|
|
91
|
+
The port's `unwrap(bytes, { expectedAAD, frame })` must atomically save the consumed-key handle
|
|
92
|
+
state and the pending record before resolving. A failed save must leave the handle openable and
|
|
93
|
+
throw an error recognized by `isAppFrameStorageError`; the app lane retries without advancing
|
|
94
|
+
past that frame. `onAppDeliveryStalled` reports a persistent storage block, a missing protocol on
|
|
95
|
+
restore, or a future-epoch frame once per blocking frame. A missing-protocol record stays
|
|
96
|
+
pending and can be delivered after that protocol is registered on a later start. An operator can
|
|
97
|
+
call `retryAppDelivery(topicID?)` to reset backoff and schedule an immediate retained pull and
|
|
98
|
+
matching delivery workers without replacing the peer. It returns when the attempt is scheduled.
|
|
99
|
+
`onAppDeliveryResumed` reports the same group, protocol, topic, position, and optional reason once
|
|
100
|
+
the reported block clears through delivery, drop, dead-frame handling, or segment rotation.
|
|
101
|
+
Disposal does not report a resume. An operator can
|
|
102
|
+
accept a frame's loss with `dropAppFrame(topicID, position)`; it can explicitly discard a
|
|
103
|
+
missing-protocol record, but refuses a pending frame under a registered protocol. It also refuses
|
|
104
|
+
to drop a sealed frame behind an earlier pending or sealed frame, because the durable cursor cannot
|
|
105
|
+
record that drop until the earlier frame is settled.
|
|
106
|
+
|
|
107
|
+
Durable delivery is off when `GroupCrypto.pending` is absent. Ephemeral events remain best effort;
|
|
108
|
+
directed traffic and anycast requests and replies keep their existing live completion or expiry
|
|
109
|
+
semantics. Log-intent pushes only wake a retained fetch: pushed bytes and positions never become
|
|
110
|
+
pending records. The hub must have appended the frame to the topic log before pushing it.
|
|
111
|
+
Frames pruned before a read, or lost after a failed durable open followed by retention expiry,
|
|
112
|
+
cannot be recovered; `onAppWindowPruned` reports a visible gap. A hub that only sends a log frame
|
|
113
|
+
by mailbox also gives no durable guarantee. A frame published at epoch E and first fetched after
|
|
114
|
+
this peer has moved past E is refused: the peer cannot authenticate its sender after that move.
|
|
115
|
+
A hub can withhold or omit frames. A frame claiming an epoch above this peer's current epoch remains
|
|
116
|
+
retained with the cursor behind it even if a commit fetch omits the matching commit. It opens when the
|
|
117
|
+
peer reaches that epoch, or an operator can explicitly discard it with `dropAppFrame`. A forged
|
|
118
|
+
far-future claim can hold delivery until that drop; `onAppDeliveryStalled` reports the wait once with
|
|
119
|
+
`reason: 'future-epoch'`. A frame below the current epoch remains refused.
|
|
120
|
+
The existing commit-applied-before-anchor-saved crash window can still leave a restarted peer on
|
|
121
|
+
a stale app topic.
|
|
122
|
+
|
|
123
|
+
App-frame AAD is `[0x01, intent, ...UTF8(topicID)]`, where intent is `0x01` for log and `0x00`
|
|
124
|
+
for ephemeral. `frameAAD` reads this cleartext routing hint; only `unwrap` with the full expected
|
|
125
|
+
AAD authenticates it. Old bare-topic AAD fails to open, so mixed 0.9/0.10 app peers are
|
|
126
|
+
incompatible. Use `encodeAppAAD` and `decodeAppAAD` for the shared format.
|
|
127
|
+
|
|
60
128
|
An `event` procedure in a group protocol may declare `retain: 'log'`, which makes every dispatch of
|
|
61
129
|
it retained by the hub and pullable later, whatever the call site:
|
|
62
130
|
|
|
@@ -135,3 +203,42 @@ refuses a retention above its ceiling rather than clamping it, and a default sit
|
|
|
135
203
|
ceiling would make every upward override an outright refusal — leaving the peer not a subscriber of
|
|
136
204
|
its own commit topic. The two windows are aligned so there is no span in which a returning member can
|
|
137
205
|
rebuild its membership but not its messages.
|
|
206
|
+
|
|
207
|
+
## Host notices for commit strands and recovery
|
|
208
|
+
|
|
209
|
+
`GroupPeerParams.onStrand` reports when the commit walk finds evidence that this peer is stranded.
|
|
210
|
+
One observation marks one stranded episode; further frames stay silent unless they provide strictly
|
|
211
|
+
stronger evidence. A successful recovery, including a bootstrap completed later, ends the episode.
|
|
212
|
+
The next strand starts a new one. A failed attempt leaves the episode open. The state is in memory,
|
|
213
|
+
so restarting a peer can produce a new observation for the same strand.
|
|
214
|
+
|
|
215
|
+
Each `StrandObservation` names the stable commit-topic `groupID`, the frame's log `position`, the
|
|
216
|
+
peer's `localEpoch`, a `kind`, and a `confidence`. `claimedEpoch` comes from the cleartext header;
|
|
217
|
+
`commitDigest` identifies the commit bytes. Both are `null` for an unreadable future version.
|
|
218
|
+
|
|
219
|
+
| Kind | Confidence | What the evidence establishes |
|
|
220
|
+
| --- | --- | --- |
|
|
221
|
+
| `own-unmerged` | `authenticated` | Sender data proves this device sealed a commit at this epoch that the hub now places in the log. Commit content is unverified; a hub can tamper beyond the ciphertext sample or fake acceptance. Heal. |
|
|
222
|
+
| `fork-losing` | `observed` | This peer enacted different commit bytes at that epoch and is on the branch that loses the log-position tiebreak. The other commit is not authenticated. |
|
|
223
|
+
| `ahead` | `claimed` | A frame's cleartext epoch is ahead of this peer. A commit-topic publisher can forge that claim. |
|
|
224
|
+
| `unknown-version` | `claimed` | A frame's handshake or commit-frame version cannot be read by this build. Its epoch and commit bytes are unavailable. |
|
|
225
|
+
|
|
226
|
+
`GroupPeerParams.onRecovery` reports `started` and exactly one terminal event (`succeeded` or
|
|
227
|
+
`failed`) for each attempt. The event's `attemptID`, `groupID` and `trigger` (`automatic` or
|
|
228
|
+
`consumer`) stay the same. A failure has reason `no-responder`, `deadline`, `bootstrap-failed`,
|
|
229
|
+
`disposed` or `error`; `error` includes the thrown value. Success means both the rejoin and ledger
|
|
230
|
+
bootstrap completed. If a rejoin landed but bootstrap failed, a later lane operation can finish it
|
|
231
|
+
and emit `bootstrapped` with that failed attempt's ID. This closes the stranded episode.
|
|
232
|
+
|
|
233
|
+
`started` is dispatched asynchronously as the attempt begins, before any rendezvous reply or
|
|
234
|
+
terminal event is required. It can arrive while the attempt is waiting on a port call; an observer
|
|
235
|
+
that disposes the peer then ends the attempt with `failed` (`disposed`).
|
|
236
|
+
|
|
237
|
+
Automatic healing and calls to `recover()` share one in-flight attempt. Joiners get its result or
|
|
238
|
+
error; they do not start another attempt. Owed `reenact` entries are kept until the first
|
|
239
|
+
`recover()`, `commit()` or `replay()` that drains them. A direct `recover()` can therefore return
|
|
240
|
+
entries stashed by an earlier automatic heal. Each entry is handed out once.
|
|
241
|
+
|
|
242
|
+
`onStrand` and terminal `onRecovery` notices run after the producing commit-lane operation settles.
|
|
243
|
+
`started` is dispatched earlier. None is awaited; throws and rejections are swallowed. `onAppWindowPruned`
|
|
244
|
+
retains its existing behavior.
|
package/lib/app-aad.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Version 1 binds both destination topic and declared retention intent to an app seal. */
|
|
2
|
+
export type AppAAD = {
|
|
3
|
+
topicID: string;
|
|
4
|
+
intent: 'ephemeral' | 'log';
|
|
5
|
+
};
|
|
6
|
+
export declare function encodeAppAAD({ topicID, intent }: AppAAD): Uint8Array;
|
|
7
|
+
/** Decode untrusted cleartext AAD. Its contents become authenticated only after the open. */
|
|
8
|
+
export declare function decodeAppAAD(bytes: Uint8Array): AppAAD | null;
|
package/lib/app-aad.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { fromUTF } from '@sozai/codec';
|
|
2
|
+
export function encodeAppAAD({ topicID, intent }) {
|
|
3
|
+
if (intent !== 'ephemeral' && intent !== 'log') throw new Error('Invalid app AAD intent');
|
|
4
|
+
const topic = fromUTF(topicID);
|
|
5
|
+
if (new TextDecoder('utf-8', {
|
|
6
|
+
fatal: true
|
|
7
|
+
}).decode(topic) !== topicID) {
|
|
8
|
+
throw new Error('App AAD topic must be well-formed UTF-8');
|
|
9
|
+
}
|
|
10
|
+
const encoded = new Uint8Array(2 + topic.length);
|
|
11
|
+
encoded[0] = 1;
|
|
12
|
+
encoded[1] = intent === 'log' ? 1 : 0;
|
|
13
|
+
encoded.set(topic, 2);
|
|
14
|
+
return encoded;
|
|
15
|
+
}
|
|
16
|
+
/** Decode untrusted cleartext AAD. Its contents become authenticated only after the open. */ export function decodeAppAAD(bytes) {
|
|
17
|
+
if (bytes.length < 2 || bytes[0] !== 1 || bytes[1] !== 0 && bytes[1] !== 1) return null;
|
|
18
|
+
try {
|
|
19
|
+
return {
|
|
20
|
+
topicID: new TextDecoder('utf-8', {
|
|
21
|
+
fatal: true
|
|
22
|
+
}).decode(bytes.subarray(2)),
|
|
23
|
+
intent: bytes[1] === 1 ? 'log' : 'ephemeral'
|
|
24
|
+
};
|
|
25
|
+
} catch {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
package/lib/app-lane.d.ts
CHANGED
|
@@ -2,26 +2,39 @@ import type { ProtocolDefinition } from '@enkaku/protocol';
|
|
|
2
2
|
import type { StoredMessage } from '@kumiai/hub-protocol';
|
|
3
3
|
import type { Anchor } from './anchor.js';
|
|
4
4
|
import type { AppCursorStore, AppWindowPruned } from './app-cursor.js';
|
|
5
|
-
import type
|
|
5
|
+
import { type GroupCrypto, type PendingAppFrame } from './crypto.js';
|
|
6
6
|
import { type LogPosition } from './cursor.js';
|
|
7
7
|
import type { BusHandlerMaps } from './handlers.js';
|
|
8
8
|
import type { HubMux } from './hub-mux.js';
|
|
9
|
-
/**
|
|
10
|
-
* One buffered app frame. `sealed` goes `null` once the frame is done — delivered or dead — but
|
|
11
|
-
* the position outlives it: the cursor advances over a RUN of done frames, so a done frame's
|
|
12
|
-
* place in that run is the whole of what it still has to say.
|
|
13
|
-
*/
|
|
9
|
+
/** The position outlives sealed bytes until the cursor can pass a run of done frames. */
|
|
14
10
|
export type AppFrame = {
|
|
15
11
|
position: LogPosition;
|
|
16
|
-
sealed:
|
|
12
|
+
sealed: {
|
|
13
|
+
state: 'sealed';
|
|
14
|
+
bytes: Uint8Array;
|
|
15
|
+
} | {
|
|
16
|
+
state: 'pending';
|
|
17
|
+
id: string;
|
|
18
|
+
} | {
|
|
19
|
+
state: 'done';
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type AppDeliveryStalled = {
|
|
23
|
+
groupID: string;
|
|
24
|
+
protocol: string;
|
|
25
|
+
topicID: string;
|
|
26
|
+
position: string;
|
|
27
|
+
error: Error;
|
|
28
|
+
reason?: 'unknown-protocol' | 'future-epoch';
|
|
17
29
|
};
|
|
30
|
+
export type AppDeliveryResumed = Omit<AppDeliveryStalled, 'error'>;
|
|
18
31
|
export type AppLaneParams = {
|
|
19
32
|
mux: HubMux;
|
|
20
33
|
crypto: GroupCrypto;
|
|
21
34
|
localDID: string;
|
|
22
35
|
protocols: Record<string, ProtocolDefinition>;
|
|
23
36
|
/**
|
|
24
|
-
* The host's app event handlers, per protocol, as the
|
|
37
|
+
* The host's app event handlers, per protocol, as the delivery worker calls them — the same adaptation
|
|
25
38
|
* the live bus server is built from, so a drained frame and a pushed one reach the host by the
|
|
26
39
|
* same door.
|
|
27
40
|
*/
|
|
@@ -30,6 +43,10 @@ export type AppLaneParams = {
|
|
|
30
43
|
retentionSeconds: number;
|
|
31
44
|
appCursorStore?: AppCursorStore | undefined;
|
|
32
45
|
onAppWindowPruned?: ((event: AppWindowPruned) => void | Promise<void>) | undefined;
|
|
46
|
+
onAppDeliveryStalled?: ((event: AppDeliveryStalled) => void) | undefined;
|
|
47
|
+
onAppDeliveryResumed?: ((event: AppDeliveryResumed) => void) | undefined;
|
|
48
|
+
/** Start workers after the caller's serialization boundary; direct lanes start immediately. */
|
|
49
|
+
scheduleDelivery?: ((start: () => void) => void) | undefined;
|
|
33
50
|
/**
|
|
34
51
|
* The live anchor, read rather than held: it moves under the peer, and the topic every buffer
|
|
35
52
|
* and cursor here belongs to is derived from it. Read once per lazy buffer creation, so a
|
|
@@ -39,14 +56,6 @@ export type AppLaneParams = {
|
|
|
39
56
|
anchor: () => Anchor;
|
|
40
57
|
/** The group's commit topic, or `undefined` before the control lanes are up. */
|
|
41
58
|
groupID: () => string | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* The highest epoch the group's own commit log can justify a frame having been sealed at.
|
|
44
|
-
*
|
|
45
|
-
* A PORT rather than this lane's own work: it pages the COMMIT log with the commit lane's
|
|
46
|
-
* codecs and limits, and only the bound it answers belongs here. See the implementation in
|
|
47
|
-
* `peer.ts` for why an untrusted field is acceptable for this one question.
|
|
48
|
-
*/
|
|
49
|
-
justifiedEpochCeiling: () => Promise<number>;
|
|
50
59
|
};
|
|
51
60
|
export type AppLane = {
|
|
52
61
|
/**
|
|
@@ -54,18 +63,26 @@ export type AppLane = {
|
|
|
54
63
|
* leave the rest buffered. Called before each apply and once more when the walk ends.
|
|
55
64
|
*/
|
|
56
65
|
deliver: () => Promise<void>;
|
|
66
|
+
dropFrame: (topicID: string, position: string) => Promise<void>;
|
|
67
|
+
/** Wake queued delivery for a topic, or every topic, without waiting for completion. */
|
|
68
|
+
retryDelivery: (topicID?: string) => void;
|
|
57
69
|
/** Record a log-class frame the live lane was pushed, at the moment it arrives. */
|
|
58
|
-
note: (name: string, topicID: string, message: StoredMessage) => void;
|
|
70
|
+
note: (name: string, topicID: string, message: StoredMessage, failure: unknown) => void;
|
|
59
71
|
/**
|
|
60
72
|
* End the segment the buffer belongs to. Called by the peer AFTER it moves the anchor, since
|
|
61
73
|
* every buffer and cursor rebuilt from here reads the anchor back through {@link
|
|
62
74
|
* AppLaneParams.anchor}.
|
|
63
75
|
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* cleared at the STORE, since a cursor is keyed by topic and stays true of the topic being left.
|
|
76
|
+
* The walk has drained the old epoch before this reset. Cursors stay in the store, keyed by
|
|
77
|
+
* topic, while pending records survive in the delivery queue.
|
|
67
78
|
*/
|
|
68
79
|
reset: () => void;
|
|
80
|
+
/** Opened records awaiting the delivery worker. */
|
|
81
|
+
pendingRecords: () => Array<PendingAppFrame>;
|
|
82
|
+
/** Restore durable records before the first retained pull. */
|
|
83
|
+
restore: (records: Array<PendingAppFrame>) => Promise<void>;
|
|
84
|
+
/** Stop queued retries and prevent new handler calls. */
|
|
85
|
+
dispose: () => void;
|
|
69
86
|
};
|
|
70
87
|
/**
|
|
71
88
|
* The peer's app lane: the retained-frame buffer, the durable read position over it, and the two
|