@macula-io/ts 0.15.0 → 0.17.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/README.md CHANGED
@@ -218,10 +218,10 @@ fixed) is in [CHANGELOG.md](CHANGELOG.md).
218
218
  `handler(payload)` for each (sync or async; `opts.bytes` as for
219
219
  `call()`). Resolves with an async
220
220
  `stop()` that unadvertises and waits for the current poll tick to
221
- finish. Only one `serve()` per `Session` at a time, and `call()`/
222
- `serve()` refuse to run concurrently on the same `Session` — both read
223
- frames off one shared control stream; open a second `Session` for the
224
- other role.
221
+ finish. Only one `serve()` per `Session` at a time, since a second would
222
+ answer CALLs meant for the first, and a `Session` takes one role at a
223
+ time: `call()` refuses while a `serve()` or `subscribe()` is active on
224
+ it. Open a second `Session` for the other role.
225
225
  - **DHT** — `session.findRecordsByType(recordType)`,
226
226
  `session.findRecords(key)`, `session.findRecord(key)`, and
227
227
  `session.putProcedureAdvertisement(procedure, servingStation, opts?)`/
@@ -243,8 +243,8 @@ fixed) is in [CHANGELOG.md](CHANGELOG.md).
243
243
  `subscribe()`d to.
244
244
  - **Content transfer** — `session.putContent(data, name?)` /
245
245
  `session.getContent(mcid)`, sent on their own dedicated QUIC stream
246
- (not the shared control stream, so they run safely alongside an active
247
- `serve()`/`subscribe()`). Data above 256 KiB is chunked and reassembled
246
+ (not the control stream, and outside the one-role rule, so they run
247
+ alongside an active `serve()`/`subscribe()`). Data above 256 KiB is chunked and reassembled
248
248
  automatically. `mcid` crosses the boundary as a lowercase hex string.
249
249
  **This is a one-time TRANSFER mechanism, not durable object storage** —
250
250
  a station may forget content after serving it, and there is no
@@ -253,17 +253,14 @@ fixed) is in [CHANGELOG.md](CHANGELOG.md).
253
253
  JWT-shaped, EdDSA-signed capability token, UCAN spec `"0.10.0"`) and
