@tangle-network/sandbox 0.36.1 → 0.36.4
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.d.ts +2 -2
- package/dist/agent/index.js +2 -2
- package/dist/{client-BUy5hS2I.d.ts → client-C-f9U8O4.d.ts} +1 -1
- package/dist/{client-CX3LB-64.js → client-DG0Pwadv.js} +1 -1
- package/dist/core.d.ts +2 -2
- package/dist/core.js +2 -2
- package/dist/{index-CtmbhfdA.d.ts → index-DcWLZb5F.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{sandbox-CzKxUiYj.js → sandbox--QhO618M.js} +123 -28
- package/dist/{sandbox-DWTay6Ou.d.ts → sandbox-BK6WNRtc.d.ts} +7 -4
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-BhLq6l2G.js → tangle-CaYKcNaS.js} +1 -1
- package/package.json +3 -3
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as SandboxSession, h as SandboxTaskSession, r as SandboxInstance } from "../sandbox-
|
|
1
|
+
import { g as SandboxSession, h as SandboxTaskSession, r as SandboxInstance } from "../sandbox-BK6WNRtc.js";
|
|
2
2
|
import { D as CodeExecutionResult, E as CodeExecutionOptions, O as CodeLanguage, Si as SessionListOptions, bi as SessionInfo, d as BackendConfig, k as CodeResultPart } from "../types-B00bLoQR.js";
|
|
3
|
-
import { i as Sandbox } from "../client-
|
|
3
|
+
import { i as Sandbox } from "../client-C-f9U8O4.js";
|
|
4
4
|
import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
5
|
|
|
6
6
|
//#region src/agent/instances.d.ts
|
package/dist/agent/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { f as assertCurrentBackendType } from "../runtime-api-ClXF8k_q.js";
|
|
2
2
|
import { d as StateError, o as NotFoundError, p as ValidationError } from "../errors-C6kn-3zt.js";
|
|
3
|
-
import { n as Sandbox } from "../client-
|
|
4
|
-
import { t as SandboxInstance } from "../sandbox
|
|
3
|
+
import { n as Sandbox } from "../client-DG0Pwadv.js";
|
|
4
|
+
import { t as SandboxInstance } from "../sandbox--QhO618M.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
//#region src/agent/instances.ts
|
|
7
7
|
const managers = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as TraceExportResult, n as HttpClient, r as SandboxInstance, u as TraceExportSink } from "./sandbox-
|
|
1
|
+
import { l as TraceExportResult, n as HttpClient, r as SandboxInstance, u as TraceExportSink } from "./sandbox-BK6WNRtc.js";
|
|
2
2
|
import { l as ScopedToken, s as MintInteractiveSessionTokenOptions } from "./terminal-stream-5GNLCsms.js";
|
|
3
3
|
import { Ar as SandboxFleetToken, At as FleetDriveTurnRequest, Bn as PublicTemplateVersionInfo, Br as SandboxIdentity, Dt as FleetDispatchResultBufferOptions, Er as SandboxFleetManifest, Et as FleetDispatchResultBuffer, F as CreateSandboxFleetOptions, Fr as SandboxFleetUsage, Ft as FleetPromptDispatchResult, Gn as ReconcileSandboxFleetsOptions, Hn as PublishPublicTemplateVersionOptions, I as CreateSandboxFleetTokenOptions, Ji as TokenRefreshHandler, Kn as ReconcileSandboxFleetsResult, L as CreateSandboxFleetWithCoordinatorOptions, Li as SubscriptionInfo, Lr as SandboxFleetWorkspaceReconcileResult, Mn as PromptInputPart, Mt as FleetExecDispatchResult, N as CreateIntelligenceReportOptions, Ni as SshKeysManager, Nn as PromptOptions, Nt as FleetMachineId, Or as SandboxFleetOperationsSummary, Ot as FleetDispatchStreamOptions, P as CreateRequestOptions, Pn as PromptResult, Pr as SandboxFleetTraceOptions, Pt as FleetPromptDispatchOptions, R as CreateSandboxOptions, Rr as SandboxFleetWorkspaceRestoreResult, Tt as FleetDispatchCancelResult, Un as ReapExpiredSandboxFleetsOptions, Vn as PublishPublicTemplateOptions, Vr as SandboxInfo, Wn as ReapExpiredSandboxFleetsResult, _r as SandboxFleetDispatchResponse, an as IntelligenceReportCompareTo, ar as SandboxConfig, b as BatchRunRequest, br as SandboxFleetInfo, ca as BatchEvent, dn as ListSandboxFleetOptions, dr as SandboxEnvironment, dt as ExecResult, ea as UsageInfo, fn as ListSandboxOptions, hr as SandboxFleetCostEstimate, in as IntelligenceReportBudget, jr as SandboxFleetTraceBundle, jt as FleetExecDispatchOptions, kt as FleetDriveTurnOutcome, l as AttachSandboxFleetMachineOptions, mr as SandboxFleetArtifactSpec, pr as SandboxFleetArtifact, rn as IntelligenceReport, sn as IntelligenceReportWindow, ui as SecretsManager, ut as ExecOptions, v as BatchResult, vr as SandboxFleetDriverCapability, wr as SandboxFleetMachineRecord, y as BatchRunOptions, zn as PublicTemplateInfo, zr as SandboxFleetWorkspaceSnapshotResult } from "./types-B00bLoQR.js";
|
|
4
4
|
import { AgentInteractiveSessionRef } from "@tangle-network/agent-interface";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as backendTypeSchema, c as encodePromptForWire, d as applyRequestedModel, f as assertCurrentBackendType, l as encodeTextForWire, o as SANDBOX_PROXY_REQUEST_MAX_BYTES, p as normalizeRuntimeBackendConfig, u as parseSSEStream } from "./runtime-api-ClXF8k_q.js";
|
|
2
2
|
import { a as NetworkError, f as TimeoutError, l as SandboxError, m as parseErrorResponse, o as NotFoundError, p as ValidationError, s as PartialFailureError, t as AuthError, u as ServerError } from "./errors-C6kn-3zt.js";
|
|
3
3
|
import { n as combineAbortSignals } from "./abort-signal-si1WMfJb.js";
|
|
4
|
-
import { E as normalizeConnection, O as exportTraceBundle, b as requestInteractiveSessionToken, i as normalizeStartupDiagnostics, n as createSandboxInstanceFromResponse, r as normalizeSandboxCreateReceipt } from "./sandbox
|
|
4
|
+
import { E as normalizeConnection, O as exportTraceBundle, b as requestInteractiveSessionToken, i as normalizeStartupDiagnostics, n as createSandboxInstanceFromResponse, r as normalizeSandboxCreateReceipt } from "./sandbox--QhO618M.js";
|
|
5
5
|
import { agentProfileSchema } from "@tangle-network/agent-interface";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/backend-registry.ts
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as WorkspaceImagePublishRequestOptions, i as WorkspaceImagePublishInput, o as WorkspaceImagePublishResult, r as SandboxInstance, s as WorkspaceImages } from "./sandbox-
|
|
1
|
+
import { a as WorkspaceImagePublishRequestOptions, i as WorkspaceImagePublishInput, o as WorkspaceImagePublishResult, r as SandboxInstance, s as WorkspaceImages } from "./sandbox-BK6WNRtc.js";
|
|
2
2
|
import { Cn as PreviewLinkWaitOptions, Mn as PromptInputPart, R as CreateSandboxOptions, Sn as PreviewLinkManager, Vr as SandboxInfo, Yr as SandboxStatus, ar as SandboxConfig, dt as ExecResult, gn as NetworkConfig, ut as ExecOptions, xn as PreviewLinkInfo } from "./types-B00bLoQR.js";
|
|
3
|
-
import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, b as backendRegistryEntrySchema, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-
|
|
3
|
+
import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, b as backendRegistryEntrySchema, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-C-f9U8O4.js";
|
|
4
4
|
import { a as NetworkError, c as QuotaError, d as SandboxFailureDetail, f as ServerError, h as ValidationError, i as FileWriteConflictError, l as SandboxError, m as TimeoutError, n as CapabilityError, o as NotFoundError, p as StateError, s as PartialFailureError, t as AuthError, u as SandboxErrorJson } from "./errors-CQOvGddH.js";
|
|
5
5
|
export { AuthError, type BackendRegistryCapabilities, type BackendRegistryEntry, type BackendRegistryInteractionKind, type BackendRegistryResponse, CapabilityError, type CreateSandboxOptions, type ExecOptions, type ExecResult, FileWriteConflictError, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, type PreviewLinkWaitOptions, type PromptInputPart, QuotaError, Sandbox, type SandboxConfig, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, StateError, TimeoutError, ValidationError, type WorkspaceImagePublishInput, type WorkspaceImagePublishRequestOptions, type WorkspaceImagePublishResult, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, isBackendRegistryInteractionKind, parseBackendRegistryResponse, parseBackendRegistryResponseBody };
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as NetworkError, c as QuotaError, d as StateError, f as TimeoutError, i as FileWriteConflictError, l as SandboxError, n as CapabilityError, o as NotFoundError, p as ValidationError, s as PartialFailureError, t as AuthError, u as ServerError } from "./errors-C6kn-3zt.js";
|
|
2
|
-
import { _ as parseBackendRegistryResponse, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, p as backendRegistryEntrySchema, v as parseBackendRegistryResponseBody } from "./client-
|
|
3
|
-
import { a as WorkspaceImages, t as SandboxInstance } from "./sandbox
|
|
2
|
+
import { _ as parseBackendRegistryResponse, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, p as backendRegistryEntrySchema, v as parseBackendRegistryResponseBody } from "./client-DG0Pwadv.js";
|
|
3
|
+
import { a as WorkspaceImages, t as SandboxInstance } from "./sandbox--QhO618M.js";
|
|
4
4
|
export { AuthError, CapabilityError, FileWriteConflictError, NetworkError, NotFoundError, PartialFailureError, QuotaError, Sandbox, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, isBackendRegistryInteractionKind, parseBackendRegistryResponse, parseBackendRegistryResponseBody };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { $ as SandboxMcpEndpoint, A as InterruptResult, B as InteractiveAttachRequest, C as InteractiveSessionHost, D as InteractiveSessionStartOptions, E as InteractiveSessionRef, F as InteractiveTerminalMetadata, G as SandboxInteractionConflict, H as InteractiveSessionControllerOptions, I as createInteractiveTerminalCapture, J as BuildControlPlaneMcpConfigOptions, K as SandboxInteractionResolution, L as createInteractiveTerminalSession, M as agentInteractiveSessionPromptRequestDigest, N as InteractiveTerminalCapture, O as InteractiveSessionStartResult, P as InteractiveTerminalFrameLog, Q as SandboxMcpConfig, R as BrowserInteractiveSessionController, S as InteractiveSessionHandleOptions, T as InteractiveSessionInfo, U as InteractiveSessionControllerTransport, V as InteractiveSessionController, W as SandboxInteractionCommandResult, X as CONTROL_PLANE_MCP_SERVER_NAME, Y as BuildSandboxMcpConfigOptions, Z as SANDBOX_MCP_SERVER_NAME, _ as AgentInteractiveTerminalSession, a as WorkspaceImagePublishRequestOptions, b as InteractiveSessionControlClaim, c as TraceExportFormat, d as buildTraceExportPayload, et as SandboxMcpServerEntry, f as exportTraceBundle, g as SandboxSession, h as SandboxTaskSession, i as WorkspaceImagePublishInput, j as RespondToPermissionOptions, k as InteractiveStopCommand, l as TraceExportResult, m as toOtelJson, nt as buildSandboxMcpConfig, o as WorkspaceImagePublishResult, p as otelTraceIdForTangleTrace, q as SandboxInteractionResult, r as SandboxInstance, s as WorkspaceImages, t as ForkAcknowledgement, tt as buildControlPlaneMcpConfig, u as TraceExportSink, v as InteractiveControlClaimRequest, w as InteractiveSessionIncarnationId, x as InteractiveSessionHandle, y as InteractivePromptCommand, z as BrowserInteractiveSessionControllerOptions } from "./sandbox-
|
|
1
|
+
import { $ as SandboxMcpEndpoint, A as InterruptResult, B as InteractiveAttachRequest, C as InteractiveSessionHost, D as InteractiveSessionStartOptions, E as InteractiveSessionRef, F as InteractiveTerminalMetadata, G as SandboxInteractionConflict, H as InteractiveSessionControllerOptions, I as createInteractiveTerminalCapture, J as BuildControlPlaneMcpConfigOptions, K as SandboxInteractionResolution, L as createInteractiveTerminalSession, M as agentInteractiveSessionPromptRequestDigest, N as InteractiveTerminalCapture, O as InteractiveSessionStartResult, P as InteractiveTerminalFrameLog, Q as SandboxMcpConfig, R as BrowserInteractiveSessionController, S as InteractiveSessionHandleOptions, T as InteractiveSessionInfo, U as InteractiveSessionControllerTransport, V as InteractiveSessionController, W as SandboxInteractionCommandResult, X as CONTROL_PLANE_MCP_SERVER_NAME, Y as BuildSandboxMcpConfigOptions, Z as SANDBOX_MCP_SERVER_NAME, _ as AgentInteractiveTerminalSession, a as WorkspaceImagePublishRequestOptions, b as InteractiveSessionControlClaim, c as TraceExportFormat, d as buildTraceExportPayload, et as SandboxMcpServerEntry, f as exportTraceBundle, g as SandboxSession, h as SandboxTaskSession, i as WorkspaceImagePublishInput, j as RespondToPermissionOptions, k as InteractiveStopCommand, l as TraceExportResult, m as toOtelJson, nt as buildSandboxMcpConfig, o as WorkspaceImagePublishResult, p as otelTraceIdForTangleTrace, q as SandboxInteractionResult, r as SandboxInstance, s as WorkspaceImages, t as ForkAcknowledgement, tt as buildControlPlaneMcpConfig, u as TraceExportSink, v as InteractiveControlClaimRequest, w as InteractiveSessionIncarnationId, x as InteractiveSessionHandle, y as InteractivePromptCommand, z as BrowserInteractiveSessionControllerOptions } from "./sandbox-BK6WNRtc.js";
|
|
2
2
|
import { c as MintScopedTokenOptions, d as TERMINAL_WS_ECHO_SUBPROTOCOL, f as TerminalExitInfo, g as TerminalStreamAuthFormat, h as TerminalReadyInfo, i as TerminalStreamOptions, l as ScopedToken, m as TerminalOutputMessage, n as TerminalStreamError, o as TerminalStreamToken, p as TerminalInteractiveSessionIdentity, r as TerminalStreamHandlers, s as MintInteractiveSessionTokenOptions, t as TerminalStream, u as ScopedTokenScope } from "./terminal-stream-5GNLCsms.js";
|
|
3
3
|
import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, d as InteractiveAttachOptions, f as InteractiveControlClaimAcknowledgement, h as InteractiveSessionStatus, i as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, l as createInteractiveControlHolderId, m as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, p as InteractiveControlClaimOptions, r as browserInteractiveControlHolderId, s as InteractiveSessionControlTransport, t as BrowserInteractiveSessionControlController, u as interactiveSessionIdentityDigest } from "./browser-interactive-control-controller-lRfzpg9t.js";
|
|
4
4
|
import { $ as DurablePlanDecisionResult, $i as UploadProgress, $n as RolloutScorer, $r as SandboxTerminalManager, $t as GpuLeaseStatus, A as CommitTaskSessionOptions, Ai as SnapshotInfo, An as ProcessSpawnOptions, Ar as SandboxFleetToken, At as FleetDriveTurnRequest, B as CreateTaskSessionOptions, Bi as TaskSessionFileChange, Bn as PublicTemplateVersionInfo, Br as SandboxIdentity, Bt as GitAuth, C as BranchOptions, Ci as SessionMessage, Cn as PreviewLinkWaitOptions, Cr as SandboxFleetMachineMeteredUsage, Ct as FileUsageResult, Di as SnapshotDeleteAcknowledgement, Dn as ProcessLogEntry, Dr as SandboxFleetManifestMachine, Dt as FleetDispatchResultBufferOptions, Ei as SessionStatus, En as ProcessListOptions, Er as SandboxFleetManifest, Et as FleetDispatchResultBuffer, F as CreateSandboxFleetOptions, Fi as StartupOperation, Fn as ProvisionEvent, Fr as SandboxFleetUsage, G as DispatchedSession, Gi as TeeAttestationResponse, Gn as ReconcileSandboxFleetsOptions, Gr as SandboxResourceUsage, Gt as GitStatus, H as DevServerInfo, Hi as TaskSessionProfile, Hn as PublishPublicTemplateVersionOptions, Hr as SandboxIntelligenceEnvelope, Ht as GitCommit, Ii as StorageConfig, In as ProvisionResult, Ir as SandboxFleetWorkspace, It as ForkCounts, J as DriveTurnOptions, Ji as TokenRefreshHandler, Jr as SandboxRuntimeHealth, Jt as GpuLeaseCommandResult, K as DownloadOptions, Ki as TeePublicKey, Kn as ReconcileSandboxFleetsResult, Kr as SandboxResources, Kt as GpuLease, L as CreateSandboxFleetWithCoordinatorOptions, Li as SubscriptionInfo, Ln as ProvisionStatus, Lr as SandboxFleetWorkspaceReconcileResult, Lt as ForkIdempotency, M as CreateGpuLeaseOptions, Mi as SnapshotResult, Mn as PromptInputPart, Mr as SandboxFleetTraceEvent, N as CreateIntelligenceReportOptions, Nn as PromptOptions, Nr as SandboxFleetTraceExport, Nt as FleetMachineId, Oi as SnapshotDeleteOutcome, On as ProcessManager, Or as SandboxFleetOperationsSummary, Ot as FleetDispatchStreamOptions, P as CreateRequestOptions, Pi as StartupDiagnostics, Pn as PromptResult, Pr as SandboxFleetTraceOptions, Pt as FleetPromptDispatchOptions, Q as DurablePlan, Qi as UploadOptions, Qn as RolloutOptions, Qr as SandboxTerminalInfo, Qt as GpuLeaseProviderName, R as CreateSandboxOptions, Ri as TaskSessionChanges, Rn as ProvisionStep, Rr as SandboxFleetWorkspaceRestoreResult, Rt as ForkLookupOptions, S as BatchTaskResult, Si as SessionListOptions, Sn as PreviewLinkManager, Sr as SandboxFleetMachine, St as FileUsageOptions, T as ChunkedUploadResult, Ti as SessionResultOptions, Tn as ProcessInfo, Tr as SandboxFleetMachineSpec, Tt as FleetDispatchCancelResult, U as DirectoryPermission, Ui as TeeAttestationOptions, Un as ReapExpiredSandboxFleetsOptions, Ur as SandboxPortBinding, Ut as GitConfig, V as DeleteOptions, Vi as TaskSessionInfo, Vn as PublishPublicTemplateOptions, Vr as SandboxInfo, Vt as GitBranch, W as DispatchPromptOptions, Wi as TeeAttestationReport, Wn as ReapExpiredSandboxFleetsResult, Wr as SandboxPortPreviewLink, Wt as GitDiff, X as DriverInfo, Xi as TurnDriveResult, Xn as Rollout, Xr as SandboxTerminalAttachOptions, Xt as GpuLeaseExecResult, Y as DriverConfig, Yi as TokenUsage, Yr as SandboxStatus, Yt as GpuLeaseExecOptions, Z as DriverType, Zi as UpdateUserOptions, Zn as RolloutChildResult, Zr as SandboxTerminalCreateOptions, Zt as GpuLeaseManager, _ as BatchBackend, _i as SessionExecutionStatus, _n as NetworkManager, _r as SandboxFleetDispatchResponse, _t as FileRenameResult, aa as WriteManyFile, ai as SandboxTraceOptions, an as IntelligenceReportCompareTo, ar as SandboxConfig, at as EgressManager, b as BatchRunRequest, bi as SessionInfo, bn as PermissionsManager, br as SandboxFleetInfo, bt as FileTreeOptions, c as AttachGpuLeaseOptions, ca as BatchEvent, ci as SearchOptions, cr as SandboxCreateReceipt, ct as EventStreamOptions, d as BackendConfig, da as BatchTaskUsage, di as SendSessionMessageOptions, dn as ListSandboxFleetOptions, dr as SandboxEnvironment, dt as ExecResult, ea as UsageInfo, ei as SandboxTerminalRequestOptions, en as HostAgentDriverConfig, er as RolloutStartResult, f as BackendInfo, fa as PublicBatchRunRequest, fi as SendSessionMessageRequest, fn as ListSandboxOptions, fr as SandboxEvent, ft as FileInfo, g as BackendStatus, gi as SessionExecutionInfo, gn as NetworkConfig, gr as SandboxFleetDispatchFailureClass, gt as FileReadResult, h as BackendRuntimeConfigUpdate, hi as SessionEventStreamOptions, hn as MkdirOptions, hr as SandboxFleetCostEstimate, ht as FileReadError, ia as WriteFileOptions, ii as SandboxTraceExport, in as IntelligenceReportBudget, ir as SSHCredentials, it as EgressDenial, j as CompletedTurnResult, ji as SnapshotOptions, jn as ProcessStatus, jr as SandboxFleetTraceBundle, jt as FleetExecDispatchOptions, ki as SnapshotIdempotency, kn as ProcessSignal, kr as SandboxFleetPolicy, kt as FleetDriveTurnOutcome, l as AttachSandboxFleetMachineOptions, la as BatchEventDataMap, li as SecretInfo, ln as ListMessagesOptions, lr as SandboxDeleteAcknowledgement, lt as ExactProcessSpawnOptions, m as BackendMcpServerStatus, ma as parseBackendType, mi as SessionBackendCredentials, mn as McpServerConfig, mr as SandboxFleetArtifactSpec, mt as FileReadBatchResult, n as AccessPolicyRule, na as WaitForRolloutOptions, ni as SandboxTraceBundle, nn as InstalledTool, nr as RolloutTurnPart, nt as EffectiveBackendProfile, oa as WriteManyOptions, oi as SandboxUser, on as IntelligenceReportSubjectType, or as SandboxConnection, ot as EgressPolicy, p as BackendManager, pa as BackendType, pi as SentSessionMessage, pn as MAX_EGRESS_DENIALS_LIMIT, pr as SandboxFleetArtifact, pt as FileReadBatchOptions, q as DownloadProgress, qi as TeePublicKeyResponse, qn as RenameOptions, qr as SandboxRuntimeCapabilities, qt as GpuLeaseBilling, r as AddUserOptions, ra as WorkspaceOperationLookup, ri as SandboxTraceEvent, rn as IntelligenceReport, rr as SSHCommandDescriptor, rt as EffectiveBackendSource, sa as BatchBackendStats, si as SearchMatch, sn as IntelligenceReportWindow, sr as SandboxCreateOutcome, st as EnsureDevServerOptions, t as AcceleratorKind, ta as WaitForOptions, ti as SandboxTerminals, tn as HostAgentRuntimeBackend, tr as RolloutStatus, tt as EffectiveBackend, u as BackendCapabilities, ua as BatchSidecarGroup, ui as SecretsManager, un as ListOptions, ur as SandboxDeleteOutcome, ut as ExecOptions, v as BatchResult, vi as SessionFailureReason, vn as NonHostAgentDriverConfig, vr as SandboxFleetDriverCapability, vt as FileSystem, w as ChunkedUploadOptions, wi as SessionMessageInputPart, wn as Process, wr as SandboxFleetMachineRecord, wt as FileWriteResult, x as BatchTask, xi as SessionInterruptOptions, xn as PreviewLinkInfo, xr as SandboxFleetIntelligenceEnvelope, xt as FileTreeResult, y as BatchRunOptions, yi as SessionForkOptions, yn as PermissionLevel, yr as SandboxFleetDriverTimings, yt as FileTreeFile, z as CreateSessionOptions, zi as TaskSessionCommitResult, zn as PublicTemplateInfo, zr as SandboxFleetWorkspaceSnapshotResult, zt as GPU_LEASE_PROVIDER_NAMES } from "./types-B00bLoQR.js";
|
|
5
|
-
import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, a as Team, b as backendRegistryEntrySchema, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-
|
|
5
|
+
import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, a as Team, b as backendRegistryEntrySchema, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-C-f9U8O4.js";
|
|
6
6
|
import { d as AnyTokenPayload, h as IssueCollaborationTokenOptions, m as CollaborationTokenPayload, p as CollaborationAccess } from "./index-Bq_z_u6A.js";
|
|
7
7
|
import { _ as CollaborationTransportConfig, a as CollaborationClient, c as CollaborationClientConfig, d as CollaborationDocumentRef, f as CollaborationFileBridgeOptions, g as CollaborationTokenRefreshResponse, h as CollaborationTokenRefreshRequest, i as parseCollaborationDocumentId, l as CollaborationDocumentAdapter, m as CollaborationPermissions, n as buildCollaborationDocumentId, o as CollaborationBootstrapRequest, p as CollaborationFileEvent, r as normalizeCollaborationPath, s as CollaborationBootstrapResponse, t as CollaborationFileBridge, u as CollaborationDocumentChange, v as SaveCollaborationSnapshotRequest, y as SaveCollaborationSnapshotResponse } from "./index-CMLW3u5K.js";
|
|
8
8
|
import { a as NetworkError, c as QuotaError, d as SandboxFailureDetail, f as ServerError, h as ValidationError, i as FileWriteConflictError, l as SandboxError, m as TimeoutError, n as CapabilityError, o as NotFoundError, p as StateError, r as EgressProxyRecoveryError, s as PartialFailureError, t as AuthError, u as SandboxErrorJson } from "./errors-CQOvGddH.js";
|
|
9
9
|
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-C0T6t4zn.js";
|
|
10
|
-
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-
|
|
10
|
+
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-DcWLZb5F.js";
|
|
11
11
|
import * as _$_tangle_network_agent_interface0 from "@tangle-network/agent-interface";
|
|
12
12
|
import { AgentProfile, AgentProfile as AgentProfile$1, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileConfigValue, AgentProfileConnection, AgentProfileFileMount, AgentProfileFileMount as AgentProfileFileMount$1, AgentProfileMcpServer, AgentProfileModelHints, AgentProfilePermissionValue, AgentProfilePrompt, AgentProfileResourceRef, AgentProfileResources, AgentProfileSecurityPolicy, AgentProfileValidationIssue, AgentProfileValidationResult, AgentRunCancellationAcknowledgement, AgentRunCancellationRequest, AgentSubagentProfile, Capability, SANDBOX_SIZE_PRESET_NAMES, SandboxSizePreset } from "@tangle-network/agent-interface";
|
|
13
13
|
import * as _$zod from "zod";
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { _ as backendTypeSchema, g as deriveAgentRunOutcome, h as deriveAgentResultOutcome, m as createAgentRunOutcomeTracker, p as normalizeRuntimeBackendConfig, u as parseSSEStream, v as parseBackendType } from "./runtime-api-ClXF8k_q.js";
|
|
2
2
|
import { a as NetworkError, c as QuotaError, d as StateError, f as TimeoutError, i as FileWriteConflictError, l as SandboxError, n as CapabilityError, o as NotFoundError, p as ValidationError, r as EgressProxyRecoveryError, s as PartialFailureError, t as AuthError, u as ServerError } from "./errors-C6kn-3zt.js";
|
|
3
|
-
import { _ as parseBackendRegistryResponse, a as splitInlineProfileSkills, c as SandboxFleetClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as splitInlineProfileFileMounts, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, o as validateDeferredProfileFileMounts, p as backendRegistryEntrySchema, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-
|
|
3
|
+
import { _ as parseBackendRegistryResponse, a as splitInlineProfileSkills, c as SandboxFleetClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as splitInlineProfileFileMounts, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, o as validateDeferredProfileFileMounts, p as backendRegistryEntrySchema, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-DG0Pwadv.js";
|
|
4
4
|
import { a as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, c as createInteractiveControlHolderId, l as interactiveSessionIdentityDigest, n as browserInteractiveControlHolderId, o as InteractiveSessionControlController, t as BrowserInteractiveSessionControlController } from "./browser-interactive-control-controller-Dv0gbFMu.js";
|
|
5
|
-
import { A as toOtelJson, C as collectAgentResponseText, D as buildTraceExportPayload, O as exportTraceBundle, S as collectAgentFinalMessageText, T as isToolBearingEvent, _ as TerminalStream, a as WorkspaceImages, c as SandboxTaskSession, d as agentInteractiveSessionPromptRequestDigest, f as InteractiveTerminalFrameLog, g as InteractiveSessionController, h as BrowserInteractiveSessionController, k as otelTraceIdForTangleTrace, l as SandboxSession, m as createInteractiveTerminalSession, o as GPU_LEASE_PROVIDER_NAMES, p as createInteractiveTerminalCapture, s as MAX_EGRESS_DENIALS_LIMIT, t as SandboxInstance, u as InteractiveSessionHandle, v as TerminalStreamError, w as getSandboxEventText, x as applySandboxEventText, y as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./sandbox
|
|
5
|
+
import { A as toOtelJson, C as collectAgentResponseText, D as buildTraceExportPayload, O as exportTraceBundle, S as collectAgentFinalMessageText, T as isToolBearingEvent, _ as TerminalStream, a as WorkspaceImages, c as SandboxTaskSession, d as agentInteractiveSessionPromptRequestDigest, f as InteractiveTerminalFrameLog, g as InteractiveSessionController, h as BrowserInteractiveSessionController, k as otelTraceIdForTangleTrace, l as SandboxSession, m as createInteractiveTerminalSession, o as GPU_LEASE_PROVIDER_NAMES, p as createInteractiveTerminalCapture, s as MAX_EGRESS_DENIALS_LIMIT, t as SandboxInstance, u as InteractiveSessionHandle, v as TerminalStreamError, w as getSandboxEventText, x as applySandboxEventText, y as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./sandbox--QhO618M.js";
|
|
6
6
|
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-DQD9kCdN.js";
|
|
7
|
-
import { t as TangleSandboxClient } from "./tangle-
|
|
7
|
+
import { t as TangleSandboxClient } from "./tangle-CaYKcNaS.js";
|
|
8
8
|
import { SANDBOX_SIZE_PRESET_NAMES, agentProfileConfidentialSchema, agentProfileSchema } from "@tangle-network/agent-interface";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
//#region src/confidential.ts
|
|
@@ -3198,7 +3198,7 @@ function normalizeProvisionStep(raw) {
|
|
|
3198
3198
|
* response into a {@link StartupDiagnostics}, deriving the
|
|
3199
3199
|
* operation-name → duration `phases` map. Returns `null` when the
|
|
3200
3200
|
* payload is absent or carries no operations — diagnostics are emitted
|
|
3201
|
-
*
|
|
3201
|
+
* on create and lifecycle responses, so most ordinary reads have no payload to
|
|
3202
3202
|
* normalize.
|
|
3203
3203
|
*/
|
|
3204
3204
|
function normalizeStartupDiagnostics(raw) {
|
|
@@ -3455,6 +3455,65 @@ const delayUntilAborted = (ms, signal) => new Promise((resolve, reject) => {
|
|
|
3455
3455
|
}
|
|
3456
3456
|
signal?.addEventListener("abort", onAbort, { once: true });
|
|
3457
3457
|
});
|
|
3458
|
+
/**
|
|
3459
|
+
* The platform's typed refusal when one sandbox already has a lifecycle
|
|
3460
|
+
* operation in flight: HTTP 409 from `withSandboxLifecycleClaim`
|
|
3461
|
+
* (products/sandbox/api/src/routes/sandbox-lifecycle-claim.ts).
|
|
3462
|
+
*/
|
|
3463
|
+
const LIFECYCLE_CONFLICT_CODE = "SANDBOX_LIFECYCLE_IN_PROGRESS";
|
|
3464
|
+
/**
|
|
3465
|
+
* How long a lifecycle call re-attempts that refusal before it surfaces.
|
|
3466
|
+
*
|
|
3467
|
+
* MEASURED MOTIVE. `resume`, `stop` and `delete` are the only three routes the
|
|
3468
|
+
* API guards, and they share one lease per sandbox, `lifecycle-<id>`. That
|
|
3469
|
+
* lease outlives the response of the call that took it: the delete handler
|
|
3470
|
+
* registers deferred key-revoke and meta-delete work through
|
|
3471
|
+
* `deferSandboxLifecycleWork`, and the release is chained after that work
|
|
3472
|
+
* through `executionCtx.waitUntil`. So a second lifecycle call landing inside
|
|
3473
|
+
* that window is refused even though nothing is wrong and the caller only has
|
|
3474
|
+
* to wait. The platform's own workflow smoke already hand-rolls this retry and
|
|
3475
|
+
* says why (scripts/platform-workflow-deploy-smoke.mjs: "the worker can still
|
|
3476
|
+
* hold the sandbox lifecycle claim while its final action cleanup completes,
|
|
3477
|
+
* so sandbox-api returns a typed 409 for a short, valid window").
|
|
3478
|
+
*
|
|
3479
|
+
* The number: 2 of 2 provider-seam runs on 2026-09-01 (tangle-network/agent-sdk#280)
|
|
3480
|
+
* lost a completed agent turn to this refusal. `agent-runtime`'s provider
|
|
3481
|
+
* executor destroys one environment twice — once when the stream settles and
|
|
3482
|
+
* once from `teardown()` — and the second DELETE was refused, which discarded
|
|
3483
|
+
* the first one's result. Nothing about the sandbox document tells a client the
|
|
3484
|
+
* lease is held (the response schema is `.strict()` and carries no lifecycle
|
|
3485
|
+
* field), so a status poll cannot replace this retry.
|
|
3486
|
+
*
|
|
3487
|
+
* The ceiling is short on purpose. The lease TTL is 360 s, but the window this
|
|
3488
|
+
* closes is the deferred-cleanup tail of an operation that already answered;
|
|
3489
|
+
* a conflict that outlives ~11 s is a genuinely concurrent operation and
|
|
3490
|
+
* belongs to the caller, not to a longer sleep here.
|
|
3491
|
+
*/
|
|
3492
|
+
const LIFECYCLE_CONFLICT_MAX_ATTEMPTS = 6;
|
|
3493
|
+
const LIFECYCLE_CONFLICT_BASE_DELAY_MS = 500;
|
|
3494
|
+
const LIFECYCLE_CONFLICT_MAX_DELAY_MS = 4e3;
|
|
3495
|
+
function isLifecycleConflict(cause) {
|
|
3496
|
+
return cause instanceof SandboxError && cause.status === 409 && cause.code === LIFECYCLE_CONFLICT_CODE;
|
|
3497
|
+
}
|
|
3498
|
+
function lifecycleConflictDelayMs(cause, failedAttempt) {
|
|
3499
|
+
if (cause instanceof SandboxError && cause.retryAfterMs !== void 0) return cause.retryAfterMs;
|
|
3500
|
+
return Math.min(LIFECYCLE_CONFLICT_BASE_DELAY_MS * 2 ** Math.max(0, failedAttempt - 1), LIFECYCLE_CONFLICT_MAX_DELAY_MS);
|
|
3501
|
+
}
|
|
3502
|
+
/**
|
|
3503
|
+
* Run one lifecycle mutation, re-attempting only the platform's typed
|
|
3504
|
+
* "already in progress" refusal.
|
|
3505
|
+
*
|
|
3506
|
+
* Every other failure keeps its identity and its stack: this widens no other
|
|
3507
|
+
* error class, and a caller abort ends the wait immediately.
|
|
3508
|
+
*/
|
|
3509
|
+
async function withLifecycleConflictRetry(run, options) {
|
|
3510
|
+
for (let attempt = 1;; attempt += 1) try {
|
|
3511
|
+
return await run();
|
|
3512
|
+
} catch (error) {
|
|
3513
|
+
if (!isLifecycleConflict(error) || attempt >= LIFECYCLE_CONFLICT_MAX_ATTEMPTS || options?.signal?.aborted) throw error;
|
|
3514
|
+
await delayUntilAborted(lifecycleConflictDelayMs(error, attempt), options?.signal);
|
|
3515
|
+
}
|
|
3516
|
+
}
|
|
3458
3517
|
const SANDBOX_STATUS_FRESHNESS_MS = 1e3;
|
|
3459
3518
|
const sandboxStatusObservedAt = /* @__PURE__ */ new WeakMap();
|
|
3460
3519
|
const directRuntimeInstances = /* @__PURE__ */ new WeakSet();
|
|
@@ -6820,13 +6879,17 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6820
6879
|
* returns it (replacing the create breakdown).
|
|
6821
6880
|
*/
|
|
6822
6881
|
async stop() {
|
|
6823
|
-
const response = await
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6882
|
+
const response = await withLifecycleConflictRetry(async () => {
|
|
6883
|
+
const attempt = await this.client.fetch(`/v1/sandboxes/${this.id}/stop`, { method: "POST" });
|
|
6884
|
+
if (!attempt.ok) {
|
|
6885
|
+
const body = await attempt.text();
|
|
6886
|
+
throw parseErrorResponse(attempt.status, body, void 0, attempt.headers);
|
|
6887
|
+
}
|
|
6888
|
+
return attempt;
|
|
6889
|
+
});
|
|
6890
|
+
const data = await this.readLifecycleResponse(response);
|
|
6891
|
+
if (!this.applyLifecycleResponse(data)) await this.refresh();
|
|
6892
|
+
const diagnostics = data ? normalizeStartupDiagnostics(data.startupDiagnostics) : null;
|
|
6830
6893
|
if (diagnostics) this.info.startupDiagnostics = diagnostics;
|
|
6831
6894
|
}
|
|
6832
6895
|
/**
|
|
@@ -6836,16 +6899,20 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6836
6899
|
if (options.timeoutMs !== void 0 && (!Number.isFinite(options.timeoutMs) || options.timeoutMs <= 0)) throw new ValidationError("resume timeoutMs must be a positive number");
|
|
6837
6900
|
const timeoutSignal = options.timeoutMs ? AbortSignal.timeout(options.timeoutMs) : void 0;
|
|
6838
6901
|
const signal = timeoutSignal ? options.signal ? combineAbortSignals([options.signal, timeoutSignal]) : timeoutSignal : options.signal;
|
|
6839
|
-
const response = await
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6902
|
+
const response = await withLifecycleConflictRetry(async () => {
|
|
6903
|
+
const attempt = await this.client.fetch(`/v1/sandboxes/${this.id}/resume`, {
|
|
6904
|
+
method: "POST",
|
|
6905
|
+
...signal ? { signal } : {}
|
|
6906
|
+
}, usableTimeoutMs(options.timeoutMs));
|
|
6907
|
+
if (!attempt.ok) {
|
|
6908
|
+
const body = await attempt.text();
|
|
6909
|
+
throw parseErrorResponse(attempt.status, body, void 0, attempt.headers);
|
|
6910
|
+
}
|
|
6911
|
+
return attempt;
|
|
6912
|
+
}, signal ? { signal } : {});
|
|
6913
|
+
const data = await this.readLifecycleResponse(response);
|
|
6914
|
+
if (!this.applyLifecycleResponse(data)) await this.refresh();
|
|
6915
|
+
const diagnostics = data ? normalizeStartupDiagnostics(data.startupDiagnostics) : null;
|
|
6849
6916
|
if (diagnostics) this.info.startupDiagnostics = diagnostics;
|
|
6850
6917
|
}
|
|
6851
6918
|
/**
|
|
@@ -6861,10 +6928,26 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6861
6928
|
* now-gone sandbox.
|
|
6862
6929
|
*/
|
|
6863
6930
|
async delete() {
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6931
|
+
let sawLifecycleConflict = false;
|
|
6932
|
+
let response;
|
|
6933
|
+
try {
|
|
6934
|
+
response = await withLifecycleConflictRetry(async () => {
|
|
6935
|
+
const attempt = await this.client.fetch(`/v1/sandboxes/${this.id}`, { method: "DELETE" });
|
|
6936
|
+
if (!attempt.ok) {
|
|
6937
|
+
const body = await attempt.text();
|
|
6938
|
+
const refusal = parseErrorResponse(attempt.status, body, void 0, attempt.headers);
|
|
6939
|
+
if (isLifecycleConflict(refusal)) sawLifecycleConflict = true;
|
|
6940
|
+
throw refusal;
|
|
6941
|
+
}
|
|
6942
|
+
return attempt;
|
|
6943
|
+
});
|
|
6944
|
+
} catch (caught) {
|
|
6945
|
+
if (!sawLifecycleConflict || !(caught instanceof NotFoundError)) throw caught;
|
|
6946
|
+
sandboxStatusObservedAt.delete(this);
|
|
6947
|
+
return {
|
|
6948
|
+
sandboxId: this.id,
|
|
6949
|
+
outcome: "already_absent"
|
|
6950
|
+
};
|
|
6868
6951
|
}
|
|
6869
6952
|
const data = await response.json().catch(() => null);
|
|
6870
6953
|
const diagnostics = data ? normalizeStartupDiagnostics(data.startupDiagnostics) : null;
|
|
@@ -6877,13 +6960,19 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6877
6960
|
};
|
|
6878
6961
|
}
|
|
6879
6962
|
/**
|
|
6880
|
-
* Read
|
|
6881
|
-
*
|
|
6882
|
-
*
|
|
6963
|
+
* Read a lifecycle response body once.
|
|
6964
|
+
*
|
|
6965
|
+
* Current APIs return the complete sandbox state. Older APIs return an empty
|
|
6966
|
+
* body, so callers refresh when this method cannot recover a state payload.
|
|
6883
6967
|
*/
|
|
6884
|
-
async
|
|
6885
|
-
|
|
6886
|
-
|
|
6968
|
+
async readLifecycleResponse(response) {
|
|
6969
|
+
return await response.json().catch(() => null);
|
|
6970
|
+
}
|
|
6971
|
+
applyLifecycleResponse(data) {
|
|
6972
|
+
if (!data || data.id !== this.id || typeof data.status !== "string" || typeof data.createdAt !== "string") return false;
|
|
6973
|
+
this.info = this.parseInfo(data, this.info);
|
|
6974
|
+
sandboxStatusObservedAt.set(this, Date.now());
|
|
6975
|
+
return true;
|
|
6887
6976
|
}
|
|
6888
6977
|
/**
|
|
6889
6978
|
* Upload a local directory to the sandbox via tar.
|
|
@@ -7018,6 +7107,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
7018
7107
|
} catch (err) {
|
|
7019
7108
|
if (err instanceof StateError || err instanceof TimeoutError) throw err;
|
|
7020
7109
|
}
|
|
7110
|
+
if (this.hasFreshStatus() && this.hasReachedWaitTarget(statuses)) return;
|
|
7021
7111
|
while (true) {
|
|
7022
7112
|
if (options?.signal?.aborted) throw new TimeoutError(0, "Aborted");
|
|
7023
7113
|
await this.refresh();
|
|
@@ -7082,6 +7172,11 @@ var SandboxInstance = class SandboxInstance {
|
|
|
7082
7172
|
if (!statuses.includes(this.status)) return false;
|
|
7083
7173
|
return this.status !== "running" || this.filesystemIncarnationReadiness === "ready";
|
|
7084
7174
|
}
|
|
7175
|
+
hasFreshStatus() {
|
|
7176
|
+
const statusObservedAt = sandboxStatusObservedAt.get(this) ?? 0;
|
|
7177
|
+
const statusAgeMs = Date.now() - statusObservedAt;
|
|
7178
|
+
return statusObservedAt > 0 && statusAgeMs >= 0 && statusAgeMs < SANDBOX_STATUS_FRESHNESS_MS;
|
|
7179
|
+
}
|
|
7085
7180
|
async ensureRunning(signal) {
|
|
7086
7181
|
signal?.throwIfAborted();
|
|
7087
7182
|
const statusObservedAt = sandboxStatusObservedAt.get(this) ?? 0;
|
|
@@ -1723,11 +1723,13 @@ declare class SandboxInstance {
|
|
|
1723
1723
|
*/
|
|
1724
1724
|
delete(): Promise<SandboxDeleteAcknowledgement>;
|
|
1725
1725
|
/**
|
|
1726
|
-
* Read
|
|
1727
|
-
*
|
|
1728
|
-
*
|
|
1726
|
+
* Read a lifecycle response body once.
|
|
1727
|
+
*
|
|
1728
|
+
* Current APIs return the complete sandbox state. Older APIs return an empty
|
|
1729
|
+
* body, so callers refresh when this method cannot recover a state payload.
|
|
1729
1730
|
*/
|
|
1730
|
-
private
|
|
1731
|
+
private readLifecycleResponse;
|
|
1732
|
+
private applyLifecycleResponse;
|
|
1731
1733
|
/**
|
|
1732
1734
|
* Upload a local directory to the sandbox via tar.
|
|
1733
1735
|
* @param localPath - Local directory path to upload
|
|
@@ -1768,6 +1770,7 @@ declare class SandboxInstance {
|
|
|
1768
1770
|
*/
|
|
1769
1771
|
private waitForWithSSE;
|
|
1770
1772
|
private hasReachedWaitTarget;
|
|
1773
|
+
private hasFreshStatus;
|
|
1771
1774
|
private ensureRunning;
|
|
1772
1775
|
private assertFilesystemIncarnationReady;
|
|
1773
1776
|
private runtimeFetch;
|
package/dist/tangle/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as AgentSandboxBlueprintAbi, d as SandboxCreateParamTypes, f as SandboxCreateResponseParamTypes, i as TANGLE_CHAIN_ID, l as ITangleJobsAbi, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, p as SandboxIdParamTypes, r as JOB_SANDBOX_DELETE, s as TangleSandboxClientConfig, t as TangleSandboxClient, u as JsonResponseParamTypes } from "../index-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as AgentSandboxBlueprintAbi, d as SandboxCreateParamTypes, f as SandboxCreateResponseParamTypes, i as TANGLE_CHAIN_ID, l as ITangleJobsAbi, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, p as SandboxIdParamTypes, r as JOB_SANDBOX_DELETE, s as TangleSandboxClientConfig, t as TangleSandboxClient, u as JsonResponseParamTypes } from "../index-DcWLZb5F.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TANGLE_MAINNET_RPC, TangleSandboxClient, TangleSandboxClientConfig };
|
package/dist/tangle/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as ITangleJobsAbi, d as SandboxCreateResponseParamTypes, f as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as JsonResponseParamTypes, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../tangle-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as ITangleJobsAbi, d as SandboxCreateResponseParamTypes, f as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as JsonResponseParamTypes, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../tangle-CaYKcNaS.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TANGLE_MAINNET_RPC, TangleSandboxClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as parseErrorResponse } from "./errors-C6kn-3zt.js";
|
|
2
|
-
import { n as createSandboxInstanceFromResponse } from "./sandbox
|
|
2
|
+
import { n as createSandboxInstanceFromResponse } from "./sandbox--QhO618M.js";
|
|
3
3
|
//#region src/tangle/abi.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tangle Contract ABI Definitions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.4",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
"url": "https://github.com/tangle-network/agent-dev-container/issues"
|
|
96
96
|
},
|
|
97
97
|
"dependencies": {
|
|
98
|
-
"@tangle-network/agent-core": "0.9.6",
|
|
99
|
-
"@tangle-network/agent-interface": "2.0.0",
|
|
98
|
+
"@tangle-network/agent-core": "^0.9.6",
|
|
99
|
+
"@tangle-network/agent-interface": "^2.0.0",
|
|
100
100
|
"zod": "4.5.4"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|