@macula-io/ts 0.13.5 → 0.14.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 CHANGED
@@ -235,6 +235,16 @@ fixed) is in [CHANGELOG.md](CHANGELOG.md).
235
235
  is why `keepAdvertisedDirect()` is a standalone function rather than a
236
236
  `Session` method.
237
237
 
238
+ - **Pool** — `Pool.connect(seeds, controlIdentity, opts)` holds live
239
+ connections to every configured seed concurrently (not
240
+ dial-one-then-fallback-on-failure), each independently monitored and
241
+ respawned with backoff on disconnect; `publish()`/`call()` fan out
242
+ over live links, `subscribe()` re-establishes automatically on
243
+ reconnect. Ports `macula/src/client/macula_client.erl`'s pool design;
244
+ see `pool.ts`'s own module doc for why it's a set of role-scoped
245
+ `Session`s per seed rather than one, given the single-reader
246
+ constraint below.
247
+
238
248
  Every item above is live-verified against the real production fleet
239
249
  (`station-de-frankfurt.macula.io`), including negative/error paths and,
240
250
  where applicable, the actual packaged npm tarball rather than only the
@@ -257,21 +267,23 @@ arbitrary payload" function (see above for why), a `station_endpoint`
257
267
  record builder (macula-go has none either — stations publish those
258
268
  themselves, not clients), and `Pinned`/`Insecure` trust modes (`WebPKI`
259
269
  only so far). Multiple concurrent `subscribe()` topics on one `Session`
260
- also isn't supported yet one `subscribe()` (like one `serve()`) per
261
- `Session` at a time; open a second `Session` for a second topic. Each of
262
- these is a separate, later slice of work built on top of a working
263
- `Session`.
270
+ still isn't supported at the `Session` level itself — one `subscribe()`
271
+ (like one `serve()`) per `Session` at a time; open a second `Session`
272
+ for a second topic (`Pool`, above, does exactly this internally to give
273
+ each tracked topic its own session). Each of these is a separate, later
274
+ slice of work built on top of a working `Session`.
264
275
 
265
276
  ## Testing
266
277
 
267
278
  ```bash
268
279
  npx vitest run # default suite, no network
269
- npm run test:live # MACULA_TS_LIVE=1 vitest run src/session.live.test.ts src/rpc.live.test.ts src/dht.live.test.ts src/pubsub.live.test.ts src/content.live.test.ts src/ucan.live.test.ts src/directdial.live.test.ts
280
+ npm run test:live # MACULA_TS_LIVE=1 vitest run src/session.live.test.ts src/rpc.live.test.ts src/dht.live.test.ts src/pubsub.live.test.ts src/content.live.test.ts src/ucan.live.test.ts src/directdial.live.test.ts src/pool.live.test.ts
270
281
  ```
271
282
 
272
283
  `src/session.live.test.ts`, `src/rpc.live.test.ts`, `src/dht.live.test.ts`,
273
284
  `src/pubsub.live.test.ts`, `src/content.live.test.ts`,
274
- `src/ucan.live.test.ts`, and `src/directdial.live.test.ts` hit the real
285
+ `src/ucan.live.test.ts`, `src/directdial.live.test.ts`, and
286
+ `src/pool.live.test.ts` hit the real
275
287
  production fleet and are **not** part of default `npm test`/CI — opt in
276
288
  explicitly, gated behind `MACULA_TS_LIVE`. Same convention as macula-go's
277
289
  `live` build tag, macula-rust's `#[ignore]`, and macula-dotnet's
