@naylence/agent-sdk 0.3.4-test.707 → 0.3.4-test.709

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.
@@ -21591,12 +21591,12 @@
21591
21591
  });
21592
21592
 
21593
21593
  // This file is auto-generated during build - do not edit manually
21594
- // Generated from package.json version: 0.3.5-test.907
21594
+ // Generated from package.json version: 0.3.5-test.909
21595
21595
  /**
21596
21596
  * The package version, injected at build time.
21597
21597
  * @internal
21598
21598
  */
21599
- const VERSION$2 = '0.3.5-test.907';
21599
+ const VERSION$2 = '0.3.5-test.909';
21600
21600
 
21601
21601
  /**
21602
21602
  * Cross-platform logging utilities for Naylence Fame
@@ -22864,11 +22864,11 @@
22864
22864
  const DEFAULT_KEY_ID$1 = 'default';
22865
22865
  const DEFAULT_ALGORITHM = 'AES-GCM';
22866
22866
  const GCM_IV_LENGTH$1 = 12;
22867
- function isBrowserEnvironment() {
22867
+ function isBrowserEnvironment$1() {
22868
22868
  return (typeof indexedDB !== 'undefined' && typeof globalThis.crypto !== 'undefined');
22869
22869
  }
22870
22870
  function tryCreateBrowserAutoKeyCredentialProvider() {
22871
- if (!isBrowserEnvironment()) {
22871
+ if (!isBrowserEnvironment$1()) {
22872
22872
  return null;
22873
22873
  }
22874
22874
  try {
@@ -23538,12 +23538,6 @@
23538
23538
 
23539
23539
  getLogger('naylence.fame.delivery.default_delivery_tracker');
23540
23540
 
23541
- const globalScope$1 = globalThis;
23542
- const nodeStack = globalScope$1.__naylenceNodeStack__ ?? (globalScope$1.__naylenceNodeStack__ = []);
23543
- function getCurrentNode() {
23544
- return nodeStack.length > 0 ? nodeStack[nodeStack.length - 1] : null;
23545
- }
23546
-
23547
23541
  getLogger('naylence.fame.node.root_session_manager');
23548
23542
 
23549
23543
  /**
@@ -23553,6 +23547,58 @@
23553
23547
  * conversion logic.
23554
23548
  */
23555
23549
  getLogger('naylence.fame.connector.connector_factory');
23550
+ getLogger('naylence.fame.connector.base_async_connector');
23551
+ // Environment variables
23552
+ const ENV_VAR_FAME_FLOW_CONTROL = 'FAME_FLOW_CONTROL';
23553
+ typeof process !== 'undefined' && process?.env
23554
+ ? process.env[ENV_VAR_FAME_FLOW_CONTROL] !== '0'
23555
+ : true;
23556
+
23557
+ getLogger('naylence.fame.connector.broadcast_channel_connector');
23558
+
23559
+ const GRANT_PURPOSE_NODE_ATTACH = 'node.attach';
23560
+ function isGrant(candidate) {
23561
+ if (!candidate || typeof candidate !== 'object') {
23562
+ return false;
23563
+ }
23564
+ const grant = candidate;
23565
+ return typeof grant.type === 'string' && typeof grant.purpose === 'string';
23566
+ }
23567
+ function assertGrant(candidate, message = 'Invalid grant object') {
23568
+ if (!isGrant(candidate)) {
23569
+ throw new TypeError(message);
23570
+ }
23571
+ }
23572
+
23573
+ const AUTH_INJECTION_STRATEGY_TYPE_ALIASES = {
23574
+ BearerTokenHeaderAuthInjectionStrategy: 'BearerTokenHeaderAuth',
23575
+ BearerTokenHeaderAuthStrategy: 'BearerTokenHeaderAuth',
23576
+ NoAuthInjectionStrategy: 'NoAuth',
23577
+ QueryParamAuthInjectionStrategy: 'QueryParamAuth',
23578
+ QueryParamAuthStrategy: 'QueryParamAuth',
23579
+ WebSocketSubprotocolAuthInjectionStrategy: 'WebSocketSubprotocolAuth',
23580
+ WebSocketSubprotocolAuthStrategy: 'WebSocketSubprotocolAuth',
23581
+ };
23582
+ function canonicalizeAuthConfig(auth) {
23583
+ if (!auth || typeof auth !== 'object' || Array.isArray(auth)) {
23584
+ return undefined;
23585
+ }
23586
+ const typeValue = auth.type;
23587
+ if (typeof typeValue !== 'string') {
23588
+ return auth;
23589
+ }
23590
+ const normalizedType = AUTH_INJECTION_STRATEGY_TYPE_ALIASES[typeValue] ?? typeValue;
23591
+ if (normalizedType === typeValue) {
23592
+ return auth;
23593
+ }
23594
+ return {
23595
+ ...auth,
23596
+ type: normalizedType,
23597
+ };
23598
+ }
23599
+ function assertConnectionGrant(candidate, message = 'Invalid connection grant') {
23600
+ assertGrant(candidate, message);
23601
+ }
23556
23602
 
