@spine-event-engine/delivery-client 2.0.0-snapshot.2 → 2.0.0-snapshot.20

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 CHANGED
@@ -8,6 +8,13 @@ remote Delivery server.
8
8
  The [reference](REFERENCE.md) records the complete protocol, retry, and limit
9
9
  contract, including API detail for coding agents.
10
10
 
11
+ This is an experimental snapshot package. Use Node 24 or newer and a reachable
12
+ Delivery server on a trusted network.
13
+
14
+ ```sh
15
+ pnpm add @spine-event-engine/delivery-client@snapshot
16
+ ```
17
+
11
18
  ## 💡 Why use it?
12
19
 
13
20
  - ✅ Connects a Node process to a local or remote Delivery server.
@@ -20,8 +27,9 @@ contract, including API detail for coding agents.
20
27
  Connect to an absolute HTTP(S) origin whose path is `/`. The client manages this
21
28
  connection and `close()` ends its active reads and streams.
22
29
 
30
+ <!-- docs-snippet-path: packages/delivery-client/src/client/client.ts -->
31
+
23
32
  ```ts
24
- // docs-snippet-path: packages/delivery-client/src/client/client.ts
25
33
  import { DeliveryClient } from "@spine-event-engine/delivery-client";
26
34
 
27
35
  const client = DeliveryClient.connectTo("http://127.0.0.1:8484", { pageSize: 100 });
@@ -34,8 +42,9 @@ Read operations can use the configured bounded retry policy. Mutations never
34
42
  retry automatically: a lost mutation response means the remote outcome is
35
43
  unknown and must be reconciled before any later action.
36
44
 
45
+ <!-- docs-snippet-path: packages/delivery-client/src/client/client.ts -->
46
+
37
47
  ```ts
38
- // docs-snippet-path: packages/delivery-client/src/client/client.ts
39
48
  import { DeliveryOutcomeUnknownError } from "@spine-event-engine/delivery-client";
40
49
 
