@naylence/runtime 0.3.6 → 0.3.9

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.
Files changed (82) hide show
  1. package/dist/browser/index.cjs +262 -172
  2. package/dist/browser/index.mjs +261 -173
  3. package/dist/cjs/_env-shim.js +3 -1
  4. package/dist/cjs/naylence/fame/config/extended-fame-config.js +2 -1
  5. package/dist/cjs/naylence/fame/connector/broadcast-channel-connector-factory.js +12 -4
  6. package/dist/cjs/naylence/fame/connector/broadcast-channel-connector.browser.js +14 -6
  7. package/dist/cjs/naylence/fame/connector/broadcast-channel-listener-factory.js +3 -1
  8. package/dist/cjs/naylence/fame/connector/broadcast-channel-listener.js +11 -7
  9. package/dist/cjs/naylence/fame/connector/index.js +2 -1
  10. package/dist/cjs/naylence/fame/connector/inpage-connector-factory.js +2 -1
  11. package/dist/cjs/naylence/fame/connector/inpage-connector.js +13 -6
  12. package/dist/cjs/naylence/fame/connector/inpage-listener-factory.js +4 -4
  13. package/dist/cjs/naylence/fame/connector/inpage-listener.js +5 -2
  14. package/dist/cjs/naylence/fame/delivery/default-delivery-tracker.js +4 -62
  15. package/dist/cjs/naylence/fame/fabric/fabric-registry.js +41 -0
  16. package/dist/cjs/naylence/fame/fabric/in-process-fame-fabric.js +3 -0
  17. package/dist/cjs/naylence/fame/fabric/index.js +3 -1
  18. package/dist/cjs/naylence/fame/grants/broadcast-channel-connection-grant.js +6 -3
  19. package/dist/cjs/naylence/fame/grants/inpage-connection-grant.js +4 -2
  20. package/dist/cjs/naylence/fame/http/oauth2-token-router.js +9 -9
  21. package/dist/cjs/naylence/fame/node/admission/default-node-attach-client.js +34 -5
  22. package/dist/cjs/naylence/fame/node/upstream-session-manager.js +40 -8
  23. package/dist/cjs/naylence/fame/security/auth/oauth2-pkce-token-provider-factory.js +10 -6
  24. package/dist/cjs/naylence/fame/security/auth/oauth2-pkce-token-provider.js +1 -2
  25. package/dist/cjs/naylence/fame/security/default-security-manager.js +2 -1
  26. package/dist/cjs/naylence/fame/security/trust-store/noop-trust-store-provider-factory.js +2 -2
  27. package/dist/cjs/naylence/fame/security/trust-store/trust-store-provider-factory.js +2 -2
  28. package/dist/cjs/naylence/fame/util/index.js +3 -1
  29. package/dist/cjs/node.js +4 -1
  30. package/dist/cjs/runtime-isomorphic.js +4 -1
  31. package/dist/cjs/version.js +2 -2
  32. package/dist/esm/_env-shim.js +3 -1
  33. package/dist/esm/browser.js +2 -2
  34. package/dist/esm/naylence/fame/config/extended-fame-config.js +2 -1
  35. package/dist/esm/naylence/fame/connector/broadcast-channel-connector-factory.js +12 -4
  36. package/dist/esm/naylence/fame/connector/broadcast-channel-connector.browser.js +14 -6
  37. package/dist/esm/naylence/fame/connector/broadcast-channel-listener-factory.js +3 -1
  38. package/dist/esm/naylence/fame/connector/broadcast-channel-listener.js +11 -7
  39. package/dist/esm/naylence/fame/connector/index.js +2 -2
  40. package/dist/esm/naylence/fame/connector/inpage-connector-factory.js +2 -1
  41. package/dist/esm/naylence/fame/connector/inpage-connector.js +13 -6
  42. package/dist/esm/naylence/fame/connector/inpage-listener-factory.js +4 -4
  43. package/dist/esm/naylence/fame/connector/inpage-listener.js +5 -2
  44. package/dist/esm/naylence/fame/delivery/default-delivery-tracker.js +4 -62
  45. package/dist/esm/naylence/fame/fabric/fabric-registry.js +37 -0
  46. package/dist/esm/naylence/fame/fabric/in-process-fame-fabric.js +3 -0
  47. package/dist/esm/naylence/fame/fabric/index.js +1 -0
  48. package/dist/esm/naylence/fame/grants/broadcast-channel-connection-grant.js +6 -3
  49. package/dist/esm/naylence/fame/grants/inpage-connection-grant.js +4 -2
  50. package/dist/esm/naylence/fame/http/oauth2-token-router.js +9 -9
  51. package/dist/esm/naylence/fame/node/admission/default-node-attach-client.js +34 -5
  52. package/dist/esm/naylence/fame/node/upstream-session-manager.js +40 -8
  53. package/dist/esm/naylence/fame/security/auth/oauth2-pkce-token-provider-factory.js +10 -6
  54. package/dist/esm/naylence/fame/security/auth/oauth2-pkce-token-provider.js +1 -2
  55. package/dist/esm/naylence/fame/security/default-security-manager.js +2 -1
  56. package/dist/esm/naylence/fame/security/index.js +1 -1
  57. package/dist/esm/naylence/fame/security/trust-store/noop-trust-store-provider-factory.js +3 -3
  58. package/dist/esm/naylence/fame/security/trust-store/trust-store-provider-factory.js +3 -3
  59. package/dist/esm/naylence/fame/util/index.js +1 -0
  60. package/dist/esm/node.js +2 -1
  61. package/dist/esm/runtime-isomorphic.js +2 -0
  62. package/dist/esm/version.js +2 -2
  63. package/dist/node/index.cjs +259 -171
  64. package/dist/node/index.mjs +258 -172
  65. package/dist/node/node.cjs +225 -136
  66. package/dist/node/node.mjs +223 -137
  67. package/dist/types/browser.d.ts +2 -2
  68. package/dist/types/naylence/fame/connector/broadcast-channel-connector-factory.d.ts +1 -0
  69. package/dist/types/naylence/fame/connector/index.d.ts +3 -3
  70. package/dist/types/naylence/fame/delivery/default-delivery-tracker.d.ts +0 -6
  71. package/dist/types/naylence/fame/fabric/fabric-registry.d.ts +29 -0
  72. package/dist/types/naylence/fame/fabric/index.d.ts +1 -0
  73. package/dist/types/naylence/fame/node/admission/default-node-attach-client.d.ts +1 -0
  74. package/dist/types/naylence/fame/security/index.d.ts +1 -1
  75. package/dist/types/naylence/fame/security/trust-store/noop-trust-store-provider-factory.d.ts +3 -3
  76. package/dist/types/naylence/fame/security/trust-store/trust-store-provider-factory.d.ts +4 -4
  77. package/dist/types/naylence/fame/security/trust-store/trust-store-provider.d.ts +5 -5
  78. package/dist/types/naylence/fame/util/index.d.ts +1 -0
  79. package/dist/types/node.d.ts +2 -1
  80. package/dist/types/runtime-isomorphic.d.ts +1 -0
  81. package/dist/types/version.d.ts +1 -1
  82. package/package.json +1 -1
@@ -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.6
5565
+ // Generated from package.json version: 0.3.9
5566
5566
  /**
5567
5567
  * The package version, injected at build time.
5568
5568
  * @internal
5569
5569
  */
5570
- const VERSION = '0.3.6';
5570
+ const VERSION = '0.3.9';
5571
5571
 
