@naylence/runtime 0.3.5-test.951 → 0.3.5-test.953

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.
@@ -98,12 +98,12 @@ installProcessEnvShim();
98
98
  // --- END ENV SHIM ---
99
99
 
100
100
  // This file is auto-generated during build - do not edit manually
101
- // Generated from package.json version: 0.3.5-test.951
101
+ // Generated from package.json version: 0.3.5-test.953
102
102
  /**
103
103
  * The package version, injected at build time.
104
104
  * @internal
105
105
  */
106
- const VERSION = '0.3.5-test.951';
106
+ const VERSION = '0.3.5-test.953';
107
107
 
108
108
  /**
109
109
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -10381,6 +10381,24 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10381
10381
  });
10382
10382
  }
10383
10383
  }
10384
+ /**
10385
+ * Update the remote node ID after learning it from NodeAttachAck
10386
+ * This allows upstream connectors to switch from wildcard to specific addressing
10387
+ */
10388
+ updateRemoteNodeId(newRemoteNodeId) {
10389
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
10390
+ throw new Error('Invalid remote node ID');
10391
+ }
10392
+ const oldValue = this.remoteNodeId;
10393
+ this.remoteNodeId = newRemoteNodeId.trim();
10394
+ logger$_.debug('broadcast_channel_connector_remote_node_id_updated', {
10395
+ channel: this.channelName,
10396
+ connector_id: this.connectorId,
10397
+ local_node_id: this.localNodeId,
10398
+ old_remote_node_id: oldValue,
10399
+ new_remote_node_id: this.remoteNodeId,
10400
+ });
10401
+ }
10384
10402
  _trimSeenAcks(now) {
10385
10403
  while (this.seenAckOrder.length > 0) {
10386
10404
  const candidate = this.seenAckOrder[0];
@@ -12844,6 +12862,20 @@ class DefaultNodeAttachClient {
12844
12862
  if (!targetSystemId) {
12845
12863
  throw new Error('Target system ID must be set in NodeAttachAckFrame on success');
12846
12864
  }
12865
+ // Update connector's remote node ID if it supports it (e.g., BroadcastChannelConnector, InPageConnector)
12866
+ // This allows upstream connectors to switch from wildcard '*' to specific node addressing
12867
+ const updatableConnector = connector;
12868
+ if (typeof updatableConnector.updateRemoteNodeId === 'function') {
12869
+ try {
12870
+ updatableConnector.updateRemoteNodeId(targetSystemId);
12871
+ }
12872
+ catch (error) {
12873
+ logger$W.debug('connector_remote_node_id_update_failed', {
12874
+ target_system_id: targetSystemId,
12875
+ error: error instanceof Error ? error.message : String(error),
12876
+ });
12877
+ }
12878
+ }
12847
12879
  try {
12848
12880
  if (this.replicaStickinessManager) {
12849
12881
  this.replicaStickinessManager.accept(ackFrame.stickiness ?? null);
@@ -20856,6 +20888,24 @@ class InPageConnector extends BaseAsyncConnector {
20856
20888
  }
20857
20889
  return rawOrEnvelope;
20858
20890
  }
20891
+ /**
20892
+ * Update the remote node ID after learning it from NodeAttachAck
20893
+ * This allows upstream connectors to switch from wildcard to specific addressing
20894
+ */
20895
+ updateRemoteNodeId(newRemoteNodeId) {
20896
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
20897
+ throw new Error('Invalid remote node ID');
20898
+ }
20899
+ const oldValue = this.remoteNodeId;
20900
+ this.remoteNodeId = newRemoteNodeId.trim();
20901
+ logger$G.debug('inpage_connector_remote_node_id_updated', {
20902
+ channel: this.channelName,
20903
+ connector_id: this.connectorId,
20904
+ local_node_id: this.localNodeId,
20905
+ old_remote_node_id: oldValue,
20906
+ new_remote_node_id: this.remoteNodeId,
20907
+ });
20908
+ }
20859
20909
  }
20860
20910
 
20861
20911
  const RPC_REGISTRY = Symbol('naylence.rpc.registry');
@@ -30187,8 +30237,10 @@ class BroadcastChannelListener extends TransportListener {
30187
30237
  // Try to unwrap as transport frame
30188
30238
  const frame = unwrapTransportFrame(record.payload);
30189
30239
  if (frame) {
30190
- // Apply listener's filtering policy: dst must match, src can be anything
30191
- if (frame.dst === this._routingNode.id) {
30240
+ // Apply listener's filtering policy: accept frames addressed to us OR with wildcard destination
30241
+ // Wildcard is needed because downstream nodes don't know the sentinel's ID during initial attach
30242
+ const isAddressedToUs = frame.dst === this._routingNode.id || frame.dst === '*';
30243
+ if (isAddressedToUs) {
30192
30244
  envelopePayload = frame.payload;
30193
30245
  logger$o.debug('broadcast_channel_listener_unwrapped_transport_frame', {
30194
30246
  sender_id: senderId,
@@ -30197,7 +30249,7 @@ class BroadcastChannelListener extends TransportListener {
30197
30249
  });
30198
30250
  }
30199
30251
  else {
30200
- // Frame not addressed to us, ignore it
30252
+ // Frame addressed to a different node, ignore it
30201
30253
  logger$o.debug('broadcast_channel_listener_ignored_frame_wrong_destination', {
30202
30254
  sender_id: senderId,
30203
30255
  dst: frame.dst,
@@ -96,12 +96,12 @@ installProcessEnvShim();
96
96
  // --- END ENV SHIM ---
97
97
 
98
98
  // This file is auto-generated during build - do not edit manually
99
- // Generated from package.json version: 0.3.5-test.951
99
+ // Generated from package.json version: 0.3.5-test.953
100
100
  /**
101
101
  * The package version, injected at build time.
102
102
  * @internal
103
103
  */
104
- const VERSION = '0.3.5-test.951';
104
+ const VERSION = '0.3.5-test.953';
105
105
 
106
106
  /**
107
107
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -10379,6 +10379,24 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10379
10379
  });
10380
10380
  }
10381
10381
  }
10382
+ /**
10383
+ * Update the remote node ID after learning it from NodeAttachAck
10384
+ * This allows upstream connectors to switch from wildcard to specific addressing
10385
+ */
10386
+ updateRemoteNodeId(newRemoteNodeId) {
10387
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
10388
+ throw new Error('Invalid remote node ID');
10389
+ }
10390
+ const oldValue = this.remoteNodeId;
10391
+ this.remoteNodeId = newRemoteNodeId.trim();
10392
+ logger$_.debug('broadcast_channel_connector_remote_node_id_updated', {
10393
+ channel: this.channelName,
10394
+ connector_id: this.connectorId,
10395
+ local_node_id: this.localNodeId,
10396
+ old_remote_node_id: oldValue,
10397
+ new_remote_node_id: this.remoteNodeId,
10398
+ });
10399
+ }
10382
10400
  _trimSeenAcks(now) {
10383
10401
  while (this.seenAckOrder.length > 0) {
10384
10402
  const candidate = this.seenAckOrder[0];
@@ -12842,6 +12860,20 @@ class DefaultNodeAttachClient {
12842
12860
  if (!targetSystemId) {
12843
12861
  throw new Error('Target system ID must be set in NodeAttachAckFrame on success');
12844
12862
  }
12863
+ // Update connector's remote node ID if it supports it (e.g., BroadcastChannelConnector, InPageConnector)
12864
+ // This allows upstream connectors to switch from wildcard '*' to specific node addressing
12865
+ const updatableConnector = connector;
12866
+ if (typeof updatableConnector.updateRemoteNodeId === 'function') {
12867
+ try {
12868
+ updatableConnector.updateRemoteNodeId(targetSystemId);
12869
+ }
12870
+ catch (error) {
12871
+ logger$W.debug('connector_remote_node_id_update_failed', {
12872
+ target_system_id: targetSystemId,
12873
+ error: error instanceof Error ? error.message : String(error),
12874
+ });
12875
+ }
12876
+ }
12845
12877
  try {
12846
12878
  if (this.replicaStickinessManager) {
12847
12879
  this.replicaStickinessManager.accept(ackFrame.stickiness ?? null);
@@ -20854,6 +20886,24 @@ class InPageConnector extends BaseAsyncConnector {
20854
20886
  }
20855
20887
  return rawOrEnvelope;
20856
20888
  }
20889
+ /**
20890
+ * Update the remote node ID after learning it from NodeAttachAck
20891
+ * This allows upstream connectors to switch from wildcard to specific addressing
20892
+ */
20893
+ updateRemoteNodeId(newRemoteNodeId) {
20894
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
20895
+ throw new Error('Invalid remote node ID');
20896
+ }
20897
+ const oldValue = this.remoteNodeId;
20898
+ this.remoteNodeId = newRemoteNodeId.trim();
20899
+ logger$G.debug('inpage_connector_remote_node_id_updated', {
20900
+ channel: this.channelName,
20901
+ connector_id: this.connectorId,
20902
+ local_node_id: this.localNodeId,
20903
+ old_remote_node_id: oldValue,
20904
+ new_remote_node_id: this.remoteNodeId,
20905
+ });
20906
+ }
20857
20907
  }
20858
20908
 
20859
20909
  const RPC_REGISTRY = Symbol('naylence.rpc.registry');
@@ -30185,8 +30235,10 @@ class BroadcastChannelListener extends TransportListener {
30185
30235
  // Try to unwrap as transport frame
30186
30236
  const frame = unwrapTransportFrame(record.payload);
30187
30237
  if (frame) {
30188
- // Apply listener's filtering policy: dst must match, src can be anything
30189
- if (frame.dst === this._routingNode.id) {
30238
+ // Apply listener's filtering policy: accept frames addressed to us OR with wildcard destination
30239
+ // Wildcard is needed because downstream nodes don't know the sentinel's ID during initial attach
30240
+ const isAddressedToUs = frame.dst === this._routingNode.id || frame.dst === '*';
30241
+ if (isAddressedToUs) {
30190
30242
  envelopePayload = frame.payload;
30191
30243
  logger$o.debug('broadcast_channel_listener_unwrapped_transport_frame', {
30192
30244
  sender_id: senderId,
@@ -30195,7 +30247,7 @@ class BroadcastChannelListener extends TransportListener {
30195
30247
  });
30196
30248
  }
30197
30249
  else {
30198
- // Frame not addressed to us, ignore it
30250
+ // Frame addressed to a different node, ignore it
30199
30251
  logger$o.debug('broadcast_channel_listener_ignored_frame_wrong_destination', {
30200
30252
  sender_id: senderId,
30201
30253
  dst: frame.dst,
@@ -492,6 +492,24 @@ class BroadcastChannelConnector extends base_async_connector_js_1.BaseAsyncConne
492
492
  });
493
493
  }
494
494
  }
495
+ /**
496
+ * Update the remote node ID after learning it from NodeAttachAck
497
+ * This allows upstream connectors to switch from wildcard to specific addressing
498
+ */
499
+ updateRemoteNodeId(newRemoteNodeId) {
500
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
501
+ throw new Error('Invalid remote node ID');
502
+ }
503
+ const oldValue = this.remoteNodeId;
504
+ this.remoteNodeId = newRemoteNodeId.trim();
505
+ logger.debug('broadcast_channel_connector_remote_node_id_updated', {
506
+ channel: this.channelName,
507
+ connector_id: this.connectorId,
508
+ local_node_id: this.localNodeId,
509
+ old_remote_node_id: oldValue,
510
+ new_remote_node_id: this.remoteNodeId,
511
+ });
512
+ }
495
513
  _trimSeenAcks(now) {
496
514
  while (this.seenAckOrder.length > 0) {
497
515
  const candidate = this.seenAckOrder[0];
@@ -220,8 +220,10 @@ class BroadcastChannelListener extends transport_listener_js_1.TransportListener
220
220
  // Try to unwrap as transport frame
221
221
  const frame = (0, transport_frame_js_1.unwrapTransportFrame)(record.payload);
222
222
  if (frame) {
223
- // Apply listener's filtering policy: dst must match, src can be anything
224
- if (frame.dst === this._routingNode.id) {
223
+ // Apply listener's filtering policy: accept frames addressed to us OR with wildcard destination
224
+ // Wildcard is needed because downstream nodes don't know the sentinel's ID during initial attach
225
+ const isAddressedToUs = frame.dst === this._routingNode.id || frame.dst === '*';
226
+ if (isAddressedToUs) {
225
227
  envelopePayload = frame.payload;
226
228
  logger.debug('broadcast_channel_listener_unwrapped_transport_frame', {
227
229
  sender_id: senderId,
@@ -230,7 +232,7 @@ class BroadcastChannelListener extends transport_listener_js_1.TransportListener
230
232
  });
231
233
  }
232
234
  else {
233
- // Frame not addressed to us, ignore it
235
+ // Frame addressed to a different node, ignore it
234
236
  logger.debug('broadcast_channel_listener_ignored_frame_wrong_destination', {
235
237
  sender_id: senderId,
236
238
  dst: frame.dst,
@@ -393,5 +393,23 @@ class InPageConnector extends base_async_connector_js_1.BaseAsyncConnector {
393
393
  }
394
394
  return rawOrEnvelope;
395
395
  }
396
+ /**
397
+ * Update the remote node ID after learning it from NodeAttachAck
398
+ * This allows upstream connectors to switch from wildcard to specific addressing
399
+ */
400
+ updateRemoteNodeId(newRemoteNodeId) {
401
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
402
+ throw new Error('Invalid remote node ID');
403
+ }
404
+ const oldValue = this.remoteNodeId;
405
+ this.remoteNodeId = newRemoteNodeId.trim();
406
+ logger.debug('inpage_connector_remote_node_id_updated', {
407
+ channel: this.channelName,
408
+ connector_id: this.connectorId,
409
+ local_node_id: this.localNodeId,
410
+ old_remote_node_id: oldValue,
411
+ new_remote_node_id: this.remoteNodeId,
412
+ });
413
+ }
396
414
  }
397
415
  exports.InPageConnector = InPageConnector;
@@ -166,6 +166,20 @@ class DefaultNodeAttachClient {
166
166
  if (!targetSystemId) {
167
167
  throw new Error('Target system ID must be set in NodeAttachAckFrame on success');
168
168
  }
169
+ // Update connector's remote node ID if it supports it (e.g., BroadcastChannelConnector, InPageConnector)
170
+ // This allows upstream connectors to switch from wildcard '*' to specific node addressing
171
+ const updatableConnector = connector;
172
+ if (typeof updatableConnector.updateRemoteNodeId === 'function') {
173
+ try {
174
+ updatableConnector.updateRemoteNodeId(targetSystemId);
175
+ }
176
+ catch (error) {
177
+ logger.debug('connector_remote_node_id_update_failed', {
178
+ target_system_id: targetSystemId,
179
+ error: error instanceof Error ? error.message : String(error),
180
+ });
181
+ }
182
+ }
169
183
  try {
170
184
  if (this.replicaStickinessManager) {
171
185
  this.replicaStickinessManager.accept(ackFrame.stickiness ?? null);
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  // This file is auto-generated during build - do not edit manually
3
- // Generated from package.json version: 0.3.5-test.951
3
+ // Generated from package.json version: 0.3.5-test.953
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.VERSION = void 0;
6
6
  /**
7
7
  * The package version, injected at build time.
8
8
  * @internal
9
9
  */
10
- exports.VERSION = '0.3.5-test.951';
10
+ exports.VERSION = '0.3.5-test.953';
@@ -489,6 +489,24 @@ export class BroadcastChannelConnector extends BaseAsyncConnector {
489
489
  });
490
490
  }
491
491
  }
492
+ /**
493
+ * Update the remote node ID after learning it from NodeAttachAck
494
+ * This allows upstream connectors to switch from wildcard to specific addressing
495
+ */
496
+ updateRemoteNodeId(newRemoteNodeId) {
497
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
498
+ throw new Error('Invalid remote node ID');
499
+ }
500
+ const oldValue = this.remoteNodeId;
501
+ this.remoteNodeId = newRemoteNodeId.trim();
502
+ logger.debug('broadcast_channel_connector_remote_node_id_updated', {
503
+ channel: this.channelName,
504
+ connector_id: this.connectorId,
505
+ local_node_id: this.localNodeId,
506
+ old_remote_node_id: oldValue,
507
+ new_remote_node_id: this.remoteNodeId,
508
+ });
509
+ }
492
510
  _trimSeenAcks(now) {
493
511
  while (this.seenAckOrder.length > 0) {
494
512
  const candidate = this.seenAckOrder[0];
@@ -216,8 +216,10 @@ export class BroadcastChannelListener extends TransportListener {
216
216
  // Try to unwrap as transport frame
217
217
  const frame = unwrapTransportFrame(record.payload);
218
218
  if (frame) {
219
- // Apply listener's filtering policy: dst must match, src can be anything
220
- if (frame.dst === this._routingNode.id) {
219
+ // Apply listener's filtering policy: accept frames addressed to us OR with wildcard destination
220
+ // Wildcard is needed because downstream nodes don't know the sentinel's ID during initial attach
221
+ const isAddressedToUs = frame.dst === this._routingNode.id || frame.dst === '*';
222
+ if (isAddressedToUs) {
221
223
  envelopePayload = frame.payload;
222
224
  logger.debug('broadcast_channel_listener_unwrapped_transport_frame', {
223
225
  sender_id: senderId,
@@ -226,7 +228,7 @@ export class BroadcastChannelListener extends TransportListener {
226
228
  });
227
229
  }
228
230
  else {
229
- // Frame not addressed to us, ignore it
231
+ // Frame addressed to a different node, ignore it
230
232
  logger.debug('broadcast_channel_listener_ignored_frame_wrong_destination', {
231
233
  sender_id: senderId,
232
234
  dst: frame.dst,
@@ -390,4 +390,22 @@ export class InPageConnector extends BaseAsyncConnector {
390
390
  }
391
391
  return rawOrEnvelope;
392
392
  }
393
+ /**
394
+ * Update the remote node ID after learning it from NodeAttachAck
395
+ * This allows upstream connectors to switch from wildcard to specific addressing
396
+ */
397
+ updateRemoteNodeId(newRemoteNodeId) {
398
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
399
+ throw new Error('Invalid remote node ID');
400
+ }
401
+ const oldValue = this.remoteNodeId;
402
+ this.remoteNodeId = newRemoteNodeId.trim();
403
+ logger.debug('inpage_connector_remote_node_id_updated', {
404
+ channel: this.channelName,
405
+ connector_id: this.connectorId,
406
+ local_node_id: this.localNodeId,
407
+ old_remote_node_id: oldValue,
408
+ new_remote_node_id: this.remoteNodeId,
409
+ });
410
+ }
393
411
  }
@@ -163,6 +163,20 @@ export class DefaultNodeAttachClient {
163
163
  if (!targetSystemId) {
164
164
  throw new Error('Target system ID must be set in NodeAttachAckFrame on success');
165
165
  }
166
+ // Update connector's remote node ID if it supports it (e.g., BroadcastChannelConnector, InPageConnector)
167
+ // This allows upstream connectors to switch from wildcard '*' to specific node addressing
168
+ const updatableConnector = connector;
169
+ if (typeof updatableConnector.updateRemoteNodeId === 'function') {
170
+ try {
171
+ updatableConnector.updateRemoteNodeId(targetSystemId);
172
+ }
173
+ catch (error) {
174
+ logger.debug('connector_remote_node_id_update_failed', {
175
+ target_system_id: targetSystemId,
176
+ error: error instanceof Error ? error.message : String(error),
177
+ });
178
+ }
179
+ }
166
180
  try {
167
181
  if (this.replicaStickinessManager) {
168
182
  this.replicaStickinessManager.accept(ackFrame.stickiness ?? null);
@@ -1,7 +1,7 @@
1
1
  // This file is auto-generated during build - do not edit manually
2
- // Generated from package.json version: 0.3.5-test.951
2
+ // Generated from package.json version: 0.3.5-test.953
3
3
  /**
4
4
  * The package version, injected at build time.
5
5
  * @internal
6
6
  */
7
- export const VERSION = '0.3.5-test.951';
7
+ export const VERSION = '0.3.5-test.953';
@@ -14,12 +14,12 @@ var fastify = require('fastify');
14
14
  var websocketPlugin = require('@fastify/websocket');
15
15
 
16
16
  // This file is auto-generated during build - do not edit manually
17
- // Generated from package.json version: 0.3.5-test.951
17
+ // Generated from package.json version: 0.3.5-test.953
18
18
  /**
19
19
  * The package version, injected at build time.
20
20
  * @internal
21
21
  */
22
- const VERSION = '0.3.5-test.951';
22
+ const VERSION = '0.3.5-test.953';
23
23
 
24
24
  /**
25
25
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -10297,6 +10297,24 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10297
10297
  });
10298
10298
  }
10299
10299
  }
10300
+ /**
10301
+ * Update the remote node ID after learning it from NodeAttachAck
10302
+ * This allows upstream connectors to switch from wildcard to specific addressing
10303
+ */
10304
+ updateRemoteNodeId(newRemoteNodeId) {
10305
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
10306
+ throw new Error('Invalid remote node ID');
10307
+ }
10308
+ const oldValue = this.remoteNodeId;
10309
+ this.remoteNodeId = newRemoteNodeId.trim();
10310
+ logger$_.debug('broadcast_channel_connector_remote_node_id_updated', {
10311
+ channel: this.channelName,
10312
+ connector_id: this.connectorId,
10313
+ local_node_id: this.localNodeId,
10314
+ old_remote_node_id: oldValue,
10315
+ new_remote_node_id: this.remoteNodeId,
10316
+ });
10317
+ }
10300
10318
  _trimSeenAcks(now) {
10301
10319
  while (this.seenAckOrder.length > 0) {
10302
10320
  const candidate = this.seenAckOrder[0];
@@ -12760,6 +12778,20 @@ class DefaultNodeAttachClient {
12760
12778
  if (!targetSystemId) {
12761
12779
  throw new Error('Target system ID must be set in NodeAttachAckFrame on success');
12762
12780
  }
12781
+ // Update connector's remote node ID if it supports it (e.g., BroadcastChannelConnector, InPageConnector)
12782
+ // This allows upstream connectors to switch from wildcard '*' to specific node addressing
12783
+ const updatableConnector = connector;
12784
+ if (typeof updatableConnector.updateRemoteNodeId === 'function') {
12785
+ try {
12786
+ updatableConnector.updateRemoteNodeId(targetSystemId);
12787
+ }
12788
+ catch (error) {
12789
+ logger$W.debug('connector_remote_node_id_update_failed', {
12790
+ target_system_id: targetSystemId,
12791
+ error: error instanceof Error ? error.message : String(error),
12792
+ });
12793
+ }
12794
+ }
12763
12795
  try {
12764
12796
  if (this.replicaStickinessManager) {
12765
12797
  this.replicaStickinessManager.accept(ackFrame.stickiness ?? null);
@@ -20772,6 +20804,24 @@ class InPageConnector extends BaseAsyncConnector {
20772
20804
  }
20773
20805
  return rawOrEnvelope;
20774
20806
  }
20807
+ /**
20808
+ * Update the remote node ID after learning it from NodeAttachAck
20809
+ * This allows upstream connectors to switch from wildcard to specific addressing
20810
+ */
20811
+ updateRemoteNodeId(newRemoteNodeId) {
20812
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
20813
+ throw new Error('Invalid remote node ID');
20814
+ }
20815
+ const oldValue = this.remoteNodeId;
20816
+ this.remoteNodeId = newRemoteNodeId.trim();
20817
+ logger$G.debug('inpage_connector_remote_node_id_updated', {
20818
+ channel: this.channelName,
20819
+ connector_id: this.connectorId,
20820
+ local_node_id: this.localNodeId,
20821
+ old_remote_node_id: oldValue,
20822
+ new_remote_node_id: this.remoteNodeId,
20823
+ });
20824
+ }
20775
20825
  }
20776
20826
 
20777
20827
  const RPC_REGISTRY = Symbol('naylence.rpc.registry');
@@ -36368,8 +36418,10 @@ class BroadcastChannelListener extends TransportListener {
36368
36418
  // Try to unwrap as transport frame
36369
36419
  const frame = unwrapTransportFrame(record.payload);
36370
36420
  if (frame) {
36371
- // Apply listener's filtering policy: dst must match, src can be anything
36372
- if (frame.dst === this._routingNode.id) {
36421
+ // Apply listener's filtering policy: accept frames addressed to us OR with wildcard destination
36422
+ // Wildcard is needed because downstream nodes don't know the sentinel's ID during initial attach
36423
+ const isAddressedToUs = frame.dst === this._routingNode.id || frame.dst === '*';
36424
+ if (isAddressedToUs) {
36373
36425
  envelopePayload = frame.payload;
36374
36426
  logger$a.debug('broadcast_channel_listener_unwrapped_transport_frame', {
36375
36427
  sender_id: senderId,
@@ -36378,7 +36430,7 @@ class BroadcastChannelListener extends TransportListener {
36378
36430
  });
36379
36431
  }
36380
36432
  else {
36381
- // Frame not addressed to us, ignore it
36433
+ // Frame addressed to a different node, ignore it
36382
36434
  logger$a.debug('broadcast_channel_listener_ignored_frame_wrong_destination', {
36383
36435
  sender_id: senderId,
36384
36436
  dst: frame.dst,
@@ -13,12 +13,12 @@ import fastify from 'fastify';
13
13
  import websocketPlugin from '@fastify/websocket';
14
14
 
15
15
  // This file is auto-generated during build - do not edit manually
16
- // Generated from package.json version: 0.3.5-test.951
16
+ // Generated from package.json version: 0.3.5-test.953
17
17
  /**
18
18
  * The package version, injected at build time.
19
19
  * @internal
20
20
  */
21
- const VERSION = '0.3.5-test.951';
21
+ const VERSION = '0.3.5-test.953';
22
22
 
23
23
  /**
24
24
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -10296,6 +10296,24 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10296
10296
  });
10297
10297
  }
10298
10298
  }
10299
+ /**
10300
+ * Update the remote node ID after learning it from NodeAttachAck
10301
+ * This allows upstream connectors to switch from wildcard to specific addressing
10302
+ */
10303
+ updateRemoteNodeId(newRemoteNodeId) {
10304
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
10305
+ throw new Error('Invalid remote node ID');
10306
+ }
10307
+ const oldValue = this.remoteNodeId;
10308
+ this.remoteNodeId = newRemoteNodeId.trim();
10309
+ logger$_.debug('broadcast_channel_connector_remote_node_id_updated', {
10310
+ channel: this.channelName,
10311
+ connector_id: this.connectorId,
10312
+ local_node_id: this.localNodeId,
10313
+ old_remote_node_id: oldValue,
10314
+ new_remote_node_id: this.remoteNodeId,
10315
+ });
10316
+ }
10299
10317
  _trimSeenAcks(now) {
10300
10318
  while (this.seenAckOrder.length > 0) {
10301
10319
  const candidate = this.seenAckOrder[0];
@@ -12759,6 +12777,20 @@ class DefaultNodeAttachClient {
12759
12777
  if (!targetSystemId) {
12760
12778
  throw new Error('Target system ID must be set in NodeAttachAckFrame on success');
12761
12779
  }
12780
+ // Update connector's remote node ID if it supports it (e.g., BroadcastChannelConnector, InPageConnector)
12781
+ // This allows upstream connectors to switch from wildcard '*' to specific node addressing
12782
+ const updatableConnector = connector;
12783
+ if (typeof updatableConnector.updateRemoteNodeId === 'function') {
12784
+ try {
12785
+ updatableConnector.updateRemoteNodeId(targetSystemId);
12786
+ }
12787
+ catch (error) {
12788
+ logger$W.debug('connector_remote_node_id_update_failed', {
12789
+ target_system_id: targetSystemId,
12790
+ error: error instanceof Error ? error.message : String(error),
12791
+ });
12792
+ }
12793
+ }
12762
12794
  try {
12763
12795
  if (this.replicaStickinessManager) {
12764
12796
  this.replicaStickinessManager.accept(ackFrame.stickiness ?? null);
@@ -20771,6 +20803,24 @@ class InPageConnector extends BaseAsyncConnector {
20771
20803
  }
20772
20804
  return rawOrEnvelope;
20773
20805
  }
20806
+ /**
20807
+ * Update the remote node ID after learning it from NodeAttachAck
20808
+ * This allows upstream connectors to switch from wildcard to specific addressing
20809
+ */
20810
+ updateRemoteNodeId(newRemoteNodeId) {
20811
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
20812
+ throw new Error('Invalid remote node ID');
20813
+ }
20814
+ const oldValue = this.remoteNodeId;
20815
+ this.remoteNodeId = newRemoteNodeId.trim();
20816
+ logger$G.debug('inpage_connector_remote_node_id_updated', {
20817
+ channel: this.channelName,
20818
+ connector_id: this.connectorId,
20819
+ local_node_id: this.localNodeId,
20820
+ old_remote_node_id: oldValue,
20821
+ new_remote_node_id: this.remoteNodeId,
20822
+ });
20823
+ }
20774
20824
  }
20775
20825
 
20776
20826
  const RPC_REGISTRY = Symbol('naylence.rpc.registry');
@@ -36367,8 +36417,10 @@ class BroadcastChannelListener extends TransportListener {
36367
36417
  // Try to unwrap as transport frame
36368
36418
  const frame = unwrapTransportFrame(record.payload);
36369
36419
  if (frame) {
36370
- // Apply listener's filtering policy: dst must match, src can be anything
36371
- if (frame.dst === this._routingNode.id) {
36420
+ // Apply listener's filtering policy: accept frames addressed to us OR with wildcard destination
36421
+ // Wildcard is needed because downstream nodes don't know the sentinel's ID during initial attach
36422
+ const isAddressedToUs = frame.dst === this._routingNode.id || frame.dst === '*';
36423
+ if (isAddressedToUs) {
36372
36424
  envelopePayload = frame.payload;
36373
36425
  logger$a.debug('broadcast_channel_listener_unwrapped_transport_frame', {
36374
36426
  sender_id: senderId,
@@ -36377,7 +36429,7 @@ class BroadcastChannelListener extends TransportListener {
36377
36429
  });
36378
36430
  }
36379
36431
  else {
36380
- // Frame not addressed to us, ignore it
36432
+ // Frame addressed to a different node, ignore it
36381
36433
  logger$a.debug('broadcast_channel_listener_ignored_frame_wrong_destination', {
36382
36434
  sender_id: senderId,
36383
36435
  dst: frame.dst,
@@ -5478,12 +5478,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
5478
5478
  }
5479
5479
 
5480
5480
  // This file is auto-generated during build - do not edit manually
5481
- // Generated from package.json version: 0.3.5-test.951
5481
+ // Generated from package.json version: 0.3.5-test.953
5482
5482
  /**
5483
5483
  * The package version, injected at build time.
5484
5484
  * @internal
5485
5485
  */
5486
- const VERSION = '0.3.5-test.951';
5486
+ const VERSION = '0.3.5-test.953';
5487
5487
 
5488
5488
  /**
5489
5489
  * Fame errors module - Fame protocol specific error classes
@@ -12050,6 +12050,24 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
12050
12050
  });
12051
12051
  }
12052
12052
  }
12053
+ /**
12054
+ * Update the remote node ID after learning it from NodeAttachAck
12055
+ * This allows upstream connectors to switch from wildcard to specific addressing
12056
+ */
12057
+ updateRemoteNodeId(newRemoteNodeId) {
12058
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
12059
+ throw new Error('Invalid remote node ID');
12060
+ }
12061
+ const oldValue = this.remoteNodeId;
12062
+ this.remoteNodeId = newRemoteNodeId.trim();
12063
+ logger$10.debug('broadcast_channel_connector_remote_node_id_updated', {
12064
+ channel: this.channelName,
12065
+ connector_id: this.connectorId,
12066
+ local_node_id: this.localNodeId,
12067
+ old_remote_node_id: oldValue,
12068
+ new_remote_node_id: this.remoteNodeId,
12069
+ });
12070
+ }
12053
12071
  _trimSeenAcks(now) {
12054
12072
  while (this.seenAckOrder.length > 0) {
12055
12073
  const candidate = this.seenAckOrder[0];
@@ -14468,6 +14486,20 @@ class DefaultNodeAttachClient {
14468
14486
  if (!targetSystemId) {
14469
14487
  throw new Error('Target system ID must be set in NodeAttachAckFrame on success');
14470
14488
  }
14489
+ // Update connector's remote node ID if it supports it (e.g., BroadcastChannelConnector, InPageConnector)
14490
+ // This allows upstream connectors to switch from wildcard '*' to specific node addressing
14491
+ const updatableConnector = connector;
14492
+ if (typeof updatableConnector.updateRemoteNodeId === 'function') {
14493
+ try {
14494
+ updatableConnector.updateRemoteNodeId(targetSystemId);
14495
+ }
14496
+ catch (error) {
14497
+ logger$Y.debug('connector_remote_node_id_update_failed', {
14498
+ target_system_id: targetSystemId,
14499
+ error: error instanceof Error ? error.message : String(error),
14500
+ });
14501
+ }
14502
+ }
14471
14503
  try {
14472
14504
  if (this.replicaStickinessManager) {
14473
14505
  this.replicaStickinessManager.accept(ackFrame.stickiness ?? null);
@@ -21966,6 +21998,24 @@ class InPageConnector extends BaseAsyncConnector {
21966
21998
  }
21967
21999
  return rawOrEnvelope;
21968
22000
  }
22001
+ /**
22002
+ * Update the remote node ID after learning it from NodeAttachAck
22003
+ * This allows upstream connectors to switch from wildcard to specific addressing
22004
+ */
22005
+ updateRemoteNodeId(newRemoteNodeId) {
22006
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
22007
+ throw new Error('Invalid remote node ID');
22008
+ }
22009
+ const oldValue = this.remoteNodeId;
22010
+ this.remoteNodeId = newRemoteNodeId.trim();
22011
+ logger$J.debug('inpage_connector_remote_node_id_updated', {
22012
+ channel: this.channelName,
22013
+ connector_id: this.connectorId,
22014
+ local_node_id: this.localNodeId,
22015
+ old_remote_node_id: oldValue,
22016
+ new_remote_node_id: this.remoteNodeId,
22017
+ });
22018
+ }
21969
22019
  }
21970
22020
 
21971
22021
  const RPC_REGISTRY = Symbol('naylence.rpc.registry');
@@ -32944,8 +32994,10 @@ class BroadcastChannelListener extends TransportListener {
32944
32994
  // Try to unwrap as transport frame
32945
32995
  const frame = unwrapTransportFrame(record.payload);
32946
32996
  if (frame) {
32947
- // Apply listener's filtering policy: dst must match, src can be anything
32948
- if (frame.dst === this._routingNode.id) {
32997
+ // Apply listener's filtering policy: accept frames addressed to us OR with wildcard destination
32998
+ // Wildcard is needed because downstream nodes don't know the sentinel's ID during initial attach
32999
+ const isAddressedToUs = frame.dst === this._routingNode.id || frame.dst === '*';
33000
+ if (isAddressedToUs) {
32949
33001
  envelopePayload = frame.payload;
32950
33002
  logger$n.debug('broadcast_channel_listener_unwrapped_transport_frame', {
32951
33003
  sender_id: senderId,
@@ -32954,7 +33006,7 @@ class BroadcastChannelListener extends TransportListener {
32954
33006
  });
32955
33007
  }
32956
33008
  else {
32957
- // Frame not addressed to us, ignore it
33009
+ // Frame addressed to a different node, ignore it
32958
33010
  logger$n.debug('broadcast_channel_listener_ignored_frame_wrong_destination', {
32959
33011
  sender_id: senderId,
32960
33012
  dst: frame.dst,
@@ -5477,12 +5477,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
5477
5477
  }
5478
5478
 
5479
5479
  // This file is auto-generated during build - do not edit manually
5480
- // Generated from package.json version: 0.3.5-test.951
5480
+ // Generated from package.json version: 0.3.5-test.953
5481
5481
  /**
5482
5482
  * The package version, injected at build time.
5483
5483
  * @internal
5484
5484
  */
5485
- const VERSION = '0.3.5-test.951';
5485
+ const VERSION = '0.3.5-test.953';
5486
5486
 
5487
5487
  /**
5488
5488
  * Fame errors module - Fame protocol specific error classes
@@ -12049,6 +12049,24 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
12049
12049
  });
12050
12050
  }
12051
12051
  }
12052
+ /**
12053
+ * Update the remote node ID after learning it from NodeAttachAck
12054
+ * This allows upstream connectors to switch from wildcard to specific addressing
12055
+ */
12056
+ updateRemoteNodeId(newRemoteNodeId) {
12057
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
12058
+ throw new Error('Invalid remote node ID');
12059
+ }
12060
+ const oldValue = this.remoteNodeId;
12061
+ this.remoteNodeId = newRemoteNodeId.trim();
12062
+ logger$10.debug('broadcast_channel_connector_remote_node_id_updated', {
12063
+ channel: this.channelName,
12064
+ connector_id: this.connectorId,
12065
+ local_node_id: this.localNodeId,
12066
+ old_remote_node_id: oldValue,
12067
+ new_remote_node_id: this.remoteNodeId,
12068
+ });
12069
+ }
12052
12070
  _trimSeenAcks(now) {
12053
12071
  while (this.seenAckOrder.length > 0) {
12054
12072
  const candidate = this.seenAckOrder[0];
@@ -14467,6 +14485,20 @@ class DefaultNodeAttachClient {
14467
14485
  if (!targetSystemId) {
14468
14486
  throw new Error('Target system ID must be set in NodeAttachAckFrame on success');
14469
14487
  }
14488
+ // Update connector's remote node ID if it supports it (e.g., BroadcastChannelConnector, InPageConnector)
14489
+ // This allows upstream connectors to switch from wildcard '*' to specific node addressing
14490
+ const updatableConnector = connector;
14491
+ if (typeof updatableConnector.updateRemoteNodeId === 'function') {
14492
+ try {
14493
+ updatableConnector.updateRemoteNodeId(targetSystemId);
14494
+ }
14495
+ catch (error) {
14496
+ logger$Y.debug('connector_remote_node_id_update_failed', {
14497
+ target_system_id: targetSystemId,
14498
+ error: error instanceof Error ? error.message : String(error),
14499
+ });
14500
+ }
14501
+ }
14470
14502
  try {
14471
14503
  if (this.replicaStickinessManager) {
14472
14504
  this.replicaStickinessManager.accept(ackFrame.stickiness ?? null);
@@ -21965,6 +21997,24 @@ class InPageConnector extends BaseAsyncConnector {
21965
21997
  }
21966
21998
  return rawOrEnvelope;
21967
21999
  }
22000
+ /**
22001
+ * Update the remote node ID after learning it from NodeAttachAck
22002
+ * This allows upstream connectors to switch from wildcard to specific addressing
22003
+ */
22004
+ updateRemoteNodeId(newRemoteNodeId) {
22005
+ if (typeof newRemoteNodeId !== 'string' || newRemoteNodeId.trim().length === 0) {
22006
+ throw new Error('Invalid remote node ID');
22007
+ }
22008
+ const oldValue = this.remoteNodeId;
22009
+ this.remoteNodeId = newRemoteNodeId.trim();
22010
+ logger$J.debug('inpage_connector_remote_node_id_updated', {
22011
+ channel: this.channelName,
22012
+ connector_id: this.connectorId,
22013
+ local_node_id: this.localNodeId,
22014
+ old_remote_node_id: oldValue,
22015
+ new_remote_node_id: this.remoteNodeId,
22016
+ });
22017
+ }
21968
22018
  }
21969
22019
 
21970
22020
  const RPC_REGISTRY = Symbol('naylence.rpc.registry');
@@ -32943,8 +32993,10 @@ class BroadcastChannelListener extends TransportListener {
32943
32993
  // Try to unwrap as transport frame
32944
32994
  const frame = unwrapTransportFrame(record.payload);
32945
32995
  if (frame) {
32946
- // Apply listener's filtering policy: dst must match, src can be anything
32947
- if (frame.dst === this._routingNode.id) {
32996
+ // Apply listener's filtering policy: accept frames addressed to us OR with wildcard destination
32997
+ // Wildcard is needed because downstream nodes don't know the sentinel's ID during initial attach
32998
+ const isAddressedToUs = frame.dst === this._routingNode.id || frame.dst === '*';
32999
+ if (isAddressedToUs) {
32948
33000
  envelopePayload = frame.payload;
32949
33001
  logger$n.debug('broadcast_channel_listener_unwrapped_transport_frame', {
32950
33002
  sender_id: senderId,
@@ -32953,7 +33005,7 @@ class BroadcastChannelListener extends TransportListener {
32953
33005
  });
32954
33006
  }
32955
33007
  else {
32956
- // Frame not addressed to us, ignore it
33008
+ // Frame addressed to a different node, ignore it
32957
33009
  logger$n.debug('broadcast_channel_listener_ignored_frame_wrong_destination', {
32958
33010
  sender_id: senderId,
32959
33011
  dst: frame.dst,
@@ -25,7 +25,7 @@ export declare class BroadcastChannelConnector extends BaseAsyncConnector {
25
25
  private visibilityChangeListenerRegistered;
26
26
  private visibilityChangeHandler?;
27
27
  private readonly localNodeId;
28
- private readonly remoteNodeId;
28
+ private remoteNodeId;
29
29
  private static generateConnectorId;
30
30
  private static coercePayload;
31
31
  constructor(config: BroadcastChannelConnectorConfig, baseConfig?: BaseAsyncConnectorConfig);
@@ -43,6 +43,11 @@ export declare class BroadcastChannelConnector extends BaseAsyncConnector {
43
43
  * Override start() to check initial visibility state
44
44
  */
45
45
  start(inboundHandler: FameEnvelopeHandler): Promise<void>;
46
+ /**
47
+ * Update the remote node ID after learning it from NodeAttachAck
48
+ * This allows upstream connectors to switch from wildcard to specific addressing
49
+ */
50
+ updateRemoteNodeId(newRemoteNodeId: string): void;
46
51
  private _trimSeenAcks;
47
52
  private _extractAckDedupKey;
48
53
  }
@@ -23,7 +23,7 @@ export declare class InPageConnector extends BaseAsyncConnector {
23
23
  private visibilityChangeListenerRegistered;
24
24
  private visibilityChangeHandler?;
25
25
  private readonly localNodeId;
26
- private readonly remoteNodeId;
26
+ private remoteNodeId;
27
27
  private static generateConnectorId;
28
28
  private static coercePayload;
29
29
  constructor(config: InPageConnectorConfig, baseConfig?: BaseAsyncConnectorConfig);
@@ -36,5 +36,10 @@ export declare class InPageConnector extends BaseAsyncConnector {
36
36
  protected _transportReceive(): Promise<InPageInboxItem>;
37
37
  protected _transportClose(code: number, reason: string): Promise<void>;
38
38
  private _normalizeInboxItem;
39
+ /**
40
+ * Update the remote node ID after learning it from NodeAttachAck
41
+ * This allows upstream connectors to switch from wildcard to specific addressing
42
+ */
43
+ updateRemoteNodeId(newRemoteNodeId: string): void;
39
44
  }
40
45
  export {};
@@ -2,4 +2,4 @@
2
2
  * The package version, injected at build time.
3
3
  * @internal
4
4
  */
5
- export declare const VERSION = "0.3.5-test.951";
5
+ export declare const VERSION = "0.3.5-test.953";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naylence/runtime",
3
- "version": "0.3.5-test.951",
3
+ "version": "0.3.5-test.953",
4
4
  "type": "module",
5
5
  "description": "Naylence Runtime - Complete TypeScript runtime",
6
6
  "author": "Naylence Dev <naylencedev@gmail.com>",