@naylence/runtime 0.3.5-test.950 → 0.3.5-test.952

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.
@@ -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.950
99
+ // Generated from package.json version: 0.3.5-test.952
100
100
  /**
101
101
  * The package version, injected at build time.
102
102
  * @internal
103
103
  */
104
- const VERSION = '0.3.5-test.950';
104
+ const VERSION = '0.3.5-test.952';
105
105
 
106
106
  /**
107
107
  * Fame protocol specific error classes with WebSocket close codes and proper inheritance.
@@ -9862,14 +9862,12 @@ function serializeTransportFrame(frame) {
9862
9862
  return serializable;
9863
9863
  }
9864
9864
  /**
9865
- * Unwrap a transport frame, validating source and destination
9865
+ * Unwrap a transport frame (pure deserializer - no filtering)
9866
9866
  *
9867
9867
  * @param raw - Raw data from the bus
9868
- * @param localNodeId - This connector's node ID
9869
- * @param remoteNodeId - Expected remote node ID
9870
- * @returns Unwrapped payload if frame is valid and addressed to us, null otherwise
9868
+ * @returns Unwrapped frame with payload as Uint8Array, or null if invalid structure
9871
9869
  */
9872
- function unwrapTransportFrame(raw, localNodeId, remoteNodeId) {
9870
+ function unwrapTransportFrame(raw) {
9873
9871
  // Validate basic structure
9874
9872
  if (!raw || typeof raw !== 'object') {
9875
9873
  return null;
@@ -9883,16 +9881,17 @@ function unwrapTransportFrame(raw, localNodeId, remoteNodeId) {
9883
9881
  if (typeof frame.src !== 'string' || typeof frame.dst !== 'string') {
9884
9882
  return null;
9885
9883
  }
9886
- // Only accept frames addressed to us from the expected remote
9887
- if (frame.dst !== localNodeId || frame.src !== remoteNodeId) {
9888
- return null;
9889
- }
9890
9884
  // Extract payload
9891
9885
  if (!frame.payload || !Array.isArray(frame.payload)) {
9892
9886
  return null;
9893
9887
  }
9894
- // Convert array back to Uint8Array
9895
- return Uint8Array.from(frame.payload);
9888
+ // Convert array back to Uint8Array and return full frame
9889
+ return {
9890
+ v: frame.v,
9891
+ src: frame.src,
9892
+ dst: frame.dst,
9893
+ payload: Uint8Array.from(frame.payload),
9894
+ };
9896
9895
  }
9897
9896
 
9898
9897
  const logger$_ = getLogger('naylence.fame.connector.broadcast_channel_connector');
@@ -10007,43 +10006,64 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
10007
10006
  return;
10008
10007
  }
10009
10008
  // Try to unwrap as transport frame
10010
- const unwrapped = unwrapTransportFrame(busMessage.payload, this.localNodeId, this.remoteNodeId === '*' ? busMessage.senderId : this.remoteNodeId);
10011
- if (unwrapped) {
10012
- // Successfully unwrapped transport frame
10013
- logger$_.debug('broadcast_channel_transport_frame_received', {
10014
- channel: this.channelName,
10015
- sender_id: busMessage.senderId,
10016
- connector_id: this.connectorId,
10017
- local_node_id: this.localNodeId,
10018
- remote_node_id: this.remoteNodeId,
10019
- payload_length: unwrapped.byteLength,
10020
- });
10021
- if (this._shouldSkipDuplicateAck(busMessage.senderId, unwrapped)) {
10022
- return;
10023
- }
10024
- try {
10025
- if (typeof this.inbox.tryEnqueue === 'function') {
10026
- const accepted = this.inbox.tryEnqueue(unwrapped);
10027
- if (accepted) {
10028
- return;
10029
- }
10009
+ const frame = unwrapTransportFrame(busMessage.payload);
10010
+ if (frame) {
10011
+ // Apply connector's filtering policy: strict dst check, src accepts wildcard
10012
+ const srcMatches = this.remoteNodeId === '*' || frame.src === this.remoteNodeId;
10013
+ const dstMatches = frame.dst === this.localNodeId;
10014
+ if (dstMatches && srcMatches) {
10015
+ // Successfully received and filtered transport frame
10016
+ logger$_.debug('broadcast_channel_transport_frame_received', {
10017
+ channel: this.channelName,
10018
+ sender_id: busMessage.senderId,
10019
+ connector_id: this.connectorId,
10020
+ local_node_id: this.localNodeId,
10021
+ remote_node_id: this.remoteNodeId,
10022
+ frame_src: frame.src,
10023
+ frame_dst: frame.dst,
10024
+ payload_length: frame.payload.byteLength,
10025
+ });
10026
+ const unwrapped = frame.payload;
10027
+ if (this._shouldSkipDuplicateAck(busMessage.senderId, unwrapped)) {
10028
+ return;
10030
10029
  }
10031
- this.inbox.enqueue(unwrapped);
10032
- }
10033
- catch (error) {
10034
- if (error instanceof QueueFullError) {
10035
- logger$_.warning('broadcast_channel_receive_queue_full', {
10036
- channel: this.channelName,
10037
- });
10030
+ try {
10031
+ if (typeof this.inbox.tryEnqueue === 'function') {
10032
+ const accepted = this.inbox.tryEnqueue(unwrapped);
10033
+ if (accepted) {
10034
+ return;
10035
+ }
10036
+ }
10037
+ this.inbox.enqueue(unwrapped);
10038
10038
  }
10039
- else {
10040
- logger$_.error('broadcast_channel_receive_error', {
10041
- channel: this.channelName,
10042
- error: error instanceof Error ? error.message : String(error),
10043
- });
10039
+ catch (error) {
10040
+ if (error instanceof QueueFullError) {
10041
+ logger$_.warning('broadcast_channel_receive_queue_full', {
10042
+ channel: this.channelName,
10043
+ });
10044
+ }
10045
+ else {
10046
+ logger$_.error('broadcast_channel_receive_error', {
10047
+ channel: this.channelName,
10048
+ error: error instanceof Error ? error.message : String(error),
10049
+ });
10050
+ }
10044
10051
  }
10052
+ return;
10053
+ }
10054
+ else {
10055
+ // Frame filtered out by addressing rules
10056
+ logger$_.debug('broadcast_channel_transport_frame_filtered', {
10057
+ channel: this.channelName,
10058
+ connector_id: this.connectorId,
10059
+ local_node_id: this.localNodeId,
10060
+ remote_node_id: this.remoteNodeId,
10061
+ frame_src: frame.src,
10062
+ frame_dst: frame.dst,
10063
+ reason: !dstMatches ? 'wrong_destination' : 'wrong_source',
10064
+ });
10065
+ return;
10045
10066
  }
10046
- return;
10047
10067
  }
10048
10068
  // Fall back to legacy format (no transport frame)
10049
10069
  const payload = BroadcastChannelConnector.coercePayload(busMessage.payload);
@@ -20570,40 +20590,61 @@ class InPageConnector extends BaseAsyncConnector {
20570
20590
  return;
20571
20591
  }
20572
20592
  // Try to unwrap as transport frame
20573
- const unwrapped = unwrapTransportFrame(busMessage.payload, this.localNodeId, this.remoteNodeId === '*' ? busMessage.senderId : this.remoteNodeId);
20574
- if (unwrapped) {
20575
- // Successfully unwrapped transport frame
20576
- logger$G.debug('inpage_transport_frame_received', {
20577
- channel: this.channelName,
20578
- sender_id: busMessage.senderId,
20579
- connector_id: this.connectorId,
20580
- local_node_id: this.localNodeId,
20581
- remote_node_id: this.remoteNodeId,
20582
- payload_length: unwrapped.byteLength,
20583
- });
20584
- try {
20585
- if (typeof this.inbox.tryEnqueue === 'function') {
20586
- const accepted = this.inbox.tryEnqueue(unwrapped);
20587
- if (accepted) {
20588
- return;
20593
+ const frame = unwrapTransportFrame(busMessage.payload);
20594
+ if (frame) {
20595
+ // Apply connector's filtering policy: strict dst check, src accepts wildcard
20596
+ const srcMatches = this.remoteNodeId === '*' || frame.src === this.remoteNodeId;
20597
+ const dstMatches = frame.dst === this.localNodeId;
20598
+ if (dstMatches && srcMatches) {
20599
+ // Successfully received and filtered transport frame
20600
+ logger$G.debug('inpage_transport_frame_received', {
20601
+ channel: this.channelName,
20602
+ sender_id: busMessage.senderId,
20603
+ connector_id: this.connectorId,
20604
+ local_node_id: this.localNodeId,
20605
+ remote_node_id: this.remoteNodeId,
20606
+ frame_src: frame.src,
20607
+ frame_dst: frame.dst,
20608
+ payload_length: frame.payload.byteLength,
20609
+ });
20610
+ const unwrapped = frame.payload;
20611
+ try {
20612
+ if (typeof this.inbox.tryEnqueue === 'function') {
20613
+ const accepted = this.inbox.tryEnqueue(unwrapped);
20614
+ if (accepted) {
20615
+ return;
20616
+ }
20589
20617
  }
20618
+ this.inbox.enqueue(unwrapped);
20590
20619
  }
20591
- this.inbox.enqueue(unwrapped);
20592
- }
20593
- catch (error) {
20594
- if (error instanceof QueueFullError) {
20595
- logger$G.warning('inpage_receive_queue_full', {
20596
- channel: this.channelName,
20597
- });
20598
- }
20599
- else {
20600
- logger$G.error('inpage_receive_error', {
20601
- channel: this.channelName,
20602
- error: error instanceof Error ? error.message : String(error),
20603
- });
20620
+ catch (error) {
20621
+ if (error instanceof QueueFullError) {
20622
+ logger$G.warning('inpage_receive_queue_full', {
20623
+ channel: this.channelName,
20624
+ });
20625
+ }
20626
+ else {
20627
+ logger$G.error('inpage_receive_error', {
20628
+ channel: this.channelName,
20629
+ error: error instanceof Error ? error.message : String(error),
20630
+ });
20631
+ }
20604
20632
  }
20633
+ return;
20634
+ }
20635
+ else {
20636
+ // Frame filtered out by addressing rules
20637
+ logger$G.debug('inpage_transport_frame_filtered', {
20638
+ channel: this.channelName,
20639
+ connector_id: this.connectorId,
20640
+ local_node_id: this.localNodeId,
20641
+ remote_node_id: this.remoteNodeId,
20642
+ frame_src: frame.src,
20643
+ frame_dst: frame.dst,
20644
+ reason: !dstMatches ? 'wrong_destination' : 'wrong_source',
20645
+ });
20646
+ return;
20605
20647
  }
20606
- return;
20607
20648
  }
20608
20649
  // Fall back to legacy format (no transport frame)
20609
20650
  const payload = InPageConnector.coercePayload(busMessage.payload);
@@ -30138,41 +30179,44 @@ class BroadcastChannelListener extends TransportListener {
30138
30179
  if (typeof senderId !== 'string' || senderId.length === 0) {
30139
30180
  return null;
30140
30181
  }
30141
- const payload = coercePayload(record.payload);
30142
- if (!payload) {
30143
- logger$o.debug('broadcast_channel_listener_ignored_event_without_payload', {
30144
- sender_id: senderId,
30145
- });
30146
- return null;
30147
- }
30148
- // Try to unwrap as transport frame first
30149
- // Use wildcard for remoteNodeId since we don't know the sender's node ID yet
30150
- let unwrapped = null;
30151
- if (this._routingNode) {
30152
- try {
30153
- // First try to deserialize as transport frame
30154
- const parsed = JSON.parse(new TextDecoder().decode(payload));
30155
- if (parsed && typeof parsed === 'object' && 'v' in parsed && 'src' in parsed && 'dst' in parsed) {
30156
- const frame = parsed;
30157
- // Check if this frame is addressed to us (localNodeId)
30158
- if (frame.dst === this._routingNode.id) {
30159
- unwrapped = unwrapTransportFrame(payload, this._routingNode.id, '*');
30160
- if (unwrapped) {
30161
- logger$o.debug('broadcast_channel_listener_unwrapped_transport_frame', {
30162
- sender_id: senderId,
30163
- src: frame.src,
30164
- dst: frame.dst,
30165
- });
30166
- }
30167
- }
30182
+ // Check if payload is a transport frame object first
30183
+ let envelopePayload = null;
30184
+ if (this._routingNode && record.payload && typeof record.payload === 'object') {
30185
+ // Try to unwrap as transport frame
30186
+ const frame = unwrapTransportFrame(record.payload);
30187
+ if (frame) {
30188
+ // Apply listener's filtering policy: accept frames addressed to us OR with wildcard destination
30189
+ // Wildcard is needed because downstream nodes don't know the sentinel's ID during initial attach
30190
+ const isAddressedToUs = frame.dst === this._routingNode.id || frame.dst === '*';
30191
+ if (isAddressedToUs) {
30192
+ envelopePayload = frame.payload;
30193
+ logger$o.debug('broadcast_channel_listener_unwrapped_transport_frame', {
30194
+ sender_id: senderId,
30195
+ src: frame.src,
30196
+ dst: frame.dst,
30197
+ });
30198
+ }
30199
+ else {
30200
+ // Frame addressed to a different node, ignore it
30201
+ logger$o.debug('broadcast_channel_listener_ignored_frame_wrong_destination', {
30202
+ sender_id: senderId,
30203
+ dst: frame.dst,
30204
+ expected: this._routingNode.id,
30205
+ });
30206
+ return null;
30168
30207
  }
30169
30208
  }
30170
- catch {
30171
- // Not a transport frame, continue with legacy format
30209
+ }
30210
+ // If not a transport frame, try to coerce as legacy format
30211
+ if (!envelopePayload) {
30212
+ envelopePayload = coercePayload(record.payload);
30213
+ if (!envelopePayload) {
30214
+ logger$o.debug('broadcast_channel_listener_ignored_event_without_payload', {
30215
+ sender_id: senderId,
30216
+ });
30217
+ return null;
30172
30218
  }
30173
30219
  }
30174
- // Use unwrapped payload if available, otherwise use raw payload
30175
- const envelopePayload = unwrapped ?? payload;
30176
30220
  let envelope;
30177
30221
  try {
30178
30222
  const decoded = new TextDecoder().decode(envelopePayload);
@@ -30182,7 +30226,7 @@ class BroadcastChannelListener extends TransportListener {
30182
30226
  catch (error) {
30183
30227
  const decoded = (() => {
30184
30228
  try {
30185
- return new TextDecoder().decode(payload);
30229
+ return new TextDecoder().decode(envelopePayload);
30186
30230
  }
30187
30231
  catch {
30188
30232
  return null;
@@ -119,43 +119,64 @@ class BroadcastChannelConnector extends base_async_connector_js_1.BaseAsyncConne
119
119
  return;
120
120
  }
121
121
  // Try to unwrap as transport frame
122
- const unwrapped = (0, transport_frame_js_1.unwrapTransportFrame)(busMessage.payload, this.localNodeId, this.remoteNodeId === '*' ? busMessage.senderId : this.remoteNodeId);
123
- if (unwrapped) {
124
- // Successfully unwrapped transport frame
125
- logger.debug('broadcast_channel_transport_frame_received', {
126
- channel: this.channelName,
127
- sender_id: busMessage.senderId,
128
- connector_id: this.connectorId,
129
- local_node_id: this.localNodeId,
130
- remote_node_id: this.remoteNodeId,
131
- payload_length: unwrapped.byteLength,
132
- });
133
- if (this._shouldSkipDuplicateAck(busMessage.senderId, unwrapped)) {
134
- return;
135
- }
136
- try {
137
- if (typeof this.inbox.tryEnqueue === 'function') {
138
- const accepted = this.inbox.tryEnqueue(unwrapped);
139
- if (accepted) {
140
- return;
141
- }
122
+ const frame = (0, transport_frame_js_1.unwrapTransportFrame)(busMessage.payload);
123
+ if (frame) {
124
+ // Apply connector's filtering policy: strict dst check, src accepts wildcard
125
+ const srcMatches = this.remoteNodeId === '*' || frame.src === this.remoteNodeId;
126
+ const dstMatches = frame.dst === this.localNodeId;
127
+ if (dstMatches && srcMatches) {
128
+ // Successfully received and filtered transport frame
129
+ logger.debug('broadcast_channel_transport_frame_received', {
130
+ channel: this.channelName,
131
+ sender_id: busMessage.senderId,
132
+ connector_id: this.connectorId,
133
+ local_node_id: this.localNodeId,
134
+ remote_node_id: this.remoteNodeId,
135
+ frame_src: frame.src,
136
+ frame_dst: frame.dst,
137
+ payload_length: frame.payload.byteLength,
138
+ });
139
+ const unwrapped = frame.payload;
140
+ if (this._shouldSkipDuplicateAck(busMessage.senderId, unwrapped)) {
141
+ return;
142
142
  }
143
- this.inbox.enqueue(unwrapped);
144
- }
145
- catch (error) {
146
- if (error instanceof bounded_async_queue_js_1.QueueFullError) {
147
- logger.warning('broadcast_channel_receive_queue_full', {
148
- channel: this.channelName,
149
- });
143
+ try {
144
+ if (typeof this.inbox.tryEnqueue === 'function') {
145
+ const accepted = this.inbox.tryEnqueue(unwrapped);
146
+ if (accepted) {
147
+ return;
148
+ }
149
+ }
150
+ this.inbox.enqueue(unwrapped);
150
151
  }
151
- else {
152
- logger.error('broadcast_channel_receive_error', {
153
- channel: this.channelName,
154
- error: error instanceof Error ? error.message : String(error),
155
- });
152
+ catch (error) {
153
+ if (error instanceof bounded_async_queue_js_1.QueueFullError) {
154
+ logger.warning('broadcast_channel_receive_queue_full', {
155
+ channel: this.channelName,
156
+ });
157
+ }
158
+ else {
159
+ logger.error('broadcast_channel_receive_error', {
160
+ channel: this.channelName,
161
+ error: error instanceof Error ? error.message : String(error),
162
+ });
163
+ }
156
164
  }
165
+ return;
166
+ }
167
+ else {
168
+ // Frame filtered out by addressing rules
169
+ logger.debug('broadcast_channel_transport_frame_filtered', {
170
+ channel: this.channelName,
171
+ connector_id: this.connectorId,
172
+ local_node_id: this.localNodeId,
173
+ remote_node_id: this.remoteNodeId,
174
+ frame_src: frame.src,
175
+ frame_dst: frame.dst,
176
+ reason: !dstMatches ? 'wrong_destination' : 'wrong_source',
177
+ });
178
+ return;
157
179
  }
158
- return;
159
180
  }
160
181
  // Fall back to legacy format (no transport frame)
161
182
  const payload = BroadcastChannelConnector.coercePayload(busMessage.payload);
@@ -214,41 +214,44 @@ class BroadcastChannelListener extends transport_listener_js_1.TransportListener
214
214
  if (typeof senderId !== 'string' || senderId.length === 0) {
215
215
  return null;
216
216
  }
217
- const payload = coercePayload(record.payload);
218
- if (!payload) {
219
- logger.debug('broadcast_channel_listener_ignored_event_without_payload', {
220
- sender_id: senderId,
221
- });
222
- return null;
223
- }
224
- // Try to unwrap as transport frame first
225
- // Use wildcard for remoteNodeId since we don't know the sender's node ID yet
226
- let unwrapped = null;
227
- if (this._routingNode) {
228
- try {
229
- // First try to deserialize as transport frame
230
- const parsed = JSON.parse(new TextDecoder().decode(payload));
231
- if (parsed && typeof parsed === 'object' && 'v' in parsed && 'src' in parsed && 'dst' in parsed) {
232
- const frame = parsed;
233
- // Check if this frame is addressed to us (localNodeId)
234
- if (frame.dst === this._routingNode.id) {
235
- unwrapped = (0, transport_frame_js_1.unwrapTransportFrame)(payload, this._routingNode.id, '*');
236
- if (unwrapped) {
237
- logger.debug('broadcast_channel_listener_unwrapped_transport_frame', {
238
- sender_id: senderId,
239
- src: frame.src,
240
- dst: frame.dst,
241
- });
242
- }
243
- }
217
+ // Check if payload is a transport frame object first
218
+ let envelopePayload = null;
219
+ if (this._routingNode && record.payload && typeof record.payload === 'object') {
220
+ // Try to unwrap as transport frame
221
+ const frame = (0, transport_frame_js_1.unwrapTransportFrame)(record.payload);
222
+ if (frame) {
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) {
227
+ envelopePayload = frame.payload;
228
+ logger.debug('broadcast_channel_listener_unwrapped_transport_frame', {
229
+ sender_id: senderId,
230
+ src: frame.src,
231
+ dst: frame.dst,
232
+ });
233
+ }
234
+ else {
235
+ // Frame addressed to a different node, ignore it
236
+ logger.debug('broadcast_channel_listener_ignored_frame_wrong_destination', {
237
+ sender_id: senderId,
238
+ dst: frame.dst,
239
+ expected: this._routingNode.id,
240
+ });
241
+ return null;
244
242
  }
245
243
  }
246
- catch {
247
- // Not a transport frame, continue with legacy format
244
+ }
245
+ // If not a transport frame, try to coerce as legacy format
246
+ if (!envelopePayload) {
247
+ envelopePayload = coercePayload(record.payload);
248
+ if (!envelopePayload) {
249
+ logger.debug('broadcast_channel_listener_ignored_event_without_payload', {
250
+ sender_id: senderId,
251
+ });
252
+ return null;
248
253
  }
249
254
  }
250
- // Use unwrapped payload if available, otherwise use raw payload
251
- const envelopePayload = unwrapped ?? payload;
252
255
  let envelope;
253
256
  try {
254
257
  const decoded = new TextDecoder().decode(envelopePayload);
@@ -258,7 +261,7 @@ class BroadcastChannelListener extends transport_listener_js_1.TransportListener
258
261
  catch (error) {
259
262
  const decoded = (() => {
260
263
  try {
261
- return new TextDecoder().decode(payload);
264
+ return new TextDecoder().decode(envelopePayload);
262
265
  }
263
266
  catch {
264
267
  return null;
@@ -129,40 +129,61 @@ class InPageConnector extends base_async_connector_js_1.BaseAsyncConnector {
129
129
  return;
130
130
  }
131
131
  // Try to unwrap as transport frame
132
- const unwrapped = (0, transport_frame_js_1.unwrapTransportFrame)(busMessage.payload, this.localNodeId, this.remoteNodeId === '*' ? busMessage.senderId : this.remoteNodeId);
133
- if (unwrapped) {
134
- // Successfully unwrapped transport frame
135
- logger.debug('inpage_transport_frame_received', {
136
- channel: this.channelName,
137
- sender_id: busMessage.senderId,
138
- connector_id: this.connectorId,
139
- local_node_id: this.localNodeId,
140
- remote_node_id: this.remoteNodeId,
141
- payload_length: unwrapped.byteLength,
142
- });
143
- try {
144
- if (typeof this.inbox.tryEnqueue === 'function') {
145
- const accepted = this.inbox.tryEnqueue(unwrapped);
146
- if (accepted) {
147
- return;
132
+ const frame = (0, transport_frame_js_1.unwrapTransportFrame)(busMessage.payload);
133
+ if (frame) {
134
+ // Apply connector's filtering policy: strict dst check, src accepts wildcard
135
+ const srcMatches = this.remoteNodeId === '*' || frame.src === this.remoteNodeId;
136
+ const dstMatches = frame.dst === this.localNodeId;
137
+ if (dstMatches && srcMatches) {
138
+ // Successfully received and filtered transport frame
139
+ logger.debug('inpage_transport_frame_received', {
140
+ channel: this.channelName,
141
+ sender_id: busMessage.senderId,
142
+ connector_id: this.connectorId,
143
+ local_node_id: this.localNodeId,
144
+ remote_node_id: this.remoteNodeId,
145
+ frame_src: frame.src,
146
+ frame_dst: frame.dst,
147
+ payload_length: frame.payload.byteLength,
148
+ });
149
+ const unwrapped = frame.payload;
150
+ try {
151
+ if (typeof this.inbox.tryEnqueue === 'function') {
152
+ const accepted = this.inbox.tryEnqueue(unwrapped);
153
+ if (accepted) {
154
+ return;
155
+ }
148
156
  }
157
+ this.inbox.enqueue(unwrapped);
149
158
  }
150
- this.inbox.enqueue(unwrapped);
151
- }
152
- catch (error) {
153
- if (error instanceof bounded_async_queue_js_1.QueueFullError) {
154
- logger.warning('inpage_receive_queue_full', {
155
- channel: this.channelName,
156
- });
157
- }
158
- else {
159
- logger.error('inpage_receive_error', {
160
- channel: this.channelName,
161
- error: error instanceof Error ? error.message : String(error),
162
- });
159
+ catch (error) {
160
+ if (error instanceof bounded_async_queue_js_1.QueueFullError) {
161
+ logger.warning('inpage_receive_queue_full', {
162
+ channel: this.channelName,
163
+ });
164
+ }
165
+ else {
166
+ logger.error('inpage_receive_error', {
167
+ channel: this.channelName,
168
+ error: error instanceof Error ? error.message : String(error),
169
+ });
170
+ }
163
171
  }
172
+ return;
173
+ }
174
+ else {
175
+ // Frame filtered out by addressing rules
176
+ logger.debug('inpage_transport_frame_filtered', {
177
+ channel: this.channelName,
178
+ connector_id: this.connectorId,
179
+ local_node_id: this.localNodeId,
180
+ remote_node_id: this.remoteNodeId,
181
+ frame_src: frame.src,
182
+ frame_dst: frame.dst,
183
+ reason: !dstMatches ? 'wrong_destination' : 'wrong_source',
184
+ });
185
+ return;
164
186
  }
165
- return;
166
187
  }
167
188
  // Fall back to legacy format (no transport frame)
168
189
  const payload = InPageConnector.coercePayload(busMessage.payload);