@tangle-network/sandbox 0.43.0 → 0.46.0
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/README.md +3 -0
- package/dist/agent/index.d.ts +6 -6
- package/dist/agent/index.js +37 -10
- package/dist/{agent-run-outcome-BSZbRoHp.d.ts → agent-run-outcome-B_DRpTxx.d.ts} +1 -1
- package/dist/{client-DuC9Z9zp.js → client-BSNkAx2K.js} +53 -5
- package/dist/{client-Bd-hvjk_.d.ts → client-DdmHMuCL.d.ts} +23 -2
- package/dist/core.d.ts +12 -4
- package/dist/core.js +10 -3
- package/dist/{index-BpO7MMIC.d.ts → index-B6eCXD1R.d.ts} +2 -2
- package/dist/index.d.ts +40 -31
- package/dist/index.js +45 -30
- package/dist/{runtime-api-BpOFn4cB.js → runtime-api-D7CdKcbu.js} +121 -28
- package/dist/runtime.d.ts +11 -10
- package/dist/runtime.js +1 -1
- package/dist/{sandbox-CWoNC94K.js → sandbox-BRZLdcud.js} +483 -68
- package/dist/{sandbox-DVJ-rfdd.d.ts → sandbox-cTa_FF5p.d.ts} +58 -1
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-O1Hi84be.js → tangle-D7KgC1Xb.js} +1 -1
- package/dist/{types-DKtPjwgd.d.ts → types-C3Kw-Tml.d.ts} +134 -4
- package/package.json +6 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { $ as SandboxMcpEndpoint, A as InterruptResult, B as InteractiveAttachRequest, C as InteractiveSessionHost, D as InteractiveSessionStartOptions, E as InteractiveSessionRef, F as InteractiveTerminalMetadata, G as SandboxInteractionConflict, H as InteractiveSessionControllerOptions, I as createInteractiveTerminalCapture, J as BuildControlPlaneMcpConfigOptions, K as SandboxInteractionResolution, L as createInteractiveTerminalSession, M as agentInteractiveSessionPromptRequestDigest, N as InteractiveTerminalCapture, O as InteractiveSessionStartResult, P as InteractiveTerminalFrameLog, Q as SandboxMcpConfig, R as BrowserInteractiveSessionController, S as InteractiveSessionHandleOptions, T as InteractiveSessionInfo, U as InteractiveSessionControllerTransport, V as InteractiveSessionController, W as SandboxInteractionCommandResult, X as CONTROL_PLANE_MCP_SERVER_NAME, Y as BuildSandboxMcpConfigOptions, Z as SANDBOX_MCP_SERVER_NAME, _ as AgentInteractiveTerminalSession, a as WorkspaceImagePublishRequestOptions, b as InteractiveSessionControlClaim, c as TraceExportFormat, d as buildTraceExportPayload, et as SandboxMcpServerEntry, f as exportTraceBundle, g as SandboxSession, h as SandboxTaskSession, i as WorkspaceImagePublishInput, j as RespondToPermissionOptions, k as InteractiveStopCommand, l as TraceExportResult, m as toOtelJson, nt as buildSandboxMcpConfig, o as WorkspaceImagePublishResult, p as otelTraceIdForTangleTrace, q as SandboxInteractionResult, r as SandboxInstance, s as WorkspaceImages, t as ForkAcknowledgement, tt as buildControlPlaneMcpConfig, u as TraceExportSink, v as InteractiveControlClaimRequest, w as InteractiveSessionIncarnationId, x as InteractiveSessionHandle, y as InteractivePromptCommand, z as BrowserInteractiveSessionControllerOptions } from "./sandbox-
|
|
1
|
+
import { $ as SandboxMcpEndpoint, A as InterruptResult, B as InteractiveAttachRequest, C as InteractiveSessionHost, D as InteractiveSessionStartOptions, E as InteractiveSessionRef, F as InteractiveTerminalMetadata, G as SandboxInteractionConflict, H as InteractiveSessionControllerOptions, I as createInteractiveTerminalCapture, J as BuildControlPlaneMcpConfigOptions, K as SandboxInteractionResolution, L as createInteractiveTerminalSession, M as agentInteractiveSessionPromptRequestDigest, N as InteractiveTerminalCapture, O as InteractiveSessionStartResult, P as InteractiveTerminalFrameLog, Q as SandboxMcpConfig, R as BrowserInteractiveSessionController, S as InteractiveSessionHandleOptions, T as InteractiveSessionInfo, U as InteractiveSessionControllerTransport, V as InteractiveSessionController, W as SandboxInteractionCommandResult, X as CONTROL_PLANE_MCP_SERVER_NAME, Y as BuildSandboxMcpConfigOptions, Z as SANDBOX_MCP_SERVER_NAME, _ as AgentInteractiveTerminalSession, a as WorkspaceImagePublishRequestOptions, b as InteractiveSessionControlClaim, c as TraceExportFormat, d as buildTraceExportPayload, et as SandboxMcpServerEntry, f as exportTraceBundle, g as SandboxSession, h as SandboxTaskSession, i as WorkspaceImagePublishInput, j as RespondToPermissionOptions, k as InteractiveStopCommand, l as TraceExportResult, m as toOtelJson, nt as buildSandboxMcpConfig, o as WorkspaceImagePublishResult, p as otelTraceIdForTangleTrace, q as SandboxInteractionResult, r as SandboxInstance, s as WorkspaceImages, t as ForkAcknowledgement, tt as buildControlPlaneMcpConfig, u as TraceExportSink, v as InteractiveControlClaimRequest, w as InteractiveSessionIncarnationId, x as InteractiveSessionHandle, y as InteractivePromptCommand, z as BrowserInteractiveSessionControllerOptions } from "./sandbox-cTa_FF5p.js";
|
|
2
2
|
import { c as MintScopedTokenOptions, d as TERMINAL_WS_ECHO_SUBPROTOCOL, f as TerminalExitInfo, g as TerminalStreamAuthFormat, h as TerminalReadyInfo, i as TerminalStreamOptions, l as ScopedToken, m as TerminalOutputMessage, n as TerminalStreamError, o as TerminalStreamToken, p as TerminalInteractiveSessionIdentity, r as TerminalStreamHandlers, s as MintInteractiveSessionTokenOptions, t as TerminalStream, u as ScopedTokenScope } from "./terminal-stream-CcaBTVg3.js";
|
|
3
3
|
import { a as InteractiveSessionControlController, c as InteractiveSessionIdentity, d as InteractiveAttachOptions, f as InteractiveControlClaimAcknowledgement, h as InteractiveSessionStatus, i as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, l as createInteractiveControlHolderId, m as InteractiveRequestOptions, n as BrowserInteractiveSessionControlControllerOptions, o as InteractiveSessionControlControllerOptions, p as InteractiveControlClaimOptions, r as browserInteractiveControlHolderId, s as InteractiveSessionControlTransport, t as BrowserInteractiveSessionControlController, u as interactiveSessionIdentityDigest } from "./browser-interactive-control-controller-BELrFH4f.js";
|
|
4
|
-
import { $ as
|
|
5
|
-
import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, a as Team, b as backendRegistryEntrySchema, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-
|
|
4
|
+
import { $ as DriverType, $i as TeeAttestationResponse, $n as RolloutChildResult, $r as SandboxShape, $t as GpuLeaseManager, A as CommitTaskSessionOptions, Ai as SessionMessage, An as ProcessManager, Ar as SandboxFleetManifestMachine, At as FleetDispatchStreamOptions, B as CreateSandboxOptions, Bi as SnapshotResult, Bn as ProvisionStep, Br as SandboxFleetWorkspaceReconcileResult, Bt as ForkLookupOptions, C as BranchOptions, Ca as parseBackendType, Ci as SessionExecutionInfo, Cn as PreviewLinkInfo, Cr as SandboxFleetInfo, Ct as FileTreeResult, Di as SessionInfo, Dn as ProcessInfo, Dr as SandboxFleetMachineRecord, Dt as FleetDispatchCancelResult, Ei as SessionForkOptions, En as Process, Er as SandboxFleetMachineMeteredUsage, Et as FileWriteResult, F as CreateIntelligenceReportOptions, Fi as SnapshotDeleteAcknowledgement, Fn as PromptOptions, Fr as SandboxFleetTraceEvent, Ft as FleetMachineId, G as DirectoryPermission, Gi as SubscriptionInfo, Gn as ReapExpiredSandboxFleetsOptions, Gr as SandboxIntelligenceEnvelope, Gt as GitConfig, H as CreateTaskSessionOptions, Hi as StartupDiagnostics, Hn as PublicTemplateVersionInfo, Hr as SandboxFleetWorkspaceSnapshotResult, Ht as GitAuth, I as CreateRequestOptions, Ii as SnapshotDeleteOutcome, In as PromptResult, Ir as SandboxFleetTraceExport, It as FleetPromptDispatchOptions, J as DownloadOptions, Ji as TaskSessionFileChange, Jn as ReconcileSandboxFleetsResult, Jr as SandboxRemovalState, Jt as GpuLease, K as DispatchPromptOptions, Ki as TaskSessionChanges, Kn as ReapExpiredSandboxFleetsResult, Kr as SandboxPortBinding, Kt as GitDiff, L as CreateSandboxFleetOptions, Li as SnapshotIdempotency, Ln as ProvisionEvent, Lr as SandboxFleetTraceOptions, M as ConversationTurnOptions, Mi as SessionMessageInputPart, Mn as ProcessSpawnOptions, Mr as SandboxFleetPolicy, Mt as FleetDriveTurnRequest, N as ConversationTurnResult, Ni as SessionResultOptions, Nn as ProcessStatus, Nr as SandboxFleetToken, Nt as FleetExecDispatchOptions, Oi as SessionInterruptOptions, On as ProcessListOptions, Or as SandboxFleetMachineSpec, Ot as FleetDispatchResultBuffer, P as CreateGpuLeaseOptions, Pi as SessionStatus, Pn as PromptInputPart, Pr as SandboxFleetTraceBundle, Q as DriverInfo, Qi as TeeAttestationReport, Qn as Rollout, Qr as SandboxRuntimeHealth, Qt as GpuLeaseExecResult, Ri as SnapshotInfo, Rn as ProvisionResult, Rr as SandboxFleetUsage, Rt as ForkCounts, S as BatchTaskResult, Sa as BackendType, Si as SessionEventStreamOptions, Sn as PermissionsManager, Sr as SandboxFleetDriverTimings, St as FileTreeOptions, T as ChunkedUploadResult, Ti as SessionFailureReason, Tn as PreviewLinkWaitOptions, Tr as SandboxFleetMachine, Tt as FileUsageResult, U as DeleteOptions, Ui as StartupOperation, Un as PublishPublicTemplateOptions, Ur as SandboxIdentity, Ut as GitBranch, V as CreateSessionOptions, Vn as PublicTemplateInfo, Vr as SandboxFleetWorkspaceRestoreResult, Vt as GPU_LEASE_PROVIDER_NAMES, W as DevServerInfo, Wi as StorageConfig, Wn as PublishPublicTemplateVersionOptions, Wr as SandboxInfo, Wt as GitCommit, X as DriveTurnOptions, Xi as TaskSessionProfile, Xr as SandboxResources, Xt as GpuLeaseCommandResult, Y as DownloadProgress, Yi as TaskSessionInfo, Yn as RenameOptions, Yr as SandboxResourceUsage, Yt as GpuLeaseBilling, Z as DriverConfig, Zi as TeeAttestationOptions, Zr as SandboxRuntimeCapabilities, Zt as GpuLeaseExecOptions, _ as BatchBackend, _a as BatchEventDataMap, _i as SecretsManager, _n as MkdirOptions, _r as SandboxFleetArtifactSpec, _t as FileReadError, aa as UpdateUserOptions, ai as SandboxTerminalInfo, an as IntelligenceReport, ar as SSHCommandDescriptor, at as EffectiveBackendSource, b as BatchRunRequest, ba as PublicBatchRunRequest, bi as SentSessionMessage, bn as NonHostAgentDriverConfig, br as SandboxFleetDispatchResponse, bt as FileSystem, c as AttachGpuLeaseOptions, ca as UsageInfo, ci as SandboxTerminals, cn as IntelligenceReportSubjectType, cr as SandboxConnection, ct as EgressPolicy, d as BackendConfig, da as WorkspaceOperationLookup, di as SandboxTraceExport, dn as ListMessagesOptions, dr as SandboxDeleteAcknowledgement, dt as ExactProcessSpawnOptions, ea as TeePublicKey, ei as SandboxShapePreset, en as GpuLeaseProviderName, er as RolloutOptions, et as DurablePlan, f as BackendInfo, fa as WriteFileOptions, fi as SandboxTraceOptions, fn as ListOptions, fr as SandboxDeleteOptions, ft as ExecOptions, g as BackendStatus, ga as BatchEvent, gi as SecretInfo, gn as McpServerConfig, gr as SandboxFleetArtifact, gt as FileReadBatchResult, h as BackendRuntimeConfigUpdate, ha as BatchBackendStats, hi as SearchOptions, hn as MAX_EGRESS_DENIALS_LIMIT, hr as SandboxEvent, ht as FileReadBatchOptions, ia as TurnDriveResult, ii as SandboxTerminalCreateOptions, in as InstalledTool, ir as RolloutTurnPart, it as EffectiveBackendProfile, j as CompletedTurnResult, ji as SessionMessageAdmission, jn as ProcessSignal, jr as SandboxFleetOperationsSummary, jt as FleetDriveTurnOutcome, ki as SessionListOptions, kn as ProcessLogEntry, kr as SandboxFleetManifest, kt as FleetDispatchResultBufferOptions, l as AttachSandboxFleetMachineOptions, la as WaitForOptions, li as SandboxTraceBundle, ln as IntelligenceReportWindow, lr as SandboxCreateOutcome, lt as EnsureDevServerOptions, m as BackendMcpServerStatus, ma as WriteManyOptions, mi as SearchMatch, mn as ListSandboxOptions, mr as SandboxEnvironment, mt as FileInfo, n as AccessPolicyRule, na as TokenRefreshHandler, ni as SandboxStatus, nn as HostAgentDriverConfig, nr as RolloutStartResult, oa as UploadOptions, oi as SandboxTerminalManager, on as IntelligenceReportBudget, or as SSHCredentials, ot as EgressDenial, p as BackendManager, pa as WriteManyFile, pi as SandboxUser, pn as ListSandboxFleetOptions, pr as SandboxDeleteOutcome, pt as ExecResult, q as DispatchedSession, qi as TaskSessionCommitResult, qn as ReconcileSandboxFleetsOptions, qr as SandboxPortPreviewLink, qt as GitStatus, r as AddUserOptions, ra as TokenUsage, ri as SandboxTerminalAttachOptions, rn as HostAgentRuntimeBackend, rr as RolloutStatus, rt as EffectiveBackend, sa as UploadProgress, si as SandboxTerminalRequestOptions, sn as IntelligenceReportCompareTo, sr as SandboxConfig, st as EgressManager, t as AcceleratorKind, ta as TeePublicKeyResponse, ti as SandboxShapesInfo, tn as GpuLeaseStatus, tr as RolloutScorer, tt as DurablePlanDecisionResult, u as BackendCapabilities, ua as WaitForRolloutOptions, ui as SandboxTraceEvent, ur as SandboxCreateReceipt, ut as EventStreamOptions, v as BatchResult, va as BatchSidecarGroup, vi as SendSessionMessageOptions, vn as NetworkConfig, vr as SandboxFleetCostEstimate, vt as FileReadResult, w as ChunkedUploadOptions, wi as SessionExecutionStatus, wn as PreviewLinkManager, wr as SandboxFleetIntelligenceEnvelope, wt as FileUsageOptions, x as BatchTask, xa as ALL_BACKEND_TYPES, xi as SessionBackendCredentials, xn as PermissionLevel, xr as SandboxFleetDriverCapability, xt as FileTreeFile, y as BatchRunOptions, ya as BatchTaskUsage, yi as SendSessionMessageRequest, yn as NetworkManager, yr as SandboxFleetDispatchFailureClass, yt as FileRenameResult, z as CreateSandboxFleetWithCoordinatorOptions, zi as SnapshotOptions, zn as ProvisionStatus, zr as SandboxFleetWorkspace, zt as ForkIdempotency } from "./types-C3Kw-Tml.js";
|
|
5
|
+
import { C as isBackendRegistryInteractionKind, S as backendRegistryResponseSchema, T as parseBackendRegistryResponseBody, _ as BackendRegistryInteractionKind, a as Team, b as backendRegistryEntrySchema, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, g as BackendRegistryEntry, h as BackendRegistryCapabilities, i as Sandbox, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet, v as BackendRegistryResponse, w as parseBackendRegistryResponse, x as backendRegistryInteractionKindSchema, y as backendRegistryCapabilitiesSchema } from "./client-DdmHMuCL.js";
|
|
6
6
|
import { d as AnyTokenPayload, h as IssueCollaborationTokenOptions, m as CollaborationTokenPayload, p as CollaborationAccess } from "./index-CS-t6tPU.js";
|
|
7
7
|
import { _ as CollaborationTransportConfig, a as CollaborationClient, c as CollaborationClientConfig, d as CollaborationDocumentRef, f as CollaborationFileBridgeOptions, g as CollaborationTokenRefreshResponse, h as CollaborationTokenRefreshRequest, i as parseCollaborationDocumentId, l as CollaborationDocumentAdapter, m as CollaborationPermissions, n as buildCollaborationDocumentId, o as CollaborationBootstrapRequest, p as CollaborationFileEvent, r as normalizeCollaborationPath, s as CollaborationBootstrapResponse, t as CollaborationFileBridge, u as CollaborationDocumentChange, v as SaveCollaborationSnapshotRequest, y as SaveCollaborationSnapshotResponse } from "./index-BzAxTiqF.js";
|
|
8
8
|
import { _ as ValidationError, a as FileWriteConflictError, c as NotFoundError, d as SandboxError, f as SandboxErrorJson, g as TimeoutError, h as StateError, i as EgressProxyRecoveryError, l as PartialFailureError, m as ServerError, n as CapabilityError, o as KeyBudgetExhaustedError, p as SandboxFailureDetail, r as EdgeNotReadyError, s as NetworkError, t as AuthError, u as QuotaError } from "./errors-BoD3Ifbd.js";
|
|
9
|
-
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-
|
|
10
|
-
import { o as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-
|
|
9
|
+
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-B_DRpTxx.js";
|
|
10
|
+
import { o as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-B6eCXD1R.js";
|
|
11
11
|
import * as _$_tangle_network_agent_interface0 from "@tangle-network/agent-interface";
|
|
12
12
|
import { AgentProfile, AgentProfile as AgentProfile$1, AgentProfileCapabilities, AgentProfileConfidential, AgentProfileConfigValue, AgentProfileConnection, AgentProfileFileMount, AgentProfileFileMount as AgentProfileFileMount$1, AgentProfileMcpServer, AgentProfileModelHints, AgentProfilePermissionValue, AgentProfilePrompt, AgentProfileResourceRef, AgentProfileResources, AgentProfileSecurityPolicy, AgentProfileValidationIssue, AgentProfileValidationResult, AgentRunCancellationAcknowledgement, AgentRunCancellationRequest, AgentSubagentProfile, Capability, SANDBOX_SIZE_PRESET_NAMES, SandboxSizePreset } from "@tangle-network/agent-interface";
|
|
13
13
|
import { z } from "zod";
|
|
@@ -480,11 +480,9 @@ declare function generateDockerfile(spec: ImageSpec): string;
|
|
|
480
480
|
//#region src/lib/agent-response-text.d.ts
|
|
481
481
|
declare function getSandboxEventText(event: SandboxEvent): string | undefined;
|
|
482
482
|
/**
|
|
483
|
-
* Fold one event into the running response text.
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
* it is a strict continuation of what we already have, in which case it is
|
|
487
|
-
* appended once. An event with no meaningful text leaves `current` untouched.
|
|
483
|
+
* Fold one event into the running response text. Explicit deltas append,
|
|
484
|
+
* including whitespace and repeated chunks. Cumulative message parts and
|
|
485
|
+
* final results replace the text. Blank snapshots leave `current` untouched.
|
|
488
486
|
*
|
|
489
487
|
* Whitespace handling differs by kind: an incremental `token` keeps its RAW text
|
|
490
488
|
* (a lone space delta is a word separator — dropping it concatenates words), but
|
|
@@ -4153,39 +4151,50 @@ declare function materializeProfileFileMounts(box: ProfileFileMountBox, files: r
|
|
|
4153
4151
|
/** The concrete cpu/memory/disk for each named tier. */
|
|
4154
4152
|
type SizePresetResources = Required<Pick<SandboxResources, "cpuCores" | "memoryMB" | "diskGB">>;
|
|
4155
4153
|
/**
|
|
4156
|
-
* The
|
|
4157
|
-
*
|
|
4158
|
-
*
|
|
4154
|
+
* The compute behind each {@link SandboxSizePreset} as the sandbox API
|
|
4155
|
+
* defines it. The API owns these numbers and serves them from
|
|
4156
|
+
* `GET /v1/shapes` ({@link Sandbox.shapes}); this table is the offline
|
|
4157
|
+
* mirror for a caller that must resolve a tier before it holds a client (a
|
|
4158
|
+
* workflow definition, a tool spec) and is pinned to the API's table by a
|
|
4159
|
+
* drift test. `@tangle-network/agent-interface` owns the tier NAMES so the
|
|
4160
|
+
* lowest layer can reference a size.
|
|
4159
4161
|
*
|
|
4160
|
-
*
|
|
4161
|
-
*
|
|
4162
|
-
*
|
|
4163
|
-
*
|
|
4164
|
-
*
|
|
4162
|
+
* `large` equals the deployment's default per-box ceiling (8 vCPU / 16 GB /
|
|
4163
|
+
* 100 GB), so every tier is creatable on a deployment that leaves
|
|
4164
|
+
* `MAX_SANDBOX_*` unset. The server still clamps an advisory request and
|
|
4165
|
+
* refuses an explicit one above the account's ceiling — read `shapes()` for
|
|
4166
|
+
* that ceiling.
|
|
4165
4167
|
*/
|
|
4166
4168
|
declare const SANDBOX_SIZE_PRESETS: Record<SandboxSizePreset, SizePresetResources>;
|
|
4167
4169
|
/**
|
|
4168
|
-
*
|
|
4169
|
-
*
|
|
4170
|
-
*
|
|
4171
|
-
*
|
|
4170
|
+
* The platform's default tier, served as `default` by `GET /v1/shapes`. An
|
|
4171
|
+
* unsized create is granted this tier's CPU and memory and reports the grant
|
|
4172
|
+
* in `resources`; its DISK is currently held below this tier (see that
|
|
4173
|
+
* endpoint's description), so expand the tier locally only when you also send
|
|
4174
|
+
* it as a request.
|
|
4172
4175
|
*/
|
|
4173
4176
|
declare const DEFAULT_SANDBOX_SIZE: SandboxSizePreset;
|
|
4174
|
-
/**
|
|
4175
|
-
*
|
|
4176
|
-
*
|
|
4177
|
-
|
|
4177
|
+
/**
|
|
4178
|
+
* The resources for a named tier, as a fresh object (never the shared preset).
|
|
4179
|
+
* Pass the `presets` from {@link Sandbox.shapes} to expand the tier to what
|
|
4180
|
+
* the serving deployment defines; without them the pinned mirror applies.
|
|
4181
|
+
* Fails loud on an unknown key rather than spreading `undefined` into an
|
|
4182
|
+
* empty resources object — a silent zero would send no compute request
|
|
4183
|
+
* downstream.
|
|
4184
|
+
*/
|
|
4185
|
+
declare function sandboxResourcesForSize(size: SandboxSizePreset, presets?: ReadonlyArray<SandboxShapePreset>): SandboxResources;
|
|
4178
4186
|
/**
|
|
4179
4187
|
* Resolve a caller's size intent to concrete {@link SandboxResources}. Raw
|
|
4180
4188
|
* `resources` win (an explicit cpu/memory request is authoritative); else a
|
|
4181
|
-
* named `size` expands to its preset; else `undefined` (the
|
|
4182
|
-
*
|
|
4183
|
-
* if both arrive here, the explicit numbers take precedence
|
|
4184
|
-
* silently merged.
|
|
4189
|
+
* named `size` expands to its preset; else `undefined` (the API applies
|
|
4190
|
+
* {@link DEFAULT_SANDBOX_SIZE}). Raw and preset are intentionally exclusive at
|
|
4191
|
+
* the schema layer — if both arrive here, the explicit numbers take precedence
|
|
4192
|
+
* rather than being silently merged.
|
|
4185
4193
|
*/
|
|
4186
4194
|
declare function resolveSandboxResources(opts: {
|
|
4187
4195
|
size?: SandboxSizePreset;
|
|
4188
4196
|
resources?: SandboxResources;
|
|
4197
|
+
presets?: ReadonlyArray<SandboxShapePreset>;
|
|
4189
4198
|
}): SandboxResources | undefined;
|
|
4190
4199
|
//#endregion
|
|
4191
4200
|
//#region src/router-search.d.ts
|
|
@@ -4438,4 +4447,4 @@ interface RouterEvalMatrixCaseResult {
|
|
|
4438
4447
|
}
|
|
4439
4448
|
declare function runTangleRouterEvalMatrixInSandbox(options: RunTangleRouterEvalMatrixInSandboxOptions): Promise<RunTangleRouterEvalMatrixInSandboxResult>;
|
|
4440
4449
|
//#endregion
|
|
4441
|
-
export { ALL_BACKEND_TYPES, type AcceleratorKind, type AccessPolicyRule, type AddUserOptions, type AgentInteractiveTerminalSession, type AgentProfile, type AgentProfileCapabilities, type AgentProfileConnection, type AgentProfileFileMount, type AgentProfileMcpServer, type AgentProfileModelHints, type AgentProfilePermissionValue, type AgentProfilePrompt, type AgentProfileResourceRef, type AgentProfileResources, type AgentProfileSecurityPolicy, type AgentProfileValidationIssue, type AgentProfileValidationResult, type AgentRunCancellationAcknowledgement, type AgentRunCancellationRequest, type AgentRunOutcome, type AgentRunOutcomeTracker, type AgentSubagentProfile, type AnyTokenPayload, type AttachGpuLeaseOptions, type AttachSandboxFleetMachineOptions, AuthError, type BackendCapabilities, type BackendConfig, type BackendInfo, type BackendManager, type BackendMcpServerStatus, type BackendRegistryCapabilities, type BackendRegistryEntry, type BackendRegistryInteractionKind, type BackendRegistryResponse, type BackendRuntimeConfigUpdate, type BackendStatus, type BackendType, type BatchBackend, type BatchBackendStats, type BatchEvent, type BatchEventDataMap, type BatchResult, type BatchResultAccumulator, type BatchRunOptions, type BatchRunRequest, type BatchSidecarGroup, type BatchTask, type BatchTaskResult, type BatchTaskUsage, type BranchOptions, BrowserInteractiveSessionControlController, type BrowserInteractiveSessionControlControllerOptions, BrowserInteractiveSessionController, type BrowserInteractiveSessionControllerOptions, type BuildControlPlaneMcpConfigOptions, type BuildProgressEvent, type BuildSandboxMcpConfigOptions, CONTROL_PLANE_MCP_SERVER_NAME, type Capability, CapabilityError, type ChunkedUploadOptions, type ChunkedUploadResult, type CollaborationAccess, type CollaborationBootstrapRequest, type CollaborationBootstrapResponse, CollaborationClient, type CollaborationClientConfig, type CollaborationDocumentAdapter, type CollaborationDocumentChange, type CollaborationDocumentRef, CollaborationFileBridge, type CollaborationFileBridgeOptions, type CollaborationFileEvent, type CollaborationPermissions, type CollaborationTokenPayload, type CollaborationTokenRefreshRequest, type CollaborationTokenRefreshResponse, type CollaborationTransportConfig, type CommitTaskSessionOptions, type CompletedTurnResult, type ConfidentialSandboxResult, type ConfidentialTeeType, type CreateConfidentialSandboxOptions, type CreateGpuLeaseOptions, type CreateIntelligenceReportOptions, type CreateRequestOptions, type CreateSandboxFleetOptions, type CreateSandboxFleetWithCoordinatorOptions, type CreateSandboxOptions, type CreateSessionOptions, type CreateTaskSessionOptions, type CreateTeamOptions, DEFAULT_SANDBOX_SIZE, type DeleteOptions, type DevServerInfo, type DirectoryPermission, type DispatchPromptOptions, type DispatchedSession, type DownloadOptions, type DownloadProgress, type DriveTurnOptions, type DriverConfig, type DriverInfo, type DriverType, type DurablePlan, type DurablePlanDecisionResult, EdgeNotReadyError, type EffectiveBackend, type EffectiveBackendProfile, type EffectiveBackendSource, type EgressDenial, type EgressManager, type EgressPolicy, EgressProxyRecoveryError, type EnsureDevServerOptions, type EventStreamOptions, type ExactProcessSpawnOptions, type ExecOptions, type ExecResult, type FileInfo, type FileReadBatchOptions, type FileReadBatchResult, type FileReadError, type FileReadResult, type FileRenameResult, type FileSystem, type FileTreeFile, type FileTreeOptions, type FileTreeResult, type FileUsageOptions, type FileUsageResult, FileWriteConflictError, type FileWriteResult, type FleetDispatchCancelResult, type FleetDispatchResultBuffer, type FleetDispatchResultBufferOptions, type FleetDispatchStreamOptions, type FleetDriveTurnOutcome, type FleetDriveTurnRequest, type FleetExecDispatchOptions, type FleetMachineId, type FleetPromptDispatchOptions, type ForkAcknowledgement, type ForkCounts, type ForkIdempotency, type ForkLookupOptions, GPU_LEASE_PROVIDER_NAMES, type GitAuth, type GitBranch, type GitCommit, type GitConfig, type GitDiff, type GitStatus, type GpuLease, type GpuLeaseBilling, type GpuLeaseCommandResult, type GpuLeaseExecOptions, type GpuLeaseExecResult, type GpuLeaseManager, type GpuLeaseProviderName, type GpuLeaseStatus, type HostAgentDriverConfig, type HostAgentRuntimeBackend, INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, Image, type ImageBuildClient, type ImageBuildClientConfig, type ImageBuildFetchClient, type ImageBuildOptions, type ImageBuildResult, ImageBuilder, type ImageSpec, type InstalledTool, IntelligenceClient, type IntelligenceReport, type IntelligenceReportBudget, type IntelligenceReportCompareTo, type IntelligenceReportSubjectType, type IntelligenceReportWindow, type InteractiveAttachOptions, type InteractiveAttachRequest, type InteractiveControlClaimAcknowledgement, type InteractiveControlClaimOptions, type InteractiveControlClaimRequest, type InteractivePromptCommand, type InteractiveRequestOptions, type InteractiveSessionControlClaim, InteractiveSessionControlController, type InteractiveSessionControlControllerOptions, type InteractiveSessionControlTransport, InteractiveSessionController, type InteractiveSessionControllerOptions, type InteractiveSessionControllerTransport, InteractiveSessionHandle, type InteractiveSessionHandleOptions, type InteractiveSessionHost, type InteractiveSessionIdentity, type InteractiveSessionIncarnationId, type InteractiveSessionInfo, type InteractiveSessionRef, type InteractiveSessionStartOptions, type InteractiveSessionStartResult, type InteractiveSessionStatus, type InteractiveStopCommand, type InteractiveTerminalCapture, InteractiveTerminalFrameLog, type InteractiveTerminalMetadata, type InterruptResult, type InviteTeamMemberOptions, type IssueCollaborationTokenOptions, KeyBudgetExhaustedError, type ListMessagesOptions, type ListOptions, type ListSandboxFleetOptions, type ListSandboxOptions, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, MAX_EGRESS_DENIALS_LIMIT, type ManageSandboxesInput, type ManageSandboxesTool, type ManageSandboxesToolOptions, type MaterializeProfileFileMountsOptions, type MaterializeProfileFileMountsResult, type McpServerConfig, type MintInteractiveSessionTokenOptions, type MintScopedTokenOptions, type MkdirOptions, type NetworkConfig, NetworkError, type NetworkManager, type NonHostAgentDriverConfig, NotFoundError, type ParseSSEStreamOptions, type ParsedSSEEvent, PartialFailureError, type PermissionLevel, type PermissionsManager, type PreviewLinkInfo, type PreviewLinkManager, type PreviewLinkWaitOptions, type Process, type ProcessInfo, type ProcessListOptions, type ProcessLogEntry, type ProcessManager, type ProcessSignal, type ProcessSpawnOptions, type ProcessStatus, type PromptInputPart, type PromptOptions, type PromptResult, type ProvisionEvent, type ProvisionResult, type ProvisionStatus, type ProvisionStep, type PublicTemplateInfo, type PublicTemplateVersionInfo, type PublishPublicTemplateOptions, type PublishPublicTemplateVersionOptions, QuotaError, type ReapExpiredSandboxFleetsOptions, type ReapExpiredSandboxFleetsResult, type ReconcileSandboxFleetsOptions, type ReconcileSandboxFleetsResult, type RenameOptions, type RespondToPermissionOptions, type Rollout, type RolloutChildResult, type RolloutOptions, type RolloutScorer, type RolloutStartResult, type RolloutStatus, type RolloutTurnPart, type RouterEvalMatrixAgentProfile, type RouterEvalMatrixCaseResult, type RouterEvalMatrixHarness, type RouterEvalMatrixPayload, type RouterEvalMatrixSandboxBox, type RouterEvalMatrixSandboxClient, type RouterEvalMatrixScenario, type RouterEvalMatrixSuiteResponse, type RouterImportedRunResponse, type RouterSearchConfig, type RouterSearchConfigOptions, type RunTangleRouterEvalMatrixInSandboxOptions, type RunTangleRouterEvalMatrixInSandboxResult, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, type SSHCommandDescriptor, type SSHCredentials, Sandbox, type SandboxConfig, type SandboxConnection, type SandboxCreateOutcome, type SandboxCreateReceipt, type SandboxDeleteAcknowledgement, type SandboxDeleteOptions, type SandboxDeleteOutcome, type SandboxEnvironment, SandboxError, type SandboxErrorJson, type SandboxEvent, type SandboxFailureDetail, SandboxFleet, type SandboxFleetArtifact, type SandboxFleetArtifactSpec, SandboxFleetClient, type SandboxFleetCostEstimate, type SandboxFleetDispatchFailureClass, type SandboxFleetDispatchResponse, type SandboxFleetDriverCapability, type SandboxFleetDriverTimings, type SandboxFleetInfo, type SandboxFleetIntelligenceEnvelope, type SandboxFleetMachine, type SandboxFleetMachineMeteredUsage, type SandboxFleetMachineRecord, type SandboxFleetMachineSpec, type SandboxFleetManifest, type SandboxFleetManifestMachine, type SandboxFleetOperationsSummary, type SandboxFleetPolicy, type SandboxFleetToken, type SandboxFleetTraceBundle, type SandboxFleetTraceEvent, type SandboxFleetTraceExport, type SandboxFleetTraceOptions, type SandboxFleetUsage, type SandboxFleetWorkspace, type SandboxFleetWorkspaceReconcileResult, type SandboxFleetWorkspaceRestoreResult, type SandboxFleetWorkspaceSnapshotResult, type SandboxIdentity, type SandboxInfo, SandboxInstance, type SandboxIntelligenceEnvelope, type SandboxInteractionCommandResult, type SandboxInteractionConflict, type SandboxInteractionResolution, type SandboxInteractionResult, type SandboxMcpConfig, type SandboxMcpEndpoint, type SandboxMcpServerEntry, type SandboxPortBinding, type SandboxPortPreviewLink, type SandboxRemovalState, type SandboxResourceUsage, type SandboxResources, type SandboxRuntimeCapabilities, type SandboxRuntimeHealth, SandboxSession, type SandboxSizePreset, type SandboxStatus, SandboxTaskSession, type SandboxTerminalAttachOptions, type SandboxTerminalCreateOptions, type SandboxTerminalInfo, type SandboxTerminalManager, type SandboxTerminalRequestOptions, type SandboxTerminals, type SandboxTraceBundle, type SandboxTraceEvent, type SandboxTraceExport, type SandboxTraceOptions, type SandboxUser, type SaveCollaborationSnapshotRequest, type SaveCollaborationSnapshotResponse, type ScopedToken, type ScopedTokenScope, type SearchMatch, type SearchOptions, type SecretInfo, type SecretsManager, type SendSessionMessageOptions, type SendSessionMessageRequest, type SentSessionMessage, ServerError, type SessionBackendCredentials, type SessionBroadcastEvent, type SessionBroadcastResult, type SessionEventStreamOptions, type SessionExecutionInfo, type SessionExecutionStatus, type SessionFailureReason, type SessionForkOptions, type SessionInfo, type SessionInterruptOptions, type SessionListOptions, type SessionMessage, type SessionMessageInputPart, type SessionResultOptions, type SessionStatus, type SnapshotDeleteAcknowledgement, type SnapshotDeleteOutcome, type SnapshotIdempotency, type SnapshotInfo, type SnapshotOptions, type SnapshotResult, type SplitInlineProfileFileMountsResult, type SplitInlineProfileSkillsResult, type StartupDiagnostics, type StartupOperation, StateError, type StorageConfig, type SubscriptionInfo, TERMINAL_WS_ECHO_SUBPROTOCOL, TangleSandboxClient, type TangleSandboxClientConfig, type TangleSearchProvider, type TaskSessionChanges, type TaskSessionCommitResult, type TaskSessionFileChange, type TaskSessionInfo, type TaskSessionProfile, type Team, type TeamInvitation, type TeamMember, type TeeAttestationHeartbeat, type TeeAttestationHeartbeatOptions, type TeeAttestationHeartbeatSample, type TeeAttestationOptions, type TeeAttestationReport, type TeeAttestationResponse, type TeePublicKey, type TeePublicKeyResponse, type TerminalExitInfo, type TerminalInteractiveSessionIdentity, type TerminalOutputMessage, type TerminalReadyInfo, TerminalStream, type TerminalStreamAuthFormat, TerminalStreamError, type TerminalStreamHandlers, type TerminalStreamOptions, type TerminalStreamToken, TimeoutError, type TokenRefreshHandler, type TokenUsage, type TraceExportFormat, type TraceExportResult, type TraceExportSink, type TurnDriveResult, type UpdateUserOptions, type UploadOptions, type UploadProgress, type UsageInfo, ValidationError, type WaitForOptions, type WaitForRolloutOptions, type WorkspaceImagePublishInput, type WorkspaceImagePublishRequestOptions, type WorkspaceImagePublishResult, WorkspaceImages, type WorkspaceOperationLookup, type WriteFileOptions, type WriteManyFile, type WriteManyOptions, applySandboxEventText, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, browserInteractiveControlHolderId, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, collectAgentFinalMessageText, collectAgentResponseText, createAgentRunOutcomeTracker, createBatchResultAccumulator, createConfidentialSandbox, createInteractiveControlHolderId, createInteractiveTerminalCapture, createInteractiveTerminalSession, createManageSandboxesTool, deriveAgentResultOutcome, deriveAgentRunOutcome, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, agentInteractiveSessionPromptRequestDigest as interactivePromptRequestDigest, interactiveSessionIdentityDigest, isBackendRegistryInteractionKind, isToolBearingEvent, manageSandboxesInputSchema, materializeProfileFileMounts, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseBackendType, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, splitInlineProfileFileMounts, splitInlineProfileSkills, startTeeAttestationHeartbeat, toOtelJson, validateBatchRunRequest, validateDeferredProfileFileMounts };
|
|
4450
|
+
export { ALL_BACKEND_TYPES, type AcceleratorKind, type AccessPolicyRule, type AddUserOptions, type AgentInteractiveTerminalSession, type AgentProfile, type AgentProfileCapabilities, type AgentProfileConnection, type AgentProfileFileMount, type AgentProfileMcpServer, type AgentProfileModelHints, type AgentProfilePermissionValue, type AgentProfilePrompt, type AgentProfileResourceRef, type AgentProfileResources, type AgentProfileSecurityPolicy, type AgentProfileValidationIssue, type AgentProfileValidationResult, type AgentRunCancellationAcknowledgement, type AgentRunCancellationRequest, type AgentRunOutcome, type AgentRunOutcomeTracker, type AgentSubagentProfile, type AnyTokenPayload, type AttachGpuLeaseOptions, type AttachSandboxFleetMachineOptions, AuthError, type BackendCapabilities, type BackendConfig, type BackendInfo, type BackendManager, type BackendMcpServerStatus, type BackendRegistryCapabilities, type BackendRegistryEntry, type BackendRegistryInteractionKind, type BackendRegistryResponse, type BackendRuntimeConfigUpdate, type BackendStatus, type BackendType, type BatchBackend, type BatchBackendStats, type BatchEvent, type BatchEventDataMap, type BatchResult, type BatchResultAccumulator, type BatchRunOptions, type BatchRunRequest, type BatchSidecarGroup, type BatchTask, type BatchTaskResult, type BatchTaskUsage, type BranchOptions, BrowserInteractiveSessionControlController, type BrowserInteractiveSessionControlControllerOptions, BrowserInteractiveSessionController, type BrowserInteractiveSessionControllerOptions, type BuildControlPlaneMcpConfigOptions, type BuildProgressEvent, type BuildSandboxMcpConfigOptions, CONTROL_PLANE_MCP_SERVER_NAME, type Capability, CapabilityError, type ChunkedUploadOptions, type ChunkedUploadResult, type CollaborationAccess, type CollaborationBootstrapRequest, type CollaborationBootstrapResponse, CollaborationClient, type CollaborationClientConfig, type CollaborationDocumentAdapter, type CollaborationDocumentChange, type CollaborationDocumentRef, CollaborationFileBridge, type CollaborationFileBridgeOptions, type CollaborationFileEvent, type CollaborationPermissions, type CollaborationTokenPayload, type CollaborationTokenRefreshRequest, type CollaborationTokenRefreshResponse, type CollaborationTransportConfig, type CommitTaskSessionOptions, type CompletedTurnResult, type ConfidentialSandboxResult, type ConfidentialTeeType, type ConversationTurnOptions, type ConversationTurnResult, type CreateConfidentialSandboxOptions, type CreateGpuLeaseOptions, type CreateIntelligenceReportOptions, type CreateRequestOptions, type CreateSandboxFleetOptions, type CreateSandboxFleetWithCoordinatorOptions, type CreateSandboxOptions, type CreateSessionOptions, type CreateTaskSessionOptions, type CreateTeamOptions, DEFAULT_SANDBOX_SIZE, type DeleteOptions, type DevServerInfo, type DirectoryPermission, type DispatchPromptOptions, type DispatchedSession, type DownloadOptions, type DownloadProgress, type DriveTurnOptions, type DriverConfig, type DriverInfo, type DriverType, type DurablePlan, type DurablePlanDecisionResult, EdgeNotReadyError, type EffectiveBackend, type EffectiveBackendProfile, type EffectiveBackendSource, type EgressDenial, type EgressManager, type EgressPolicy, EgressProxyRecoveryError, type EnsureDevServerOptions, type EventStreamOptions, type ExactProcessSpawnOptions, type ExecOptions, type ExecResult, type FileInfo, type FileReadBatchOptions, type FileReadBatchResult, type FileReadError, type FileReadResult, type FileRenameResult, type FileSystem, type FileTreeFile, type FileTreeOptions, type FileTreeResult, type FileUsageOptions, type FileUsageResult, FileWriteConflictError, type FileWriteResult, type FleetDispatchCancelResult, type FleetDispatchResultBuffer, type FleetDispatchResultBufferOptions, type FleetDispatchStreamOptions, type FleetDriveTurnOutcome, type FleetDriveTurnRequest, type FleetExecDispatchOptions, type FleetMachineId, type FleetPromptDispatchOptions, type ForkAcknowledgement, type ForkCounts, type ForkIdempotency, type ForkLookupOptions, GPU_LEASE_PROVIDER_NAMES, type GitAuth, type GitBranch, type GitCommit, type GitConfig, type GitDiff, type GitStatus, type GpuLease, type GpuLeaseBilling, type GpuLeaseCommandResult, type GpuLeaseExecOptions, type GpuLeaseExecResult, type GpuLeaseManager, type GpuLeaseProviderName, type GpuLeaseStatus, type HostAgentDriverConfig, type HostAgentRuntimeBackend, INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, Image, type ImageBuildClient, type ImageBuildClientConfig, type ImageBuildFetchClient, type ImageBuildOptions, type ImageBuildResult, ImageBuilder, type ImageSpec, type InstalledTool, IntelligenceClient, type IntelligenceReport, type IntelligenceReportBudget, type IntelligenceReportCompareTo, type IntelligenceReportSubjectType, type IntelligenceReportWindow, type InteractiveAttachOptions, type InteractiveAttachRequest, type InteractiveControlClaimAcknowledgement, type InteractiveControlClaimOptions, type InteractiveControlClaimRequest, type InteractivePromptCommand, type InteractiveRequestOptions, type InteractiveSessionControlClaim, InteractiveSessionControlController, type InteractiveSessionControlControllerOptions, type InteractiveSessionControlTransport, InteractiveSessionController, type InteractiveSessionControllerOptions, type InteractiveSessionControllerTransport, InteractiveSessionHandle, type InteractiveSessionHandleOptions, type InteractiveSessionHost, type InteractiveSessionIdentity, type InteractiveSessionIncarnationId, type InteractiveSessionInfo, type InteractiveSessionRef, type InteractiveSessionStartOptions, type InteractiveSessionStartResult, type InteractiveSessionStatus, type InteractiveStopCommand, type InteractiveTerminalCapture, InteractiveTerminalFrameLog, type InteractiveTerminalMetadata, type InterruptResult, type InviteTeamMemberOptions, type IssueCollaborationTokenOptions, KeyBudgetExhaustedError, type ListMessagesOptions, type ListOptions, type ListSandboxFleetOptions, type ListSandboxOptions, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, MAX_EGRESS_DENIALS_LIMIT, type ManageSandboxesInput, type ManageSandboxesTool, type ManageSandboxesToolOptions, type MaterializeProfileFileMountsOptions, type MaterializeProfileFileMountsResult, type McpServerConfig, type MintInteractiveSessionTokenOptions, type MintScopedTokenOptions, type MkdirOptions, type NetworkConfig, NetworkError, type NetworkManager, type NonHostAgentDriverConfig, NotFoundError, type ParseSSEStreamOptions, type ParsedSSEEvent, PartialFailureError, type PermissionLevel, type PermissionsManager, type PreviewLinkInfo, type PreviewLinkManager, type PreviewLinkWaitOptions, type Process, type ProcessInfo, type ProcessListOptions, type ProcessLogEntry, type ProcessManager, type ProcessSignal, type ProcessSpawnOptions, type ProcessStatus, type PromptInputPart, type PromptOptions, type PromptResult, type ProvisionEvent, type ProvisionResult, type ProvisionStatus, type ProvisionStep, type PublicTemplateInfo, type PublicTemplateVersionInfo, type PublishPublicTemplateOptions, type PublishPublicTemplateVersionOptions, QuotaError, type ReapExpiredSandboxFleetsOptions, type ReapExpiredSandboxFleetsResult, type ReconcileSandboxFleetsOptions, type ReconcileSandboxFleetsResult, type RenameOptions, type RespondToPermissionOptions, type Rollout, type RolloutChildResult, type RolloutOptions, type RolloutScorer, type RolloutStartResult, type RolloutStatus, type RolloutTurnPart, type RouterEvalMatrixAgentProfile, type RouterEvalMatrixCaseResult, type RouterEvalMatrixHarness, type RouterEvalMatrixPayload, type RouterEvalMatrixSandboxBox, type RouterEvalMatrixSandboxClient, type RouterEvalMatrixScenario, type RouterEvalMatrixSuiteResponse, type RouterImportedRunResponse, type RouterSearchConfig, type RouterSearchConfigOptions, type RunTangleRouterEvalMatrixInSandboxOptions, type RunTangleRouterEvalMatrixInSandboxResult, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, type SSHCommandDescriptor, type SSHCredentials, Sandbox, type SandboxConfig, type SandboxConnection, type SandboxCreateOutcome, type SandboxCreateReceipt, type SandboxDeleteAcknowledgement, type SandboxDeleteOptions, type SandboxDeleteOutcome, type SandboxEnvironment, SandboxError, type SandboxErrorJson, type SandboxEvent, type SandboxFailureDetail, SandboxFleet, type SandboxFleetArtifact, type SandboxFleetArtifactSpec, SandboxFleetClient, type SandboxFleetCostEstimate, type SandboxFleetDispatchFailureClass, type SandboxFleetDispatchResponse, type SandboxFleetDriverCapability, type SandboxFleetDriverTimings, type SandboxFleetInfo, type SandboxFleetIntelligenceEnvelope, type SandboxFleetMachine, type SandboxFleetMachineMeteredUsage, type SandboxFleetMachineRecord, type SandboxFleetMachineSpec, type SandboxFleetManifest, type SandboxFleetManifestMachine, type SandboxFleetOperationsSummary, type SandboxFleetPolicy, type SandboxFleetToken, type SandboxFleetTraceBundle, type SandboxFleetTraceEvent, type SandboxFleetTraceExport, type SandboxFleetTraceOptions, type SandboxFleetUsage, type SandboxFleetWorkspace, type SandboxFleetWorkspaceReconcileResult, type SandboxFleetWorkspaceRestoreResult, type SandboxFleetWorkspaceSnapshotResult, type SandboxIdentity, type SandboxInfo, SandboxInstance, type SandboxIntelligenceEnvelope, type SandboxInteractionCommandResult, type SandboxInteractionConflict, type SandboxInteractionResolution, type SandboxInteractionResult, type SandboxMcpConfig, type SandboxMcpEndpoint, type SandboxMcpServerEntry, type SandboxPortBinding, type SandboxPortPreviewLink, type SandboxRemovalState, type SandboxResourceUsage, type SandboxResources, type SandboxRuntimeCapabilities, type SandboxRuntimeHealth, SandboxSession, type SandboxShape, type SandboxShapePreset, type SandboxShapesInfo, type SandboxSizePreset, type SandboxStatus, SandboxTaskSession, type SandboxTerminalAttachOptions, type SandboxTerminalCreateOptions, type SandboxTerminalInfo, type SandboxTerminalManager, type SandboxTerminalRequestOptions, type SandboxTerminals, type SandboxTraceBundle, type SandboxTraceEvent, type SandboxTraceExport, type SandboxTraceOptions, type SandboxUser, type SaveCollaborationSnapshotRequest, type SaveCollaborationSnapshotResponse, type ScopedToken, type ScopedTokenScope, type SearchMatch, type SearchOptions, type SecretInfo, type SecretsManager, type SendSessionMessageOptions, type SendSessionMessageRequest, type SentSessionMessage, ServerError, type SessionBackendCredentials, type SessionBroadcastEvent, type SessionBroadcastResult, type SessionEventStreamOptions, type SessionExecutionInfo, type SessionExecutionStatus, type SessionFailureReason, type SessionForkOptions, type SessionInfo, type SessionInterruptOptions, type SessionListOptions, type SessionMessage, type SessionMessageAdmission, type SessionMessageInputPart, type SessionResultOptions, type SessionStatus, type SnapshotDeleteAcknowledgement, type SnapshotDeleteOutcome, type SnapshotIdempotency, type SnapshotInfo, type SnapshotOptions, type SnapshotResult, type SplitInlineProfileFileMountsResult, type SplitInlineProfileSkillsResult, type StartupDiagnostics, type StartupOperation, StateError, type StorageConfig, type SubscriptionInfo, TERMINAL_WS_ECHO_SUBPROTOCOL, TangleSandboxClient, type TangleSandboxClientConfig, type TangleSearchProvider, type TaskSessionChanges, type TaskSessionCommitResult, type TaskSessionFileChange, type TaskSessionInfo, type TaskSessionProfile, type Team, type TeamInvitation, type TeamMember, type TeeAttestationHeartbeat, type TeeAttestationHeartbeatOptions, type TeeAttestationHeartbeatSample, type TeeAttestationOptions, type TeeAttestationReport, type TeeAttestationResponse, type TeePublicKey, type TeePublicKeyResponse, type TerminalExitInfo, type TerminalInteractiveSessionIdentity, type TerminalOutputMessage, type TerminalReadyInfo, TerminalStream, type TerminalStreamAuthFormat, TerminalStreamError, type TerminalStreamHandlers, type TerminalStreamOptions, type TerminalStreamToken, TimeoutError, type TokenRefreshHandler, type TokenUsage, type TraceExportFormat, type TraceExportResult, type TraceExportSink, type TurnDriveResult, type UpdateUserOptions, type UploadOptions, type UploadProgress, type UsageInfo, ValidationError, type WaitForOptions, type WaitForRolloutOptions, type WorkspaceImagePublishInput, type WorkspaceImagePublishRequestOptions, type WorkspaceImagePublishResult, WorkspaceImages, type WorkspaceOperationLookup, type WriteFileOptions, type WriteManyFile, type WriteManyOptions, applySandboxEventText, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, browserInteractiveControlHolderId, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, collectAgentFinalMessageText, collectAgentResponseText, createAgentRunOutcomeTracker, createBatchResultAccumulator, createConfidentialSandbox, createInteractiveControlHolderId, createInteractiveTerminalCapture, createInteractiveTerminalSession, createManageSandboxesTool, deriveAgentResultOutcome, deriveAgentRunOutcome, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, agentInteractiveSessionPromptRequestDigest as interactivePromptRequestDigest, interactiveSessionIdentityDigest, isBackendRegistryInteractionKind, isToolBearingEvent, manageSandboxesInputSchema, materializeProfileFileMounts, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseBackendType, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, splitInlineProfileFileMounts, splitInlineProfileSkills, startTeeAttestationHeartbeat, toOtelJson, validateBatchRunRequest, validateDeferredProfileFileMounts };
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as parseBackendType, S as backendTypeSchema, _ as normalizeRuntimeBackendConfig, b as deriveAgentRunOutcome, p as parseSSEStream, v as createAgentRunOutcomeTracker, x as ALL_BACKEND_TYPES, y as deriveAgentResultOutcome } from "./runtime-api-D7CdKcbu.js";
|
|
2
2
|
import { a as FileWriteConflictError, c as NotFoundError, d as SandboxError, f as ServerError, h as ValidationError, i as EgressProxyRecoveryError, l as PartialFailureError, m as TimeoutError, n as CapabilityError, o as KeyBudgetExhaustedError, p as StateError, r as EdgeNotReadyError, s as NetworkError, t as AuthError, u as QuotaError } from "./errors-CdDyExth.js";
|
|
3
|
-
import { _ as parseBackendRegistryResponse, a as splitInlineProfileSkills, c as SandboxFleetClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as splitInlineProfileFileMounts, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, o as validateDeferredProfileFileMounts, p as backendRegistryEntrySchema, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-
|
|
3
|
+
import { _ as parseBackendRegistryResponse, a as splitInlineProfileSkills, c as SandboxFleetClient, d as validateBatchRunRequest, f as backendRegistryCapabilitiesSchema, g as isBackendRegistryInteractionKind, h as backendRegistryResponseSchema, i as splitInlineProfileFileMounts, l as runtimeWorkspaceCwdSchema, m as backendRegistryInteractionKindSchema, n as Sandbox, o as validateDeferredProfileFileMounts, p as backendRegistryEntrySchema, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as createBatchResultAccumulator, v as parseBackendRegistryResponseBody } from "./client-BSNkAx2K.js";
|
|
4
4
|
import { a as INTERACTIVE_CONTROL_CLEANUP_TIMEOUT_MS, c as createInteractiveControlHolderId, l as interactiveSessionIdentityDigest, n as browserInteractiveControlHolderId, o as InteractiveSessionControlController, t as BrowserInteractiveSessionControlController } from "./browser-interactive-control-controller-Dv0gbFMu.js";
|
|
5
|
-
import { A as
|
|
5
|
+
import { A as otelTraceIdForTangleTrace, C as collectAgentResponseText, O as buildTraceExportPayload, S as collectAgentFinalMessageText, T as isToolBearingEvent, _ as TerminalStream, a as WorkspaceImages, c as SandboxTaskSession, d as agentInteractiveSessionPromptRequestDigest, f as InteractiveTerminalFrameLog, g as InteractiveSessionController, h as BrowserInteractiveSessionController, j as toOtelJson, k as exportTraceBundle, l as SandboxSession, m as createInteractiveTerminalSession, o as GPU_LEASE_PROVIDER_NAMES, p as createInteractiveTerminalCapture, s as MAX_EGRESS_DENIALS_LIMIT, t as SandboxInstance, u as InteractiveSessionHandle, v as TerminalStreamError, w as getSandboxEventText, x as applySandboxEventText, y as TERMINAL_WS_ECHO_SUBPROTOCOL } from "./sandbox-BRZLdcud.js";
|
|
6
6
|
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-DilBgjXG.js";
|
|
7
|
-
import { t as TangleSandboxClient } from "./tangle-
|
|
7
|
+
import { t as TangleSandboxClient } from "./tangle-D7KgC1Xb.js";
|
|
8
8
|
import { SANDBOX_SIZE_PRESET_NAMES, agentProfileConfidentialSchema, agentProfileSchema } from "@tangle-network/agent-interface";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
//#region src/confidential.ts
|
|
@@ -1010,64 +1010,79 @@ function buildControlPlaneMcpConfig(options) {
|
|
|
1010
1010
|
//#endregion
|
|
1011
1011
|
//#region src/resources.ts
|
|
1012
1012
|
/**
|
|
1013
|
-
* The
|
|
1014
|
-
*
|
|
1015
|
-
*
|
|
1013
|
+
* The compute behind each {@link SandboxSizePreset} as the sandbox API
|
|
1014
|
+
* defines it. The API owns these numbers and serves them from
|
|
1015
|
+
* `GET /v1/shapes` ({@link Sandbox.shapes}); this table is the offline
|
|
1016
|
+
* mirror for a caller that must resolve a tier before it holds a client (a
|
|
1017
|
+
* workflow definition, a tool spec) and is pinned to the API's table by a
|
|
1018
|
+
* drift test. `@tangle-network/agent-interface` owns the tier NAMES so the
|
|
1019
|
+
* lowest layer can reference a size.
|
|
1016
1020
|
*
|
|
1017
|
-
*
|
|
1018
|
-
*
|
|
1019
|
-
*
|
|
1020
|
-
*
|
|
1021
|
-
*
|
|
1021
|
+
* `large` equals the deployment's default per-box ceiling (8 vCPU / 16 GB /
|
|
1022
|
+
* 100 GB), so every tier is creatable on a deployment that leaves
|
|
1023
|
+
* `MAX_SANDBOX_*` unset. The server still clamps an advisory request and
|
|
1024
|
+
* refuses an explicit one above the account's ceiling — read `shapes()` for
|
|
1025
|
+
* that ceiling.
|
|
1022
1026
|
*/
|
|
1023
1027
|
const SANDBOX_SIZE_PRESETS = {
|
|
1024
1028
|
nano: {
|
|
1025
1029
|
cpuCores: 1,
|
|
1026
1030
|
memoryMB: 2048,
|
|
1027
|
-
diskGB:
|
|
1031
|
+
diskGB: 10
|
|
1028
1032
|
},
|
|
1029
1033
|
small: {
|
|
1030
1034
|
cpuCores: 2,
|
|
1031
1035
|
memoryMB: 4096,
|
|
1032
|
-
diskGB:
|
|
1036
|
+
diskGB: 20
|
|
1033
1037
|
},
|
|
1034
1038
|
medium: {
|
|
1035
1039
|
cpuCores: 4,
|
|
1036
1040
|
memoryMB: 8192,
|
|
1037
|
-
diskGB:
|
|
1041
|
+
diskGB: 50
|
|
1038
1042
|
},
|
|
1039
1043
|
large: {
|
|
1040
1044
|
cpuCores: 8,
|
|
1041
1045
|
memoryMB: 16384,
|
|
1042
|
-
diskGB:
|
|
1046
|
+
diskGB: 100
|
|
1043
1047
|
}
|
|
1044
1048
|
};
|
|
1045
1049
|
/**
|
|
1046
|
-
*
|
|
1047
|
-
*
|
|
1048
|
-
*
|
|
1049
|
-
*
|
|
1050
|
+
* The platform's default tier, served as `default` by `GET /v1/shapes`. An
|
|
1051
|
+
* unsized create is granted this tier's CPU and memory and reports the grant
|
|
1052
|
+
* in `resources`; its DISK is currently held below this tier (see that
|
|
1053
|
+
* endpoint's description), so expand the tier locally only when you also send
|
|
1054
|
+
* it as a request.
|
|
1050
1055
|
*/
|
|
1051
1056
|
const DEFAULT_SANDBOX_SIZE = "small";
|
|
1052
|
-
/**
|
|
1053
|
-
*
|
|
1054
|
-
*
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
+
/**
|
|
1058
|
+
* The resources for a named tier, as a fresh object (never the shared preset).
|
|
1059
|
+
* Pass the `presets` from {@link Sandbox.shapes} to expand the tier to what
|
|
1060
|
+
* the serving deployment defines; without them the pinned mirror applies.
|
|
1061
|
+
* Fails loud on an unknown key rather than spreading `undefined` into an
|
|
1062
|
+
* empty resources object — a silent zero would send no compute request
|
|
1063
|
+
* downstream.
|
|
1064
|
+
*/
|
|
1065
|
+
function sandboxResourcesForSize(size, presets) {
|
|
1066
|
+
const served = presets?.find((preset) => preset.name === size);
|
|
1067
|
+
const preset = served ? {
|
|
1068
|
+
cpuCores: served.cpuCores,
|
|
1069
|
+
memoryMB: served.memoryMB,
|
|
1070
|
+
diskGB: served.diskGB
|
|
1071
|
+
} : SANDBOX_SIZE_PRESETS[size];
|
|
1057
1072
|
if (!preset) throw new Error(`sandboxResourcesForSize: unknown size preset '${size}' (expected one of ${SANDBOX_SIZE_PRESET_NAMES.join(", ")})`);
|
|
1058
1073
|
return { ...preset };
|
|
1059
1074
|
}
|
|
1060
1075
|
/**
|
|
1061
1076
|
* Resolve a caller's size intent to concrete {@link SandboxResources}. Raw
|
|
1062
1077
|
* `resources` win (an explicit cpu/memory request is authoritative); else a
|
|
1063
|
-
* named `size` expands to its preset; else `undefined` (the
|
|
1064
|
-
*
|
|
1065
|
-
* if both arrive here, the explicit numbers take precedence
|
|
1066
|
-
* silently merged.
|
|
1078
|
+
* named `size` expands to its preset; else `undefined` (the API applies
|
|
1079
|
+
* {@link DEFAULT_SANDBOX_SIZE}). Raw and preset are intentionally exclusive at
|
|
1080
|
+
* the schema layer — if both arrive here, the explicit numbers take precedence
|
|
1081
|
+
* rather than being silently merged.
|
|
1067
1082
|
*/
|
|
1068
1083
|
function resolveSandboxResources(opts) {
|
|
1069
1084
|
if (opts.resources) return opts.resources;
|
|
1070
|
-
if (opts.size) return sandboxResourcesForSize(opts.size);
|
|
1085
|
+
if (opts.size) return sandboxResourcesForSize(opts.size, opts.presets);
|
|
1071
1086
|
}
|
|
1072
1087
|
//#endregion
|
|
1073
1088
|
//#region src/router-search.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as SandboxError, f as ServerError, g as parseErrorResponse, h as ValidationError, m as TimeoutError, n as CapabilityError, s as NetworkError, u as QuotaError } from "./errors-CdDyExth.js";
|
|
2
2
|
import { n as combineAbortSignals } from "./abort-signal-si1WMfJb.js";
|
|
3
|
-
import { AgentExactRunControlRefSchema, AgentExecutionOutcomeSchema, AgentRuntimeAttachmentsSchema, DurablePlanSchema, InteractionRequestSchema, agentProfileSchema, harnessTypeSchema } from "@tangle-network/agent-interface";
|
|
3
|
+
import { AgentExactRunControlRefSchema, AgentExecutionOutcomeSchema, AgentRuntimeAttachmentsSchema, DurablePlanSchema, InteractionRequestSchema, agentProfileSchema, canonicalCandidateDigest, harnessTypeSchema } from "@tangle-network/agent-interface";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region ../../../packages/runtime-contracts/dist/backend-types.js
|
|
6
6
|
/**
|
|
@@ -796,6 +796,57 @@ function isFileTooLargeErrorBody(value) {
|
|
|
796
796
|
return isSizeLimitErrorBodyFor(value, FILE_TOO_LARGE_CODE);
|
|
797
797
|
}
|
|
798
798
|
//#endregion
|
|
799
|
+
//#region src/dispatch-run-control.ts
|
|
800
|
+
const DISPATCH_RUN_PROVIDER = "tangle-sandbox";
|
|
801
|
+
function generateRuntimeId(prefix) {
|
|
802
|
+
const crypto = globalThis.crypto;
|
|
803
|
+
if (crypto?.randomUUID) return `${prefix}-${crypto.randomUUID()}`;
|
|
804
|
+
if (crypto?.getRandomValues) {
|
|
805
|
+
const bytes = crypto.getRandomValues(new Uint8Array(16));
|
|
806
|
+
return `${prefix}-${Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("")}`;
|
|
807
|
+
}
|
|
808
|
+
throw new ValidationError("Run identity generation requires global crypto");
|
|
809
|
+
}
|
|
810
|
+
function resolveDispatchRunIdentity(sandboxId, message, options) {
|
|
811
|
+
const sessionId = options?.sessionId ?? options?.runControlRef?.sessionId ?? generateRuntimeId("session");
|
|
812
|
+
const executionId = options?.executionId ?? options?.runControlRef?.executionId ?? generateRuntimeId("execution");
|
|
813
|
+
return {
|
|
814
|
+
sessionId,
|
|
815
|
+
executionId,
|
|
816
|
+
runControlRef: options?.runControlRef ?? {
|
|
817
|
+
runId: generateRuntimeId("run"),
|
|
818
|
+
provider: DISPATCH_RUN_PROVIDER,
|
|
819
|
+
environmentId: sandboxId,
|
|
820
|
+
sessionId,
|
|
821
|
+
executionId,
|
|
822
|
+
requestDigest: canonicalCandidateDigest({
|
|
823
|
+
message,
|
|
824
|
+
sessionId,
|
|
825
|
+
turnId: options?.turnId ?? null,
|
|
826
|
+
backend: options?.backend ?? null,
|
|
827
|
+
model: options?.model ?? null,
|
|
828
|
+
context: options?.context ?? null
|
|
829
|
+
})
|
|
830
|
+
}
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
function sameExactRunControlRef(left, right) {
|
|
834
|
+
return left.runId === right.runId && left.provider === right.provider && left.environmentId === right.environmentId && left.sessionId === right.sessionId && left.executionId === right.executionId && left.requestDigest === right.requestDigest;
|
|
835
|
+
}
|
|
836
|
+
function validateAcceptedDispatchRunRef(raw, expected, sandboxId, sessionId, executionId, endpoint = "/agents/run/stream") {
|
|
837
|
+
const parsed = AgentExactRunControlRefSchema.safeParse(raw);
|
|
838
|
+
if (!parsed.success) throw new ServerError("Sandbox returned an invalid exact run reference on admission", 502, {
|
|
839
|
+
origin: "runtime",
|
|
840
|
+
endpoint
|
|
841
|
+
});
|
|
842
|
+
const accepted = parsed.data;
|
|
843
|
+
if (accepted.environmentId !== sandboxId || accepted.sessionId !== sessionId || accepted.executionId !== executionId || !sameExactRunControlRef(accepted, expected)) throw new ServerError("Sandbox returned an exact run reference for another execution", 502, {
|
|
844
|
+
origin: "runtime",
|
|
845
|
+
endpoint
|
|
846
|
+
});
|
|
847
|
+
return accepted;
|
|
848
|
+
}
|
|
849
|
+
//#endregion
|
|
799
850
|
//#region src/lib/chunked-upload.ts
|
|
800
851
|
/**
|
|
801
852
|
* Chunked upload — the sanctioned SDK path for delivering payloads larger
|
|
@@ -1144,16 +1195,48 @@ var SandboxRuntimeApi = class {
|
|
|
1144
1195
|
}
|
|
1145
1196
|
if (options.executionId !== void 0 && !sawTerminal) throw new NetworkError("event stream ended before a terminal event — the connection dropped mid-turn");
|
|
1146
1197
|
}
|
|
1147
|
-
/**
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1198
|
+
/** Read a turn's retained admission without proposing or admitting a message. */
|
|
1199
|
+
async admission(sessionId, turnId, options = {}) {
|
|
1200
|
+
if (!sessionId.trim() || !turnId.trim()) throw new ValidationError("sessionId and turnId are required");
|
|
1201
|
+
await this.transport.ensureRunning();
|
|
1202
|
+
const endpoint = `/agents/sessions/${encodeURIComponent(sessionId)}/admissions/${encodeURIComponent(turnId)}`;
|
|
1203
|
+
const payload = await this.json(endpoint, {
|
|
1204
|
+
method: "GET",
|
|
1205
|
+
signal: options.signal
|
|
1206
|
+
});
|
|
1207
|
+
if (payload?.receipt === null) return null;
|
|
1208
|
+
const receipt = payload?.receipt;
|
|
1209
|
+
if (!receipt || typeof receipt.info?.id !== "string" || !receipt.info.id || receipt.processing !== true) throw new ServerError("Runtime returned an invalid message admission receipt", 502, {
|
|
1210
|
+
origin: "runtime",
|
|
1211
|
+
endpoint
|
|
1212
|
+
});
|
|
1213
|
+
const parsedRef = receipt.runControlRef === void 0 ? void 0 : AgentExactRunControlRefSchema.safeParse(receipt.runControlRef);
|
|
1214
|
+
if (parsedRef && !parsedRef.success) throw new ServerError("Admission returned an invalid exact run reference", 502, {
|
|
1215
|
+
origin: "runtime",
|
|
1216
|
+
endpoint
|
|
1217
|
+
});
|
|
1218
|
+
const runControlRef = parsedRef?.data;
|
|
1219
|
+
if (runControlRef && (runControlRef.sessionId !== sessionId || runControlRef.executionId !== receipt.info.id)) throw new ServerError("Admission control reference does not match its execution", 502, {
|
|
1220
|
+
origin: "runtime",
|
|
1221
|
+
endpoint
|
|
1222
|
+
});
|
|
1223
|
+
const run = (await this.runs(sessionId, options)).find((candidate) => candidate.executionId === receipt.info.id);
|
|
1224
|
+
return {
|
|
1225
|
+
sessionId,
|
|
1226
|
+
turnId,
|
|
1227
|
+
executionId: receipt.info.id,
|
|
1228
|
+
status: run?.status ?? "unavailable",
|
|
1229
|
+
...runControlRef ? { runControlRef } : {}
|
|
1230
|
+
};
|
|
1231
|
+
}
|
|
1232
|
+
/** List validated execution records from the runtime ledger, newest first. */
|
|
1233
|
+
async runs(sessionId, options = {}) {
|
|
1154
1234
|
await this.transport.ensureRunning();
|
|
1155
1235
|
const endpoint = `/agents/sessions/${encodeURIComponent(sessionId)}/runs`;
|
|
1156
|
-
const payload = await this.json(endpoint, {
|
|
1236
|
+
const payload = await this.json(endpoint, {
|
|
1237
|
+
method: "GET",
|
|
1238
|
+
signal: options.signal
|
|
1239
|
+
});
|
|
1157
1240
|
if (payload.success !== true || !Array.isArray(payload.executions)) throw new ServerError("Session runs response has an invalid shape", 502, {
|
|
1158
1241
|
origin: "runtime",
|
|
1159
1242
|
endpoint
|
|
@@ -1305,6 +1388,7 @@ var SandboxRuntimeApi = class {
|
|
|
1305
1388
|
body: JSON.stringify({
|
|
1306
1389
|
...options.sessionId !== void 0 ? { sessionId: options.sessionId } : {},
|
|
1307
1390
|
...options.title !== void 0 ? { title: options.title } : {},
|
|
1391
|
+
...options.retention !== void 0 ? { retention: options.retention } : {},
|
|
1308
1392
|
...options.parentId !== void 0 ? { parentID: options.parentId } : {},
|
|
1309
1393
|
...backend && Object.keys(backend).length > 0 ? { backend } : {}
|
|
1310
1394
|
})
|
|
@@ -1362,30 +1446,18 @@ var SandboxRuntimeApi = class {
|
|
|
1362
1446
|
method: "POST",
|
|
1363
1447
|
headers,
|
|
1364
1448
|
signal,
|
|
1365
|
-
body: JSON.stringify(
|
|
1366
|
-
...request.messageId !== void 0 ? { messageID: request.messageId } : {},
|
|
1367
|
-
parts: request.parts.map((part) => part.type === "text" ? {
|
|
1368
|
-
...part,
|
|
1369
|
-
text: encodeTextForWire(part.text)
|
|
1370
|
-
} : part),
|
|
1371
|
-
...request.system !== void 0 ? { system: request.system } : {},
|
|
1372
|
-
...request.agent !== void 0 ? { agent: request.agent } : {},
|
|
1373
|
-
...request.model !== void 0 ? { model: {
|
|
1374
|
-
providerID: request.model.providerId,
|
|
1375
|
-
modelID: request.model.modelId
|
|
1376
|
-
} } : {},
|
|
1377
|
-
...request.reasoningEffort !== void 0 ? { reasoningEffort: request.reasoningEffort } : {},
|
|
1378
|
-
...request.turnId !== void 0 ? { turnId: request.turnId } : {},
|
|
1379
|
-
...request.interactions !== void 0 ? { interactions: request.interactions } : {}
|
|
1380
|
-
})
|
|
1449
|
+
body: JSON.stringify(sessionMessageRequestBody(request))
|
|
1381
1450
|
};
|
|
1451
|
+
let receipt;
|
|
1382
1452
|
try {
|
|
1383
|
-
|
|
1453
|
+
receipt = await this.json(path, init);
|
|
1384
1454
|
} catch (error) {
|
|
1385
1455
|
if (!isRetryableCredentialRefusal(error)) throw error;
|
|
1386
1456
|
await waitForRetryAfter(error.retryAfterMs ?? 1e3, signal);
|
|
1387
|
-
|
|
1457
|
+
receipt = await this.json(path, init);
|
|
1388
1458
|
}
|
|
1459
|
+
if (request.runControlRef) validateAcceptedDispatchRunRef(receipt.runControlRef, request.runControlRef, request.runControlRef.environmentId, id, receipt.info.id, path);
|
|
1460
|
+
return receipt;
|
|
1389
1461
|
}
|
|
1390
1462
|
async deleteSession(id) {
|
|
1391
1463
|
await this.transport.ensureRunning();
|
|
@@ -1553,5 +1625,26 @@ function normalizeSessionInfo(raw) {
|
|
|
1553
1625
|
raw
|
|
1554
1626
|
};
|
|
1555
1627
|
}
|
|
1628
|
+
/** The admission check must hash the same wire request as dispatch. */
|
|
1629
|
+
function sessionMessageRequestBody(request) {
|
|
1630
|
+
return {
|
|
1631
|
+
...request.backend !== void 0 ? { backend: normalizeRuntimeBackendConfig(request.backend) } : {},
|
|
1632
|
+
...request.runControlRef !== void 0 ? { runControlRef: AgentExactRunControlRefSchema.parse(request.runControlRef) } : {},
|
|
1633
|
+
...request.messageId !== void 0 ? { messageID: request.messageId } : {},
|
|
1634
|
+
parts: request.parts.map((part) => part.type === "text" ? {
|
|
1635
|
+
...part,
|
|
1636
|
+
text: encodeTextForWire(part.text)
|
|
1637
|
+
} : part),
|
|
1638
|
+
...request.system !== void 0 ? { system: request.system } : {},
|
|
1639
|
+
...request.agent !== void 0 ? { agent: request.agent } : {},
|
|
1640
|
+
...request.model !== void 0 ? { model: {
|
|
1641
|
+
providerID: request.model.providerId,
|
|
1642
|
+
modelID: request.model.modelId
|
|
1643
|
+
} } : {},
|
|
1644
|
+
...request.reasoningEffort !== void 0 ? { reasoningEffort: request.reasoningEffort } : {},
|
|
1645
|
+
...request.turnId !== void 0 ? { turnId: request.turnId } : {},
|
|
1646
|
+
...request.interactions !== void 0 ? { interactions: request.interactions } : {}
|
|
1647
|
+
};
|
|
1648
|
+
}
|
|
1556
1649
|
//#endregion
|
|
1557
|
-
export {
|
|
1650
|
+
export { parseBackendType as C, backendTypeSchema as S, normalizeRuntimeBackendConfig as _, sessionHeaders as a, deriveAgentRunOutcome as b, validateAcceptedDispatchRunRef as c, encodePromptForWire as d, encodeTextForWire as f, mergeRuntimeBackendConfig as g, assertCurrentBackendType as h, appendSessionIdQuery as i, SANDBOX_PROXY_REQUEST_MAX_BYTES as l, applyRequestedModel as m, normalizeSessionInfo as n, uploadChunked as o, parseSSEStream as p, sessionMessageRequestBody as r, resolveDispatchRunIdentity as s, SandboxRuntimeApi as t, FILE_DECODED_WRITE_MAX_BYTES as u, createAgentRunOutcomeTracker as v, ALL_BACKEND_TYPES as x, deriveAgentResultOutcome as y };
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as CommitTaskSessionOptions, Ai as SessionMessage, Ci as SessionExecutionInfo, Ct as FileTreeResult, Di as SessionInfo, Et as FileWriteResult, H as CreateTaskSessionOptions, Ki as TaskSessionChanges, Kr as SandboxPortBinding, Qr as SandboxRuntimeHealth, Si as SessionEventStreamOptions, St as FileTreeOptions, T as ChunkedUploadResult, Tt as FileUsageResult, V as CreateSessionOptions, Yi as TaskSessionInfo, Yn as RenameOptions, ai as SandboxTerminalInfo, bi as SentSessionMessage, dn as ListMessagesOptions, fa as WriteFileOptions, gt as FileReadBatchResult, hr as SandboxEvent, ht as FileReadBatchOptions, ii as SandboxTerminalCreateOptions, ji as SessionMessageAdmission, oi as SandboxTerminalManager, qi as TaskSessionCommitResult, sa as UploadProgress, si as SandboxTerminalRequestOptions, vi as SendSessionMessageOptions, w as ChunkedUploadOptions, wi as SessionExecutionStatus, wt as FileUsageOptions, yi as SendSessionMessageRequest, yt as FileRenameResult } from "./types-C3Kw-Tml.js";
|
|
2
2
|
import { _ as ValidationError, a as FileWriteConflictError, c as NotFoundError, d as SandboxError, f as SandboxErrorJson, g as TimeoutError, h as StateError, l as PartialFailureError, m as ServerError, n as CapabilityError, p as SandboxFailureDetail, s as NetworkError, t as AuthError, u as QuotaError } from "./errors-BoD3Ifbd.js";
|
|
3
|
-
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-
|
|
3
|
+
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-B_DRpTxx.js";
|
|
4
4
|
|
|
5
5
|
//#region src/lib/chunked-upload.d.ts
|
|
6
6
|
/** The transport a caller wires this module to — {@link SandboxInstance.runtimeFetch}
|
|
@@ -56,13 +56,14 @@ declare class SandboxRuntimeApi {
|
|
|
56
56
|
* the token for.
|
|
57
57
|
*/
|
|
58
58
|
events(sessionId: string, options?: SessionEventStreamOptions): AsyncGenerator<SandboxEvent>;
|
|
59
|
-
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
/** Read a turn's retained admission without proposing or admitting a message. */
|
|
60
|
+
admission(sessionId: string, turnId: string, options?: {
|
|
61
|
+
signal?: AbortSignal;
|
|
62
|
+
}): Promise<SessionMessageAdmission | null>;
|
|
63
|
+
/** List validated execution records from the runtime ledger, newest first. */
|
|
64
|
+
runs(sessionId: string, options?: {
|
|
65
|
+
signal?: AbortSignal;
|
|
66
|
+
}): Promise<SessionExecutionInfo[]>;
|
|
66
67
|
readFiles(paths: string[], options?: FileReadBatchOptions): Promise<FileReadBatchResult>;
|
|
67
68
|
writeFile(path: string, content: string, options?: WriteFileOptions): Promise<FileWriteResult>;
|
|
68
69
|
/**
|
|
@@ -128,4 +129,4 @@ declare class SandboxRuntimeClient extends SandboxRuntimeApi {
|
|
|
128
129
|
}
|
|
129
130
|
declare function createSandboxRuntimeClient(config: SandboxRuntimeClientConfig): SandboxRuntimeClient;
|
|
130
131
|
//#endregion
|
|
131
|
-
export { type AgentRunOutcome, type AgentRunOutcomeTracker, AuthError, CapabilityError, type ChunkedUploadOptions, type ChunkedUploadResult, type ChunkedUploadTransport, type FileReadBatchOptions, type FileReadBatchResult, type FileRenameResult, type FileTreeOptions, type FileTreeResult, FileWriteConflictError, type FileWriteResult, type ListMessagesOptions, NetworkError, NotFoundError, PartialFailureError, QuotaError, type RenameOptions, SandboxError, type SandboxErrorJson, type SandboxEvent, type SandboxFailureDetail, SandboxRuntimeClient, type SandboxRuntimeClientConfig, type SandboxRuntimeHealth, type SandboxTerminalCreateOptions, type SandboxTerminalInfo, type SandboxTerminalManager, type SandboxTerminalRequestOptions, ServerError, type SessionEventStreamOptions, type SessionExecutionInfo, type SessionExecutionStatus, type SessionMessage, StateError, TimeoutError, type UploadProgress, ValidationError, type WriteFileOptions, createAgentRunOutcomeTracker, createSandboxRuntimeClient, deriveAgentResultOutcome, deriveAgentRunOutcome, uploadChunked };
|
|
132
|
+
export { type AgentRunOutcome, type AgentRunOutcomeTracker, AuthError, CapabilityError, type ChunkedUploadOptions, type ChunkedUploadResult, type ChunkedUploadTransport, type FileReadBatchOptions, type FileReadBatchResult, type FileRenameResult, type FileTreeOptions, type FileTreeResult, FileWriteConflictError, type FileWriteResult, type ListMessagesOptions, NetworkError, NotFoundError, PartialFailureError, QuotaError, type RenameOptions, SandboxError, type SandboxErrorJson, type SandboxEvent, type SandboxFailureDetail, SandboxRuntimeClient, type SandboxRuntimeClientConfig, type SandboxRuntimeHealth, type SandboxTerminalCreateOptions, type SandboxTerminalInfo, type SandboxTerminalManager, type SandboxTerminalRequestOptions, ServerError, type SessionEventStreamOptions, type SessionExecutionInfo, type SessionExecutionStatus, type SessionMessage, type SessionMessageAdmission, StateError, TimeoutError, type UploadProgress, ValidationError, type WriteFileOptions, createAgentRunOutcomeTracker, createSandboxRuntimeClient, deriveAgentResultOutcome, deriveAgentRunOutcome, uploadChunked };
|