5572
5572
  /**
5573
5573
  * Fame errors module - Fame protocol specific error classes
@@ -9726,9 +9726,6 @@ class DefaultDeliveryTracker extends TaskSpawner {
9726
9726
  this.ackDoneSince = new Map();
9727
9727
  this.replyDoneSince = new Map();
9728
9728
  this.pendingAckDispatches = new Set();
9729
- this.recentlyHandled = new Map();
9730
- this.recentlyHandledOrder = [];
9731
- this.recentlyHandledTtlMs = 60000;
9732
9729
  this.isPreparingToStop = false;
9733
9730
  this.shutdownRequestedAtMs = null;
9734
9731
  this.shutdownRetryGraceMs = 1000;
@@ -9964,22 +9961,6 @@ class DefaultDeliveryTracker extends TaskSpawner {
9964
9961
  }
9965
9962
  }
9966
9963
  else {
9967
- const wasRecentlyHandled = await this.lock.runExclusive(async () => this.wasRecentlyHandled(envelope.id));
9968
- if (wasRecentlyHandled) {
9969
- logger$12.debug('tracker_duplicate_envelope_recently_handled', {
9970
- envp_id: envelope.id,
9971
- });
9972
- return new TrackedEnvelope({
9973
- timeoutAtMs: 0,
9974
- overallTimeoutAtMs: 0,
9975
- expectedResponseType: envelope.rtype ?? FameResponseType.NONE,
9976
- createdAtMs: Date.now(),
9977
- status: EnvelopeStatus.HANDLED,
9978
- mailboxType: MailboxType.INBOX,
9979
- originalEnvelope: envelope,
9980
- serviceName: inboxName,
9981
- });
9982
- }
9983
9964
  tracked = new TrackedEnvelope({
9984
9965
  timeoutAtMs: 0,
9985
9966
  overallTimeoutAtMs: 0,
@@ -10001,12 +9982,8 @@ class DefaultDeliveryTracker extends TaskSpawner {
10001
9982
  async onEnvelopeHandled(envelope) {
10002
9983
  const inbox = this.ensureInbox();
10003
9984
  envelope.status = EnvelopeStatus.HANDLED;
9985
+ // Delete the envelope from inbox to prevent growth
10004
9986
  await inbox.delete(envelope.originalEnvelope.id);
10005
- await this.lock.runExclusive(async () => {
10006
- this.markRecentlyHandled(envelope.originalEnvelope.id);
10007
- });
10008
- // Preserve handled envelope to prevent duplicate redelivery during shutdown drains.
10009
- // await inbox.set(envelope.originalEnvelope.id, envelope);
10010
9987
  }
10011
9988
  async onEnvelopeHandleFailed(inboxName, envelope, context, error, isFinalFailure = false) {
10012
9989
  void context;
@@ -10225,9 +10202,9 @@ class DefaultDeliveryTracker extends TaskSpawner {
10225
10202
  });
10226
10203
  await this.markDoneSince(this.replyFutures, trackedEnvelope.originalEnvelope.id, this.replyDoneSince);
10227
10204
  await this.markDoneSince(this.ackFutures, trackedEnvelope.originalEnvelope.id, this.ackDoneSince);
10228
- if (envelope.rtype && Boolean(envelope.rtype & FameResponseType.ACK)) {
10229
- await this.sendAck(envelope);
10230
- }
10205
+ // Note: ACK is already sent in onCorrelatedMessage (lines 655-657)
10206
+ // when the reply envelope is first delivered. No need to send it again here.
10207
+ // Removing this duplicate sendAck call fixes the duplicate DeliveryAck bug.
10231
10208
  for (const handler of this.eventHandlers) {
10232
10209
  await handler.onEnvelopeReplied?.(trackedEnvelope, envelope);
10233
10210
  }
@@ -10377,8 +10354,6 @@ class DefaultDeliveryTracker extends TaskSpawner {
10377
10354
  }
10378
10355
  this.streamDone.clear();
10379
10356
  this.correlationToEnvelope.clear();
10380
- this.recentlyHandled.clear();
10381
- this.recentlyHandledOrder.length = 0;
10382
10357
  return values;
10383
10358
  });
10384
10359
  for (const timer of timers) {
@@ -10960,39 +10935,6 @@ class DefaultDeliveryTracker extends TaskSpawner {
10960
10935
  this.pendingAckDispatches.delete(ackDispatch);
10961
10936
  }
10962
10937
  }
10963
- markRecentlyHandled(envelopeId) {
10964
- const now = Date.now();
10965
- this.recentlyHandled.set(envelopeId, now);
10966
- this.recentlyHandledOrder.push(envelopeId);
10967
- this.trimRecentlyHandled(now);
10968
- }
10969
- wasRecentlyHandled(envelopeId) {
10970
- const now = Date.now();
10971
- const timestamp = this.recentlyHandled.get(envelopeId);
10972
- if (timestamp === undefined) {
10973
- return false;
10974
- }
10975
- if (now - timestamp > this.recentlyHandledTtlMs) {
10976
- this.recentlyHandled.delete(envelopeId);
10977
- return false;
10978
- }
10979
- return true;
10980
- }
10981
- trimRecentlyHandled(now) {
10982
- while (this.recentlyHandledOrder.length > 0) {
10983
- const candidate = this.recentlyHandledOrder[0];
10984
- const timestamp = this.recentlyHandled.get(candidate);
10985
- if (timestamp === undefined) {
10986
- this.recentlyHandledOrder.shift();
10987
- continue;
10988
- }
10989
- if (now - timestamp <= this.recentlyHandledTtlMs) {
10990
- break;
10991
- }
10992
- this.recentlyHandled.delete(candidate);
10993
- this.recentlyHandledOrder.shift();
10994
- }
10995
- }
10996
10938
  getShutdownRetryDeferDelay(nowMs) {
10997
10939
  if (!this.isPreparingToStop || this.shutdownRequestedAtMs === null) {
10998
10940
  return null;
@@ -11569,7 +11511,8 @@ const ensureBroadcastEnvironment = () => {
11569
11511
  };
11570
11512
  let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAsyncConnector {
11571
11513
  static generateConnectorId() {
11572
- const globalCrypto = globalThis.crypto;
11514
+ const globalCrypto = globalThis
11515
+ .crypto;
11573
11516
  if (globalCrypto?.randomUUID) {
11574
11517
  return globalCrypto.randomUUID();
11575
11518
  }
@@ -11624,7 +11567,8 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11624
11567
  this.listenerRegistered = false;
11625
11568
  this.visibilityChangeListenerRegistered = false;
11626
11569
  this.channelName =
11627
- typeof config.channelName === 'string' && config.channelName.trim().length > 0
11570
+ typeof config.channelName === 'string' &&
11571
+ config.channelName.trim().length > 0
11628
11572
  ? config.channelName.trim()
11629
11573
  : DEFAULT_CHANNEL$7;
11630
11574
  const preferredCapacity = typeof config.inboxCapacity === 'number' &&
@@ -11648,6 +11592,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11648
11592
  local_node_id: this.localNodeId,
11649
11593
  target_node_id: this.targetNodeId ?? null,
11650
11594
  inbox_capacity: preferredCapacity,
11595
+ passive: config.passive ?? false,
11651
11596
  timestamp: new Date().toISOString(),
11652
11597
  });
11653
11598
  this.onMsg = (event) => {
@@ -11665,7 +11610,8 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11665
11610
  channel: this.channelName,
11666
11611
  connector_id: this.connectorId,
11667
11612
  message_type: message && typeof message === 'object'
11668
- ? message.constructor?.name ?? typeof message
11613
+ ? (message.constructor
11614
+ ?.name ?? typeof message)
11669
11615
  : typeof message,
11670
11616
  has_sender_id: Boolean(message?.senderId),
11671
11617
  has_sender_node_id: Boolean(message?.senderNodeId),
@@ -11895,7 +11841,9 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11895
11841
  timestamp: new Date().toISOString(),
11896
11842
  });
11897
11843
  }
11898
- if (this.visibilityChangeListenerRegistered && this.visibilityChangeHandler && typeof document !== 'undefined') {
11844
+ if (this.visibilityChangeListenerRegistered &&
11845
+ this.visibilityChangeHandler &&
11846
+ typeof document !== 'undefined') {
11899
11847
  document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
11900
11848
  this.visibilityChangeListenerRegistered = false;
11901
11849
  this.visibilityChangeHandler = undefined;
@@ -11923,7 +11871,7 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11923
11871
  return rawOrEnvelope;
11924
11872
  }
11925
11873
  _isWildcardTarget() {
11926
- return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
11874
+ return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
11927
11875
  }
11928
11876
  _shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
11929
11877
  if (this._isWildcardTarget()) {
@@ -11943,7 +11891,9 @@ let BroadcastChannelConnector$2 = class BroadcastChannelConnector extends BaseAs
11943
11891
  return true;
11944
11892
  }
11945
11893
  const expectedSender = this.targetNodeId;
11946
- if (expectedSender && expectedSender !== '*' && senderNodeId !== expectedSender) {
11894
+ if (expectedSender &&
11895
+ expectedSender !== '*' &&
11896
+ senderNodeId !== expectedSender) {
11947
11897
  logger$10.debug('broadcast_channel_message_rejected', {
11948
11898
  channel: this.channelName,
11949
11899
  connector_id: this.connectorId,
@@ -12117,14 +12067,16 @@ function normalizeBroadcastChannelConnectionGrant(candidate) {
12117
12067
  type,
12118
12068
  purpose,
12119
12069
  };
12120
- const channelValue = candidate.channelName ?? candidate['channel_name'];
12070
+ const channelValue = candidate.channelName ??
12071
+ candidate['channel_name'];
12121
12072
  if (channelValue !== undefined) {
12122
12073
  if (typeof channelValue !== 'string' || channelValue.trim().length === 0) {
12123
12074
  throw new TypeError('BroadcastChannelConnectionGrant "channelName" must be a non-empty string when provided');
12124
12075
  }
12125
12076
  result.channelName = channelValue.trim();
12126
12077
  }
12127
- const inboxValue = candidate.inboxCapacity ?? candidate['inbox_capacity'];
12078
+ const inboxValue = candidate.inboxCapacity ??
12079
+ candidate['inbox_capacity'];
12128
12080
  if (inboxValue !== undefined) {
12129
12081
  if (typeof inboxValue !== 'number' ||
12130
12082
  !Number.isFinite(inboxValue) ||
@@ -12133,7 +12085,8 @@ function normalizeBroadcastChannelConnectionGrant(candidate) {
12133
12085
  }
12134
12086
  result.inboxCapacity = Math.floor(inboxValue);
12135
12087
  }
12136
- const windowValue = candidate.initialWindow ?? candidate['initial_window'];
12088
+ const windowValue = candidate.initialWindow ??
12089
+ candidate['initial_window'];
12137
12090
  if (windowValue !== undefined) {
12138
12091
  if (typeof windowValue !== 'number' ||
12139
12092
  !Number.isFinite(windowValue) ||
@@ -12470,25 +12423,56 @@ class UpstreamSessionManager extends TaskSpawner {
12470
12423
  await connector.start(this.wrappedHandler);
12471
12424
  this.connector = connector;
12472
12425
  const callbackGrants = this.node.gatherSupportedCallbackGrants();
12426
+ logger$$.debug('callback_grants_before_augmentation', {
12427
+ count: callbackGrants.length,
12428
+ types: callbackGrants.map((g) => g.type),
12429
+ });
12430
+ // Check if we should create a broadcast callback grant before processing connection grants
12431
+ // This prevents adding duplicate broadcast grants
12432
+ const shouldAddBroadcastGrant = this.shouldAdvertiseBroadcastGrant(grant, callbackGrants);
12433
+ const broadcastCallbackGrant = shouldAddBroadcastGrant
12434
+ ? this.createBroadcastCallbackGrant(grant)
12435
+ : null;
12436
+ logger$$.debug('broadcast_callback_grant_check', {
12437
+ should_add: shouldAddBroadcastGrant,
12438
+ grant_created: !!broadcastCallbackGrant,
12439
+ });
12473
12440
  // Include admission client's connection grants as callback grants
12474
12441
  // This ensures DirectAdmissionClient grants are available for grant selection
12475
- if (welcome.frame.connectionGrants && Array.isArray(welcome.frame.connectionGrants)) {
12442
+ if (welcome.frame.connectionGrants &&
12443
+ Array.isArray(welcome.frame.connectionGrants)) {
12476
12444
  for (const grant of welcome.frame.connectionGrants) {
12477
12445
  if (grant && typeof grant === 'object') {
12478
12446
  // Avoid duplicates by checking if grant already exists
12479
- const isDuplicate = callbackGrants.some(existing => JSON.stringify(existing) === JSON.stringify(grant));
12447
+ const isDuplicate = callbackGrants.some((existing) => JSON.stringify(existing) === JSON.stringify(grant));
12480
12448
  if (!isDuplicate) {
12481
12449
  callbackGrants.push(grant);
12450
+ logger$$.debug('added_connection_grant_as_callback', {
12451
+ type: grant.type,
12452
+ });
12453
+ }
12454
+ else {
12455
+ logger$$.debug('skipped_duplicate_connection_grant', {
12456
+ type: grant.type,
12457
+ });
12482
12458
  }
12483
12459
  }
12484
12460
  }
12485
12461
  }
12486
- if (this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
12487
- const augmented = this.createBroadcastCallbackGrant(grant);
12488
- if (augmented) {
12489
- callbackGrants.push(augmented);
12490
- }
12462
+ // Add broadcast grant after connection grants to ensure we don't duplicate
12463
+ // any broadcast grants that may have been in connectionGrants
12464
+ if (broadcastCallbackGrant &&
12465
+ this.shouldAdvertiseBroadcastGrant(grant, callbackGrants)) {
12466
+ callbackGrants.push(broadcastCallbackGrant);
12467
+ logger$$.debug('added_broadcast_callback_grant');
12491
12468
  }
12469
+ else if (broadcastCallbackGrant) {
12470
+ logger$$.debug('skipped_duplicate_broadcast_callback_grant');
12471
+ }
12472
+ logger$$.debug('callback_grants_after_augmentation', {
12473
+ count: callbackGrants.length,
12474
+ types: callbackGrants.map((g) => g.type),
12475
+ });
12492
12476
  const attachInfo = await this.attachClient.attach(this.node, this.outboundOriginType, connector, welcome.frame, this.wrappedHandler, this.getKeys() ?? undefined, callbackGrants);
12493
12477
  this.targetSystemId = attachInfo.targetSystemId ?? null;
12494
12478
  if (this.targetSystemId) {
@@ -12729,7 +12713,8 @@ class UpstreamSessionManager extends TaskSpawner {
12729
12713
  continue;
12730
12714
  }
12731
12715
  // Reset ack time if just resumed from pause (prevents immediate timeout)
12732
- if (previousState === ConnectorState.PAUSED && currentState === ConnectorState.STARTED) {
12716
+ if (previousState === ConnectorState.PAUSED &&
12717
+ currentState === ConnectorState.STARTED) {
12733
12718
  logger$$.debug('connector_just_resumed_resetting_ack_time', {
12734
12719
  previous_state: previousState,
12735
12720
  current_state: currentState,
@@ -14286,15 +14271,30 @@ class DefaultNodeAttachClient {
14286
14271
  constructor(options = {}) {
14287
14272
  this.buffer = [];
14288
14273
  this.inHandshake = false;
14274
+ this.expectedSystemId = null;
14289
14275
  this.timeoutMs = options.timeoutMs ?? 10000;
14290
14276
  this.attachmentKeyValidator = options.attachmentKeyValidator;
14291
14277
  this.replicaStickinessManager = options.replicaStickinessManager ?? null;
14292
14278
  }
14293
14279
  async attach(node, originType, connector, welcomeFrame, finalHandler, keys, callbackGrants) {
14294
14280
  this.inHandshake = true;
14281
+ this.expectedSystemId = welcomeFrame.systemId;
14295
14282
  const interimHandler = async (envelope, context) => {
14296
14283
  if (this.inHandshake) {
14297
- this.buffer.push(envelope);
14284
+ // Filter: only buffer frames related to our systemId or frames without systemId info
14285
+ const frameSystemId = envelope.frame
14286
+ ?.systemId;
14287
+ if (!frameSystemId || frameSystemId === this.expectedSystemId) {
14288
+ this.buffer.push(envelope);
14289
+ }
14290
+ else {
14291
+ // Silently ignore frames from other agents during concurrent handshakes
14292
+ logger$Y.debug('handshake_ignoring_frame_from_different_system', {
14293
+ frame_type: envelope.frame.type,
14294
+ frame_system_id: frameSystemId,
14295
+ expected_system_id: this.expectedSystemId,
14296
+ });
14297
+ }
14298
14298
  return null;
14299
14299
  }
14300
14300
  return finalHandler(envelope, context);
@@ -14421,6 +14421,7 @@ class DefaultNodeAttachClient {
14421
14421
  parent_id: ackFrame.targetSystemId,
14422
14422
  });
14423
14423
  this.inHandshake = false;
14424
+ this.expectedSystemId = null;
14424
14425
  await connector.replaceHandler(finalHandler);
14425
14426
  while (this.buffer.length > 0) {
14426
14427
  const bufferedEnvelope = this.buffer.shift();
@@ -14478,7 +14479,8 @@ class DefaultNodeAttachClient {
14478
14479
  const deadline = Date.now() + this.timeoutMs;
14479
14480
  while (Date.now() < deadline) {
14480
14481
  // Allow both STARTED and PAUSED states (PAUSED = tab hidden but connection alive)
14481
- if (connector.state !== ConnectorState.STARTED && connector.state !== ConnectorState.PAUSED) {
14482
+ if (connector.state !== ConnectorState.STARTED &&
14483
+ connector.state !== ConnectorState.PAUSED) {
14482
14484
  let errorMessage = 'Connector closed while waiting for NodeAttachAck';
14483
14485
  if (connector.closeCode !== undefined) {
14484
14486
  errorMessage += ` (code=${connector.closeCode}`;
@@ -14497,9 +14499,21 @@ class DefaultNodeAttachClient {
14497
14499
  if (envelope.frame.type === 'NodeAttachAck') {
14498
14500
  return envelope;
14499
14501
  }
14500
- logger$Y.error('unexpected_frame_during_handshake', {
14501
- frame_type: envelope.frame.type,
14502
- });
14502
+ // NodeAttach frames during handshake are expected in multi-agent scenarios
14503
+ // where multiple agents attach concurrently to the same channel
14504
+ if (envelope.frame.type === 'NodeAttach') {
14505
+ logger$Y.debug('handshake_ignoring_concurrent_attach', {
14506
+ frame_type: envelope.frame.type,
14507
+ frame_system_id: envelope.frame?.systemId ??
14508
+ 'unknown',
14509
+ });
14510
+ }
14511
+ else {
14512
+ // Other unexpected frames are still logged as errors
14513
+ logger$Y.error('unexpected_frame_during_handshake', {
14514
+ frame_type: envelope.frame.type,
14515
+ });
14516
+ }
14503
14517
  }
14504
14518
  await delay(HANDSHAKE_POLL_INTERVAL_MS);
14505
14519
  }
@@ -15218,7 +15232,8 @@ function createFsShim() {
15218
15232
  else if (options &&
15219
15233
  typeof options === 'object' &&
15220
15234
  'encoding' in options &&
15221
- typeof options.encoding === 'string') {
15235
+ typeof options.encoding ===
15236
+ 'string') {
15222
15237
  encoding = options.encoding;
15223
15238
  }
15224
15239
  const data = fsBinding.readFileUtf8(pathOrDescriptor, 0);
@@ -21637,7 +21652,8 @@ class InPageConnector extends BaseAsyncConnector {
21637
21652
  this.listenerRegistered = false;
21638
21653
  this.visibilityChangeListenerRegistered = false;
21639
21654
  this.channelName =
21640
- typeof config.channelName === 'string' && config.channelName.trim().length > 0
21655
+ typeof config.channelName === 'string' &&
21656
+ config.channelName.trim().length > 0
21641
21657
  ? config.channelName.trim()
21642
21658
  : DEFAULT_CHANNEL$6;
21643
21659
  const preferredCapacity = typeof config.inboxCapacity === 'number' &&
@@ -21676,7 +21692,8 @@ class InPageConnector extends BaseAsyncConnector {
21676
21692
  channel: this.channelName,
21677
21693
  connector_id: this.connectorId,
21678
21694
  message_type: message && typeof message === 'object'
21679
- ? message.constructor?.name ?? typeof message
21695
+ ? (message.constructor
21696
+ ?.name ?? typeof message)
21680
21697
  : typeof message,
21681
21698
  has_sender_id: Boolean(message?.senderId),
21682
21699
  has_sender_node_id: Boolean(message?.senderNodeId),
@@ -21685,7 +21702,8 @@ class InPageConnector extends BaseAsyncConnector {
21685
21702
  return;
21686
21703
  }
21687
21704
  const busMessage = message;
21688
- const senderId = typeof busMessage.senderId === 'string' && busMessage.senderId.length > 0
21705
+ const senderId = typeof busMessage.senderId === 'string' &&
21706
+ busMessage.senderId.length > 0
21689
21707
  ? busMessage.senderId
21690
21708
  : null;
21691
21709
  const senderNodeId = InPageConnector.normalizeNodeId(busMessage.senderNodeId);
@@ -21936,7 +21954,9 @@ class InPageConnector extends BaseAsyncConnector {
21936
21954
  timestamp: new Date().toISOString(),
21937
21955
  });
21938
21956
  }
21939
- if (this.visibilityChangeListenerRegistered && this.visibilityChangeHandler && typeof document !== 'undefined') {
21957
+ if (this.visibilityChangeListenerRegistered &&
21958
+ this.visibilityChangeHandler &&
21959
+ typeof document !== 'undefined') {
21940
21960
  document.removeEventListener('visibilitychange', this.visibilityChangeHandler);
21941
21961
  this.visibilityChangeListenerRegistered = false;
21942
21962
  this.visibilityChangeHandler = undefined;
@@ -21953,7 +21973,7 @@ class InPageConnector extends BaseAsyncConnector {
21953
21973
  return rawOrEnvelope;
21954
21974
  }
21955
21975
  _isWildcardTarget() {
21956
- return this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined';
21976
+ return (this.targetNodeId === '*' || typeof this.targetNodeId === 'undefined');
21957
21977
  }
21958
21978
  _shouldAcceptMessageFromBus(senderNodeId, targetNodeId) {
21959
21979
  if (this._isWildcardTarget()) {
@@ -21973,7 +21993,9 @@ class InPageConnector extends BaseAsyncConnector {
21973
21993
  return true;
21974
21994
  }
21975
21995
  const expectedSender = this.targetNodeId;
21976
- if (expectedSender && expectedSender !== '*' && senderNodeId !== expectedSender) {
21996
+ if (expectedSender &&
21997
+ expectedSender !== '*' &&
21998
+ senderNodeId !== expectedSender) {
21977
21999
  logger$J.debug('inpage_message_rejected', {
21978
22000
  channel: this.channelName,
21979
22001
  connector_id: this.connectorId,
@@ -22375,8 +22397,8 @@ class CertificateManagerFactory extends AbstractResourceFactory {
22375
22397
  }
22376
22398
  }
22377
22399
 
22378
- const DEFAULT_UNCONFIGURED_MESSAGE = "Trust store is not configured. Set FAME_CA_CERTS to a PEM value, a file path, a data URI, or an HTTPS bundle URL.";
22379
- const TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE = "TrustStoreProviderFactory";
22400
+ const DEFAULT_UNCONFIGURED_MESSAGE = 'Trust store is not configured. Set FAME_CA_CERTS to a PEM value, a file path, a data URI, or an HTTPS bundle URL.';
22401
+ const TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE = 'TrustStoreProviderFactory';
22380
22402
  class TrustStoreProviderFactory extends AbstractResourceFactory {
22381
22403
  createUnconfiguredProvider(reason) {
22382
22404
  return new NoopTrustStoreProvider(reason ?? DEFAULT_UNCONFIGURED_MESSAGE);
@@ -26105,7 +26127,8 @@ class DefaultSecurityManager {
26105
26127
  const hasSignature = Boolean(envelope.sec?.sig);
26106
26128
  if (!hasSignature) {
26107
26129
  const nodeSid = node.sid;
26108
- const envelopeSid = envelope.sid;
26130
+ const envelopeSid = envelope
26131
+ .sid;
26109
26132
  const isLocalUnsignedSelfEnvelope = localContext.originType === DeliveryOriginType.LOCAL &&
26110
26133
  typeof nodeSid === 'string' &&
26111
26134
  nodeSid.length > 0 &&
@@ -29349,14 +29372,16 @@ function normalizeInPageConnectionGrant(candidate) {
29349
29372
  type,
29350
29373
  purpose,
29351
29374
  };
29352
- const channelValue = candidate.channelName ?? candidate['channel_name'];
29375
+ const channelValue = candidate.channelName ??
29376
+ candidate['channel_name'];
29353
29377
  if (channelValue !== undefined) {
29354
29378
  if (typeof channelValue !== 'string' || channelValue.trim().length === 0) {
29355
29379
  throw new TypeError('InPageConnectionGrant "channelName" must be a non-empty string when provided');
29356
29380
  }
29357
29381
  result.channelName = channelValue.trim();
29358
29382
  }
29359
- const inboxValue = candidate.inboxCapacity ?? candidate['inbox_capacity'];
29383
+ const inboxValue = candidate.inboxCapacity ??
29384
+ candidate['inbox_capacity'];
29360
29385
  if (inboxValue !== undefined) {
29361
29386
  if (typeof inboxValue !== 'number' ||
29362
29387
  !Number.isFinite(inboxValue) ||
@@ -29872,6 +29897,44 @@ function normalizeRouterOptions(options) {
29872
29897
  return { welcomeService, prefix };
29873
29898
  }
29874
29899
 
29900
+ /**
29901
+ * Fabric Registry
29902
+ *
29903
+ * Provides a mapping from nodes to their associated fabrics.
29904
+ * This allows agents to retrieve the fabric they were registered on
29905
+ * without relying on the global fabric stack.
29906
+ */
29907
+ /**
29908
+ * WeakMap to store the node-to-fabric mapping.
29909
+ * Using WeakMap ensures that nodes can be garbage collected
29910
+ * when no longer referenced elsewhere.
29911
+ */
29912
+ const nodeToFabric = new WeakMap();
29913
+ /**
29914
+ * @internal
29915
+ * Associates a node with its fabric. This should only be called
29916
+ * by fabric implementations when they create or adopt a node.
29917
+ *
29918
+ * @param node - The node to associate
29919
+ * @param fabric - The fabric that owns the node
29920
+ */
29921
+ function _setFabricForNode(node, fabric) {
29922
+ nodeToFabric.set(node, fabric);
29923
+ }
29924
+ /**
29925
+ * Retrieves the fabric associated with a node.
29926
+ *
29927
+ * This is useful for agents that need to access the fabric they
29928
+ * were registered on, particularly in environments where multiple
29929
+ * fabrics exist (e.g., React with multiple FabricProviders).
29930
+ *
29931
+ * @param node - The node to look up
29932
+ * @returns The fabric associated with the node, or undefined if not found
29933
+ */
29934
+ function getFabricForNode(node) {
29935
+ return nodeToFabric.get(node);
29936
+ }
29937
+
29875
29938
  /**
29876
29939
  * Browser-friendly entry point for Naylence Runtime.
29877
29940
  *
@@ -30162,7 +30225,9 @@ function normalizeConfig$p(config) {
30162
30225
  : DEFAULT_CHANNEL$5;
30163
30226
  const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
30164
30227
  let inboxCapacity = DEFAULT_INBOX_CAPACITY$5;
30165
- if (typeof rawInbox === 'number' && Number.isFinite(rawInbox) && rawInbox > 0) {
30228
+ if (typeof rawInbox === 'number' &&
30229
+ Number.isFinite(rawInbox) &&
30230
+ rawInbox > 0) {
30166
30231
  inboxCapacity = Math.floor(rawInbox);
30167
30232
  }
30168
30233
  else if (typeof rawInbox === 'string') {
@@ -30190,9 +30255,7 @@ class InPageListenerFactory extends TransportListenerFactory {
30190
30255
  }
30191
30256
  async create(config, ...factoryArgs) {
30192
30257
  const normalized = normalizeConfig$p(config);
30193
- const [{ InPageListener }] = await Promise.all([
30194
- getInPageListenerModule(),
30195
- ]);
30258
+ const [{ InPageListener }] = await Promise.all([getInPageListenerModule()]);
30196
30259
  void factoryArgs;
30197
30260
  return new InPageListener({
30198
30261
  channelName: normalized.channelName,
@@ -30225,7 +30288,9 @@ function normalizeConfig$o(config) {
30225
30288
  : DEFAULT_CHANNEL$4;
30226
30289
  const rawInbox = record.inboxCapacity ?? record['inbox_capacity'];
30227
30290
  let inboxCapacity = DEFAULT_INBOX_CAPACITY$4;
30228
- if (typeof rawInbox === 'number' && Number.isFinite(rawInbox) && rawInbox > 0) {
30291
+ if (typeof rawInbox === 'number' &&
30292
+ Number.isFinite(rawInbox) &&
30293
+ rawInbox > 0) {
30229
30294
  inboxCapacity = Math.floor(rawInbox);
30230
30295
  }
30231
30296
  else if (typeof rawInbox === 'string') {
@@ -30630,7 +30695,8 @@ class InPageConnectorFactory extends ConnectorFactory {
30630
30695
  const normalized = this._normalizeConfig(config);
30631
30696
  const options = (factoryArgs[0] ?? {});
30632
30697
  const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
30633
- const localNodeId = this._normalizeNodeId(options.localNodeId) ?? normalizedLocalNodeFromConfig;
30698
+ const localNodeId = this._normalizeNodeId(options.localNodeId) ??
30699
+ normalizedLocalNodeFromConfig;
30634
30700
  if (!localNodeId) {
30635
30701
  throw new Error('InPageConnectorFactory requires a localNodeId from config or create() options');
30636
30702
  }
@@ -30806,10 +30872,12 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
30806
30872
  type: BROADCAST_CHANNEL_CONNECTOR_TYPE$1,
30807
30873
  };
30808
30874
  const channelCandidate = record.channelName ?? record['channel_name'];
30809
- if (typeof channelCandidate === 'string' && channelCandidate.trim().length > 0) {
30875
+ if (typeof channelCandidate === 'string' &&
30876
+ channelCandidate.trim().length > 0) {
30810
30877
  config.channelName = channelCandidate.trim();
30811
30878
  }
30812
- const inboxCandidate = record.inboxCapacity ?? record['inbox_capacity'];
30879
+ const inboxCandidate = record.inboxCapacity ??
30880
+ record['inbox_capacity'];
30813
30881
  if (typeof inboxCandidate === 'number' &&
30814
30882
  Number.isFinite(inboxCandidate) &&
30815
30883
  inboxCandidate > 0) {
@@ -30833,9 +30901,11 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
30833
30901
  throw new Error('BroadcastChannelConnectorFactory requires a configuration');
30834
30902
  }
30835
30903
  const normalized = this._normalizeConfig(config);
30836
- const options = (factoryArgs[0] ?? {});
30904
+ const options = (factoryArgs[0] ??
30905
+ {});
30837
30906
  const normalizedLocalNodeFromConfig = this._normalizeNodeId(normalized.localNodeId);
30838
- const localNodeId = this._normalizeNodeId(options.localNodeId) ?? normalizedLocalNodeFromConfig;
30907
+ const localNodeId = this._normalizeNodeId(options.localNodeId) ??
30908
+ normalizedLocalNodeFromConfig;
30839
30909
  if (!localNodeId) {
30840
30910
  throw new Error('BroadcastChannelConnectorFactory requires a localNodeId from config or create() options');
30841
30911
  }
@@ -30860,6 +30930,7 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
30860
30930
  inboxCapacity,
30861
30931
  localNodeId,
30862
30932
  initialTargetNodeId: resolvedTarget,
30933
+ passive: normalized.passive,
30863
30934
  };
30864
30935
  const connector = new BroadcastChannelConnector(connectorConfig, baseConfig);
30865
30936
  if (options.authorization) {
@@ -30898,6 +30969,9 @@ class BroadcastChannelConnectorFactory extends ConnectorFactory {
30898
30969
  if (normalizedLocalNodeId) {
30899
30970
  normalized.localNodeId = normalizedLocalNodeId;
30900
30971
  }
30972
+ if (typeof candidate.passive === 'boolean') {
30973
+ normalized.passive = candidate.passive;
30974
+ }
30901
30975
  if (typeof candidate.flowControl === 'boolean') {
30902
30976
  normalized.flowControl = candidate.flowControl;
30903
30977
  }
@@ -32439,7 +32513,9 @@ class InPageListener extends TransportListener {
32439
32513
  typeof channelCandidate === 'string' && channelCandidate.trim().length > 0
32440
32514
  ? channelCandidate.trim()
32441
32515
  : DEFAULT_CHANNEL$1;
32442
- const normalizedCapacity = typeof inboxCandidate === 'number' && Number.isFinite(inboxCandidate) && inboxCandidate > 0
32516
+ const normalizedCapacity = typeof inboxCandidate === 'number' &&
32517
+ Number.isFinite(inboxCandidate) &&
32518
+ inboxCandidate > 0
32443
32519
  ? Math.floor(inboxCandidate)
32444
32520
  : DEFAULT_INBOX_CAPACITY$1;
32445
32521
  this._inboxCapacity = normalizedCapacity;
@@ -32714,7 +32790,8 @@ class InPageListener extends TransportListener {
32714
32790
  if (grant.type === INPAGE_CONNECTION_GRANT_TYPE) {
32715
32791
  return inPageGrantToConnectorConfig(grant);
32716
32792
  }
32717
- if (typeof grant?.toConnectorConfig === 'function') {
32793
+ if (typeof grant
32794
+ ?.toConnectorConfig === 'function') {
32718
32795
  return grant.toConnectorConfig();
32719
32796
  }
32720
32797
  throw new Error(`Unsupported grant type: ${grant.type}`);
@@ -32854,9 +32931,7 @@ var inpageListener = /*#__PURE__*/Object.freeze({
32854
32931
  const logger$n = getLogger('naylence.fame.connector.broadcast_channel_listener');
32855
32932
  const DEFAULT_CHANNEL = 'naylence-fabric';
32856
32933
  const DEFAULT_INBOX_CAPACITY = 2048;
32857
- const RESPONSE_TYPE_MASK = FameResponseType.ACK |
32858
- FameResponseType.REPLY |
32859
- FameResponseType.STREAM;
32934
+ const RESPONSE_TYPE_MASK = FameResponseType.ACK | FameResponseType.REPLY | FameResponseType.STREAM;
32860
32935
  const isBrowserEnvironment$1 = () => typeof window !== 'undefined' &&
32861
32936
  typeof BroadcastChannel !== 'undefined' &&
32862
32937
  typeof MessageEvent !== 'undefined';
@@ -33070,9 +33145,7 @@ class BroadcastChannelListener extends TransportListener {
33070
33145
  return null;
33071
33146
  }
33072
33147
  })();
