@avatarsd-llc/libtracer-client 0.14.0 → 0.15.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/dist/index.d.ts CHANGED
@@ -16,7 +16,7 @@
16
16
  export declare const CLIENT_EXPERIMENTAL: true;
17
17
  export { LibtracerClient, FwdError, CompactFlowError } from './client.js';
18
18
  export type { ClientTransport, ValueHandler, Unsubscribe, ClientOptions, } from './client.js';
19
- export { encodeValue, encodePath, encodeSubscriber, encodeConnSpec, firstChild, pathSegments, PACKED_ESCAPE_LEN, DELIVERY_DURABILITY_REQUEST, } from './tlv.js';
19
+ export { encodeValue, encodePath, encodeSubscriber, encodeConnSpec, firstChild, pathSegments, PACKED_ESCAPE_LEN, DELIVERY_DURABILITY_REQUEST, DELIVERY_CLASS, deliveryClassBits, deliveryClassOf, } from './tlv.js';
20
20
  export type { ValueOptions, SubscriberOptions, ConnSpecOptions, ConnRole } from './tlv.js';
21
21
  export { walkTopology, routeKey, CONN_ENDPOINT_NAME } from './topology.js';
22
22
  export type { TopologyGraph, TopologyNode, TopologyEdge, TopologyBusPeers, TopologyGap, WalkOptions, } from './topology.js';
package/dist/index.js CHANGED
@@ -17,6 +17,6 @@
17
17
  */
18
18
  export const CLIENT_EXPERIMENTAL = true;
19
19
  export { LibtracerClient, FwdError, CompactFlowError } from './client.js';
20
- export { encodeValue, encodePath, encodeSubscriber, encodeConnSpec, firstChild, pathSegments, PACKED_ESCAPE_LEN, DELIVERY_DURABILITY_REQUEST, } from './tlv.js';
20
+ export { encodeValue, encodePath, encodeSubscriber, encodeConnSpec, firstChild, pathSegments, PACKED_ESCAPE_LEN, DELIVERY_DURABILITY_REQUEST, DELIVERY_CLASS, deliveryClassBits, deliveryClassOf, } from './tlv.js';
21
21
  export { walkTopology, routeKey, CONN_ENDPOINT_NAME } from './topology.js';
22
22
  export { FWD_OP, FWD_OPCODE_MASK, FWD_OP_FLAG_MINT_REQUEST, FWD_KIND, FWD_ERROR, FWD_ERROR_PATH, fwdErrorName, fwdErrorPath, fwdErrorCodeForPath, encodeFwd, encodeField, parseField, decodeFwd, parseFwdTlv, replyErrorCode, replyErrorPath, } from './fwd.js';
package/dist/tlv.d.ts CHANGED
@@ -166,7 +166,8 @@ export interface SubscriberOptions {
166
166
  *
167
167
  * Bit 0–1 reliability (0 = best-effort, 1 = reliable), bits 2–4 priority (0–7, 0 =
168
168
  * default), bit 5 `durability_request` (deliver the producer's latched last value on
169
- * join), bits 6–15 reserved — a sender MUST write them 0 and a receiver MUST ignore them.
169
+ * join), bits 6–7 `delivery_class` (RFC-0025 §4.1 — see {@link DELIVERY_CLASS}), bits
170
+ * 8–15 reserved — a sender MUST write them 0 and a receiver MUST ignore them.
170
171
  *
171
172
  * Omitted or `0` emits **no** SETTINGS child at all: absent ⇒ all-zero ⇒ today's
172
173
  * behaviour, byte-identically (the `subscriber/policy-absent` vector).
