@naylence/runtime 0.3.5-test.965 → 0.3.5-test.966

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.
@@ -5563,12 +5563,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
5563
5563
  }
5564
5564
 
5565
5565
  // This file is auto-generated during build - do not edit manually
5566
- // Generated from package.json version: 0.3.5-test.965
5566
+ // Generated from package.json version: 0.3.5-test.966
5567
5567
  /**
5568
5568
  * The package version, injected at build time.
5569
5569
  * @internal
5570
5570
  */
5571
- const VERSION = '0.3.5-test.965';
5571
+ const VERSION = '0.3.5-test.966';
5572
5572
 
5573
5573
  /**
5574
5574
  * Fame errors module - Fame protocol specific error classes
@@ -11623,11 +11623,6 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11623
11623
  ensureBroadcastEnvironment();
11624
11624
  super(baseConfig);
11625
11625
  this.listenerRegistered = false;
11626
- this.seenAckKeys = new Map();
11627
- this.seenAckOrder = [];
11628
- this.ackDedupTtlMs = 30000;
11629
- this.ackDedupMaxEntries = 4096;
11630
- this.textDecoder = new TextDecoder();
11631
11626
  this.visibilityChangeListenerRegistered = false;
11632
11627
  this.channelName =
11633
11628
  typeof config.channelName === 'string' && config.channelName.trim().length > 0
@@ -11719,9 +11714,6 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11719
11714
  connector_id: this.connectorId,
11720
11715
  payload_length: payload.byteLength,
11721
11716
  });
11722
- if (this._shouldSkipDuplicateAck(senderNodeId, payload)) {
11723
- return;
11724
- }
11725
11717
  try {
11726
11718
  if (typeof this.inbox.tryEnqueue === 'function') {
11727
11719
  const accepted = this.inbox.tryEnqueue(payload);
@@ -11825,9 +11817,6 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11825
11817
  }
11826
11818
  async pushToReceive(rawOrEnvelope) {
11827
11819
  const item = this._normalizeInboxItem(rawOrEnvelope);
11828
- if (this._shouldSkipDuplicateAckFromInboxItem(item)) {
11829
- return;
11830
- }
11831
11820
  try {
11832
11821
  if (typeof this.inbox.tryEnqueue === 'function') {
11833
11822
  const accepted = this.inbox.tryEnqueue(item);
@@ -11927,8 +11916,6 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11927
11916
  const closeReason = typeof reason === 'string' && reason.length > 0 ? reason : 'closed';
11928
11917
  const shutdownError = new FameTransportClose(closeReason, closeCode);
11929
11918
  this.inbox.drain(shutdownError);
11930
- this.seenAckKeys.clear();
11931
- this.seenAckOrder.length = 0;
11932
11919
  }
11933
11920
  _normalizeInboxItem(rawOrEnvelope) {
11934
11921
  if (rawOrEnvelope instanceof Uint8Array) {
@@ -12005,125 +11992,6 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
12005
11992
  ...extra,
12006
11993
  });
12007
11994
  }
12008
- _shouldSkipDuplicateAck(senderId, payload) {
12009
- const dedupKey = this._extractAckDedupKey(payload);
12010
- if (!dedupKey) {
12011
- return false;
12012
- }
12013
- const normalizedSenderId = typeof senderId === 'string' && senderId.length > 0
12014
- ? senderId
12015
- : undefined;
12016
- if (normalizedSenderId && normalizedSenderId !== this.localNodeId) {
12017
- logger$10.debug('broadcast_channel_duplicate_ack_bypass_non_self', {
12018
- channel: this.channelName,
12019
- connector_id: this.connectorId,
12020
- sender_id: normalizedSenderId,
12021
- dedup_key: dedupKey,
12022
- source: 'listener',
12023
- });
12024
- return false;
12025
- }
12026
- logger$10.debug('broadcast_channel_duplicate_ack_check', {
12027
- channel: this.channelName,
12028
- connector_id: this.connectorId,
12029
- sender_id: normalizedSenderId ?? null,
12030
- dedup_key: dedupKey,
12031
- source: 'listener',
12032
- cache_entries: this.seenAckKeys.size,
12033
- });
12034
- return this._checkDuplicateAck(dedupKey, normalizedSenderId);
12035
- }
12036
- _shouldSkipDuplicateAckFromInboxItem(item) {
12037
- if (item instanceof Uint8Array) {
12038
- return this._shouldSkipDuplicateAck(undefined, item);
12039
- }
12040
- const envelope = this._extractEnvelopeFromInboxItem(item);
12041
- if (!envelope) {
12042
- return false;
12043
- }
12044
- const frame = envelope.frame;
12045
- if (!frame || frame.type !== 'DeliveryAck') {
12046
- return false;
12047
- }
12048
- const refId = typeof frame.refId === 'string' && frame.refId.length > 0
12049
- ? frame.refId
12050
- : null;
12051
- const dedupKey = refId ?? envelope.id ?? null;
12052
- if (!dedupKey) {
12053
- return false;
12054
- }
12055
- const senderId = this._extractSenderIdFromInboxItem(item);
12056
- if (senderId && senderId !== this.localNodeId) {
12057
- logger$10.debug('broadcast_channel_duplicate_ack_bypass_non_self', {
12058
- channel: this.channelName,
12059
- connector_id: this.connectorId,
12060
- sender_id: senderId,
12061
- dedup_key: dedupKey,
12062
- source: 'inbox_item',
12063
- });
12064
- return false;
12065
- }
12066
- logger$10.debug('broadcast_channel_duplicate_ack_check', {
12067
- channel: this.channelName,
12068
- connector_id: this.connectorId,
12069
- sender_id: senderId ?? null,
12070
- dedup_key: dedupKey,
12071
- source: 'inbox_item',
12072
- cache_entries: this.seenAckKeys.size,
12073
- });
12074
- return this._checkDuplicateAck(dedupKey, senderId);
12075
- }
12076
- _checkDuplicateAck(dedupKey, senderId) {
12077
- const now = Date.now();
12078
- const lastSeen = this.seenAckKeys.get(dedupKey);
12079
- if (lastSeen && now - lastSeen < this.ackDedupTtlMs) {
12080
- logger$10.debug('broadcast_channel_duplicate_ack_suppressed', {
12081
- channel: this.channelName,
12082
- connector_id: this.connectorId,
12083
- sender_id: senderId ?? null,
12084
- dedup_key: dedupKey,
12085
- age_ms: now - lastSeen,
12086
- ttl_ms: this.ackDedupTtlMs,
12087
- cache_entries: this.seenAckKeys.size,
12088
- });
12089
- return true;
12090
- }
12091
- this.seenAckKeys.set(dedupKey, now);
12092
- this.seenAckOrder.push(dedupKey);
12093
- logger$10.debug('broadcast_channel_duplicate_ack_recorded', {
12094
- channel: this.channelName,
12095
- connector_id: this.connectorId,
12096
- sender_id: senderId ?? null,
12097
- dedup_key: dedupKey,
12098
- cache_entries: this.seenAckKeys.size,
12099
- });
12100
- this._trimSeenAcks(now);
12101
- return false;
12102
- }
12103
- _extractEnvelopeFromInboxItem(item) {
12104
- if (!item || typeof item !== 'object') {
12105
- return null;
12106
- }
12107
- if ('envelope' in item) {
12108
- return item.envelope;
12109
- }
12110
- if ('frame' in item) {
12111
- return item;
12112
- }
12113
- return null;
12114
- }
12115
- _extractSenderIdFromInboxItem(item) {
12116
- if (!item || typeof item !== 'object') {
12117
- return undefined;
12118
- }
12119
- if ('context' in item) {
12120
- const context = item.context;
12121
- if (context && typeof context.fromSystemId === 'string') {
12122
- return context.fromSystemId;
12123
- }
12124
- }
12125
- return undefined;
12126
- }
12127
11995
  /**
12128
11996
  * Override start() to check initial visibility state
12129
11997
  */