@@ -1 +1 @@
1
- {"version":3,"file":"binding.js","sourceRoot":"","sources":["../src/binding.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,uEAAuE;AACvE,wEAAwE;AACxE,kEAAkE;AAClE,sEAAsE;AACtE,0DAA0D;AAC1D,2DAA2D;AAC3D,EAAE;AACF,oEAAoE;AACpE,yEAAyE;AACzE,8DAA8D;AAC9D,mEAAmE;AACnE,kEAAkE;AAClE,sEAAsE;AACtE,sEAAsE;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAErE,8DAA8D;AAC9D,MAAM,KAAK,GAAG,OA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mCxE;;;;;;;mCAOmC;AACnC,MAAM,CAAC,MAAM,kCAAkC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAiBjE;;;;;;;;;;;;;;;;;;;;;;;sBAuBsB;AACtB,MAAM,UAAU,oBAAoB,CAAC,OAAgB,EAAE,SAAiB,EAAE,IAAI,GAAgC,EAAE;IAC9G,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,kCAAkC,CAAC;IACzE,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,MAAM,IAAI,GAAG,GAAS,EAAE;QACtB,OAAO,CAAC,eAAe,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YAClG,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,IAAI,EAAE,CAAC;IACP,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC5C,oEAAoE;IACpE,uEAAuE;IACvE,sEAAsE;IACtE,qEAAqE;IACrE,sEAAsE;IACtE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;IAEhB,OAAO,GAAS,EAAE;QAChB,IAAI,OAAO;YAAE,OAAO;QACpB,OAAO,GAAG,IAAI,CAAC;QACf,aAAa,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { Identity } from "./identity.js";
2
2
  export { Session, type CallOptions } from "./session.js";
3
+ export { Pool, NoHealthyStationError, type Seed, type PoolOptions, type PoolStatus } from "./pool.js";
3
4
  export { MaculaCallError, type JsonValue, type Bolt4ErrorInfo } from "./rpc.js";
4
5
  export { DhtRecordType, DHT_DEFAULT_TTL_MS, type DhtRecord } from "./dht.js";
5
6
  export type { PublishOptions, PubsubEvent } from "./pubsub.js";
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { Identity } from "./identity.js";
2
2
  export { Session } from "./session.js";
3
+ export { Pool, NoHealthyStationError } from "./pool.js";
3
4
  export { MaculaCallError } from "./rpc.js";
4
5
  export { DhtRecordType, DHT_DEFAULT_TTL_MS } from "./dht.js";
5
6
  export { ContentNotFoundError } from "./content.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAoB,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,eAAe,EAAuC,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAkB,MAAM,UAAU,CAAC;AAE7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,IAAI,EAAiE,MAAM,WAAW,CAAC;AAChG,OAAO,EACL,oBAAoB,EACpB,kCAAkC,GAInC,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,OAAO,EAAoB,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAgD,MAAM,WAAW,CAAC;AACtG,OAAO,EAAE,eAAe,EAAuC,MAAM,UAAU,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAkB,MAAM,UAAU,CAAC;AAE7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,IAAI,EAAiE,MAAM,WAAW,CAAC;AAChG,OAAO,EACL,oBAAoB,EACpB,kCAAkC,GAInC,MAAM,iBAAiB,CAAC"}
package/dist/pool.d.ts ADDED
@@ -0,0 +1,140 @@
1
+ import { Identity } from "./identity.js";
2
+ import type { PubsubEvent } from "./pubsub.js";
3
+ import { type JsonValue } from "./rpc.js";
4
+ /** One configured connection target. */
5
+ export interface Seed {
6
+ host: string;
7
+ port: number;
8
+ }
9
+ export interface PoolOptions {
10
+ /** How many currently-live control links a publish() fans out to
11
+ * before resolving -- partial success counts as success, matching
12
+ * macula_client:publish/5's own documented semantics. Default 1.
13
+ * NOT YET FULLY AT PARITY above 1: the Erlang reference stamps ONE
14
+ * seq across every replica specifically so a receiver's own
15
+ * (publisher, seq, topic) dedup collapses the redundant copies into
16
+ * one event. This SDK's Session.publish() has no caller-supplied-seq
17
+ * parameter to do the same (each call mints its own fresh seq), so
18
+ * setting this above 1 would deliver N distinct, non-deduplicable
19
+ * copies to every subscriber -- clamped to 1 until that's fixed. */
20
+ replicationFactor?: number;
21
+ /** How long a recorded (realm, publisher, seq, topic) key is treated
22
+ * as a duplicate before it ages out. Default 60_000, matching the
23
+ * Erlang reference's own `dedup_window_ms` default. */
24
+ dedupWindowMs?: number;
25
+ /** How often the dedup table is swept for expired entries. Default
26
+ * 30_000, matching the Erlang reference's own `dedup_sweep_ms`. */
27
+ dedupSweepMs?: number;
28
+ /** How often a live control link is health-checked (see
29
+ * #armHealthCheck's own doc for why publish() alone can't be trusted
30
+ * to ever notice a dead connection). Default 10_000. */
31
+ healthCheckIntervalMs?: number;
32
+ }
33
+ export interface PoolStatus {
34
+ /** Seeds whose control link is currently connected. */
35
+ healthyLinks: number;
36
+ /** Seeds whose control link is not currently connected (connecting
37
+ * or backing off). Every configured seed is exactly one or the
38
+ * other -- a link backs off and retries forever, it is never given
39
+ * up on and dropped from the pool, same as the Erlang reference. */
40
+ failedLinks: number;
41
+ }
42
+ /** Thrown by publish()/call() when the pool has zero live control links
43
+ * to try -- a distinct, identifiable condition from any one link's own
44
+ * transient error, matching macula_client:publish/5's own `{error,
45
+ * {transient, no_healthy_station}}`. */
46
+ export declare class NoHealthyStationError extends Error {
47
+ constructor();
48
+ }
49
+ /**
50
+ * A resilient multi-station client: live connections to every configured
51
+ * seed held concurrently, each independently monitored and respawned
52
+ * with backoff on disconnect, every tracked subscription re-established
53
+ * automatically when its own link reconnects. See this module's own
54
+ * header doc for the full design, why a "link" is a small role-scoped
55
+ * session set rather than one Session, and its one deliberate deviation
56
+ * from the Erlang reference (topic-scoped dedup).
57
+ */
58
+ export declare class Pool {
59
+ #private;
60
+ private constructor();
61
+ /** Dials the control role against every seed concurrently under
62
+ * `controlIdentity` (the caller's own identity -- publish()/call()
63
+ * are attributed to it on the wire) and resolves once every seed's
64
+ * FIRST connect attempt has settled (success or a logged failure
65
+ * headed into backoff) -- matches tapRoom()'s own "await the first
66
+ * attempt, not the eventual outcome" reasoning (macula-mcp's
67
+ * lobby_observer.ts): a caller that publishes/calls immediately
68
+ * after connect() must not race links still mid-handshake. */
69
+ static connect(seeds: Seed[], controlIdentity: Identity, opts?: PoolOptions): Promise<Pool>;
70
+ /** Publishes to `replicationFactor` currently-live control links
71
+ * (default 1); partial success counts as success. A link whose
72
+ * publish attempt fails is marked for respawn immediately -- this is
73
+ * this v1's only liveness signal for the control role, since it
74
+ * cannot also carry a liveness-only subscribe (see this module's own
75
+ * header doc). Throws NoHealthyStationError if zero links are live.
76
+ *
77
+ * `realm`/`payload` are validated before any link is touched. Found
78
+ * live 2026-09-05: a malformed realm or an unserializable payload
79
+ * throws inside session.publish() itself, well before any wire I/O --
80
+ * treating that throw as evidence of a dead connection (the pre-fix
81
+ * behavior) tore down a perfectly healthy link over a caller-side
82
+ * argument bug. */
83
+ publish(realm: string | undefined, topic: string, payload: JsonValue, opts?: {
84
+ ttlMs?: number;
85
+ }): Promise<void>;
86
+ /** Calls `procedure` against the pool's live control links in order
87
+ * until one succeeds or all have been tried. Throws
88
+ * NoHealthyStationError if zero links are live.
89
+ *
90
+ * `realm`/`payload` are validated before any link is touched, for the
91
+ * same reason as publish() -- a malformed realm is a caller bug, not
92
+ * evidence of a dead connection, and must never be attributed to one.
93
+ *
94
+ * A `MaculaCallError` (a real BOLT#4 response -- e.g.
95
+ * unknown_next_peer, unauthorized, a procedure nobody serves, a gated
96
+ * call this identity isn't authorized for) does NOT mark its link for
97
+ * respawn: the connection plainly worked, it answered. call() still
98
+ * falls through to the next link either way, matching the Erlang
99
+ * reference's own keep_or_next (macula_client.erl) -- a non-idempotent
100
+ * provider handler genuinely can be re-invoked on each live link this
101
+ * reaches; that is parity with the reference, not a bug this fixes.
102
+ *
103
+ * Any OTHER thrown error (never a wire-level answer at all) is
104
+ * ambiguous, not automatically a dead link: session.call()'s own
105
+ * deadlineMs elapsing looks identical to a genuinely severed
106
+ * connection, but means the far end is merely slow, not gone. Found
107
+ * live 2026-09-05: treating every such error as a dead link meant one
108
+ * slow provider response tore down and reconnected EVERY live control
109
+ * link in turn as call() moved through them re-trying the same call.
110
+ * #probeLiveness's own dedicated liveness call is the tiebreaker --
111
+ * only a link that ALSO fails to get a wire-level answer on that
112
+ * fresh probe is scheduled for reconnect. Each link's own `session`
113
+ * reference is re-checked both before probing and before scheduling a
114
+ * reconnect, in case a concurrent operation already superseded it. */
115
+ call(realm: string | undefined, procedure: string, payload: JsonValue, opts?: {
116
+ deadlineMs?: number;
117
+ }): Promise<JsonValue>;
118
+ /** Subscribes `handler` to `(realm, topic)`: opens one subscribe-only
119
+ * session against every configured seed, replayed automatically on
120
+ * every future respawn. Mints a dedicated identity for this topic by
121
+ * default (disposed on unsubscribe); pass `identity` to supply the
122
+ * pool's own instead (e.g. for a stable, caller-controlled identity
123
+ * across restarts, matching macula-mcp's own observeRoomIdentityPath
124
+ * pattern) -- the pool never disposes an identity it didn't mint.
125
+ * Returns an unsubscribe function. */
126
+ subscribe(realm: string | undefined, topic: string, handler: (evt: PubsubEvent) => void, identity?: Identity): Promise<() => Promise<void>>;
127
+ /** Live/backing-off CONTROL link counts (publish/call reachability).
128
+ * Every configured seed is exactly one or the other. Per-topic
129
+ * subscription link health is not reflected here -- inspect a
130
+ * specific subscription's own behavior (events arriving or not)
131
+ * instead; exposing N independent per-topic health vectors here
132
+ * would not simplify what a caller actually needs to know. */
133
+ status(): PoolStatus;
134
+ /** Closes every control and subscription link and disposes every
135
+ * identity this pool owns (the caller-supplied control identity
136
+ * included). Awaits each link's in-flight connect/reconnect first,
137
+ * so a still-connecting link never has its identity yanked out from
138
+ * under it. */
139
+ close(): Promise<void>;
140
+ }
package/dist/pool.js ADDED
@@ -0,0 +1,610 @@
1
+ // Resilient multi-station client -- ports macula/src/client/macula_client.erl's
2
+ // pool design (N live links, monitor + respawn-with-backoff, subscription
3
+ // replay on reconnect) into this SDK. `Session` (session.ts) and
4
+ // `connectWithFallback`/`withSession` (this SDK's consumers, e.g.
5
+ // macula-mcp's macula_ts_client.ts) are both dial-one-then-use primitives --
6
+ // correct for a one-shot operation, wrong for anything that needs to stay
7
+ // reachable across a station's own outage. A Pool holds live connections to
8
+ // every configured seed concurrently, not one-then-fallback-on-first-failure;
9
+ // a seed that never connects and a link whose connection later dies are the
10
+ // same condition (backoff, retry forever) rather than two different code
11
+ // paths.
12
+ //
13
+ // == Why this isn't "one Session per seed" ==
14
+ //
15
+ // Erlang's macula_client can put N tracked (Realm, Topic) subscriptions
16
+ // (plus Call, plus Advertise) on ONE gen_server-owned link, because a BEAM
17
+ // mailbox demuxes every message type for that one process regardless of how
18
+ // many concerns it's juggling. This SDK's Session has no equivalent: its
19
+ // underlying control stream supports exactly one concurrent reader --
20
+ // `subscribe()` throws outright if called twice on the same Session
21
+ // ("a second concurrent subscribe() on the same Session races; open a
22
+ // second Session instead"), and `call()`/`serve()` are mutually exclusive
23
+ // with an active subscribe on the same Session for the identical reason
24
+ // (macula-go's FrameStream does a raw sequential read into a shared buffer,
25
+ // no per-caller demux). Confirmed live 2026-09-04 while porting the Go side
26
+ // of this same design: this is a wire-level constraint, not a TS-specific
27
+ // gap -- macula-mcp already works around it today by giving lobby_observer.ts
28
+ // a dedicated identity+Session PER ROOM TOPIC rather than multiplexing one
29
+ // connection.
30
+ //
31
+ // So a "link" to one station here is a small SET of role-scoped sessions,
32
+ // not one session:
33
+ // - one "control" session (this pool's own caller-supplied identity),
34
+ // used for publish() and call() and NEVER subscribed on -- publish() is
35
+ // write-only (explicitly unguarded by the exclusivity rule) and call()'s
36
+ // own internal queue already serialises concurrent calls safely, so one
37
+ // control session per station is enough regardless of call volume.
38
+ // - one additional session PER CURRENTLY-TRACKED TOPIC, under an identity
39
+ // derived from that topic (shared across every station's copy of that
40
+ // topic's session -- reused across stations is safe, since a station's
41
+ // own per-identity dedupe only kicks a SECOND connection to THAT SAME
42
+ // station, never across different stations). Each does exactly one
43
+ // subscribe() and nothing else.
44
+ // Every one of these sessions is independently monitored and respawned with
45
+ // backoff; a topic session dying just re-subscribes its own one topic on
46
+ // respawn (no "replay N subscriptions onto a survivor" step needed, since
47
+ // each session only ever carried one). A control link can't also carry a
48
+ // liveness-only subscribe without reintroducing the exclusivity problem it
49
+ // exists to avoid, and a failed call() genuinely does surface a dead
50
+ // connection -- but publish() does not: found live 2026-09-04 that a
51
+ // publish() attempt on a session the station had already kicked can still
52
+ // locally "succeed" (the frame is handed off before the QUIC stack notices
53
+ // its own connection is gone), so a publish-only workload could go
54
+ // arbitrarily long without ever discovering a dead control link. Every
55
+ // live control link is therefore also health-checked on a timer
56
+ // (#armHealthCheck's own doc has the mechanism) -- a periodic call() to a
57
+ // procedure name guaranteed never to be advertised, whose failure is
58
+ // inspected to tell "a real BOLT#4 unknown_next_peer came back" (alive)
59
+ // apart from "this never reached anyone at all" (dead, reconnect).
60
+ //
61
+ // == Deliberate deviation from the Erlang reference ==
62
+ //
63
+ // macula_client's own inbound-event dedup keys on (Realm, Publisher, Seq)
64
+ // alone, with no Topic. That is the exact shape of a real bug found and
65
+ // fixed on the station side 2026-09-04 (macula-station's event_dedup): an
66
+ // identity's own auto-published facts and its application-level publishes
67
+ // can share one seq-counter space, and two different topics publishing the
68
+ // same seq collide under a topic-blind key. This pool's own dedup includes
69
+ // Topic from the start.
70
+ import { Identity } from "./identity.js";
71
+ import { MaculaCallError } from "./rpc.js";
72
+ import { realmBytesFromHex, Session } from "./session.js";
73
+ /** Thrown by publish()/call() when the pool has zero live control links
74
+ * to try -- a distinct, identifiable condition from any one link's own
75
+ * transient error, matching macula_client:publish/5's own `{error,
76
+ * {transient, no_healthy_station}}`. */
77
+ export class NoHealthyStationError extends Error {
78
+ constructor() {
79
+ super("macula-ts: pool has no currently-live links");
80
+ this.name = "NoHealthyStationError";
81
+ }
82
+ }
83
+ const RECONNECT_BASE_MS = 1_000;
84
+ const RECONNECT_MAX_MS = 30_000;
85
+ /** How often a LIVE control link is health-checked (see #armHealthCheck's
86
+ * own doc for why publish() alone can't be trusted to ever notice a dead
87
+ * connection). Topic-role links need no equivalent -- their own
88
+ * subscribe() already gives them a real, immediate onClosed signal. */
89
+ const HEALTH_CHECK_INTERVAL_MS = 10_000;
90
+ function subKey(realm, topic) {
91
+ return `${realm ?? ""}\0${topic}`;
92
+ }
93
+ function dedupKey(realm, publisher, seq, topic) {
94
+ return `${realm ?? ""}\0${Buffer.from(publisher).toString("hex")}\0${seq}\0${topic}`;
95
+ }
96
+ /**
97
+ * A resilient multi-station client: live connections to every configured
98
+ * seed held concurrently, each independently monitored and respawned
99
+ * with backoff on disconnect, every tracked subscription re-established
100
+ * automatically when its own link reconnects. See this module's own
101
+ * header doc for the full design, why a "link" is a small role-scoped
102
+ * session set rather than one Session, and its one deliberate deviation
103
+ * from the Erlang reference (topic-scoped dedup).
104
+ */
105
+ export class Pool {
106
+ #controlIdentity;
107
+ #controlLinks;
108
+ #seeds;
109
+ #subscriptions = new Map();
110
+ #dedup = new Map();
111
+ #sweepTimer;
112
+ #replicationFactor;
113
+ #dedupWindowMs;
114
+ #healthCheckIntervalMs;
115
+ #closed = false;
116
+ constructor(controlIdentity, seeds, opts) {
117
+ this.#controlIdentity = controlIdentity;
118
+ this.#seeds = seeds;
119
+ const requestedReplication = opts.replicationFactor ?? 1;
120
+ if (requestedReplication !== 1) {
121
+ console.error(`macula-ts pool: replicationFactor ${requestedReplication} is not yet supported (each replica would publish ` +
122
+ "a distinct seq, so a receiver's dedup can't collapse them into one event) -- clamping to 1.");
123
+ }
124
+ this.#replicationFactor = 1;
125
+ this.#dedupWindowMs = opts.dedupWindowMs ?? 60_000;
126
+ this.#healthCheckIntervalMs = opts.healthCheckIntervalMs ?? HEALTH_CHECK_INTERVAL_MS;
127
+ this.#controlLinks = seeds.map((seed) => this.#newRoleLink(seed, controlIdentity, undefined));
128
+ const sweepMs = opts.dedupSweepMs ?? 30_000;
129
+ this.#sweepTimer = setInterval(() => this.#sweepDedup(), sweepMs);
130
+ this.#sweepTimer.unref?.();
131
+ }
132
+ #newRoleLink(seed, identity, onConnected) {
133
+ return {
134
+ seed,
135
+ identity,
136
+ session: undefined,
137
+ status: "connecting",
138
+ reconnectAttempt: 0,
139
+ retryTimer: undefined,
140
+ healthCheckTimer: undefined,
141
+ closing: false,
142
+ inFlight: undefined,
143
+ pendingClose: undefined,
144
+ onConnected,
145
+ closedDuringConnect: false,
146
+ };
147
+ }
148
+ /** Dials the control role against every seed concurrently under
149
+ * `controlIdentity` (the caller's own identity -- publish()/call()
150
+ * are attributed to it on the wire) and resolves once every seed's
151
+ * FIRST connect attempt has settled (success or a logged failure
152
+ * headed into backoff) -- matches tapRoom()'s own "await the first
153
+ * attempt, not the eventual outcome" reasoning (macula-mcp's
154
+ * lobby_observer.ts): a caller that publishes/calls immediately
155
+ * after connect() must not race links still mid-handshake. */
156
+ static async connect(seeds, controlIdentity, opts = {}) {
157
+ if (seeds.length === 0)
158
+ throw new Error("macula-ts: Pool.connect() needs at least one seed");
159
+ const seen = new Set();
160
+ for (const seed of seeds) {
161
+ const seedKey = `${seed.host}:${seed.port}`;
162
+ if (seen.has(seedKey))
163
+ throw new Error(`macula-ts: Pool.connect() given duplicate seed ${seedKey} -- each seed must be a distinct station`);
164
+ seen.add(seedKey);
165
+ }
166
+ const pool = new Pool(controlIdentity, seeds, opts);
167
+ await Promise.all(pool.#controlLinks.map((link) => pool.#attach(link)));
168
+ return pool;
169
+ }
170
+ async #attach(link) {
171
+ const attempt = this.#attachOnce(link);
172
+ link.inFlight = attempt.finally(() => {
173
+ if (link.inFlight === attempt)
174
+ link.inFlight = undefined;
175
+ });
176
+ await link.inFlight;
177
+ }
178
+ /** (Re)connects one role link and, for a topic role, re-subscribes it.
179
+ * Never throws -- a failure logs and schedules a backoff retry, the
180
+ * same self-healing shape every persistent connection in this
181
+ * ecosystem already uses. */
182
+ async #attachOnce(link) {
183
+ if (link.closing)
184
+ return;
185
+ // Defensive: a redundant call on an already-live link must never
186
+ // overwrite its session with a second connection under the same
187
+ // identity to the same station (exactly the collision this whole
188
+ // design exists to avoid). #scheduleReconnect's own idempotency
189
+ // guard is what should prevent this from ever being reachable in
190
+ // practice; this is the belt-and-suspenders backstop.
191
+ if (link.session)
192
+ return;
193
+ link.status = "connecting";
194
+ let session;
195
+ try {
196
+ session = await Session.connect(link.seed.host, link.seed.port, link.identity);
197
+ }
198
+ catch (err) {
199
+ console.error(`macula-ts pool: connect to ${link.seed.host}:${link.seed.port} failed:`, err);
200
+ this.#scheduleReconnect(link);
201
+ return;
202
+ }
203
+ if (link.closing) {
204
+ await session.close(link.identity).catch(() => { });
205
+ return;
206
+ }
207
+ if (link.onConnected) {
208
+ link.closedDuringConnect = false;
209
+ try {
210
+ await link.onConnected(link, session);
211
+ }
212
+ catch (err) {
213
+ console.error(`macula-ts pool: subscribe on ${link.seed.host}:${link.seed.port} failed:`, err);
214
+ await session.close(link.identity).catch(() => { });
215
+ this.#scheduleReconnect(link);
216
+ return;
217
+ }
218
+ if (link.closedDuringConnect) {
219
+ console.error(`macula-ts pool: ${link.seed.host}:${link.seed.port}'s subscription closed before it could be marked live -- retrying`);
220
+ await session.close(link.identity).catch(() => { });
221
+ this.#scheduleReconnect(link);
222
+ return;
223
+ }
224
+ }
225
+ link.session = session;
226
+ link.status = "live";
227
+ link.reconnectAttempt = 0;
228
+ if (!link.onConnected)
229
+ this.#armHealthCheck(link);
230
+ }
231
+ /** Control-role links only (topic roles have their own subscribe()
232
+ * onClosed and never reach here -- `!link.onConnected` is what
233
+ * distinguishes them). publish() is fire-and-forget: found live
234
+ * 2026-09-04 that a publish() attempt on a session the station had
235
+ * already kicked can still locally "succeed" (the frame is handed off
236
+ * before the QUIC stack notices its own connection is gone), so a
237
+ * publish-only caller could go arbitrarily long without this pool
238
+ * ever discovering a dead control link. Every HEALTH_CHECK_INTERVAL_MS
239
+ * while the link is live, this calls a procedure name that is
240
+ * guaranteed never to be advertised (a fresh UUID-shaped string) and
241
+ * inspects the failure: a clean MaculaCallError means a real BOLT#4
242
+ * response came back over the wire (unknown_next_peer, as expected) --
243
+ * the connection is genuinely alive, nothing to do. Any OTHER
244
+ * thrown error means the call never got a wire-level answer at all --
245
+ * the same signal call()'s own doc uses to distinguish a real BOLT#4
246
+ * answer from "this never reached anyone" -- so it's treated exactly
247
+ * like a real operation failure and schedules a reconnect. */
248
+ #armHealthCheck(link) {
249
+ if (link.healthCheckTimer)
250
+ clearInterval(link.healthCheckTimer);
251
+ const timer = setInterval(() => {
252
+ const session = link.session;
253
+ if (!session)
254
+ return;
255
+ this.#probeLiveness(session).then((alive) => {
256
+ if (alive)
257
+ return;
258
+ if (link.session !== session)
259
+ return; // already superseded by a reconnect
260
+ console.error(`macula-ts pool: health check on ${link.seed.host}:${link.seed.port} failed`);
261
+ this.#scheduleReconnect(link);
262
+ });
263
+ }, this.#healthCheckIntervalMs);
264
+ timer.unref?.();
265
+ link.healthCheckTimer = timer;
266
+ }
267
+ /** Calls a procedure name guaranteed never to be advertised and
268
+ * classifies the outcome: true if a real BOLT#4 answer came back
269
+ * (the connection is alive, whatever else provoked this probe), false
270
+ * if the call never got a wire-level answer at all (the connection is
271
+ * genuinely dead). Shared by #armHealthCheck's own timer and call()'s
272
+ * handling of an ambiguous failure (see call()'s own doc) -- a plain
273
+ * Error from session.call() means "no wire answer", but that is also
274
+ * exactly what a timed-out call against an otherwise-healthy but
275
+ * momentarily slow provider looks like. Found live 2026-09-05: without
276
+ * this second opinion, call() tore down every live control link in
277
+ * turn on nothing more than one slow provider response. */
278
+ async #probeLiveness(session) {
279
+ const probe = `_pool.healthcheck.${Math.random().toString(36).slice(2)}`;
280
+ try {
281
+ await session.call(probe, null, { deadlineMs: this.#healthCheckIntervalMs });
282
+ return true; // a real provider somehow answering a random UUID-shaped name is astronomically unlikely either way
283
+ }
284
+ catch (err) {
285
+ return err instanceof MaculaCallError; // alive iff a real wire answer came back
286
+ }
287
+ }
288
+ /** Marks `link` for backoff and schedules its next reconnect attempt.
289
+ * Closes whatever session it currently holds first (fire-and-forget,
290
+ * not awaited -- the retry timer must not wait on a graceful close
291
+ * round trip) so a still-alive session from an OPERATION failure
292
+ * (publish()/call() throwing for a reason that doesn't mean the
293
+ * connection itself already died, unlike a subscribe onClosed) is
294
+ * never simply orphaned. Found live 2026-09-04: without this, a
295
+ * publish/call failure left the old session's native handle both
296
+ * leaked AND, worse, still open under this link's identity -- the
297
+ * NEXT connect attempt for this SAME station under that SAME
298
+ * identity then races the still-live old one for the station's own
299
+ * per-identity dedupe kick, with no guarantee which one loses. The
300
+ * close is fired here, before scheduling, so it has the full backoff
301
+ * delay (at least RECONNECT_BASE_MS) to land before a new connect
302
+ * attempt begins.
303
+ *
304
+ * Idempotent per backoff episode: a no-op once `link.status` is
305
+ * already "backoff". Found live in review 2026-09-05: concurrent
306
+ * operations queued on one session (e.g. several call()s serialised
307
+ * by Session's own internal queue) can ALL fail once that session
308
+ * dies, and each one's catch handler calls this -- without this
309
+ * guard, every failure past the first would re-close an
310
+ * already-`undefined` `link.session` (harmless) but ALSO arm a
311
+ * second, third, ... retryTimer, each bumping reconnectAttempt
312
+ * independently, leaving multiple redundant reconnects racing each
313
+ * other. Deliberately NOT guarded against "connecting" -- this is
314
+ * also called from `#attachOnce`'s own failure paths, while status
315
+ * is still "connecting" from the top of that same function, and
316
+ * that path must proceed normally. */
317
+ #scheduleReconnect(link) {
318
+ if (link.closing)
319
+ return;
320
+ if (link.status === "backoff")
321
+ return;
322
+ if (link.healthCheckTimer) {
323
+ clearInterval(link.healthCheckTimer);
324
+ link.healthCheckTimer = undefined;
325
+ }
326
+ const stale = link.session;
327
+ link.status = "backoff";
328
+ link.session = undefined;
329
+ if (stale) {
330
+ const closing = stale.close(link.identity).catch(() => { });
331
+ link.pendingClose = closing;
332
+ void closing.finally(() => {
333
+ if (link.pendingClose === closing)
334
+ link.pendingClose = undefined;
335
+ });
336
+ }
337
+ const delay = Math.min(RECONNECT_MAX_MS, RECONNECT_BASE_MS * 2 ** link.reconnectAttempt);
338
+ link.reconnectAttempt += 1;
339
+ const timer = setTimeout(() => {
340
+ const attempt = this.#attachOnce(link);
341
+ link.inFlight = attempt.finally(() => {
342
+ if (link.inFlight === attempt)
343
+ link.inFlight = undefined;
344
+ });
345
+ }, delay);
346
+ // Deliberately NOT unref()'d, unlike healthCheckTimer/sweepTimer --
347
+ // this pool's own documented contract is "retry forever" for a
348
+ // link in backoff. Found live in review 2026-09-05: a pure
349
+ // subscribe()-only process (no other keep-alive handle: no HTTP
350
+ // listener, no stdio transport) would otherwise exit cleanly the
351
+ // moment its last live connection drops, silently breaking that
352
+ // promise instead of actually retrying through the outage.
353
+ link.retryTimer = timer;
354
+ }
355
+ #sweepDedup() {
356
+ const cutoff = Date.now() - this.#dedupWindowMs;
357
+ for (const [key, at] of this.#dedup) {
358
+ if (at < cutoff)
359
+ this.#dedup.delete(key);
360
+ }
361
+ }
362
+ #liveControlLinks() {
363
+ return this.#controlLinks.filter((l) => l.status === "live" && l.session);
364
+ }
365
+ /** Refuses an `identity` that would double-connect to the same
366
+ * station as the control role or another already-tracked
367
+ * subscription -- the station kicks the OLDER of the two, this pool
368
+ * reconnects it, which gets IT kicked in turn: a perpetual ping-pong
369
+ * with no error naming the cause. Compares raw node-id bytes, not
370
+ * object identity, so two separately-loaded Identity instances over
371
+ * the SAME underlying keypair are still caught. */
372
+ #assertIdentityNotAlreadyUsed(identity) {
373
+ const nodeIdHex = Buffer.from(identity.nodeId).toString("hex");
374
+ if (nodeIdHex === Buffer.from(this.#controlIdentity.nodeId).toString("hex")) {
375
+ throw new Error("macula-ts pool: this identity is already the pool's own control identity -- reusing it for a subscription would double-connect one identity to one station");
376
+ }
377
+ for (const sub of this.#subscriptions.values()) {
378
+ if (Buffer.from(sub.identity.nodeId).toString("hex") === nodeIdHex) {
379
+ throw new Error(`macula-ts pool: this identity is already used by the "${sub.topic}" subscription -- reusing it here would double-connect one identity to one station`);
380
+ }
381
+ }
382
+ }
383
+ /** Publishes to `replicationFactor` currently-live control links
384
+ * (default 1); partial success counts as success. A link whose
385
+ * publish attempt fails is marked for respawn immediately -- this is
386
+ * this v1's only liveness signal for the control role, since it
387
+ * cannot also carry a liveness-only subscribe (see this module's own
388
+ * header doc). Throws NoHealthyStationError if zero links are live.
389
+ *
390
+ * `realm`/`payload` are validated before any link is touched. Found
391
+ * live 2026-09-05: a malformed realm or an unserializable payload
392
+ * throws inside session.publish() itself, well before any wire I/O --
393
+ * treating that throw as evidence of a dead connection (the pre-fix
394
+ * behavior) tore down a perfectly healthy link over a caller-side
395
+ * argument bug. */
396
+ async publish(realm, topic, payload, opts = {}) {
397
+ if (this.#closed)
398
+ throw new Error("macula-ts pool: used after close()");
399
+ realmBytesFromHex(realm);
400
+ JSON.stringify(payload ?? null);
401
+ const targets = this.#liveControlLinks().slice(0, this.#replicationFactor);
402
+ if (targets.length === 0)
403
+ throw new NoHealthyStationError();
404
+ const results = await Promise.allSettled(targets.map(async (link) => {
405
+ const session = link.session;
406
+ if (link.status !== "live" || !session)
407
+ throw new NoHealthyStationError(); // superseded since targets was captured
408
+ try {
409
+ await session.publish(topic, payload, { realm, ttlMs: opts.ttlMs });
410
+ }
411
+ catch (err) {
412
+ if (link.session === session)
413
+ this.#scheduleReconnect(link);
414
+ throw err;
415
+ }
416
+ }));
417
+ if (!results.some((r) => r.status === "fulfilled")) {
418
+ const first = results.find((r) => r.status === "rejected");
419
+ throw first ? first.reason : new Error("macula-ts pool: publish failed on every targeted link");
420
+ }
421
+ }
422
+ /** Calls `procedure` against the pool's live control links in order
423
+ * until one succeeds or all have been tried. Throws
424
+ * NoHealthyStationError if zero links are live.
425
+ *
426
+ * `realm`/`payload` are validated before any link is touched, for the
427
+ * same reason as publish() -- a malformed realm is a caller bug, not
428
+ * evidence of a dead connection, and must never be attributed to one.
429
+ *
430
+ * A `MaculaCallError` (a real BOLT#4 response -- e.g.
431
+ * unknown_next_peer, unauthorized, a procedure nobody serves, a gated
432
+ * call this identity isn't authorized for) does NOT mark its link for
433
+ * respawn: the connection plainly worked, it answered. call() still
434
+ * falls through to the next link either way, matching the Erlang
435
+ * reference's own keep_or_next (macula_client.erl) -- a non-idempotent
436
+ * provider handler genuinely can be re-invoked on each live link this
437
+ * reaches; that is parity with the reference, not a bug this fixes.
438
+ *
439
+ * Any OTHER thrown error (never a wire-level answer at all) is
440
+ * ambiguous, not automatically a dead link: session.call()'s own
441
+ * deadlineMs elapsing looks identical to a genuinely severed
442
+ * connection, but means the far end is merely slow, not gone. Found
443
+ * live 2026-09-05: treating every such error as a dead link meant one
444
+ * slow provider response tore down and reconnected EVERY live control
445
+ * link in turn as call() moved through them re-trying the same call.
446
+ * #probeLiveness's own dedicated liveness call is the tiebreaker --
447
+ * only a link that ALSO fails to get a wire-level answer on that
448
+ * fresh probe is scheduled for reconnect. Each link's own `session`
449
+ * reference is re-checked both before probing and before scheduling a
450
+ * reconnect, in case a concurrent operation already superseded it. */
451
+ async call(realm, procedure, payload, opts = {}) {
452
+ if (this.#closed)
453
+ throw new Error("macula-ts pool: used after close()");
454
+ realmBytesFromHex(realm);
455
+ JSON.stringify(payload ?? null);
456
+ const targets = this.#liveControlLinks();
457
+ if (targets.length === 0)
458
+ throw new NoHealthyStationError();
459
+ let lastErr;
460
+ for (const link of targets) {
461
+ const session = link.session;
462
+ if (link.status !== "live" || !session)
463
+ continue; // superseded since `targets` was captured
464
+ try {
465
+ return await session.call(procedure, payload, { realm, deadlineMs: opts.deadlineMs });
466
+ }
467
+ catch (err) {
468
+ lastErr = err;
469
+ if (!(err instanceof MaculaCallError) && link.session === session && !(await this.#probeLiveness(session))) {
470
+ if (link.session === session)
471
+ this.#scheduleReconnect(link);
472
+ }
473
+ }
474
+ }
475
+ throw lastErr;
476
+ }
477
+ /** Subscribes `handler` to `(realm, topic)`: opens one subscribe-only
478
+ * session against every configured seed, replayed automatically on
479
+ * every future respawn. Mints a dedicated identity for this topic by
480
+ * default (disposed on unsubscribe); pass `identity` to supply the
481
+ * pool's own instead (e.g. for a stable, caller-controlled identity
482
+ * across restarts, matching macula-mcp's own observeRoomIdentityPath
483
+ * pattern) -- the pool never disposes an identity it didn't mint.
484
+ * Returns an unsubscribe function. */
485
+ async subscribe(realm, topic, handler, identity) {
486
+ if (this.#closed)
487
+ throw new Error("macula-ts pool: used after close()");
488
+ const key = subKey(realm, topic);
489
+ if (this.#subscriptions.has(key))
490
+ throw new Error(`macula-ts pool: already subscribed to ${topic}${realm ? ` (realm ${realm})` : ""}`);
491
+ if (identity)
492
+ this.#assertIdentityNotAlreadyUsed(identity);
493
+ const ownsIdentity = identity === undefined;
494
+ const subIdentity = identity ?? Identity.generate();
495
+ const sub = { realm, topic, handler, identity: subIdentity, ownsIdentity, links: [] };
496
+ const onConnected = async (link, session) => {
497
+ await session.subscribe(topic, (evt) => {
498
+ const dkey = dedupKey(realm, evt.publisher, evt.seq, topic);
499
+ if (this.#dedup.has(dkey))
500
+ return;
501
+ this.#dedup.set(dkey, Date.now());
502
+ // A caller's handler throwing must not take down the native
503
+ // callback that invoked it -- found live 2026-09-05: an
504
+ // uncaught exception here crosses back into the N-API
505
+ // callback with no pending-exception handling on the addon
506
+ // side, which Node only warns about today (DEP0168) but is
507
+ // documented to become a fatal, unrecoverable crash under
508
+ // --force-node-api-uncaught-exceptions-policy once that
509
+ // policy's default flips.
510
+ try {
511
+ sub.handler(evt);
512
+ }
513
+ catch (err) {
514
+ console.error(`macula-ts pool: subscription handler for ${topic} threw:`, err);
515
+ }
516
+ }, {
517
+ realm,
518
+ onClosed: (err) => {
519
+ if (link.closing)
520
+ return; // already tearing down -- #scheduleReconnect would bail anyway, don't log a misleading "reconnecting"
521
+ if (link.session === session) {
522
+ console.error(`macula-ts pool: subscription to ${topic} on ${link.seed.host}:${link.seed.port} dropped (${err.message}) -- reconnecting`);
523
+ this.#scheduleReconnect(link);
524
+ }
525
+ else {
526
+ // subscribe-start hasn't resolved on this side yet (or
527
+ // this link has already moved on) -- flag it so
528
+ // #attachOnce notices once `onConnected` itself returns,
529
+ // rather than marking a link live with a subscription
530
+ // that already silently died. See closedDuringConnect's
531
+ // own doc.
532
+ link.closedDuringConnect = true;
533
+ }
534
+ },
535
+ });
536
+ };
537
+ sub.links = this.#seeds.map((seed) => this.#newRoleLink(seed, subIdentity, onConnected));
538
+ this.#subscriptions.set(key, sub);
539
+ await Promise.all(sub.links.map((link) => this.#attach(link)));
540
+ return async () => {
541
+ // Guards against a stale unsubscribe() firing (possibly a second
542
+ // time, which this SDK's own convention elsewhere treats as safe)
543
+ // after a newer subscription has since taken this same (realm,
544
+ // topic) key -- found live 2026-09-05: without this check, an
545
+ // old unsubscribe() tore down a DIFFERENT, newer subscription's
546
+ // links and deleted it from #subscriptions, silently stopping its
547
+ // handler with no error anywhere.
548
+ if (this.#subscriptions.get(key) !== sub)
549
+ return;
550
+ const tracked = sub;
551
+ this.#subscriptions.delete(key);
552
+ await Promise.all(tracked.links.map(async (link) => {
553
+ link.closing = true;
554
+ if (link.retryTimer)
555
+ clearTimeout(link.retryTimer);
556
+ if (link.inFlight)
557
+ await link.inFlight.catch(() => { });
558
+ if (link.pendingClose)
559
+ await link.pendingClose;
560
+ if (link.session)
561
+ await link.session.close(link.identity).catch(() => { });
562
+ }));
563
+ if (tracked.ownsIdentity)
564
+ tracked.identity.dispose();
565
+ };
566
+ }
567
+ /** Live/backing-off CONTROL link counts (publish/call reachability).
568
+ * Every configured seed is exactly one or the other. Per-topic
569
+ * subscription link health is not reflected here -- inspect a
570
+ * specific subscription's own behavior (events arriving or not)
571
+ * instead; exposing N independent per-topic health vectors here
572
+ * would not simplify what a caller actually needs to know. */
573
+ status() {
574
+ const healthy = this.#liveControlLinks().length;
575
+ return { healthyLinks: healthy, failedLinks: this.#controlLinks.length - healthy };
576
+ }
577
+ /** Closes every control and subscription link and disposes every
578
+ * identity this pool owns (the caller-supplied control identity
579
+ * included). Awaits each link's in-flight connect/reconnect first,
580
+ * so a still-connecting link never has its identity yanked out from
581
+ * under it. */
582
+ async close() {
583
+ if (this.#closed)
584
+ return;
585
+ this.#closed = true;
586
+ clearInterval(this.#sweepTimer);
587
+ const allLinks = [...this.#controlLinks, ...[...this.#subscriptions.values()].flatMap((s) => s.links)];
588
+ await Promise.all(allLinks.map(async (link) => {
589
+ link.closing = true;
590
+ if (link.retryTimer)
591
+ clearTimeout(link.retryTimer);
592
+ if (link.healthCheckTimer)
593
+ clearInterval(link.healthCheckTimer);
594
+ if (link.inFlight)
595
+ await link.inFlight.catch(() => { });
596
+ if (link.pendingClose)
597
+ await link.pendingClose;
598
+ if (link.session)
599
+ await link.session.close(link.identity).catch(() => { });
600
+ link.session = undefined;
601
+ link.status = "backoff"; // reflects reality for status()/#liveControlLinks() if either is called after close()
602
+ }));
603
+ for (const sub of this.#subscriptions.values())
604
+ if (sub.ownsIdentity)
605
+ sub.identity.dispose();
606
+ this.#subscriptions.clear();
607
+ this.#controlIdentity.dispose();
608
+ }
609
+ }
610
+ //# sourceMappingURL=pool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pool.js","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,0EAA0E;AAC1E,iEAAiE;AACjE,kEAAkE;AAClE,6EAA6E;AAC7E,0EAA0E;AAC1E,4EAA4E;AAC5E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C;QACvG,MAAM,OAAO,CAAC,GAAG,CACf,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;YAC1B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,IAAI,IAAI,CAAC,UAAU;gBAAE,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACnD,IAAI,IAAI,CAAC,gBAAgB;gBAAE,aAAa,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;YAChE,IAAI,IAAI,CAAC,QAAQ;gBAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YACvD,IAAI,IAAI,CAAC,YAAY;gBAAE,MAAM,IAAI,CAAC,YAAY,CAAC;YAC/C,IAAI,IAAI,CAAC,OAAO;gBAAE,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;YAC1E,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;YACzB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,sFAAsF;QACjH,CAAC,CAAC,CACH,CAAC;QACF,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE;YAAE,IAAI,GAAG,CAAC,YAAY;gBAAE,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QAC7F,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC5B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC;IAClC,CAAC;CACF"}
package/dist/session.d.ts CHANGED
@@ -31,6 +31,20 @@ export interface CallOptions {
31
31
  * provider serving under that same realm through some other means. */
32
32
  realm?: string;
33
33
  }
34
+ /** Decodes CallOptions.realm/PublishOptions.realm/SubscribeOptions.realm's
35
+ * public hex-string convention into the 32-byte Uint8Array native.*
36
+ * already accepts for its own `realm` parameter on sessionCall/
37
+ * sessionCallWithUcan/sessionPublish/sessionSubscribeStart -- cabi/rpc.go,
38
+ * cabi/pubsub.go, and addon/binding.cc were, on inspection, already fully
39
+ * wired for an optional realm all the way through (ReadOptionalRealm in
40
+ * binding.cc, realm32OrZero in cabi/main.go); this class's own methods
41
+ * were the only place still hardcoding `undefined`. Kept as a hex string
42
+ * at the PUBLIC surface specifically to match DhtRecord's existing
43
+ * convention, while reusing that already-working raw-byte plumbing
44
+ * beneath it unchanged, rather than re-threading the FFI boundary itself
45
+ * as a second, redundant string convention alongside it.
46
+ * `undefined` in, `undefined` out -- the all-zero-realm default. */
47
+ export declare function realmBytesFromHex(realm: string | undefined): Uint8Array | undefined;
34
48
  export declare class Session {
35
49
  #private;
36
50
  private constructor();
package/dist/session.js CHANGED
@@ -28,7 +28,7 @@ const REALM_HEX_PATTERN = /^[0-9a-fA-F]{64}$/;
28
28
  * beneath it unchanged, rather than re-threading the FFI boundary itself
29
29
  * as a second, redundant string convention alongside it.
30
30
  * `undefined` in, `undefined` out -- the all-zero-realm default. */
31
- function realmBytesFromHex(realm) {
31
+ export function realmBytesFromHex(realm) {
32
32
  if (realm === undefined)
33
33
  return undefined;
34
34
  if (!REALM_HEX_PATTERN.test(realm)) {
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,kEAAkE;AAClE,uEAAuE;AACvE,oEAAoE;AACpE,sEAAsE;AACtE,uBAAuB;AACvB,EAAE;AACF,sEAAsE;AACtE,qEAAqE;AACrE,uEAAuE;AACvE,sEAAsE;AACtE,QAAQ;AACR,OAAO,EAAE,MAAM,EAAe,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAiC,MAAM,UAAU,CAAC;AAI7E,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,aA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AM,EAAE,CAAC,CAAC;IACpF,CAAC;AACH,CAAC"}
package/dist/ucan.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ucan.js","sourceRoot":"","sources":["../src/ucan.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,qEAAqE;AACrE,wEAAwE;AACxE,qEAAqE;AACrE,kEAAkE;AAClE,yEAAyE;AACzE,0EAA0E;AAC1E,wEAAwE;AACxE,yEAAyE;AACzE,kEAAkE;AAClE,wEAAwE;AACxE,2DAA2D;AAC3D,oCAAoC;AACpC,EAAE;AACF,2DAA2D;AAC3D,yEAAyE;AACzE,wEAAwE;AACxE,sEAAsE;AACtE,4BAA4B;AAC5B,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,sEAAsE;AACtE,sEAAsE;AACtE,yEAAyE;AACzE,oEAAoE;AACpE,kEAAkE;AAClE,oEAAoE;AACpE,yEAAyE;AACzE,iEAAiE;AACjE,sEAAsE;AACtE,yEAAyE;AACzE,oEAAoE;AACpE,WAAW;AACX,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AA2DtC;;;;;;;;;;wEAUwE;AACxE,SAAS,aAAa,CAAC,MAAkB;IACvC,OAAO,cAAc,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;AAC7D,CAAC;AAED;;;;;;kBAMkB;AAClB,MAAM,OAAO,IAAI;IACf;;;mCAG+B;IACtB,KAAK,CAAS;IACvB;6EACyE;IAChE,MAAM,CAAS;IACxB;;mEAE+D;IACtD,QAAQ,CAAS;IACjB,YAAY,CAA4B;IACjD;0BACsB;IACb,SAAS,CAAgB;IAClC,0DAA0D;IACjD,SAAS,CAAgB;IAClC;;;+CAG2C;IAClC,KAAK,CAAS;IACvB,4CAA4C;IACnC,KAAK,CAAiD;IAC/D,wEAAwE;IAC/D,MAAM,CAAoB;IAEnC,YAAoB,KAAa,EAAE,OAAwB;QACzD,IAAI,CAA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5",
3
+ "version": "0.14.1",
4
4
  "description": "TypeScript SDK for the Macula mesh (FFI over macula-go)",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -46,7 +46,7 @@
46
46
  "build:prebuilds": "npm run build:go && prebuildify --napi --strip && npm pkg delete scripts.install",
47
47
  "build": "npm run build:addon:dev && tsc",
48
48
  "test": "vitest run",
49
- "test:live": "MACULA_TS_LIVE=1 vitest run src/session.live.test.ts src/rpc.live.test.ts src/dht.live.test.ts src/pubsub.live.test.ts src/content.live.test.ts src/ucan.live.test.ts src/directdial.live.test.ts",
49
+ "test:live": "MACULA_TS_LIVE=1 vitest run src/session.live.test.ts src/rpc.live.test.ts src/dht.live.test.ts src/pubsub.live.test.ts src/content.live.test.ts src/ucan.live.test.ts src/directdial.live.test.ts src/pool.live.test.ts",
50
50
  "typecheck": "tsc --noEmit"
51
51
  },
52
52
  "dependencies": {
@@ -54,11 +54,11 @@
54
54
  "node-gyp-build": "^4.8.4"
55
55
  },
56
56
  "devDependencies": {
57
- "@types/node": "^24.0.0",
57
+ "@types/node": "^24.13.3",
58
58
  "node-gyp": "^13.0.2",
59
59
  "prebuildify": "^6.0.1",
60
- "typescript": "^5.4.0",
61
- "vitest": "^3.2.7"
60
+ "typescript": "^7.0.2",
61
+ "vitest": "^5.0.0"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=24.18.1"