23557
23603
  getLogger('naylence.fame.node.upstream_session_manager');
23558
23604
 
@@ -23934,20 +23980,6 @@
23934
23980
  }).optional(),
23935
23981
  });
23936
23982
 
23937
- const GRANT_PURPOSE_NODE_ATTACH = 'node.attach';
23938
- function isGrant(candidate) {
23939
- if (!candidate || typeof candidate !== 'object') {
23940
- return false;
23941
- }
23942
- const grant = candidate;
23943
- return typeof grant.type === 'string' && typeof grant.purpose === 'string';
23944
- }
23945
- function assertGrant(candidate, message = 'Invalid grant object') {
23946
- if (!isGrant(candidate)) {
23947
- throw new TypeError(message);
23948
- }
23949
- }
23950
-
23951
23983
  getLogger('naylence.fame.sentinel.load_balancing.composite_load_balancing_strategy');
23952
23984
 
23953
23985
  getLogger('naylence.fame.sentinel.load_balancing.sticky_load_balancing_strategy');
@@ -23992,12 +24024,6 @@
23992
24024
  routeStore: unknown().optional().nullable(),
23993
24025
  })
23994
24026
  .passthrough();
23995
- getLogger('naylence.fame.connector.base_async_connector');
23996
- // Environment variables
23997
- const ENV_VAR_FAME_FLOW_CONTROL = 'FAME_FLOW_CONTROL';
23998
- typeof process !== 'undefined' && process?.env
23999
- ? process.env[ENV_VAR_FAME_FLOW_CONTROL] !== '0'
24000
- : true;
24001
24027
 
24002
24028
  /**
24003
24029
  * WebSocket Connector Implementation
@@ -24007,6 +24033,12 @@
24007
24033
  */
24008
24034
  getLogger('naylence.fame.connector.websocket_connector');
24009
24035
 
24036
+ /**
24037
+ * Browser-local connector that routes binary frames between peers via an in-page EventTarget.
24038
+ * Relies on BaseAsyncConnector for flow control and shutdown behavior.
24039
+ */
24040
+ getLogger('naylence.fame.connector.inpage_connector');
24041
+
24010
24042
  const RPC_REGISTRY = Symbol('naylence.rpc.registry');