@@ -12177,47 +12045,6 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
12177
12045
  target_mode: 'wildcard',
12178
12046
  });
12179
12047
  }
12180
- _trimSeenAcks(now) {
12181
- while (this.seenAckOrder.length > 0) {
12182
- const candidate = this.seenAckOrder[0];
12183
- const timestamp = this.seenAckKeys.get(candidate);
12184
- if (timestamp === undefined) {
12185
- this.seenAckOrder.shift();
12186
- continue;
12187
- }
12188
- if (this.seenAckKeys.size > this.ackDedupMaxEntries ||
12189
- now - timestamp > this.ackDedupTtlMs) {
12190
- this.seenAckKeys.delete(candidate);
12191
- this.seenAckOrder.shift();
12192
- continue;
12193
- }
12194
- break;
12195
- }
12196
- }
12197
- _extractAckDedupKey(payload) {
12198
- try {
12199
- const decoded = this.textDecoder.decode(payload);
12200
- const parsed = JSON.parse(decoded);
12201
- const envelopeId = typeof parsed?.id === 'string' ? parsed.id : null;
12202
- const frameType = parsed?.frame?.type;
12203
- if (typeof frameType !== 'string' || frameType !== 'DeliveryAck') {
12204
- return null;
12205
- }
12206
- const refId = parsed.frame?.refId;
12207
- if (typeof refId === 'string' && refId.length > 0) {
12208
- return refId;
12209
- }
12210
- return envelopeId;
12211
- }
12212
- catch (error) {
12213
- logger$10.debug('broadcast_channel_ack_dedup_parse_failed', {
12214
- channel: this.channelName,
12215
- connector_id: this.connectorId,
12216
- error: error instanceof Error ? error.message : String(error),
12217
- });
12218
- return null;
12219
- }
12220
- }
12221
12048
  };