254
254
  `Ucan.decode(token)` (parses claims WITHOUT verifying signature or
255
255
  expiry — `Ucan#isExpired` mirrors macula-go's own semantics). Both are
256
- pure local operations, no network I/O. `issuer`/`audience` DID strings
257
- are `did:macula:<hex NodeID>`. `session.callWithUcan(procedure,
258
- payload, ucanToken, opts?)` attaches a token to an outgoing CALL, for
259
- invoking a procedure gated behind a provider-side `ucan.Policy.Required`
260
- policy. **Deliberately places no restriction relating the calling
261
- identity to the token's own `aud` claim** — macula's UCAN gate is a
262
- BEARER-token check (verifies signature + expiry against the issuer
263
- only, never the caller's identity against `aud`), so a client-side
264
- "does my identity match this token's audience" guard would both reject
265
- configurations the real wire-level gate accepts and misrepresent a
266
- security property the mesh doesn't enforce. This SDK does **not**
256
+ pure local operations, no network I/O. `issuer` is written as
257
+ `did:macula:<hex NodeID>` and `audience` as the audience NodeID in
258
+ lowercase hex. `session.callWithUcan(procedure, payload, ucanToken,
259
+ opts?)` attaches a token to an outgoing CALL, for invoking a procedure
260
+ gated behind a provider-side `ucan.Policy.Required` policy. A gated
261
+ provider accepts a token only from the caller its `aud` names, so mint
262
+ it for the identity that will present it; `callWithUcan` attaches
263
+ whatever token it is given. This SDK does **not**
267
264
  expose `ucan.Verify` or `ucan.Policy` — only minting, inspecting, and
268
265
  attaching a token are implemented; enforcing one is provider-side, out
269
266
  of scope here.
@@ -276,14 +273,18 @@ fixed) is in [CHANGELOG.md](CHANGELOG.md).
276
273
  to its serving station's own signed `station_endpoint`, then dials that
277
274
  station directly in one hop instead of depending on advertise-gossip
278
275
  having reached whichever station the caller happens to already be
279
- connected to. Trust is enforced at the application layer: the freshly
276
+ connected to. Every advertisement that verifies is a candidate:
277
+ `resolveDirect()` asks the DHT again until one's station endpoint
278
+ resolves, within `opts.deadlineMs` (10 s when unset), and `callDirect()`
279
+ moves on to the next candidate when a dial fails, within its own
280
+ `deadlineMs`. Trust is enforced at the application layer: the freshly
280
281
  connected peer's HELLO-proven identity is checked against the exact
281
282
  pubkey the signed DHT chain resolved. `advertiseDirect()` issues both a
282
283
  plain ADVERTISE and the signed DHT record on the same call — both are
283
284
  required for `resolveDirect()`+`callDirect()` to actually reach a live
284
285
  route. `resolveDirect`/`callDirect`/`callDirectWithUcan`/
285
- `advertiseDirect` share the same same-Session exclusivity guard as
286
- `call()`/the DHT methods; a long-lived provider that also serves the
286
+ `advertiseDirect` follow the same one-role rule as `call()`/the DHT
287
+ methods; a long-lived provider that also serves the
287
288
  same procedure needs a separate `Session` (and identity — this fleet
288
289
  enforces one connection per identity) to keep re-advertising on, which
289
290
  is why `keepAdvertisedDirect()` is a standalone function rather than a
@@ -331,7 +332,7 @@ slice of work built on top of a working `Session`.
331
332
 
332
333
  ```bash
333
334
  npx vitest run # default suite, no network
334
- 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
335
+ MACULA_TS_LIVE_STATION=<station host> MACULA_TS_LIVE_OTHER_STATION=<another station host> npm run test:live
335
336
  ```
336
337
 
337
338
  `src/session.live.test.ts`, `src/rpc.live.test.ts`, `src/dht.live.test.ts`,
@@ -343,9 +344,18 @@ explicitly, gated behind `MACULA_TS_LIVE`. Same convention as macula-go's
343
344
  `live` build tag, macula-rust's `#[ignore]`, and macula-dotnet's
344
345
  `[Trait("Category","Live")]`: real-network tests are written and
345
346
  runnable, just excluded from the default/CI run so a station outage doesn't
346
- make ordinary CI flaky. `.github/workflows/ci.yml` exposes this as a
347
- manually-triggered (`workflow_dispatch`) job, never run automatically on
348
- push/PR.
347
+ make ordinary CI flaky. `.github/workflows/live.yml` runs them when dispatched
348
+ by hand (`workflow_dispatch`), never on push or PR. Its two required inputs name
349
+ the stations, and it loads the committed linux-x64 prebuild, the same `.node`
350
+ file the npm package ships, after checking its sha256 against the commit.
351
+
352
+ A live run names its stations: `MACULA_TS_LIVE_STATION` is the host every live
353
+ test uses, and `MACULA_TS_LIVE_OTHER_STATION` is the second station the pool's
354
+ multi-station test connects to. Neither has a default. With `MACULA_TS_LIVE`
355
+ set, a station that isn't set, or that no session can be opened to, fails the
356
+ tests with a message naming its variable instead of skipping them. When
357
+ `MACULA_TS_LIVE_WAITS` names a file, each wait for a station to register an
358
+ ADVERTISE or SUBSCRIBE is also recorded there.
349
359
 
350
360
  ## Packaging: genuinely zero install-time scripts
351
361
 
package/dist/binding.d.ts CHANGED
@@ -40,7 +40,7 @@ export declare const native: {
40
40
  sessionSubscribeStop(subscriptionHandle: Handle): Promise<void>;
41
41
  contentPut(sessionHandle: Handle, identityHandle: Handle, data: Uint8Array, name: string): Promise<string>;
42
42
  contentGet(sessionHandle: Handle, identityHandle: Handle, mcidHex: string): Promise<Uint8Array | null>;
43
- directdialResolve(sessionHandle: Handle, identityHandle: Handle, realm: Uint8Array | undefined, procedure: string): Promise<string>;
43
+ directdialResolve(sessionHandle: Handle, identityHandle: Handle, realm: Uint8Array | undefined, procedure: string, timeoutMs: number): Promise<string>;
44
44
  directdialCall(sessionHandle: Handle, identityHandle: Handle, procedure: string, realm: Uint8Array | undefined, payloadJson: string, timeoutMs: number, bytesMode: number): Promise<string>;
45
45
  directdialCallWithUcan(sessionHandle: Handle, identityHandle: Handle, procedure: string, realm: Uint8Array | undefined, payloadJson: string, timeoutMs: number, ucanToken: string, bytesMode: number): Promise<string>;
46
46
  directdialAdvertise(sessionHandle: Handle, identityHandle: Handle, realm: Uint8Array | undefined, procedure: string, ttlMs: number): Promise<void>;
package/dist/binding.js CHANGED
@@ -117,8 +117,8 @@ export const native = {
117
117
  contentGet(sessionHandle, identityHandle, mcidHex) {
118
118
  return addon.contentGet(sessionHandle, identityHandle, mcidHex);
119
119
  },
120
- directdialResolve(sessionHandle, identityHandle, realm, procedure) {
121
- return addon.directdialResolve(sessionHandle, identityHandle, realm, procedure);
120
+ directdialResolve(sessionHandle, identityHandle, realm, procedure, timeoutMs) {
121
+ return addon.directdialResolve(sessionHandle, identityHandle, realm, procedure, timeoutMs);
122
122
  },
123
123
  directdialCall(sessionHandle, identityHandle, procedure, realm, payloadJson, timeoutMs, bytesMode) {
124
124
  return addon.directdialCall(sessionHandle, identityHandle, procedure, realm, payloadJson, timeoutMs, bytesMode);
@@ -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,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAErE,8DAA8D;AAC9D,MAAM,KAAK,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAuM/C,CAAC;AAQF,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,gBAAgB;QACd,OAAO,KAAK,CAAC,gBAAgB,EAAE,CAAC;IAClC,CAAC;IACD,qBAAqB,CAAC,MAAkB;QACtC,IAAI,MAAM,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,iDAAiD,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC;IACD,cAAc,CAAC,MAAc;QAC3B,OAAO,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACtC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ACjB,SAAiB;QAEjB,OAAO,KAAK,CAAC,cAAc,CAAC,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAClH,CAAC;IACD,sBAAsB,CACpB,aAAqB,EACrB,cAAsB,EACtB,SAAiB,EACjB,KAA6B,EAC7B,WAAmB,EACnB,SAAiB,EACjB,SAAiB,EACjB,SAAiB;QAEjB,OAAO,KAAK,CAAC,sBAAsB,CAAC,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IACrI,CAAC;IACD,mBAAmB,CACjB,aAAqB,EACrB,cAAsB,EACtB,KAA6B,EAC7B,SAAiB,EACjB,KAAa;QAEb,OAAO,KAAK,CAAC,mBAAmB,CAAC,aAAa,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC3F,CAAC;CACF,CAAC"}
package/dist/content.js CHANGED
@@ -1,13 +1,12 @@
1
1
  // Content transfer -- macula-go's content package (Put/Get), thin
2
2
  // CALL/RESULT wrappers to reserved `_content.*` procedures sent on
3
3
  // their OWN dedicated QUIC stream (Session.OpenDedicatedStream on the
4
- // Go side), NOT the shared control stream call()/serve()/the DHT
5
- // methods/subscribe() all read from -- see cabi/content.go's own doc
6
- // for why Session.putContent()/getContent() (session.ts) are, unlike
7
- // those, never subject to Session's same-Session exclusivity guard, and
8
- // why two concurrent putContent()/getContent() calls on one Session
9
- // don't race each other either (each gets its own fresh dedicated
10
- // stream).
4
+ // Go side), NOT the control stream call()/serve()/the DHT
5
+ // methods/subscribe() all use -- see cabi/content.go's own doc for why
6
+ // Session.putContent()/getContent() (session.ts) are, unlike those, never
7
+ // subject to Session's one-role rule, and why two concurrent
8
+ // putContent()/getContent() calls on one Session don't race each other
9
+ // either (each gets its own fresh dedicated stream).
11
10
  //
12
11
  // IMPORTANT: this is a one-time TRANSFER mechanism, not durable object
13
12
  // storage. A station may forget content after serving it, there is no
@@ -1 +1 @@
1
- {"version":3,"file":"content.js","sourceRoot":"","sources":["../src/content.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,mEAAmE;AACnE,sEAAsE;AACtE,iEAAiE;AACjE,qEAAqE;AACrE,qEAAqE;AACrE,wEAAwE;AACxE,oEAAoE;AACpE,kEAAkE;AAClE,WAAW;AACX,EAAE;AACF,uEAAuE;AACvE,sEAAsE;AACtE,gEAAgE;AAChE,qEAAqE;AACrE,wEAAwE;AACxE,uEAAuE;AACvE,wDAAwD;AACxD,EAAE;AACF,kEAAkE;AAClE,wEAAwE;AACxE,iEAAiE;AACjE,qEAAqE;AACrE,mEAAmE;AACnE,sEAAsE;AACtE,4BAA4B;AAE5B;;;;;;;sDAOsD;AACtD,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C;2CACuC;IAC9B,IAAI,CAAS;IAEtB,YAAY,IAAY;QACtB,KAAK,CAAC,wCAAwC,IAAI,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
1
+ {"version":3,"file":"content.js","sourceRoot":"","sources":["../src/content.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,mEAAmE;AACnE,sEAAsE;AACtE,0DAA0D;AAC1D,uEAAuE;AACvE,0EAA0E;AAC1E,6DAA6D;AAC7D,uEAAuE;AACvE,qDAAqD;AACrD,EAAE;AACF,uEAAuE;AACvE,sEAAsE;AACtE,gEAAgE;AAChE,qEAAqE;AACrE,wEAAwE;AACxE,uEAAuE;AACvE,wDAAwD;AACxD,EAAE;AACF,kEAAkE;AAClE,wEAAwE;AACxE,iEAAiE;AACjE,qEAAqE;AACrE,mEAAmE;AACnE,sEAAsE;AACtE,4BAA4B;AAE5B;;;;;;;sDAOsD;AACtD,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C;2CACuC;IAC9B,IAAI,CAAS;IAEtB,YAAY,IAAY;QACtB,KAAK,CAAC,wCAAwC,IAAI,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
@@ -62,9 +62,9 @@ export interface KeepAdvertisedDirectOptions extends AdvertiseDirectOptions {
62
62
  * long-lived provider needs to call `AdvertiseDirect` again on its own
63
63
  * schedule, and it is this function's CALLER's job to decide WHICH
64
64
  * Session that runs on. See `Session.advertiseDirect()`'s own doc for why
65
- * that must NOT be a Session with an active `serve()` on it
66
- * (`advertiseDirect()`'s own `PutRecord` CALL would race `serve()`'s own
67
- * reads of the same shared control stream): a long-lived provider that
65
+ * that must NOT be a Session with an active `serve()` on it (a Session
66
+ * takes one role at a time, and `advertiseDirect()`'s own `PutRecord` is a
67
+ * CALL): a long-lived provider that
68
68
  * also serves `procedure` needs a SEPARATE Session (and identity -- this
69
69
  * fleet enforces one connection per identity, kicking whichever connects
70
70
  * second) for that, passed here instead of the serving Session.
@@ -37,9 +37,9 @@ export const KEEP_ADVERTISED_DIRECT_INTERVAL_MS = 15 * 60 * 1000;
37
37
  * long-lived provider needs to call `AdvertiseDirect` again on its own
38
38
  * schedule, and it is this function's CALLER's job to decide WHICH
39
39
  * Session that runs on. See `Session.advertiseDirect()`'s own doc for why
40
- * that must NOT be a Session with an active `serve()` on it
41
- * (`advertiseDirect()`'s own `PutRecord` CALL would race `serve()`'s own
42
- * reads of the same shared control stream): a long-lived provider that
40
+ * that must NOT be a Session with an active `serve()` on it (a Session
41
+ * takes one role at a time, and `advertiseDirect()`'s own `PutRecord` is a
42
+ * CALL): a long-lived provider that
43
43
  * also serves `procedure` needs a SEPARATE Session (and identity -- this
44
44
  * fleet enforces one connection per identity, kicking whichever connects
45
45
  * second) for that, passed here instead of the serving Session.
package/dist/pool.js CHANGED
@@ -15,24 +15,22 @@
15
15
  // Erlang's macula_client can put N tracked (Realm, Topic) subscriptions
16
16
  // (plus Call, plus Advertise) on ONE gen_server-owned link, because a BEAM
17
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.
18
+ // many concerns it's juggling. This SDK's Session takes one role at a time:
19
+ // `subscribe()` throws outright if called twice on the same Session, and
20
+ // `call()`/`serve()` refuse to run beside an active subscribe on the same
21
+ // Session. The rule dates from macula-go's FrameStream doing a raw
22
+ // sequential read into a shared buffer with no per-caller demux (confirmed
23
+ // live 2026-09-04). macula-go v0.10.0, which this release embeds, routes
24
+ // each reply and event on one reader, but Session keeps its one-role rule
25
+ // in this release, so a pool link is still built around it -- as
26
+ // macula-mcp's lobby_observer.ts is, with a dedicated identity+Session PER
27
+ // ROOM TOPIC rather than multiplexing one connection.
30
28
  //
31
29
  // So a "link" to one station here is a small SET of role-scoped sessions,
32
30
  // not one session:
33
31
  // - one "control" session (this pool's own caller-supplied identity),
34
32
  // used for publish() and call() and NEVER subscribed on -- publish() is
35
- // write-only (explicitly unguarded by the exclusivity rule) and call()'s
33
+ // write-only (explicitly outside the one-role rule) and call()'s
36
34
  // own internal queue already serialises concurrent calls safely, so one
37
35
  // control session per station is enough regardless of call volume.
38
36
  // - one additional session PER CURRENTLY-TRACKED TOPIC, under an identity
@@ -45,8 +43,8 @@
45
43
  // backoff; a topic session dying just re-subscribes its own one topic on
46
44
  // respawn (no "replay N subscriptions onto a survivor" step needed, since
47
45
  // 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
46
+ // liveness-only subscribe without breaking the one-role rule it exists to
47
+ // keep, and a failed call() genuinely does surface a dead
50
48
  // connection -- but publish() does not: found live 2026-09-04 that a
51
49
  // publish() attempt on a session the station had already kicked can still
52
50
  // locally "succeed" (the frame is handed off before the QUIC stack notices
package/dist/pool.js.map CHANGED
@@ -1 +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,8EAA8E;AAC9E,4EAA4E;AAC5E,yEAAyE;AACzE,SAAS;AACT,EAAE;AACF,8CAA8C;AAC9C,EAAE;AACF,wEAAwE;AACxE,2EAA2E;AAC3E,4EAA4E;AAC5E,yEAAyE;AACzE,sEAAsE;AACtE,oEAAoE;AACpE,sEAAsE;AACtE,0EAA0E;AAC1E,wEAAwE;AACxE,4EAA4E;AAC5E,4EAA4E;AAC5E,0EAA0E;AAC1E,8EAA8E;AAC9E,2EAA2E;AAC3E,cAAc;AACd,EAAE;AACF,0EAA0E;AAC1E,mBAAmB;AACnB,wEAAwE;AACxE,4EAA4E;AAC5E,6EAA6E;AAC7E,4EAA4E;AAC5E,uEAAuE;AACvE,4EAA4E;AAC5E,0EAA0E;AAC1E,2EAA2E;AAC3E,0EAA0E;AAC1E,uEAAuE;AACvE,oCAAoC;AACpC,4EAA4E;AAC5E,yEAAyE;AACzE,0EAA0E;AAC1E,yEAAyE;AACzE,2EAA2E;AAC3E,qEAAqE;AACrE,qEAAqE;AACrE,0EAA0E;AAC1E,2EAA2E;AAC3E,mEAAmE;AACnE,uEAAuE;AACvE,gEAAg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Q;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
@@ -117,13 +117,10 @@ export declare class Session {
117
117
  *
118
118
  * Real network I/O -- a signed frame out and a wait for the reply,
119
119
  * up to opts.deadlineMs -- so this runs off the main thread on the
120
- * native side, like connect()/close(). Do not call this
121
- * concurrently with an active serve() on the SAME Session: both read
122
- * frames off the one shared control stream, and macula-go's own
123
- * ServeOneCall/Call docs both warn that mixing roles on one
124
- * connection races (an unrelated frame arriving first is discarded,
125
- * not queued) -- open a second Session for the other role instead,
126
- * exactly what this SDK's own live test does. */
120
+ * native side, like connect()/close(). Rejects while a serve() or
121
+ * subscribe() is active on the SAME Session (#requireHandleNotServing):
122
+ * a Session takes one role at a time, so open a second Session for the
123
+ * other role, exactly what this SDK's own live test does. */
127
124
  call(procedure: string, payload: JsonValue, opts?: CallOptions): Promise<JsonValue>;
128
125
  /** Caller role: call(), attaching `ucanToken` to the outgoing CALL
129
126
  * (macula-go's `connection.Session.CallWithUCAN`) -- for invoking a
@@ -150,9 +147,8 @@ export declare class Session {
150
147
  * security property that isn't actually enforced.
151
148
  *
152
149
  * Real network I/O, off the main thread on the native side, and
153
- * subject to the identical same-Session exclusivity rule as `call()`
154
- * (`#requireHandleNotServing`) -- both end up on the same shared
155
- * control stream. */
150
+ * subject to the same one-role check as `call()`
151
+ * (`#requireHandleNotServing`). */
156
152
  callWithUcan(procedure: string, payload: JsonValue, ucanToken: string | Ucan, opts?: CallOptions): Promise<JsonValue>;
157
153
  /** Provider role: advertises `procedure` (macula-go's
158
154
  * connection.Session.Advertise) and answers inbound CALLs against it
@@ -166,11 +162,15 @@ export declare class Session {
166
162
  * between this and the JS handler) would map to
167
163
  * TemporaryRelayFailure, per that same file.
168
164
  *
169
- * Only one serve() registration is allowed per Session at a time --
170
- * see call()'s own doc on why mixing roles (or two server loops) on
171
- * one connection is unsafe, not just inadvisable; open a second
172
- * Session for a second procedure instead of trying to serve two
173
- * procedures off one.
165
+ * Only one serve() registration is allowed per Session at a time: each
166
+ * poll tick takes the next inbound CALL from the session's one queue
167
+ * (macula-go's ServeOneCall) and answers a CALL for a procedure it
168
+ * doesn't serve with unknown_next_peer, so a second serve() would answer
169
+ * CALLs meant for the first. Open a second Session for a second
170
+ * procedure instead of trying to serve two procedures off one. serve()
171
+ * also refuses while a subscribe() is active on the same Session, and
172
+ * call()/the DHT methods refuse while a serve() is (the one-role rule,
173
+ * #requireHandleNotServing).
174
174
  *
175
175
  * `opts.bytes` picks how bytes in each inbound CALL's payload reach
176
176
  * `handler`: "hex" (the default) or "tagged" (rpc.ts's BytesOutput).
@@ -194,9 +194,9 @@ export declare class Session {
194
194
  * signature or checks its expiry -- see DhtRecord's own doc (dht.ts).
195
195
  *
196
196
  * Real network I/O, off the main thread on the native side, exactly
197
- * like call() -- and subject to the same same-Session exclusivity
198
- * rule as call() (see #requireHandleNotServing's own doc): do not
199
- * call this while serve() is active on the same Session. */
197
+ * like call() -- and subject to the same one-role rule as call() (see
198
+ * #requireHandleNotServing's own doc): it refuses while a serve() or
199
+ * subscribe() is active on the same Session. */
200
200
  findRecordsByType(recordType: DhtRecordType | number): Promise<DhtRecord[]>;
201
201
  /** DHT: returns every record stored at `key` -- the full
202
202
  * signer-deduped multiset at that storage key (macula-go's
@@ -204,14 +204,14 @@ export declare class Session {
204
204
  * procedure, not just the first one found. `key` must be exactly 32
205
205
  * bytes -- see dht/record.go's ProcedureKey/StationEndpointKey/
206
206
  * ContentKey (macula-go) for how those are derived from the thing
207
- * being looked up. Same I/O and exclusivity notes as
207
+ * being looked up. Same I/O and one-role notes as
208
208
  * findRecordsByType(). */
209
209
  findRecords(key: Uint8Array): Promise<DhtRecord[]>;
210
210
  /** DHT: returns ONE record by storage key (macula-go's
211
211
  * dht.FindRecord). Resolves `null` when none exists -- mirrors
212
212
  * macula-go's own dht.ErrNotFound, translated to a value instead of a
213
213
  * thrown error since "not found" is an expected, routine outcome
214
- * here, not exceptional. Same I/O and exclusivity notes as
214
+ * here, not exceptional. Same I/O and one-role notes as
215
215
  * findRecordsByType(). */
216
216
  findRecord(key: Uint8Array): Promise<DhtRecord | null>;
217
217
  /** DHT: builds the realm-qualified discovery URI (macula-go's
@@ -248,7 +248,7 @@ export declare class Session {
248
248
  * silently becomes CBOR text. Typed arguments rule that mistake out
249
249
  * (see DhtRecord's own doc). `ttlMs` defaults to DHT_DEFAULT_TTL_MS
250
250
  * (48h). Resolves with the signed record actually stored. Same I/O
251
- * and exclusivity notes as findRecordsByType(). */
251
+ * and one-role notes as findRecordsByType(). */
252
252
  putProcedureAdvertisement(procedure: string, servingStation: Uint8Array, opts?: {
253
253
  realm?: Uint8Array;
254
254
  ttlMs?: number;
@@ -261,17 +261,18 @@ export declare class Session {
261
261
  * own doc for wrapping macula-go's real constructor instead of a
262
262
  * generic JSON-payload builder (announcer_node/mcid are the same kind
263
263
  * of raw-byte field). `ttlMs` defaults to DHT_DEFAULT_TTL_MS (48h).
264
- * Same I/O and exclusivity notes as findRecordsByType(). */
264
+ * Same I/O and one-role notes as findRecordsByType(). */
265
265
  putContentAnnouncement(mcid: Uint8Array, endpoint: string, ttlMs?: number): Promise<DhtRecord>;
266
266
  /** Direct-dial (caller side): finds `procedure`'s currently-advertised
267
267
  * serving station and its dialable host/port (macula-go's
268
268
  * `directdial.Resolve`), via this Session used only to query the DHT
269
269
  * -- it does not need to be connected to the station that ends up
270
- * serving `procedure`. Retries past DHT propagation lag internally (up
271
- * to ~5s, macula-go's own fixed schedule, not configurable here); a
272
- * `procedure` nobody ever called `advertiseDirect()` for rejects
273
- * cleanly after that window (a plain `Error` wrapping macula-go's
274
- * `ErrProcedureNotAdvertised`), never a hang.
270
+ * serving `procedure`. Every advertisement that verifies is a
271
+ * candidate, and the DHT is asked again until one's station endpoint
272
+ * resolves or `opts.deadlineMs` passes (10 s when unset, macula-go's
273
+ * `directdial.DefaultResolveTimeout`); a `procedure` nobody ever called
274
+ * `advertiseDirect()` for rejects once that time is up (a plain `Error`
275
+ * wrapping macula-go's `ErrProcedureNotAdvertised`), never a hang.
275
276
  *
276
277
  * `opts.realm` must match whatever realm `procedure` was
277
278
  * `advertiseDirect()`d under, or the discovery URI the two sides
@@ -283,10 +284,11 @@ export declare class Session {
283
284
  * diagnostics).
284
285
  *
285
286
  * Real network I/O, off the main thread on the native side, subject to
286
- * the same same-Session exclusivity rule as `call()`/the DHT methods
287
+ * the same one-role rule as `call()`/the DHT methods
287
288
  * (`#requireHandleNotServing`). */
288
289
  resolveDirect(procedure: string, opts?: {
289
290
  realm?: string;
291
+ deadlineMs?: number;
290
292
  }): Promise<DirectDialTarget>;
291
293
  /** Direct-dial (caller side): resolves `procedure`'s provider (via
292
294
  * `resolveDirect()`, through this Session) and calls it there, in one
@@ -307,9 +309,9 @@ export declare class Session {
307
309
  *
308
310
  * Real network I/O (DHT lookups, a fresh QUIC dial, then the CALL
309
311
  * itself) -- off the main thread on the native side, subject to the
310
- * same same-Session exclusivity rule as `call()` for THIS Session's own
311
- * DHT-querying use (the separate dialed connection this opens
312
- * internally is not this Session and is never exposed as one). */
312
+ * same one-role rule as `call()` for THIS Session's own DHT-querying use
313
+ * (the separate dialed connection this opens internally is not this
314
+ * Session and is never exposed as one). */
313
315
  callDirect(procedure: string, payload: JsonValue, opts?: CallOptions): Promise<JsonValue>;
314
316
  /** Direct-dial (caller side): `callDirect()`, attaching `ucanToken` to
315
317
  * the outgoing CALL (macula-go's `directdial.CallWithUCAN`) -- for
@@ -322,7 +324,7 @@ export declare class Session {
322
324
  * method's and ucan.ts's own doc for why: macula's UCAN gate is a
323
325
  * bearer-token check, not an audience match).
324
326
  *
325
- * Same I/O and exclusivity notes as `callDirect()`. */
327
+ * Same I/O and one-role notes as `callDirect()`. */
326
328
  callDirectWithUcan(procedure: string, payload: JsonValue, ucanToken: string | Ucan, opts?: CallOptions): Promise<JsonValue>;
327
329
  /** Direct-dial (provider side): publishes `procedure` as
328
330
  * direct-dial-reachable at THIS Session's own currently-connected
@@ -349,10 +351,8 @@ export declare class Session {
349
351
  *
350
352
  * **Must NOT be called on a Session that is also actively
351
353
  * `serve()`-ing** -- enforced by the same `#requireHandleNotServing`
352
- * guard `call()`/the DHT methods use, for the identical reason: this
353
- * method's own `PutRecord` CALL reads a RESULT off the same shared
354
- * control stream `serve()`'s poll loop is also reading, and the two
355
- * would race (matches `directdial.AdvertiseDirect`'s own doc). A
354
+ * one-role check `call()`/the DHT methods use, since this method's own
355
+ * `PutRecord` is a CALL. A
356
356
  * provider that also serves `procedure` needs a SEPARATE Session (and
357
357
  * identity -- this fleet enforces one connection per identity, kicking
358
358
  * whichever connects second) to call this on.
@@ -373,13 +373,11 @@ export declare class Session {
373
373
  * observes a subscriber's own publish arriving back at it rather than
374
374
  * asserting it as a hard guarantee, for the same reason).
375
375
  *
376
- * Deliberately NOT guarded by the same-Session exclusivity rule
377
- * call()/serve()/subscribe()/the DHT methods share (see
378
- * #requireHandleNotServing's own doc) -- publish() only ever writes,
379
- * never reads off the shared control stream, so it does not race a
380
- * concurrent serve()/subscribe() the way those do, and can run safely
381
- * on the SAME Session a subscribe() of its own is active on -- exactly
382
- * what a subscriber publishing to (and receiving) its own topic needs.
376
+ * Deliberately NOT subject to the one-role rule call()/serve()/
377
+ * subscribe()/the DHT methods share (see #requireHandleNotServing's own
378
+ * doc) -- publish() only ever writes, so it runs on the SAME Session a
379
+ * subscribe() of its own is active on -- exactly what a subscriber
380
+ * publishing to (and receiving) its own topic needs.
383
381
  *
384
382
  * `opts.realm` (see CallOptions.realm's own doc for the hex-string
385
383
  * format and exact-match semantics) scopes which realm this EVENT is
@@ -392,21 +390,18 @@ export declare class Session {
392
390
  * here. */
393
391
  publish(topic: string, payload: JsonValue, opts?: PublishOptions): Promise<void>;
394
392
  /** Pubsub: sends a signed SUBSCRIBE for `topic`, then delivers every
395
- * inbound EVENT for it to `handler` -- macula-go's own
396
- * connection.Session.RunSubscriber (connection/subscriber.go) drives
397
- * the actual read loop on the Go side, in a background goroutine, NOT
398
- * reimplemented on top of a hand-rolled poll here (see cabi/pubsub.go's
399
- * own doc for why RunSubscriber specifically, over the lower-level
400
- * RecvEvent). Delivery is Go-driven, not JS-driven: unlike serve()'s
393
+ * inbound EVENT for it to `handler` -- a background goroutine on the Go
394
+ * side reads the macula-go connection.Subscription that SUBSCRIBE
395
+ * opened (see cabi/pubsub.go's own doc for why the SUBSCRIBE goes out
396
+ * before that goroutine starts). Delivery is Go-driven, not JS-driven:
397
+ * unlike serve()'s
401
398
  * poll loop, nothing on this side calls into the native layer
402
399
  * repeatedly to ask "did anything arrive yet" -- the addon calls INTO
403
400
  * this handler asynchronously, via a Napi::ThreadSafeFunction wired to
404
401
  * that background goroutine, whenever an EVENT actually shows up.
405
402
  *
406
403
  * Only one subscribe() (and no active serve()) is allowed per Session
407
- * at a time -- same reasoning as serve()'s own one-at-a-time rule
408
- * (#requireHandleNotServing's own doc): the background reader and any
409
- * other read off this Session's shared control stream would race.
404
+ * at a time -- the one-role rule (#requireHandleNotServing's own doc).
410
405
  * Open a second Session for a second topic (or to serve/call
411
406
  * concurrently) instead.
412
407
  *
@@ -441,8 +436,8 @@ export declare class Session {
441
436
  subscribe(topic: string, handler: (evt: PubsubEvent) => void, opts?: SubscribeOptions): Promise<() => Promise<void>>;
442
437
  /** Content transfer: stores `data` (macula-go's content.Put, on this
443
438
  * Session's own fresh dedicated QUIC stream -- Session.
444
- * OpenDedicatedStream on the Go side, NOT the shared control stream
445
- * call()/serve()/the DHT methods/subscribe() all read from), chunking
439
+ * OpenDedicatedStream on the Go side, NOT the control stream
440
+ * call()/serve()/the DHT methods/subscribe() all use), chunking
446
441
  * automatically above manifest.DefaultChunkSize (256 KiB) and
447
442
  * returning the hex-encoded mcid it's now addressable by. `name` is
448
443
  * used ONLY on the chunked path (attached to the resulting manifest)
@@ -453,12 +448,11 @@ export declare class Session {
453
448
  * station may forget this content later, and there is no list/delete
454
449
  * operation. Treat this as "hand these bytes to a peer once."
455
450
  *
456
- * Because Put opens its own dedicated stream instead of reading the
457
- * shared control stream, this is, unlike call()/serve()/the DHT
458
- * methods/subscribe(), never subject to Session's same-Session
459
- * exclusivity guard (#requireHandleNotServing) -- it can run
460
- * concurrently with an active serve()/subscribe() (or another
461
- * putContent()/getContent()) on the same Session without racing.
451
+ * Because Put opens its own dedicated stream, this is, unlike call()/
452
+ * serve()/the DHT methods/subscribe(), never subject to Session's
453
+ * one-role rule (#requireHandleNotServing) -- it can run concurrently
454
+ * with an active serve()/subscribe() (or another putContent()/
455
+ * getContent()) on the same Session.
462
456
  *
463
457
  * Real network I/O (one or more signed CALLs on the new stream) --
464
458
  * runs off the main thread on the native side, like every other
@@ -480,8 +474,8 @@ export declare class Session {
480
474
  * (a bad session, a malformed mcid, a real transport error) rejects
481
475
  * with a plain Error instead.
482
476
  *
483
- * Same dedicated-stream, no-exclusivity-guard reasoning as
484
- * putContent() -- safe alongside an active serve()/subscribe() on the
485
- * same Session. Real network I/O, runs off the main thread. */
477
+ * Not subject to the one-role rule, for the same dedicated-stream
478
+ * reason as putContent() -- safe alongside an active serve()/subscribe()
479
+ * on the same Session. Real network I/O, runs off the main thread. */
486
480
  getContent(mcid: string): Promise<Uint8Array>;
487
481
  }