41
50
  try {
@@ -52,8 +61,9 @@ try {
52
61
  Use a snapshot to establish current facts and an observation stream for later
53
62
  hints. Cancel the stream when it is no longer needed.
54
63
 
64
+ <!-- docs-snippet-path: packages/delivery-client/src/client/client.ts -->
65
+
55
66
  ```ts
56
- // docs-snippet-path: packages/delivery-client/src/client/client.ts
57
67
  import { DeliveryClient } from "@spine-event-engine/delivery-client";
58
68
 
59
69
  declare const client: DeliveryClient;
@@ -73,9 +83,15 @@ the current shard lease; the client keeps no local removal record. A delivered
73
83
  row is the deduplication fact, but a handler effect and its acknowledgement are
74
84
  not one transaction. If an acknowledgement is lost, delivery can happen again
75
85
  after restart, so make downstream effects idempotent.
86
+ Remote delivery reads bounded raw pages. The shared server delivery policy
87
+ removes a pending duplicate when its signal ID and typed Inbox target match a
88
+ delivered row in that page or a recent delivery in the bounded process-local
89
+ cache. A different target or a newly generated signal ID remains independently
90
+ deliverable, even when its payload is equal.
91
+
92
+ <!-- docs-snippet-path: packages/delivery-client/src/remote/adapters.ts -->
76
93
 
77
94
  ```ts
78
- // docs-snippet-path: packages/delivery-client/src/remote/adapters.ts
79
95
  import {
80
96
  DeliveryClient,
81
97
  RemoteInbox,
@@ -110,8 +126,9 @@ including rows that arrive while a drain is active, before it releases the
110
126
  shard. A pre-commit ownership probe fences known stale owners, but it is not a
111
127
  linearizable distributed transaction with Entity storage.
112
128
 
129
+ <!-- docs-snippet-path: packages/delivery-client/src/remote/remote-delivery.ts -->
130
+
113
131
  ```ts
114
- // docs-snippet-path: packages/delivery-client/src/remote/remote-delivery.ts
115
132
  import { RemoteDelivery } from "@spine-event-engine/delivery-client";
116
133
 
117
134
  const delivery = RemoteDelivery.connectTo({ endpoint: "https://delivery.example.test" });
@@ -128,6 +145,6 @@ attempt history or quarantine records.
128
145
 
129
146
  ## 🔗 Learn more
130
147
 
131
- - [Delivery server](../delivery-server/README.md)
132
- - [Server delivery APIs](../server/README.md#delivery-and-environment)
148
+ - [Delivery server](https://github.com/SpineEventEngine/spine-ts/blob/master/packages/delivery-server/README.md)
149
+ - [Server delivery APIs](https://github.com/SpineEventEngine/spine-ts/blob/master/packages/server/README.md#native-lifecycle-and-routing)
133
150
  - [Detailed delivery reference](REFERENCE.md)
package/REFERENCE.md CHANGED
@@ -52,14 +52,28 @@ local session and permits a new pickup. Do not release a stale session.
52
52
 
53
53
  `RemoteInbox` and `RemoteWorkRegistry` satisfy the server delivery-builder
54
54
  ports. `RemoteInbox` rereads the exact pending remote row before acknowledgement
55
- and calls the authoritative removal operation directly. It creates no local
56
- attempt history, receipt, fingerprint, or quarantine record. Shard ownership excludes concurrent
57
- delivery and delivered rows are the deduplication fact. Handler effects and the
58
- delivered transition are not transactional: a lost acknowledgement can
59
- redeliver after restart, so downstream handling must be idempotent. This
55
+ and upserts that exact row as `DELIVERED`. An exact retained `DELIVERED` row is
56
+ an idempotent acknowledgement after a lost response. Expired-row cleanup first
57
+ checks the remote snapshot and then sends a separate removal request; it is
58
+ best effort, not an atomic compare-and-delete guarantee. It creates no local attempt history,
59
+ receipt, fingerprint, or quarantine record. Shard ownership excludes concurrent
60
+ delivery and delivered rows are the deduplication fact. This
60
61
  package does not add authentication, authorization, durability, exactly-once
61
62
  effects, or a production topology.
62
63
 
64
+ Each delivery read requests one bounded logical shard page. Because the remote
65
+ cursor includes its anchor row, filling that logical page may require multiple
66
+ bounded raw-page RPCs. The server delivery policy compares pending rows with
67
+ delivered rows in the logical page and its bounded recent-delivery cache, then
68
+ removes exact duplicates without treating them as delivered acknowledgements.
69
+ Remote duplicate removal compares the current snapshot before sending the
70
+ existing best-effort removal request.
71
+
72
+ Local retention filtering uses the client's clock for both retained-row
73
+ duplicate recognition and cleanup eligibility. It skips cleanup requests for
74
+ rows whose retention deadline is still in the future. This does not synchronize
75
+ client and server clocks or change the remote server's mutation checks.
76
+
63
77
  ## Remote delivery in an environment
64
78
 
65
79
  `RemoteDelivery.connectTo({ endpoint, clientOptions? })` creates one lazy
@@ -87,3 +101,7 @@ Environment shutdown closes the client's HTTP/2 session. Concurrent/repeated
87
101
  close calls share work; a failed phase is the only phase retried. This adds no
88
102
  health route, provider selector, worker, or
89
103
  delivery-server mode.
104
+
105
+ Retained rows suppress the same signal ID at the same typed Inbox target until
106
+ `keep_until`. Remote pagination follows the JVM timestamp-only cursor and rejects a
107
+ non-progressing full page; it does not provide arbitrary-depth indexed lookup.
@@ -7,6 +7,7 @@ import { type RemoteShardObservation } from "../client/types.js";
7
7
  * Adapts a delivery-server client to the server-owned inbox port.
8
8
  */
9
9
  export declare class RemoteInbox implements DeliveryInbox {
10
+ #private;
10
11
  private readonly client;
11
12
  /**
12
13
  * Remote inbox work requires an exclusive remote shard session.
@@ -43,14 +44,40 @@ export declare class RemoteInbox implements DeliveryInbox {
43
44
  */
44
45
  readMessage(id: InboxMessageId, options?: DeliveryOperationOptions): Promise<InboxMessage | undefined>;
45
46
  /**
46
- * Removes one exact authoritative pending row and returns its delivered fact.
47
+ * Persists one exact authoritative pending row as a delivered fact.
47
48
  *
48
49
  * @param message Supplies the expected pending message snapshot.
49
- * @param options Bounds or cancels remote reads and removal.
50
- * @returns The delivered acknowledgement, or `undefined` when the pending
50
+ * @param options Bounds or cancels the remote read and delivered upsert.
51
+ * @returns The delivered acknowledgement, including an exact retained
52
+ * acknowledgement after a committed response loss, or `undefined` when the
51
53
  * row is absent or no longer matches.
52
54
  */
53
55
  markDelivered(message: InboxMessage, options?: DeliveryOperationOptions): Promise<InboxMessage | undefined>;
56
+ /**
57
+ * Removes an expired delivered row while its exclusive shard session remains current.
58
+ *
59
+ * The remote API exposes a read followed by a removal call, not an atomic
60
+ * compare-and-delete operation. Another writer may therefore change the row
61
+ * between the equality check and removal.
62
+ *
63
+ * @param message Supplies the delivered snapshot.
64
+ * @param session Supplies the matching exclusive shard session.
65
+ * @param options Bounds remote reads and removal.
66
+ * @returns Whether the snapshot matched when read and the removal request completed.
67
+ */
68
+ removeDelivered(message: InboxMessage, session: DeliveryWorkSession, options?: DeliveryOperationOptions): Promise<boolean>;
69
+ /**
70
+ * Removes one exact pending duplicate while its exclusive shard session remains current.
71
+ *
72
+ * Remote removal reads and compares before a separate removal request, so it
73
+ * cannot provide the direct provider's atomic compare-and-delete guarantee.
74
+ *
75
+ * @param message Supplies the pending duplicate snapshot.
76
+ * @param session Supplies the matching exclusive shard session.
77
+ * @param options Bounds remote reads and removal.
78
+ * @returns Whether the snapshot matched when read and the removal request completed.
79
+ */
80
+ removeDuplicate(message: InboxMessage, session: DeliveryWorkSession, options?: DeliveryOperationOptions): Promise<boolean>;
54
81
  }
55
82
  /**
56
83
  * Adapts one per-registry remote session owner to the server work-registry port.
@@ -1 +1 @@
1
- {"version":3,"file":"adapters.d.ts","sourceRoot":"","sources":["../../src/remote/adapters.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACnB,4BAA4B,EAC5B,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAGnE,OAAO,EAAE,cAAc,EAAwB,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAIL,KAAK,sBAAsB,EAE5B,MAAM,oBAAoB,CAAC;AAG5B;;GAEG;AACH,qBAAa,WAAY,YAAW,aAAa;IAanC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAVnC;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAG,WAAW,CAAU;IAE5C;;;;OAIG;gBAC0B,MAAM,EAAE,cAAc;IAInD;;;;;;OAMG;IACG,OAAO,CACX,KAAK,EAAE,iBAAiB,EACxB,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,gBAAgB,CAAC;IAM5B;;;;;;OAMG;IACG,IAAI,CACR,UAAU,EAAE,UAAU,EACtB,OAAO,GAAE,gBAAgB,GAAG,wBAA6B,GACxD,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC;IAwCnC;;;;;;OAMG;IACH,WAAW,CACT,EAAE,EAAE,cAAc,EAClB,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAI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M,EAAE,QAAQ,EAChB,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,4BAA4B,GAAG,SAAS,CAAC;IAIpD;;;;;;OAMG;IACH,OAAO,CAAC,OAAO,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3F;;;;;;OAMG;IACH,iBAAiB,CACf,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,wBAAwB,GACjC,OAAO,CAAC,4BAA4B,GAAG,SAAS,CAAC;IAIpD;;;;OAIG;IACH,SAAS,CAAC,WAAW,EAAE,sBAAsB,GAAG,IAAI;CAGrD"}
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import { randomUUID } from "node:crypto";
15
15
  import { ShardIndex } from "@spine-event-engine/server";
16
- import { conditionalPickUp } from "@spine-event-engine/server/internal/conditional-pickup";
16
+ import { conditionalPickUp } from "@spine-event-engine/server/spi/delivery";
17
17
  import { DeliveryClient, deliveryClientAccess } from "../client/client.js";
18
18
  import { DeliveryPagingError, DeliveryProtocolError, } from "../client/types.js";
19
19
  import { DeliveryMessageCodec, DeliveryRequestCodec, DeliveryShardCodec } from "../wire/codec.js";
@@ -61,38 +61,48 @@ export class RemoteInbox {
61
61
  const limit = options.limit === undefined
62
62
  ? this.client.pageSize
63
63
  : DeliveryRequestCodec.pageSize(options.limit);
64
+ return this.#readCollected(shardIndex, options, limit);
65
+ }
66
+ async #readPage(shardIndex, after, limit, options) {
67
+ const pageSize = after === undefined ? limit : Math.min(1_000, limit + 1);
68
+ const page = await this.client.readPage(shardIndex, {
69
+ pageSize,
70
+ ...(options.signal === undefined ? {} : { signal: options.signal }),
71
+ ...(options.timeoutMs === undefined ? {} : { timeoutMs: options.timeoutMs }),
72
+ ...(after === undefined ? {} : { sinceWhen: RemoteValues.pageAnchor(after.whenReceived) }),
73
+ });
74
+ const start = after === undefined ? 0 : RemoteValues.exactAfter(page, after);
75
+ const last = page.at(-1);
76
+ const prior = page.at(-2);
77
+ if (page.length === pageSize &&
78
+ (last === undefined || prior?.whenReceived.getTime() === last.whenReceived.getTime()))
79
+ throw new DeliveryPagingError();
80
+ return {
81
+ messages: page.slice(start),
82
+ complete: page.length < pageSize,
83
+ last,
84
+ };
85
+ }
86
+ async #readCollected(shardIndex, options, limit) {
64
87
  let after = options.after;
65
- let scanned = 0;
66
88
  const result = [];
67
89
  while (result.length < limit) {
68
- const page = await this.client.readPage(shardIndex, {
69
- pageSize: limit,
70
- ...(options.signal === undefined ? {} : { signal: options.signal }),
71
- ...(options.timeoutMs === undefined ? {} : { timeoutMs: options.timeoutMs }),
72
- ...(after === undefined ? {} : { sinceWhen: RemoteValues.pageAnchor(after.whenReceived) }),
73
- });
74
- const start = after === undefined ? 0 : RemoteValues.exactAfter(page, after);
75
- const raw = page.slice(start);
76
- scanned += raw.length;
77
- if (scanned > 1_000 + limit)
78
- throw new DeliveryPagingError();
79
- const last = page.at(-1);
80
- const prior = page.at(-2);
81
- if (page.length === limit &&
82
- (last === undefined || prior?.whenReceived.getTime() === last.whenReceived.getTime()))
83
- throw new DeliveryPagingError();
84
- for (const message of raw) {
85
- if (options.statuses === undefined || options.statuses.includes(message.status)) {
90
+ const page = await this.#readPage(shardIndex, after, limit, options);
91
+ for (const message of page.messages) {
92
+ if (options.statuses === undefined || options.statuses.includes(message.status))
86
93
  result.push(message);
87
- if (result.length === limit)
88
- return Object.freeze(result);
89
- }
94
+ if (result.length === limit)
95
+ return Object.freeze(result);
90
96
  }
91
- if (page.length < limit)
97
+ if (page.complete)
92
98
  return Object.freeze(result);
93
- if (last === undefined)
99
+ if (page.last === undefined)
94
100
  throw new DeliveryPagingError();
95
- after = { messageId: last.id.value, whenReceived: last.whenReceived, version: last.version };
101
+ after = {
102
+ messageId: page.last.id.value,
103
+ whenReceived: page.last.whenReceived,
104
+ version: page.last.version,
105
+ };
96
106
  }
97
107
  return Object.freeze(result);
98
108
  }
@@ -107,19 +117,70 @@ export class RemoteInbox {
107
117
  return this.client.findOne(id, options);
108
118
  }
109
119
  /**
110
- * Removes one exact authoritative pending row and returns its delivered fact.
120
+ * Persists one exact authoritative pending row as a delivered fact.
111
121
  *
112
122
  * @param message Supplies the expected pending message snapshot.
113
- * @param options Bounds or cancels remote reads and removal.
114
- * @returns The delivered acknowledgement, or `undefined` when the pending
123
+ * @param options Bounds or cancels the remote read and delivered upsert.
124
+ * @returns The delivered acknowledgement, including an exact retained
125
+ * acknowledgement after a committed response loss, or `undefined` when the
115
126
  * row is absent or no longer matches.
116
127
  */
117
128
  async markDelivered(message, options) {
118
129
  const current = await this.client.findOne(message.id, options);
130
+ const expected = DeliveryMessageCodec.snapshot({ ...message, status: "DELIVERED" });
131
+ if (current?.status === "DELIVERED" && RemoteValues.sameMessage(current, expected))
132
+ return current;
119
133
  if (current?.status !== "TO_DELIVER" || !RemoteValues.sameMessage(current, message))
120
134
  return undefined;
135
+ const delivered = DeliveryMessageCodec.snapshot({ ...current, status: "DELIVERED" });
136
+ await this.client.writeOne(delivered, options);
137
+ return delivered;
138
+ }
139
+ /**
140
+ * Removes an expired delivered row while its exclusive shard session remains current.
141
+ *
142
+ * The remote API exposes a read followed by a removal call, not an atomic
143
+ * compare-and-delete operation. Another writer may therefore change the row
144
+ * between the equality check and removal.
145
+ *
146
+ * @param message Supplies the delivered snapshot.
147
+ * @param session Supplies the matching exclusive shard session.
148
+ * @param options Bounds remote reads and removal.
149
+ * @returns Whether the snapshot matched when read and the removal request completed.
150
+ */
151
+ async removeDelivered(message, session, options) {
152
+ if (session.kind !== this.sessionKind || session.shard.key() !== message.shard.key())
153
+ return false;
154
+ if (message.status !== "DELIVERED" ||
155
+ (message.keepUntil !== undefined && message.keepUntil.getTime() > Date.now()))
156
+ return false;
157
+ const current = await this.client.findOne(message.id, options);
158
+ if (current === undefined || !RemoteValues.sameMessage(current, message))
159
+ return false;
121
160
  await this.client.removeOne(current, options);
122
- return DeliveryMessageCodec.snapshot({ ...current, status: "DELIVERED" });
161
+ return true;
162
+ }
163
+ /**
164
+ * Removes one exact pending duplicate while its exclusive shard session remains current.
165
+ *
166
+ * Remote removal reads and compares before a separate removal request, so it
167
+ * cannot provide the direct provider's atomic compare-and-delete guarantee.
168
+ *
169
+ * @param message Supplies the pending duplicate snapshot.
170
+ * @param session Supplies the matching exclusive shard session.
171
+ * @param options Bounds remote reads and removal.
172
+ * @returns Whether the snapshot matched when read and the removal request completed.
173
+ */
174
+ async removeDuplicate(message, session, options) {
175
+ if (session.kind !== this.sessionKind || session.shard.key() !== message.shard.key())
176
+ return false;
177
+ if (message.status !== "TO_DELIVER")
178
+ return false;
179
+ const current = await this.client.findOne(message.id, options);
180
+ if (current === undefined || !RemoteValues.sameMessage(current, message))
181
+ return false;
182
+ await this.client.removeOne(current, options);
183
+ return true;
123
184
  }
124
185
  }
125
186
  /**
@@ -218,6 +279,12 @@ class RemoteSessionOwner {
218
279
  this.#invalidate(session);
219
280
  return undefined;
220
281
  }
282
+ /**
283
+ * Calls the client to release a probe session acquired accidentally.
284
+ *
285
+ * @param session Supplies the session to release.
286
+ * @returns Completion after the bounded release attempt.
287
+ */
221
288
  async #cleanupAccidentalPickup(session) {
222
289
  try {
223
290
  await this.client.release(session, { timeoutMs: 1_000 });
@@ -226,6 +293,11 @@ class RemoteSessionOwner {
226
293
  // Validation remains failed closed when bounded cleanup is uncertain.
227
294
  }
228
295
  }
296
+ /**
297
+ * Removes a session from local validation state.
298
+ *
299
+ * @param session Supplies the session to invalidate.
300
+ */
229
301
  #invalidate(session) {
230
302
  this.#sessions.delete(session);
231
303
  this.#removeSession(RemoteValues.shardKey(session.shard), session);
@@ -257,6 +329,12 @@ class RemoteSessionOwner {
257
329
  this.#sessionsByShard.delete(key);
258
330
  }
259
331
  }
332
+ /**
333
+ * Removes one session from the shard's local session set.
334
+ *
335
+ * @param key Identifies the shard session set.
336
+ * @param session Supplies the session to remove.
337
+ */
260
338
  #removeSession(key, session) {
261
339
  const sessions = this.#sessionsByShard.get(key);
262
340
  if (sessions === undefined)
@@ -330,6 +408,12 @@ export class RemoteWorkRegistry {
330
408
  * Groups immutable remote-adapter value operations.
331
409
  */
332
410
  const RemoteValues = Object.freeze({
411
+ /**
412
+ * Creates a detached message with a generated inbox identity.
413
+ *
414
+ * @param input Supplies the inbox message fields.
415
+ * @returns The encoded inbox message with a generated ID.
416
+ */
333
417
  receiveMessage(input) {
334
418
  const message = DeliveryMessageCodec.snapshot({
335
419
  ...input,
@@ -342,24 +426,64 @@ const RemoteValues = Object.freeze({
342
426
  DeliveryMessageCodec.encode(message);
343
427
  return message;
344
428
  },
429
+ /**
430
+ * Returns a frozen object with its original type.
431
+ *
432
+ * @typeParam T Object type.
433
+ * @param value Supplies the object to freeze.
434
+ * @returns The frozen object.
435
+ */
345
436
  freeze(value) {
346
437
  return Object.freeze(value);
347
438
  },
439
+ /**
440
+ * Creates the local key for a shard.
441
+ *
442
+ * @param value Supplies the shard index.
443
+ * @returns The shard index and count as a key.
444
+ */
348
445
  shardKey(value) {
349
446
  return `${String(value.index)}/${String(value.ofTotal)}`;
350
447
  },
448
+ /**
449
+ * Returns the millisecond before a page anchor for exclusive paging.
450
+ *
451
+ * @param value Supplies the received-time continuation.
452
+ * @returns The preceding millisecond as a new Date.
453
+ */
351
454
  pageAnchor(value) {
352
455
  const milliseconds = value.getTime();
353
456
  if (milliseconds <= -62_135_596_800_000)
354
457
  throw new DeliveryPagingError();
355
458
  return new Date(milliseconds - 1);
356
459
  },
460
+ /**
461
+ * Compares shard indexes by index and shard count.
462
+ *
463
+ * @param left Supplies the first shard.
464
+ * @param right Supplies the second shard.
465
+ * @returns Whether both values identify the same shard.
466
+ */
357
467
  sameShard(left, right) {
358
468
  return left.index === right.index && left.ofTotal === right.ofTotal;
359
469
  },
470
+ /**
471
+ * Compares worker IDs by node and worker values.
472
+ *
473
+ * @param left Supplies the first worker ID.
474
+ * @param right Supplies the second worker ID.
475
+ * @returns Whether both values identify the same worker.
476
+ */
360
477
  sameWorker(left, right) {
361
478
  return left.nodeId === right.nodeId && left.value === right.value;
362
479
  },
480
+ /**
481
+ * Finds the exact continuation in one remote page.
482
+ *
483
+ * @param page Supplies the ordered remote page.
484
+ * @param after Supplies the requested continuation position.
485
+ * @returns The index after the matching message.
486
+ */
363
487
  exactAfter(page, after) {
364
488
  const exact = page.findIndex((message) => message.id.value === after.messageId &&
365
489
  message.whenReceived.getTime() === after.whenReceived.getTime() &&
@@ -368,6 +492,13 @@ const RemoteValues = Object.freeze({
368
492
  throw new DeliveryPagingError();
369
493
  return exact + 1;
370
494
  },
495
+ /**
496
+ * Compares all stored fields of two inbox messages.
497
+ *
498
+ * @param left Supplies the first message.
499
+ * @param right Supplies the second message.
500
+ * @returns Whether all compared fields match.
501
+ */
371
502
  sameMessage(left, right) {
372
503
  return (left.id.value === right.id.value &&
373
504
  RemoteValues.sameShard(left.id.shard, right.id.shard) &&
@@ -382,9 +513,23 @@ const RemoteValues = Object.freeze({
382
513
  left.whenReceived.getTime() === right.whenReceived.getTime() &&
383
514
  RemoteValues.sameDate(left.keepUntil, right.keepUntil));
384
515
  },
516
+ /**
517
+ * Compares optional dates by their millisecond values.
518
+ *
519
+ * @param left Supplies the first date.
520
+ * @param right Supplies the second date.
521
+ * @returns Whether both dates are absent or represent the same time.
522
+ */
385
523
  sameDate(left, right) {
386
524
  return left === undefined ? right === undefined : left.getTime() === right?.getTime();
387
525
  },
526
+ /**
527
+ * Compares optional Protobuf Any values by type URL and bytes.
528
+ *
529
+ * @param left Supplies the first Any value.
530
+ * @param right Supplies the second Any value.
531
+ * @returns Whether both values have the same type URL and bytes.
532
+ */
388
533
  sameAny(left, right) {
389
534
  return left === undefined || right === undefined
390
535
  ? left === right
@@ -392,6 +537,12 @@ const RemoteValues = Object.freeze({
392
537
  left.value.length === right.value.length &&
393
538
  left.value.every((value, index) => value === right.value[index]);
394
539
  },
540
+ /**
541
+ * Validates and copies a worker ID for the remote protocol.
542
+ *
543
+ * @param worker Supplies the worker ID.
544
+ * @returns The detached remote worker ID.
545
+ */
395
546
  worker(worker) {
396
547
  const nodeId = worker.nodeId?.value;
397
548
  if (typeof nodeId !== "string" ||
@@ -1 +1 @@
1
- {"version":3,"file":"adapters.js","sourceRoot":"","sources":["../../src/remote/adapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAczC,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GAItB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAElG;;GAEG;AACH,MAAM,OAAO,WAAW;IAaO;IAZ7B,kBAAkB;IAElB;;OAEG;IACM,WAAW,GAAG,WAAoB,CAAC;IAE5C;;;;OAIG;IACH,YAA6B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;QACjD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,OAAO,CACX,KAAwB,EACxB,OAAkC;QAElC,MAAM,OAAO,GAAG,YAAY,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QACnD,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7C,OAAO,YAAY,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAkB,EAAE,OAAO,EAAE,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CACR,UAAsB,EACtB,UAAuD,EAAE;QAEzD,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,IA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