@tangle-network/sandbox 0.11.1-develop.20260722072508.5875624 → 0.11.1-develop.20260722104143.c136f04
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 +3 -3
- package/dist/{client-DNi_lq1C.js → client-Bi9rZKmY.js} +4 -1
- package/dist/{client-B2WKNCtZ.d.ts → client-CP9K4lYb.d.ts} +2 -2
- package/dist/core.d.ts +3 -3
- package/dist/core.js +2 -2
- package/dist/{index-C4qh6W2h.d.ts → index-BtWedJd2.d.ts} +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/runtime.d.ts +1 -1
- package/dist/{sandbox-i9F1XmCG.d.ts → sandbox-CqGV297f.d.ts} +15 -1
- package/dist/{sandbox-DIh_cMZL.js → sandbox-_XxypYz0.js} +70 -9
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-DvSHze2O.js → tangle-B74oCU6n.js} +67 -19
- package/dist/{types-B0EPTi1F.d.ts → types-Bzq-iUmW.d.ts} +6 -0
- package/package.json +3 -3
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as CodeExecutionResult, E as CodeResultPart, S as CodeExecutionOptions, w as CodeLanguage } from "../types-
|
|
2
|
-
import { n as SandboxInstance } from "../sandbox-
|
|
3
|
-
import { i as SandboxClient } from "../client-
|
|
1
|
+
import { C as CodeExecutionResult, E as CodeResultPart, S as CodeExecutionOptions, w as CodeLanguage } from "../types-Bzq-iUmW.js";
|
|
2
|
+
import { n as SandboxInstance } from "../sandbox-CqGV297f.js";
|
|
3
|
+
import { i as SandboxClient } from "../client-CP9K4lYb.js";
|
|
4
4
|
import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
5
|
|
|
6
6
|
//#region src/agent/tools/_specs.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as encodeTextForWire, i as SANDBOX_PROXY_REQUEST_MAX_BYTES, o as combineAbortSignals, s as encodePromptForWire } from "./runtime-api-DCMrscis.js";
|
|
2
2
|
import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, o as PartialFailureError, p as parseErrorResponse, t as AuthError } from "./errors-hbpL_-S6.js";
|
|
3
|
-
import { h as exportTraceBundle, n as createSandboxInstanceFromResponse, p as normalizeConnection, r as normalizeStartupDiagnostics, v as parseSSEStream } from "./sandbox-
|
|
3
|
+
import { h as exportTraceBundle, n as createSandboxInstanceFromResponse, p as normalizeConnection, r as normalizeStartupDiagnostics, v as parseSSEStream } from "./sandbox-_XxypYz0.js";
|
|
4
4
|
//#region src/resources.ts
|
|
5
5
|
/**
|
|
6
6
|
* Compute tiers, ordered smallest → largest. Defined HERE (not imported from
|
|
@@ -2165,6 +2165,9 @@ var SandboxClient = class {
|
|
|
2165
2165
|
return {
|
|
2166
2166
|
id: data.id ?? "",
|
|
2167
2167
|
name: data.name,
|
|
2168
|
+
filesystemIncarnationId: data.filesystemIncarnationId,
|
|
2169
|
+
filesystemIncarnationProvenance: data.filesystemIncarnationProvenance,
|
|
2170
|
+
filesystemIncarnationReadiness: data.filesystemIncarnationReadiness,
|
|
2168
2171
|
status: data.status ?? "pending",
|
|
2169
2172
|
connection: normalizeConnection(data.connection),
|
|
2170
2173
|
metadata: data.metadata,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $n as SandboxFleetDispatchResponse, $t as ListSandboxOptions, A as CreateIntelligenceReportOptions, An as ReconcileSandboxFleetsOptions, Ct as FleetPromptDispatchOptions, Dn as PublishPublicTemplateVersionOptions, Dr as SandboxProfileSummary, En as PublishPublicTemplateOptions, F as CreateSandboxOptions, Gn as SandboxClientConfig, Gt as IntelligenceReportBudget, Jt as IntelligenceReportWindow, Kt as IntelligenceReportCompareTo, M as CreateSandboxFleetOptions, N as CreateSandboxFleetTokenOptions, Oi as TokenRefreshHandler, On as ReapExpiredSandboxFleetsOptions, P as CreateSandboxFleetWithCoordinatorOptions, Pi as UsageInfo, Qt as ListSandboxFleetOptions, Sr as SandboxInfo, St as FleetMachineId, Tn as PublicTemplateVersionInfo, Vi as BatchEvent, Wt as IntelligenceReport, Xn as SandboxFleetArtifactSpec, Xr as SecretsManager, Yn as SandboxFleetArtifact, Zn as SandboxFleetCostEstimate, _ as BatchTask, _n as PromptInputPart, _r as SandboxFleetUsage, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, br as SandboxFleetWorkspaceRestoreResult, bt as FleetExecDispatchOptions, cr as SandboxFleetManifest, di as SshKeysManager, er as SandboxFleetDriverCapability, fr as SandboxFleetToken, g as BatchRunRequest, gr as SandboxFleetTraceOptions, gt as FleetDispatchCancelResult, h as BatchRunOptions, hi as SubscriptionInfo, j as CreateRequestOptions, jn as ReconcileSandboxFleetsResult, kn as ReapExpiredSandboxFleetsResult, m as BatchResult, nr as SandboxFleetInfo, nt as ExecResult, or as SandboxFleetMachineRecord, p as BatchOptions, pr as SandboxFleetTraceBundle, qn as SandboxEnvironment, tt as ExecOptions, ur as SandboxFleetOperationsSummary, vn as PromptOptions, vt as FleetDispatchResultBufferOptions, wn as PublicTemplateInfo, wt as FleetPromptDispatchResult, xr as SandboxFleetWorkspaceSnapshotResult, xt as FleetExecDispatchResult, yn as PromptResult, yr as SandboxFleetWorkspaceReconcileResult, yt as FleetDispatchStreamOptions } from "./types-
|
|
2
|
-
import { a as TraceExportSink, i as TraceExportResult, n as SandboxInstance, t as HttpClient } from "./sandbox-
|
|
1
|
+
import { $n as SandboxFleetDispatchResponse, $t as ListSandboxOptions, A as CreateIntelligenceReportOptions, An as ReconcileSandboxFleetsOptions, Ct as FleetPromptDispatchOptions, Dn as PublishPublicTemplateVersionOptions, Dr as SandboxProfileSummary, En as PublishPublicTemplateOptions, F as CreateSandboxOptions, Gn as SandboxClientConfig, Gt as IntelligenceReportBudget, Jt as IntelligenceReportWindow, Kt as IntelligenceReportCompareTo, M as CreateSandboxFleetOptions, N as CreateSandboxFleetTokenOptions, Oi as TokenRefreshHandler, On as ReapExpiredSandboxFleetsOptions, P as CreateSandboxFleetWithCoordinatorOptions, Pi as UsageInfo, Qt as ListSandboxFleetOptions, Sr as SandboxInfo, St as FleetMachineId, Tn as PublicTemplateVersionInfo, Vi as BatchEvent, Wt as IntelligenceReport, Xn as SandboxFleetArtifactSpec, Xr as SecretsManager, Yn as SandboxFleetArtifact, Zn as SandboxFleetCostEstimate, _ as BatchTask, _n as PromptInputPart, _r as SandboxFleetUsage, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, br as SandboxFleetWorkspaceRestoreResult, bt as FleetExecDispatchOptions, cr as SandboxFleetManifest, di as SshKeysManager, er as SandboxFleetDriverCapability, fr as SandboxFleetToken, g as BatchRunRequest, gr as SandboxFleetTraceOptions, gt as FleetDispatchCancelResult, h as BatchRunOptions, hi as SubscriptionInfo, j as CreateRequestOptions, jn as ReconcileSandboxFleetsResult, kn as ReapExpiredSandboxFleetsResult, m as BatchResult, nr as SandboxFleetInfo, nt as ExecResult, or as SandboxFleetMachineRecord, p as BatchOptions, pr as SandboxFleetTraceBundle, qn as SandboxEnvironment, tt as ExecOptions, ur as SandboxFleetOperationsSummary, vn as PromptOptions, vt as FleetDispatchResultBufferOptions, wn as PublicTemplateInfo, wt as FleetPromptDispatchResult, xr as SandboxFleetWorkspaceSnapshotResult, xt as FleetExecDispatchResult, yn as PromptResult, yr as SandboxFleetWorkspaceReconcileResult, yt as FleetDispatchStreamOptions } from "./types-Bzq-iUmW.js";
|
|
2
|
+
import { a as TraceExportSink, i as TraceExportResult, n as SandboxInstance, t as HttpClient } from "./sandbox-CqGV297f.js";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/sse-parser.d.ts
|
|
5
5
|
/**
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as CreateSandboxOptions, Gn as SandboxClientConfig, Nr as SandboxStatus, Sr as SandboxInfo, cn as PreviewLinkInfo, ln as PreviewLinkManager, nt as ExecResult, rn as NetworkConfig, tt as ExecOptions } from "./types-
|
|
2
|
-
import { n as SandboxInstance } from "./sandbox-
|
|
3
|
-
import { i as SandboxClient } from "./client-
|
|
1
|
+
import { F as CreateSandboxOptions, Gn as SandboxClientConfig, Nr as SandboxStatus, Sr as SandboxInfo, cn as PreviewLinkInfo, ln as PreviewLinkManager, nt as ExecResult, rn as NetworkConfig, tt as ExecOptions } from "./types-Bzq-iUmW.js";
|
|
2
|
+
import { n as SandboxInstance } from "./sandbox-CqGV297f.js";
|
|
3
|
+
import { i as SandboxClient } from "./client-CP9K4lYb.js";
|
|
4
4
|
import { a as NotFoundError, c as SandboxError, d as ServerError, f as StateError, i as NetworkError, l as SandboxErrorJson, m as ValidationError, n as CapabilityError, o as PartialFailureError, p as TimeoutError, s as QuotaError, t as AuthError, u as SandboxFailureDetail } from "./errors-B-8AMQdY.js";
|
|
5
5
|
export { AuthError, CapabilityError, type CreateSandboxOptions, type ExecOptions, type ExecResult, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, QuotaError, SandboxClient as Sandbox, SandboxClient, type SandboxClientConfig, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, StateError, TimeoutError, ValidationError };
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, n as CapabilityError, o as PartialFailureError, s as QuotaError, t as AuthError, u as StateError } from "./errors-hbpL_-S6.js";
|
|
2
|
-
import { t as SandboxInstance } from "./sandbox-
|
|
3
|
-
import { n as SandboxClient } from "./client-
|
|
2
|
+
import { t as SandboxInstance } from "./sandbox-_XxypYz0.js";
|
|
3
|
+
import { n as SandboxClient } from "./client-Bi9rZKmY.js";
|
|
4
4
|
export { AuthError, CapabilityError, NetworkError, NotFoundError, PartialFailureError, QuotaError, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as CreateSandboxOptions } from "./types-
|
|
2
|
-
import { n as SandboxInstance, t as HttpClient } from "./sandbox-
|
|
1
|
+
import { F as CreateSandboxOptions } from "./types-Bzq-iUmW.js";
|
|
2
|
+
import { n as SandboxInstance, t as HttpClient } from "./sandbox-CqGV297f.js";
|
|
3
3
|
|
|
4
4
|
//#region src/tangle/abi.d.ts
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $ as EventStreamOptions, $i as TerminalStreamToken, $n as SandboxFleetDispatchResponse, $r as SentSessionMessage, $t as ListSandboxOptions, A as CreateIntelligenceReportOptions, Ai as TurnDriveResult, An as ReconcileSandboxFleetsOptions, Ar as SandboxRuntimeHealth, At as GitDiff, B as DirectoryPermission, Bi as BatchBackendStats, Bn as RolloutStatus, Br as SandboxTraceBundle, Bt as GpuType, Ci as TeeAttestationOptions, Cn as ProvisionStep, Cr as SandboxIntelligenceEnvelope, Ct as FleetPromptDispatchOptions, D as CommitTaskSessionOptions, Di as TeePublicKeyResponse, Dn as PublishPublicTemplateVersionOptions, Dr as SandboxProfileSummary, Dt as GitBranch, Ei as TeePublicKey, En as PublishPublicTemplateOptions, Er as SandboxPortPreviewLink, Et as GitAuth, F as CreateSandboxOptions, Fi as WaitForOptions, Fn as Rollout, Fr as SandboxTerminalCreateOptions, Ft as GpuLeaseExecOptions, G as DriveTurnOptions, Gi as TERMINAL_WS_ECHO_SUBPROTOCOL, Gn as SandboxClientConfig, Gr as ScopedToken, Gt as IntelligenceReportBudget, H as DispatchedSession, Hi as BatchEventDataMap, Hn as RunCodeOptions, Hr as SandboxTraceExport, Ht as HostAgentRuntimeBackend, I as CreateSessionOptions, Ii as WaitForRolloutOptions, In as RolloutChildResult, Ir as SandboxTerminalInfo, It as GpuLeaseExecResult, J as DriverType, Ji as TerminalStream, Jn as SandboxEvent, Jr as SearchOptions, Jt as IntelligenceReportWindow, K as DriverConfig, Ki as TerminalExitInfo, Kn as SandboxConnection, Kr as ScopedTokenScope, Kt as IntelligenceReportCompareTo, L as CreateTaskSessionOptions, Li as WriteFileOptions, Ln as RolloutOptions, Lr as SandboxTerminalManager, Lt as GpuLeaseManager, M as CreateSandboxFleetOptions, Mi as UploadOptions, Mn as RenameOptions, Mr as SandboxRuntimeProfileList, Mt as GpuLease, Ni as UploadProgress, Nr as SandboxStatus, Nt as GpuLeaseBilling, O as CompletedTurnResult, Oi as TokenRefreshHandler, On as ReapExpiredSandboxFleetsOptions, Or as SandboxResourceUsage, Ot as GitCommit, P as CreateSandboxFleetWithCoordinatorOptions, Pi as UsageInfo, Pr as SandboxTerminalAttachOptions, Pt as GpuLeaseCommandResult, Q as EnsureDevServerOptions, Qi as TerminalStreamOptions, Qn as SandboxFleetDispatchFailureClass, Qr as SendSessionMessageRequest, Qt as ListSandboxFleetOptions, R as DeleteOptions, Ri as WriteManyFile, Rn as RolloutScorer, Rr as SandboxTerminalRequestOptions, Rt as GpuLeaseProviderName, Sa as validateAgentProfileSecurity, Si as TaskSessionProfile, Sn as ProvisionStatus, Sr as SandboxInfo, St as FleetMachineId, T as CodeResult, Ti as TeeAttestationResponse, Tn as PublicTemplateVersionInfo, Tr as SandboxPortBinding, Tt as GPU_LEASE_PROVIDER_NAMES, U as DownloadOptions, Ui as BatchSidecarGroup, Un as SSHCommandDescriptor, Ur as SandboxTraceOptions, Ut as InstalledTool, V as DispatchPromptOptions, Vi as BatchEvent, Vn as RolloutTurnPart, Vr as SandboxTraceEvent, Vt as HostAgentDriverConfig, W as DownloadProgress, Wi as BatchTaskUsage, Wn as SSHCredentials, Wr as SandboxUser, Wt as IntelligenceReport, X as EgressManager, Xi as TerminalStreamError, Xn as SandboxFleetArtifactSpec, Xr as SecretsManager, Xt as ListMessagesOptions, Yi as TerminalStreamAuthFormat, Yn as SandboxFleetArtifact, Yr as SecretInfo, Z as EgressPolicy, Zi as TerminalStreamHandlers, Zn as SandboxFleetCostEstimate, Zr as SendSessionMessageOptions, Zt as ListOptions, _ as BatchTask, _a as capabilitySchema, _i as TaskResult, _r as SandboxFleetUsage, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, aa as AgentProfileMcpServer, ai as SessionMessage, an as NonHostAgentDriverConfig, ar as SandboxFleetMachineMeteredUsage, at as FileReadBatchResult, b as ChunkedUploadOptions, ba as defineInlineResource, bi as TaskSessionFileChange, bn as ProvisionEvent, br as SandboxFleetWorkspaceRestoreResult, bt as FleetExecDispatchOptions, c as BackendInfo, ca as AgentProfilePrompt, ci as SnapshotInfo, cn as PreviewLinkInfo, cr as SandboxFleetManifest, ct as FileRenameResult, d as BackendType, da as AgentProfileSecurityPolicy, dn as ProcessInfo, dr as SandboxFleetPolicy, dt as FileTreeOptions, ea as AgentProfile, ei as SessionBackendCredentials, en as McpServerConfig, er as SandboxFleetDriverCapability, et as ExactProcessSpawnOptions, f as BatchBackend, fa as AgentProfileValidationIssue, fi as StartupDiagnostics, fn as ProcessLogEntry, fr as SandboxFleetToken, ft as FileTreeResult, g as BatchRunRequest, ga as agentProfileSchema, gi as TaskOptions, gn as ProcessStatus, gr as SandboxFleetTraceOptions, gt as FleetDispatchCancelResult, h as BatchRunOptions, ha as Capability, hi as SubscriptionInfo, hn as ProcessSpawnOptions, hr as SandboxFleetTraceExport, ht as FileWriteResult, i as AttachGpuLeaseOptions, ia as AgentProfileFileMount, ii as SessionListOptions, in as NetworkManager, ir as SandboxFleetMachine, it as FileReadBatchOptions, j as CreateRequestOptions, ji as UpdateUserOptions, jn as ReconcileSandboxFleetsResult, jr as SandboxRuntimeProfile, jt as GitStatus, k as CreateGpuLeaseOptions, ki as ToolsConfig, kn as ReapExpiredSandboxFleetsResult, kr as SandboxResources, kt as GitConfig, l as BackendManager, la as AgentProfileResourceRef, li as SnapshotOptions, ln as PreviewLinkManager, lr as SandboxFleetManifestMachine, lt as FileSystem, m as BatchResult, ma as AgentSubagentProfile, mi as StorageConfig, mn as ProcessSignal, mr as SandboxFleetTraceEvent, mt as FileUsageResult, n as AccessPolicyRule, na as AgentProfileConfidential, ni as SessionForkOptions, nn as MkdirOptions, nr as SandboxFleetInfo, nt as ExecResult, o as BackendCapabilities, oa as AgentProfileModelHints, oi as SessionMessageInputPart, on as PermissionLevel, or as SandboxFleetMachineRecord, ot as FileReadError, p as BatchOptions, pa as AgentProfileValidationResult, pi as StartupOperation, pn as ProcessManager, pr as SandboxFleetTraceBundle, pt as FileUsageOptions, q as DriverInfo, qi as TerminalReadyInfo, qn as SandboxEnvironment, qr as SearchMatch, qt as IntelligenceReportSubjectType, r as AddUserOptions, ra as AgentProfileConnection, ri as SessionInfo, rn as NetworkConfig, rr as SandboxFleetIntelligenceEnvelope, rt as FileInfo, s as BackendConfig, sa as AgentProfilePermissionValue, si as SessionStatus, sn as PermissionsManager, sr as SandboxFleetMachineSpec, st as FileReadResult, t as AcceleratorKind, ta as AgentProfileCapabilities, ti as SessionEventStreamOptions, tn as MintScopedTokenOptions, tr as SandboxFleetDriverTimings, tt as ExecOptions, u as BackendStatus, ua as AgentProfileResources, ui as SnapshotResult, un as Process, ur as SandboxFleetOperationsSummary, ut as FileTreeFile, v as BatchTaskResult, va as defineAgentProfile, vi as TaskSessionChanges, vn as PromptOptions, vr as SandboxFleetWorkspace, vt as FleetDispatchResultBufferOptions, wi as TeeAttestationReport, wn as PublicTemplateInfo, wr as SandboxPermissionsConfig, x as ChunkedUploadResult, xa as mergeAgentProfiles, xi as TaskSessionInfo, xn as ProvisionResult, xr as SandboxFleetWorkspaceSnapshotResult, y as BranchOptions, ya as defineGitHubResource, yi as TaskSessionCommitResult, yn as PromptResult, yr as SandboxFleetWorkspaceReconcileResult, yt as FleetDispatchStreamOptions, z as DevServerInfo, zi as WriteManyOptions, zn as RolloutStartResult, zr as SandboxTerminals, zt as GpuLeaseStatus } from "./types-
|
|
2
|
-
import { C as CONTROL_PLANE_MCP_SERVER_NAME, D as SandboxMcpServerEntry, E as SandboxMcpEndpoint, O as buildControlPlaneMcpConfig, S as BuildSandboxMcpConfigOptions, T as SandboxMcpConfig, _ as InteractiveSessionStatus, a as TraceExportSink, b as StartInteractiveOptions, c as otelTraceIdForTangleTrace, d as SandboxSession, f as InteractiveAttachOptions, g as InteractiveSessionInfo, h as InteractiveSessionHost, i as TraceExportResult, k as buildSandboxMcpConfig, l as toOtelJson, m as InteractiveSessionHandle, n as SandboxInstance, o as buildTraceExportPayload, p as InteractiveAuthFile, r as TraceExportFormat, s as exportTraceBundle, u as SandboxTaskSession, v as InterruptResult, w as SANDBOX_MCP_SERVER_NAME, x as BuildControlPlaneMcpConfigOptions, y as RespondToPermissionOptions } from "./sandbox-
|
|
3
|
-
import { a as Team, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, i as SandboxClient, 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 } from "./client-
|
|
1
|
+
import { $ as EventStreamOptions, $i as TerminalStreamToken, $n as SandboxFleetDispatchResponse, $r as SentSessionMessage, $t as ListSandboxOptions, A as CreateIntelligenceReportOptions, Ai as TurnDriveResult, An as ReconcileSandboxFleetsOptions, Ar as SandboxRuntimeHealth, At as GitDiff, B as DirectoryPermission, Bi as BatchBackendStats, Bn as RolloutStatus, Br as SandboxTraceBundle, Bt as GpuType, Ci as TeeAttestationOptions, Cn as ProvisionStep, Cr as SandboxIntelligenceEnvelope, Ct as FleetPromptDispatchOptions, D as CommitTaskSessionOptions, Di as TeePublicKeyResponse, Dn as PublishPublicTemplateVersionOptions, Dr as SandboxProfileSummary, Dt as GitBranch, Ei as TeePublicKey, En as PublishPublicTemplateOptions, Er as SandboxPortPreviewLink, Et as GitAuth, F as CreateSandboxOptions, Fi as WaitForOptions, Fn as Rollout, Fr as SandboxTerminalCreateOptions, Ft as GpuLeaseExecOptions, G as DriveTurnOptions, Gi as TERMINAL_WS_ECHO_SUBPROTOCOL, Gn as SandboxClientConfig, Gr as ScopedToken, Gt as IntelligenceReportBudget, H as DispatchedSession, Hi as BatchEventDataMap, Hn as RunCodeOptions, Hr as SandboxTraceExport, Ht as HostAgentRuntimeBackend, I as CreateSessionOptions, Ii as WaitForRolloutOptions, In as RolloutChildResult, Ir as SandboxTerminalInfo, It as GpuLeaseExecResult, J as DriverType, Ji as TerminalStream, Jn as SandboxEvent, Jr as SearchOptions, Jt as IntelligenceReportWindow, K as DriverConfig, Ki as TerminalExitInfo, Kn as SandboxConnection, Kr as ScopedTokenScope, Kt as IntelligenceReportCompareTo, L as CreateTaskSessionOptions, Li as WriteFileOptions, Ln as RolloutOptions, Lr as SandboxTerminalManager, Lt as GpuLeaseManager, M as CreateSandboxFleetOptions, Mi as UploadOptions, Mn as RenameOptions, Mr as SandboxRuntimeProfileList, Mt as GpuLease, Ni as UploadProgress, Nr as SandboxStatus, Nt as GpuLeaseBilling, O as CompletedTurnResult, Oi as TokenRefreshHandler, On as ReapExpiredSandboxFleetsOptions, Or as SandboxResourceUsage, Ot as GitCommit, P as CreateSandboxFleetWithCoordinatorOptions, Pi as UsageInfo, Pr as SandboxTerminalAttachOptions, Pt as GpuLeaseCommandResult, Q as EnsureDevServerOptions, Qi as TerminalStreamOptions, Qn as SandboxFleetDispatchFailureClass, Qr as SendSessionMessageRequest, Qt as ListSandboxFleetOptions, R as DeleteOptions, Ri as WriteManyFile, Rn as RolloutScorer, Rr as SandboxTerminalRequestOptions, Rt as GpuLeaseProviderName, Sa as validateAgentProfileSecurity, Si as TaskSessionProfile, Sn as ProvisionStatus, Sr as SandboxInfo, St as FleetMachineId, T as CodeResult, Ti as TeeAttestationResponse, Tn as PublicTemplateVersionInfo, Tr as SandboxPortBinding, Tt as GPU_LEASE_PROVIDER_NAMES, U as DownloadOptions, Ui as BatchSidecarGroup, Un as SSHCommandDescriptor, Ur as SandboxTraceOptions, Ut as InstalledTool, V as DispatchPromptOptions, Vi as BatchEvent, Vn as RolloutTurnPart, Vr as SandboxTraceEvent, Vt as HostAgentDriverConfig, W as DownloadProgress, Wi as BatchTaskUsage, Wn as SSHCredentials, Wr as SandboxUser, Wt as IntelligenceReport, X as EgressManager, Xi as TerminalStreamError, Xn as SandboxFleetArtifactSpec, Xr as SecretsManager, Xt as ListMessagesOptions, Yi as TerminalStreamAuthFormat, Yn as SandboxFleetArtifact, Yr as SecretInfo, Z as EgressPolicy, Zi as TerminalStreamHandlers, Zn as SandboxFleetCostEstimate, Zr as SendSessionMessageOptions, Zt as ListOptions, _ as BatchTask, _a as capabilitySchema, _i as TaskResult, _r as SandboxFleetUsage, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, aa as AgentProfileMcpServer, ai as SessionMessage, an as NonHostAgentDriverConfig, ar as SandboxFleetMachineMeteredUsage, at as FileReadBatchResult, b as ChunkedUploadOptions, ba as defineInlineResource, bi as TaskSessionFileChange, bn as ProvisionEvent, br as SandboxFleetWorkspaceRestoreResult, bt as FleetExecDispatchOptions, c as BackendInfo, ca as AgentProfilePrompt, ci as SnapshotInfo, cn as PreviewLinkInfo, cr as SandboxFleetManifest, ct as FileRenameResult, d as BackendType, da as AgentProfileSecurityPolicy, dn as ProcessInfo, dr as SandboxFleetPolicy, dt as FileTreeOptions, ea as AgentProfile, ei as SessionBackendCredentials, en as McpServerConfig, er as SandboxFleetDriverCapability, et as ExactProcessSpawnOptions, f as BatchBackend, fa as AgentProfileValidationIssue, fi as StartupDiagnostics, fn as ProcessLogEntry, fr as SandboxFleetToken, ft as FileTreeResult, g as BatchRunRequest, ga as agentProfileSchema, gi as TaskOptions, gn as ProcessStatus, gr as SandboxFleetTraceOptions, gt as FleetDispatchCancelResult, h as BatchRunOptions, ha as Capability, hi as SubscriptionInfo, hn as ProcessSpawnOptions, hr as SandboxFleetTraceExport, ht as FileWriteResult, i as AttachGpuLeaseOptions, ia as AgentProfileFileMount, ii as SessionListOptions, in as NetworkManager, ir as SandboxFleetMachine, it as FileReadBatchOptions, j as CreateRequestOptions, ji as UpdateUserOptions, jn as ReconcileSandboxFleetsResult, jr as SandboxRuntimeProfile, jt as GitStatus, k as CreateGpuLeaseOptions, ki as ToolsConfig, kn as ReapExpiredSandboxFleetsResult, kr as SandboxResources, kt as GitConfig, l as BackendManager, la as AgentProfileResourceRef, li as SnapshotOptions, ln as PreviewLinkManager, lr as SandboxFleetManifestMachine, lt as FileSystem, m as BatchResult, ma as AgentSubagentProfile, mi as StorageConfig, mn as ProcessSignal, mr as SandboxFleetTraceEvent, mt as FileUsageResult, n as AccessPolicyRule, na as AgentProfileConfidential, ni as SessionForkOptions, nn as MkdirOptions, nr as SandboxFleetInfo, nt as ExecResult, o as BackendCapabilities, oa as AgentProfileModelHints, oi as SessionMessageInputPart, on as PermissionLevel, or as SandboxFleetMachineRecord, ot as FileReadError, p as BatchOptions, pa as AgentProfileValidationResult, pi as StartupOperation, pn as ProcessManager, pr as SandboxFleetTraceBundle, pt as FileUsageOptions, q as DriverInfo, qi as TerminalReadyInfo, qn as SandboxEnvironment, qr as SearchMatch, qt as IntelligenceReportSubjectType, r as AddUserOptions, ra as AgentProfileConnection, ri as SessionInfo, rn as NetworkConfig, rr as SandboxFleetIntelligenceEnvelope, rt as FileInfo, s as BackendConfig, sa as AgentProfilePermissionValue, si as SessionStatus, sn as PermissionsManager, sr as SandboxFleetMachineSpec, st as FileReadResult, t as AcceleratorKind, ta as AgentProfileCapabilities, ti as SessionEventStreamOptions, tn as MintScopedTokenOptions, tr as SandboxFleetDriverTimings, tt as ExecOptions, u as BackendStatus, ua as AgentProfileResources, ui as SnapshotResult, un as Process, ur as SandboxFleetOperationsSummary, ut as FileTreeFile, v as BatchTaskResult, va as defineAgentProfile, vi as TaskSessionChanges, vn as PromptOptions, vr as SandboxFleetWorkspace, vt as FleetDispatchResultBufferOptions, wi as TeeAttestationReport, wn as PublicTemplateInfo, wr as SandboxPermissionsConfig, x as ChunkedUploadResult, xa as mergeAgentProfiles, xi as TaskSessionInfo, xn as ProvisionResult, xr as SandboxFleetWorkspaceSnapshotResult, y as BranchOptions, ya as defineGitHubResource, yi as TaskSessionCommitResult, yn as PromptResult, yr as SandboxFleetWorkspaceReconcileResult, yt as FleetDispatchStreamOptions, z as DevServerInfo, zi as WriteManyOptions, zn as RolloutStartResult, zr as SandboxTerminals, zt as GpuLeaseStatus } from "./types-Bzq-iUmW.js";
|
|
2
|
+
import { C as CONTROL_PLANE_MCP_SERVER_NAME, D as SandboxMcpServerEntry, E as SandboxMcpEndpoint, O as buildControlPlaneMcpConfig, S as BuildSandboxMcpConfigOptions, T as SandboxMcpConfig, _ as InteractiveSessionStatus, a as TraceExportSink, b as StartInteractiveOptions, c as otelTraceIdForTangleTrace, d as SandboxSession, f as InteractiveAttachOptions, g as InteractiveSessionInfo, h as InteractiveSessionHost, i as TraceExportResult, k as buildSandboxMcpConfig, l as toOtelJson, m as InteractiveSessionHandle, n as SandboxInstance, o as buildTraceExportPayload, p as InteractiveAuthFile, r as TraceExportFormat, s as exportTraceBundle, u as SandboxTaskSession, v as InterruptResult, w as SANDBOX_MCP_SERVER_NAME, x as BuildControlPlaneMcpConfigOptions, y as RespondToPermissionOptions } from "./sandbox-CqGV297f.js";
|
|
3
|
+
import { a as Team, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, i as SandboxClient, 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 } from "./client-CP9K4lYb.js";
|
|
4
4
|
import { d as AnyTokenPayload, h as IssueCollaborationTokenOptions, m as CollaborationTokenPayload, p as CollaborationAccess } from "./index-CyHojkuA.js";
|
|
5
5
|
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-DKzapw-9.js";
|
|
6
6
|
import { a as NotFoundError, c as SandboxError, d as ServerError, f as StateError, i as NetworkError, l as SandboxErrorJson, m as ValidationError, n as CapabilityError, o as PartialFailureError, p as TimeoutError, r as EgressProxyRecoveryError, s as QuotaError, t as AuthError, u as SandboxFailureDetail } from "./errors-B-8AMQdY.js";
|
|
7
|
-
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-
|
|
7
|
+
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-BtWedJd2.js";
|
|
8
8
|
|
|
9
9
|
//#region src/attestation-heartbeat.d.ts
|
|
10
10
|
interface TeeAttestationHeartbeatSample {
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { d as serializeForSidecar, l as normalizeRuntimeBackendConfig } from "./runtime-api-DCMrscis.js";
|
|
2
2
|
import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, n as CapabilityError, o as PartialFailureError, r as EgressProxyRecoveryError, s as QuotaError, t as AuthError, u as StateError } from "./errors-hbpL_-S6.js";
|
|
3
|
-
import { _ as toOtelJson, a as TerminalStream, c as SandboxSession, d as collectAgentResponseText, f as getSandboxEventText, g as otelTraceIdForTangleTrace, h as exportTraceBundle, i as TERMINAL_WS_ECHO_SUBPROTOCOL, l as InteractiveSessionHandle, m as buildTraceExportPayload, o as TerminalStreamError, s as SandboxTaskSession, t as SandboxInstance, u as applySandboxEventText, v as parseSSEStream } from "./sandbox-
|
|
4
|
-
import { a as splitInlineProfileSkills, c as SandboxFleetClient, d as SANDBOX_SIZE_PRESET_NAMES, f as resolveSandboxResources, i as splitInlineProfileFileMounts, l as DEFAULT_SANDBOX_SIZE, n as SandboxClient, o as validateDeferredProfileFileMounts, p as sandboxResourcesForSize, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as SANDBOX_SIZE_PRESETS } from "./client-
|
|
3
|
+
import { _ as toOtelJson, a as TerminalStream, c as SandboxSession, d as collectAgentResponseText, f as getSandboxEventText, g as otelTraceIdForTangleTrace, h as exportTraceBundle, i as TERMINAL_WS_ECHO_SUBPROTOCOL, l as InteractiveSessionHandle, m as buildTraceExportPayload, o as TerminalStreamError, s as SandboxTaskSession, t as SandboxInstance, u as applySandboxEventText, v as parseSSEStream } from "./sandbox-_XxypYz0.js";
|
|
4
|
+
import { a as splitInlineProfileSkills, c as SandboxFleetClient, d as SANDBOX_SIZE_PRESET_NAMES, f as resolveSandboxResources, i as splitInlineProfileFileMounts, l as DEFAULT_SANDBOX_SIZE, n as SandboxClient, o as validateDeferredProfileFileMounts, p as sandboxResourcesForSize, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as SANDBOX_SIZE_PRESETS } from "./client-Bi9rZKmY.js";
|
|
5
5
|
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-CeNQA9H_.js";
|
|
6
|
-
import { t as TangleSandboxClient } from "./tangle-
|
|
6
|
+
import { t as TangleSandboxClient } from "./tangle-B74oCU6n.js";
|
|
7
7
|
import { agentProfileSchema, capabilitySchema, defineAgentProfile, defineGitHubResource, defineInlineResource, mergeAgentProfiles, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
8
8
|
//#region src/confidential.ts
|
|
9
9
|
function generateAttestationNonce(bytes = 32) {
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $r as SentSessionMessage, Ar as SandboxRuntimeHealth, D as CommitTaskSessionOptions, Fr as SandboxTerminalCreateOptions, I as CreateSessionOptions, Ir as SandboxTerminalInfo, L as CreateTaskSessionOptions, Li as WriteFileOptions, Lr as SandboxTerminalManager, Mn as RenameOptions, Mr as SandboxRuntimeProfileList, Ni as UploadProgress, Qr as SendSessionMessageRequest, Rr as SandboxTerminalRequestOptions, Tr as SandboxPortBinding, Xt as ListMessagesOptions, Zr as SendSessionMessageOptions, ai as SessionMessage, at as FileReadBatchResult, b as ChunkedUploadOptions, ct as FileRenameResult, dt as FileTreeOptions, ft as FileTreeResult, ht as FileWriteResult, it as FileReadBatchOptions, mt as FileUsageResult, pt as FileUsageOptions, ri as SessionInfo, vi as TaskSessionChanges, x as ChunkedUploadResult, xi as TaskSessionInfo, yi as TaskSessionCommitResult } from "./types-
|
|
1
|
+
import { $r as SentSessionMessage, Ar as SandboxRuntimeHealth, D as CommitTaskSessionOptions, Fr as SandboxTerminalCreateOptions, I as CreateSessionOptions, Ir as SandboxTerminalInfo, L as CreateTaskSessionOptions, Li as WriteFileOptions, Lr as SandboxTerminalManager, Mn as RenameOptions, Mr as SandboxRuntimeProfileList, Ni as UploadProgress, Qr as SendSessionMessageRequest, Rr as SandboxTerminalRequestOptions, Tr as SandboxPortBinding, Xt as ListMessagesOptions, Zr as SendSessionMessageOptions, ai as SessionMessage, at as FileReadBatchResult, b as ChunkedUploadOptions, ct as FileRenameResult, dt as FileTreeOptions, ft as FileTreeResult, ht as FileWriteResult, it as FileReadBatchOptions, mt as FileUsageResult, pt as FileUsageOptions, ri as SessionInfo, vi as TaskSessionChanges, x as ChunkedUploadResult, xi as TaskSessionInfo, yi as TaskSessionCommitResult } from "./types-Bzq-iUmW.js";
|
|
2
2
|
import { a as NotFoundError, c as SandboxError, d as ServerError, f as StateError, i as NetworkError, l as SandboxErrorJson, m as ValidationError, n as CapabilityError, o as PartialFailureError, p as TimeoutError, s as QuotaError, t as AuthError, u as SandboxFailureDetail } from "./errors-B-8AMQdY.js";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/chunked-upload.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as EventStreamOptions, $r as SentSessionMessage, Ai as TurnDriveResult, Ar as SandboxRuntimeHealth, At as GitDiff, Br as SandboxTraceBundle, C as CodeExecutionResult, Ci as TeeAttestationOptions, D as CommitTaskSessionOptions, Di as TeePublicKeyResponse, Dt as GitBranch, Fi as WaitForOptions, Fn as Rollout, G as DriveTurnOptions, Gr as ScopedToken, Gt as IntelligenceReportBudget, H as DispatchedSession, I as CreateSessionOptions, Ii as WaitForRolloutOptions, Ji as TerminalStream, Jn as SandboxEvent, Jr as SearchOptions, Jt as IntelligenceReportWindow, Kn as SandboxConnection, Kt as IntelligenceReportCompareTo, L as CreateTaskSessionOptions, Li as WriteFileOptions, Ln as RolloutOptions, Lt as GpuLeaseManager, Mr as SandboxRuntimeProfileList, Mt as GpuLease, Nn as RestoreSnapshotOptions, Nr as SandboxStatus, O as CompletedTurnResult, Or as SandboxResourceUsage, Ot as GitCommit, Pn as ResumeOptions, Pr as SandboxTerminalAttachOptions, Qr as SendSessionMessageRequest, Ri as WriteManyFile, S as CodeExecutionOptions, Sr as SandboxInfo, Ti as TeeAttestationResponse, Tr as SandboxPortBinding, Un as SSHCommandDescriptor, Ur as SandboxTraceOptions, Ut as InstalledTool, V as DispatchPromptOptions, Wn as SSHCredentials, Wt as IntelligenceReport, X as EgressManager, Xt as ListMessagesOptions, Y as DurablePlan, Yt as JsonValue, Zi as TerminalStreamHandlers, Zr as SendSessionMessageOptions, _i as TaskResult, _n as PromptInputPart, ai as SessionMessage, bn as ProvisionEvent, ci as SnapshotInfo, fi as StartupDiagnostics, gi as TaskOptions, ht as FileWriteResult, ii as SessionListOptions, in as NetworkManager, jt as GitStatus, l as BackendManager, li as SnapshotOptions, ln as PreviewLinkManager, lt as FileSystem, ni as SessionForkOptions, nt as ExecResult, pn as ProcessManager, pr as SandboxFleetTraceBundle, q as DriverInfo, qr as SearchMatch, ri as SessionInfo, s as BackendConfig, sn as PermissionsManager, ti as SessionEventStreamOptions, tn as MintScopedTokenOptions, tt as ExecOptions, ui as SnapshotResult, vi as TaskSessionChanges, vn as PromptOptions, w as CodeLanguage, xi as TaskSessionInfo, xn as ProvisionResult, y as BranchOptions, yi as TaskSessionCommitResult, yn as PromptResult, zi as WriteManyOptions, zn as RolloutStartResult, zr as SandboxTerminals } from "./types-
|
|
1
|
+
import { $ as EventStreamOptions, $r as SentSessionMessage, Ai as TurnDriveResult, Ar as SandboxRuntimeHealth, At as GitDiff, Br as SandboxTraceBundle, C as CodeExecutionResult, Ci as TeeAttestationOptions, D as CommitTaskSessionOptions, Di as TeePublicKeyResponse, Dt as GitBranch, Fi as WaitForOptions, Fn as Rollout, G as DriveTurnOptions, Gr as ScopedToken, Gt as IntelligenceReportBudget, H as DispatchedSession, I as CreateSessionOptions, Ii as WaitForRolloutOptions, Ji as TerminalStream, Jn as SandboxEvent, Jr as SearchOptions, Jt as IntelligenceReportWindow, Kn as SandboxConnection, Kt as IntelligenceReportCompareTo, L as CreateTaskSessionOptions, Li as WriteFileOptions, Ln as RolloutOptions, Lt as GpuLeaseManager, Mr as SandboxRuntimeProfileList, Mt as GpuLease, Nn as RestoreSnapshotOptions, Nr as SandboxStatus, O as CompletedTurnResult, Or as SandboxResourceUsage, Ot as GitCommit, Pn as ResumeOptions, Pr as SandboxTerminalAttachOptions, Qr as SendSessionMessageRequest, Ri as WriteManyFile, S as CodeExecutionOptions, Sr as SandboxInfo, Ti as TeeAttestationResponse, Tr as SandboxPortBinding, Un as SSHCommandDescriptor, Ur as SandboxTraceOptions, Ut as InstalledTool, V as DispatchPromptOptions, Wn as SSHCredentials, Wt as IntelligenceReport, X as EgressManager, Xt as ListMessagesOptions, Y as DurablePlan, Yt as JsonValue, Zi as TerminalStreamHandlers, Zr as SendSessionMessageOptions, _i as TaskResult, _n as PromptInputPart, ai as SessionMessage, bn as ProvisionEvent, ci as SnapshotInfo, fi as StartupDiagnostics, gi as TaskOptions, ht as FileWriteResult, ii as SessionListOptions, in as NetworkManager, jt as GitStatus, l as BackendManager, li as SnapshotOptions, ln as PreviewLinkManager, lt as FileSystem, ni as SessionForkOptions, nt as ExecResult, pn as ProcessManager, pr as SandboxFleetTraceBundle, q as DriverInfo, qr as SearchMatch, ri as SessionInfo, s as BackendConfig, sn as PermissionsManager, ti as SessionEventStreamOptions, tn as MintScopedTokenOptions, tt as ExecOptions, ui as SnapshotResult, vi as TaskSessionChanges, vn as PromptOptions, w as CodeLanguage, xi as TaskSessionInfo, xn as ProvisionResult, y as BranchOptions, yi as TaskSessionCommitResult, yn as PromptResult, zi as WriteManyOptions, zn as RolloutStartResult, zr as SandboxTerminals } from "./types-Bzq-iUmW.js";
|
|
2
2
|
import { AgentProfile } from "@tangle-network/agent-interface";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
@@ -536,6 +536,8 @@ interface ToolsCapability {
|
|
|
536
536
|
declare class SandboxInstance {
|
|
537
537
|
private readonly client;
|
|
538
538
|
private info;
|
|
539
|
+
/** Once observed, incarnation metadata is authoritative for this handle. */
|
|
540
|
+
private filesystemIncarnationContract;
|
|
539
541
|
private refreshInFlight?;
|
|
540
542
|
private readonly defaultRuntimeBackend?;
|
|
541
543
|
private readonly runtime;
|
|
@@ -555,6 +557,12 @@ declare class SandboxInstance {
|
|
|
555
557
|
get id(): string;
|
|
556
558
|
/** Human-readable name */
|
|
557
559
|
get name(): string | undefined;
|
|
560
|
+
/** Identity of the currently published filesystem contents. */
|
|
561
|
+
get filesystemIncarnationId(): string | undefined;
|
|
562
|
+
/** How the current filesystem contents were acquired. */
|
|
563
|
+
get filesystemIncarnationProvenance(): "fresh" | "restored" | "unknown" | undefined;
|
|
564
|
+
/** Whether the current incarnation is safe to use as authoritative state. */
|
|
565
|
+
get filesystemIncarnationReadiness(): "transitioning" | "ready" | undefined;
|
|
558
566
|
/** Current status */
|
|
559
567
|
get status(): SandboxStatus;
|
|
560
568
|
/** Connection information */
|
|
@@ -1464,6 +1472,10 @@ declare class SandboxInstance {
|
|
|
1464
1472
|
/**
|
|
1465
1473
|
* Wait for the sandbox to reach a specific status.
|
|
1466
1474
|
*
|
|
1475
|
+
* A sandbox using the filesystem-incarnation contract is not considered
|
|
1476
|
+
* `running` until that incarnation is ready. Legacy servers that omit the
|
|
1477
|
+
* contract retain the status-only behavior.
|
|
1478
|
+
*
|
|
1467
1479
|
* When `onProgress` is provided and the sandbox is still provisioning,
|
|
1468
1480
|
* uses SSE events for real-time progress instead of polling. Falls back
|
|
1469
1481
|
* to polling if the SSE connection fails or is unavailable.
|
|
@@ -1491,7 +1503,9 @@ declare class SandboxInstance {
|
|
|
1491
1503
|
* delivers progress callbacks while waiting for a target status.
|
|
1492
1504
|
*/
|
|
1493
1505
|
private waitForWithSSE;
|
|
1506
|
+
private hasReachedWaitTarget;
|
|
1494
1507
|
private ensureRunning;
|
|
1508
|
+
private assertFilesystemIncarnationReady;
|
|
1495
1509
|
private runtimeFetch;
|
|
1496
1510
|
/**
|
|
1497
1511
|
* Delegates to the shared `parseSSEStream` in `lib/sse-parser.ts`
|
|
@@ -1311,6 +1311,21 @@ const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
1311
1311
|
const SANDBOX_STATUS_FRESHNESS_MS = 1e3;
|
|
1312
1312
|
const sandboxStatusObservedAt = /* @__PURE__ */ new WeakMap();
|
|
1313
1313
|
const directRuntimeInstances = /* @__PURE__ */ new WeakSet();
|
|
1314
|
+
function readFilesystemIncarnationTuple(value) {
|
|
1315
|
+
const rawId = value.filesystemIncarnationId;
|
|
1316
|
+
const rawProvenance = value.filesystemIncarnationProvenance;
|
|
1317
|
+
const rawReadiness = value.filesystemIncarnationReadiness;
|
|
1318
|
+
const id = typeof rawId === "string" && rawId.length > 0 ? rawId : void 0;
|
|
1319
|
+
const provenance = rawProvenance === "fresh" || rawProvenance === "restored" || rawProvenance === "unknown" ? rawProvenance : void 0;
|
|
1320
|
+
const readiness = rawReadiness === "transitioning" || rawReadiness === "ready" ? rawReadiness : void 0;
|
|
1321
|
+
return {
|
|
1322
|
+
hasAny: rawId !== void 0 || rawProvenance !== void 0 || rawReadiness !== void 0,
|
|
1323
|
+
complete: id !== void 0 && provenance !== void 0 && readiness !== void 0,
|
|
1324
|
+
id,
|
|
1325
|
+
provenance,
|
|
1326
|
+
readiness
|
|
1327
|
+
};
|
|
1328
|
+
}
|
|
1314
1329
|
function createSandboxInstanceFromResponse(client, info, defaultRuntimeBackend) {
|
|
1315
1330
|
const instance = new SandboxInstance(client, info, defaultRuntimeBackend);
|
|
1316
1331
|
sandboxStatusObservedAt.set(instance, Date.now());
|
|
@@ -1328,6 +1343,8 @@ function isTransientWriteError(err) {
|
|
|
1328
1343
|
var SandboxInstance = class SandboxInstance {
|
|
1329
1344
|
client;
|
|
1330
1345
|
info;
|
|
1346
|
+
/** Once observed, incarnation metadata is authoritative for this handle. */
|
|
1347
|
+
filesystemIncarnationContract;
|
|
1331
1348
|
refreshInFlight;
|
|
1332
1349
|
defaultRuntimeBackend;
|
|
1333
1350
|
runtime;
|
|
@@ -1344,7 +1361,15 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1344
1361
|
deferredProfileReference;
|
|
1345
1362
|
constructor(client, info, defaultRuntimeBackend) {
|
|
1346
1363
|
this.client = client;
|
|
1347
|
-
|
|
1364
|
+
const incarnation = readFilesystemIncarnationTuple(info);
|
|
1365
|
+
this.filesystemIncarnationContract = incarnation.hasAny;
|
|
1366
|
+
this.info = incarnation.hasAny ? {
|
|
1367
|
+
...info,
|
|
1368
|
+
filesystemIncarnationId: incarnation.complete ? incarnation.id : void 0,
|
|
1369
|
+
filesystemIncarnationProvenance: incarnation.complete ? incarnation.provenance : void 0,
|
|
1370
|
+
filesystemIncarnationReadiness: incarnation.complete ? incarnation.readiness : void 0,
|
|
1371
|
+
connection: incarnation.complete && incarnation.readiness === "ready" ? info.connection : void 0
|
|
1372
|
+
} : info;
|
|
1348
1373
|
this.defaultRuntimeBackend = defaultRuntimeBackend;
|
|
1349
1374
|
this.runtime = new SandboxRuntimeApi({
|
|
1350
1375
|
ensureRunning: () => this.ensureRunning(),
|
|
@@ -1359,6 +1384,18 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1359
1384
|
get name() {
|
|
1360
1385
|
return this.info.name;
|
|
1361
1386
|
}
|
|
1387
|
+
/** Identity of the currently published filesystem contents. */
|
|
1388
|
+
get filesystemIncarnationId() {
|
|
1389
|
+
return this.info.filesystemIncarnationId;
|
|
1390
|
+
}
|
|
1391
|
+
/** How the current filesystem contents were acquired. */
|
|
1392
|
+
get filesystemIncarnationProvenance() {
|
|
1393
|
+
return this.info.filesystemIncarnationProvenance;
|
|
1394
|
+
}
|
|
1395
|
+
/** Whether the current incarnation is safe to use as authoritative state. */
|
|
1396
|
+
get filesystemIncarnationReadiness() {
|
|
1397
|
+
return this.info.filesystemIncarnationReadiness;
|
|
1398
|
+
}
|
|
1362
1399
|
/** Current status */
|
|
1363
1400
|
get status() {
|
|
1364
1401
|
return this.info.status;
|
|
@@ -1428,6 +1465,9 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1428
1465
|
return {
|
|
1429
1466
|
id: this.id,
|
|
1430
1467
|
name: this.name,
|
|
1468
|
+
filesystemIncarnationId: this.filesystemIncarnationId,
|
|
1469
|
+
filesystemIncarnationProvenance: this.filesystemIncarnationProvenance,
|
|
1470
|
+
filesystemIncarnationReadiness: this.filesystemIncarnationReadiness,
|
|
1431
1471
|
status: this.status,
|
|
1432
1472
|
connection: redactConnectionSecrets(this.connection),
|
|
1433
1473
|
metadata: this.metadata,
|
|
@@ -4587,6 +4627,10 @@ var SandboxInstance = class SandboxInstance {
|
|
|
4587
4627
|
/**
|
|
4588
4628
|
* Wait for the sandbox to reach a specific status.
|
|
4589
4629
|
*
|
|
4630
|
+
* A sandbox using the filesystem-incarnation contract is not considered
|
|
4631
|
+
* `running` until that incarnation is ready. Legacy servers that omit the
|
|
4632
|
+
* contract retain the status-only behavior.
|
|
4633
|
+
*
|
|
4590
4634
|
* When `onProgress` is provided and the sandbox is still provisioning,
|
|
4591
4635
|
* uses SSE events for real-time progress instead of polling. Falls back
|
|
4592
4636
|
* to polling if the SSE connection fails or is unavailable.
|
|
@@ -4612,17 +4656,16 @@ var SandboxInstance = class SandboxInstance {
|
|
|
4612
4656
|
const statuses = Array.isArray(status) ? status : [status];
|
|
4613
4657
|
const timeoutMs = options?.timeoutMs ?? 12e4;
|
|
4614
4658
|
const pollIntervalMs = options?.pollIntervalMs ?? 2e3;
|
|
4659
|
+
const startTime = Date.now();
|
|
4615
4660
|
if (options?.onProgress && (this.status === "provisioning" || this.status === "pending")) try {
|
|
4616
|
-
await this.waitForWithSSE(statuses, timeoutMs, options.onProgress, options.signal);
|
|
4617
|
-
return;
|
|
4661
|
+
if (await this.waitForWithSSE(statuses, timeoutMs, options.onProgress, options.signal)) return;
|
|
4618
4662
|
} catch (err) {
|
|
4619
4663
|
if (err instanceof StateError || err instanceof TimeoutError) throw err;
|
|
4620
4664
|
}
|
|
4621
|
-
const startTime = Date.now();
|
|
4622
4665
|
while (true) {
|
|
4623
4666
|
if (options?.signal?.aborted) throw new TimeoutError(0, "Aborted");
|
|
4624
4667
|
await this.refresh();
|
|
4625
|
-
if (
|
|
4668
|
+
if (this.hasReachedWaitTarget(statuses)) return;
|
|
4626
4669
|
if (this.status === "failed") throw new StateError(this.error ?? "Sandbox failed", this.status);
|
|
4627
4670
|
if (Date.now() - startTime > timeoutMs) throw new TimeoutError(timeoutMs, `Timed out waiting for sandbox to reach ${statuses.join(" or ")}`);
|
|
4628
4671
|
await this.sleep(pollIntervalMs);
|
|
@@ -4666,25 +4709,35 @@ var SandboxInstance = class SandboxInstance {
|
|
|
4666
4709
|
throw new StateError(event.data.error ?? "Provisioning failed", this.status);
|
|
4667
4710
|
} else if (event.type === "provision_complete" || event.type === "status_change") {
|
|
4668
4711
|
await this.refresh();
|
|
4669
|
-
if (
|
|
4712
|
+
if (this.hasReachedWaitTarget(statuses)) return true;
|
|
4670
4713
|
if (this.status === "failed") throw new StateError(this.error ?? "Sandbox failed", this.status);
|
|
4671
4714
|
}
|
|
4672
4715
|
await this.refresh();
|
|
4673
|
-
if (
|
|
4716
|
+
if (this.hasReachedWaitTarget(statuses)) return true;
|
|
4674
4717
|
if (this.status === "failed") throw new StateError(this.error ?? "Sandbox failed", this.status);
|
|
4718
|
+
if (statuses.includes("running") && this.status === "running" && this.filesystemIncarnationContract) return false;
|
|
4675
4719
|
throw new TimeoutError(timeoutMs, `SSE stream ended before sandbox reached ${statuses.join(" or ")}`);
|
|
4676
4720
|
} finally {
|
|
4677
4721
|
clearTimeout(timeout);
|
|
4678
4722
|
abortController.abort();
|
|
4679
4723
|
}
|
|
4680
4724
|
}
|
|
4725
|
+
hasReachedWaitTarget(statuses) {
|
|
4726
|
+
if (!statuses.includes(this.status)) return false;
|
|
4727
|
+
return this.status !== "running" || !this.filesystemIncarnationContract || this.filesystemIncarnationReadiness === "ready";
|
|
4728
|
+
}
|
|
4681
4729
|
async ensureRunning() {
|
|
4682
4730
|
const statusObservedAt = sandboxStatusObservedAt.get(this) ?? 0;
|
|
4683
4731
|
const statusAgeMs = Date.now() - statusObservedAt;
|
|
4684
4732
|
if (directRuntimeInstances.has(this) || statusObservedAt <= 0 || statusAgeMs < 0 || statusAgeMs >= SANDBOX_STATUS_FRESHNESS_MS) await this.refresh();
|
|
4685
4733
|
if (this.status !== "running") throw new StateError(`Sandbox is not running (status: ${this.status})`, this.status, "running");
|
|
4734
|
+
this.assertFilesystemIncarnationReady();
|
|
4735
|
+
}
|
|
4736
|
+
assertFilesystemIncarnationReady() {
|
|
4737
|
+
if (this.filesystemIncarnationContract && this.filesystemIncarnationReadiness !== "ready") throw new StateError("Sandbox filesystem incarnation is not ready", this.status, "running with a ready filesystem incarnation");
|
|
4686
4738
|
}
|
|
4687
4739
|
async runtimeFetch(path, options, fetchOptions) {
|
|
4740
|
+
this.assertFilesystemIncarnationReady();
|
|
4688
4741
|
const url = `/v1/sandboxes/${encodeURIComponent(this.id)}/runtime${path}`;
|
|
4689
4742
|
try {
|
|
4690
4743
|
if (fetchOptions) return await this.client.fetch(url, options, fetchOptions);
|
|
@@ -4775,11 +4828,19 @@ var SandboxInstance = class SandboxInstance {
|
|
|
4775
4828
|
};
|
|
4776
4829
|
}
|
|
4777
4830
|
parseInfo(data) {
|
|
4831
|
+
const id = data.id ?? this.id;
|
|
4832
|
+
const incarnation = readFilesystemIncarnationTuple(data);
|
|
4833
|
+
this.filesystemIncarnationContract ||= incarnation.hasAny;
|
|
4834
|
+
const incarnationComplete = incarnation.complete;
|
|
4835
|
+
const connection = this.filesystemIncarnationContract ? incarnationComplete && incarnation.readiness === "ready" ? normalizeConnection(data.connection) : void 0 : normalizeConnection(data.connection) ?? this.info.connection;
|
|
4778
4836
|
return {
|
|
4779
|
-
id
|
|
4837
|
+
id,
|
|
4780
4838
|
name: data.name,
|
|
4839
|
+
filesystemIncarnationId: incarnationComplete ? incarnation.id : void 0,
|
|
4840
|
+
filesystemIncarnationProvenance: incarnationComplete ? incarnation.provenance : void 0,
|
|
4841
|
+
filesystemIncarnationReadiness: incarnationComplete ? incarnation.readiness : void 0,
|
|
4781
4842
|
status: data.status ?? "pending",
|
|
4782
|
-
connection
|
|
4843
|
+
connection,
|
|
4783
4844
|
metadata: data.metadata,
|
|
4784
4845
|
createdAt: data.createdAt ? new Date(data.createdAt) : this.info.createdAt,
|
|
4785
4846
|
startedAt: data.startedAt ? new Date(data.startedAt) : void 0,
|
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-BtWedJd2.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-B74oCU6n.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 { p as parseErrorResponse } from "./errors-hbpL_-S6.js";
|
|
2
|
-
import { n as createSandboxInstanceFromResponse } from "./sandbox-
|
|
2
|
+
import { n as createSandboxInstanceFromResponse } from "./sandbox-_XxypYz0.js";
|
|
3
3
|
//#region src/tangle/abi.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tangle Contract ABI Definitions
|
|
@@ -632,6 +632,29 @@ function readString(record, keys) {
|
|
|
632
632
|
if (typeof value === "string" && value.length > 0) return value;
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
|
+
/**
|
|
636
|
+
* The incarnation fields are one contract, not three independent hints.
|
|
637
|
+
* Keep the legacy (all absent) wire shape distinct from a partial contract so
|
|
638
|
+
* a readiness-only response cannot authorize a stale runtime credential.
|
|
639
|
+
*/
|
|
640
|
+
function classifyFilesystemIncarnation(value) {
|
|
641
|
+
const rawId = value.filesystemIncarnationId;
|
|
642
|
+
const rawProvenance = value.filesystemIncarnationProvenance;
|
|
643
|
+
const rawReadiness = value.filesystemIncarnationReadiness;
|
|
644
|
+
const id = typeof rawId === "string" && rawId.length > 0 ? rawId : void 0;
|
|
645
|
+
const provenance = rawProvenance === "fresh" || rawProvenance === "restored" || rawProvenance === "unknown" ? rawProvenance : void 0;
|
|
646
|
+
const readiness = rawReadiness === "transitioning" || rawReadiness === "ready" ? rawReadiness : void 0;
|
|
647
|
+
return {
|
|
648
|
+
hasAny: rawId !== void 0 || rawProvenance !== void 0 || rawReadiness !== void 0,
|
|
649
|
+
complete: id !== void 0 && provenance !== void 0 && readiness !== void 0,
|
|
650
|
+
id,
|
|
651
|
+
provenance,
|
|
652
|
+
readiness
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
function runtimeCredentialsAllowed(incarnation) {
|
|
656
|
+
return !incarnation.hasAny || incarnation.complete && incarnation.readiness === "ready";
|
|
657
|
+
}
|
|
635
658
|
function entryMetadata(entry) {
|
|
636
659
|
const metadata = {
|
|
637
660
|
...entry.metadata ?? {},
|
|
@@ -642,11 +665,16 @@ function entryMetadata(entry) {
|
|
|
642
665
|
return Object.keys(metadata).length > 0 ? metadata : void 0;
|
|
643
666
|
}
|
|
644
667
|
function sandboxInfoFromEntry(entry) {
|
|
668
|
+
const incarnation = classifyFilesystemIncarnation(entry);
|
|
669
|
+
const allowRuntime = runtimeCredentialsAllowed(incarnation);
|
|
645
670
|
return {
|
|
646
671
|
id: entry.id,
|
|
647
672
|
name: entry.name,
|
|
673
|
+
filesystemIncarnationId: incarnation.complete ? incarnation.id : void 0,
|
|
674
|
+
filesystemIncarnationProvenance: incarnation.complete ? incarnation.provenance : void 0,
|
|
675
|
+
filesystemIncarnationReadiness: incarnation.complete ? incarnation.readiness : void 0,
|
|
648
676
|
status: entry.status === "deleted" ? "stopped" : entry.status,
|
|
649
|
-
connection: entry.runtimeUrl ? {
|
|
677
|
+
connection: allowRuntime && entry.runtimeUrl ? {
|
|
650
678
|
runtimeUrl: entry.runtimeUrl,
|
|
651
679
|
authToken: entry.runtimeToken
|
|
652
680
|
} : void 0,
|
|
@@ -681,14 +709,26 @@ function sandboxEntryFromWire(fallbackId, raw) {
|
|
|
681
709
|
"sidecarToken",
|
|
682
710
|
"token"
|
|
683
711
|
]) ?? "";
|
|
712
|
+
const tupleField = (key) => Object.hasOwn(raw, key) ? raw[key] : void 0;
|
|
713
|
+
const tupleId = tupleField("filesystemIncarnationId") === void 0 ? void 0 : typeof tupleField("filesystemIncarnationId") === "string" ? tupleField("filesystemIncarnationId") : "";
|
|
714
|
+
const tupleProvenance = tupleField("filesystemIncarnationProvenance") === void 0 ? void 0 : tupleField("filesystemIncarnationProvenance");
|
|
715
|
+
const tupleReadiness = tupleField("filesystemIncarnationReadiness") === void 0 ? void 0 : tupleField("filesystemIncarnationReadiness");
|
|
716
|
+
const allowRuntime = runtimeCredentialsAllowed(classifyFilesystemIncarnation({
|
|
717
|
+
filesystemIncarnationId: tupleId,
|
|
718
|
+
filesystemIncarnationProvenance: tupleProvenance,
|
|
719
|
+
filesystemIncarnationReadiness: tupleReadiness
|
|
720
|
+
}));
|
|
684
721
|
const rawStatus = readString(raw, ["status"]) ?? "running";
|
|
685
722
|
const createdAtRaw = readString(raw, ["createdAt", "created_at"]);
|
|
686
723
|
const createdAt = createdAtRaw ? new Date(createdAtRaw) : /* @__PURE__ */ new Date();
|
|
687
724
|
return {
|
|
688
725
|
id,
|
|
689
726
|
name: readString(raw, ["name"]),
|
|
690
|
-
|
|
691
|
-
|
|
727
|
+
filesystemIncarnationId: tupleId,
|
|
728
|
+
filesystemIncarnationProvenance: tupleProvenance,
|
|
729
|
+
filesystemIncarnationReadiness: tupleReadiness,
|
|
730
|
+
runtimeUrl: allowRuntime ? runtimeUrl : "",
|
|
731
|
+
runtimeToken: allowRuntime ? runtimeToken : "",
|
|
692
732
|
status: rawStatus === "stopped" || rawStatus === "deleted" || rawStatus === "running" ? rawStatus : "running",
|
|
693
733
|
createdAt,
|
|
694
734
|
metadata,
|
|
@@ -728,20 +768,21 @@ var TangleSandboxClient = class {
|
|
|
728
768
|
throw new Error("Failed to decode create job result");
|
|
729
769
|
}
|
|
730
770
|
else throw new Error("No result returned from create job");
|
|
731
|
-
const
|
|
732
|
-
|
|
733
|
-
|
|
771
|
+
const wireEntry = sandboxEntryFromWire(sandboxId, responseJson);
|
|
772
|
+
if (wireEntry.runtimeUrl && !wireEntry.runtimeToken) throw new Error("Create job returned a runtime URL without an auth token");
|
|
773
|
+
const allowRuntime = runtimeCredentialsAllowed(classifyFilesystemIncarnation(wireEntry));
|
|
734
774
|
const entry = {
|
|
775
|
+
...wireEntry,
|
|
735
776
|
id: sandboxId,
|
|
736
|
-
name: options?.name,
|
|
737
|
-
runtimeUrl,
|
|
738
|
-
runtimeToken,
|
|
739
|
-
status:
|
|
740
|
-
createdAt:
|
|
741
|
-
metadata: createOptions.metadata,
|
|
742
|
-
teeAttestationJson: responseJson.teeAttestationJson,
|
|
743
|
-
teePublicKeyJson: responseJson.teePublicKeyJson,
|
|
744
|
-
attestationNonce: attestationNonceFromOptions(createOptions)
|
|
777
|
+
name: options?.name ?? wireEntry.name,
|
|
778
|
+
runtimeUrl: allowRuntime ? wireEntry.runtimeUrl : "",
|
|
779
|
+
runtimeToken: allowRuntime ? wireEntry.runtimeToken : "",
|
|
780
|
+
status: wireEntry.status,
|
|
781
|
+
createdAt: wireEntry.createdAt,
|
|
782
|
+
metadata: createOptions.metadata ?? wireEntry.metadata,
|
|
783
|
+
teeAttestationJson: wireEntry.teeAttestationJson ?? responseJson.teeAttestationJson,
|
|
784
|
+
teePublicKeyJson: wireEntry.teePublicKeyJson ?? responseJson.teePublicKeyJson,
|
|
785
|
+
attestationNonce: attestationNonceFromOptions(createOptions) ?? wireEntry.attestationNonce
|
|
745
786
|
};
|
|
746
787
|
this.sandboxes.set(sandboxId, entry);
|
|
747
788
|
return createSandboxInstanceFromResponse(this, sandboxInfoFromEntry(entry));
|
|
@@ -781,7 +822,7 @@ var TangleSandboxClient = class {
|
|
|
781
822
|
if (getMatch && method === "GET") {
|
|
782
823
|
const id = decodeURIComponent(requirePathGroup(getMatch, 1));
|
|
783
824
|
let entry = this.sandboxes.get(id);
|
|
784
|
-
if (
|
|
825
|
+
if (this.operatorApiUrl) {
|
|
785
826
|
const operatorResponse = await this.fetchOperatorApi(`/api/sandboxes/${encodeURIComponent(id)}`, { method: "GET" });
|
|
786
827
|
if (!operatorResponse.ok) return operatorResponse;
|
|
787
828
|
entry = sandboxEntryFromWire(id, await operatorResponse.json());
|
|
@@ -861,8 +902,15 @@ var TangleSandboxClient = class {
|
|
|
861
902
|
throw new Error(`Operation not supported via on-chain client: ${method} ${path}`);
|
|
862
903
|
}
|
|
863
904
|
async fetchRuntime(sandboxId, runtimePath, options) {
|
|
864
|
-
|
|
865
|
-
if (
|
|
905
|
+
let entry = this.sandboxes.get(sandboxId);
|
|
906
|
+
if (this.operatorApiUrl) {
|
|
907
|
+
const operatorResponse = await this.fetchOperatorApi(`/api/sandboxes/${encodeURIComponent(sandboxId)}`, { method: "GET" });
|
|
908
|
+
if (!operatorResponse.ok) return operatorResponse;
|
|
909
|
+
entry = sandboxEntryFromWire(sandboxId, await operatorResponse.json());
|
|
910
|
+
this.sandboxes.set(entry.id, entry);
|
|
911
|
+
}
|
|
912
|
+
const incarnation = entry ? classifyFilesystemIncarnation(entry) : void 0;
|
|
913
|
+
if (!entry || !incarnation || !runtimeCredentialsAllowed(incarnation) || !entry.runtimeUrl || !entry.runtimeToken) return new Response(JSON.stringify({ error: "Sandbox runtime unavailable" }), {
|
|
866
914
|
status: 503,
|
|
867
915
|
headers: { "Content-Type": "application/json" }
|
|
868
916
|
});
|
|
@@ -1189,6 +1189,12 @@ interface SandboxInfo {
|
|
|
1189
1189
|
id: string;
|
|
1190
1190
|
/** Human-readable name */
|
|
1191
1191
|
name?: string;
|
|
1192
|
+
/** Control-plane identity of the currently published filesystem contents. */
|
|
1193
|
+
filesystemIncarnationId?: string;
|
|
1194
|
+
/** How the current filesystem contents were acquired. */
|
|
1195
|
+
filesystemIncarnationProvenance?: "fresh" | "restored" | "unknown";
|
|
1196
|
+
/** Whether this incarnation is safe for consumers to treat as authoritative. */
|
|
1197
|
+
filesystemIncarnationReadiness?: "transitioning" | "ready";
|
|
1192
1198
|
/** Current status */
|
|
1193
1199
|
status: SandboxStatus;
|
|
1194
1200
|
/** Connection information */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.11.1-develop.
|
|
3
|
+
"version": "0.11.1-develop.20260722104143.c136f04",
|
|
4
4
|
"description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -125,8 +125,8 @@
|
|
|
125
125
|
"vitest": "^4.1.5",
|
|
126
126
|
"ws": "^8.20.0",
|
|
127
127
|
"yjs": "13.6.30",
|
|
128
|
-
"@
|
|
129
|
-
"@
|
|
128
|
+
"@repo/shared": "0.0.0",
|
|
129
|
+
"@tangle-network/runtime-contracts": "0.1.0"
|
|
130
130
|
},
|
|
131
131
|
"scripts": {
|
|
132
132
|
"build": "tsdown",
|