24011
24043
  function isPlainObject$1(value) {
24012
24044
  return Boolean(value &&
@@ -24146,8 +24178,12 @@
24146
24178
  * Provides the list of runtime factory modules for registration.
24147
24179
  */
24148
24180
  const MODULES = [
24181
+ "./connector/broadcast-channel-connector-factory.js",
24182
+ "./connector/broadcast-channel-listener-factory.js",
24149
24183
  "./connector/http-listener-factory.js",
24150
24184
  "./connector/http-stateless-connector-factory.js",
24185
+ "./connector/inpage-connector-factory.js",
24186
+ "./connector/inpage-listener-factory.js",
24151
24187
  "./connector/websocket-connector-factory.js",
24152
24188
  "./connector/websocket-listener-factory.js",
24153
24189
  "./delivery/at-least-once-delivery-policy-factory.js",
@@ -24160,7 +24196,6 @@
24160
24196
  "./node/admission/welcome-service-client-factory.js",
24161
24197
  "./node/node-factory.js",
24162
24198
  "./placement/static-node-placement-strategy-factory.js",
24163
- "./placement/websocket-node-placement-strategy-factory.js",
24164
24199
  "./security/auth/bearer-token-header-auth-injection-strategy-factory.js",
24165
24200
  "./security/auth/default-authorizer-factory.js",
24166
24201
  "./security/auth/jwks-jwt-token-verifier-factory.js",
@@ -24457,36 +24492,6 @@
24457
24492
 
24458
24493
  getLogger('naylence.fame.stickiness.simple_load_balancer_stickiness_manager');
24459
24494
 
24460
- const AUTH_INJECTION_STRATEGY_TYPE_ALIASES = {
24461
- BearerTokenHeaderAuthInjectionStrategy: 'BearerTokenHeaderAuth',
24462
- BearerTokenHeaderAuthStrategy: 'BearerTokenHeaderAuth',
24463
- NoAuthInjectionStrategy: 'NoAuth',
24464
- QueryParamAuthInjectionStrategy: 'QueryParamAuth',
24465
- QueryParamAuthStrategy: 'QueryParamAuth',
24466
- WebSocketSubprotocolAuthInjectionStrategy: 'WebSocketSubprotocolAuth',
24467
- WebSocketSubprotocolAuthStrategy: 'WebSocketSubprotocolAuth',
24468
- };
24469
- function canonicalizeAuthConfig(auth) {
24470
- if (!auth || typeof auth !== 'object' || Array.isArray(auth)) {
24471
- return undefined;
24472
- }
24473
- const typeValue = auth.type;
24474
- if (typeof typeValue !== 'string') {
24475
- return auth;
24476
- }
24477
- const normalizedType = AUTH_INJECTION_STRATEGY_TYPE_ALIASES[typeValue] ?? typeValue;
24478
- if (normalizedType === typeValue) {
24479
- return auth;
24480
- }
24481
- return {
24482
- ...auth,
24483
- type: normalizedType,
24484
- };
24485
- }
24486
- function assertConnectionGrant(candidate, message = 'Invalid connection grant') {
24487
- assertGrant(candidate, message);
24488
- }
24489
-
24490
24495
  const WEBSOCKET_CONNECTION_GRANT_TYPE = 'WebSocketConnectionGrant';
24491
24496
  function normalizeWebSocketConnectionGrant(candidate) {
24492
24497
  const type = typeof candidate.type === 'string'
@@ -26768,6 +26773,7 @@
26768
26773
  this._capabilities = [AGENT_CAPABILITY];
26769
26774
  this._subscriptions = new Map();
26770
26775
  this._stateLock = new AsyncLock();
26776
+ this._node = null;
26771
26777
  this._stateStore = null;
26772
26778
  this._stateCache = null;
26773
26779
  this._name = name ?? camelToSnakeCase(this.constructor.name);
@@ -26798,10 +26804,8 @@
26798
26804
  }
26799
26805
  get storageProvider() {
26800
26806
  if (!this._storageProvider) {
26801
- // Try to get storage provider from current node context (matches Python behavior)
26802
- const node = getCurrentNode();
26803
- if (node) {
26804
- this._storageProvider = node.storageProvider;
26807
+ if (this._node) {
26808
+ this._storageProvider = this._node.storageProvider;
26805
26809
  }
26806
26810
  }
26807
26811
  if (!this._storageProvider) {
@@ -26809,6 +26813,9 @@
26809
26813
  }
26810
26814
  return this._storageProvider;
26811
26815
  }
26816
+ async onRegister(node) {
26817
+ this._node = node;
26818
+ }
26812
26819
  async acquireStateLock() {
26813
26820
  let acquiredResolve;
26814
26821
  const acquired = new Promise((resolve) => {