@tangle-network/sandbox 0.11.1-develop.20260718051226.027ffd3 → 0.11.1-develop.20260718065557.556b29e
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/{client-BjRAbbVo.js → client-C8zjvgpm.js} +13 -5
- package/dist/{client-Cm6jEUvz.d.ts → client-D8aRlF_N.d.ts} +1 -1
- package/dist/core.d.ts +2 -2
- package/dist/core.js +2 -2
- package/dist/{index-NDUDHCQ8.d.ts → index-B_9PUXLN.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{sandbox-Px9LWXQW.d.ts → sandbox-BfCcV3M4.d.ts} +2 -0
- package/dist/{sandbox-CWpdam-a.js → sandbox-RpcTSijL.js} +30 -3
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-Bkz92e1E.js → tangle-BU24fDBA.js} +3 -3
- package/package.json +1 -1
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { D as CodeExecutionOptions, O as CodeExecutionResult, j as CodeResultPart, k as CodeLanguage } from "../types-GCqqVbu5.js";
|
|
2
|
-
import { n as SandboxInstance } from "../sandbox-
|
|
3
|
-
import { i as SandboxClient } from "../client-
|
|
2
|
+
import { n as SandboxInstance } from "../sandbox-BfCcV3M4.js";
|
|
3
|
+
import { i as SandboxClient } from "../client-D8aRlF_N.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-fqaQ3CN2.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-Cbs78OlF.js";
|
|
3
|
-
import {
|
|
3
|
+
import { f as exportTraceBundle, h as parseSSEStream, n as createSandboxInstanceFromResponse, r as normalizeStartupDiagnostics, u as normalizeConnection } from "./sandbox-RpcTSijL.js";
|
|
4
4
|
//#region src/resources.ts
|
|
5
5
|
/**
|
|
6
6
|
* Compute tiers, ordered smallest → largest. Defined HERE (not imported from
|
|
@@ -326,10 +326,18 @@ var SandboxFleet = class {
|
|
|
326
326
|
return this.requireSandbox(machineId);
|
|
327
327
|
}
|
|
328
328
|
async collectArtifacts(artifacts) {
|
|
329
|
+
const sandboxes = /* @__PURE__ */ new Map();
|
|
330
|
+
const sandboxFor = (machineId) => {
|
|
331
|
+
const existing = sandboxes.get(machineId);
|
|
332
|
+
if (existing) return existing;
|
|
333
|
+
const pending = this.requireSandbox(machineId);
|
|
334
|
+
sandboxes.set(machineId, pending);
|
|
335
|
+
return pending;
|
|
336
|
+
};
|
|
329
337
|
return mapConcurrent(artifacts, Math.min(MAX_CONCURRENT_ARTIFACT_READS, artifacts.length || 1), async (artifact) => {
|
|
330
338
|
assertArtifactPath(artifact.path);
|
|
331
339
|
const machine = this.get(artifact.machineId);
|
|
332
|
-
const content = await (await
|
|
340
|
+
const content = await (await sandboxFor(artifact.machineId)).read(artifact.path);
|
|
333
341
|
assertArtifactSize(content, artifact);
|
|
334
342
|
return {
|
|
335
343
|
...artifact,
|
|
@@ -1745,7 +1753,7 @@ var SandboxClient = class {
|
|
|
1745
1753
|
}
|
|
1746
1754
|
if (!response) throw createTimeoutError();
|
|
1747
1755
|
const data = await response.json();
|
|
1748
|
-
const instance =
|
|
1756
|
+
const instance = createSandboxInstanceFromResponse(this, this.parseInfo(data), requestBackend);
|
|
1749
1757
|
if (instance.status === "provisioning" || instance.status === "pending") {
|
|
1750
1758
|
const remainingMs = Math.max(0, deadline - Date.now());
|
|
1751
1759
|
await instance.waitFor("running", {
|
|
@@ -1828,7 +1836,7 @@ var SandboxClient = class {
|
|
|
1828
1836
|
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
1829
1837
|
}
|
|
1830
1838
|
const data = await response.json();
|
|
1831
|
-
return (Array.isArray(data) ? data : data.sandboxes ?? []).map((item) =>
|
|
1839
|
+
return (Array.isArray(data) ? data : data.sandboxes ?? []).map((item) => createSandboxInstanceFromResponse(this, this.parseInfo(item)));
|
|
1832
1840
|
}
|
|
1833
1841
|
/**
|
|
1834
1842
|
* Get a sandbox by ID.
|
|
@@ -1852,7 +1860,7 @@ var SandboxClient = class {
|
|
|
1852
1860
|
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
1853
1861
|
}
|
|
1854
1862
|
const data = await response.json();
|
|
1855
|
-
return
|
|
1863
|
+
return createSandboxInstanceFromResponse(this, this.parseInfo(data));
|
|
1856
1864
|
}
|
|
1857
1865
|
/**
|
|
1858
1866
|
* Get usage information for the account.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { $n as SandboxFleetArtifactSpec, An as PublishPublicTemplateVersionOptions, Ar as SandboxProfileSummary, B as CreateSandboxOptions, Cr as SandboxFleetWorkspaceRestoreResult, Ct as FleetExecDispatchOptions, Dn as PublicTemplateInfo, Dt as FleetPromptDispatchResult, Et as FleetPromptDispatchOptions, F as CreateIntelligenceReportOptions, Fi as UsageInfo, I as CreateRequestOptions, Jn as SandboxClientConfig, Jt as IntelligenceReportBudget, L as CreateSandboxFleetOptions, Mn as ReapExpiredSandboxFleetsResult, Nn as ReconcileSandboxFleetsOptions, On as PublicTemplateVersionInfo, Pn as ReconcileSandboxFleetsResult, Qn as SandboxFleetArtifact, R as CreateSandboxFleetTokenOptions, Sn as PromptResult, Sr as SandboxFleetWorkspaceReconcileResult, St as FleetDispatchStreamOptions, Tr as SandboxInfo, Tt as FleetMachineId, Xn as SandboxEnvironment, Yt as IntelligenceReportCompareTo, Zr as SecretsManager, Zt as IntelligenceReportWindow, _ as BatchResult, a as AttachSandboxFleetMachineOptions, ar as SandboxFleetInfo, bn as PromptInputPart, br as SandboxFleetUsage, bt as FleetDispatchResultBuffer, dr as SandboxFleetManifest, er as SandboxFleetCostEstimate, fi as SshKeysManager, g as BatchOptions, gi as SubscriptionInfo, gr as SandboxFleetTraceBundle, hr as SandboxFleetToken, jn as ReapExpiredSandboxFleetsOptions, ki as TokenRefreshHandler, kn as PublishPublicTemplateOptions, lr as SandboxFleetMachineRecord, m as BatchEvent, nn as ListSandboxOptions, nr as SandboxFleetDispatchResponse, ot as ExecOptions, pr as SandboxFleetOperationsSummary, qt as IntelligenceReport, rr as SandboxFleetDriverCapability, st as ExecResult, tn as ListSandboxFleetOptions, v as BatchRunOptions, wr as SandboxFleetWorkspaceSnapshotResult, wt as FleetExecDispatchResult, x as BatchTask, xn as PromptOptions, xt as FleetDispatchResultBufferOptions, y as BatchRunRequest, yr as SandboxFleetTraceOptions, yt as FleetDispatchCancelResult, z as CreateSandboxFleetWithCoordinatorOptions } from "./types-GCqqVbu5.js";
|
|
2
|
-
import { a as TraceExportSink, i as TraceExportResult, n as SandboxInstance, t as HttpClient } from "./sandbox-
|
|
2
|
+
import { a as TraceExportSink, i as TraceExportResult, n as SandboxInstance, t as HttpClient } from "./sandbox-BfCcV3M4.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
1
|
import { B as CreateSandboxOptions, Ir as SandboxStatus, Jn as SandboxClientConfig, Tr as SandboxInfo, dn as PreviewLinkInfo, fn as PreviewLinkManager, on as NetworkConfig, ot as ExecOptions, st as ExecResult } from "./types-GCqqVbu5.js";
|
|
2
|
-
import { n as SandboxInstance } from "./sandbox-
|
|
3
|
-
import { i as SandboxClient } from "./client-
|
|
2
|
+
import { n as SandboxInstance } from "./sandbox-BfCcV3M4.js";
|
|
3
|
+
import { i as SandboxClient } from "./client-D8aRlF_N.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-ntvaf0_F.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-Cbs78OlF.js";
|
|
2
|
-
import { t as SandboxInstance } from "./sandbox-
|
|
3
|
-
import { n as SandboxClient } from "./client-
|
|
2
|
+
import { t as SandboxInstance } from "./sandbox-RpcTSijL.js";
|
|
3
|
+
import { n as SandboxClient } from "./client-C8zjvgpm.js";
|
|
4
4
|
export { AuthError, CapabilityError, NetworkError, NotFoundError, PartialFailureError, QuotaError, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { $ as DriverType, $i as AgentProfileValidationIssue, $n as SandboxFleetArtifactSpec, $r as SendSessionMessageRequest, $t as ListMessagesOptions, A as CodeResult, Ai as ToolsConfig, An as PublishPublicTemplateVersionOptions, Ar as SandboxProfileSummary, At as GitBranch, B as CreateSandboxOptions, Bi as WriteManyOptions, Bn as RolloutOptions, Br as SandboxTerminalRequestOptions, Bt as GpuLeaseManager, C as BatchTaskUsage, Ci as TaskSessionProfile, Cn as ProvisionEvent, Cr as SandboxFleetWorkspaceRestoreResult, Ct as FleetExecDispatchOptions, Di as TeePublicKey, Dn as PublicTemplateInfo, Dr as SandboxPermissionsConfig, E as ChunkedUploadResult, Ei as TeeAttestationResponse, En as ProvisionStep, Er as SandboxIntelligenceEnvelope, Et as FleetPromptDispatchOptions, F as CreateIntelligenceReportOptions, Fi as UsageInfo, Fn as RenameOptions, Fr as SandboxRuntimeProfileList, Ft as GpuLease, G as DirectoryPermission, Gi as AgentProfileFileMount, Gn as RunCodeOptions, Gr as SandboxUser, Gt as HostAgentRuntimeBackend, H as CreateTaskSessionOptions, Hi as AgentProfileCapabilities, Hn as RolloutStartResult, Hr as SandboxTraceEvent, Ht as GpuLeaseStatus, I as CreateRequestOptions, Ii as WaitForOptions, Ir as SandboxStatus, It as GpuLeaseBilling, J as DownloadOptions, Ji as AgentProfilePermissionValue, Jn as SandboxClientConfig, Jr as SearchMatch, Jt as IntelligenceReportBudget, K as DispatchPromptOptions, Ki as AgentProfileMcpServer, Kn as SSHCommandDescriptor, Kr as ScopedToken, Kt as InstalledTool, L as CreateSandboxFleetOptions, Li as WaitForRolloutOptions, Lr as SandboxTerminalCreateOptions, Lt as GpuLeaseCommandResult, M as CommitTaskSessionOptions, Mi as UpdateUserOptions, Mn as ReapExpiredSandboxFleetsResult, Mr as SandboxResources, Mt as GitConfig, N as CompletedTurnResult, Ni as UploadOptions, Nn as ReconcileSandboxFleetsOptions, Nr as SandboxRuntimeHealth, Nt as GitDiff, Oi as TeePublicKeyResponse, On as PublicTemplateVersionInfo, Or as SandboxPortBinding, Ot as GPU_LEASE_PROVIDER_NAMES, P as CreateGpuLeaseOptions, Pi as UploadProgress, Pn as ReconcileSandboxFleetsResult, Pr as SandboxRuntimeProfile, Pt as GitStatus, Q as DriverInfo, Qi as AgentProfileSecurityPolicy, Qn as SandboxFleetArtifact, Qr as SendSessionMessageOptions, Ri as WriteFileOptions, Rn as Rollout, Rr as SandboxTerminalInfo, Rt as GpuLeaseExecOptions, S as BatchTaskResult, Si as TaskSessionInfo, Sn as PromptResult, Sr as SandboxFleetWorkspaceReconcileResult, St as FleetDispatchStreamOptions, T as ChunkedUploadOptions, Ti as TeeAttestationReport, Tn as ProvisionStatus, Tr as SandboxInfo, Tt as FleetMachineId, U as DeleteOptions, Ui as AgentProfileConfidential, Un as RolloutStatus, Ur as SandboxTraceExport, Ut as GpuType, V as CreateSessionOptions, Vi as AgentProfile, Vn as RolloutScorer, Vr as SandboxTraceBundle, Vt as GpuLeaseProviderName, W as DevServerInfo, Wi as AgentProfileConnection, Wn as RolloutTurnPart, Wr as SandboxTraceOptions, Wt as HostAgentDriverConfig, X as DriveTurnOptions, Xi as AgentProfileResourceRef, Xn as SandboxEnvironment, Xr as SecretInfo, Xt as IntelligenceReportSubjectType, Y as DownloadProgress, Yi as AgentProfilePrompt, Yn as SandboxConnection, Yr as SearchOptions, Yt as IntelligenceReportCompareTo, Z as DriverConfig, Zi as AgentProfileResources, Zn as SandboxEvent, Zr as SecretsManager, Zt as IntelligenceReportWindow, _ as BatchResult, _i as TaskOptions, _n as ProcessSignal, _r as SandboxFleetTraceEvent, _t as FileTreeResult, a as AttachSandboxFleetMachineOptions, aa as defineAgentProfile, ai as SessionListOptions, an as MkdirOptions, ar as SandboxFleetInfo, at as ExactProcessSpawnOptions, b as BatchSidecarGroup, bi as TaskSessionCommitResult, br as SandboxFleetUsage, bt as FleetDispatchResultBuffer, c as BackendInfo, ca as mergeAgentProfiles, ci as SessionStatus, cn as NonHostAgentDriverConfig, cr as SandboxFleetMachineMeteredUsage, ct as FileInfo, d as BackendType, di as SnapshotResult, dn as PreviewLinkInfo, dr as SandboxFleetManifest, dt as FileReadError, ea as AgentProfileValidationResult, ei as SentSessionMessage, en as ListOptions, er as SandboxFleetCostEstimate, f as BatchBackend, fn as PreviewLinkManager, fr as SandboxFleetManifestMachine, ft as FileReadResult, g as BatchOptions, gi as SubscriptionInfo, gn as ProcessManager, gr as SandboxFleetTraceBundle, gt as FileTreeOptions, h as BatchEventDataMap, hi as StorageConfig, hn as ProcessLogEntry, hr as SandboxFleetToken, ht as FileTreeFile, i as AttachGpuLeaseOptions, ia as capabilitySchema, ii as SessionInfo, in as MintScopedTokenOptions, ir as SandboxFleetDriverTimings, it as EventStreamOptions, ji as TurnDriveResult, jn as ReapExpiredSandboxFleetsOptions, jr as SandboxResourceUsage, jt as GitCommit, ki as TokenRefreshHandler, kn as PublishPublicTemplateOptions, kr as SandboxPortPreviewLink, kt as GitAuth, l as BackendManager, la as validateAgentProfileSecurity, li as SnapshotInfo, ln as PermissionLevel, lr as SandboxFleetMachineRecord, lt as FileReadBatchOptions, m as BatchEvent, mi as StartupOperation, mn as ProcessInfo, mr as SandboxFleetPolicy, mt as FileSystem, n as AccessPolicyRule, na as Capability, ni as SessionEventStreamOptions, nn as ListSandboxOptions, nr as SandboxFleetDispatchResponse, nt as EgressPolicy, o as BackendCapabilities, oa as defineGitHubResource, oi as SessionMessage, on as NetworkConfig, or as SandboxFleetIntelligenceEnvelope, ot as ExecOptions, p as BatchBackendStats, pi as StartupDiagnostics, pn as Process, pr as SandboxFleetOperationsSummary, pt as FileRenameResult, q as DispatchedSession, qi as AgentProfileModelHints, qn as SSHCredentials, qr as ScopedTokenScope, qt as IntelligenceReport, r as AddUserOptions, ra as agentProfileSchema, ri as SessionForkOptions, rn as McpServerConfig, rr as SandboxFleetDriverCapability, rt as EnsureDevServerOptions, s as BackendConfig, sa as defineInlineResource, si as SessionMessageInputPart, sn as NetworkManager, sr as SandboxFleetMachine, st as ExecResult, t as AcceleratorKind, ta as AgentSubagentProfile, ti as SessionBackendCredentials, tn as ListSandboxFleetOptions, tr as SandboxFleetDispatchFailureClass, tt as EgressManager, u as BackendStatus, ui as SnapshotOptions, un as PermissionsManager, ur as SandboxFleetMachineSpec, ut as FileReadBatchResult, v as BatchRunOptions, vi as TaskResult, vn as ProcessSpawnOptions, vr as SandboxFleetTraceExport, vt as FileWriteResult, w as BranchOptions, wi as TeeAttestationOptions, wn as ProvisionResult, wr as SandboxFleetWorkspaceSnapshotResult, x as BatchTask, xi as TaskSessionFileChange, xn as PromptOptions, xr as SandboxFleetWorkspace, xt as FleetDispatchResultBufferOptions, y as BatchRunRequest, yi as TaskSessionChanges, yn as ProcessStatus, yr as SandboxFleetTraceOptions, yt as FleetDispatchCancelResult, z as CreateSandboxFleetWithCoordinatorOptions, zi as WriteManyFile, zn as RolloutChildResult, zr as SandboxTerminalManager, zt as GpuLeaseExecResult } from "./types-GCqqVbu5.js";
|
|
2
|
-
import { C as SandboxMcpConfig, D as buildSandboxMcpConfig, E as buildControlPlaneMcpConfig, S as SANDBOX_MCP_SERVER_NAME, T as SandboxMcpServerEntry, _ as RespondToPermissionOptions, a as TraceExportSink, b as BuildSandboxMcpConfigOptions, c as otelTraceIdForTangleTrace, d as SandboxSession, f as InteractiveAuthFile, g as InterruptResult, h as InteractiveSessionInfo, i as TraceExportResult, l as toOtelJson, m as InteractiveSessionHost, n as SandboxInstance, o as buildTraceExportPayload, p as InteractiveSessionHandle, r as TraceExportFormat, s as exportTraceBundle, u as SandboxTaskSession, v as StartInteractiveOptions, w as SandboxMcpEndpoint, x as CONTROL_PLANE_MCP_SERVER_NAME, y as BuildControlPlaneMcpConfigOptions } 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-
|
|
2
|
+
import { C as SandboxMcpConfig, D as buildSandboxMcpConfig, E as buildControlPlaneMcpConfig, S as SANDBOX_MCP_SERVER_NAME, T as SandboxMcpServerEntry, _ as RespondToPermissionOptions, a as TraceExportSink, b as BuildSandboxMcpConfigOptions, c as otelTraceIdForTangleTrace, d as SandboxSession, f as InteractiveAuthFile, g as InterruptResult, h as InteractiveSessionInfo, i as TraceExportResult, l as toOtelJson, m as InteractiveSessionHost, n as SandboxInstance, o as buildTraceExportPayload, p as InteractiveSessionHandle, r as TraceExportFormat, s as exportTraceBundle, u as SandboxTaskSession, v as StartInteractiveOptions, w as SandboxMcpEndpoint, x as CONTROL_PLANE_MCP_SERVER_NAME, y as BuildControlPlaneMcpConfigOptions } from "./sandbox-BfCcV3M4.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-D8aRlF_N.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-ntvaf0_F.js";
|
|
7
|
-
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-
|
|
7
|
+
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-B_9PUXLN.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-fqaQ3CN2.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-Cbs78OlF.js";
|
|
3
|
-
import { a as
|
|
4
|
-
import { a as validateDeferredProfileFileMounts, c as DEFAULT_SANDBOX_SIZE, d as resolveSandboxResources, f as sandboxResourcesForSize, i as splitInlineProfileFileMounts, l as SANDBOX_SIZE_PRESETS, n as SandboxClient, o as SandboxFleet, r as materializeProfileFileMounts, s as SandboxFleetClient, t as IntelligenceClient, u as SANDBOX_SIZE_PRESET_NAMES } from "./client-
|
|
3
|
+
import { a as SandboxSession, c as collectAgentResponseText, d as buildTraceExportPayload, f as exportTraceBundle, h as parseSSEStream, i as SandboxTaskSession, l as getSandboxEventText, m as toOtelJson, o as InteractiveSessionHandle, p as otelTraceIdForTangleTrace, s as applySandboxEventText, t as SandboxInstance } from "./sandbox-RpcTSijL.js";
|
|
4
|
+
import { a as validateDeferredProfileFileMounts, c as DEFAULT_SANDBOX_SIZE, d as resolveSandboxResources, f as sandboxResourcesForSize, i as splitInlineProfileFileMounts, l as SANDBOX_SIZE_PRESETS, n as SandboxClient, o as SandboxFleet, r as materializeProfileFileMounts, s as SandboxFleetClient, t as IntelligenceClient, u as SANDBOX_SIZE_PRESET_NAMES } from "./client-C8zjvgpm.js";
|
|
5
5
|
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-DDnuTcZd.js";
|
|
6
|
-
import { t as TangleSandboxClient } from "./tangle-
|
|
6
|
+
import { t as TangleSandboxClient } from "./tangle-BU24fDBA.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) {
|
|
@@ -456,6 +456,7 @@ interface ToolsCapability {
|
|
|
456
456
|
declare class SandboxInstance {
|
|
457
457
|
private readonly client;
|
|
458
458
|
private info;
|
|
459
|
+
private refreshInFlight?;
|
|
459
460
|
private readonly defaultRuntimeBackend?;
|
|
460
461
|
private readonly runtime;
|
|
461
462
|
constructor(client: HttpClient, info: SandboxInfo, defaultRuntimeBackend?: BackendConfig);
|
|
@@ -556,6 +557,7 @@ declare class SandboxInstance {
|
|
|
556
557
|
* Refresh sandbox information from the server.
|
|
557
558
|
*/
|
|
558
559
|
refresh(): Promise<void>;
|
|
560
|
+
private refreshInfo;
|
|
559
561
|
/**
|
|
560
562
|
* Fetch fresh TEE attestation evidence for this sandbox.
|
|
561
563
|
*
|
|
@@ -955,6 +955,14 @@ function parseTextFileReadResponse(body) {
|
|
|
955
955
|
return payload.data.content;
|
|
956
956
|
}
|
|
957
957
|
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
958
|
+
const SANDBOX_STATUS_FRESHNESS_MS = 1e3;
|
|
959
|
+
const sandboxStatusObservedAt = /* @__PURE__ */ new WeakMap();
|
|
960
|
+
const directRuntimeInstances = /* @__PURE__ */ new WeakSet();
|
|
961
|
+
function createSandboxInstanceFromResponse(client, info, defaultRuntimeBackend) {
|
|
962
|
+
const instance = new SandboxInstance(client, info, defaultRuntimeBackend);
|
|
963
|
+
sandboxStatusObservedAt.set(instance, Date.now());
|
|
964
|
+
return instance;
|
|
965
|
+
}
|
|
958
966
|
/** Transient file-write failures worth retrying: rate-limit (quota), 5xx,
|
|
959
967
|
* transport (network), and request timeouts. A non-transient error (bad path,
|
|
960
968
|
* auth, validation) fails loud immediately. */
|
|
@@ -967,6 +975,7 @@ function isTransientWriteError(err) {
|
|
|
967
975
|
var SandboxInstance = class SandboxInstance {
|
|
968
976
|
client;
|
|
969
977
|
info;
|
|
978
|
+
refreshInFlight;
|
|
970
979
|
defaultRuntimeBackend;
|
|
971
980
|
runtime;
|
|
972
981
|
constructor(client, info, defaultRuntimeBackend) {
|
|
@@ -1099,6 +1108,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1099
1108
|
const client = this.client;
|
|
1100
1109
|
if (next && typeof client._emitTokenRefresh === "function") client._emitTokenRefresh(this.id, next);
|
|
1101
1110
|
}), { ...this.info }, this.defaultRuntimeBackend);
|
|
1111
|
+
directRuntimeInstances.add(directInstance);
|
|
1102
1112
|
return directInstance;
|
|
1103
1113
|
}
|
|
1104
1114
|
/**
|
|
@@ -1138,6 +1148,19 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1138
1148
|
* Refresh sandbox information from the server.
|
|
1139
1149
|
*/
|
|
1140
1150
|
async refresh() {
|
|
1151
|
+
if (this.refreshInFlight) {
|
|
1152
|
+
await this.refreshInFlight;
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
const refresh = this.refreshInfo();
|
|
1156
|
+
this.refreshInFlight = refresh;
|
|
1157
|
+
try {
|
|
1158
|
+
await refresh;
|
|
1159
|
+
} finally {
|
|
1160
|
+
if (this.refreshInFlight === refresh) this.refreshInFlight = void 0;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
async refreshInfo() {
|
|
1141
1164
|
const response = await this.client.fetch(`/v1/sandboxes/${this.id}`);
|
|
1142
1165
|
if (!response.ok) {
|
|
1143
1166
|
const body = await response.text();
|
|
@@ -1145,6 +1168,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1145
1168
|
}
|
|
1146
1169
|
const data = await response.json();
|
|
1147
1170
|
this.info = this.parseInfo(data);
|
|
1171
|
+
sandboxStatusObservedAt.set(this, Date.now());
|
|
1148
1172
|
}
|
|
1149
1173
|
/**
|
|
1150
1174
|
* Fetch fresh TEE attestation evidence for this sandbox.
|
|
@@ -3858,7 +3882,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
3858
3882
|
const body = await response.text();
|
|
3859
3883
|
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
3860
3884
|
}
|
|
3861
|
-
return ((await response.json()).children ?? []).map((child) =>
|
|
3885
|
+
return ((await response.json()).children ?? []).map((child) => createSandboxInstanceFromResponse(this.client, this.parseInfo(child), this.defaultRuntimeBackend));
|
|
3862
3886
|
}
|
|
3863
3887
|
/**
|
|
3864
3888
|
* Speculative rollouts: branch this RUNNING sandbox into `n` copy-on-write
|
|
@@ -3991,6 +4015,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
3991
4015
|
}
|
|
3992
4016
|
const diagnostics = await this.readLifecycleDiagnostics(response);
|
|
3993
4017
|
if (diagnostics) this.info.startupDiagnostics = diagnostics;
|
|
4018
|
+
sandboxStatusObservedAt.delete(this);
|
|
3994
4019
|
}
|
|
3995
4020
|
/**
|
|
3996
4021
|
* Read the per-phase lifecycle breakdown off a stop/resume/delete response
|
|
@@ -4199,7 +4224,9 @@ var SandboxInstance = class SandboxInstance {
|
|
|
4199
4224
|
}
|
|
4200
4225
|
}
|
|
4201
4226
|
async ensureRunning() {
|
|
4202
|
-
|
|
4227
|
+
const statusObservedAt = sandboxStatusObservedAt.get(this) ?? 0;
|
|
4228
|
+
const statusAgeMs = Date.now() - statusObservedAt;
|
|
4229
|
+
if (directRuntimeInstances.has(this) || statusObservedAt <= 0 || statusAgeMs < 0 || statusAgeMs >= SANDBOX_STATUS_FRESHNESS_MS) await this.refresh();
|
|
4203
4230
|
if (this.status !== "running") throw new StateError(`Sandbox is not running (status: ${this.status})`, this.status, "running");
|
|
4204
4231
|
}
|
|
4205
4232
|
async runtimeFetch(path, options, fetchOptions) {
|
|
@@ -4929,4 +4956,4 @@ function quoteForShell(value) {
|
|
|
4929
4956
|
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
4930
4957
|
}
|
|
4931
4958
|
//#endregion
|
|
4932
|
-
export {
|
|
4959
|
+
export { SandboxSession as a, collectAgentResponseText as c, buildTraceExportPayload as d, exportTraceBundle as f, parseSSEStream as h, SandboxTaskSession as i, getSandboxEventText as l, toOtelJson as m, createSandboxInstanceFromResponse as n, InteractiveSessionHandle as o, otelTraceIdForTangleTrace as p, normalizeStartupDiagnostics as r, applySandboxEventText as s, SandboxInstance as t, normalizeConnection as u };
|
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-B_9PUXLN.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-BU24fDBA.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-Cbs78OlF.js";
|
|
2
|
-
import {
|
|
2
|
+
import { n as createSandboxInstanceFromResponse } from "./sandbox-RpcTSijL.js";
|
|
3
3
|
//#region src/tangle/abi.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tangle Contract ABI Definitions
|
|
@@ -744,7 +744,7 @@ var TangleSandboxClient = class {
|
|
|
744
744
|
attestationNonce: attestationNonceFromOptions(createOptions)
|
|
745
745
|
};
|
|
746
746
|
this.sandboxes.set(sandboxId, entry);
|
|
747
|
-
return
|
|
747
|
+
return createSandboxInstanceFromResponse(this, sandboxInfoFromEntry(entry));
|
|
748
748
|
}
|
|
749
749
|
/**
|
|
750
750
|
* Get a sandbox by id. Rehydrates from the operator API when configured so
|
|
@@ -758,7 +758,7 @@ var TangleSandboxClient = class {
|
|
|
758
758
|
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
759
759
|
}
|
|
760
760
|
const data = await response.json();
|
|
761
|
-
return
|
|
761
|
+
return createSandboxInstanceFromResponse(this, sandboxInfoFromEntry(sandboxEntryFromWire(id, data)));
|
|
762
762
|
}
|
|
763
763
|
/**
|
|
764
764
|
* Route interception for SandboxInstance lifecycle calls.
|
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.20260718065557.556b29e",
|
|
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",
|