@tangle-network/sandbox 0.19.1-develop.20260804130818.010a6de → 0.19.1-develop.20260804211932.592adfa
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 +1 -1
- package/dist/{client-CAaISfcc.d.ts → client-DbalFqjR.d.ts} +10 -0
- package/dist/{client-jlWtzNDF.js → client-Ex8BbE6N.js} +31 -2
- package/dist/core.d.ts +1 -1
- package/dist/core.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { C as CodeResultPart, S as CodeLanguage, b as CodeExecutionOptions, x as CodeExecutionResult } from "../types-BSXWeu-Q.js";
|
|
2
2
|
import { n as SandboxInstance } from "../sandbox-BHA5uUjk.js";
|
|
3
|
-
import { i as Sandbox } from "../client-
|
|
3
|
+
import { i as Sandbox } from "../client-DbalFqjR.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
|
|
@@ -252,6 +252,16 @@ declare class Sandbox implements HttpClient {
|
|
|
252
252
|
private readonly apiKey;
|
|
253
253
|
private readonly timeoutMs;
|
|
254
254
|
private readonly trustLocalCliAuth;
|
|
255
|
+
/**
|
|
256
|
+
* Last auth accelerator token handed back by the API, echoed on the
|
|
257
|
+
* next request so the server can skip re-verifying `apiKey` against the
|
|
258
|
+
* platform. See {@link AUTH_ACCELERATOR_HEADER}.
|
|
259
|
+
*
|
|
260
|
+
* Held only in memory for this client's lifetime and never persisted:
|
|
261
|
+
* it is short-lived, and it is bound server-side to `apiKey`, so it is
|
|
262
|
+
* useless to anyone who does not already hold the key.
|
|
263
|
+
*/
|
|
264
|
+
private authAcceleratorToken;
|
|
255
265
|
private _secrets;
|
|
256
266
|
private _sshKeys;
|
|
257
267
|
private _fleets;
|
|
@@ -2273,6 +2273,21 @@ async function broadcastSessionAgentEvent(client, sessionId, event) {
|
|
|
2273
2273
|
}
|
|
2274
2274
|
//#endregion
|
|
2275
2275
|
//#region src/client.ts
|
|
2276
|
+
/**
|
|
2277
|
+
* Auth accelerator header. The API returns a short-lived signed token on
|
|
2278
|
+
* any request it authenticated by verifying the API key against the
|
|
2279
|
+
* platform; echoing that token on later requests lets the API re-establish
|
|
2280
|
+
* the same identity with an in-process signature check instead of a
|
|
2281
|
+
* cross-region round trip to id.tangle.tools (measured at ~240ms median
|
|
2282
|
+
* per verification, so a multi-call operation pays it once instead of once
|
|
2283
|
+
* per call).
|
|
2284
|
+
*
|
|
2285
|
+
* Same name in both directions so a client can blindly forward the last
|
|
2286
|
+
* value it saw. The token is bound server-side to the API key it was
|
|
2287
|
+
* minted for and expires in ~60s, so holding one grants nothing on its own
|
|
2288
|
+
* and never widens what the key can reach.
|
|
2289
|
+
*/
|
|
2290
|
+
const AUTH_ACCELERATOR_HEADER = "X-Sandbox-Auth-Token";
|
|
2276
2291
|
const DEFAULT_TIMEOUT_MS = 3e4;
|
|
2277
2292
|
/**
|
|
2278
2293
|
* Default time budget for `create()` — the full create-and-reach-running
|
|
@@ -2411,6 +2426,16 @@ var Sandbox = class {
|
|
|
2411
2426
|
apiKey;
|
|
2412
2427
|
timeoutMs;
|
|
2413
2428
|
trustLocalCliAuth;
|
|
2429
|
+
/**
|
|
2430
|
+
* Last auth accelerator token handed back by the API, echoed on the
|
|
2431
|
+
* next request so the server can skip re-verifying `apiKey` against the
|
|
2432
|
+
* platform. See {@link AUTH_ACCELERATOR_HEADER}.
|
|
2433
|
+
*
|
|
2434
|
+
* Held only in memory for this client's lifetime and never persisted:
|
|
2435
|
+
* it is short-lived, and it is bound server-side to `apiKey`, so it is
|
|
2436
|
+
* useless to anyone who does not already hold the key.
|
|
2437
|
+
*/
|
|
2438
|
+
authAcceleratorToken = null;
|
|
2414
2439
|
_secrets = null;
|
|
2415
2440
|
_sshKeys = null;
|
|
2416
2441
|
_fleets = null;
|
|
@@ -3039,13 +3064,17 @@ var Sandbox = class {
|
|
|
3039
3064
|
try {
|
|
3040
3065
|
const headers = new Headers(options?.headers);
|
|
3041
3066
|
headers.set("Authorization", `Bearer ${this.apiKey}`);
|
|
3067
|
+
if (this.authAcceleratorToken) headers.set(AUTH_ACCELERATOR_HEADER, this.authAcceleratorToken);
|
|
3042
3068
|
const isFormDataBody = typeof FormData !== "undefined" && options?.body instanceof FormData;
|
|
3043
3069
|
if (!headers.has("Content-Type") && !isFormDataBody) headers.set("Content-Type", "application/json");
|
|
3044
|
-
|
|
3070
|
+
const response = await globalThis.fetch(url, {
|
|
3045
3071
|
...options,
|
|
3046
3072
|
headers,
|
|
3047
3073
|
signal: options?.signal ?? controller.signal
|
|
3048
|
-
})
|
|
3074
|
+
});
|
|
3075
|
+
const refreshed = response.headers.get(AUTH_ACCELERATOR_HEADER);
|
|
3076
|
+
if (refreshed) this.authAcceleratorToken = refreshed;
|
|
3077
|
+
return withRequestContextHeaders(response, path, options?.method);
|
|
3049
3078
|
} catch (err) {
|
|
3050
3079
|
if (err instanceof Error && err.name === "AbortError") throw new TimeoutError(requestTimeoutMs);
|
|
3051
3080
|
throw new NetworkError(`Failed to connect to Sandbox API: ${err instanceof Error ? err.message : String(err)}`, err instanceof Error ? err : void 0, {
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { M as CreateSandboxOptions, Mr as SandboxStatus, Tr as SandboxInfo, bn as PromptInputPart, dn as PreviewLinkWaitOptions, in as NetworkConfig, ln as PreviewLinkInfo, nt as ExecResult, qn as SandboxConfig, tt as ExecOptions, un as PreviewLinkManager } from "./types-BSXWeu-Q.js";
|
|
2
2
|
import { a as WorkspaceImagePublishResult, i as WorkspaceImagePublishRequestOptions, n as SandboxInstance, o as WorkspaceImages, r as WorkspaceImagePublishInput } from "./sandbox-BHA5uUjk.js";
|
|
3
|
-
import { i as Sandbox } from "./client-
|
|
3
|
+
import { i as Sandbox } from "./client-DbalFqjR.js";
|
|
4
4
|
import { a as NetworkError, c as QuotaError, d as SandboxFailureDetail, f as ServerError, h as ValidationError, i as FileWriteConflictError, l as SandboxError, m as TimeoutError, n as CapabilityError, o as NotFoundError, p as StateError, s as PartialFailureError, t as AuthError, u as SandboxErrorJson } from "./errors-Bdy5jXzc.js";
|
|
5
5
|
export { AuthError, CapabilityError, type CreateSandboxOptions, type ExecOptions, type ExecResult, FileWriteConflictError, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, type PreviewLinkWaitOptions, type PromptInputPart, QuotaError, Sandbox, type SandboxConfig, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, StateError, TimeoutError, ValidationError, type WorkspaceImagePublishInput, type WorkspaceImagePublishRequestOptions, type WorkspaceImagePublishResult, WorkspaceImages };
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { a as NetworkError, c as QuotaError, d as StateError, f as TimeoutError, i as FileWriteConflictError, l as SandboxError, n as CapabilityError, o as NotFoundError, p as ValidationError, s as PartialFailureError, t as AuthError, u as ServerError } from "./errors-Bf-A-4SA.js";
|
|
2
|
-
import { n as Sandbox } from "./client-
|
|
2
|
+
import { n as Sandbox } from "./client-Ex8BbE6N.js";
|
|
3
3
|
import { i as WorkspaceImages, t as SandboxInstance } from "./sandbox-DQ1yf_nX.js";
|
|
4
4
|
export { AuthError, CapabilityError, FileWriteConflictError, NetworkError, NotFoundError, PartialFailureError, QuotaError, Sandbox, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { $ as EventStreamOptions, $i as PublicBatchRunRequest, $n as SandboxFleetCostEstimate, $r as SessionBackendCredentials, $t as ListSandboxFleetOptions, Ai as UpdateUserOptions, An as PublishPublicTemplateVersionOptions, Ar as SandboxResources, At as GitCommit, B as DownloadOptions, Bi as TerminalExitInfo, Bn as RolloutOptions, Br as SandboxTraceEvent, Bt as GpuLeaseProviderName, Ci as TeeAttestationReport, Cn as ProvisionEvent, Cr as SandboxFleetWorkspaceSnapshotResult, D as CreateIntelligenceReportOptions, Di as TokenRefreshHandler, Dn as PublicTemplateInfo, Dr as SandboxPortBinding, Dt as GPU_LEASE_PROVIDER_NAMES, E as CreateGpuLeaseOptions, Ei as TeePublicKeyResponse, En as ProvisionStep, Er as SandboxIntelligenceEnvelope, F as DeleteOptions, Fi as WaitForRolloutOptions, Fn as RenameOptions, Fr as SandboxTerminalInfo, Ft as GpuLeaseBilling, G as DriverType, Gi as TerminalStreamHandlers, Gn as SSHCommandDescriptor, Gr as ScopedTokenScope, Gt as IntelligenceReport, H as DriveTurnOptions, Hi as TerminalStream, Hn as RolloutStartResult, Hr as SandboxTraceOptions, Ht as HostAgentDriverConfig, I as DevServerInfo, Ii as WriteFileOptions, Ir as SandboxTerminalManager, It as GpuLeaseCommandResult, J as EffectiveBackendProfile, Ji as BatchBackendStats, Jn as SandboxConnection, Jr as SecretInfo, Jt as IntelligenceReportSubjectType, Ki as TerminalStreamOptions, Kn as SSHCredentials, Kr as SearchMatch, Kt as IntelligenceReportBudget, L as DirectoryPermission, Li as WriteManyFile, Lr as SandboxTerminalRequestOptions, Lt as GpuLeaseExecOptions, M as CreateSandboxOptions, Mi as UploadProgress, Mn as ReapExpiredSandboxFleetsResult, Mr as SandboxStatus, Mt as GitDiff, N as CreateSessionOptions, Ni as UsageInfo, Nn as ReconcileSandboxFleetsOptions, Nr as SandboxTerminalAttachOptions, Nt as GitStatus, O as CreateRequestOptions, Oi as TokenUsage, On as PublicTemplateVersionInfo, Or as SandboxPortPreviewLink, Ot as GitAuth, P as CreateTaskSessionOptions, Pi as WaitForOptions, Pn as ReconcileSandboxFleetsResult, Pr as SandboxTerminalCreateOptions, Pt as GpuLease, Q as EnsureDevServerOptions, Qi as BatchTaskUsage, Qn as SandboxFleetArtifactSpec, Qr as SentSessionMessage, Qt as ListOptions, R as DispatchPromptOptions, Ri as WriteManyOptions, Rn as Rollout, Rr as SandboxTerminals, Rt as GpuLeaseExecResult, Si as TeeAttestationOptions, Sn as PromptResult, Sr as SandboxFleetWorkspaceRestoreResult, St as FleetExecDispatchOptions, T as CompletedTurnResult, Ti as TeePublicKey, Tn as ProvisionStatus, Tr as SandboxInfo, Tt as FleetPromptDispatchOptions, U as DriverConfig, Ui as TerminalStreamAuthFormat, Un as RolloutStatus, Ur as SandboxUser, Ut as HostAgentRuntimeBackend, V as DownloadProgress, Vi as TerminalReadyInfo, Vn as RolloutScorer, Vr as SandboxTraceExport, Vt as GpuLeaseStatus, W as DriverInfo, Wi as TerminalStreamError, Wn as RolloutTurnPart, Wr as ScopedToken, Wt as InstalledTool, X as EgressManager, Xi as BatchEventDataMap, Xn as SandboxEvent, Xr as SendSessionMessageOptions, Y as EffectiveBackendSource, Yi as BatchEvent, Yn as SandboxEnvironment, Yr as SecretsManager, Yt as IntelligenceReportWindow, Z as EgressPolicy, Zi as BatchSidecarGroup, Zn as SandboxFleetArtifact, Zr as SendSessionMessageRequest, Zt as ListMessagesOptions, _ as BranchOptions, _i as TaskSessionChanges, _n as ProcessSignal, _r as SandboxFleetTraceExport, _t as FleetDispatchResultBuffer, a as AttachSandboxFleetMachineOptions, ai as SessionMessage, an as NetworkManager, ar as SandboxFleetIntelligenceEnvelope, at as FileReadBatchResult, bi as TaskSessionInfo, bn as PromptInputPart, br as SandboxFleetWorkspace, bt as FleetDriveTurnOutcome, c as BackendInfo, ci as SessionStatus, cn as PermissionsManager, cr as SandboxFleetMachineRecord, ct as FileRenameResult, d as BatchBackend, di as SnapshotResult, dn as PreviewLinkWaitOptions, dr as SandboxFleetManifestMachine, dt as FileTreeOptions, ea as BackendType, ei as SessionEventStreamOptions, en as ListSandboxOptions, er as SandboxFleetDispatchFailureClass, et as ExactProcessSpawnOptions, f as BatchResult, fn as Process, fr as SandboxFleetOperationsSummary, ft as FileTreeResult, g as BatchTaskResult, gi as SubscriptionInfo, gn as ProcessManager, gr as SandboxFleetTraceEvent, gt as FleetDispatchCancelResult, h as BatchTask, hi as StorageConfig, hn as ProcessLogEntry, hr as SandboxFleetTraceBundle, ht as FileWriteResult, i as AttachGpuLeaseOptions, ii as SessionListOptions, in as NetworkConfig, ir as SandboxFleetInfo, it as FileReadBatchOptions, j as CreateSandboxFleetWithCoordinatorOptions, ji as UploadOptions, jn as ReapExpiredSandboxFleetsOptions, jr as SandboxRuntimeHealth, jt as GitConfig, k as CreateSandboxFleetOptions, ki as TurnDriveResult, kn as PublishPublicTemplateOptions, kr as SandboxResourceUsage, kt as GitBranch, l as BackendManager, li as SnapshotInfo, ln as PreviewLinkInfo, lr as SandboxFleetMachineSpec, lt as FileSystem, m as BatchRunRequest, mi as StartupOperation, mn as ProcessListOptions, mr as SandboxFleetToken, mt as FileUsageResult, n as AccessPolicyRule, ni as SessionInfo, nn as MintScopedTokenOptions, nr as SandboxFleetDriverCapability, nt as ExecResult, o as BackendCapabilities, oi as SessionMessageInputPart, on as NonHostAgentDriverConfig, or as SandboxFleetMachine, ot as FileReadError, p as BatchRunOptions, pi as StartupDiagnostics, pn as ProcessInfo, pr as SandboxFleetPolicy, pt as FileUsageOptions, q as EffectiveBackend, qi as TerminalStreamToken, qn as SandboxConfig, qr as SearchOptions, qt as IntelligenceReportCompareTo, r as AddUserOptions, ri as SessionInterruptOptions, rn as MkdirOptions, rr as SandboxFleetDriverTimings, rt as FileInfo, s as BackendConfig, si as SessionResultOptions, sn as PermissionLevel, sr as SandboxFleetMachineMeteredUsage, st as FileReadResult, t as AcceleratorKind, ta as parseBackendType, ti as SessionForkOptions, tn as McpServerConfig, tr as SandboxFleetDispatchResponse, tt as ExecOptions, u as BackendStatus, ui as SnapshotOptions, un as PreviewLinkManager, ur as SandboxFleetManifest, ut as FileTreeFile, v as ChunkedUploadOptions, vi as TaskSessionCommitResult, vn as ProcessSpawnOptions, vr as SandboxFleetTraceOptions, vt as FleetDispatchResultBufferOptions, w as CommitTaskSessionOptions, wi as TeeAttestationResponse, wn as ProvisionResult, wr as SandboxIdentity, wt as FleetMachineId, xi as TaskSessionProfile, xn as PromptOptions, xr as SandboxFleetWorkspaceReconcileResult, xt as FleetDriveTurnRequest, y as ChunkedUploadResult, yi as TaskSessionFileChange, yn as ProcessStatus, yr as SandboxFleetUsage, yt as FleetDispatchStreamOptions, z as DispatchedSession, zi as TERMINAL_WS_ECHO_SUBPROTOCOL, zn as RolloutChildResult, zr as SandboxTraceBundle, zt as GpuLeaseManager } from "./types-BSXWeu-Q.js";
|
|
2
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-BHA5uUjk.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-
|
|
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-DbalFqjR.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 NetworkError, c as QuotaError, d as SandboxFailureDetail, f as ServerError, h as ValidationError, i as FileWriteConflictError, l as SandboxError, m as TimeoutError, n as CapabilityError, o as NotFoundError, p as StateError, r as EgressProxyRecoveryError, s as PartialFailureError, t as AuthError, u as SandboxErrorJson } from "./errors-Bdy5jXzc.js";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h as parseBackendType, m as backendTypeSchema, p as normalizeRuntimeBackendConfig } from "./runtime-api-BRQkJnW4.js";
|
|
2
2
|
import { a as NetworkError, c as QuotaError, d as StateError, f as TimeoutError, i as FileWriteConflictError, l as SandboxError, n as CapabilityError, o as NotFoundError, p as ValidationError, r as EgressProxyRecoveryError, s as PartialFailureError, t as AuthError, u as ServerError } from "./errors-Bf-A-4SA.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-
|
|
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-Ex8BbE6N.js";
|
|
4
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-DQ1yf_nX.js";
|
|
5
5
|
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-CVdLf_4n.js";
|
|
6
6
|
import { t as TangleSandboxClient } from "./tangle-Bbf2QqDC.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.19.1-develop.
|
|
3
|
+
"version": "0.19.1-develop.20260804211932.592adfa",
|
|
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",
|