12222
12049
 
12223
12050
  const BROADCAST_CHANNEL_CONNECTOR_TYPE = 'broadcast-channel-connector';
@@ -5562,12 +5562,12 @@ for (const [name, config] of Object.entries(SQLITE_PROFILES)) {
5562
5562
  }
5563
5563
 
5564
5564
  // This file is auto-generated during build - do not edit manually
5565
- // Generated from package.json version: 0.3.5-test.965
5565
+ // Generated from package.json version: 0.3.5-test.966
5566
5566
  /**
5567
5567
  * The package version, injected at build time.
5568
5568
  * @internal
5569
5569
  */
5570
- const VERSION = '0.3.5-test.965';
5570
+ const VERSION = '0.3.5-test.966';
5571
5571
 
5572
5572
  /**
5573
5573
  * Fame errors module - Fame protocol specific error classes
@@ -11622,11 +11622,6 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11622
11622
  ensureBroadcastEnvironment();
11623
11623
  super(baseConfig);
11624
11624
  this.listenerRegistered = false;
11625
- this.seenAckKeys = new Map();
11626
- this.seenAckOrder = [];
11627
- this.ackDedupTtlMs = 30000;
11628
- this.ackDedupMaxEntries = 4096;
11629
- this.textDecoder = new TextDecoder();
11630
11625
  this.visibilityChangeListenerRegistered = false;
11631
11626
  this.channelName =
11632
11627
  typeof config.channelName === 'string' && config.channelName.trim().length > 0
@@ -11718,9 +11713,6 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11718
11713
  connector_id: this.connectorId,
11719
11714
  payload_length: payload.byteLength,
11720
11715
  });
11721
- if (this._shouldSkipDuplicateAck(senderNodeId, payload)) {
11722
- return;
11723
- }
11724
11716
  try {
11725
11717
  if (typeof this.inbox.tryEnqueue === 'function') {
11726
11718
  const accepted = this.inbox.tryEnqueue(payload);
@@ -11824,9 +11816,6 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11824
11816
  }
11825
11817
  async pushToReceive(rawOrEnvelope) {
11826
11818
  const item = this._normalizeInboxItem(rawOrEnvelope);
11827
- if (this._shouldSkipDuplicateAckFromInboxItem(item)) {
11828
- return;
11829
- }
11830
11819
  try {
11831
11820
  if (typeof this.inbox.tryEnqueue === 'function') {
11832
11821
  const accepted = this.inbox.tryEnqueue(item);
@@ -11926,8 +11915,6 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11926
11915
  const closeReason = typeof reason === 'string' && reason.length > 0 ? reason : 'closed';
11927
11916
  const shutdownError = new FameTransportClose(closeReason, closeCode);
11928
11917
  this.inbox.drain(shutdownError);
11929
- this.seenAckKeys.clear();
11930
- this.seenAckOrder.length = 0;
11931
11918
  }
11932
11919
  _normalizeInboxItem(rawOrEnvelope) {
11933
11920
  if (rawOrEnvelope instanceof Uint8Array) {
@@ -12004,125 +11991,6 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
12004
11991
  ...extra,
12005
11992
  });
12006
11993
  }
12007
- _shouldSkipDuplicateAck(senderId, payload) {
12008
- const dedupKey = this._extractAckDedupKey(payload);
12009
- if (!dedupKey) {
12010
- return false;
12011
- }
12012
- const normalizedSenderId = typeof senderId === 'string' && senderId.length > 0
12013
- ? senderId
12014
- : undefined;
12015
- if (normalizedSenderId && normalizedSenderId !== this.localNodeId) {
12016
- logger$10.debug('broadcast_channel_duplicate_ack_bypass_non_self', {
12017
- channel: this.channelName,
12018
- connector_id: this.connectorId,
12019
- sender_id: normalizedSenderId,
12020
- dedup_key: dedupKey,
12021
- source: 'listener',
12022
- });
12023
- return false;
12024
- }
12025
- logger$10.debug('broadcast_channel_duplicate_ack_check', {
12026
- channel: this.channelName,
12027
- connector_id: this.connectorId,
12028
- sender_id: normalizedSenderId ?? null,
12029
- dedup_key: dedupKey,
12030
- source: 'listener',
12031
- cache_entries: this.seenAckKeys.size,
12032
- });
12033
- return this._checkDuplicateAck(dedupKey, normalizedSenderId);
12034
- }
12035
- _shouldSkipDuplicateAckFromInboxItem(item) {
12036
- if (item instanceof Uint8Array) {
12037
- return this._shouldSkipDuplicateAck(undefined, item);
12038
- }
12039
- const envelope = this._extractEnvelopeFromInboxItem(item);
12040
- if (!envelope) {
12041
- return false;
12042
- }
12043
- const frame = envelope.frame;
12044
- if (!frame || frame.type !== 'DeliveryAck') {
12045
- return false;
12046
- }
12047
- const refId = typeof frame.refId === 'string' && frame.refId.length > 0
12048
- ? frame.refId
12049
- : null;
12050
- const dedupKey = refId ?? envelope.id ?? null;
12051
- if (!dedupKey) {
12052
- return false;
12053
- }
12054
- const senderId = this._extractSenderIdFromInboxItem(item);
12055
- if (senderId && senderId !== this.localNodeId) {
12056
- logger$10.debug('broadcast_channel_duplicate_ack_bypass_non_self', {
12057
- channel: this.channelName,
12058
- connector_id: this.connectorId,
12059
- sender_id: senderId,
12060
- dedup_key: dedupKey,
12061
- source: 'inbox_item',
12062
- });
12063
- return false;
12064
- }
12065
- logger$10.debug('broadcast_channel_duplicate_ack_check', {
12066
- channel: this.channelName,
12067
- connector_id: this.connectorId,
12068
- sender_id: senderId ?? null,
12069
- dedup_key: dedupKey,
12070
- source: 'inbox_item',
12071
- cache_entries: this.seenAckKeys.size,
12072
- });
12073
- return this._checkDuplicateAck(dedupKey, senderId);
12074
- }
12075
- _checkDuplicateAck(dedupKey, senderId) {
12076
- const now = Date.now();
12077
- const lastSeen = this.seenAckKeys.get(dedupKey);
12078
- if (lastSeen && now - lastSeen < this.ackDedupTtlMs) {
12079
- logger$10.debug('broadcast_channel_duplicate_ack_suppressed', {
12080
- channel: this.channelName,
12081
- connector_id: this.connectorId,
12082
- sender_id: senderId ?? null,
12083
- dedup_key: dedupKey,
12084
- age_ms: now - lastSeen,
12085
- ttl_ms: this.ackDedupTtlMs,
12086
- cache_entries: this.seenAckKeys.size,
12087
- });
12088
- return true;
12089
- }
12090
- this.seenAckKeys.set(dedupKey, now);
12091
- this.seenAckOrder.push(dedupKey);
12092
- logger$10.debug('broadcast_channel_duplicate_ack_recorded', {
12093
- channel: this.channelName,
12094
- connector_id: this.connectorId,
12095
- sender_id: senderId ?? null,
12096
- dedup_key: dedupKey,
12097
- cache_entries: this.seenAckKeys.size,
12098
- });
12099
- this._trimSeenAcks(now);
12100
- return false;
12101
- }
12102
- _extractEnvelopeFromInboxItem(item) {
12103
- if (!item || typeof item !== 'object') {
12104
- return null;
12105
- }
12106
- if ('envelope' in item) {
12107
- return item.envelope;
12108
- }
12109
- if ('frame' in item) {
12110
- return item;
12111
- }
12112
- return null;
12113
- }
12114
- _extractSenderIdFromInboxItem(item) {
12115
- if (!item || typeof item !== 'object') {
12116
- return undefined;
12117
- }
12118
- if ('context' in item) {
12119
- const context = item.context;
12120
- if (context && typeof context.fromSystemId === 'string') {
12121
- return context.fromSystemId;
12122
- }
12123
- }
12124
- return undefined;
12125
- }
12126
11994
  /**
12127
11995
  * Override start() to check initial visibility state
12128
11996
  */
