@real-life/trust-protocol 0.6.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 CHANGED
@@ -1,5 +1,170 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.8.0
4
+
5
+ Takes up the VTI Mediator Adapter Profile 0.25 (§1b, the delivery hint)
6
+ and Encounter 0.31.1: a card carries the hints by which its side is
7
+ reachable in the relationship the card opens. A minor version: the
8
+ public API grows (`CarrierOffer`, a new `ActError` member, new
9
+ `RelationshipView` fields, three adapter exports); the storage format
10
+ does not change.
11
+
12
+ - **The carrier offer** of `show` and `scan`: `carrier: {nonce,
13
+ deliveryHints}` (new type `CarrierOffer`). `nonce` is the
14
+ relationship's carrier nonce N, 32 bytes the app draws fresh (Identity
15
+ §7a.3); `deliveryHints` are the hints the app built from the wire
16
+ identities its adapter derives from N. The displayed card (`show`) or
17
+ the scanner's sent card (`scan`) carries the hints under its proof.
18
+ The library interprets no hint. The offer is act input: bound and
19
+ journaled with the act, so a repeat under the same actId answers the
20
+ same card and another offer under it is `actid-conflict`.
21
+ - **N in the register** (`register.carriers`, generation 1) under the
22
+ relationship the card opens: at `show` already, as the card's pair
23
+ label enters the register before display (Encounter 4110); a card that
24
+ ages unscanned leaves its entry, as it leaves its label. At `scan`
25
+ under the scanner's fresh relationship. The storage format is
26
+ unchanged (codec 3).
27
+ - **Refusals**: more than eight hints or a hint over 512 characters
28
+ (Encounter RLTP-ENC-6090) is `card-invalid` with `ref`
29
+ `RLTP-ENC-6090`; an offer without a hint, or with a hint that is no
30
+ string, is `card-invalid` without a `ref` (an empty offer announces
31
+ nothing; a card without hints needs no offer, 6080); a nonce that is not 32 bytes in canonical base64url,
32
+ or that the register already holds as a carrier or pair nonce, is the
33
+ new code `carrier-nonce-invalid`. Nothing commits on a refusal.
34
+ - **The view**: each `RelationshipView` names the relationship's
35
+ canonical carrier-nonce entry (`carrierNonce: {nonce, generation}`) and
36
+ the counterpart's hints from the card of the enactment that opened it
37
+ (`counterpartDeliveryHints`), as signed. A re-encounter chained into
38
+ the relationship changes neither (profile RLTP-VTI-1230). Without an
39
+ offer both are absent.
40
+ - `cardBody` takes `deliveryHints`.
41
+ - **The adapter builds and reads the hint** (`./adapters/vti-mediator`,
42
+ below the port line): `deliveryHint(rootIkm, C, N)` derives this
43
+ side's connection DID and egress identity from (root, `C`, `N`), as
44
+ the factory derives the instance's trio (derived, not supplied), and
45
+ gives its hint (RLTP-VTI-1210: the JCS form of the `TSPTransport`
46
+ entry);
47
+ `readDeliveryHint(hint, C)` reads one hint strictly (1210, 1220: JSON,
48
+ byte-equal to its JCS form, exactly the four members, both identities
49
+ canonical Ed25519 `did:key` that decode to `0xed01` and 32 bytes,
50
+ `serviceEndpoint` = `C`) into `{connectionDid, egressDid, carrier}` or null;
51
+ `readDeliveryHints(hints, C, self)` reads a card's list as the side
52
+ `self` (its own connection DID and egress identity): a hint naming one
53
+ of them is ignored (RLTP-VTI-1227), then exactly one hint for `C`
54
+ (1225), else null. Both readers are total (RLTP-VTI-1220): any input
55
+ answers null or the complete identities, nothing throws — a hint that
56
+ parses but has no JCS form (a lone surrogate) included; tested over the
57
+ vector's corpus and 20 000 seeded mutations. The app passes the
58
+ identities to the wire (`peerDid`, `peerEgressDid` of the binding),
59
+ which refuses a counterpart identity that is one of its own.
60
+ - **No change of N.** The library offers no rotation of a carrier nonce
61
+ (Identity §7a.3, `generation + 1`) and no replacement after loss:
62
+ `register.carriers` is written once per relationship, at `show` or
63
+ `scan`. The profile carries none either (RLTP-VTI-1245). With one
64
+ writer of the register per holder, as in this library, `carrierNonce`
65
+ is the `N` whose identities the counterpart saw; two devices writing a
66
+ first `N` apart would make that untrue (profile Open Issue 13). A
67
+ relationship chained into another is no `RelationshipView` of its own
68
+ (only an id in `chainedFrom`) and shows no `carrierNonce`: the app
69
+ closes the adapter instance of a relationship once its id appears in
70
+ another relationship's `chainedFrom` (RLTP-VTI-1230).
71
+
72
+ ## 0.7.0
73
+
74
+ Takes up the VTI Mediator Adapter Profile 0.24: the sending form of §3a.
75
+
76
+ - **Two sending modes** (RLTP-VTI-3110 to 3140): `SendMode` is
77
+ `'routed' | 'egress-session'`. Every adapter instance starts in
78
+ `routed`; `MediatorWire.deposit(accessToken, bytes, egressDid, mode)`
79
+ now receives the mode of each deposit, read at the hand-over, so an
80
+ attempt begun before a switch ends in the mode it began in. A wire may
81
+ offer `queueEmpty()` (true when the mediator holds nothing more for
82
+ the connection). Closed: a wire without it never completes a
83
+ collection, and the adapter over it never switches. The consumer a
84
+ wire registers with `onDeliver` now answers a boolean: whether the
85
+ adapter took the frame (buffered, already held, or absorbed); `false`
86
+ (above `max-queue-bytes`, or a retired instance) leaves the frame with
87
+ the mediator, and a wire does not take its queue for drained until the
88
+ frame is offered again.
89
+ - **The send state** (RLTP-VTI-3130), per relationship: the mode and the
90
+ **open routed deposits** (`SendState.open`, each with digest and
91
+ acceptance instant): every document (an entry of kind `document` filed
92
+ by `reconcile`) accepted in `routed` and not yet answered.
93
+ Acknowledgements are no open deposits, so a side that only
94
+ acknowledges never switches by the deadline (profile Open Issue 9). A
95
+ document's acceptance instant is the adapter clock (the last port
96
+ instant) when its deposit resolved; without a port call in between it
97
+ is the hand-over instant. The send state travels in `AckState.send`
98
+ (new type `SendState`); a restore checks it fail-closed: exactly `mode`
99
+ and `open`, a known mode, each entry exactly digest and acceptance
100
+ instant, finite and not after the restore instant, each digest once,
101
+ nothing open in `egress-session` — any other field is refused, not
102
+ ignored. A snapshot without it starts in `routed`. `sendMode` reads the
103
+ current mode. A `submit()` without a digest opens nothing. An open
104
+ deposit falls `routedAckDeadlineMs` plus `duplicateWindowMs` after its
105
+ acceptance, also where no switch check runs; a restore cuts such
106
+ entries instead of refusing them. A routed attempt accepted after the
107
+ switch enters nothing.
108
+ - **Absorption for the give-up horizon** (profile §2, §4): the adapter
109
+ absorbs a byte-identical copy of a concluded item only within
110
+ `give-up-horizon` of its conclusion (or while an acknowledgement for it
111
+ is on the wire); a later copy is a new item for the holder, whose
112
+ absorption answers it with the stored acknowledgement (RLTP-DEL-6330,
113
+ 6335); its new conclusion sets the conclusion instant anew. Buffered
114
+ and outstanding go before concluded, so a redelivery of such a copy is
115
+ ignored while the holder has it. The entry and its ack intent stand for
116
+ the duplicate window; while such a later copy waits in the buffer or is outstanding,
117
+ the standing intent is not sent, so it never deletes the copy before
118
+ the holder concluded it (hand off → await → ack).
119
+ - **"Nothing pending" is the binding's statement** (RLTP-VTI-7150):
120
+ `queueEmpty()` true; without it, no switch.
121
+ - **Answers and switch**: `acknowledged(id)`, `receiverRefused(id, code)`
122
+ and the new `answered(digest, now)` (an answer the holder hands a later
123
+ instance: a valid acknowledgement, a validated refusal or a validated
124
+ `idConflict`) answer the open deposit of that document's digest; a
125
+ verdict that outruns the acceptance (`answered` included) keeps the
126
+ document from being opened. An open acknowledgement is answered by nothing. Each answer
127
+ settles its own deposit only. `advance` switches one way to
128
+ `egress-session` when an open routed deposit was accepted
129
+ `DECLARED.routedAckDeadlineMs` (72 h, equal to the give-up horizon) or
130
+ more ago, checked only after the instance concluded a collection that
131
+ left nothing pending (an empty collection counts; `queueEmpty()` true,
132
+ nothing buffered or outstanding) and only while nothing is pending
133
+ again at the check, so an acknowledgement that arrived since is
134
+ collected and reported first. A deposit the wire refuses with the new
135
+ `WireError` kind `'routed-refused'` (a validated refusal of the routed
136
+ form) switches at once; the submission stays
137
+ `awaiting-transport(carrier-refused-retriable)` and goes in
138
+ `egress-session` at its next hand-over. This holds for an attempt the
139
+ holder withdrew while it ran as well: the refusal is evidence about the
140
+ mediator, not about the document. At the switch the open deposits
141
+ leave; nothing returns to `routed`. An accepted submission is never
142
+ deposited again; one still in the holder's custody goes in the new mode
143
+ at its next hand-over (RLTP-VTI-3135, 7130).
144
+ - **What the host owes**: the reports a collection carries are applied
145
+ before its `conclude`, at the latest before the next `advance`, since
146
+ the switch check counts them as applied. A host that persists only
147
+ `concluded` and `pending` starts every opening in `routed` with nothing
148
+ open, so a relationship whose openings last less than 72 hours never
149
+ switches by the deadline; the mode in a restored snapshot is as
150
+ trustworthy as the host's store.
151
+ - **`depositAddressing(mode, self, peerConnection, carrier)`**: the
152
+ addressing of both layers and the session per mode, as
153
+ `vectors/vti-routed-addressing.json` states it (RLTP-VTI-1110, 1120,
154
+ 3110, 3115, 3120); the wire binding packs from it.
155
+ - **The app's transport contract**, stated and tested (it held before):
156
+ after a withdrawal by `reconcile` the adapter starts no deposit for that
157
+ submission, and an outcome that resolves late changes nothing, the send
158
+ state included, except a validated refusal of the routed form, which
159
+ switches; a wire call already running cannot be recalled and may
160
+ still land at the mediator (profile §6), and the copy that arrives is a
161
+ duplicate the receiver absorbs (Delivery §6.2). Every deposit is a
162
+ submission with an id of its own, a duplicate's answer included; the
163
+ report handed to the holder carries the digest, and the app pairs it
164
+ with its deposit through the submission id it polls.
165
+ - Breaking for wire implementations: `deposit` takes the mode as its
166
+ fourth argument. `AckState` gains the optional `send`.
167
+
3
168
  ## 0.6.1
