@tangle-network/sandbox 0.68.2 → 0.68.3

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.
@@ -431,7 +431,6 @@ interface SessionGatewayStats {
431
431
  */
432
432
  declare function calculateConnectionQuality(metrics: ConnectionMetrics, isConnected: boolean): ConnectionQuality;
433
433
  //#endregion
434
- //#region ../../../packages/sdk/dist/client-DlMgBOqN.d.ts
435
434
  //#region src/session-gateway/core-types.d.ts
436
435
  interface SubscriptionDenial {
437
436
  channel: string;
@@ -441,7 +440,7 @@ interface SubscriptionAcknowledgement {
441
440
  channels: string[];
442
441
  denied?: SubscriptionDenial[];
443
442
  }
444
- type ServerMessage$1 = Exclude<GatewayServerMessage, {
443
+ type ServerMessage = Exclude<GatewayServerMessage, {
445
444
  type: "connection.established" | "subscribed";
446
445
  }> | (ServerMessageBase & {
447
446
  type: "connection.established";
@@ -483,20 +482,21 @@ interface RawWireMessage {
483
482
  interface NormalizedServerMessage extends RawWireMessage {
484
483
  type: string;
485
484
  }
486
- interface SessionGatewayEventHandlers$1 extends GatewayEventHandlers {
485
+ interface SessionGatewayEventHandlers extends GatewayEventHandlers {
487
486
  /** Called after internal processing for every non-duplicate normalized frame. */
488
487
  onMessage?: (message: NormalizedServerMessage) => void;
489
488
  }
490
- interface SessionGatewayClientConfig$1 extends Omit<GatewayClientConfig, "handlers"> {
489
+ interface SessionGatewayClientConfig extends Omit<GatewayClientConfig, "handlers"> {
491
490
  /** Browser session ID embedded in the session-scoped read token. */
492
491
  sessionId: string;
493
492
  /** Additional subscriptions; server-authorized channels are used by default. */
494
493
  channels?: string[];
495
494
  /** Maximum wait for `connection.established` (default: 10000 ms). */
496
495
  connectionEstablishmentTimeoutMs?: number;
497
- handlers?: SessionGatewayEventHandlers$1;
496
+ handlers?: SessionGatewayEventHandlers;
498
497
  }
499
- declare const INITIAL_METRICS: ConnectionMetrics; //#endregion
498
+ declare const INITIAL_METRICS: ConnectionMetrics;
499
+ //#endregion
500
500
  //#region src/session-gateway/core.d.ts
501
501
  declare class SessionGatewayClientCore {
502
502
  #private;
@@ -508,7 +508,7 @@ declare class SessionGatewayClientCore {
508
508
  private readonly metrics;
509
509
  private readonly replayCursor;
510
510
  private readonly inbound;
511
- constructor(config: SessionGatewayClientConfig$1, initialMetrics?: ConnectionMetrics);
511
+ constructor(config: SessionGatewayClientConfig, initialMetrics?: ConnectionMetrics);
512
512
  /**
513
513
  * Connect to the session gateway.
514
514
  */
@@ -571,17 +571,15 @@ declare class SessionGatewayClientCore {
571
571
  private handleMessage;
572
572
  private send;
573
573
  private sendWithResponse;
574
- } //#endregion
575
- //#region src/session-gateway/client.d.ts
576
- /** SDK client with its original immediate, synchronous replay commands. */
574
+ }
577
575
  //#endregion
578
576
  //#region src/session-gateway/client.d.ts
579
577
  /** Sandbox replay waits for the server's authenticated connection receipt. */
580
578
  declare class SessionGatewayClient extends SessionGatewayClientCore {
581
- constructor(config: SessionGatewayClientConfig$1);
579
+ constructor(config: SessionGatewayClientConfig);
582
580
  /** @deprecated Timestamps are not a stable cursor. Use replaySinceSeq(). */
583
581
  replay(since: number): Promise<void>;
584
582
  replaySinceSeq(sinceSeq: number): Promise<void>;
585
583
  }
586
584
  //#endregion
587
- export { type ClientMessage, type ConnectionMetrics, type ConnectionQuality, type ConnectionState, INITIAL_METRICS, type NormalizedServerMessage, type PortEventData, type ReplayOptions, type ReplayState, type ReplayStateStorage, type RuntimeUnavailableData, type RuntimeUnavailableReason, type ServerMessage$1 as ServerMessage, SessionGatewayClient, type SessionGatewayClientConfig$1 as SessionGatewayClientConfig, type SessionGatewayEventHandlers$1 as SessionGatewayEventHandlers, type SessionGatewayStats, type SubscriptionAcknowledgement, type SubscriptionDenial, type TokenRefreshResult, type TransportMode, calculateConnectionQuality };
585
+ export { type ClientMessage, type ConnectionMetrics, type ConnectionQuality, type ConnectionState, INITIAL_METRICS, type NormalizedServerMessage, type PortEventData, type ReplayOptions, type ReplayState, type ReplayStateStorage, type RuntimeUnavailableData, type RuntimeUnavailableReason, type ServerMessage, SessionGatewayClient, type SessionGatewayClientConfig, type SessionGatewayEventHandlers, type SessionGatewayStats, type SubscriptionAcknowledgement, type SubscriptionDenial, type TokenRefreshResult, type TransportMode, calculateConnectionQuality };
@@ -1,3 +1,15 @@
1
+ //#region src/session-gateway/callback.ts
2
+ function invokeClientCallback(name, callback, onError) {
3
+ try {
4
+ callback();
5
+ } catch (error) {
6
+ if (name === "onError") return;
7
+ try {
8
+ onError?.(`${name} callback failed: ${error instanceof Error ? error.message : String(error)}`, "CALLBACK_ERROR");
9
+ } catch {}
10
+ }
11
+ }
12
+ //#endregion
1
13
  //#region ../../../packages/runtime-contracts/dist/session-gateway.js
2
14
  /**
3
15
  * Shared session-gateway protocol and connection metrics
@@ -33,19 +45,11 @@ function calculateConnectionQuality(metrics, isConnected) {
33
45
  return "good";
34
46
  }
35
47
  //#endregion
36
- //#region ../../../packages/sdk/dist/types-B1NMYFuB.js
37
- function invokeClientCallback(name, callback, onError) {
38
- try {
39
- callback();
40
- } catch (error) {
41
- if (name === "onError") return;
42
- try {
43
- onError?.(`${name} callback failed: ${error instanceof Error ? error.message : String(error)}`, "CALLBACK_ERROR");
44
- } catch {}
45
- }
46
- }
48
+ //#region src/session-gateway/core-types.ts
47
49
  /** Browser-safe session gateway contracts for both SDK clients. */
48
50
  const INITIAL_METRICS = createConnectionMetrics();
51
+ //#endregion
52
+ //#region src/session-gateway/connection-metrics.ts
49
53
  /** Connection quality metrics derived from ping latency and missed pongs. */
50
54
  var ConnectionMetricsTracker = class {
51
55
  metrics;
@@ -109,6 +113,8 @@ var ConnectionMetricsTracker = class {
109
113
  }
110
114
  }
111
115
  };
116
+ //#endregion
117
+ //#region src/session-gateway/connection-waiters.ts
112
118
  var ConnectionWaiters = class {
113
119
  /** True once the current socket has reported `connection.established`. */
114
120
  established = false;
@@ -160,6 +166,8 @@ var ConnectionWaiters = class {
160
166
  this.waiters.clear();
161
167
  }
162
168
  };
169
+ //#endregion
170
+ //#region src/session-gateway/heartbeat.ts
163
171
  const PONG_TIMEOUT_CLOSE_CODE = 4e3;
164
172
  const PONG_TIMEOUT_CLOSE_REASON = "Pong timeout - connection unresponsive";
165
173
  /** Sends pings on an interval and closes a socket that stops answering. */
@@ -230,6 +238,8 @@ var Heartbeat = class {
230
238
  }, this.policy.pongTimeoutMs);
231
239
  }
232
240
  };
241
+ //#endregion
242
+ //#region src/session-gateway/message-dispatch.ts
233
243
  /**
234
244
  * Parse a wire frame into a server message. Reports a frame with no message
235
245
  * type through `onError` and returns null; throws on invalid JSON.
@@ -326,6 +336,8 @@ function dispatchServerMessage(message, targets) {
326
336
  break;
327
337
  }
328
338
  }
339
+ //#endregion
340
+ //#region src/session-gateway/pending-requests.ts
329
341
  const REQUEST_TIMEOUT_MS = 1e4;
330
342
  /** Correlates request messages with the server replies that carry their id. */
331
343
  var PendingRequests = class {
@@ -365,6 +377,8 @@ var PendingRequests = class {
365
377
  }
366
378
  }
367
379
  };
380
+ //#endregion
381
+ //#region src/session-gateway/protocol.ts
368
382
  const DEFAULT_SESSION_GATEWAY_CLIENT_CONFIG = {
369
383
  transport: "websocket",
370
384
  channels: [],
@@ -429,6 +443,8 @@ function resolveClientConfig(config) {
429
443
  connectionEstablishmentTimeoutMs: config.connectionEstablishmentTimeoutMs ?? defaults.connectionEstablishmentTimeoutMs
430
444
  };
431
445
  }
446
+ //#endregion
447
+ //#region src/session-gateway/reconnect-scheduler.ts
432
448
  /** Decides whether to reconnect and schedules attempts with jittered backoff. */
433
449
  var ReconnectScheduler = class {
434
450
  hasConnectedBefore = false;
@@ -457,6 +473,8 @@ var ReconnectScheduler = class {
457
473
  }
458
474
  }
459
475
  };
476
+ //#endregion
477
+ //#region src/session-gateway/replay-cursor.ts
460
478
  /**
461
479
  * Replay position of one gateway session: the last delivered event, the
462
480
  * execution and session being followed, replay progress, and the set of event
@@ -590,6 +608,8 @@ var ReplayCursor = class {
590
608
  });
591
609
  }
592
610
  };
611
+ //#endregion
612
+ //#region src/session-gateway/replay-storage.ts
593
613
  const STORAGE_KEYS = {
594
614
  lastEventId: "last_event_id",
595
615
  executionId: "execution_id",
@@ -676,6 +696,8 @@ var ReplayStateStore = class {
676
696
  };
677
697
  }
678
698
  };
699
+ //#endregion
700
+ //#region src/session-gateway/token-refresh.ts
679
701
  var TokenRefresher = class {
680
702
  refreshing = false;
681
703
  constructor(refreshToken, applyToken, onError) {
@@ -697,6 +719,8 @@ var TokenRefresher = class {
697
719
  }
698
720
  }
699
721
  };
722
+ //#endregion
723
+ //#region src/session-gateway/core.ts
700
724
  const CONNECTION_ESTABLISHMENT_TIMEOUT_CODE = 4008;
701
725
  const CONNECTION_ERROR_CODE = 4009;
702
726
  const CONNECTION_ERROR_REASON = "WebSocket connection error";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox",
3
- "version": "0.68.2",
3
+ "version": "0.68.3",
4
4
  "description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -165,16 +165,15 @@
165
165
  "ws": "^8.22.0",
166
166
  "yjs": "13.6.30",
167
167
  "@products/sandbox-test-utils": "0.0.0",
168
- "@tangle-network/cli-agent-registry": "0.10.2",
169
- "@tangle-network/agent-profile-materialize": "0.26.0",
170
168
  "@repo/shared": "0.0.0",
169
+ "@tangle-network/agent-profile-materialize": "0.26.0",
170
+ "@tangle-network/cli-agent-registry": "0.10.2",
171
171
  "@tangle-network/runtime-contracts": "0.19.0",
172
- "@tangle-network/sdk": "4.0.16",
173
172
  "@tangle-network/sse-core": "0.0.0"
174
173
  },
175
174
  "tangleRelease": {
176
- "sourceSha": "0984d38ccbb6dfa20c8b44d81e8886664c7a720b",
177
- "mergedAt": "2026-10-25T20:02:18-06:00"
175
+ "sourceSha": "eb53cabf1079da6debe8011a8ab9f56ed5fb9ca3",
176
+ "mergedAt": "2026-10-25T20:28:27-06:00"
178
177
  },
179
178
  "scripts": {
180
179
  "build": "node scripts/build-dist.mjs",