@@ -12176,47 +12044,6 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
12176
12044
  target_mode: 'wildcard',
12177
12045
  });
12178
12046
  }
12179
- _trimSeenAcks(now) {
12180
- while (this.seenAckOrder.length > 0) {
12181
- const candidate = this.seenAckOrder[0];
12182
- const timestamp = this.seenAckKeys.get(candidate);
12183
- if (timestamp === undefined) {
12184
- this.seenAckOrder.shift();
12185
- continue;
12186
- }
12187
- if (this.seenAckKeys.size > this.ackDedupMaxEntries ||
12188
- now - timestamp > this.ackDedupTtlMs) {
12189
- this.seenAckKeys.delete(candidate);
12190
- this.seenAckOrder.shift();
12191
- continue;
12192
- }
12193
- break;
12194
- }
12195
- }
12196
- _extractAckDedupKey(payload) {
12197
- try {
12198
- const decoded = this.textDecoder.decode(payload);
12199
- const parsed = JSON.parse(decoded);
12200
- const envelopeId = typeof parsed?.id === 'string' ? parsed.id : null;
12201
- const frameType = parsed?.frame?.type;
12202
- if (typeof frameType !== 'string' || frameType !== 'DeliveryAck') {
12203
- return null;
12204
- }
12205
- const refId = parsed.frame?.refId;
12206
- if (typeof refId === 'string' && refId.length > 0) {
12207
- return refId;
12208
- }
12209
- return envelopeId;
12210
- }
12211
- catch (error) {
12212
- logger$10.debug('broadcast_channel_ack_dedup_parse_failed', {
12213
- channel: this.channelName,
12214
- connector_id: this.connectorId,
12215
- error: error instanceof Error ? error.message : String(error),
12216
- });
12217
- return null;
12218
- }
12219
- }
12220
12047
  };