33073
- if (error instanceof ZodError &&
33074
- decoded &&
33075
- decoded.length > 0) {
33148
+ if (error instanceof ZodError && decoded && decoded.length > 0) {
33076
33149
  try {
33077
33150
  const reparsed = JSON.parse(decoded);
33078
33151
  const candidate = reparsed.rtype;
@@ -33295,11 +33368,19 @@ class BroadcastChannelListener extends TransportListener {
33295
33368
  ? Math.floor(initialWindowCandidate)
33296
33369
  : undefined;
33297
33370
  const initialTargetNodeId = this._normalizeNodeId(targetCandidate) ?? targetSystemId;
33371
+ const passive = typeof passiveCandidate === 'boolean' ? passiveCandidate : true;
33372
+ logger$n.debug('broadcast_channel_listener_building_connector_config', {
33373
+ system_id: systemId,
33374
+ channel_name: channelName,
33375
+ passive,
33376
+ has_base_config: !!baseConfig,
33377
+ passive_candidate: passiveCandidate,
33378
+ });
33298
33379
  return {
33299
33380
  type: BROADCAST_CHANNEL_CONNECTOR_TYPE$1,
33300
33381
  channelName,
33301
33382
  inboxCapacity,
33302
- passive: typeof passiveCandidate === 'boolean' ? passiveCandidate : true,
33383
+ passive,
33303
33384
  initialWindow,
33304
33385
  localNodeId,
33305
33386
  initialTargetNodeId,
@@ -33488,6 +33569,8 @@ class InProcessFameFabric extends FameFabric {
33488
33569
  this._currentNode = await NodeLikeFactory.createNode(nodeConfig);
33489
33570
  this._ownsNode = true;
33490
33571
  }
33572
+ // Register this fabric in the registry so agents can look it up
33573
+ _setFabricForNode(this._currentNode, this);
33491
33574
  if (this._ownsNode && !this._nodeStarted) {
33492
33575
  await this.getRequiredNode().start();
33493
33576
  this._nodeStarted = true;
@@ -34169,7 +34252,9 @@ function parseCookies(cookieHeader) {
34169
34252
  if (!cookieHeader) {
34170
34253
  return {};
34171
34254
  }
34172
- return cookieHeader.split(';').reduce((acc, entry) => {
34255
+ return cookieHeader
34256
+ .split(';')
34257
+ .reduce((acc, entry) => {
34173
34258
  const [rawName, ...rawValueParts] = entry.split('=');
34174
34259
  const name = rawName?.trim();
34175
34260
  if (!name) {
@@ -34317,10 +34402,7 @@ function setNoCacheHeaders(res) {
34317
34402
  res.set('Pragma', 'no-cache');
34318
34403
  }
34319
34404
  function respondInvalidClient(res) {
34320
- res
34321
- .status(401)
34322
- .set('WWW-Authenticate', 'Basic')
34323
- .json({
34405
+ res.status(401).set('WWW-Authenticate', 'Basic').json({
34324
34406
  error: 'invalid_client',
34325
34407
  error_description: 'Invalid client credentials',
34326
34408
  });
@@ -34357,10 +34439,10 @@ function createOAuth2TokenRouter(options) {
34357
34439
  DEFAULT_JWT_ALGORITHM$1;
34358
34440
  const allowedScopes = getAllowedScopes$1(configAllowedScopes);
34359
34441
  const resolvedTokenTtlSec = tokenTtlSec ?? 3600;
34360
- const enablePkce = coerceBoolean(process.env[ENV_VAR_ENABLE_PKCE]) ??
34361
- (configEnablePkce ?? true);
34442
+ const enablePkce = coerceBoolean(process.env[ENV_VAR_ENABLE_PKCE]) ?? configEnablePkce ?? true;
34362
34443
  const allowPublicClients = coerceBoolean(process.env[ENV_VAR_ALLOW_PUBLIC_CLIENTS]) ??
34363
- (configAllowPublicClients ?? true);
34444
+ configAllowPublicClients ??
34445
+ true;
34364
34446
  const authorizationCodeTtlSec = ensurePositiveInteger(coerceNumber$1(process.env[ENV_VAR_AUTHORIZATION_CODE_TTL]) ??
34365
34447
  configAuthorizationCodeTtlSec) ?? DEFAULT_AUTHORIZATION_CODE_TTL_SEC;
34366
34448
  const devLoginExplicitlyEnabled = coerceBoolean(process.env[ENV_VAR_ENABLE_DEV_LOGIN]) ??
@@ -34375,7 +34457,8 @@ function createOAuth2TokenRouter(options) {
34375
34457
  configDevLoginCookieName ??
34376
34458
  DEFAULT_SESSION_COOKIE_NAME;
34377
34459
  const devLoginSecureCookie = coerceBoolean(process.env[ENV_VAR_SESSION_SECURE_COOKIE]) ??
34378
- (configDevLoginSecureCookie ?? false);
34460
+ configDevLoginSecureCookie ??
34461
+ false;
34379
34462
  const devLoginTitle = coerceString$2(process.env[ENV_VAR_LOGIN_TITLE]) ??
34380
34463
  configDevLoginTitle ??
34381
34464
  DEFAULT_LOGIN_TITLE;
@@ -37442,19 +37525,23 @@ function normalizeConfig$a(config) {
37442
37525
  normalized.clientSecretConfig = normalizeSecretSource(clientSecretSource);
37443
37526
  }
37444
37527
  const audienceCandidate = candidate.audience ?? candidate.aud;
37445
- if (typeof audienceCandidate === 'string' && audienceCandidate.trim().length > 0) {
37528
+ if (typeof audienceCandidate === 'string' &&
37529
+ audienceCandidate.trim().length > 0) {
37446
37530
  normalized.audience = audienceCandidate.trim();
37447
37531
  }
37448
37532
  const codeChallengeMethod = candidate.codeChallengeMethod ?? candidate.code_challenge_method;
37449
- if (typeof codeChallengeMethod === 'string' && codeChallengeMethod.trim().length > 0) {
37533
+ if (typeof codeChallengeMethod === 'string' &&
37534
+ codeChallengeMethod.trim().length > 0) {
37450
37535
  normalized.codeChallengeMethod = codeChallengeMethod.trim();
37451
37536
  }
37452
37537
  const codeVerifierLength = candidate.codeVerifierLength ?? candidate.code_verifier_length;
37453
- if (typeof codeVerifierLength === 'number' && Number.isFinite(codeVerifierLength)) {
37538
+ if (typeof codeVerifierLength === 'number' &&
37539
+ Number.isFinite(codeVerifierLength)) {
37454
37540
  normalized.codeVerifierLength = codeVerifierLength;
37455
37541
  }
37456
37542
  const clockSkewSeconds = candidate.clockSkewSeconds ?? candidate.clock_skew_seconds;
37457
- if (typeof clockSkewSeconds === 'number' && Number.isFinite(clockSkewSeconds)) {
37543
+ if (typeof clockSkewSeconds === 'number' &&
37544
+ Number.isFinite(clockSkewSeconds)) {
37458
37545
  normalized.clockSkewSeconds = clockSkewSeconds;
37459
37546
  }
37460
37547
  const loginHintParam = candidate.loginHintParam ?? candidate.login_hint_param;
@@ -37499,8 +37586,8 @@ class OAuth2PkceTokenProviderFactory extends TokenProviderFactory {
37499
37586
  options.audience = normalized.audience;
37500
37587
  }
37501
37588
  if (normalized.codeChallengeMethod) {
37502
- options.codeChallengeMethod = normalized.codeChallengeMethod
37503
- .toUpperCase();
37589
+ options.codeChallengeMethod =
37590
+ normalized.codeChallengeMethod.toUpperCase();
37504
37591
  }
37505
37592
  if (normalized.codeVerifierLength) {
37506
37593
  options.codeVerifierLength = normalized.codeVerifierLength;
@@ -39258,14 +39345,14 @@ var eddsaEnvelopeVerifierFactory = /*#__PURE__*/Object.freeze({
39258
39345
 
39259
39346
  const FACTORY_META$d = {
39260
39347
  base: TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE,
39261
- key: "NoopTrustStoreProvider",
39348
+ key: 'NoopTrustStoreProvider',
39262
39349
  isDefault: true,
39263
39350
  priority: 10,
39264
39351
  };
39265
39352
  class NoopTrustStoreProviderFactory extends TrustStoreProviderFactory {
39266
39353
  constructor() {
39267
39354
  super(...arguments);
39268
- this.type = "NoopTrustStoreProvider";
39355
+ this.type = 'NoopTrustStoreProvider';
39269
39356
  this.isDefault = true;
39270
39357
  this.priority = 10;
39271
39358
  }
@@ -41503,8 +41590,7 @@ function normalizeOptions$2(raw) {
41503
41590
  const scopes = normalizeScopes(camel.scopes) ??
41504
41591
  normalizeScopes(snake.scopes ?? snake.scope) ??
41505
41592
  DEFAULT_SCOPES.slice();
41506
- const audience = coerceString(camel.audience) ??
41507
- coerceString(snake.audience ?? snake.aud);
41593
+ const audience = coerceString(camel.audience) ?? coerceString(snake.audience ?? snake.aud);
41508
41594
  const fetchImpl = (camel.fetchImpl ?? snake.fetch_impl);
41509
41595
  const clockSkewSeconds = coerceNumber(camel.clockSkewSeconds) ??
41510
41596
  coerceNumber(snake.clock_skew_seconds) ??
@@ -43002,4 +43088,4 @@ var websocketTransportProvisioner = /*#__PURE__*/Object.freeze({
43002
43088
  WebSocketTransportProvisionerFactory: WebSocketTransportProvisionerFactory
43003
43089
  });
43004
43090
 
43005
- export { ADMISSION_CLIENT_FACTORY_BASE_TYPE, ATTACHMENT_KEY_VALIDATOR_FACTORY_BASE_TYPE, AUTHORIZER_FACTORY_BASE_TYPE, AUTH_INJECTION_STRATEGY_FACTORY_BASE_TYPE, AnsiColor, AsyncLock, AttachmentKeyValidator, AuthInjectionStrategyFactory, AuthorizerFactory, BROADCAST_CHANNEL_CONNECTION_GRANT_TYPE, BackPressureFull, BaseAsyncConnector, BaseNodeEventListener, BindingManager, BindingStoreEntryRecord, BrowserAutoKeyCredentialProvider, BrowserWrappedKeyCredentialProvider, CERTIFICATE_MANAGER_FACTORY_BASE_TYPE, CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE, CRYPTO_LEVEL_SECURITY_ORDER, CertificateManagerFactory, ConnectorConfigDefaults, ConnectorFactory, ConsoleMetricsEmitter, CryptoLevel, FACTORY_META$_ as DEFAULT_WELCOME_FACTORY_META, DefaultCryptoProvider, DefaultHttpServer, DefaultKeyManager, DefaultSecurityManager, DefaultSecurityPolicy, DefaultWelcomeService, DefaultWelcomeServiceFactory, DevFixedKeyCredentialProvider, ENCRYPTION_MANAGER_FACTORY_BASE_TYPE, ENVELOPE_SIGNER_FACTORY_BASE_TYPE, ENVELOPE_VERIFIER_FACTORY_BASE_TYPE, ENV_VAR_DEFAULT_ENCRYPTION_LEVEL, ENV_VAR_HMAC_SECRET, ENV_VAR_JWKS_URL, ENV_VAR_JWT_ALGORITHM$2 as ENV_VAR_JWT_ALGORITHM, ENV_VAR_JWT_AUDIENCE$2 as ENV_VAR_JWT_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, ENV_VAR_JWT_TRUSTED_ISSUER, ENV_VAR_SHOW_ENVELOPES$1 as ENV_VAR_SHOW_ENVELOPES, EdDSAEnvelopeSigner, EncryptedKeyValueStore, EncryptedStorageProviderBase, EncryptedValue, EncryptionConfiguration, EncryptionManagerFactory, EncryptionResult, EncryptionStatus, EnvCredentialProvider, EnvelopeContext, EnvelopeListenerManager, EnvelopeSecurityHandler, EnvelopeSignerFactory, EnvelopeVerifierFactory, FACTORY_META$$ as FACTORY_META, FAME_FABRIC_FACTORY_BASE_TYPE, FIXED_PREFIX_LEN, FameAuthorizedDeliveryContextSchema, FameConnectError, FameEnvironmentContext, FameError, FameMessageTooLarge, FameNode, FameNodeAuthorizationContextSchema, FameProtocolError, FameTransportClose, FlowController, GRANT_PURPOSE_NODE_ATTACH, HTTP_CONNECTION_GRANT_TYPE, HTTP_STATELESS_CONNECTOR_TYPE, HttpListener, HttpStatelessConnector, INPAGE_CONNECTION_GRANT_TYPE, INPAGE_CONNECTOR_TYPE, InMemoryBinding, InMemoryFanoutBroker, InMemoryKeyValueStore, InMemoryReadWriteChannel, InMemoryStorageProvider, InPageConnector, InPageListener, InProcessFameFabric, InProcessFameFabricFactory, IndexedDBKeyValueStore, IndexedDBStorageProvider, InvalidPassphraseError, JWKValidationError, KEY_MANAGER_FACTORY_BASE_TYPE, KEY_STORE_FACTORY_BASE_TYPE, KeyInfo, KeyManagementHandler, KeyManagerFactory, KeyStore, KeyStoreFactory, KeyValidationError, LOAD_BALANCER_STICKINESS_MANAGER_FACTORY_BASE_TYPE, LoadBalancerStickinessManagerFactory, LogLevel, LogLevelNames, MemoryMetricsEmitter, NODE_LIKE_FACTORY_BASE_TYPE, NODE_PLACEMENT_STRATEGY_FACTORY_BASE_TYPE, NoOpMetricsEmitter, NoSecurityPolicy, NodeFactory, NodePlacementStrategyFactory, NoneCredentialProvider, NoopEncryptionManager, NoopKeyValidator, NoopTrustStoreProvider, NotAuthorized, PROFILE_NAME_GATED, PROFILE_NAME_GATED_CALLBACK, PROFILE_NAME_OPEN$1 as PROFILE_NAME_OPEN, PROFILE_NAME_OVERLAY, PROFILE_NAME_OVERLAY_CALLBACK, PROFILE_NAME_STRICT_OVERLAY, PromptCredentialProvider, QueueFullError, REPLICA_STICKINESS_MANAGER_FACTORY_BASE_TYPE, REQUIRED_FIELDS_BY_KTY, ReplicaStickinessManagerFactory, RootSessionManager, RouteManager, RpcMixin, RpcProxy, SEALED_ENVELOPE_NONCE_LENGTH, SEALED_ENVELOPE_OVERHEAD, SEALED_ENVELOPE_PRIVATE_KEY_LENGTH, SEALED_ENVELOPE_PUBLIC_KEY_LENGTH, SEALED_ENVELOPE_TAG_LENGTH, SECURE_CHANNEL_MANAGER_FACTORY_BASE_TYPE, SECURITY_MANAGER_FACTORY_BASE_TYPE, SECURITY_POLICY_FACTORY_BASE_TYPE, SQLiteKeyValueStore, SQLiteStorageProvider, STORAGE_PROVIDER_FACTORY_BASE_TYPE, SecretSource, SecretStoreCredentialProvider, SecureChannelFrameHandler, SecureChannelManagerFactory, SecurityAction, SecurityRequirements, Sentinel, SentinelFactory, SessionKeyCredentialProvider, SignaturePolicy, SigningConfig as SigningConfigClass, SigningConfiguration, SimpleLoadBalancerStickinessManager, SimpleLoadBalancerStickinessManagerFactory, StaticCredentialProvider, StorageAESEncryptionManager, TOKEN_ISSUER_FACTORY_BASE_TYPE, TOKEN_PROVIDER_FACTORY_BASE_TYPE, TOKEN_VERIFIER_FACTORY_BASE_TYPE, TRANSPORT_LISTENER_FACTORY_BASE_TYPE, TRANSPORT_PROVISIONER_FACTORY_BASE_TYPE, TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE, TaskSpawner, TokenIssuerFactory, TokenProviderFactory, TokenVerifierFactory, TransportListener, TransportProvisionerFactory, TrustStoreProviderFactory, TtlValidationError, UpstreamSessionManager, VALID_CURVES_BY_KTY, VALID_KEY_USES, VERSION, WEBSOCKET_CONNECTION_GRANT_TYPE, WELCOME_SERVICE_FACTORY_BASE_TYPE, WebSocketCloseCode, WebSocketConnector, WebSocketListener, WebSocketState, WelcomeServiceFactory, _NoopFlowController, __runtimePluginLoader, addEnvelopeFields, addLogLevel, addTimestamp, assertConnectionGrant, assertGrant, basicConfig, broadcastChannelGrantToConnectorConfig, camelToSnakeCase, canonicalJson, capitalizeFirstLetter, color, compareCryptoLevels, compiledPathPattern, consoleTransport, convertWildcardLogicalToDnsConstraint, createConnectorConfig, createEd25519Keypair, createHostLogicalUri, createJwksRouter, createLogicalUri, createNodeDeliveryContext, createApp as createOAuth2ServerApp, createOAuth2TokenRouter, createOpenIDConfigurationRouter, createResource, createRpcProxy, createRsaKeypair, createTransportCloseError, createX25519Keypair, credentialToString, currentTraceId$1 as currentTraceId, debounce, decodeBase64Url, decodeFameDataPayload, deepMerge, defaultJsonEncoder, delay, dropEmpty, enableLogging, encodeUtf8, ensureRuntimeFactoriesRegistered, extractId, extractPoolAddressBase, extractPoolBase, filterKeysByUse, formatTimestamp, formatTimestampForConsole$1 as formatTimestampForConsole, frameDigest, getCurrentEnvelope, getFameRoot, getHttpListenerInstance, getInPageListenerInstance, getKeyProvider, getKeyStore, getLogger, getWebsocketListenerInstance, hasCryptoSupport, hostnameToLogical, hostnamesToLogicals, httpGrantToConnectorConfig, immutableHeaders, inPageGrantToConnectorConfig, isAuthInjectionStrategy, isBroadcastChannelConnectionGrant, isConnectionGrant, isConnectorConfig, isEnvelopeLoggingEnabled, isFameError, isFameErrorType, isGrant, isHttpConnectionGrant, isInPageConnectionGrant, isNodeLike, isPlainObject$3 as isPlainObject, isPoolAddress, isPoolLogical, isRegisterable, isTokenExpired, isTokenProvider, isTokenValid, isWebSocketConnectionGrant, jsonDumps, logicalPatternsToDnsConstraints, logicalToHostname, logicalsToHostnames, matchesPoolAddress, matchesPoolLogical, maybeAwait, nodeWelcomeRouter, nodeWelcomeRouterPlugin, normalizeBroadcastChannelConnectionGrant, normalizeEncryptionConfig, normalizeEnvelopeSnapshot, normalizeExtendedFameConfig, normalizeHttpConnectionGrant, normalizeInPageConnectionGrant, normalizeInboundCryptoRules, normalizeInboundSigningRules, normalizeOutboundCryptoRules, normalizeOutboundSigningRules, normalizePath, normalizeResponseCryptoRules, normalizeResponseSigningRules, normalizeSecretSource, normalizeSecurityRequirements, normalizeSigningConfig, normalizeWebSocketConnectionGrant, objectToBytes, operation, parseSealedEnvelope, pinoTransport, prettyModel$1 as prettyModel, registerDefaultFactories, registerDefaultKeyStoreFactory, registerNodePlacementStrategyFactory, registerRuntimeFactories, requireCryptoSupport, retryWithBackoff, main as runOAuth2Server, safeColor, sealedDecrypt, sealedEncrypt, secureDigest, setKeyStore, showEnvelopes$1 as showEnvelopes, sleep, snakeToCamelCase, stringifyNonPrimitives, supportsColor, throttle, urlsafeBase64Decode, urlsafeBase64Encode, validateCacheTtlSec, validateEncryptionKey, validateHostLogical, validateHostLogicals, validateJwkComplete, validateJwkStructure, validateJwkUseField, validateJwtTokenTtlSec, validateKeyCorrelationTtlSec, validateLogical, validateLogicalSegment, validateOAuth2TtlSec, validateSigningKey, validateTtlSec, waitForAll, waitForAllSettled, waitForAny, websocketGrantToConnectorConfig, withEnvelopeContext, withEnvelopeContextAsync, withLegacySnakeCaseKeys, withLock, withTimeout };
43091
+ export { ADMISSION_CLIENT_FACTORY_BASE_TYPE, ATTACHMENT_KEY_VALIDATOR_FACTORY_BASE_TYPE, AUTHORIZER_FACTORY_BASE_TYPE, AUTH_INJECTION_STRATEGY_FACTORY_BASE_TYPE, AnsiColor, AsyncLock, AttachmentKeyValidator, AuthInjectionStrategyFactory, AuthorizerFactory, BROADCAST_CHANNEL_CONNECTION_GRANT_TYPE, BackPressureFull, BaseAsyncConnector, BaseNodeEventListener, BindingManager, BindingStoreEntryRecord, BrowserAutoKeyCredentialProvider, BrowserWrappedKeyCredentialProvider, CERTIFICATE_MANAGER_FACTORY_BASE_TYPE, CREDENTIAL_PROVIDER_FACTORY_BASE_TYPE, CRYPTO_LEVEL_SECURITY_ORDER, CertificateManagerFactory, ConnectorConfigDefaults, ConnectorFactory, ConsoleMetricsEmitter, CryptoLevel, FACTORY_META$_ as DEFAULT_WELCOME_FACTORY_META, DefaultCryptoProvider, DefaultHttpServer, DefaultKeyManager, DefaultSecurityManager, DefaultSecurityPolicy, DefaultWelcomeService, DefaultWelcomeServiceFactory, DevFixedKeyCredentialProvider, ENCRYPTION_MANAGER_FACTORY_BASE_TYPE, ENVELOPE_SIGNER_FACTORY_BASE_TYPE, ENVELOPE_VERIFIER_FACTORY_BASE_TYPE, ENV_VAR_DEFAULT_ENCRYPTION_LEVEL, ENV_VAR_HMAC_SECRET, ENV_VAR_JWKS_URL, ENV_VAR_JWT_ALGORITHM$2 as ENV_VAR_JWT_ALGORITHM, ENV_VAR_JWT_AUDIENCE$2 as ENV_VAR_JWT_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_AUDIENCE, ENV_VAR_JWT_REVERSE_AUTH_TRUSTED_ISSUER, ENV_VAR_JWT_TRUSTED_ISSUER, ENV_VAR_SHOW_ENVELOPES$1 as ENV_VAR_SHOW_ENVELOPES, EdDSAEnvelopeSigner, EncryptedKeyValueStore, EncryptedStorageProviderBase, EncryptedValue, EncryptionConfiguration, EncryptionManagerFactory, EncryptionResult, EncryptionStatus, EnvCredentialProvider, EnvelopeContext, EnvelopeListenerManager, EnvelopeSecurityHandler, EnvelopeSignerFactory, EnvelopeVerifierFactory, FACTORY_META$$ as FACTORY_META, FAME_FABRIC_FACTORY_BASE_TYPE, FIXED_PREFIX_LEN, FameAuthorizedDeliveryContextSchema, FameConnectError, FameEnvironmentContext, FameError, FameMessageTooLarge, FameNode, FameNodeAuthorizationContextSchema, FameProtocolError, FameTransportClose, FlowController, GRANT_PURPOSE_NODE_ATTACH, HTTP_CONNECTION_GRANT_TYPE, HTTP_STATELESS_CONNECTOR_TYPE, HttpListener, HttpStatelessConnector, INPAGE_CONNECTION_GRANT_TYPE, INPAGE_CONNECTOR_TYPE, InMemoryBinding, InMemoryFanoutBroker, InMemoryKeyValueStore, InMemoryReadWriteChannel, InMemoryStorageProvider, InPageConnector, InPageListener, InProcessFameFabric, InProcessFameFabricFactory, IndexedDBKeyValueStore, IndexedDBStorageProvider, InvalidPassphraseError, JWKValidationError, KEY_MANAGER_FACTORY_BASE_TYPE, KEY_STORE_FACTORY_BASE_TYPE, KeyInfo, KeyManagementHandler, KeyManagerFactory, KeyStore, KeyStoreFactory, KeyValidationError, LOAD_BALANCER_STICKINESS_MANAGER_FACTORY_BASE_TYPE, LoadBalancerStickinessManagerFactory, LogLevel, LogLevelNames, MemoryMetricsEmitter, NODE_LIKE_FACTORY_BASE_TYPE, NODE_PLACEMENT_STRATEGY_FACTORY_BASE_TYPE, NoOpMetricsEmitter, NoSecurityPolicy, NodeFactory, NodePlacementStrategyFactory, NoneCredentialProvider, NoopEncryptionManager, NoopKeyValidator, NoopTrustStoreProvider, NotAuthorized, PROFILE_NAME_GATED, PROFILE_NAME_GATED_CALLBACK, PROFILE_NAME_OPEN$1 as PROFILE_NAME_OPEN, PROFILE_NAME_OVERLAY, PROFILE_NAME_OVERLAY_CALLBACK, PROFILE_NAME_STRICT_OVERLAY, PromptCredentialProvider, QueueFullError, REPLICA_STICKINESS_MANAGER_FACTORY_BASE_TYPE, REQUIRED_FIELDS_BY_KTY, ReplicaStickinessManagerFactory, RootSessionManager, RouteManager, RpcMixin, RpcProxy, SEALED_ENVELOPE_NONCE_LENGTH, SEALED_ENVELOPE_OVERHEAD, SEALED_ENVELOPE_PRIVATE_KEY_LENGTH, SEALED_ENVELOPE_PUBLIC_KEY_LENGTH, SEALED_ENVELOPE_TAG_LENGTH, SECURE_CHANNEL_MANAGER_FACTORY_BASE_TYPE, SECURITY_MANAGER_FACTORY_BASE_TYPE, SECURITY_POLICY_FACTORY_BASE_TYPE, SQLiteKeyValueStore, SQLiteStorageProvider, STORAGE_PROVIDER_FACTORY_BASE_TYPE, SecretSource, SecretStoreCredentialProvider, SecureChannelFrameHandler, SecureChannelManagerFactory, SecurityAction, SecurityRequirements, Sentinel, SentinelFactory, SessionKeyCredentialProvider, SignaturePolicy, SigningConfig as SigningConfigClass, SigningConfiguration, SimpleLoadBalancerStickinessManager, SimpleLoadBalancerStickinessManagerFactory, StaticCredentialProvider, StorageAESEncryptionManager, TOKEN_ISSUER_FACTORY_BASE_TYPE, TOKEN_PROVIDER_FACTORY_BASE_TYPE, TOKEN_VERIFIER_FACTORY_BASE_TYPE, TRANSPORT_LISTENER_FACTORY_BASE_TYPE, TRANSPORT_PROVISIONER_FACTORY_BASE_TYPE, TRUST_STORE_PROVIDER_FACTORY_BASE_TYPE, TaskSpawner, TokenIssuerFactory, TokenProviderFactory, TokenVerifierFactory, TransportListener, TransportListenerFactory, TransportProvisionerFactory, TrustStoreProviderFactory, TtlValidationError, UpstreamSessionManager, VALID_CURVES_BY_KTY, VALID_KEY_USES, VERSION, WEBSOCKET_CONNECTION_GRANT_TYPE, WELCOME_SERVICE_FACTORY_BASE_TYPE, WebSocketCloseCode, WebSocketConnector, WebSocketListener, WebSocketState, WelcomeServiceFactory, _NoopFlowController, __runtimePluginLoader, addEnvelopeFields, addLogLevel, addTimestamp, assertConnectionGrant, assertGrant, basicConfig, broadcastChannelGrantToConnectorConfig, camelToSnakeCase, canonicalJson, capitalizeFirstLetter, color, compareCryptoLevels, compiledPathPattern, consoleTransport, convertWildcardLogicalToDnsConstraint, createConnectorConfig, createEd25519Keypair, createHostLogicalUri, createJwksRouter, createLogicalUri, createNodeDeliveryContext, createApp as createOAuth2ServerApp, createOAuth2TokenRouter, createOpenIDConfigurationRouter, createResource, createRpcProxy, createRsaKeypair, createTransportCloseError, createX25519Keypair, credentialToString, currentTraceId$1 as currentTraceId, debounce, decodeBase64Url, decodeFameDataPayload, deepMerge, defaultJsonEncoder, delay, dropEmpty, enableLogging, encodeUtf8, ensureRuntimeFactoriesRegistered, extractId, extractPoolAddressBase, extractPoolBase, filterKeysByUse, formatTimestamp, formatTimestampForConsole$1 as formatTimestampForConsole, frameDigest, getCurrentEnvelope, getFabricForNode, getFameRoot, getHttpListenerInstance, getInPageListenerInstance, getKeyProvider, getKeyStore, getLogger, getWebsocketListenerInstance, hasCryptoSupport, hostnameToLogical, hostnamesToLogicals, httpGrantToConnectorConfig, immutableHeaders, inPageGrantToConnectorConfig, isAuthInjectionStrategy, isBroadcastChannelConnectionGrant, isConnectionGrant, isConnectorConfig, isEnvelopeLoggingEnabled, isFameError, isFameErrorType, isGrant, isHttpConnectionGrant, isInPageConnectionGrant, isNodeLike, isPlainObject$3 as isPlainObject, isPoolAddress, isPoolLogical, isRegisterable, isTokenExpired, isTokenProvider, isTokenValid, isWebSocketConnectionGrant, jsonDumps, logicalPatternsToDnsConstraints, logicalToHostname, logicalsToHostnames, matchesPoolAddress, matchesPoolLogical, maybeAwait, nodeWelcomeRouter, nodeWelcomeRouterPlugin, normalizeBroadcastChannelConnectionGrant, normalizeEncryptionConfig, normalizeEnvelopeSnapshot, normalizeExtendedFameConfig, normalizeHttpConnectionGrant, normalizeInPageConnectionGrant, normalizeInboundCryptoRules, normalizeInboundSigningRules, normalizeOutboundCryptoRules, normalizeOutboundSigningRules, normalizePath, normalizeResponseCryptoRules, normalizeResponseSigningRules, normalizeSecretSource, normalizeSecurityRequirements, normalizeSigningConfig, normalizeWebSocketConnectionGrant, objectToBytes, operation, parseSealedEnvelope, pinoTransport, prettyModel$1 as prettyModel, registerDefaultFactories, registerDefaultKeyStoreFactory, registerNodePlacementStrategyFactory, registerRuntimeFactories, requireCryptoSupport, retryWithBackoff, main as runOAuth2Server, safeColor, safeImport, sealedDecrypt, sealedEncrypt, secureDigest, setKeyStore, showEnvelopes$1 as showEnvelopes, sleep, snakeToCamelCase, stringifyNonPrimitives, supportsColor, throttle, urlsafeBase64Decode, urlsafeBase64Encode, validateCacheTtlSec, validateEncryptionKey, validateHostLogical, validateHostLogicals, validateJwkComplete, validateJwkStructure, validateJwkUseField, validateJwtTokenTtlSec, validateKeyCorrelationTtlSec, validateLogical, validateLogicalSegment, validateOAuth2TtlSec, validateSigningKey, validateTtlSec, waitForAll, waitForAllSettled, waitForAny, websocketGrantToConnectorConfig, withEnvelopeContext, withEnvelopeContextAsync, withLegacySnakeCaseKeys, withLock, withTimeout };