4
169
 
5
170
  One actId, one result.
package/README.md CHANGED
@@ -94,7 +94,33 @@ that the adapter holds it and ends nothing (RLTP-DEL-6330), and it stays
94
94
  retained with its effect for a duplicate (6335).
95
95
  `./adapters/vti-mediator` reconciles from the view
96
96
  (`reconcile(view, holder, now)`); one adapter serves one opening, so the
97
- next opening creates a new one.
97
+ next opening creates a new one. The app persists the adapter's
98
+ `ackState()`, which carries the relationship's send state, and restores it
99
+ into the next adapter; it hands that adapter, through `answered(digest,
100
+ now)`, the valid acknowledgements, validated refusals and validated
101
+ `idConflict` answers that arrive for documents an earlier adapter
102
+ deposited, before the adapter's next `advance`. The reports a
103
+ collection carries (`acknowledged`, `receiverRefused`, `answered`) are
104
+ applied before that collection's `conclude`, at the latest before the
105
+ next `advance`: the switch check counts them as applied, and one applied
106
+ late can let a relationship switch although its deposits were answered.
107
+ The send state holds the mode and the open routed deposits: this side's
108
+ documents accepted in `routed` and not yet answered (acknowledgements are
109
+ none, so a side that only acknowledges never switches by the deadline); an open
110
+ deposit 72 hours old switches the relationship to `egress-session`, and
111
+ so does a deposit the wire refuses as `'routed-refused'`, at once. A host
112
+ that persists only `concluded` and `pending` starts every opening in
113
+ `routed` with nothing open, so a relationship whose openings last less
114
+ than 72 hours never switches by the deadline; the mode in a restored
115
+ snapshot is as trustworthy as the host's store. The adapter absorbs a
116
+ byte-identical copy of a concluded item only for the give-up horizon
117
+ after its conclusion; a later copy reaches the holder, which absorbs it
118
+ and answers it with the stored acknowledgement. An open routed deposit
119
+ falls 72 hours plus the 30-day duplicate window after its acceptance, so
120
+ the send state stays bounded. A `submit()` without a
121
+ digest opens nothing: an app that sends only through `submit()` never
122
+ switches by the deadline. The consumer a wire registers with `onDeliver`
123
+ answers whether the adapter took the frame.
98
124
 