12221
12048
 
12222
12049
  const BROADCAST_CHANNEL_CONNECTOR_TYPE = 'broadcast-channel-connector';
@@ -22,11 +22,6 @@ export declare class BroadcastChannelConnector extends BaseAsyncConnector {
22
22
  private targetNodeId?;
23
23
  private readonly onMsg;
24
24
  private readonly channel;
25
- private readonly seenAckKeys;
26
- private readonly seenAckOrder;
27
- private readonly ackDedupTtlMs;
28
- private readonly ackDedupMaxEntries;
29
- private readonly textDecoder;
30
25
  private visibilityChangeListenerRegistered;
31
26
  private visibilityChangeHandler?;
32
27
  private static generateConnectorId;
@@ -43,18 +38,11 @@ export declare class BroadcastChannelConnector extends BaseAsyncConnector {
43
38
  private _shouldAcceptMessageFromBus;
44
39
  private _describeInboxItem;
45
40
  private logInboxSnapshot;
46
- private _shouldSkipDuplicateAck;
47
- private _shouldSkipDuplicateAckFromInboxItem;
48
- private _checkDuplicateAck;
49
- private _extractEnvelopeFromInboxItem;
50
- private _extractSenderIdFromInboxItem;
51
41
  /**
52
42
  * Override start() to check initial visibility state
53
43
  */
54
44
  start(inboundHandler: FameEnvelopeHandler): Promise<void>;
55
45
  setTargetNodeId(nodeId: string): void;
56
46
  setWildcardTarget(): void;
57
- private _trimSeenAcks;
58
- private _extractAckDedupKey;
59
47
  }
60
48
  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.965";
5
+ export declare const VERSION = "0.3.5-test.966";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naylence/runtime",
3
- "version": "0.3.5-test.965",
3
+ "version": "0.3.5-test.966",
4
4
  "type": "module",
5
5
  "description": "Naylence Runtime - Complete TypeScript runtime",
6
6
  "author": "Naylence Dev <naylencedev@gmail.com>",