@tangle-network/sandbox 0.64.1 → 0.64.2
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/dist/agent/index.js +1 -1
- package/dist/{client-Dy5B2NkM.js → client-DB3wP4hO.js} +96 -74
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/session-gateway/index.d.ts +7 -49
- package/dist/session-gateway/index.js +569 -439
- package/package.json +5 -5
package/dist/agent/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-BjLG7VHY.js";
|
|
2
2
|
import { D as assertCurrentBackendType } from "../interactive-controller-OAsASPd_.js";
|
|
3
3
|
import { S as StateError, T as ValidationError, h as NotFoundError } from "../errors-BfbOP_rx.js";
|
|
4
|
-
import { t as Sandbox } from "../client-
|
|
4
|
+
import { t as Sandbox } from "../client-DB3wP4hO.js";
|
|
5
5
|
import { t as SandboxInstance } from "../sandbox-BPLzHOZ1.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/agent/instances.ts
|
|
@@ -349,7 +349,7 @@ const publicPersistentBatchRunRequestSchema = z.object({
|
|
|
349
349
|
/** Public callers control work only. Identity and capacity are server-owned. */
|
|
350
350
|
const publicBatchRunRequestSchema = z.union([publicTemporaryBatchRunRequestSchema, publicPersistentBatchRunRequestSchema]);
|
|
351
351
|
//#endregion
|
|
352
|
-
//#region ../../../packages/runtime-contracts/dist/batch-stream.js
|
|
352
|
+
//#region ../../../packages/runtime-contracts/dist/batch-stream-support.js
|
|
353
353
|
/** A transport-independent batch event sequence failure. */
|
|
354
354
|
var BatchStreamError = class extends Error {
|
|
355
355
|
kind;
|
|
@@ -369,6 +369,87 @@ function invalid(message) {
|
|
|
369
369
|
function incomplete(message) {
|
|
370
370
|
throw new BatchStreamError(message, "incomplete");
|
|
371
371
|
}
|
|
372
|
+
function setsMatch(left, right) {
|
|
373
|
+
return left.size === right.size && [...left].every((value) => right.has(value));
|
|
374
|
+
}
|
|
375
|
+
//#endregion
|
|
376
|
+
//#region ../../../packages/runtime-contracts/dist/batch-stream-cleanup.js
|
|
377
|
+
/**
|
|
378
|
+
* Validates the cleanup events that follow a batch terminal event: retained
|
|
379
|
+
* compute (persistent, grace period) or per-sidecar release.
|
|
380
|
+
*/
|
|
381
|
+
var BatchCleanupTracker = class {
|
|
382
|
+
host;
|
|
383
|
+
cleanup;
|
|
384
|
+
releasingSidecars = /* @__PURE__ */ new Set();
|
|
385
|
+
releasedSidecars = /* @__PURE__ */ new Set();
|
|
386
|
+
pendingSidecars = /* @__PURE__ */ new Set();
|
|
387
|
+
constructor(host) {
|
|
388
|
+
this.host = host;
|
|
389
|
+
}
|
|
390
|
+
requireTerminal(eventType) {
|
|
391
|
+
if (!this.host.terminal()) invalid(`Batch stream emitted ${eventType} before a batch terminal event`);
|
|
392
|
+
}
|
|
393
|
+
addPersistent(data) {
|
|
394
|
+
this.requireTerminal("batch.persistent");
|
|
395
|
+
if (!this.host.completed() || !this.host.request.persistent || this.cleanup) invalid("Batch stream emitted invalid or duplicate batch.persistent cleanup metadata");
|
|
396
|
+
if (data.sidecarCount !== this.host.allocatedSidecarIds.size) invalid("Batch persistent sidecar count does not match allocation");
|
|
397
|
+
this.cleanup = {
|
|
398
|
+
mode: "persistent",
|
|
399
|
+
...data
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
addGrace(data) {
|
|
403
|
+
this.requireTerminal("batch.grace_period");
|
|
404
|
+
if (!this.host.completed() || this.host.request.persistent || this.cleanup || this.host.request.graceMs === 0) invalid("Batch stream emitted invalid or duplicate batch.grace_period cleanup metadata");
|
|
405
|
+
const reported = new Set(data.sidecarIds);
|
|
406
|
+
if (data.sidecarCount !== this.host.allocatedSidecarIds.size || data.sidecarIds.length !== reported.size || !setsMatch(this.host.allocatedSidecarIds, reported) || this.host.request.graceMs !== void 0 && data.graceMs !== this.host.request.graceMs) invalid("Batch grace-period metadata does not match allocation");
|
|
407
|
+
this.cleanup = {
|
|
408
|
+
mode: "grace",
|
|
409
|
+
...data
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
addSidecarReleasing(data) {
|
|
413
|
+
this.requireTerminal("sidecar.releasing");
|
|
414
|
+
const graceMs = "graceMs" in this.host.request ? this.host.request.graceMs : void 0;
|
|
415
|
+
if (this.host.request.persistent && this.host.terminal() === "completed" || this.cleanup?.mode === "persistent" || this.cleanup?.mode === "grace" || this.host.terminal() === "completed" && graceMs !== void 0 && graceMs > 0) invalid("Batch stream emitted sidecar.releasing for retained compute");
|
|
416
|
+
if (this.host.terminal() === "completed" && !this.host.allocatedSidecarIds.has(data.sidecarId)) invalid(`Batch stream released unknown sidecar: ${data.sidecarId}`);
|
|
417
|
+
if (this.releasingSidecars.has(data.sidecarId) || this.releasedSidecars.has(data.sidecarId) || this.pendingSidecars.has(data.sidecarId)) invalid(`Batch stream started sidecar release more than once: ${data.sidecarId}`);
|
|
418
|
+
this.releasingSidecars.add(data.sidecarId);
|
|
419
|
+
}
|
|
420
|
+
addSidecarReleased(data) {
|
|
421
|
+
this.requireTerminal("sidecar.released");
|
|
422
|
+
if (!this.releasingSidecars.delete(data.sidecarId)) invalid(`Batch stream confirmed release before sidecar.releasing: ${data.sidecarId}`);
|
|
423
|
+
this.releasedSidecars.add(data.sidecarId);
|
|
424
|
+
}
|
|
425
|
+
addSidecarReleasePending(data) {
|
|
426
|
+
this.requireTerminal("sidecar.release_pending");
|
|
427
|
+
if (!this.releasingSidecars.delete(data.sidecarId)) invalid(`Batch stream reported pending release before sidecar.releasing: ${data.sidecarId}`);
|
|
428
|
+
if (data.attempt < 1 || data.retryInMs < 1) invalid("Batch stream reported invalid pending release retry metadata");
|
|
429
|
+
this.pendingSidecars.add(data.sidecarId);
|
|
430
|
+
}
|
|
431
|
+
finish() {
|
|
432
|
+
const graceMs = "graceMs" in this.host.request ? this.host.request.graceMs : void 0;
|
|
433
|
+
if (this.host.request.persistent && this.host.terminal() === "completed") {
|
|
434
|
+
if (this.cleanup?.mode !== "persistent") incomplete("Batch stream ended before batch.persistent cleanup metadata");
|
|
435
|
+
return this.cleanup;
|
|
436
|
+
}
|
|
437
|
+
if (this.cleanup?.mode === "grace" && this.host.terminal() === "completed") return this.cleanup;
|
|
438
|
+
if (this.host.terminal() === "completed" && graceMs !== void 0 && graceMs > 0) incomplete("Batch stream ended before batch.grace_period cleanup metadata");
|
|
439
|
+
if (this.releasingSidecars.size > 0) incomplete(`Batch stream ended while releasing ${this.releasingSidecars.size} sidecars`);
|
|
440
|
+
const terminalCleanupSidecars = new Set([...this.releasedSidecars, ...this.pendingSidecars]);
|
|
441
|
+
if (this.host.terminal() === "completed" && !setsMatch(terminalCleanupSidecars, this.host.allocatedSidecarIds)) incomplete(`Batch stream ended after resolving cleanup for ${terminalCleanupSidecars.size} of ${this.host.allocatedSidecarIds.size} sidecars`);
|
|
442
|
+
if (this.host.failed() && [...this.host.allocatedSidecarIds].some((sidecarId) => !terminalCleanupSidecars.has(sidecarId))) incomplete(`Failed batch stream ended after resolving cleanup for ${terminalCleanupSidecars.size} of ${this.host.allocatedSidecarIds.size} sidecars`);
|
|
443
|
+
return {
|
|
444
|
+
mode: "release",
|
|
445
|
+
releasedSidecarIds: [...this.releasedSidecars],
|
|
446
|
+
pendingSidecarIds: [...this.pendingSidecars],
|
|
447
|
+
isComplete: this.pendingSidecars.size === 0
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region ../../../packages/runtime-contracts/dist/batch-stream.js
|
|
372
453
|
function executionKey(taskId, backendId) {
|
|
373
454
|
return JSON.stringify([taskId, backendId]);
|
|
374
455
|
}
|
|
@@ -378,9 +459,6 @@ function expectedSuccessRate(success, total) {
|
|
|
378
459
|
function ratesMatch(left, right) {
|
|
379
460
|
return Math.abs(left - right) < 1e-9;
|
|
380
461
|
}
|
|
381
|
-
function setsMatch(left, right) {
|
|
382
|
-
return left.size === right.size && [...left].every((value) => right.has(value));
|
|
383
|
-
}
|
|
384
462
|
function backendStatsMatch(left, right) {
|
|
385
463
|
return left.backendId === right.backendId && left.backendType === right.backendType && left.backendLabel === right.backendLabel && left.backendModel === right.backendModel && left.success === right.success && left.failure === right.failure && left.retries === right.retries && ratesMatch(left.successRate, right.successRate);
|
|
386
464
|
}
|
|
@@ -410,17 +488,14 @@ var BatchStreamState = class {
|
|
|
410
488
|
allocatedSidecarsByBackend = /* @__PURE__ */ new Map();
|
|
411
489
|
allocatedSidecarIds = /* @__PURE__ */ new Set();
|
|
412
490
|
completedBackends = /* @__PURE__ */ new Map();
|
|
413
|
-
releasingSidecars = /* @__PURE__ */ new Set();
|
|
414
|
-
releasedSidecars = /* @__PURE__ */ new Set();
|
|
415
|
-
pendingSidecars = /* @__PURE__ */ new Set();
|
|
416
491
|
eventIds = /* @__PURE__ */ new Set();
|
|
492
|
+
cleanupTracker;
|
|
417
493
|
provisioning;
|
|
418
494
|
provisioned;
|
|
419
495
|
started;
|
|
420
496
|
sidecars;
|
|
421
497
|
completion;
|
|
422
498
|
failure;
|
|
423
|
-
cleanup;
|
|
424
499
|
constructor(request) {
|
|
425
500
|
this.request = request;
|
|
426
501
|
this.taskIndexes = new Map(request.tasks.map((task, index) => [task.id, index]));
|
|
@@ -429,6 +504,13 @@ var BatchStreamState = class {
|
|
|
429
504
|
started: false,
|
|
430
505
|
retries: 0
|
|
431
506
|
});
|
|
507
|
+
this.cleanupTracker = new BatchCleanupTracker({
|
|
508
|
+
request,
|
|
509
|
+
allocatedSidecarIds: this.allocatedSidecarIds,
|
|
510
|
+
terminal: () => this.terminal,
|
|
511
|
+
completed: () => this.completion !== void 0,
|
|
512
|
+
failed: () => this.failure !== void 0
|
|
513
|
+
});
|
|
432
514
|
}
|
|
433
515
|
get terminal() {
|
|
434
516
|
if (this.completion) return "completed";
|
|
@@ -479,25 +561,25 @@ var BatchStreamState = class {
|
|
|
479
561
|
this.addBatchFailed(event.data);
|
|
480
562
|
return;
|
|
481
563
|
case "batch.persistent":
|
|
482
|
-
this.
|
|
564
|
+
this.cleanupTracker.addPersistent(event.data);
|
|
483
565
|
return;
|
|
484
566
|
case "batch.grace_period":
|
|
485
|
-
this.
|
|
567
|
+
this.cleanupTracker.addGrace(event.data);
|
|
486
568
|
return;
|
|
487
569
|
case "sidecar.releasing":
|
|
488
|
-
this.addSidecarReleasing(event.data);
|
|
570
|
+
this.cleanupTracker.addSidecarReleasing(event.data);
|
|
489
571
|
return;
|
|
490
572
|
case "sidecar.released":
|
|
491
|
-
this.addSidecarReleased(event.data);
|
|
573
|
+
this.cleanupTracker.addSidecarReleased(event.data);
|
|
492
574
|
return;
|
|
493
575
|
case "sidecar.release_pending":
|
|
494
|
-
this.addSidecarReleasePending(event.data);
|
|
576
|
+
this.cleanupTracker.addSidecarReleasePending(event.data);
|
|
495
577
|
return;
|
|
496
578
|
}
|
|
497
579
|
}
|
|
498
580
|
finish() {
|
|
499
581
|
if (!this.completion && !this.failure) incomplete("Batch stream ended before batch.completed or batch.failed");
|
|
500
|
-
const cleanup = this.
|
|
582
|
+
const cleanup = this.cleanupTracker.finish();
|
|
501
583
|
if (this.failure) throw new BatchStreamError(this.failure.error, "failed", this.failure, cleanup);
|
|
502
584
|
const completion = this.completion;
|
|
503
585
|
const started = this.started;
|
|
@@ -546,9 +628,6 @@ var BatchStreamState = class {
|
|
|
546
628
|
this.requireRunning(eventType);
|
|
547
629
|
if (!this.sidecars) invalid(`Batch stream emitted ${eventType} before sidecars.allocated`);
|
|
548
630
|
}
|
|
549
|
-
requireTerminal(eventType) {
|
|
550
|
-
if (!this.terminal) invalid(`Batch stream emitted ${eventType} before a batch terminal event`);
|
|
551
|
-
}
|
|
552
631
|
validateBackend(identity) {
|
|
553
632
|
const expectedType = this.backendTypes.get(identity.backendId);
|
|
554
633
|
if (!expectedType) invalid(`Batch stream referenced unknown backend id: ${identity.backendId}`);
|
|
@@ -726,63 +805,6 @@ var BatchStreamState = class {
|
|
|
726
805
|
if (data.backendIds.length !== this.backendTypes.size || reported.size !== this.backendTypes.size || [...this.backendTypes.keys()].some((id) => !reported.has(id))) invalid("Batch failure metadata does not match the requested backends");
|
|
727
806
|
this.failure = data;
|
|
728
807
|
}
|
|
729
|
-
addPersistentCleanup(data) {
|
|
730
|
-
this.requireTerminal("batch.persistent");
|
|
731
|
-
if (!this.completion || !this.request.persistent || this.cleanup) invalid("Batch stream emitted invalid or duplicate batch.persistent cleanup metadata");
|
|
732
|
-
if (data.sidecarCount !== this.allocatedSidecarIds.size) invalid("Batch persistent sidecar count does not match allocation");
|
|
733
|
-
this.cleanup = {
|
|
734
|
-
mode: "persistent",
|
|
735
|
-
...data
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
addGraceCleanup(data) {
|
|
739
|
-
this.requireTerminal("batch.grace_period");
|
|
740
|
-
if (!this.completion || this.request.persistent || this.cleanup || this.request.graceMs === 0) invalid("Batch stream emitted invalid or duplicate batch.grace_period cleanup metadata");
|
|
741
|
-
const reported = new Set(data.sidecarIds);
|
|
742
|
-
if (data.sidecarCount !== this.allocatedSidecarIds.size || data.sidecarIds.length !== reported.size || !setsMatch(this.allocatedSidecarIds, reported) || this.request.graceMs !== void 0 && data.graceMs !== this.request.graceMs) invalid("Batch grace-period metadata does not match allocation");
|
|
743
|
-
this.cleanup = {
|
|
744
|
-
mode: "grace",
|
|
745
|
-
...data
|
|
746
|
-
};
|
|
747
|
-
}
|
|
748
|
-
addSidecarReleasing(data) {
|
|
749
|
-
this.requireTerminal("sidecar.releasing");
|
|
750
|
-
const graceMs = "graceMs" in this.request ? this.request.graceMs : void 0;
|
|
751
|
-
if (this.request.persistent && this.terminal === "completed" || this.cleanup?.mode === "persistent" || this.cleanup?.mode === "grace" || this.terminal === "completed" && graceMs !== void 0 && graceMs > 0) invalid("Batch stream emitted sidecar.releasing for retained compute");
|
|
752
|
-
if (this.terminal === "completed" && !this.allocatedSidecarIds.has(data.sidecarId)) invalid(`Batch stream released unknown sidecar: ${data.sidecarId}`);
|
|
753
|
-
if (this.releasingSidecars.has(data.sidecarId) || this.releasedSidecars.has(data.sidecarId) || this.pendingSidecars.has(data.sidecarId)) invalid(`Batch stream started sidecar release more than once: ${data.sidecarId}`);
|
|
754
|
-
this.releasingSidecars.add(data.sidecarId);
|
|
755
|
-
}
|
|
756
|
-
addSidecarReleased(data) {
|
|
757
|
-
this.requireTerminal("sidecar.released");
|
|
758
|
-
if (!this.releasingSidecars.delete(data.sidecarId)) invalid(`Batch stream confirmed release before sidecar.releasing: ${data.sidecarId}`);
|
|
759
|
-
this.releasedSidecars.add(data.sidecarId);
|
|
760
|
-
}
|
|
761
|
-
addSidecarReleasePending(data) {
|
|
762
|
-
this.requireTerminal("sidecar.release_pending");
|
|
763
|
-
if (!this.releasingSidecars.delete(data.sidecarId)) invalid(`Batch stream reported pending release before sidecar.releasing: ${data.sidecarId}`);
|
|
764
|
-
if (data.attempt < 1 || data.retryInMs < 1) invalid("Batch stream reported invalid pending release retry metadata");
|
|
765
|
-
this.pendingSidecars.add(data.sidecarId);
|
|
766
|
-
}
|
|
767
|
-
finishCleanup() {
|
|
768
|
-
const graceMs = "graceMs" in this.request ? this.request.graceMs : void 0;
|
|
769
|
-
if (this.request.persistent && this.terminal === "completed") {
|
|
770
|
-
if (this.cleanup?.mode !== "persistent") incomplete("Batch stream ended before batch.persistent cleanup metadata");
|
|
771
|
-
return this.cleanup;
|
|
772
|
-
}
|
|
773
|
-
if (this.cleanup?.mode === "grace" && this.terminal === "completed") return this.cleanup;
|
|
774
|
-
if (this.terminal === "completed" && graceMs !== void 0 && graceMs > 0) incomplete("Batch stream ended before batch.grace_period cleanup metadata");
|
|
775
|
-
if (this.releasingSidecars.size > 0) incomplete(`Batch stream ended while releasing ${this.releasingSidecars.size} sidecars`);
|
|
776
|
-
const terminalCleanupSidecars = new Set([...this.releasedSidecars, ...this.pendingSidecars]);
|
|
777
|
-
if (this.terminal === "completed" && !setsMatch(terminalCleanupSidecars, this.allocatedSidecarIds)) incomplete(`Batch stream ended after resolving cleanup for ${terminalCleanupSidecars.size} of ${this.allocatedSidecarIds.size} sidecars`);
|
|
778
|
-
if (this.failure && [...this.allocatedSidecarIds].some((sidecarId) => !terminalCleanupSidecars.has(sidecarId))) incomplete(`Failed batch stream ended after resolving cleanup for ${terminalCleanupSidecars.size} of ${this.allocatedSidecarIds.size} sidecars`);
|
|
779
|
-
return {
|
|
780
|
-
mode: "release",
|
|
781
|
-
releasedSidecarIds: [...this.releasedSidecars],
|
|
782
|
-
pendingSidecarIds: [...this.pendingSidecars],
|
|
783
|
-
isComplete: this.pendingSidecars.size === 0
|
|
784
|
-
};
|
|
785
|
-
}
|
|
786
808
|
};
|
|
787
809
|
//#endregion
|
|
788
810
|
//#region src/batch.ts
|
package/dist/core.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as StateError, T as ValidationError, _ as ProfileFileMountPathError, a as AuthError, b as SandboxError, g as PartialFailureError, h as NotFoundError, m as NetworkError, s as CapabilityError, u as FileWriteConflictError, v as QuotaError, w as TimeoutError, x as ServerError } from "./errors-BfbOP_rx.js";
|
|
2
|
-
import { _ as parseBackendRegistryResponse, a as InstancesClient, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as InstanceRestartingError, m as backendRegistryInteractionKindSchema, p as backendRegistryEntrySchema, r as HostedInstance, t as Sandbox, v as parseBackendRegistryResponseBody } from "./client-
|
|
2
|
+
import { _ as parseBackendRegistryResponse, a as InstancesClient, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as InstanceRestartingError, m as backendRegistryInteractionKindSchema, p as backendRegistryEntrySchema, r as HostedInstance, t as Sandbox, v as parseBackendRegistryResponseBody } from "./client-DB3wP4hO.js";
|
|
3
3
|
import { r as WorkspaceImages, t as SandboxInstance, x as ManagedProcessClient } from "./sandbox-BPLzHOZ1.js";
|
|
4
4
|
import { i as profileChannelReference, r as lineInstanceKey, t as LinesClient } from "./lines-C5ER4aN_.js";
|
|
5
5
|
import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as isolationPrincipalSchema, o as parseBackendType, r as backendTypeSchema, t as ALL_BACKEND_TYPES } from "./backend-types-CLvdSX8V.js";
|
|
2
2
|
import { A as normalizeRuntimeBackendConfig, B as TERMINAL_WS_ECHO_SUBPROTOCOL, I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, R as deriveAgentRunOutcome, b as parseSSEStream, i as terminalUpgradeHeadersSupported, j as requestedPublicProfileDigest, n as InteractiveSessionController, r as TerminalStream, t as BrowserInteractiveSessionController, z as projectAgentTerminalRecord } from "./interactive-controller-OAsASPd_.js";
|
|
3
3
|
import { C as StreamInterruptedError, S as StateError, T as ValidationError, _ as ProfileFileMountPathError, a as AuthError, b as SandboxError, c as EdgeNotReadyError, d as GpuProviderNotConfiguredError, f as KeyBudgetExhaustedError, g as PartialFailureError, h as NotFoundError, l as EgressProxyRecoveryError, m as NetworkError, o as BranchFanoutExceedsHostError, s as CapabilityError, t as TerminalStreamError, u as FileWriteConflictError, v as QuotaError, w as TimeoutError, x as ServerError, y as ResumeEnvRequiredError } from "./errors-BfbOP_rx.js";
|
|
4
|
-
import { _ as parseBackendRegistryResponse, a as InstancesClient, c as IntelligenceClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as InstanceRestartingError, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as RunsClient, o as SandboxFleetClient, p as backendRegistryEntrySchema, r as HostedInstance, s as SandboxFleet, t as Sandbox, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-
|
|
4
|
+
import { _ as parseBackendRegistryResponse, a as InstancesClient, c as IntelligenceClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as InstanceRestartingError, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as RunsClient, o as SandboxFleetClient, p as backendRegistryEntrySchema, r as HostedInstance, s as SandboxFleet, t as Sandbox, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-DB3wP4hO.js";
|
|
5
5
|
import { a as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, l as createInteractiveControlHolderId, n as browserInteractiveControlHolderId, o as InteractiveSessionControlController, s as InteractiveSessionNotRunningError, t as BrowserInteractiveSessionControlController, u as interactiveSessionIdentityDigest } from "./browser-interactive-control-controller-DHx53yre.js";
|
|
6
6
|
import { C as SandboxOperationFailedError, D as validateDeferredProfileFileMounts, E as splitInlineProfileSkills, S as SandboxOperation, T as splitInlineProfileFileMounts, _ as collectAgentFinalMessageText, a as buildTraceExportPayload, b as isToolBearingEvent, c as toOtelJson, d as InteractiveSessionHandle, f as agentInteractiveSessionPromptRequestDigest, g as applySandboxEventText, h as createInteractiveTerminalSession, i as MAX_EGRESS_DENIALS_LIMIT, l as SandboxTaskSession, m as createInteractiveTerminalCapture, o as exportTraceBundle, p as InteractiveTerminalFrameLog, r as WorkspaceImages, s as otelTraceIdForTangleTrace, t as SandboxInstance, u as SandboxSession, v as collectAgentResponseText, w as materializeProfileFileMounts, x as ManagedProcessClient, y as getSandboxEventText } from "./sandbox-BPLzHOZ1.js";
|
|
7
7
|
import { i as profileChannelReference, n as SandboxLines, r as lineInstanceKey, t as LinesClient } from "./lines-C5ER4aN_.js";
|
|
@@ -431,7 +431,7 @@ interface SessionGatewayStats {
|
|
|
431
431
|
*/
|
|
432
432
|
declare function calculateConnectionQuality(metrics: ConnectionMetrics, isConnected: boolean): ConnectionQuality;
|
|
433
433
|
//#endregion
|
|
434
|
-
//#region ../../../packages/sdk/dist/client-
|
|
434
|
+
//#region ../../../packages/sdk/dist/client-h8AqRerh.d.ts
|
|
435
435
|
//#region src/session-gateway/core-types.d.ts
|
|
436
436
|
interface SubscriptionDenial {
|
|
437
437
|
channel: string;
|
|
@@ -500,38 +500,16 @@ declare const INITIAL_METRICS: ConnectionMetrics; //#endregion
|
|
|
500
500
|
//#region src/session-gateway/core.d.ts
|
|
501
501
|
declare class SessionGatewayClientCore {
|
|
502
502
|
#private;
|
|
503
|
-
private readonly initialMetrics;
|
|
504
503
|
private ws;
|
|
505
504
|
private readonly handlers;
|
|
506
|
-
private readonly replayStateStore;
|
|
507
|
-
private readonly tokenRefresher;
|
|
508
505
|
private state;
|
|
509
|
-
private
|
|
510
|
-
private hasConnectedBefore;
|
|
511
|
-
private connectionEstablishedForSocket;
|
|
512
|
-
private lastPingAt;
|
|
513
|
-
private lastPongAt;
|
|
514
|
-
private lastPingSentAt;
|
|
515
|
-
private missedPongCount;
|
|
516
|
-
private reconnectAttempts;
|
|
517
|
-
private messagesReceived;
|
|
518
|
-
private messagesSent;
|
|
519
|
-
private eventsReceived;
|
|
520
|
-
private duplicatesSkipped;
|
|
521
|
-
private reconnectTimer;
|
|
522
|
-
private pingInterval;
|
|
523
|
-
private pongTimeout;
|
|
524
|
-
private pendingCallbacks;
|
|
506
|
+
private readonly counters;
|
|
525
507
|
private readonly connectionWaiters;
|
|
526
|
-
private
|
|
527
|
-
private
|
|
528
|
-
private
|
|
529
|
-
private
|
|
530
|
-
private
|
|
531
|
-
private currentExecutionId;
|
|
532
|
-
private currentSessionId;
|
|
533
|
-
private isReplaying;
|
|
534
|
-
private replayProgress;
|
|
508
|
+
private readonly reconnects;
|
|
509
|
+
private readonly heartbeat;
|
|
510
|
+
private readonly metrics;
|
|
511
|
+
private readonly replayCursor;
|
|
512
|
+
private readonly inbound;
|
|
535
513
|
constructor(config: SessionGatewayClientConfig$1, initialMetrics?: ConnectionMetrics);
|
|
536
514
|
/**
|
|
537
515
|
* Connect to the session gateway.
|
|
@@ -590,31 +568,11 @@ declare class SessionGatewayClientCore {
|
|
|
590
568
|
*/
|
|
591
569
|
getToken(): string;
|
|
592
570
|
private setState;
|
|
593
|
-
private handleOpen;
|
|
594
571
|
private handleConnectionEstablished;
|
|
595
572
|
private handleClose;
|
|
596
|
-
private handleError;
|
|
597
|
-
private closeBeforeEstablishment;
|
|
598
573
|
private handleMessage;
|
|
599
|
-
private handlePong;
|
|
600
|
-
private dispatchMessage;
|
|
601
|
-
private deliverMessage;
|
|
602
|
-
private trackExecutionContext;
|
|
603
574
|
private send;
|
|
604
575
|
private sendWithResponse;
|
|
605
|
-
private waitForConnectionEstablished;
|
|
606
|
-
private restoreSubscriptions;
|
|
607
|
-
private startPingInterval;
|
|
608
|
-
private stopPingInterval;
|
|
609
|
-
private sendPing;
|
|
610
|
-
private clearPongTimeout;
|
|
611
|
-
private scheduleReconnect;
|
|
612
|
-
private cleanup;
|
|
613
|
-
private updateConnectionMetrics;
|
|
614
|
-
private updateConnectionQuality;
|
|
615
|
-
private trackReconnection;
|
|
616
|
-
private loadReplayState;
|
|
617
|
-
private saveReplayState;
|
|
618
576
|
} //#endregion
|
|
619
577
|
//#region src/session-gateway/client.d.ts
|
|
620
578
|
/** SDK client with its original immediate, synchronous replay commands. */
|