@tangle-network/sandbox 0.15.2-develop.20260729082954.3766194 → 0.15.3-develop.20260729104309.c4a5aa8
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-BVa82mrD.js → client-BiZ9-TqN.js} +2 -2
- package/dist/{client-Dm_0x97r.d.ts → client-TMvNZgyy.d.ts} +2 -2
- package/dist/core.d.ts +3 -3
- package/dist/core.js +2 -2
- package/dist/{index-nQeJZQKM.d.ts → index-BdPCuaZM.d.ts} +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/{runtime-api-DdF4OiCL.js → runtime-api-Bage44Xd.js} +35 -18
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/dist/{sandbox-B-x-i-c6.js → sandbox-hSaxYyWo.js} +17 -22
- package/dist/{sandbox-CM6yi4RF.d.ts → sandbox-sQlgHNQu.d.ts} +1 -1
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-mWN-aSM_.js → tangle-DsQLgyfb.js} +1 -1
- package/dist/{types-BhhjmEOz.d.ts → types-Bj2gAOtW.d.ts} +3 -1
- package/package.json +1 -1
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as CodeResultPart, S as CodeLanguage, b as CodeExecutionOptions, x as CodeExecutionResult } from "../types-
|
|
2
|
-
import { n as SandboxInstance } from "../sandbox-
|
|
3
|
-
import { i as Sandbox } from "../client-
|
|
1
|
+
import { C as CodeResultPart, S as CodeLanguage, b as CodeExecutionOptions, x as CodeExecutionResult } from "../types-Bj2gAOtW.js";
|
|
2
|
+
import { n as SandboxInstance } from "../sandbox-sQlgHNQu.js";
|
|
3
|
+
import { i as Sandbox } from "../client-TMvNZgyy.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
|
-
import { c as
|
|
1
|
+
import { c as combineAbortSignals, d as applyRequestedModel, f as assertCurrentBackendType, l as encodePromptForWire, m as backendTypeSchema, o as SANDBOX_PROXY_REQUEST_MAX_BYTES, p as normalizeRuntimeBackendConfig, u as encodeTextForWire } from "./runtime-api-Bage44Xd.js";
|
|
2
2
|
import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, o as PartialFailureError, p as parseErrorResponse, t as AuthError } from "./errors-D9fFOWX9.js";
|
|
3
|
-
import { g as exportTraceBundle, m as normalizeConnection, n as createSandboxInstanceFromResponse, r as normalizeStartupDiagnostics, y as parseSSEStream } from "./sandbox-
|
|
3
|
+
import { g as exportTraceBundle, m as normalizeConnection, n as createSandboxInstanceFromResponse, r as normalizeStartupDiagnostics, y as parseSSEStream } from "./sandbox-hSaxYyWo.js";
|
|
4
4
|
import { agentProfileSchema } from "@tangle-network/agent-interface";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region ../../../packages/runtime-contracts/dist/git-policy.js
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $t as ListSandboxFleetOptions, A as CreateSandboxFleetTokenOptions, An as ReapExpiredSandboxFleetsOptions, Cr as SandboxIdentity, Ct as FleetExecDispatchResult, D as CreateIntelligenceReportOptions, Dn as PublicTemplateVersionInfo, Ei as TokenRefreshHandler, En as PublicTemplateInfo, Et as FleetPromptDispatchResult, Gt as IntelligenceReport, Ji as BatchEvent, Jn as SandboxEnvironment, Jr as SecretsManager, Kn as SandboxConfig, Kt as IntelligenceReportBudget, M as CreateSandboxOptions, Mi as UsageInfo, Mn as ReconcileSandboxFleetsOptions, Nn as ReconcileSandboxFleetsResult, O as CreateRequestOptions, On as PublishPublicTemplateOptions, Qn as SandboxFleetCostEstimate, Sr as SandboxFleetWorkspaceSnapshotResult, St as FleetExecDispatchOptions, Tt as FleetPromptDispatchOptions, Xn as SandboxFleetArtifact, Yt as IntelligenceReportWindow, Zn as SandboxFleetArtifactSpec, _r as SandboxFleetTraceOptions, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, bn as PromptOptions, br as SandboxFleetWorkspaceReconcileResult, bt as FleetDriveTurnOutcome, dr as SandboxFleetOperationsSummary, en as ListSandboxOptions, er as SandboxFleetDispatchResponse, f as BatchResult, gt as FleetDispatchCancelResult, j as CreateSandboxFleetWithCoordinatorOptions, jn as ReapExpiredSandboxFleetsResult, k as CreateSandboxFleetOptions, kn as PublishPublicTemplateVersionOptions, li as SshKeysManager, lr as SandboxFleetManifest, m as BatchRunRequest, mr as SandboxFleetTraceBundle, nt as ExecResult, p as BatchRunOptions, pi as SubscriptionInfo, pr as SandboxFleetToken, qt as IntelligenceReportCompareTo, rr as SandboxFleetInfo, sr as SandboxFleetMachineRecord, tr as SandboxFleetDriverCapability, tt as ExecOptions, vr as SandboxFleetUsage, vt as FleetDispatchResultBufferOptions, wr as SandboxInfo, wt as FleetMachineId, xn as PromptResult, xr as SandboxFleetWorkspaceRestoreResult, xt as FleetDriveTurnRequest, yn as PromptInputPart, yt as FleetDispatchStreamOptions } from "./types-
|
|
2
|
-
import { c as TraceExportResult, l as TraceExportSink, n as SandboxInstance, t as HttpClient } from "./sandbox-
|
|
1
|
+
import { $t as ListSandboxFleetOptions, A as CreateSandboxFleetTokenOptions, An as ReapExpiredSandboxFleetsOptions, Cr as SandboxIdentity, Ct as FleetExecDispatchResult, D as CreateIntelligenceReportOptions, Dn as PublicTemplateVersionInfo, Ei as TokenRefreshHandler, En as PublicTemplateInfo, Et as FleetPromptDispatchResult, Gt as IntelligenceReport, Ji as BatchEvent, Jn as SandboxEnvironment, Jr as SecretsManager, Kn as SandboxConfig, Kt as IntelligenceReportBudget, M as CreateSandboxOptions, Mi as UsageInfo, Mn as ReconcileSandboxFleetsOptions, Nn as ReconcileSandboxFleetsResult, O as CreateRequestOptions, On as PublishPublicTemplateOptions, Qn as SandboxFleetCostEstimate, Sr as SandboxFleetWorkspaceSnapshotResult, St as FleetExecDispatchOptions, Tt as FleetPromptDispatchOptions, Xn as SandboxFleetArtifact, Yt as IntelligenceReportWindow, Zn as SandboxFleetArtifactSpec, _r as SandboxFleetTraceOptions, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, bn as PromptOptions, br as SandboxFleetWorkspaceReconcileResult, bt as FleetDriveTurnOutcome, dr as SandboxFleetOperationsSummary, en as ListSandboxOptions, er as SandboxFleetDispatchResponse, f as BatchResult, gt as FleetDispatchCancelResult, j as CreateSandboxFleetWithCoordinatorOptions, jn as ReapExpiredSandboxFleetsResult, k as CreateSandboxFleetOptions, kn as PublishPublicTemplateVersionOptions, li as SshKeysManager, lr as SandboxFleetManifest, m as BatchRunRequest, mr as SandboxFleetTraceBundle, nt as ExecResult, p as BatchRunOptions, pi as SubscriptionInfo, pr as SandboxFleetToken, qt as IntelligenceReportCompareTo, rr as SandboxFleetInfo, sr as SandboxFleetMachineRecord, tr as SandboxFleetDriverCapability, tt as ExecOptions, vr as SandboxFleetUsage, vt as FleetDispatchResultBufferOptions, wr as SandboxInfo, wt as FleetMachineId, xn as PromptResult, xr as SandboxFleetWorkspaceRestoreResult, xt as FleetDriveTurnRequest, yn as PromptInputPart, yt as FleetDispatchStreamOptions } from "./types-Bj2gAOtW.js";
|
|
2
|
+
import { c as TraceExportResult, l as TraceExportSink, n as SandboxInstance, t as HttpClient } from "./sandbox-sQlgHNQu.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 { Kn as SandboxConfig, M as CreateSandboxOptions, in as NetworkConfig, jr as SandboxStatus, ln as PreviewLinkInfo, nt as ExecResult, tt as ExecOptions, un as PreviewLinkManager, wr as SandboxInfo, yn as PromptInputPart } from "./types-
|
|
2
|
-
import { a as WorkspaceImagePublishResult, i as WorkspaceImagePublishRequestOptions, n as SandboxInstance, o as WorkspaceImages, r as WorkspaceImagePublishInput } from "./sandbox-
|
|
3
|
-
import { i as Sandbox } from "./client-
|
|
1
|
+
import { Kn as SandboxConfig, M as CreateSandboxOptions, in as NetworkConfig, jr as SandboxStatus, ln as PreviewLinkInfo, nt as ExecResult, tt as ExecOptions, un as PreviewLinkManager, wr as SandboxInfo, yn as PromptInputPart } from "./types-Bj2gAOtW.js";
|
|
2
|
+
import { a as WorkspaceImagePublishResult, i as WorkspaceImagePublishRequestOptions, n as SandboxInstance, o as WorkspaceImages, r as WorkspaceImagePublishInput } from "./sandbox-sQlgHNQu.js";
|
|
3
|
+
import { i as Sandbox } from "./client-TMvNZgyy.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-BzMmpmqU.js";
|
|
5
5
|
export { AuthError, CapabilityError, type CreateSandboxOptions, type ExecOptions, type ExecResult, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, type PromptInputPart, QuotaError, Sandbox, type SandboxConfig, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, StateError, TimeoutError, ValidationError, type WorkspaceImagePublishInput, type WorkspaceImagePublishRequestOptions, type WorkspaceImagePublishResult, WorkspaceImages };
|
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-D9fFOWX9.js";
|
|
2
|
-
import { n as Sandbox } from "./client-
|
|
3
|
-
import { i as WorkspaceImages, t as SandboxInstance } from "./sandbox-
|
|
2
|
+
import { n as Sandbox } from "./client-BiZ9-TqN.js";
|
|
3
|
+
import { i as WorkspaceImages, t as SandboxInstance } from "./sandbox-hSaxYyWo.js";
|
|
4
4
|
export { AuthError, CapabilityError, NetworkError, NotFoundError, PartialFailureError, QuotaError, Sandbox, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as CreateSandboxOptions } from "./types-
|
|
2
|
-
import { n as SandboxInstance, t as HttpClient } from "./sandbox-
|
|
1
|
+
import { M as CreateSandboxOptions } from "./types-Bj2gAOtW.js";
|
|
2
|
+
import { n as SandboxInstance, t as HttpClient } from "./sandbox-sQlgHNQu.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 BackendType, $n as SandboxFleetDispatchFailureClass, $r as SessionEventStreamOptions, $t as ListSandboxFleetOptions, Ai as UploadOptions, An as ReapExpiredSandboxFleetsOptions, Ar as SandboxRuntimeHealth, At as GitCommit, B as DownloadOptions, Bi as TerminalReadyInfo, Bn as RolloutScorer, Br as SandboxTraceExport, Bt as GpuLeaseProviderName, Ci as TeeAttestationResponse, Cn as ProvisionResult, Cr as SandboxIdentity, D as CreateIntelligenceReportOptions, Di as TokenUsage, Dn as PublicTemplateVersionInfo, Dr as SandboxPortPreviewLink, Dt as GPU_LEASE_PROVIDER_NAMES, E as CreateGpuLeaseOptions, Ei as TokenRefreshHandler, En as PublicTemplateInfo, Er as SandboxPortBinding, F as DeleteOptions, Fi as WriteFileOptions, Fr as SandboxTerminalManager, Ft as GpuLeaseBilling, G as DriverType, Gi as TerminalStreamOptions, Gn as SSHCredentials, Gr as SearchMatch, Gt as IntelligenceReport, H as DriveTurnOptions, Hi as TerminalStreamAuthFormat, Hn as RolloutStatus, Hr as SandboxUser, Ht as HostAgentDriverConfig, I as DevServerInfo, Ii as WriteManyFile, Ir as SandboxTerminalRequestOptions, It as GpuLeaseCommandResult, J as EffectiveBackendProfile, Ji as BatchEvent, Jn as SandboxEnvironment, Jr as SecretsManager, Jt as IntelligenceReportSubjectType, Ki as TerminalStreamToken, Kn as SandboxConfig, Kr as SearchOptions, Kt as IntelligenceReportBudget, L as DirectoryPermission, Li as WriteManyOptions, Ln as Rollout, Lr as SandboxTerminals, Lt as GpuLeaseExecOptions, M as CreateSandboxOptions, Mi as UsageInfo, Mn as ReconcileSandboxFleetsOptions, Mr as SandboxTerminalAttachOptions, Mt as GitDiff, N as CreateSessionOptions, Ni as WaitForOptions, Nn as ReconcileSandboxFleetsResult, Nr as SandboxTerminalCreateOptions, Nt as GitStatus, O as CreateRequestOptions, Oi as TurnDriveResult, On as PublishPublicTemplateOptions, Or as SandboxResourceUsage, Ot as GitAuth, P as CreateTaskSessionOptions, Pi as WaitForRolloutOptions, Pn as RenameOptions, Pr as SandboxTerminalInfo, Pt as GpuLease, Q as EnsureDevServerOptions, Qi as PublicBatchRunRequest, Qn as SandboxFleetCostEstimate, Qr as SessionBackendCredentials, Qt as ListOptions, R as DispatchPromptOptions, Ri as TERMINAL_WS_ECHO_SUBPROTOCOL, Rn as RolloutChildResult, Rr as SandboxTraceBundle, Rt as GpuLeaseExecResult, Si as TeeAttestationReport, Sn as ProvisionEvent, Sr as SandboxFleetWorkspaceSnapshotResult, St as FleetExecDispatchOptions, T as CompletedTurnResult, Ti as TeePublicKeyResponse, Tn as ProvisionStep, Tr as SandboxIntelligenceEnvelope, Tt as FleetPromptDispatchOptions, U as DriverConfig, Ui as TerminalStreamError, Un as RolloutTurnPart, Ur as ScopedToken, Ut as HostAgentRuntimeBackend, V as DownloadProgress, Vi as TerminalStream, Vn as RolloutStartResult, Vr as SandboxTraceOptions, Vt as GpuLeaseStatus, W as DriverInfo, Wi as TerminalStreamHandlers, Wn as SSHCommandDescriptor, Wr as ScopedTokenScope, Wt as InstalledTool, X as EgressManager, Xi as BatchSidecarGroup, Xn as SandboxFleetArtifact, Xr as SendSessionMessageRequest, Y as EffectiveBackendSource, Yi as BatchEventDataMap, Yn as SandboxEvent, Yr as SendSessionMessageOptions, Yt as IntelligenceReportWindow, Z as EgressPolicy, Zi as BatchTaskUsage, Zn as SandboxFleetArtifactSpec, Zr as SentSessionMessage, Zt as ListMessagesOptions, _ as BranchOptions, _i as TaskSessionCommitResult, _n as ProcessSpawnOptions, _r as SandboxFleetTraceOptions, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, ai as SessionStatus, an as NetworkManager, ar as SandboxFleetMachine, at as FileReadBatchResult, bi as TaskSessionProfile, bn as PromptOptions, br as SandboxFleetWorkspaceReconcileResult, bt as FleetDriveTurnOutcome, c as BackendInfo, ci as SnapshotResult, cn as PermissionsManager, cr as SandboxFleetMachineSpec, ct as FileRenameResult, d as BatchBackend, di as StartupOperation, dn as Process, dr as SandboxFleetOperationsSummary, dt as FileTreeOptions, ei as SessionForkOptions, en as ListSandboxOptions, er as SandboxFleetDispatchResponse, et as ExactProcessSpawnOptions, f as BatchResult, fi as StorageConfig, fn as ProcessInfo, fr as SandboxFleetPolicy, ft as FileTreeResult, g as BatchTaskResult, gi as TaskSessionChanges, gn as ProcessSignal, gr as SandboxFleetTraceExport, gt as FleetDispatchCancelResult, h as BatchTask, hi as TaskResult, hn as ProcessManager, hr as SandboxFleetTraceEvent, ht as FileWriteResult, i as AttachGpuLeaseOptions, ii as SessionMessageInputPart, in as NetworkConfig, ir as SandboxFleetIntelligenceEnvelope, it as FileReadBatchOptions, j as CreateSandboxFleetWithCoordinatorOptions, ji as UploadProgress, jn as ReapExpiredSandboxFleetsResult, jr as SandboxStatus, jt as GitConfig, k as CreateSandboxFleetOptions, ki as UpdateUserOptions, kn as PublishPublicTemplateVersionOptions, kr as SandboxResources, kt as GitBranch, l as BackendManager, ln as PreviewLinkInfo, lr as SandboxFleetManifest, lt as FileSystem, m as BatchRunRequest, mi as TaskOptions, mn as ProcessLogEntry, mr as SandboxFleetTraceBundle, mt as FileUsageResult, n as AccessPolicyRule, ni as SessionListOptions, nn as MintScopedTokenOptions, nr as SandboxFleetDriverTimings, nt as ExecResult, o as BackendCapabilities, oi as SnapshotInfo, on as NonHostAgentDriverConfig, or as SandboxFleetMachineMeteredUsage, ot as FileReadError, p as BatchRunOptions, pi as SubscriptionInfo, pn as ProcessListOptions, pr as SandboxFleetToken, pt as FileUsageOptions, q as EffectiveBackend, qi as BatchBackendStats, qn as SandboxConnection, qr as SecretInfo, qt as IntelligenceReportCompareTo, r as AddUserOptions, ri as SessionMessage, rn as MkdirOptions, rr as SandboxFleetInfo, rt as FileInfo, s as BackendConfig, si as SnapshotOptions, sn as PermissionLevel, sr as SandboxFleetMachineRecord, st as FileReadResult, t as AcceleratorKind, ti as SessionInfo, tn as McpServerConfig, tr as SandboxFleetDriverCapability, tt as ExecOptions, u as BackendStatus, ui as StartupDiagnostics, un as PreviewLinkManager, ur as SandboxFleetManifestMachine, ut as FileTreeFile, v as ChunkedUploadOptions, vi as TaskSessionFileChange, vn as ProcessStatus, vr as SandboxFleetUsage, vt as FleetDispatchResultBufferOptions, w as CommitTaskSessionOptions, wi as TeePublicKey, wn as ProvisionStatus, wr as SandboxInfo, wt as FleetMachineId, xi as TeeAttestationOptions, xn as PromptResult, xr as SandboxFleetWorkspaceRestoreResult, xt as FleetDriveTurnRequest, y as ChunkedUploadResult, yi as TaskSessionInfo, yn as PromptInputPart, yr as SandboxFleetWorkspace, yt as FleetDispatchStreamOptions, z as DispatchedSession, zi as TerminalExitInfo, zn as RolloutOptions, zr as SandboxTraceEvent, zt as GpuLeaseManager } from "./types-
|
|
2
|
-
import { A as SandboxMcpEndpoint, C as RespondToPermissionOptions, D as CONTROL_PLANE_MCP_SERVER_NAME, E as BuildSandboxMcpConfigOptions, M as buildControlPlaneMcpConfig, N as buildSandboxMcpConfig, O as SANDBOX_MCP_SERVER_NAME, S as InterruptResult, T as BuildControlPlaneMcpConfigOptions, _ as InteractiveAuthFile, a as WorkspaceImagePublishResult, b as InteractiveSessionInfo, c as TraceExportResult, d as exportTraceBundle, f as otelTraceIdForTangleTrace, g as InteractiveAttachOptions, h as SandboxSession, i as WorkspaceImagePublishRequestOptions, j as SandboxMcpServerEntry, k as SandboxMcpConfig, l as TraceExportSink, m as SandboxTaskSession, n as SandboxInstance, o as WorkspaceImages, p as toOtelJson, r as WorkspaceImagePublishInput, s as TraceExportFormat, u as buildTraceExportPayload, v as InteractiveSessionHandle, w as StartInteractiveOptions, x as InteractiveSessionStatus, y as InteractiveSessionHost } from "./sandbox-
|
|
3
|
-
import { a as Team, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, i as Sandbox, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet } from "./client-
|
|
1
|
+
import { $ as EventStreamOptions, $i as BackendType, $n as SandboxFleetDispatchFailureClass, $r as SessionEventStreamOptions, $t as ListSandboxFleetOptions, Ai as UploadOptions, An as ReapExpiredSandboxFleetsOptions, Ar as SandboxRuntimeHealth, At as GitCommit, B as DownloadOptions, Bi as TerminalReadyInfo, Bn as RolloutScorer, Br as SandboxTraceExport, Bt as GpuLeaseProviderName, Ci as TeeAttestationResponse, Cn as ProvisionResult, Cr as SandboxIdentity, D as CreateIntelligenceReportOptions, Di as TokenUsage, Dn as PublicTemplateVersionInfo, Dr as SandboxPortPreviewLink, Dt as GPU_LEASE_PROVIDER_NAMES, E as CreateGpuLeaseOptions, Ei as TokenRefreshHandler, En as PublicTemplateInfo, Er as SandboxPortBinding, F as DeleteOptions, Fi as WriteFileOptions, Fr as SandboxTerminalManager, Ft as GpuLeaseBilling, G as DriverType, Gi as TerminalStreamOptions, Gn as SSHCredentials, Gr as SearchMatch, Gt as IntelligenceReport, H as DriveTurnOptions, Hi as TerminalStreamAuthFormat, Hn as RolloutStatus, Hr as SandboxUser, Ht as HostAgentDriverConfig, I as DevServerInfo, Ii as WriteManyFile, Ir as SandboxTerminalRequestOptions, It as GpuLeaseCommandResult, J as EffectiveBackendProfile, Ji as BatchEvent, Jn as SandboxEnvironment, Jr as SecretsManager, Jt as IntelligenceReportSubjectType, Ki as TerminalStreamToken, Kn as SandboxConfig, Kr as SearchOptions, Kt as IntelligenceReportBudget, L as DirectoryPermission, Li as WriteManyOptions, Ln as Rollout, Lr as SandboxTerminals, Lt as GpuLeaseExecOptions, M as CreateSandboxOptions, Mi as UsageInfo, Mn as ReconcileSandboxFleetsOptions, Mr as SandboxTerminalAttachOptions, Mt as GitDiff, N as CreateSessionOptions, Ni as WaitForOptions, Nn as ReconcileSandboxFleetsResult, Nr as SandboxTerminalCreateOptions, Nt as GitStatus, O as CreateRequestOptions, Oi as TurnDriveResult, On as PublishPublicTemplateOptions, Or as SandboxResourceUsage, Ot as GitAuth, P as CreateTaskSessionOptions, Pi as WaitForRolloutOptions, Pn as RenameOptions, Pr as SandboxTerminalInfo, Pt as GpuLease, Q as EnsureDevServerOptions, Qi as PublicBatchRunRequest, Qn as SandboxFleetCostEstimate, Qr as SessionBackendCredentials, Qt as ListOptions, R as DispatchPromptOptions, Ri as TERMINAL_WS_ECHO_SUBPROTOCOL, Rn as RolloutChildResult, Rr as SandboxTraceBundle, Rt as GpuLeaseExecResult, Si as TeeAttestationReport, Sn as ProvisionEvent, Sr as SandboxFleetWorkspaceSnapshotResult, St as FleetExecDispatchOptions, T as CompletedTurnResult, Ti as TeePublicKeyResponse, Tn as ProvisionStep, Tr as SandboxIntelligenceEnvelope, Tt as FleetPromptDispatchOptions, U as DriverConfig, Ui as TerminalStreamError, Un as RolloutTurnPart, Ur as ScopedToken, Ut as HostAgentRuntimeBackend, V as DownloadProgress, Vi as TerminalStream, Vn as RolloutStartResult, Vr as SandboxTraceOptions, Vt as GpuLeaseStatus, W as DriverInfo, Wi as TerminalStreamHandlers, Wn as SSHCommandDescriptor, Wr as ScopedTokenScope, Wt as InstalledTool, X as EgressManager, Xi as BatchSidecarGroup, Xn as SandboxFleetArtifact, Xr as SendSessionMessageRequest, Y as EffectiveBackendSource, Yi as BatchEventDataMap, Yn as SandboxEvent, Yr as SendSessionMessageOptions, Yt as IntelligenceReportWindow, Z as EgressPolicy, Zi as BatchTaskUsage, Zn as SandboxFleetArtifactSpec, Zr as SentSessionMessage, Zt as ListMessagesOptions, _ as BranchOptions, _i as TaskSessionCommitResult, _n as ProcessSpawnOptions, _r as SandboxFleetTraceOptions, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, ai as SessionStatus, an as NetworkManager, ar as SandboxFleetMachine, at as FileReadBatchResult, bi as TaskSessionProfile, bn as PromptOptions, br as SandboxFleetWorkspaceReconcileResult, bt as FleetDriveTurnOutcome, c as BackendInfo, ci as SnapshotResult, cn as PermissionsManager, cr as SandboxFleetMachineSpec, ct as FileRenameResult, d as BatchBackend, di as StartupOperation, dn as Process, dr as SandboxFleetOperationsSummary, dt as FileTreeOptions, ei as SessionForkOptions, en as ListSandboxOptions, er as SandboxFleetDispatchResponse, et as ExactProcessSpawnOptions, f as BatchResult, fi as StorageConfig, fn as ProcessInfo, fr as SandboxFleetPolicy, ft as FileTreeResult, g as BatchTaskResult, gi as TaskSessionChanges, gn as ProcessSignal, gr as SandboxFleetTraceExport, gt as FleetDispatchCancelResult, h as BatchTask, hi as TaskResult, hn as ProcessManager, hr as SandboxFleetTraceEvent, ht as FileWriteResult, i as AttachGpuLeaseOptions, ii as SessionMessageInputPart, in as NetworkConfig, ir as SandboxFleetIntelligenceEnvelope, it as FileReadBatchOptions, j as CreateSandboxFleetWithCoordinatorOptions, ji as UploadProgress, jn as ReapExpiredSandboxFleetsResult, jr as SandboxStatus, jt as GitConfig, k as CreateSandboxFleetOptions, ki as UpdateUserOptions, kn as PublishPublicTemplateVersionOptions, kr as SandboxResources, kt as GitBranch, l as BackendManager, ln as PreviewLinkInfo, lr as SandboxFleetManifest, lt as FileSystem, m as BatchRunRequest, mi as TaskOptions, mn as ProcessLogEntry, mr as SandboxFleetTraceBundle, mt as FileUsageResult, n as AccessPolicyRule, ni as SessionListOptions, nn as MintScopedTokenOptions, nr as SandboxFleetDriverTimings, nt as ExecResult, o as BackendCapabilities, oi as SnapshotInfo, on as NonHostAgentDriverConfig, or as SandboxFleetMachineMeteredUsage, ot as FileReadError, p as BatchRunOptions, pi as SubscriptionInfo, pn as ProcessListOptions, pr as SandboxFleetToken, pt as FileUsageOptions, q as EffectiveBackend, qi as BatchBackendStats, qn as SandboxConnection, qr as SecretInfo, qt as IntelligenceReportCompareTo, r as AddUserOptions, ri as SessionMessage, rn as MkdirOptions, rr as SandboxFleetInfo, rt as FileInfo, s as BackendConfig, si as SnapshotOptions, sn as PermissionLevel, sr as SandboxFleetMachineRecord, st as FileReadResult, t as AcceleratorKind, ti as SessionInfo, tn as McpServerConfig, tr as SandboxFleetDriverCapability, tt as ExecOptions, u as BackendStatus, ui as StartupDiagnostics, un as PreviewLinkManager, ur as SandboxFleetManifestMachine, ut as FileTreeFile, v as ChunkedUploadOptions, vi as TaskSessionFileChange, vn as ProcessStatus, vr as SandboxFleetUsage, vt as FleetDispatchResultBufferOptions, w as CommitTaskSessionOptions, wi as TeePublicKey, wn as ProvisionStatus, wr as SandboxInfo, wt as FleetMachineId, xi as TeeAttestationOptions, xn as PromptResult, xr as SandboxFleetWorkspaceRestoreResult, xt as FleetDriveTurnRequest, y as ChunkedUploadResult, yi as TaskSessionInfo, yn as PromptInputPart, yr as SandboxFleetWorkspace, yt as FleetDispatchStreamOptions, z as DispatchedSession, zi as TerminalExitInfo, zn as RolloutOptions, zr as SandboxTraceEvent, zt as GpuLeaseManager } from "./types-Bj2gAOtW.js";
|
|
2
|
+
import { A as SandboxMcpEndpoint, C as RespondToPermissionOptions, D as CONTROL_PLANE_MCP_SERVER_NAME, E as BuildSandboxMcpConfigOptions, M as buildControlPlaneMcpConfig, N as buildSandboxMcpConfig, O as SANDBOX_MCP_SERVER_NAME, S as InterruptResult, T as BuildControlPlaneMcpConfigOptions, _ as InteractiveAuthFile, a as WorkspaceImagePublishResult, b as InteractiveSessionInfo, c as TraceExportResult, d as exportTraceBundle, f as otelTraceIdForTangleTrace, g as InteractiveAttachOptions, h as SandboxSession, i as WorkspaceImagePublishRequestOptions, j as SandboxMcpServerEntry, k as SandboxMcpConfig, l as TraceExportSink, m as SandboxTaskSession, n as SandboxInstance, o as WorkspaceImages, p as toOtelJson, r as WorkspaceImagePublishInput, s as TraceExportFormat, u as buildTraceExportPayload, v as InteractiveSessionHandle, w as StartInteractiveOptions, x as InteractiveSessionStatus, y as InteractiveSessionHost } from "./sandbox-sQlgHNQu.js";
|
|
3
|
+
import { a as Team, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, i as Sandbox, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet } from "./client-TMvNZgyy.js";
|
|
4
4
|
import { d as AnyTokenPayload, h as IssueCollaborationTokenOptions, m as CollaborationTokenPayload, p as CollaborationAccess } from "./index-DtRFVx5U.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-Cp1KYanB.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-BzMmpmqU.js";
|
|
7
|
-
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-
|
|
7
|
+
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-BdPCuaZM.js";
|
|
8
8
|
import * as _$_tangle_network_agent_interface0 from "@tangle-network/agent-interface";
|
|
9
9
|
import { AgentProfile, AgentProfile as AgentProfile$1, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileConnection, AgentProfileFileMount, AgentProfileFileMount as AgentProfileFileMount$1, AgentProfileMcpServer, AgentProfileModelHints, AgentProfilePermissionValue, AgentProfilePrompt, AgentProfileResourceRef, AgentProfileResources, AgentProfileSecurityPolicy, AgentProfileValidationIssue, AgentProfileValidationResult, AgentSubagentProfile, Capability, SANDBOX_SIZE_PRESET_NAMES, SandboxSizePreset } from "@tangle-network/agent-interface";
|
|
10
10
|
import { z } from "zod";
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as backendTypeSchema, p as normalizeRuntimeBackendConfig } from "./runtime-api-Bage44Xd.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-D9fFOWX9.js";
|
|
3
|
-
import { a as splitInlineProfileSkills, c as SandboxFleetClient, i as splitInlineProfileFileMounts, l as createBatchResultAccumulator, n as Sandbox, o as validateDeferredProfileFileMounts, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as validateBatchRunRequest } from "./client-
|
|
4
|
-
import { _ as otelTraceIdForTangleTrace, a as TERMINAL_WS_ECHO_SUBPROTOCOL, c as SandboxTaskSession, d as applySandboxEventText, f as collectAgentResponseText, g as exportTraceBundle, h as buildTraceExportPayload, i as WorkspaceImages, l as SandboxSession, o as TerminalStream, p as getSandboxEventText, s as TerminalStreamError, t as SandboxInstance, u as InteractiveSessionHandle, v as toOtelJson, y as parseSSEStream } from "./sandbox-
|
|
3
|
+
import { a as splitInlineProfileSkills, c as SandboxFleetClient, i as splitInlineProfileFileMounts, l as createBatchResultAccumulator, n as Sandbox, o as validateDeferredProfileFileMounts, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as validateBatchRunRequest } from "./client-BiZ9-TqN.js";
|
|
4
|
+
import { _ as otelTraceIdForTangleTrace, a as TERMINAL_WS_ECHO_SUBPROTOCOL, c as SandboxTaskSession, d as applySandboxEventText, f as collectAgentResponseText, g as exportTraceBundle, h as buildTraceExportPayload, i as WorkspaceImages, l as SandboxSession, o as TerminalStream, p as getSandboxEventText, s as TerminalStreamError, t as SandboxInstance, u as InteractiveSessionHandle, v as toOtelJson, y as parseSSEStream } from "./sandbox-hSaxYyWo.js";
|
|
5
5
|
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-DdD_rFZQ.js";
|
|
6
|
-
import { t as TangleSandboxClient } from "./tangle-
|
|
6
|
+
import { t as TangleSandboxClient } from "./tangle-DsQLgyfb.js";
|
|
7
7
|
import { SANDBOX_SIZE_PRESET_NAMES, agentProfileConfidentialSchema, agentProfileSchema } from "@tangle-network/agent-interface";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
//#region src/confidential.ts
|
|
@@ -394,6 +394,23 @@ async function uploadChunked(transport, remotePath, data, options = {}) {
|
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
//#endregion
|
|
397
|
+
//#region src/lib/session-id.ts
|
|
398
|
+
const SESSION_ID_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
399
|
+
function assertValidSessionId(value) {
|
|
400
|
+
if (typeof value !== "string" || !SESSION_ID_PATTERN.test(value)) throw new ValidationError(`Invalid sessionId ${typeof value === "string" ? JSON.stringify(value) : `of type ${typeof value}`}: must match ${SESSION_ID_PATTERN.source}`);
|
|
401
|
+
}
|
|
402
|
+
function sessionHeaders(sessionId) {
|
|
403
|
+
if (sessionId === void 0) return void 0;
|
|
404
|
+
assertValidSessionId(sessionId);
|
|
405
|
+
return { "X-Session-Id": sessionId };
|
|
406
|
+
}
|
|
407
|
+
function appendSessionIdQuery(params, sessionId) {
|
|
408
|
+
if (sessionId === void 0) return false;
|
|
409
|
+
assertValidSessionId(sessionId);
|
|
410
|
+
params.set("sessionId", sessionId);
|
|
411
|
+
return true;
|
|
412
|
+
}
|
|
413
|
+
//#endregion
|
|
397
414
|
//#region src/runtime-api.ts
|
|
398
415
|
/** Internal typed client for routes served by a sandbox runtime. */
|
|
399
416
|
var SandboxRuntimeApi = class {
|
|
@@ -416,6 +433,8 @@ var SandboxRuntimeApi = class {
|
|
|
416
433
|
return (await this.json("/ports", { method: "GET" })).data?.ports ?? [];
|
|
417
434
|
}
|
|
418
435
|
async readFiles(paths, options = {}) {
|
|
436
|
+
const params = new URLSearchParams();
|
|
437
|
+
appendSessionIdQuery(params, options.sessionId);
|
|
419
438
|
if (paths.length === 0) return {
|
|
420
439
|
files: [],
|
|
421
440
|
errors: [],
|
|
@@ -425,6 +444,7 @@ var SandboxRuntimeApi = class {
|
|
|
425
444
|
failed: 0
|
|
426
445
|
}
|
|
427
446
|
};
|
|
447
|
+
const query = params.toString();
|
|
428
448
|
await this.transport.ensureRunning();
|
|
429
449
|
const files = [];
|
|
430
450
|
const errors = [];
|
|
@@ -433,9 +453,6 @@ var SandboxRuntimeApi = class {
|
|
|
433
453
|
let failed = 0;
|
|
434
454
|
for (let offset = 0; offset < paths.length; offset += 100) {
|
|
435
455
|
const chunk = paths.slice(offset, offset + 100);
|
|
436
|
-
const params = new URLSearchParams();
|
|
437
|
-
if (options.sessionId) params.set("sessionId", options.sessionId);
|
|
438
|
-
const query = params.toString();
|
|
439
456
|
const payload = await this.json(`/files/read-batch${query ? `?${query}` : ""}`, {
|
|
440
457
|
method: "POST",
|
|
441
458
|
body: JSON.stringify({
|
|
@@ -472,10 +489,10 @@ var SandboxRuntimeApi = class {
|
|
|
472
489
|
};
|
|
473
490
|
}
|
|
474
491
|
async writeFile(path, content, options = {}) {
|
|
475
|
-
await this.transport.ensureRunning();
|
|
476
492
|
const params = new URLSearchParams();
|
|
477
|
-
|
|
493
|
+
appendSessionIdQuery(params, options.sessionId);
|
|
478
494
|
const query = params.toString();
|
|
495
|
+
await this.transport.ensureRunning();
|
|
479
496
|
return (await this.json(`/files/write${query ? `?${query}` : ""}`, {
|
|
480
497
|
method: "POST",
|
|
481
498
|
body: JSON.stringify({
|
|
@@ -506,20 +523,20 @@ var SandboxRuntimeApi = class {
|
|
|
506
523
|
return uploadChunked({ fetch: (path, init) => this.transport.fetch(path, init) }, remotePath, data, options);
|
|
507
524
|
}
|
|
508
525
|
async deleteFile(path, options = {}) {
|
|
509
|
-
await this.transport.ensureRunning();
|
|
510
526
|
const params = new URLSearchParams();
|
|
511
|
-
|
|
527
|
+
appendSessionIdQuery(params, options.sessionId);
|
|
512
528
|
const query = params.toString();
|
|
529
|
+
await this.transport.ensureRunning();
|
|
513
530
|
await this.request(`/files/delete${query ? `?${query}` : ""}`, {
|
|
514
531
|
method: "POST",
|
|
515
532
|
body: JSON.stringify({ path })
|
|
516
533
|
});
|
|
517
534
|
}
|
|
518
535
|
async renameFile(sourcePath, destinationPath, options = {}) {
|
|
519
|
-
await this.transport.ensureRunning();
|
|
520
536
|
const params = new URLSearchParams();
|
|
521
|
-
|
|
537
|
+
appendSessionIdQuery(params, options.sessionId);
|
|
522
538
|
const query = params.toString();
|
|
539
|
+
await this.transport.ensureRunning();
|
|
523
540
|
return (await this.json(`/files/rename${query ? `?${query}` : ""}`, {
|
|
524
541
|
method: "POST",
|
|
525
542
|
body: JSON.stringify({
|
|
@@ -530,16 +547,16 @@ var SandboxRuntimeApi = class {
|
|
|
530
547
|
}
|
|
531
548
|
async fileTree(path, options = {}) {
|
|
532
549
|
if (options.maxDepth !== void 0 && (!Number.isInteger(options.maxDepth) || options.maxDepth < 1 || options.maxDepth > 20)) throw new ValidationError("maxDepth must be an integer between 1 and 20");
|
|
533
|
-
await this.transport.ensureRunning();
|
|
534
550
|
const params = new URLSearchParams({ path });
|
|
535
551
|
if (options.maxDepth !== void 0) params.set("maxDepth", String(options.maxDepth));
|
|
536
|
-
|
|
552
|
+
appendSessionIdQuery(params, options.sessionId);
|
|
553
|
+
await this.transport.ensureRunning();
|
|
537
554
|
return (await this.json(`/files/tree?${params}`, { method: "GET" })).data;
|
|
538
555
|
}
|
|
539
556
|
async fileUsage(path, options = {}) {
|
|
540
|
-
await this.transport.ensureRunning();
|
|
541
557
|
const params = new URLSearchParams({ path });
|
|
542
|
-
|
|
558
|
+
appendSessionIdQuery(params, options.sessionId);
|
|
559
|
+
await this.transport.ensureRunning();
|
|
543
560
|
return (await this.json(`/files/usage?${params}`, { method: "GET" })).data;
|
|
544
561
|
}
|
|
545
562
|
async createSession(options) {
|
|
@@ -642,20 +659,20 @@ var SandboxRuntimeApi = class {
|
|
|
642
659
|
});
|
|
643
660
|
}
|
|
644
661
|
async createTerminal(options = {}, request = {}) {
|
|
645
|
-
await this.transport.ensureRunning();
|
|
646
662
|
const params = new URLSearchParams();
|
|
647
|
-
|
|
663
|
+
appendSessionIdQuery(params, request.sessionId);
|
|
648
664
|
const query = params.toString();
|
|
665
|
+
await this.transport.ensureRunning();
|
|
649
666
|
return (await this.json(`/terminals${query ? `?${query}` : ""}`, {
|
|
650
667
|
method: "POST",
|
|
651
668
|
body: JSON.stringify(options)
|
|
652
669
|
})).data;
|
|
653
670
|
}
|
|
654
671
|
async writeTerminal(terminalId, data, request = {}) {
|
|
655
|
-
await this.transport.ensureRunning();
|
|
656
672
|
const params = new URLSearchParams();
|
|
657
|
-
|
|
673
|
+
appendSessionIdQuery(params, request.sessionId);
|
|
658
674
|
const query = params.toString();
|
|
675
|
+
await this.transport.ensureRunning();
|
|
659
676
|
await this.request(`/terminals/${encodeURIComponent(terminalId)}/input${query ? `?${query}` : ""}`, {
|
|
660
677
|
method: "POST",
|
|
661
678
|
body: JSON.stringify({ data })
|
|
@@ -747,4 +764,4 @@ function normalizeSessionInfo(raw) {
|
|
|
747
764
|
};
|
|
748
765
|
}
|
|
749
766
|
//#endregion
|
|
750
|
-
export {
|
|
767
|
+
export { uploadChunked as a, combineAbortSignals as c, applyRequestedModel as d, assertCurrentBackendType as f, sessionHeaders as i, encodePromptForWire as l, backendTypeSchema as m, normalizeSessionInfo as n, SANDBOX_PROXY_REQUEST_MAX_BYTES as o, normalizeRuntimeBackendConfig as p, appendSessionIdQuery as r, FILE_DECODED_WRITE_MAX_BYTES as s, SandboxRuntimeApi as t, encodeTextForWire as u };
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Ar as SandboxRuntimeHealth, Er as SandboxPortBinding, Fi as WriteFileOptions, Fr as SandboxTerminalManager, Ir as SandboxTerminalRequestOptions, N as CreateSessionOptions, Nr as SandboxTerminalCreateOptions, P as CreateTaskSessionOptions, Pn as RenameOptions, Pr as SandboxTerminalInfo, Xr as SendSessionMessageRequest, Yr as SendSessionMessageOptions, Zr as SentSessionMessage, Zt as ListMessagesOptions, _i as TaskSessionCommitResult, at as FileReadBatchResult, ct as FileRenameResult, dt as FileTreeOptions, ft as FileTreeResult, gi as TaskSessionChanges, ht as FileWriteResult, it as FileReadBatchOptions, ji as UploadProgress, mt as FileUsageResult, pt as FileUsageOptions, ri as SessionMessage, ti as SessionInfo, v as ChunkedUploadOptions, w as CommitTaskSessionOptions, y as ChunkedUploadResult, yi as TaskSessionInfo } from "./types-
|
|
1
|
+
import { Ar as SandboxRuntimeHealth, Er as SandboxPortBinding, Fi as WriteFileOptions, Fr as SandboxTerminalManager, Ir as SandboxTerminalRequestOptions, N as CreateSessionOptions, Nr as SandboxTerminalCreateOptions, P as CreateTaskSessionOptions, Pn as RenameOptions, Pr as SandboxTerminalInfo, Xr as SendSessionMessageRequest, Yr as SendSessionMessageOptions, Zr as SentSessionMessage, Zt as ListMessagesOptions, _i as TaskSessionCommitResult, at as FileReadBatchResult, ct as FileRenameResult, dt as FileTreeOptions, ft as FileTreeResult, gi as TaskSessionChanges, ht as FileWriteResult, it as FileReadBatchOptions, ji as UploadProgress, mt as FileUsageResult, pt as FileUsageOptions, ri as SessionMessage, ti as SessionInfo, v as ChunkedUploadOptions, w as CommitTaskSessionOptions, y as ChunkedUploadResult, yi as TaskSessionInfo } from "./types-Bj2gAOtW.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-BzMmpmqU.js";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/chunked-upload.d.ts
|
package/dist/runtime.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as uploadChunked, c as combineAbortSignals, t as SandboxRuntimeApi } from "./runtime-api-Bage44Xd.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, s as QuotaError, t as AuthError, u as StateError } from "./errors-D9fFOWX9.js";
|
|
3
3
|
//#region src/runtime-client.ts
|
|
4
4
|
const DEFAULT_RUNTIME_TIMEOUT_MS = 3e4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as uploadChunked, c as combineAbortSignals, d as applyRequestedModel, f as assertCurrentBackendType, i as sessionHeaders, l as encodePromptForWire, n as normalizeSessionInfo, p as normalizeRuntimeBackendConfig, r as appendSessionIdQuery, t as SandboxRuntimeApi } from "./runtime-api-Bage44Xd.js";
|
|
2
2
|
import { a as NotFoundError, c as SandboxError, d as TimeoutError, f as ValidationError, i as NetworkError, l as ServerError, p as parseErrorResponse, s as QuotaError, t as AuthError, u as StateError } from "./errors-D9fFOWX9.js";
|
|
3
3
|
import { readTokenCostUsd, readTokenUsage } from "@tangle-network/agent-core";
|
|
4
4
|
//#region src/lib/sse-parser.ts
|
|
@@ -1272,10 +1272,6 @@ function normalizeStartupDiagnostics(raw) {
|
|
|
1272
1272
|
phases
|
|
1273
1273
|
};
|
|
1274
1274
|
}
|
|
1275
|
-
const SESSION_ID_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
1276
|
-
function assertValidSessionId(value) {
|
|
1277
|
-
if (!SESSION_ID_PATTERN.test(value)) throw new ValidationError(`Invalid sessionId ${JSON.stringify(value)}: must match ${SESSION_ID_PATTERN.source}`);
|
|
1278
|
-
}
|
|
1279
1275
|
/**
|
|
1280
1276
|
* Replace bearer-secret fields on a `SandboxConnection` with a sentinel
|
|
1281
1277
|
* before serialization. The serialized shape is preserved (so external
|
|
@@ -1938,11 +1934,10 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1938
1934
|
* Execute a command in the sandbox.
|
|
1939
1935
|
*/
|
|
1940
1936
|
async exec(command, options) {
|
|
1937
|
+
const headers = sessionHeaders(options?.sessionId);
|
|
1941
1938
|
await this.ensureRunning();
|
|
1942
1939
|
const timeoutMs = options?.timeoutMs ?? EXEC_DEFAULT_TIMEOUT_MS;
|
|
1943
1940
|
if (!Number.isInteger(timeoutMs) || timeoutMs < EXEC_MIN_TIMEOUT_MS || timeoutMs > EXEC_MAX_TIMEOUT_MS) throw new ValidationError(`exec timeoutMs must be an integer between ${EXEC_MIN_TIMEOUT_MS} and ${EXEC_MAX_TIMEOUT_MS}`);
|
|
1944
|
-
const headers = {};
|
|
1945
|
-
if (options?.sessionId) headers["X-Session-Id"] = options.sessionId;
|
|
1946
1941
|
const response = await this.runtimeFetch("/process/spawn", {
|
|
1947
1942
|
method: "POST",
|
|
1948
1943
|
headers,
|
|
@@ -1995,10 +1990,8 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1995
1990
|
* ```
|
|
1996
1991
|
*/
|
|
1997
1992
|
async runCode(language, source, options) {
|
|
1998
|
-
|
|
1993
|
+
const headers = sessionHeaders(options?.sessionId) ?? {};
|
|
1999
1994
|
await this.ensureRunning();
|
|
2000
|
-
const headers = {};
|
|
2001
|
-
if (options?.sessionId) headers["X-Session-Id"] = options.sessionId;
|
|
2002
1995
|
if (options?.idempotencyKey) headers["X-Idempotency-Key"] = options.idempotencyKey;
|
|
2003
1996
|
const response = await this.runtimeFetch("/code/exec", {
|
|
2004
1997
|
method: "POST",
|
|
@@ -2033,8 +2026,8 @@ var SandboxInstance = class SandboxInstance {
|
|
|
2033
2026
|
* ```
|
|
2034
2027
|
*/
|
|
2035
2028
|
async read(path, options) {
|
|
2029
|
+
const headers = sessionHeaders(options?.sessionId);
|
|
2036
2030
|
await this.ensureRunning();
|
|
2037
|
-
const headers = options?.sessionId ? { "X-Session-Id": options.sessionId } : void 0;
|
|
2038
2031
|
const response = await this.runtimeFetch("/files/read", {
|
|
2039
2032
|
method: "POST",
|
|
2040
2033
|
headers,
|
|
@@ -2063,9 +2056,9 @@ var SandboxInstance = class SandboxInstance {
|
|
|
2063
2056
|
* ```
|
|
2064
2057
|
*/
|
|
2065
2058
|
async write(path, content, options) {
|
|
2066
|
-
await this.ensureRunning();
|
|
2067
2059
|
const params = new URLSearchParams();
|
|
2068
|
-
|
|
2060
|
+
appendSessionIdQuery(params, options?.sessionId);
|
|
2061
|
+
await this.ensureRunning();
|
|
2069
2062
|
const query = params.toString();
|
|
2070
2063
|
const response = await this.runtimeFetch(`/files/write${query ? `?${query}` : ""}`, {
|
|
2071
2064
|
method: "POST",
|
|
@@ -3166,11 +3159,11 @@ var SandboxInstance = class SandboxInstance {
|
|
|
3166
3159
|
}
|
|
3167
3160
|
}
|
|
3168
3161
|
async fsList(path, options) {
|
|
3169
|
-
await this.ensureRunning();
|
|
3170
3162
|
const params = new URLSearchParams();
|
|
3171
3163
|
if (options?.all) params.set("all", "true");
|
|
3172
3164
|
if (options?.long) params.set("long", "true");
|
|
3173
|
-
|
|
3165
|
+
appendSessionIdQuery(params, options?.sessionId);
|
|
3166
|
+
await this.ensureRunning();
|
|
3174
3167
|
const query = params.toString();
|
|
3175
3168
|
const basePath = runtimeFilesystemPath("/fs/list", path);
|
|
3176
3169
|
const url = query ? `${basePath}?${query}` : basePath;
|
|
@@ -3216,9 +3209,11 @@ var SandboxInstance = class SandboxInstance {
|
|
|
3216
3209
|
};
|
|
3217
3210
|
}
|
|
3218
3211
|
async fsDelete(path, options) {
|
|
3212
|
+
const params = new URLSearchParams();
|
|
3213
|
+
if (options?.recursive) params.set("recursive", "true");
|
|
3214
|
+
const hasSessionScope = appendSessionIdQuery(params, options?.sessionId);
|
|
3219
3215
|
await this.ensureRunning();
|
|
3220
|
-
if (
|
|
3221
|
-
const params = new URLSearchParams({ sessionId: options.sessionId });
|
|
3216
|
+
if (hasSessionScope && !options?.recursive) {
|
|
3222
3217
|
const response = await this.runtimeFetch(`/files/delete?${params}`, {
|
|
3223
3218
|
method: "POST",
|
|
3224
3219
|
body: JSON.stringify({ path })
|
|
@@ -3229,9 +3224,6 @@ var SandboxInstance = class SandboxInstance {
|
|
|
3229
3224
|
}
|
|
3230
3225
|
return;
|
|
3231
3226
|
}
|
|
3232
|
-
const params = new URLSearchParams();
|
|
3233
|
-
if (options?.recursive) params.set("recursive", "true");
|
|
3234
|
-
if (options?.sessionId) params.set("sessionId", options.sessionId);
|
|
3235
3227
|
const query = params.toString();
|
|
3236
3228
|
const basePath = runtimeFilesystemPath("/fs", path);
|
|
3237
3229
|
const url = query ? `${basePath}?${query}` : basePath;
|
|
@@ -3654,10 +3646,9 @@ var SandboxInstance = class SandboxInstance {
|
|
|
3654
3646
|
};
|
|
3655
3647
|
}
|
|
3656
3648
|
async processEnsureDevServer(options) {
|
|
3657
|
-
|
|
3649
|
+
const headers = sessionHeaders(options?.sessionId);
|
|
3658
3650
|
if (options?.cwd !== void 0 && (typeof options.cwd !== "string" || options.cwd.trim().length === 0)) throw new ValidationError("Dev server cwd must be a non-empty string");
|
|
3659
3651
|
await this.ensureRunning();
|
|
3660
|
-
const headers = options?.sessionId ? { "X-Session-Id": options.sessionId } : void 0;
|
|
3661
3652
|
const response = await this.runtimeFetch("/process/ensure-dev-server", {
|
|
3662
3653
|
method: "POST",
|
|
3663
3654
|
headers,
|
|
@@ -3674,9 +3665,11 @@ var SandboxInstance = class SandboxInstance {
|
|
|
3674
3665
|
};
|
|
3675
3666
|
}
|
|
3676
3667
|
async processSpawn(command, options) {
|
|
3668
|
+
const headers = sessionHeaders(options?.sessionId);
|
|
3677
3669
|
await this.ensureRunning();
|
|
3678
3670
|
const response = await this.runtimeFetch("/process/spawn", {
|
|
3679
3671
|
method: "POST",
|
|
3672
|
+
headers,
|
|
3680
3673
|
body: JSON.stringify({
|
|
3681
3674
|
executable: "/bin/sh",
|
|
3682
3675
|
args: ["-lc", command],
|
|
@@ -3694,9 +3687,11 @@ var SandboxInstance = class SandboxInstance {
|
|
|
3694
3687
|
return this.createProcessHandle(data.data.pid, command);
|
|
3695
3688
|
}
|
|
3696
3689
|
async processSpawnExact(executable, args, options) {
|
|
3690
|
+
const headers = sessionHeaders(options?.sessionId);
|
|
3697
3691
|
await this.ensureRunning();
|
|
3698
3692
|
const response = await this.runtimeFetch("/process/spawn", {
|
|
3699
3693
|
method: "POST",
|
|
3694
|
+
headers,
|
|
3700
3695
|
body: JSON.stringify({
|
|
3701
3696
|
executable,
|
|
3702
3697
|
args,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as EventStreamOptions, $i as BackendType, $r as SessionEventStreamOptions, Ar as SandboxRuntimeHealth, At as GitCommit, Ci as TeeAttestationResponse, Cn as ProvisionResult, Er as SandboxPortBinding, Fi as WriteFileOptions, Fn as RestoreSnapshotOptions, Gn as SSHCredentials, Gr as SearchMatch, Gt as IntelligenceReport, H as DriveTurnOptions, Ii as WriteManyFile, In as ResumeOptions, K as DurablePlan, Kr as SearchOptions, Kt as IntelligenceReportBudget, Li as WriteManyOptions, Ln as Rollout, Lr as SandboxTerminals, Mr as SandboxTerminalAttachOptions, Mt as GitDiff, N as CreateSessionOptions, Ni as WaitForOptions, Nt as GitStatus, Oi as TurnDriveResult, Or as SandboxResourceUsage, P as CreateTaskSessionOptions, Pi as WaitForRolloutOptions, Pt as GpuLease, R as DispatchPromptOptions, Rr as SandboxTraceBundle, S as CodeLanguage, Sn as ProvisionEvent, T as CompletedTurnResult, Ti as TeePublicKeyResponse, Ur as ScopedToken, Vi as TerminalStream, Vn as RolloutStartResult, Vr as SandboxTraceOptions, W as DriverInfo, Wi as TerminalStreamHandlers, Wn as SSHCommandDescriptor, Wt as InstalledTool, X as EgressManager, Xr as SendSessionMessageRequest, Xt as JsonValue, Yn as SandboxEvent, Yr as SendSessionMessageOptions, Yt as IntelligenceReportWindow, Zr as SentSessionMessage, Zt as ListMessagesOptions, _ as BranchOptions, _i as TaskSessionCommitResult, an as NetworkManager, b as CodeExecutionOptions, bn as PromptOptions, ci as SnapshotResult, cn as PermissionsManager, ei as SessionForkOptions, gi as TaskSessionChanges, hn as ProcessManager, ht as FileWriteResult, jr as SandboxStatus, kt as GitBranch, l as BackendManager, lt as FileSystem, mr as SandboxFleetTraceBundle, ni as SessionListOptions, nn as MintScopedTokenOptions, nt as ExecResult, oi as SnapshotInfo, qn as SandboxConnection, qt as IntelligenceReportCompareTo, ri as SessionMessage, s as BackendConfig, si as SnapshotOptions, ti as SessionInfo, tt as ExecOptions, ui as StartupDiagnostics, un as PreviewLinkManager, w as CommitTaskSessionOptions, wr as SandboxInfo, x as CodeExecutionResult, xi as TeeAttestationOptions, xn as PromptResult, yi as TaskSessionInfo, yn as PromptInputPart, z as DispatchedSession, zn as RolloutOptions, zt as GpuLeaseManager } from "./types-
|
|
1
|
+
import { $ as EventStreamOptions, $i as BackendType, $r as SessionEventStreamOptions, Ar as SandboxRuntimeHealth, At as GitCommit, Ci as TeeAttestationResponse, Cn as ProvisionResult, Er as SandboxPortBinding, Fi as WriteFileOptions, Fn as RestoreSnapshotOptions, Gn as SSHCredentials, Gr as SearchMatch, Gt as IntelligenceReport, H as DriveTurnOptions, Ii as WriteManyFile, In as ResumeOptions, K as DurablePlan, Kr as SearchOptions, Kt as IntelligenceReportBudget, Li as WriteManyOptions, Ln as Rollout, Lr as SandboxTerminals, Mr as SandboxTerminalAttachOptions, Mt as GitDiff, N as CreateSessionOptions, Ni as WaitForOptions, Nt as GitStatus, Oi as TurnDriveResult, Or as SandboxResourceUsage, P as CreateTaskSessionOptions, Pi as WaitForRolloutOptions, Pt as GpuLease, R as DispatchPromptOptions, Rr as SandboxTraceBundle, S as CodeLanguage, Sn as ProvisionEvent, T as CompletedTurnResult, Ti as TeePublicKeyResponse, Ur as ScopedToken, Vi as TerminalStream, Vn as RolloutStartResult, Vr as SandboxTraceOptions, W as DriverInfo, Wi as TerminalStreamHandlers, Wn as SSHCommandDescriptor, Wt as InstalledTool, X as EgressManager, Xr as SendSessionMessageRequest, Xt as JsonValue, Yn as SandboxEvent, Yr as SendSessionMessageOptions, Yt as IntelligenceReportWindow, Zr as SentSessionMessage, Zt as ListMessagesOptions, _ as BranchOptions, _i as TaskSessionCommitResult, an as NetworkManager, b as CodeExecutionOptions, bn as PromptOptions, ci as SnapshotResult, cn as PermissionsManager, ei as SessionForkOptions, gi as TaskSessionChanges, hn as ProcessManager, ht as FileWriteResult, jr as SandboxStatus, kt as GitBranch, l as BackendManager, lt as FileSystem, mr as SandboxFleetTraceBundle, ni as SessionListOptions, nn as MintScopedTokenOptions, nt as ExecResult, oi as SnapshotInfo, qn as SandboxConnection, qt as IntelligenceReportCompareTo, ri as SessionMessage, s as BackendConfig, si as SnapshotOptions, ti as SessionInfo, tt as ExecOptions, ui as StartupDiagnostics, un as PreviewLinkManager, w as CommitTaskSessionOptions, wr as SandboxInfo, x as CodeExecutionResult, xi as TeeAttestationOptions, xn as PromptResult, yi as TaskSessionInfo, yn as PromptInputPart, z as DispatchedSession, zn as RolloutOptions, zt as GpuLeaseManager } from "./types-Bj2gAOtW.js";
|
|
2
2
|
import { AgentProfile } from "@tangle-network/agent-interface";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
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-BdPCuaZM.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-DsQLgyfb.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-D9fFOWX9.js";
|
|
2
|
-
import { n as createSandboxInstanceFromResponse } from "./sandbox-
|
|
2
|
+
import { n as createSandboxInstanceFromResponse } from "./sandbox-hSaxYyWo.js";
|
|
3
3
|
//#region src/tangle/abi.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tangle Contract ABI Definitions
|
|
@@ -5047,6 +5047,8 @@ interface BackendManager {
|
|
|
5047
5047
|
* ```
|
|
5048
5048
|
*/
|
|
5049
5049
|
interface ProcessSpawnOptions {
|
|
5050
|
+
/** Agent session whose workspace the process should use. */
|
|
5051
|
+
sessionId?: string;
|
|
5050
5052
|
/** Working directory for the process */
|
|
5051
5053
|
cwd?: string;
|
|
5052
5054
|
/** Environment variables to set */
|
|
@@ -5271,7 +5273,7 @@ interface ProcessManager {
|
|
|
5271
5273
|
* Returns immediately with a Process handle.
|
|
5272
5274
|
*
|
|
5273
5275
|
* @param command - Shell command to execute
|
|
5274
|
-
* @param options - Spawn options (cwd, env, timeout)
|
|
5276
|
+
* @param options - Spawn options (sessionId, cwd, env, timeout)
|
|
5275
5277
|
* @returns Process handle for control and monitoring
|
|
5276
5278
|
*/
|
|
5277
5279
|
spawn(command: string, options?: ProcessSpawnOptions): Promise<Process>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.3-develop.20260729104309.c4a5aa8",
|
|
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",
|