99
125
  **The timer.** Every act, receive and resume may name `nextDueAt`: the
100
126
  earliest time something is due, delivery work (retries, duties, acks)
@@ -120,6 +146,44 @@ human: `receive`, `report`, `resume`, `tick`, `recover`, `takeMessages`.
120
146
  Reads: `contacts`, `contact`, `groups`, `profile`, `prompts`, `inbox`,
121
147
  `deliveryStatus`, `deviceKey`, `replay`, `snapshot`, `subscribe`.
122
148
 
149
+ **Delivery hints** (Encounter RLTP-ENC-6080, 6090; Identity §7a.3; VTI
150
+ Mediator Adapter Profile 0.25 §1b). `show` and `scan` take a carrier
151
+ offer, `carrier: {nonce, deliveryHints}`: the relationship's carrier
152
+ nonce N (32 bytes the app draws fresh) and the hints the app built from
153
+ the wire identities its adapter derives from N. The card (the displayed
154
+ card, or the scanner's sent card) carries the hints under its proof, and
155
+ N enters the register under the relationship the card opens — at `show`
156
+ already, as the card's pair label does. More than eight hints or a hint
157
+ over 512 characters is `card-invalid` with `ref` `RLTP-ENC-6090`; an
158
+ offer without a hint, or with a hint that is no string, is
159
+ `card-invalid` without a `ref`; a nonce
160
+ that is not 32 bytes or that the register already holds is
161
+ `carrier-nonce-invalid`. The offer is act input, journaled with the act.
162
+ The library interprets no hint. Each relationship of a contact view names
163
+ the own canonical carrier-nonce entry (`carrierNonce: {nonce,
164
+ generation}`) and the counterpart's hints from the card of the enactment
165
+ that opened it (`counterpartDeliveryHints`); a re-encounter chained into
166
+ the relationship changes neither, and the chained relationship shows no
167
+ `carrierNonce`: the app closes the adapter instance of a relationship
168
+ once its id appears in another relationship's `chainedFrom`. The
169
+ library offers no rotation or replacement of N (profile RLTP-VTI-1245);
170
+ with its one writer per holder, `carrierNonce` is the N the counterpart
171
+ saw. The VTI adapter module builds and reads the hint:
172
+ `deliveryHint(rootIkm, C, N)` (derived like the adapter's trio),
173
+ `readDeliveryHint(hint, C)`, `readDeliveryHints(hints, C, self)` (profile
174
+ §1b; total readers, a hint naming `self`'s identities ignored).
175
+
176
+ ```ts
177
+ import { deliveryHint } from '@real-life/trust-protocol/adapters/vti-mediator'
178
+
179
+ // rootIkm and C: the same inputs the app gives MediatorCarrierAdapter.create
180
+ const nonce = crypto.getRandomValues(new Uint8Array(32))
181
+ const hint = await deliveryHint(rootIkm, C, nonce)
182
+ const shown = await holder.show({ when: Date.now(), actId: crypto.randomUUID(), carrier: { nonce, deliveryHints: [hint] } })
183
+ const [rel] = (await holder.contacts())[0]?.relationships ?? []
184
+ // rel?.carrierNonce: this side's N; rel?.counterpartDeliveryHints: the counterpart's hints, as signed
185
+ ```
186
+
123
187
  One actId, one result: every human act is journaled under its actId with
124
188
  its result. A repeat under the same actId answers the journaled events
125
189
  (for `sendMessage` the same `mid`) at any clock and across a lock and a
@@ -141,7 +205,7 @@ journal, and acting anew is the human's decision. Custody:
141
205
 
142
206
  ## What the root exports
143
207
 
144
- - `createHolder` and its types (`Holder`, `HolderOptions`, `HumanActOptions`,
208
+ - `createHolder` and its types (`Holder`, `HolderOptions`, `HumanActOptions`, `CarrierOffer`,
145
209
  `HolderSnapshot`).
146
210
  - The ports: `Store`, `KeyProvider`, `Entropy`, `Log`, `Access`,
147
211
  `RetryPolicy`, `DeliveryReport`, `Outbound`; `seedKeys(seed)` is the
@@ -168,7 +232,7 @@ Other entry points:
168
232
  |---|---|
169
233
  | `./testing` | `InMemoryStore`, `memoryLog`, `scriptedEntropy`, `storeContract`, `emptyState`, `stateBuilder`, `freezeDeep`, `sampleState`, `openPromptModule`, the invariant checks, `forgeMapping` (deniability, Trust 6.1), `SCHEMAS` and the generated `wire` types. For tests, vectors and adapter authors; not for production holders. |
170
234
  | `./internal` | The structural `HolderState`, `encodeState` and the codec chain, the engine's module types, the pure view functions, the modules' factories and pure reads. For the library's own modules and tests; not an app contract. |
171
- | `./adapters/vti-mediator` | The VTI mediator as a carrier adapter: its submission states as `DeliveryReport`, collection and ack handling, the selective conclusion of a collection (`conclude(c, now, {keep})`, `concludable(result)`: a `failed(rate-limited)` item stays with the carrier). |
235
+ | `./adapters/vti-mediator` | The VTI mediator as a transport adapter (profile 0.25): its submission states as `DeliveryReport`, collection and ack handling, the selective conclusion of a collection (`conclude(c, now, {keep})`, `concludable(result)`: a `failed(rate-limited)` item stays with the carrier), the sending form of §3a: every deposit names its `SendMode` (`routed`, or `egress-session` after the one-way switch of RLTP-VTI-3130), the send state (mode, open routed deposits) travels in `AckState.send` (a `submit()` without a digest opens nothing), a `WireError('routed-refused')` switches at once, a wire without `queueEmpty()` never completes a collection and so never switches, `answered(digest, now)` carries the holder's answers to a later instance, `depositAddressing(mode, self, peerConnection, carrier)` gives both layers' addressing, and `deliveryHint(rootIkm, C, N)`, `readDeliveryHint(hint, C)`, `readDeliveryHints(hints, C, self)` build and read the delivery hint of §1b (total readers). |
172
236
 
173
237
  ## The modules and the rules they implement
174
238
 
@@ -288,6 +352,7 @@ This package uses its own semver; the specification uses castings.
288
352
  | membership | Membership Tasks 0.20, Access 0.57 | the Access envelope (Membership 3.3: `access-operation/0.1` with `member.add` and the sealed welcome; this library sends its own `x-membership-welcome/0.1`); an admission prompt after the bound of RLTP-MT-3282; roster replication: a holder knows the members it admitted and the roster its welcome carried |
289
353
  | introduction | Trust 0.31 §8 | how a requester learns the mediator's designator (8.3): this library's mediator sends `x-introduction-offer/0.1` |
290
354
  | delivery | Delivery 0.83 | transport adapters beyond `./adapters/vti-mediator`; the block of the Trust Layer's types (Message Tasks 6240: their treatments wait for the next casting of the Trust Layer) |
355
+ | transport adapter | VTI Mediator Adapter Profile 0.25 | a change of the carrier nonce N (RLTP-VTI-1245; profile Open Issue 13); the TSP framing, which is the wire binding's (profile §7; `binding/` in the repository); a return from `egress-session` to `routed` (profile Open Issue 7) |
291
356
  | message | Message Tasks 0.1 | holding a message unsent until its tuple is ready (5020): `sendMessage` answers `not-ready` and the app keeps the message; checking `replyTo` against the relationship's history (5120), which is the app's; multi-device (§9); `failed(task-expired)` for a message: reachable only with a retry horizon beyond P179D, which the engine does not admit (at most P90D), so an undelivered message ends as `failed(expired-by-adapter-policy)` |
292
357
  | devices | Identity §5.5 | multi-device production: one writer per holder |
293
358
 
@@ -10,8 +10,69 @@ export declare const DECLARED: Readonly<{
10
10
  readonly queueFloorBytes: 1048576;
11
11
  readonly maxQueueBytes: 16777216;
12
12
  readonly duplicateWindowMs: number;
13
+ readonly routedAckDeadlineMs: number;
13
14
  }>;
14
- export type WireErrorKind = 'unreachable' | 'refused-retriable' | 'refused-admission' | 'oversize';
15
+ /** The counterpart's wire identities at one carrier, as its hint names them. */
16
+ export interface DeliveryHintIdentities {
17
+ connectionDid: string;
18
+ egressDid: string;
19
+ carrier: string;
20
+ }
21
+ /** This side's hint for carrier `C` in the relationship of carrier nonce
22
+ * `N` (RLTP-VTI-1210, 1215): the connection DID and the egress identity
23
+ * derived here from (root, `C`, `N`), exactly as the factory derives the
24
+ * instance's trio — derived, not supplied, so the two cannot come from
25
+ * different relationships — as the JCS form of the TSPTransport service
26
+ * entry naming the connection DID (`id`, with `#tsp`), `C`
27
+ * (`serviceEndpoint`) and the egress identity (`rltpEgress`). */
28
+ export declare function deliveryHint(rootIkm: Uint8Array, carrier: string, nonce: Uint8Array): Promise<string>;
29
+ /** One hint read strictly (RLTP-VTI-1210, 1220) for carrier `C`: JSON,
30
+ * byte-equal to its JCS form, exactly the four members, type
31
+ * TSPTransport, an `id` ending in `#tsp`, both identities distinct
32
+ * canonical Ed25519 did:key, `serviceEndpoint` byte-equal to `C`.
33
+ * Total (RLTP-VTI-1220): any other input — not a string, not JSON, no JCS
34
+ * form (a lone surrogate), any other shape — is null, ignored; it never
35
+ * throws. */
36
+ export declare function readDeliveryHint(hint: unknown, carrier: unknown): DeliveryHintIdentities | null;
37
+ /** The counterpart's wire identities at `C` from the hints of the card
38
+ * that opened the relationship, read by the side `self` (its own
39
+ * connection DID and egress identity of this relationship and carrier):
40
+ * every hint read as readDeliveryHint does; a hint naming one of `self`'s
41
+ * identities is ignored (RLTP-VTI-1227); of what remains, the one hint
42
+ * for `C` (RLTP-VTI-1225, 1240) — none, or more than one, is null: the
43
+ * relationship is not carried at `C` (RLTP-VTI-1235). Total: any input
44
+ * answers null or the identities, never a throw; without a well-formed
45
+ * `self` nothing is read. */
46
+ export declare function readDeliveryHints(hints: unknown, carrier: unknown, self: unknown): DeliveryHintIdentities | null;
47
+ /** How a deposit reaches the mediator (RLTP-VTI-3110, 3120). */
48
+ export type SendMode = 'routed' | 'egress-session';
49
+ /** One TSP layer's addressing (no keys, no bytes: those are the wire's). */
50
+ export interface LayerAddressing {
51
+ messageType: 'direct' | 'routed';
52
+ sender: string;
53
+ receiver: string;
54
+ route?: string[];
55
+ }
56
+ /** The addressing of a deposit in `mode` (RLTP-VTI-1110, 1120, 3110,
57
+ * 3115, 3120): the inner `direct` message from this side's egress
58
+ * identity to the counterpart's connection DID; in mode `routed` an
59
+ * outer routed message from this side's connection DID to the carrier
60
+ * `C` with the route [counterpart's connection DID], deposited on the
61
+ * connection DID's session; in mode `egress-session` no outer layer,
62
+ * deposited on the egress identity's send-only session. */
63
+ export declare function depositAddressing(mode: SendMode, self: {
64
+ connection: string;
65
+ egress: string;
66
+ }, peerConnection: string, carrier: string): {
67
+ inner: LayerAddressing;
68
+ outer: LayerAddressing | null;
69
+ session: string;
70
+ };
71
+ export type WireErrorKind = 'unreachable' | 'refused-retriable' | 'refused-admission' | 'oversize'
72
+ /** the mediator refused a routed deposit for its routed form, and the
73
+ * binding authenticated that refusal as the mediator's (RLTP-VTI-3130):
74
+ * the relationship switches to egress-session at once */
75
+ | 'routed-refused';
15
76
  export declare class WireError extends Error {
16
77
  kind: WireErrorKind;
17
78
  constructor(kind: WireErrorKind, message?: string);
@@ -28,11 +89,23 @@ export interface MediatorWire {
28
89
  }): Promise<TokenSet>;
29
90
  refresh(refreshToken: string): Promise<TokenSet>;
30
91
  keylistUpdate(accessToken: string, rkids: string[]): Promise<void>;
31
- deposit(accessToken: string, bytes: Uint8Array, egressDid: string): Promise<void>;
92
+ /** `mode` is the sending form of this deposit (profile §3a): the wire
93
+ * packs and sends it as depositAddressing(mode, …) describes. */
94
+ deposit(accessToken: string, bytes: Uint8Array, egressDid: string, mode: SendMode): Promise<void>;
32
95
  ackReceived(accessToken: string, queueIds: string[]): Promise<void>;
33
- onDeliver(cb: (bytes: Uint8Array) => Promise<void>): void;
96
+ /** The adapter's consumer answers whether it took the frame (buffered,
97
+ * already held, or absorbed as a duplicate): false means the frame is
98
+ * left with the mediator (above max-queue-bytes, or a retired
99
+ * instance), and a wire must not take its queue for drained until the
100
+ * frame is offered again (RLTP-VTI-3130, queueEmpty). */
101
+ onDeliver(cb: (bytes: Uint8Array) => Promise<boolean>): void;
34
102
  /** Optional truthful connectivity signal; absent means unknown. */
35
103
  offline?(): boolean;
104
+ /** Optional: true when the mediator holds nothing more for this
105
+ * connection (RLTP-VTI-3130: a conclusion that left no frame
106
+ * pending). Closed: absent, no collection counts as complete, so an
107
+ * adapter over a wire without it never switches to egress-session. */
108
+ queueEmpty?(): boolean;
36
109
  }
37
110
  export interface TokenSet {
38
111
  accessToken: string;
@@ -82,6 +155,20 @@ export interface AckState {
82
155
  concludedAt: number;
83
156
  }>;
84
157
  pending: string[];
158
+ /** the relationship's send state (RLTP-VTI-3130); absent → `routed` */
159
+ send?: SendState;
160
+ }
161
+ /** The send state of a relationship (profile §3a, RLTP-VTI-3130),
162
+ * persisted with the ack state: the mode and the open routed deposits —
163
+ * this side's documents accepted in routed and not yet answered, each
164
+ * with its digest and acceptance instant. Acknowledgements are no open
165
+ * deposits. In egress-session `open` is empty. */
166
+ export interface SendState {
167
+ mode: SendMode;
168
+ open: Array<{
169
+ digest: string;
170
+ acceptedAt: number;
171
+ }>;
85
172
  }
86
173
  /** The holder's side of a hand-over (lib 0.6.0): the holder itself.
87
174
  * handOver checks the entry and calls `start` inside the holder's queue;
@@ -125,6 +212,15 @@ export declare class MediatorCarrierAdapter {
125
212
  * submission filed without a digest (submit) has no report form. */
126
213
  report(id: string): DeliveryReport | null;
127
214
  has(id: string): boolean;
215
+ /** The current sending mode of the relationship (profile §3a). */
216
+ get sendMode(): SendMode;
217
+ /** An answer the holder hands this instance for a document an earlier
218
+ * instance deposited (RLTP-VTI-3130): a valid acknowledgement, a
219
+ * validated receiver refusal or a validated `idConflict` answer for
220
+ * `digest`. If the send state names the document as an open routed
221
+ * deposit, it is answered and leaves; otherwise it answers nothing. A
222
+ * no-op on a retired instance, like acknowledged. */
223
+ answered(digest: string, rawNow: number): void;
128
224
  /** Host teardown aid, NOT a port operation (profile §6): awaits
129
225
  * the in-flight background tasks so a host can drain before
130
226
  * persisting ackState. On a hanging wire it waits as long as the
@@ -144,13 +240,20 @@ export declare class MediatorCarrierAdapter {
144
240
  * (d) otherwise → no report yet (null)
145
241
  * Terminal states and `accepted` are stored and stand. */
146
242
  status(id: string): SubmissionState | null;
243
+ /** A valid acknowledgement for submission `id`. Reports that a
244
+ * collection carries are applied before that collection's conclude,
245
+ * at the latest before the next advance: the switch check of
246
+ * RLTP-VTI-3130 counts on them, and a report applied late can let the
247
+ * relationship switch although its deposits were answered. */
147
248
  acknowledged(id: string): void;
148
249
  /** Refusals act on live submissions only (§6.1 knows exactly one
149
250
  * late correction — the valid ack). The code set is closed and
150
251
  * TERMINAL: retryable counterpart conditions (unavailable,
151
252
  * internalError) are transport outcomes, never receiver verdicts
152
253
  * — they have no entry here, and an unknown code is refused
153
- * fail-closed rather than minted into a verdict (R6-B2). */
254
+ * fail-closed rather than minted into a verdict (R6-B2). Applied, like
255
+ * acknowledged, before the conclude of the collection that carried
256
+ * it (RLTP-VTI-3130). */
154
257
  receiverRefused(id: string, code: ReceiverRefusalCode): void;
155
258
  drainTransitions(): Array<{
156
259
  id: string;
@@ -162,7 +265,11 @@ export declare class MediatorCarrierAdapter {
162
265
  * is transient (Delivery RLTP-DEL-5810, 5820: `failed(rate-limited)`,
163
266
  * or a transaction that could not commit, see `concludable`): they are
164
267
  * not concluded and not acknowledged, they go back to the buffer and the
165
- * next collect offers them again, and the mediator keeps its copy. */
268
+ * next collect offers them again, and the mediator keeps its copy.
269
+ * The reports the collection carries (acknowledged, receiverRefused,
270
+ * answered) are applied BEFORE this call, at the latest before the next
271
+ * advance: a conclusion that leaves nothing pending opens the switch
272
+ * check of RLTP-VTI-3130, which counts them as applied. */
166
273
  conclude(collection: {
167
274
  id: string;
168
275
  }, rawNow: number, opts?: {
@@ -1 +1 @@
1
- {"version":3,"file":"vti-mediator.d.ts","sourceRoot":"","sources":["../../src/adapters/vti-mediator.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAItD,eAAO,MAAM,QAAQ;;;;;;;EAOV,CAAA;AAGX,MAAM,MAAM,aAAa,GACrB,aAAa,GAAG,mBAAmB,GAAG,mBAAmB,GAAG,UAAU,CAAA;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