@@ -177,6 +178,30 @@ export interface SubscriberOptions {
177
178
  * latched last value once, on join. Before RFC-0022 this was the producer's
178
179
  * `:settings.durability`, which applied to every subscriber at once. */
179
180
  export declare const DELIVERY_DURABILITY_REQUEST = 32;
181
+ /**
182
+ * @brief `delivery_class` (RFC-0025 §4.1, bits 6–7 of the packed word): how the producer's
183
+ * fan-out edge treats THIS subscriber's deliveries.
184
+ *
185
+ * `CONFLATE` is `0`, which is what a sender that predates the class wrote into those bits
186
+ * when they were reserved — so the assignment costs no wire byte and old subscribers are
187
+ * conflate-class by construction. Shift into place with {@link deliveryClassBits}; read one
188
+ * back out with {@link deliveryClassOf}. This client is a codec: it carries the class, it
189
+ * does not honour it.
190
+ */
191
+ export declare const DELIVERY_CLASS: {
192
+ /** @brief `0` — last-wins; delivery MAY coalesce to the newest value. The LKV default. */
193
+ readonly CONFLATE: 0;
194
+ /** @brief `1` — every write its own event; order-preserving, never conflated. */
195
+ readonly IMMEDIATE: 1;
196
+ /** @brief `2` — the wire encoding of a flush: one BATCH record (`0x80`) per flush. */
197
+ readonly BATCH: 2;
198
+ /** @brief `3` — append-preserving; every write delivered in order, none conflated. */
199
+ readonly STREAM: 3;
200
+ };
201
+ /** @brief The packed-word bits for a {@link DELIVERY_CLASS} member — `class << 6`. */
202
+ export declare function deliveryClassBits(cls: number): number;
203
+ /** @brief The delivery class carried in a packed `delivery_policy` word (bits 6–7). */
204
+ export declare function deliveryClassOf(policy: number): number;
180
205
  /**
181
206
  * @brief Build a SUBSCRIBER TLV (`type=0x04`, PL=1) wrapping a target PATH —
182
207
  * the payload of a subscribe-write (reference/04 §Subscribe).
package/dist/tlv.js CHANGED
@@ -326,6 +326,34 @@ export function encodeConnSpec(o) {
326
326
  * latched last value once, on join. Before RFC-0022 this was the producer's
327
327
  * `:settings.durability`, which applied to every subscriber at once. */
328
328
  export const DELIVERY_DURABILITY_REQUEST = 0x0020;
329
+ /**
330
+ * @brief `delivery_class` (RFC-0025 §4.1, bits 6–7 of the packed word): how the producer's
331
+ * fan-out edge treats THIS subscriber's deliveries.
332
+ *
333
+ * `CONFLATE` is `0`, which is what a sender that predates the class wrote into those bits
334
+ * when they were reserved — so the assignment costs no wire byte and old subscribers are
335
+ * conflate-class by construction. Shift into place with {@link deliveryClassBits}; read one
336
+ * back out with {@link deliveryClassOf}. This client is a codec: it carries the class, it
337
+ * does not honour it.
338
+ */
339
+ export const DELIVERY_CLASS = {
340
+ /** @brief `0` — last-wins; delivery MAY coalesce to the newest value. The LKV default. */
341
+ CONFLATE: 0,
342
+ /** @brief `1` — every write its own event; order-preserving, never conflated. */
343
+ IMMEDIATE: 1,
344
+ /** @brief `2` — the wire encoding of a flush: one BATCH record (`0x80`) per flush. */
345
+ BATCH: 2,
346
+ /** @brief `3` — append-preserving; every write delivered in order, none conflated. */
347
+ STREAM: 3,
348
+ };
349
+ /** @brief The packed-word bits for a {@link DELIVERY_CLASS} member — `class << 6`. */
350
+ export function deliveryClassBits(cls) {
351
+ return (cls & 0x03) << 6;
352
+ }
353
+ /** @brief The delivery class carried in a packed `delivery_policy` word (bits 6–7). */
354
+ export function deliveryClassOf(policy) {
355
+ return (policy >> 6) & 0x03;
356
+ }
329
357
  /**
330
358
  * @brief Build a SUBSCRIBER TLV (`type=0x04`, PL=1) wrapping a target PATH —
331
359
  * the payload of a subscribe-write (reference/04 §Subscribe).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avatarsd-llc/libtracer-client",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "EXPERIMENTAL libtracer client SDK (#56, ADR-0034/0035) — a path-addressed client over the cross-validated codec (@avatarsd-llc/libtracer) and an injected transport seam (e.g. @avatarsd-llc/libtracer-ws). Speaks the RFC-0004 remote operations over FWD: read / write / await / readField / subscribe, each a FWD frame whose source-routed FWD{REPLY} is decoded back. Pre-1.0 and experimental.",
5
5
  "author": "avatarsd LLC",
6
6
  "license": "Apache-2.0",
@@ -33,8 +33,8 @@
33
33
  "access": "public"
34
34
  },
35
35
  "peerDependencies": {
36
- "@avatarsd-llc/libtracer": ">=0.14.0 <0.15.0",
37
- "@avatarsd-llc/libtracer-ws": ">=0.14.0 <0.15.0"
36
+ "@avatarsd-llc/libtracer": ">=0.15.0 <0.16.0",
37
+ "@avatarsd-llc/libtracer-ws": ">=0.15.0 <0.16.0"
38
38
  },
39
39
  "peerDependenciesMeta": {
40
40
  "@avatarsd-llc/libtracer-ws": {