@tangle-network/sandbox 0.60.2 → 0.60.6
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.
- package/README.md +2 -0
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +5 -5
- package/dist/agent/preview.d.ts +1 -1
- package/dist/agent/preview.js +2 -2
- package/dist/{agent-run-outcome-BDxby7zK.d.ts → agent-run-outcome-B7w8HpoL.d.ts} +1 -1
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{browser-interactive-control-controller-C2qVGzQz.d.ts → browser-interactive-control-controller-C-3MDol8.d.ts} +1 -1
- package/dist/{client-BFilDKO8.d.ts → client-AXO7ykS7.d.ts} +5 -5
- package/dist/{client-p2T45dAv.js → client-qSyPPokh.js} +84 -355
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-C1JAl5kE.js → collaboration-B7QeBrFQ.js} +1 -1
- package/dist/core.d.ts +6 -6
- package/dist/core.js +4 -4
- package/dist/{errors-CKl_BSlD.js → errors-D1JIX7Jm.js} +13 -1
- package/dist/{index-DGuTeptP.d.ts → index-BPt77jdR.d.ts} +88 -3
- package/dist/index.d.ts +13 -13
- package/dist/index.js +7 -7
- package/dist/intelligence/index.js +1 -1
- package/dist/interactive-control.d.ts +1 -1
- package/dist/{interactive-controller-DV1HT3NR.js → interactive-controller-f_ePJqoh.js} +14 -8
- package/dist/{interactive-controller-Dghv9yMk.d.ts → interactive-controller-iYddZt8b.d.ts} +2 -2
- package/dist/{line-application-DJYY1v8U.js → line-application-C2SuT1zK.js} +24 -0
- package/dist/{lines-T2D6xHHx.d.ts → lines-ggdLY7xy.d.ts} +37 -12
- package/dist/lines.d.ts +2 -2
- package/dist/lines.js +4 -5
- package/dist/{local-cli-auth-CdIM0B6p.js → local-cli-auth-D4T4wi9r.js} +1 -1
- package/dist/{mcp-local-BSvH4yAU.js → mcp-local-DjryqUiY.js} +1 -1
- package/dist/{preview-ZaYvOOXz.d.ts → preview-CAiSrOuZ.d.ts} +3 -3
- package/dist/runtime.d.ts +6 -6
- package/dist/runtime.js +2 -2
- package/dist/{sandbox-DeE2MDx9.js → sandbox-DF2Z1lqW.js} +128 -558
- package/dist/{sandbox-LRvBzGGm.d.ts → sandbox-DsJ3ZJdA.d.ts} +5 -5
- package/dist/secp256k1-CyKOxB5J.js +2619 -0
- package/dist/session-gateway/index.d.ts +31 -25
- package/dist/session-gateway/index.js +75 -79
- package/dist/tangle/index.d.ts +2 -2
- package/dist/tangle/index.js +2 -2
- package/dist/tangle-CDtwGZtf.js +2847 -0
- package/dist/{types-C9w6MdZB.d.ts → types-BbgO-4f8.d.ts} +6 -2
- package/dist/utils-ChcSLv53.js +170 -0
- package/package.json +8 -7
- package/dist/tangle-SNShua9T.js +0 -1146
- /package/dist/{cli-auth-bundle-gs7xEnA1.d.ts → cli-auth-bundle-CTia4WWs.d.ts} +0 -0
- /package/dist/{cli-auth-bundle-ChOdvrjd.js → cli-auth-bundle-DzbqR2nA.js} +0 -0
- /package/dist/{errors-C6dll8Qf.d.ts → errors-DS32ViPj.d.ts} +0 -0
- /package/dist/{index-BKhRnV0i.d.ts → index-BXcL8P-U.d.ts} +0 -0
- /package/dist/{index-BSCz2Q0v.d.ts → index-BoQeoNOD.d.ts} +0 -0
- /package/dist/{preview-operations-BLsclF88.js → preview-operations-DqSo-IBm.js} +0 -0
- /package/dist/{terminal-stream-C9jxoB07.d.ts → terminal-stream-BUMu8Oae.d.ts} +0 -0
|
@@ -66,7 +66,7 @@ interface RuntimeUnavailableData {
|
|
|
66
66
|
/**
|
|
67
67
|
* Message types sent by the server.
|
|
68
68
|
*/
|
|
69
|
-
type ServerMessage
|
|
69
|
+
type ServerMessage = (ServerMessageBase & {
|
|
70
70
|
type: "connection.established";
|
|
71
71
|
data: {
|
|
72
72
|
sessionId: string;
|
|
@@ -258,7 +258,7 @@ interface TokenRefreshResult {
|
|
|
258
258
|
/**
|
|
259
259
|
* Event handlers for session gateway events.
|
|
260
260
|
*/
|
|
261
|
-
interface SessionGatewayEventHandlers
|
|
261
|
+
interface SessionGatewayEventHandlers {
|
|
262
262
|
onConnect?: (sessionId: string) => void;
|
|
263
263
|
onDisconnect?: (code: number, reason: string) => void;
|
|
264
264
|
onReconnect?: () => void;
|
|
@@ -359,7 +359,7 @@ type TransportMode = "websocket";
|
|
|
359
359
|
/**
|
|
360
360
|
* Configuration for SessionGatewayClient.
|
|
361
361
|
*/
|
|
362
|
-
interface SessionGatewayClientConfig
|
|
362
|
+
interface SessionGatewayClientConfig {
|
|
363
363
|
/** WebSocket URL for the session gateway */
|
|
364
364
|
url: string;
|
|
365
365
|
/**
|
|
@@ -408,7 +408,7 @@ interface SessionGatewayClientConfig$1 {
|
|
|
408
408
|
/** Number of latency samples to track for averaging (default: 10) */
|
|
409
409
|
latencyHistorySize?: number;
|
|
410
410
|
/** Event handlers */
|
|
411
|
-
handlers?: SessionGatewayEventHandlers
|
|
411
|
+
handlers?: SessionGatewayEventHandlers;
|
|
412
412
|
}
|
|
413
413
|
/**
|
|
414
414
|
* Statistics for the session gateway connection.
|
|
@@ -431,7 +431,8 @@ interface SessionGatewayStats {
|
|
|
431
431
|
*/
|
|
432
432
|
declare function calculateConnectionQuality(metrics: ConnectionMetrics, isConnected: boolean): ConnectionQuality;
|
|
433
433
|
//#endregion
|
|
434
|
-
//#region
|
|
434
|
+
//#region ../../../packages/sdk/dist/client-D7H0VmDC.d.ts
|
|
435
|
+
//#region src/session-gateway/core-types.d.ts
|
|
435
436
|
interface SubscriptionDenial {
|
|
436
437
|
channel: string;
|
|
437
438
|
reason: string;
|
|
@@ -440,7 +441,7 @@ interface SubscriptionAcknowledgement {
|
|
|
440
441
|
channels: string[];
|
|
441
442
|
denied?: SubscriptionDenial[];
|
|
442
443
|
}
|
|
443
|
-
type ServerMessage = Exclude<ServerMessage
|
|
444
|
+
type ServerMessage$2 = Exclude<ServerMessage, {
|
|
444
445
|
type: "connection.established" | "subscribed";
|
|
445
446
|
}> | (ServerMessageBase & {
|
|
446
447
|
type: "connection.established";
|
|
@@ -482,23 +483,22 @@ interface RawWireMessage {
|
|
|
482
483
|
interface NormalizedServerMessage extends RawWireMessage {
|
|
483
484
|
type: string;
|
|
484
485
|
}
|
|
485
|
-
interface SessionGatewayEventHandlers extends SessionGatewayEventHandlers
|
|
486
|
+
interface SessionGatewayEventHandlers$2 extends SessionGatewayEventHandlers {
|
|
486
487
|
/** Called after internal processing for every non-duplicate normalized frame. */
|
|
487
488
|
onMessage?: (message: NormalizedServerMessage) => void;
|
|
488
489
|
}
|
|
489
|
-
interface SessionGatewayClientConfig extends Omit<SessionGatewayClientConfig
|
|
490
|
+
interface SessionGatewayClientConfig$2 extends Omit<SessionGatewayClientConfig, "handlers"> {
|
|
490
491
|
/** Browser session ID embedded in the session-scoped read token. */
|
|
491
492
|
sessionId: string;
|
|
492
493
|
/** Additional subscriptions; server-authorized channels are used by default. */
|
|
493
494
|
channels?: string[];
|
|
494
495
|
/** Maximum wait for `connection.established` (default: 10000 ms). */
|
|
495
496
|
connectionEstablishmentTimeoutMs?: number;
|
|
496
|
-
handlers?: SessionGatewayEventHandlers;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
declare class SessionGatewayClient {
|
|
497
|
+
handlers?: SessionGatewayEventHandlers$2;
|
|
498
|
+
} //#endregion
|
|
499
|
+
//#region src/session-gateway/core.d.ts
|
|
500
|
+
declare class SessionGatewayClientCore {
|
|
501
|
+
private readonly initialMetrics;
|
|
502
502
|
private ws;
|
|
503
503
|
private readonly config;
|
|
504
504
|
private readonly handlers;
|
|
@@ -532,7 +532,7 @@ declare class SessionGatewayClient {
|
|
|
532
532
|
private currentSessionId;
|
|
533
533
|
private isReplaying;
|
|
534
534
|
private replayProgress;
|
|
535
|
-
constructor(config: SessionGatewayClientConfig);
|
|
535
|
+
constructor(config: SessionGatewayClientConfig$2, initialMetrics?: ConnectionMetrics);
|
|
536
536
|
/**
|
|
537
537
|
* Connect to the session gateway.
|
|
538
538
|
*/
|
|
@@ -554,15 +554,8 @@ declare class SessionGatewayClient {
|
|
|
554
554
|
* Send a ping and wait for pong.
|
|
555
555
|
*/
|
|
556
556
|
ping(): Promise<number>;
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
* @deprecated Timestamps are not a stable cursor. Use replaySinceSeq().
|
|
560
|
-
*/
|
|
561
|
-
replay(since: number): Promise<void>;
|
|
562
|
-
/**
|
|
563
|
-
* Request replay of events with a per-session seq above the cursor.
|
|
564
|
-
*/
|
|
565
|
-
replaySinceSeq(sinceSeq: number): Promise<void>;
|
|
557
|
+
protected replayImmediately(message: ClientMessage): void;
|
|
558
|
+
protected replayAfterConnection(message: ClientMessage): Promise<void>;
|
|
566
559
|
/**
|
|
567
560
|
* Send terminal input via WebSocket.
|
|
568
561
|
*/
|
|
@@ -622,6 +615,19 @@ declare class SessionGatewayClient {
|
|
|
622
615
|
private trackReconnection;
|
|
623
616
|
private loadReplayState;
|
|
624
617
|
private saveReplayState;
|
|
618
|
+
} //#endregion
|
|
619
|
+
//#region src/session-gateway/types.d.ts
|
|
620
|
+
//#endregion
|
|
621
|
+
//#region src/session-gateway/types.d.ts
|
|
622
|
+
declare const INITIAL_METRICS: ConnectionMetrics;
|
|
623
|
+
//#endregion
|
|
624
|
+
//#region src/session-gateway/client.d.ts
|
|
625
|
+
/** Sandbox replay waits for the server's authenticated connection receipt. */
|
|
626
|
+
declare class SessionGatewayClient extends SessionGatewayClientCore {
|
|
627
|
+
constructor(config: SessionGatewayClientConfig$2);
|
|
628
|
+
/** @deprecated Timestamps are not a stable cursor. Use replaySinceSeq(). */
|
|
629
|
+
replay(since: number): Promise<void>;
|
|
630
|
+
replaySinceSeq(sinceSeq: number): Promise<void>;
|
|
625
631
|
}
|
|
626
632
|
//#endregion
|
|
627
|
-
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 };
|
|
633
|
+
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$2 as ServerMessage, SessionGatewayClient, type SessionGatewayClientConfig$2 as SessionGatewayClientConfig, type SessionGatewayEventHandlers$2 as SessionGatewayEventHandlers, type SessionGatewayStats, type SubscriptionAcknowledgement, type SubscriptionDenial, type TokenRefreshResult, type TransportMode, calculateConnectionQuality };
|
|
@@ -1,4 +1,39 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region ../../../packages/runtime-contracts/dist/session-gateway.js
|
|
2
|
+
/**
|
|
3
|
+
* Shared session-gateway protocol and connection metrics
|
|
4
|
+
*
|
|
5
|
+
* Browser-safe wire contracts. SDK-specific extensions and connection defaults
|
|
6
|
+
* remain with their clients; this module imports no runtime or Node services.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Default connection metrics.
|
|
10
|
+
*/
|
|
11
|
+
function createConnectionMetrics() {
|
|
12
|
+
return {
|
|
13
|
+
lastPingLatencyMs: null,
|
|
14
|
+
avgPingLatencyMs: null,
|
|
15
|
+
missedPongCount: 0,
|
|
16
|
+
reconnectCount: 0,
|
|
17
|
+
lastPongAt: null,
|
|
18
|
+
lastReconnectAt: null,
|
|
19
|
+
quality: "disconnected"
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Calculate connection quality from metrics.
|
|
24
|
+
*/
|
|
25
|
+
function calculateConnectionQuality(metrics, isConnected) {
|
|
26
|
+
if (!isConnected) return "disconnected";
|
|
27
|
+
const { avgPingLatencyMs, missedPongCount, reconnectCount, lastReconnectAt } = metrics;
|
|
28
|
+
const recentReconnect = lastReconnectAt && Date.now() - lastReconnectAt < 300 * 1e3;
|
|
29
|
+
if (missedPongCount >= 2 || recentReconnect && reconnectCount > 1) return "poor";
|
|
30
|
+
if (missedPongCount >= 1 || avgPingLatencyMs !== null && avgPingLatencyMs > 1e3 || recentReconnect) return "degraded";
|
|
31
|
+
if (avgPingLatencyMs !== null && avgPingLatencyMs < 100 && reconnectCount === 0) return "excellent";
|
|
32
|
+
if (avgPingLatencyMs !== null && avgPingLatencyMs <= 300) return "good";
|
|
33
|
+
return "good";
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region ../../../packages/sdk/dist/client-Bnu3TXji.js
|
|
2
37
|
function invokeClientCallback(name, callback, onError) {
|
|
3
38
|
try {
|
|
4
39
|
callback();
|
|
@@ -9,8 +44,6 @@ function invokeClientCallback(name, callback, onError) {
|
|
|
9
44
|
} catch {}
|
|
10
45
|
}
|
|
11
46
|
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/session-gateway/connection-waiters.ts
|
|
14
47
|
var ConnectionWaiters = class {
|
|
15
48
|
waiters = /* @__PURE__ */ new Set();
|
|
16
49
|
establishmentTimeout = null;
|
|
@@ -35,12 +68,8 @@ var ConnectionWaiters = class {
|
|
|
35
68
|
wait() {
|
|
36
69
|
return new Promise((resolve, reject) => {
|
|
37
70
|
this.waiters.add({
|
|
38
|
-
resolve
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
reject: (error) => {
|
|
42
|
-
reject(error);
|
|
43
|
-
}
|
|
71
|
+
resolve,
|
|
72
|
+
reject
|
|
44
73
|
});
|
|
45
74
|
});
|
|
46
75
|
}
|
|
@@ -55,8 +84,6 @@ var ConnectionWaiters = class {
|
|
|
55
84
|
this.waiters.clear();
|
|
56
85
|
}
|
|
57
86
|
};
|
|
58
|
-
//#endregion
|
|
59
|
-
//#region src/session-gateway/protocol.ts
|
|
60
87
|
const DEFAULT_CONFIG = {
|
|
61
88
|
transport: "websocket",
|
|
62
89
|
channels: [],
|
|
@@ -97,8 +124,6 @@ function acceptedSubscriptionChannels(acknowledgement) {
|
|
|
97
124
|
}
|
|
98
125
|
return acknowledgement.channels;
|
|
99
126
|
}
|
|
100
|
-
//#endregion
|
|
101
|
-
//#region src/session-gateway/replay-storage.ts
|
|
102
127
|
const STORAGE_KEYS = {
|
|
103
128
|
lastEventId: "last_event_id",
|
|
104
129
|
executionId: "execution_id",
|
|
@@ -185,8 +210,6 @@ var ReplayStateStore = class {
|
|
|
185
210
|
};
|
|
186
211
|
}
|
|
187
212
|
};
|
|
188
|
-
//#endregion
|
|
189
|
-
//#region src/session-gateway/token-refresh.ts
|
|
190
213
|
var TokenRefresher = class {
|
|
191
214
|
refreshing = false;
|
|
192
215
|
constructor(refreshToken, applyToken, onError) {
|
|
@@ -208,51 +231,12 @@ var TokenRefresher = class {
|
|
|
208
231
|
}
|
|
209
232
|
}
|
|
210
233
|
};
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Shared session-gateway protocol and connection metrics
|
|
215
|
-
*
|
|
216
|
-
* Browser-safe wire contracts. SDK-specific extensions and connection defaults
|
|
217
|
-
* remain with their clients; this module imports no runtime or Node services.
|
|
218
|
-
*/
|
|
219
|
-
/**
|
|
220
|
-
* Default connection metrics.
|
|
221
|
-
*/
|
|
222
|
-
function createConnectionMetrics() {
|
|
223
|
-
return {
|
|
224
|
-
lastPingLatencyMs: null,
|
|
225
|
-
avgPingLatencyMs: null,
|
|
226
|
-
missedPongCount: 0,
|
|
227
|
-
reconnectCount: 0,
|
|
228
|
-
lastPongAt: null,
|
|
229
|
-
lastReconnectAt: null,
|
|
230
|
-
quality: "disconnected"
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Calculate connection quality from metrics.
|
|
235
|
-
*/
|
|
236
|
-
function calculateConnectionQuality(metrics, isConnected) {
|
|
237
|
-
if (!isConnected) return "disconnected";
|
|
238
|
-
const { avgPingLatencyMs, missedPongCount, reconnectCount, lastReconnectAt } = metrics;
|
|
239
|
-
const recentReconnect = lastReconnectAt && Date.now() - lastReconnectAt < 300 * 1e3;
|
|
240
|
-
if (missedPongCount >= 2 || recentReconnect && reconnectCount > 1) return "poor";
|
|
241
|
-
if (missedPongCount >= 1 || avgPingLatencyMs !== null && avgPingLatencyMs > 1e3 || recentReconnect) return "degraded";
|
|
242
|
-
if (avgPingLatencyMs !== null && avgPingLatencyMs < 100 && reconnectCount === 0) return "excellent";
|
|
243
|
-
if (avgPingLatencyMs !== null && avgPingLatencyMs <= 300) return "good";
|
|
244
|
-
return "good";
|
|
245
|
-
}
|
|
246
|
-
//#endregion
|
|
247
|
-
//#region src/session-gateway/types.ts
|
|
248
|
-
/** Browser-safe shared contracts plus the public Sandbox gateway extensions. */
|
|
249
|
-
const INITIAL_METRICS = createConnectionMetrics();
|
|
250
|
-
//#endregion
|
|
251
|
-
//#region src/session-gateway/client.ts
|
|
234
|
+
/** Browser-safe session gateway contracts for both SDK clients. */
|
|
235
|
+
const INITIAL_METRICS$1 = createConnectionMetrics();
|
|
252
236
|
const CONNECTION_ESTABLISHMENT_TIMEOUT_CODE = 4008;
|
|
253
237
|
const CONNECTION_ERROR_CODE = 4009;
|
|
254
238
|
const CONNECTION_ERROR_REASON = "WebSocket connection error";
|
|
255
|
-
var
|
|
239
|
+
var SessionGatewayClientCore = class {
|
|
256
240
|
ws = null;
|
|
257
241
|
config;
|
|
258
242
|
handlers;
|
|
@@ -280,7 +264,7 @@ var SessionGatewayClient = class {
|
|
|
280
264
|
messageIdCounter = 0;
|
|
281
265
|
processedEventIds = /* @__PURE__ */ new Set();
|
|
282
266
|
pingLatencyHistory = [];
|
|
283
|
-
connectionMetrics
|
|
267
|
+
connectionMetrics;
|
|
284
268
|
lastEventId = null;
|
|
285
269
|
currentExecutionId = null;
|
|
286
270
|
currentSessionId = null;
|
|
@@ -289,7 +273,9 @@ var SessionGatewayClient = class {
|
|
|
289
273
|
total: 0,
|
|
290
274
|
received: 0
|
|
291
275
|
};
|
|
292
|
-
constructor(config) {
|
|
276
|
+
constructor(config, initialMetrics = INITIAL_METRICS$1) {
|
|
277
|
+
this.initialMetrics = initialMetrics;
|
|
278
|
+
this.connectionMetrics = { ...initialMetrics };
|
|
293
279
|
if (!config.token.trim()) throw new Error("Session gateway token must not be empty");
|
|
294
280
|
const replayStorage = resolveReplayStorage(config.replayStorage);
|
|
295
281
|
this.config = {
|
|
@@ -385,28 +371,13 @@ var SessionGatewayClient = class {
|
|
|
385
371
|
await this.sendWithResponse({ type: "ping" });
|
|
386
372
|
return Date.now() - start;
|
|
387
373
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
* @deprecated Timestamps are not a stable cursor. Use replaySinceSeq().
|
|
391
|
-
*/
|
|
392
|
-
async replay(since) {
|
|
393
|
-
if (!this.connectionEstablishedForSocket || !this.isConnected()) await this.waitForConnectionEstablished();
|
|
394
|
-
if (!this.connectionEstablishedForSocket || !this.isConnected()) throw new Error("Connection closed before replay could be requested");
|
|
395
|
-
this.send({
|
|
396
|
-
type: "replay",
|
|
397
|
-
since
|
|
398
|
-
});
|
|
374
|
+
replayImmediately(message) {
|
|
375
|
+
this.send(message);
|
|
399
376
|
}
|
|
400
|
-
|
|
401
|
-
* Request replay of events with a per-session seq above the cursor.
|
|
402
|
-
*/
|
|
403
|
-
async replaySinceSeq(sinceSeq) {
|
|
377
|
+
async replayAfterConnection(message) {
|
|
404
378
|
if (!this.connectionEstablishedForSocket || !this.isConnected()) await this.waitForConnectionEstablished();
|
|
405
379
|
if (!this.connectionEstablishedForSocket || !this.isConnected()) throw new Error("Connection closed before replay could be requested");
|
|
406
|
-
this.send(
|
|
407
|
-
type: "replay",
|
|
408
|
-
sinceSeq
|
|
409
|
-
});
|
|
380
|
+
this.send(message);
|
|
410
381
|
}
|
|
411
382
|
/**
|
|
412
383
|
* Send terminal input via WebSocket.
|
|
@@ -487,7 +458,7 @@ var SessionGatewayClient = class {
|
|
|
487
458
|
}
|
|
488
459
|
resetMetrics() {
|
|
489
460
|
this.pingLatencyHistory = [];
|
|
490
|
-
this.connectionMetrics = { ...
|
|
461
|
+
this.connectionMetrics = { ...this.initialMetrics };
|
|
491
462
|
invokeClientCallback("onMetricsChange", () => this.handlers.onMetricsChange?.(this.connectionMetrics), this.handlers.onError);
|
|
492
463
|
}
|
|
493
464
|
/**
|
|
@@ -882,5 +853,30 @@ var SessionGatewayClient = class {
|
|
|
882
853
|
});
|
|
883
854
|
}
|
|
884
855
|
};
|
|
856
|
+
createConnectionMetrics();
|
|
857
|
+
//#endregion
|
|
858
|
+
//#region src/session-gateway/types.ts
|
|
859
|
+
const INITIAL_METRICS = createConnectionMetrics();
|
|
860
|
+
//#endregion
|
|
861
|
+
//#region src/session-gateway/client.ts
|
|
862
|
+
/** Sandbox replay waits for the server's authenticated connection receipt. */
|
|
863
|
+
var SessionGatewayClient = class extends SessionGatewayClientCore {
|
|
864
|
+
constructor(config) {
|
|
865
|
+
super(config, INITIAL_METRICS);
|
|
866
|
+
}
|
|
867
|
+
/** @deprecated Timestamps are not a stable cursor. Use replaySinceSeq(). */
|
|
868
|
+
replay(since) {
|
|
869
|
+
return this.replayAfterConnection({
|
|
870
|
+
type: "replay",
|
|
871
|
+
since
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
replaySinceSeq(sinceSeq) {
|
|
875
|
+
return this.replayAfterConnection({
|
|
876
|
+
type: "replay",
|
|
877
|
+
sinceSeq
|
|
878
|
+
});
|
|
879
|
+
}
|
|
880
|
+
};
|
|
885
881
|
//#endregion
|
|
886
882
|
export { INITIAL_METRICS, SessionGatewayClient, calculateConnectionQuality };
|
package/dist/tangle/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorChallenge, OperatorSession, OperatorSessionError, OperatorSessionToken, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, SignMessage, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, TangleSandboxClientConfig };
|
|
1
|
+
import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as ITangleJobsAbi, T as SandboxCreateResponseParamTypes, _ as JOB_SANDBOX_DELETE, a as fetchQuote, b as TangleSandboxClientConfig, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as JOB_SANDBOX_CREATE, h as TangleSandboxClient, i as SignedQuote, l as validateQuote, m as SignMessage, n as QuoteDomain, o as inputsHashOf, p as OperatorSessionToken, r as QuoteError, s as jobQuoteDigest, t as JobQuoteDetails, u as OperatorChallenge, v as TANGLE_CHAIN_ID, w as SandboxCreateParamTypes, x as AgentSandboxBlueprintAbi, y as TANGLE_JOBS_CONTRACT } from "../index-BPt77jdR.js";
|
|
2
|
+
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JobQuoteDetails, JsonResponseParamTypes, OperatorChallenge, OperatorSession, OperatorSessionError, OperatorSessionToken, QuoteDomain, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, SignMessage, SignedQuote, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, TangleSandboxClientConfig, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
|
package/dist/tangle/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorSession, OperatorSessionError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient };
|
|
1
|
+
import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as JOB_SANDBOX_DELETE, f as TANGLE_CHAIN_ID, g as JsonResponseParamTypes, h as ITangleJobsAbi, i as jobQuoteDigest, l as OperatorSessionError, m as AgentSandboxBlueprintAbi, n as fetchQuote, o as validateQuote, p as TANGLE_JOBS_CONTRACT, r as inputsHashOf, s as TangleSandboxClient, t as QuoteError, u as JOB_SANDBOX_CREATE, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-CDtwGZtf.js";
|
|
2
|
+
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorSession, OperatorSessionError, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
|