@tangle-network/sandbox 0.22.0 → 0.23.0-develop.20260814092444.5f93bc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.ts +3 -3
- package/dist/{client-CV2xqPAw.js → client-CLn6Tzx8.js} +3 -2
- package/dist/{client-DZA6-Gwg.d.ts → client-QSo4goVc.d.ts} +2 -2
- package/dist/core.d.ts +3 -3
- package/dist/core.js +2 -2
- package/dist/{index-D8gFjIat.d.ts → index-BBZKkva-.d.ts} +2 -2
- package/dist/index.d.ts +35 -5
- package/dist/index.js +3 -3
- package/dist/runtime.d.ts +1 -1
- package/dist/{sandbox-EcY9ibhA.js → sandbox-D2wREqmA.js} +333 -71
- package/dist/{sandbox-DqA_HkI0.d.ts → sandbox-S1ayJN7d.d.ts} +120 -26
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-B37vhbje.js → tangle-CzFPb4Jm.js} +1 -1
- package/dist/{types-KcG-gz1O.d.ts → types-Dpj6Unaq.d.ts} +47 -4
- package/package.json +3 -3
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as CodeResultPart, S as CodeLanguage, b as CodeExecutionOptions, x as CodeExecutionResult } from "../types-
|
|
2
|
-
import { n as SandboxInstance } from "../sandbox-
|
|
3
|
-
import { i as Sandbox } from "../client-
|
|
1
|
+
import { C as CodeResultPart, S as CodeLanguage, b as CodeExecutionOptions, x as CodeExecutionResult } from "../types-Dpj6Unaq.js";
|
|
2
|
+
import { n as SandboxInstance } from "../sandbox-S1ayJN7d.js";
|
|
3
|
+
import { i as Sandbox } from "../client-QSo4goVc.js";
|
|
4
4
|
import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
|
|
5
5
|
|
|
6
6
|
//#region src/agent/tools/_specs.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as combineAbortSignals, d as applyRequestedModel, f as assertCurrentBackendType, l as encodePromptForWire, m as backendTypeSchema, o as SANDBOX_PROXY_REQUEST_MAX_BYTES, p as normalizeRuntimeBackendConfig, u as encodeTextForWire } from "./runtime-api-Co-Ow_VR.js";
|
|
2
2
|
import { a as NetworkError, f as TimeoutError, l as SandboxError, m as parseErrorResponse, o as NotFoundError, p as ValidationError, s as PartialFailureError, t as AuthError, u as ServerError } from "./errors-D2aWy99l.js";
|
|
3
|
-
import {
|
|
3
|
+
import { S as parseSSEStream, _ as normalizeConnection, i as normalizeStartupDiagnostics, n as createSandboxInstanceFromResponse, r as normalizeSandboxCreateReceipt, y as exportTraceBundle } from "./sandbox-D2wREqmA.js";
|
|
4
4
|
import { agentProfileSchema } from "@tangle-network/agent-interface";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region ../../../packages/runtime-contracts/dist/git-policy.js
|
|
@@ -3100,7 +3100,8 @@ var Sandbox = class {
|
|
|
3100
3100
|
expiresAt: data.expiresAt ? new Date(data.expiresAt) : void 0,
|
|
3101
3101
|
error: data.error,
|
|
3102
3102
|
gpuLease: data.gpuLease,
|
|
3103
|
-
startupDiagnostics: normalizeStartupDiagnostics(data.startupDiagnostics) ?? void 0
|
|
3103
|
+
startupDiagnostics: normalizeStartupDiagnostics(data.startupDiagnostics) ?? void 0,
|
|
3104
|
+
createReceipt: normalizeSandboxCreateReceipt(data.createReceipt) ?? void 0
|
|
3104
3105
|
};
|
|
3105
3106
|
}
|
|
3106
3107
|
_tokenRefreshHandlers = /* @__PURE__ */ new Set();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
import { c as TraceExportResult, l as TraceExportSink, n as SandboxInstance, t as HttpClient } from "./sandbox-
|
|
1
|
+
import { $r as SecretsManager, A as CreateSandboxFleetTokenOptions, An as PublishPublicTemplateOptions, Cn as PromptResult, Ct as FleetExecDispatchOptions, D as CreateIntelligenceReportOptions, Dr as SandboxIdentity, Dt as FleetPromptDispatchResult, Er as SandboxFleetWorkspaceSnapshotResult, Et as FleetPromptDispatchOptions, Fn as ReconcileSandboxFleetsResult, Jn as SandboxConfig, Jt as IntelligenceReportCompareTo, Kt as IntelligenceReport, M as CreateSandboxOptions, Mi as TokenRefreshHandler, Mn as ReapExpiredSandboxFleetsOptions, Nn as ReapExpiredSandboxFleetsResult, O as CreateRequestOptions, On as PublicTemplateInfo, Or as SandboxInfo, Pn as ReconcileSandboxFleetsOptions, Qn as SandboxEnvironment, Ri as UsageInfo, Sn as PromptOptions, Sr as SandboxFleetUsage, St as FleetDriveTurnRequest, Tr as SandboxFleetWorkspaceRestoreResult, Tt as FleetMachineId, Xt as IntelligenceReportWindow, _i as SshKeysManager, _r as SandboxFleetToken, _t as FleetDispatchCancelResult, a as AttachSandboxFleetMachineOptions, ar as SandboxFleetDriverCapability, bt as FleetDispatchStreamOptions, dr as SandboxFleetMachineRecord, ea as BatchEvent, en as ListSandboxFleetOptions, er as SandboxFleetArtifact, f as BatchResult, hr as SandboxFleetOperationsSummary, ir as SandboxFleetDispatchResponse, j as CreateSandboxFleetWithCoordinatorOptions, jn as PublishPublicTemplateVersionOptions, k as CreateSandboxFleetOptions, kn as PublicTemplateVersionInfo, m as BatchRunRequest, nr as SandboxFleetCostEstimate, nt as ExecOptions, p as BatchRunOptions, pr as SandboxFleetManifest, qt as IntelligenceReportBudget, rt as ExecResult, sr as SandboxFleetInfo, tn as ListSandboxOptions, tr as SandboxFleetArtifactSpec, vr as SandboxFleetTraceBundle, vt as FleetDispatchResultBuffer, wr as SandboxFleetWorkspaceReconcileResult, wt as FleetExecDispatchResult, xi as SubscriptionInfo, xn as PromptInputPart, xr as SandboxFleetTraceOptions, xt as FleetDriveTurnOutcome, yt as FleetDispatchResultBufferOptions } from "./types-Dpj6Unaq.js";
|
|
2
|
+
import { c as TraceExportResult, l as TraceExportSink, n as SandboxInstance, t as HttpClient } from "./sandbox-S1ayJN7d.js";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/sse-parser.d.ts
|
|
5
5
|
/**
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as WorkspaceImagePublishResult, i as WorkspaceImagePublishRequestOptions, n as SandboxInstance, o as WorkspaceImages, r as WorkspaceImagePublishInput } from "./sandbox-
|
|
3
|
-
import { i as Sandbox } from "./client-
|
|
1
|
+
import { Ir as SandboxStatus, Jn as SandboxConfig, M as CreateSandboxOptions, Or as SandboxInfo, an as NetworkConfig, dn as PreviewLinkManager, fn as PreviewLinkWaitOptions, nt as ExecOptions, rt as ExecResult, un as PreviewLinkInfo, xn as PromptInputPart } from "./types-Dpj6Unaq.js";
|
|
2
|
+
import { a as WorkspaceImagePublishResult, i as WorkspaceImagePublishRequestOptions, n as SandboxInstance, o as WorkspaceImages, r as WorkspaceImagePublishInput } from "./sandbox-S1ayJN7d.js";
|
|
3
|
+
import { i as Sandbox } from "./client-QSo4goVc.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-D2aWy99l.js";
|
|
2
|
-
import { n as Sandbox } from "./client-
|
|
3
|
-
import {
|
|
2
|
+
import { n as Sandbox } from "./client-CLn6Tzx8.js";
|
|
3
|
+
import { a as WorkspaceImages, t as SandboxInstance } from "./sandbox-D2wREqmA.js";
|
|
4
4
|
export { AuthError, CapabilityError, FileWriteConflictError, NetworkError, NotFoundError, PartialFailureError, QuotaError, Sandbox, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as CreateSandboxOptions } from "./types-
|
|
2
|
-
import { n as SandboxInstance, t as HttpClient } from "./sandbox-
|
|
1
|
+
import { M as CreateSandboxOptions } from "./types-Dpj6Unaq.js";
|
|
2
|
+
import { n as SandboxInstance, t as HttpClient } from "./sandbox-S1ayJN7d.js";
|
|
3
3
|
|
|
4
4
|
//#region src/tangle/abi.d.ts
|
|
5
5
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { A as
|
|
3
|
-
import { a as Team, c as SessionBroadcastEvent, d as SandboxFleetClient, f as ParseSSEStreamOptions, i as Sandbox, l as SessionBroadcastResult, m as parseSSEStream, n as IntelligenceClient, o as TeamInvitation, p as ParsedSSEEvent, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as SandboxFleet } from "./client-
|
|
1
|
+
import { $ as EnsureDevServerOptions, $i as BatchBackendStats, $n as SandboxEvent, $r as SecretsManager, $t as ListOptions, Ai as TeePublicKey, An as PublishPublicTemplateOptions, Ar as SandboxPortBinding, At as GitBranch, B as DownloadOptions, Bi as WaitForRolloutOptions, Bn as RolloutChildResult, Br as SandboxTerminalManager, Bt as GpuLeaseManager, Ci as TaskSessionCommitResult, Cn as PromptResult, Cr as SandboxFleetWorkspace, Ct as FleetExecDispatchOptions, D as CreateIntelligenceReportOptions, Di as TeeAttestationOptions, Dn as ProvisionStep, Dr as SandboxIdentity, E as CreateGpuLeaseOptions, Ei as TaskSessionProfile, En as ProvisionStatus, Er as SandboxFleetWorkspaceSnapshotResult, Et as FleetPromptDispatchOptions, F as DeleteOptions, Fi as UpdateUserOptions, Fn as ReconcileSandboxFleetsResult, Fr as SandboxRuntimeHealth, Ft as GpuLease, G as DriverType, Gi as TerminalExitInfo, Gn as RolloutTurnPart, Gr as SandboxTraceExport, Gt as InstalledTool, H as DriveTurnOptions, Hi as WriteManyFile, Hn as RolloutScorer, Hr as SandboxTerminals, Ht as GpuLeaseStatus, I as DevServerInfo, Ii as UploadOptions, In as RenameOptions, Ir as SandboxStatus, It as GpuLeaseBilling, J as EffectiveBackend, Ji as TerminalStreamAuthFormat, Jn as SandboxConfig, Jr as ScopedToken, Jt as IntelligenceReportCompareTo, K as DurablePlan, Ki as TerminalReadyInfo, Kn as SSHCommandDescriptor, Kr as SandboxTraceOptions, Kt as IntelligenceReport, L as DirectoryPermission, Li as UploadProgress, Lr as SandboxTerminalAttachOptions, Lt as GpuLeaseCommandResult, M as CreateSandboxOptions, Mi as TokenRefreshHandler, Mn as ReapExpiredSandboxFleetsOptions, Mr as SandboxResourceUsage, Mt as GitConfig, N as CreateSessionOptions, Ni as TokenUsage, Nn as ReapExpiredSandboxFleetsResult, Nr as SandboxResources, Nt as GitDiff, O as CreateRequestOptions, Oi as TeeAttestationReport, On as PublicTemplateInfo, Or as SandboxInfo, Ot as GPU_LEASE_PROVIDER_NAMES, P as CreateTaskSessionOptions, Pi as TurnDriveResult, Pn as ReconcileSandboxFleetsOptions, Pr as SandboxRuntimeCapabilities, Pt as GitStatus, Q as EgressPolicy, Qi as TerminalStreamToken, Qn as SandboxEnvironment, Qr as SecretInfo, Qt as ListMessagesOptions, R as DispatchPromptOptions, Ri as UsageInfo, Rr as SandboxTerminalCreateOptions, Rt as GpuLeaseExecOptions, Si as TaskSessionChanges, Sn as PromptOptions, Sr as SandboxFleetUsage, St as FleetDriveTurnRequest, T as CompletedTurnResult, Ti as TaskSessionInfo, Tn as ProvisionResult, Tr as SandboxFleetWorkspaceRestoreResult, Tt as FleetMachineId, U as DriverConfig, Ui as WriteManyOptions, Un as RolloutStartResult, Ur as SandboxTraceBundle, Ut as HostAgentDriverConfig, V as DownloadProgress, Vi as WriteFileOptions, Vn as RolloutOptions, Vr as SandboxTerminalRequestOptions, Vt as GpuLeaseProviderName, W as DriverInfo, Wi as TERMINAL_WS_ECHO_SUBPROTOCOL, Wn as RolloutStatus, Wr as SandboxTraceEvent, Wt as HostAgentRuntimeBackend, X as EffectiveBackendSource, Xi as TerminalStreamHandlers, Xn as SandboxCreateOutcome, Xr as SearchMatch, Xt as IntelligenceReportWindow, Y as EffectiveBackendProfile, Yi as TerminalStreamError, Yn as SandboxConnection, Yr as ScopedTokenScope, Yt as IntelligenceReportSubjectType, Z as EgressManager, Zi as TerminalStreamOptions, Zn as SandboxCreateReceipt, Zr as SearchOptions, _ as BranchOptions, _n as ProcessManager, _r as SandboxFleetToken, _t as FleetDispatchCancelResult, a as AttachSandboxFleetMachineOptions, aa as BackendType, ai as SessionFailureReason, an as NetworkConfig, ar as SandboxFleetDriverCapability, at as FileReadBatchOptions, bi as StorageConfig, bn as ProcessStatus, br as SandboxFleetTraceExport, bt as FleetDispatchStreamOptions, c as BackendInfo, ci as SessionInterruptOptions, cn as PermissionLevel, cr as SandboxFleetIntelligenceEnvelope, ct as FileReadResult, d as BatchBackend, di as SessionMessageInputPart, dn as PreviewLinkManager, dr as SandboxFleetMachineRecord, dt as FileTreeFile, ea as BatchEvent, ei as SendSessionMessageOptions, en as ListSandboxFleetOptions, er as SandboxFleetArtifact, et as EventStreamOptions, f as BatchResult, fi as SessionResultOptions, fn as PreviewLinkWaitOptions, fr as SandboxFleetMachineSpec, ft as FileTreeOptions, g as BatchTaskResult, gi as SnapshotResult, gn as ProcessLogEntry, gr as SandboxFleetPolicy, gt as FileWriteResult, h as BatchTask, hi as SnapshotOptions, hn as ProcessListOptions, hr as SandboxFleetOperationsSummary, ht as FileUsageResult, i as AttachGpuLeaseOptions, ia as PublicBatchRunRequest, ii as SessionEventStreamOptions, in as MkdirOptions, ir as SandboxFleetDispatchResponse, it as FileInfo, j as CreateSandboxFleetWithCoordinatorOptions, ji as TeePublicKeyResponse, jn as PublishPublicTemplateVersionOptions, jr as SandboxPortPreviewLink, jt as GitCommit, k as CreateSandboxFleetOptions, ki as TeeAttestationResponse, kn as PublicTemplateVersionInfo, kr as SandboxIntelligenceEnvelope, kt as GitAuth, l as BackendManager, li as SessionListOptions, ln as PermissionsManager, lr as SandboxFleetMachine, lt as FileRenameResult, m as BatchRunRequest, mi as SnapshotInfo, mn as ProcessInfo, mr as SandboxFleetManifestMachine, mt as FileUsageOptions, n as AccessPolicyRule, na as BatchSidecarGroup, ni as SentSessionMessage, nn as McpServerConfig, nr as SandboxFleetCostEstimate, nt as ExecOptions, o as BackendCapabilities, oa as parseBackendType, oi as SessionForkOptions, on as NetworkManager, or as SandboxFleetDriverTimings, ot as FileReadBatchResult, p as BatchRunOptions, pi as SessionStatus, pn as Process, pr as SandboxFleetManifest, pt as FileTreeResult, q as DurablePlanDecisionResult, qi as TerminalStream, qn as SSHCredentials, qr as SandboxUser, qt as IntelligenceReportBudget, r as AddUserOptions, ra as BatchTaskUsage, ri as SessionBackendCredentials, rn as MintScopedTokenOptions, rr as SandboxFleetDispatchFailureClass, rt as ExecResult, s as BackendConfig, si as SessionInfo, sn as NonHostAgentDriverConfig, sr as SandboxFleetInfo, st as FileReadError, t as AcceleratorKind, ta as BatchEventDataMap, ti as SendSessionMessageRequest, tn as ListSandboxOptions, tr as SandboxFleetArtifactSpec, tt as ExactProcessSpawnOptions, u as BackendStatus, ui as SessionMessage, un as PreviewLinkInfo, ur as SandboxFleetMachineMeteredUsage, ut as FileSystem, v as ChunkedUploadOptions, vi as StartupDiagnostics, vn as ProcessSignal, vr as SandboxFleetTraceBundle, vt as FleetDispatchResultBuffer, w as CommitTaskSessionOptions, wi as TaskSessionFileChange, wn as ProvisionEvent, wr as SandboxFleetWorkspaceReconcileResult, xi as SubscriptionInfo, xn as PromptInputPart, xr as SandboxFleetTraceOptions, xt as FleetDriveTurnOutcome, y as ChunkedUploadResult, yi as StartupOperation, yn as ProcessSpawnOptions, yr as SandboxFleetTraceEvent, yt as FleetDispatchResultBufferOptions, z as DispatchedSession, zi as WaitForOptions, zn as Rollout, zr as SandboxTerminalInfo, zt as GpuLeaseExecResult } from "./types-Dpj6Unaq.js";
|
|
2
|
+
import { A as BuildSandboxMcpConfigOptions, C as RespondToPermissionOptions, D as SandboxInteractionResolution, E as SandboxInteractionConflict, F as SandboxMcpServerEntry, I as buildControlPlaneMcpConfig, L as buildSandboxMcpConfig, M as SANDBOX_MCP_SERVER_NAME, N as SandboxMcpConfig, O as SandboxInteractionResult, P as SandboxMcpEndpoint, S as InterruptResult, T as SandboxInteractionCommandResult, _ 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 CONTROL_PLANE_MCP_SERVER_NAME, k as BuildControlPlaneMcpConfigOptions, 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-S1ayJN7d.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-QSo4goVc.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";
|
|
7
|
-
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-
|
|
7
|
+
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-BBZKkva-.js";
|
|
8
8
|
import * as _$_tangle_network_agent_interface0 from "@tangle-network/agent-interface";
|
|
9
9
|
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";
|
|
10
10
|
import { z } from "zod";
|
|
@@ -614,6 +614,9 @@ declare const manageSandboxesInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
614
614
|
xhigh: "xhigh";
|
|
615
615
|
ultracode: "ultracode";
|
|
616
616
|
}>>;
|
|
617
|
+
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
618
|
+
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
619
|
+
maxTotalOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
617
620
|
metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
|
|
618
621
|
}, z.core.$strict>>;
|
|
619
622
|
harness: z.ZodOptional<z.ZodEnum<{
|
|
@@ -939,6 +942,9 @@ declare const manageSandboxesInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
939
942
|
xhigh: "xhigh";
|
|
940
943
|
ultracode: "ultracode";
|
|
941
944
|
}>>;
|
|
945
|
+
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
946
|
+
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
947
|
+
maxTotalOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
942
948
|
metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
|
|
943
949
|
}, z.core.$strict>>;
|
|
944
950
|
harness: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1274,6 +1280,9 @@ declare const manageSandboxesInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1274
1280
|
xhigh: "xhigh";
|
|
1275
1281
|
ultracode: "ultracode";
|
|
1276
1282
|
}>>;
|
|
1283
|
+
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1284
|
+
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
1285
|
+
maxTotalOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1277
1286
|
metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
|
|
1278
1287
|
}, z.core.$strict>>;
|
|
1279
1288
|
harness: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1594,6 +1603,9 @@ declare const manageSandboxesInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1594
1603
|
xhigh: "xhigh";
|
|
1595
1604
|
ultracode: "ultracode";
|
|
1596
1605
|
}>>;
|
|
1606
|
+
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1607
|
+
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
1608
|
+
maxTotalOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1597
1609
|
metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
|
|
1598
1610
|
}, z.core.$strict>>;
|
|
1599
1611
|
harness: z.ZodOptional<z.ZodEnum<{
|
|
@@ -1919,6 +1931,9 @@ declare const manageSandboxesInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
1919
1931
|
xhigh: "xhigh";
|
|
1920
1932
|
ultracode: "ultracode";
|
|
1921
1933
|
}>>;
|
|
1934
|
+
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1935
|
+
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
1936
|
+
maxTotalOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
1922
1937
|
metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
|
|
1923
1938
|
}, z.core.$strict>>;
|
|
1924
1939
|
harness: z.ZodOptional<z.ZodEnum<{
|
|
@@ -2349,6 +2364,9 @@ declare const MANAGE_SANDBOXES_PARAMETERS: z.core.ZodStandardJSONSchemaPayload<z
|
|
|
2349
2364
|
xhigh: "xhigh";
|
|
2350
2365
|
ultracode: "ultracode";
|
|
2351
2366
|
}>>;
|
|
2367
|
+
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
2368
|
+
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
2369
|
+
maxTotalOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
2352
2370
|
metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
|
|
2353
2371
|
}, z.core.$strict>>;
|
|
2354
2372
|
harness: z.ZodOptional<z.ZodEnum<{
|
|
@@ -2674,6 +2692,9 @@ declare const MANAGE_SANDBOXES_PARAMETERS: z.core.ZodStandardJSONSchemaPayload<z
|
|
|
2674
2692
|
xhigh: "xhigh";
|
|
2675
2693
|
ultracode: "ultracode";
|
|
2676
2694
|
}>>;
|
|
2695
|
+
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
2696
|
+
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
2697
|
+
maxTotalOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
2677
2698
|
metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
|
|
2678
2699
|
}, z.core.$strict>>;
|
|
2679
2700
|
harness: z.ZodOptional<z.ZodEnum<{
|
|
@@ -3009,6 +3030,9 @@ declare const MANAGE_SANDBOXES_PARAMETERS: z.core.ZodStandardJSONSchemaPayload<z
|
|
|
3009
3030
|
xhigh: "xhigh";
|
|
3010
3031
|
ultracode: "ultracode";
|
|
3011
3032
|
}>>;
|
|
3033
|
+
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3034
|
+
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
3035
|
+
maxTotalOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3012
3036
|
metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
|
|
3013
3037
|
}, z.core.$strict>>;
|
|
3014
3038
|
harness: z.ZodOptional<z.ZodEnum<{
|
|
@@ -3329,6 +3353,9 @@ declare const MANAGE_SANDBOXES_PARAMETERS: z.core.ZodStandardJSONSchemaPayload<z
|
|
|
3329
3353
|
xhigh: "xhigh";
|
|
3330
3354
|
ultracode: "ultracode";
|
|
3331
3355
|
}>>;
|
|
3356
|
+
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3357
|
+
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
3358
|
+
maxTotalOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3332
3359
|
metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
|
|
3333
3360
|
}, z.core.$strict>>;
|
|
3334
3361
|
harness: z.ZodOptional<z.ZodEnum<{
|
|
@@ -3654,6 +3681,9 @@ declare const MANAGE_SANDBOXES_PARAMETERS: z.core.ZodStandardJSONSchemaPayload<z
|
|
|
3654
3681
|
xhigh: "xhigh";
|
|
3655
3682
|
ultracode: "ultracode";
|
|
3656
3683
|
}>>;
|
|
3684
|
+
maxVisibleOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3685
|
+
maxReasoningTokens: z.ZodOptional<z.ZodNumber>;
|
|
3686
|
+
maxTotalOutputTokens: z.ZodOptional<z.ZodNumber>;
|
|
3657
3687
|
metadata: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
|
|
3658
3688
|
}, z.core.$strict>>;
|
|
3659
3689
|
harness: z.ZodOptional<z.ZodEnum<{
|
|
@@ -4395,4 +4425,4 @@ interface RouterEvalMatrixCaseResult {
|
|
|
4395
4425
|
}
|
|
4396
4426
|
declare function runTangleRouterEvalMatrixInSandbox(options: RunTangleRouterEvalMatrixInSandboxOptions): Promise<RunTangleRouterEvalMatrixInSandboxResult>;
|
|
4397
4427
|
//#endregion
|
|
4398
|
-
export { type AcceleratorKind, type AccessPolicyRule, type AddUserOptions, 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 AgentSubagentProfile, type AnyTokenPayload, type AttachGpuLeaseOptions, type AttachSandboxFleetMachineOptions, AuthError, type BackendCapabilities, type BackendConfig, type BackendInfo, type BackendManager, 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, 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 EffectiveBackend, type EffectiveBackendProfile, type EffectiveBackendSource, 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, 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, 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 InteractiveAuthFile, InteractiveSessionHandle, type InteractiveSessionHost, type InteractiveSessionInfo, type InteractiveSessionStatus, type InterruptResult, type InviteTeamMemberOptions, type IssueCollaborationTokenOptions, type ListMessagesOptions, type ListOptions, type ListSandboxFleetOptions, type ListSandboxOptions, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, type ManageSandboxesInput, type ManageSandboxesTool, type ManageSandboxesToolOptions, type MaterializeProfileFileMountsOptions, type MaterializeProfileFileMountsResult, type McpServerConfig, 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 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 SandboxMcpConfig, type SandboxMcpEndpoint, type SandboxMcpServerEntry, type SandboxPortBinding, type SandboxPortPreviewLink, 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 SessionFailureReason, type SessionForkOptions, type SessionInfo, type SessionInterruptOptions, type SessionListOptions, type SessionMessage, type SessionMessageInputPart, type SessionResultOptions, type SessionStatus, type SnapshotInfo, type SnapshotOptions, type SnapshotResult, type SplitInlineProfileFileMountsResult, type SplitInlineProfileSkillsResult, type StartInteractiveOptions, 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 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 WriteFileOptions, type WriteManyFile, type WriteManyOptions, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, collectAgentFinalMessageText, collectAgentResponseText, createBatchResultAccumulator, createConfidentialSandbox, createManageSandboxesTool, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, isToolBearingEvent, manageSandboxesInputSchema, materializeProfileFileMounts, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseBackendType, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, splitInlineProfileFileMounts, splitInlineProfileSkills, startTeeAttestationHeartbeat, toOtelJson, validateBatchRunRequest, validateDeferredProfileFileMounts };
|
|
4428
|
+
export { type AcceleratorKind, type AccessPolicyRule, type AddUserOptions, 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 AgentSubagentProfile, type AnyTokenPayload, type AttachGpuLeaseOptions, type AttachSandboxFleetMachineOptions, AuthError, type BackendCapabilities, type BackendConfig, type BackendInfo, type BackendManager, 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, 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, type EffectiveBackend, type EffectiveBackendProfile, type EffectiveBackendSource, 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, 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, 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 InteractiveAuthFile, InteractiveSessionHandle, type InteractiveSessionHost, type InteractiveSessionInfo, type InteractiveSessionStatus, type InterruptResult, type InviteTeamMemberOptions, type IssueCollaborationTokenOptions, type ListMessagesOptions, type ListOptions, type ListSandboxFleetOptions, type ListSandboxOptions, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, type ManageSandboxesInput, type ManageSandboxesTool, type ManageSandboxesToolOptions, type MaterializeProfileFileMountsOptions, type MaterializeProfileFileMountsResult, type McpServerConfig, 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 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 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 SessionFailureReason, type SessionForkOptions, type SessionInfo, type SessionInterruptOptions, type SessionListOptions, type SessionMessage, type SessionMessageInputPart, type SessionResultOptions, type SessionStatus, type SnapshotInfo, type SnapshotOptions, type SnapshotResult, type SplitInlineProfileFileMountsResult, type SplitInlineProfileSkillsResult, type StartInteractiveOptions, 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 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 WriteFileOptions, type WriteManyFile, type WriteManyOptions, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, collectAgentFinalMessageText, collectAgentResponseText, createBatchResultAccumulator, createConfidentialSandbox, createManageSandboxesTool, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, isToolBearingEvent, manageSandboxesInputSchema, materializeProfileFileMounts, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseBackendType, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, splitInlineProfileFileMounts, splitInlineProfileSkills, startTeeAttestationHeartbeat, toOtelJson, validateBatchRunRequest, validateDeferredProfileFileMounts };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { h as parseBackendType, m as backendTypeSchema, p as normalizeRuntimeBackendConfig } from "./runtime-api-Co-Ow_VR.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-D2aWy99l.js";
|
|
3
|
-
import { a as splitInlineProfileSkills, c as SandboxFleetClient, i as splitInlineProfileFileMounts, l as createBatchResultAccumulator, n as Sandbox, o as validateDeferredProfileFileMounts, r as materializeProfileFileMounts, s as SandboxFleet, t as IntelligenceClient, u as validateBatchRunRequest } from "./client-
|
|
4
|
-
import {
|
|
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-CLn6Tzx8.js";
|
|
4
|
+
import { S as parseSSEStream, a as WorkspaceImages, b as otelTraceIdForTangleTrace, c as TerminalStreamError, d as InteractiveSessionHandle, f as applySandboxEventText, g as isToolBearingEvent, h as getSandboxEventText, l as SandboxTaskSession, m as collectAgentResponseText, o as TERMINAL_WS_ECHO_SUBPROTOCOL, p as collectAgentFinalMessageText, s as TerminalStream, t as SandboxInstance, u as SandboxSession, v as buildTraceExportPayload, x as toOtelJson, y as exportTraceBundle } from "./sandbox-D2wREqmA.js";
|
|
5
5
|
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-CqPA0kar.js";
|
|
6
|
-
import { t as TangleSandboxClient } from "./tangle-
|
|
6
|
+
import { t as TangleSandboxClient } from "./tangle-CzFPb4Jm.js";
|
|
7
7
|
import { SANDBOX_SIZE_PRESET_NAMES, agentProfileConfidentialSchema, agentProfileSchema } from "@tangle-network/agent-interface";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
//#region src/confidential.ts
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ar as SandboxPortBinding, Br as SandboxTerminalManager, Ci as TaskSessionCommitResult, Fr as SandboxRuntimeHealth, In as RenameOptions, Li as UploadProgress, N as CreateSessionOptions, P as CreateTaskSessionOptions, Qt as ListMessagesOptions, Rr as SandboxTerminalCreateOptions, Si as TaskSessionChanges, Ti as TaskSessionInfo, Vi as WriteFileOptions, Vr as SandboxTerminalRequestOptions, at as FileReadBatchOptions, ei as SendSessionMessageOptions, ft as FileTreeOptions, gt as FileWriteResult, ht as FileUsageResult, lt as FileRenameResult, mt as FileUsageOptions, ni as SentSessionMessage, ot as FileReadBatchResult, pt as FileTreeResult, si as SessionInfo, ti as SendSessionMessageRequest, ui as SessionMessage, v as ChunkedUploadOptions, w as CommitTaskSessionOptions, y as ChunkedUploadResult, zr as SandboxTerminalInfo } from "./types-Dpj6Unaq.js";
|
|
2
2
|
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";
|
|
3
3
|
|
|
4
4
|
//#region src/lib/chunked-upload.d.ts
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { a as uploadChunked, c as combineAbortSignals, d as applyRequestedModel, f as assertCurrentBackendType, i as sessionHeaders, l as encodePromptForWire, n as normalizeSessionInfo, o as SANDBOX_PROXY_REQUEST_MAX_BYTES, p as normalizeRuntimeBackendConfig, r as appendSessionIdQuery, t as SandboxRuntimeApi } from "./runtime-api-Co-Ow_VR.js";
|
|
2
2
|
import { a as NetworkError, c as QuotaError, d as StateError, f as TimeoutError, l as SandboxError, m as parseErrorResponse, n as CapabilityError, o as NotFoundError, p as ValidationError, t as AuthError, u as ServerError } from "./errors-D2aWy99l.js";
|
|
3
|
-
import { AgentExactRunControlRefSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, agentRunCancellationAcknowledgementMatchesRequest, canonicalCandidateDigest } from "@tangle-network/agent-interface";
|
|
3
|
+
import { AgentExactRunControlRefSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, InteractionAcknowledgementSchema, InteractionBindingSchema, InteractionRequestSchema, InteractionResponseCommandSchema, InteractionResponseSchema, agentRunCancellationAcknowledgementMatchesRequest, canonicalCandidateDigest, sha256DigestSchema } from "@tangle-network/agent-interface";
|
|
4
|
+
import { z } from "zod";
|
|
4
5
|
import { readTokenCostUsd, readTokenUsage } from "@tangle-network/agent-core";
|
|
5
6
|
//#region src/lib/sse-parser.ts
|
|
6
7
|
/**
|
|
@@ -498,6 +499,226 @@ function validateAcceptedDispatchRunRef(raw, expected, sandboxId, sessionId, exe
|
|
|
498
499
|
return accepted;
|
|
499
500
|
}
|
|
500
501
|
//#endregion
|
|
502
|
+
//#region src/interaction-response.ts
|
|
503
|
+
const APPLIED_INTERACTION_STATUS = z.enum(["accepted", "already_resolved_same"]);
|
|
504
|
+
const REFUSED_INTERACTION_STATUS = z.enum(["already_resolved_different", "binding_mismatch"]);
|
|
505
|
+
const InteractionResolutionSchema = z.strictObject({
|
|
506
|
+
status: APPLIED_INTERACTION_STATUS,
|
|
507
|
+
operationId: z.string().min(1),
|
|
508
|
+
responseDigest: sha256DigestSchema,
|
|
509
|
+
interactionId: z.string().min(1),
|
|
510
|
+
sessionId: z.string().min(1),
|
|
511
|
+
outcome: z.enum([
|
|
512
|
+
"accepted",
|
|
513
|
+
"declined",
|
|
514
|
+
"cancelled"
|
|
515
|
+
]),
|
|
516
|
+
delivered: z.boolean(),
|
|
517
|
+
resolvedAt: z.string().min(1),
|
|
518
|
+
binding: InteractionBindingSchema.optional()
|
|
519
|
+
});
|
|
520
|
+
const InteractionResolutionEnvelopeSchema = z.object({
|
|
521
|
+
success: z.literal(true),
|
|
522
|
+
resolution: InteractionResolutionSchema
|
|
523
|
+
});
|
|
524
|
+
const InteractionConflictEnvelopeSchema = z.object({
|
|
525
|
+
success: z.literal(false),
|
|
526
|
+
currentState: REFUSED_INTERACTION_STATUS,
|
|
527
|
+
error: z.object({
|
|
528
|
+
code: z.string().min(1),
|
|
529
|
+
message: z.string().min(1),
|
|
530
|
+
status: REFUSED_INTERACTION_STATUS,
|
|
531
|
+
existingResponseDigest: sha256DigestSchema.optional(),
|
|
532
|
+
existingOperationId: z.string().min(1).optional(),
|
|
533
|
+
resolvedAt: z.string().min(1).optional()
|
|
534
|
+
})
|
|
535
|
+
});
|
|
536
|
+
const InteractionListEnvelopeSchema = z.object({
|
|
537
|
+
success: z.literal(true),
|
|
538
|
+
data: z.object({ interactions: z.array(InteractionRequestSchema) })
|
|
539
|
+
});
|
|
540
|
+
function invalidRuntimeResponse(message, response, endpoint) {
|
|
541
|
+
return new ServerError(message, 502, {
|
|
542
|
+
origin: "runtime",
|
|
543
|
+
endpoint,
|
|
544
|
+
sidecarVersion: response.headers.get("x-sidecar-version") ?? void 0,
|
|
545
|
+
containerImage: response.headers.get("x-sidecar-image") ?? response.headers.get("x-sidecar-image-tag") ?? void 0
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
function parseJson(body, response, endpoint) {
|
|
549
|
+
try {
|
|
550
|
+
return JSON.parse(body);
|
|
551
|
+
} catch {
|
|
552
|
+
throw invalidRuntimeResponse("Sidecar returned an invalid interaction response", response, endpoint);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
function bindingsEqual(left, right) {
|
|
556
|
+
return left.requestDigest === right.requestDigest && left.runId === right.runId && left.provider === right.provider && left.environmentId === right.environmentId && left.sessionId === right.sessionId && left.executionId === right.executionId && left.interactionId === right.interactionId;
|
|
557
|
+
}
|
|
558
|
+
function assertResolutionMatches(resolution, sessionId, submitted, response, endpoint) {
|
|
559
|
+
const expectedDigest = canonicalCandidateDigest(submitted);
|
|
560
|
+
if (resolution.sessionId !== sessionId || resolution.interactionId !== submitted.id || resolution.outcome !== submitted.outcome || resolution.responseDigest !== expectedDigest) throw invalidRuntimeResponse("Sidecar returned a resolution for another interaction response", response, endpoint);
|
|
561
|
+
}
|
|
562
|
+
/** Parse one interaction response without discarding replay information. */
|
|
563
|
+
async function readInteractionResult(response, endpoint, sessionId, submitted) {
|
|
564
|
+
const body = await response.text();
|
|
565
|
+
if (response.ok) {
|
|
566
|
+
const parsed = InteractionResolutionEnvelopeSchema.safeParse(parseJson(body, response, endpoint));
|
|
567
|
+
if (!parsed.success) throw invalidRuntimeResponse("Sidecar returned an invalid interaction resolution", response, endpoint);
|
|
568
|
+
assertResolutionMatches(parsed.data.resolution, sessionId, submitted, response, endpoint);
|
|
569
|
+
return parsed.data.resolution;
|
|
570
|
+
}
|
|
571
|
+
if (response.status === 409) {
|
|
572
|
+
const parsed = InteractionConflictEnvelopeSchema.safeParse(parseJson(body, response, endpoint));
|
|
573
|
+
if (!parsed.success || parsed.data.currentState !== parsed.data.error.status) throw invalidRuntimeResponse("Sidecar returned an invalid interaction conflict", response, endpoint);
|
|
574
|
+
return {
|
|
575
|
+
status: parsed.data.error.status,
|
|
576
|
+
message: parsed.data.error.message,
|
|
577
|
+
...parsed.data.error.existingResponseDigest === void 0 ? {} : { existingResponseDigest: parsed.data.error.existingResponseDigest },
|
|
578
|
+
...parsed.data.error.existingOperationId === void 0 ? {} : { existingOperationId: parsed.data.error.existingOperationId },
|
|
579
|
+
...parsed.data.error.resolvedAt === void 0 ? {} : { resolvedAt: parsed.data.error.resolvedAt }
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
throw parseErrorResponse(response.status, body, {
|
|
583
|
+
method: "POST",
|
|
584
|
+
path: endpoint
|
|
585
|
+
}, response.headers);
|
|
586
|
+
}
|
|
587
|
+
/** Convert a command result into the shared retry-safe acknowledgement. */
|
|
588
|
+
function interactionAcknowledgement(command, result) {
|
|
589
|
+
if ("interactionId" in result && (result.binding === void 0 || !bindingsEqual(result.binding, command.binding))) throw new ServerError("Sidecar did not return the exact interaction binding for this command", 502, {
|
|
590
|
+
origin: "runtime",
|
|
591
|
+
endpoint: "/agents/sessions/:id/interactions"
|
|
592
|
+
});
|
|
593
|
+
const status = "delivered" in result && !result.delivered ? "transport_failure" : result.status;
|
|
594
|
+
const message = status === "transport_failure" ? `Interaction ${command.binding.interactionId} is recorded but delivery is not confirmed` : "message" in result ? result.message : void 0;
|
|
595
|
+
return {
|
|
596
|
+
acknowledgement: commandAcknowledgement(command, status, {
|
|
597
|
+
...message === void 0 ? {} : { message },
|
|
598
|
+
...status === "transport_failure" ? { retryable: true } : {}
|
|
599
|
+
}),
|
|
600
|
+
serverResult: result
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
function commandAcknowledgement(command, status, extras = {}) {
|
|
604
|
+
return InteractionAcknowledgementSchema.parse({
|
|
605
|
+
operationId: command.operationId,
|
|
606
|
+
binding: command.binding,
|
|
607
|
+
commandDigest: command.commandDigest,
|
|
608
|
+
status,
|
|
609
|
+
...extras.message === void 0 ? {} : { message: extras.message },
|
|
610
|
+
...extras.retryable === void 0 ? {} : { retryable: extras.retryable }
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
function commandHttpFailure(command, error) {
|
|
614
|
+
const message = error.message;
|
|
615
|
+
switch (error.status) {
|
|
616
|
+
case 400: return { acknowledgement: commandAcknowledgement(command, "invalid_response", { message }) };
|
|
617
|
+
case 404: return { acknowledgement: commandAcknowledgement(command, error.code === "SESSION_NOT_FOUND" ? "unknown_run" : "unknown_interaction", { message }) };
|
|
618
|
+
case 408:
|
|
619
|
+
case 429: return { acknowledgement: commandAcknowledgement(command, "transport_failure", {
|
|
620
|
+
message,
|
|
621
|
+
retryable: true
|
|
622
|
+
}) };
|
|
623
|
+
case 410: return { acknowledgement: commandAcknowledgement(command, "expired", { message }) };
|
|
624
|
+
case 501: return { acknowledgement: commandAcknowledgement(command, "transport_failure", {
|
|
625
|
+
message,
|
|
626
|
+
retryable: false
|
|
627
|
+
}) };
|
|
628
|
+
default: return error.status !== void 0 && error.status >= 500 ? { acknowledgement: commandAcknowledgement(command, "transport_failure", {
|
|
629
|
+
message,
|
|
630
|
+
retryable: true
|
|
631
|
+
}) } : void 0;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
/** Parse and validate the outstanding interaction set returned by a session. */
|
|
635
|
+
async function readOutstandingInteractions(response, endpoint) {
|
|
636
|
+
const body = await response.text();
|
|
637
|
+
if (!response.ok) throw parseErrorResponse(response.status, body, {
|
|
638
|
+
method: "GET",
|
|
639
|
+
path: endpoint
|
|
640
|
+
}, response.headers);
|
|
641
|
+
const parsed = InteractionListEnvelopeSchema.safeParse(parseJson(body, response, endpoint));
|
|
642
|
+
if (!parsed.success) throw invalidRuntimeResponse("Sidecar returned an invalid interaction list", response, endpoint);
|
|
643
|
+
return parsed.data.data.interactions;
|
|
644
|
+
}
|
|
645
|
+
async function prepareTransport(transport, signal) {
|
|
646
|
+
signal?.throwIfAborted();
|
|
647
|
+
await transport.ensureRunning();
|
|
648
|
+
signal?.throwIfAborted();
|
|
649
|
+
}
|
|
650
|
+
function interactionEndpoint(sessionId) {
|
|
651
|
+
return `/agents/sessions/${encodeURIComponent(sessionId)}/interactions`;
|
|
652
|
+
}
|
|
653
|
+
/** Read the exact outstanding set through one validated transport path. */
|
|
654
|
+
async function listSandboxInteractions(transport, sessionId, options) {
|
|
655
|
+
await prepareTransport(transport, options?.signal);
|
|
656
|
+
const endpoint = interactionEndpoint(sessionId);
|
|
657
|
+
return readOutstandingInteractions(await transport.fetch(endpoint, {
|
|
658
|
+
method: "GET",
|
|
659
|
+
...options?.signal === void 0 ? {} : { signal: options.signal }
|
|
660
|
+
}), endpoint);
|
|
661
|
+
}
|
|
662
|
+
/** Submit a plain response and preserve the server's durable result. */
|
|
663
|
+
async function submitSandboxInteractionResponse(transport, sessionId, submitted, options) {
|
|
664
|
+
const parsed = InteractionResponseSchema.safeParse(submitted);
|
|
665
|
+
if (!parsed.success) throw new ValidationError("Invalid interaction response", { response: parsed.error.message });
|
|
666
|
+
await prepareTransport(transport, options?.signal);
|
|
667
|
+
const endpoint = interactionEndpoint(sessionId);
|
|
668
|
+
return readInteractionResult(await transport.fetch(endpoint, {
|
|
669
|
+
method: "POST",
|
|
670
|
+
headers: { "content-type": "application/json" },
|
|
671
|
+
body: JSON.stringify(parsed.data),
|
|
672
|
+
...options?.signal === void 0 ? {} : { signal: options.signal }
|
|
673
|
+
}), endpoint, sessionId, parsed.data);
|
|
674
|
+
}
|
|
675
|
+
/** Submit one digest-bound command and return the shared acknowledgement. */
|
|
676
|
+
async function submitSandboxInteractionCommand(transport, sessionId, command, options) {
|
|
677
|
+
const parsed = InteractionResponseCommandSchema.safeParse(command);
|
|
678
|
+
if (!parsed.success) throw new ValidationError("Invalid interaction response command", { commandDigest: parsed.error.message });
|
|
679
|
+
if (parsed.data.binding.sessionId !== sessionId) throw new ValidationError("Interaction response command does not belong to this session", { "binding.sessionId": `Expected ${sessionId}` });
|
|
680
|
+
if (parsed.data.binding.environmentId !== transport.environmentId) throw new ValidationError("Interaction response command does not belong to this sandbox", { "binding.environmentId": `Expected ${transport.environmentId}` });
|
|
681
|
+
try {
|
|
682
|
+
await prepareTransport(transport, options?.signal);
|
|
683
|
+
} catch (error) {
|
|
684
|
+
options?.signal?.throwIfAborted();
|
|
685
|
+
if (error instanceof NetworkError) return { acknowledgement: commandAcknowledgement(parsed.data, "transport_failure", {
|
|
686
|
+
message: error.message,
|
|
687
|
+
retryable: true
|
|
688
|
+
}) };
|
|
689
|
+
throw error;
|
|
690
|
+
}
|
|
691
|
+
const endpoint = interactionEndpoint(sessionId);
|
|
692
|
+
let response;
|
|
693
|
+
try {
|
|
694
|
+
response = await transport.fetch(endpoint, {
|
|
695
|
+
method: "POST",
|
|
696
|
+
headers: { "content-type": "application/json" },
|
|
697
|
+
body: JSON.stringify(parsed.data),
|
|
698
|
+
...options?.signal === void 0 ? {} : { signal: options.signal }
|
|
699
|
+
});
|
|
700
|
+
} catch (error) {
|
|
701
|
+
options?.signal?.throwIfAborted();
|
|
702
|
+
if (error instanceof NetworkError) return { acknowledgement: commandAcknowledgement(parsed.data, "transport_failure", {
|
|
703
|
+
message: error.message,
|
|
704
|
+
retryable: true
|
|
705
|
+
}) };
|
|
706
|
+
throw error;
|
|
707
|
+
}
|
|
708
|
+
if (!response.ok && response.status !== 409) {
|
|
709
|
+
const body = await response.text();
|
|
710
|
+
const error = parseErrorResponse(response.status, body, {
|
|
711
|
+
method: "POST",
|
|
712
|
+
path: endpoint
|
|
713
|
+
}, response.headers);
|
|
714
|
+
const acknowledgement = commandHttpFailure(parsed.data, error);
|
|
715
|
+
if (acknowledgement) return acknowledgement;
|
|
716
|
+
throw error;
|
|
717
|
+
}
|
|
718
|
+
const result = await readInteractionResult(response, endpoint, sessionId, parsed.data.response);
|
|
719
|
+
return interactionAcknowledgement(parsed.data, result);
|
|
720
|
+
}
|
|
721
|
+
//#endregion
|
|
501
722
|
//#region src/lib/agent-response-text.ts
|
|
502
723
|
/**
|
|
503
724
|
* Canonical extraction of an agent's response text from its sandbox event
|
|
@@ -879,6 +1100,14 @@ var SandboxSession = class SandboxSession {
|
|
|
879
1100
|
async respondToPermission(permissionID, options) {
|
|
880
1101
|
return this.box._respondToPermission(this.id, permissionID, options);
|
|
881
1102
|
}
|
|
1103
|
+
/** Return every interaction that still awaits a response on this session. */
|
|
1104
|
+
async interactions(options) {
|
|
1105
|
+
return this.box._listInteractions(this.id, options);
|
|
1106
|
+
}
|
|
1107
|
+
/** Respond to one exact interaction with a retry-safe command. */
|
|
1108
|
+
async respondToInteraction(command, options) {
|
|
1109
|
+
return this.box._respondToInteraction(this.id, command, options);
|
|
1110
|
+
}
|
|
882
1111
|
/**
|
|
883
1112
|
* Interrupt an execution without deleting the session. Pass `executionId`
|
|
884
1113
|
* to make the cancellation exact: a newer run on the same session is never
|
|
@@ -896,15 +1125,9 @@ var SandboxSession = class SandboxSession {
|
|
|
896
1125
|
async cancelRun(request, options) {
|
|
897
1126
|
return this.box._cancelRun(this.id, request, options);
|
|
898
1127
|
}
|
|
899
|
-
/**
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
* with any backend that raises kind:"question" interactions — OpenCode
|
|
903
|
-
* natively, or CLI backends with `BackendConfig.interactions.question`
|
|
904
|
-
* enabled. Backends with no question support reject loudly.
|
|
905
|
-
*/
|
|
906
|
-
async answer(answers) {
|
|
907
|
-
return this.box._answerQuestion(this.id, answers);
|
|
1128
|
+
/** Answer one exact question without selecting another outstanding ask. */
|
|
1129
|
+
async answer(interactionId, answers, options) {
|
|
1130
|
+
return this.box._answerQuestion(this.id, interactionId, answers, options);
|
|
908
1131
|
}
|
|
909
1132
|
/** Return the newest plan awaiting a decision for this session. */
|
|
910
1133
|
async plan() {
|
|
@@ -1531,6 +1754,30 @@ function normalizeStartupDiagnostics(raw) {
|
|
|
1531
1754
|
phases
|
|
1532
1755
|
};
|
|
1533
1756
|
}
|
|
1757
|
+
const SANDBOX_CREATE_OUTCOMES = [
|
|
1758
|
+
"created",
|
|
1759
|
+
"idempotent_replay",
|
|
1760
|
+
"unknown"
|
|
1761
|
+
];
|
|
1762
|
+
/**
|
|
1763
|
+
* Normalize the raw `createReceipt` field from a sandbox API response into a
|
|
1764
|
+
* {@link SandboxCreateReceipt}. Returns `null` when the payload is absent or
|
|
1765
|
+
* carries no boolean `idempotencyKeyApplied` — the platform emits the receipt
|
|
1766
|
+
* only on the create response, so most reads have no payload to normalize.
|
|
1767
|
+
*
|
|
1768
|
+
* An outcome this SDK version does not know becomes `unknown`: only a known
|
|
1769
|
+
* `created` proves that the call allocated the environment.
|
|
1770
|
+
*/
|
|
1771
|
+
function normalizeSandboxCreateReceipt(raw) {
|
|
1772
|
+
if (!raw || typeof raw !== "object") return null;
|
|
1773
|
+
const record = raw;
|
|
1774
|
+
const idempotencyKeyApplied = record.idempotencyKeyApplied;
|
|
1775
|
+
if (typeof idempotencyKeyApplied !== "boolean") return null;
|
|
1776
|
+
return {
|
|
1777
|
+
outcome: SANDBOX_CREATE_OUTCOMES.includes(record.outcome) ? record.outcome : "unknown",
|
|
1778
|
+
idempotencyKeyApplied
|
|
1779
|
+
};
|
|
1780
|
+
}
|
|
1534
1781
|
/**
|
|
1535
1782
|
* Replace bearer-secret fields on a `SandboxConnection` with a sentinel
|
|
1536
1783
|
* before serialization. The serialized shape is preserved (so external
|
|
@@ -2026,6 +2273,25 @@ var SandboxInstance = class SandboxInstance {
|
|
|
2026
2273
|
return this.info.startupDiagnostics ?? null;
|
|
2027
2274
|
}
|
|
2028
2275
|
/**
|
|
2276
|
+
* The platform verdict for the create call that returned this sandbox: did
|
|
2277
|
+
* the call allocate the environment, or did it replay an earlier create that
|
|
2278
|
+
* carried the same idempotency key.
|
|
2279
|
+
*
|
|
2280
|
+
* Present only on a freshly created box; `null` for a box resolved by id and
|
|
2281
|
+
* `null` when the platform reported no receipt. Delete the environment only
|
|
2282
|
+
* on a `created` outcome — every other value permits another caller to hold
|
|
2283
|
+
* it, and a delete then destroys work that caller depends on.
|
|
2284
|
+
*
|
|
2285
|
+
* @example
|
|
2286
|
+
* ```typescript
|
|
2287
|
+
* const receipt = box.createReceipt();
|
|
2288
|
+
* if (receipt?.outcome === "created") await box.delete();
|
|
2289
|
+
* ```
|
|
2290
|
+
*/
|
|
2291
|
+
createReceipt() {
|
|
2292
|
+
return this.info.createReceipt ?? null;
|
|
2293
|
+
}
|
|
2294
|
+
/**
|
|
2029
2295
|
* Serialize to the public sandbox shape for logs and structured
|
|
2030
2296
|
* output. Secrets in `connection` (currently `authToken`) are
|
|
2031
2297
|
* redacted so that `JSON.stringify(box)` is safe to ship to log
|
|
@@ -2143,7 +2409,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
2143
2409
|
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
2144
2410
|
}
|
|
2145
2411
|
const data = await response.json();
|
|
2146
|
-
this.info = this.parseInfo(data);
|
|
2412
|
+
this.info = this.parseInfo(data, this.info);
|
|
2147
2413
|
sandboxStatusObservedAt.set(this, Date.now());
|
|
2148
2414
|
}
|
|
2149
2415
|
/**
|
|
@@ -5435,7 +5701,18 @@ var SandboxInstance = class SandboxInstance {
|
|
|
5435
5701
|
sessionId: data.sessionId ?? opts.sessionId
|
|
5436
5702
|
};
|
|
5437
5703
|
}
|
|
5438
|
-
|
|
5704
|
+
/**
|
|
5705
|
+
* Parse a sandbox API payload into `SandboxInfo`.
|
|
5706
|
+
*
|
|
5707
|
+
* `carryCreateFacts` supplies the create-time facts a refresh must keep:
|
|
5708
|
+
* the GPU lease, the startup diagnostics, and the create receipt each arrive
|
|
5709
|
+
* once on the create response and are absent from every later payload. They
|
|
5710
|
+
* describe ONE environment's creation, so they travel only when the payload
|
|
5711
|
+
* describes that same environment. A payload for a different sandbox — a
|
|
5712
|
+
* branch child parsed through its parent — passes no carry, or the child
|
|
5713
|
+
* would report its parent's create verdict.
|
|
5714
|
+
*/
|
|
5715
|
+
parseInfo(data, carryCreateFacts) {
|
|
5439
5716
|
const id = data.id ?? this.id;
|
|
5440
5717
|
const incarnation = readFilesystemIncarnationTuple(data);
|
|
5441
5718
|
const incarnationComplete = incarnation.complete;
|
|
@@ -5455,8 +5732,9 @@ var SandboxInstance = class SandboxInstance {
|
|
|
5455
5732
|
lastActivityAt: data.lastActivityAt ? new Date(data.lastActivityAt) : void 0,
|
|
5456
5733
|
expiresAt: data.expiresAt ? new Date(data.expiresAt) : void 0,
|
|
5457
5734
|
error: data.error,
|
|
5458
|
-
gpuLease: data.gpuLease ??
|
|
5459
|
-
startupDiagnostics: normalizeStartupDiagnostics(data.startupDiagnostics) ??
|
|
5735
|
+
gpuLease: data.gpuLease ?? carryCreateFacts?.gpuLease,
|
|
5736
|
+
startupDiagnostics: normalizeStartupDiagnostics(data.startupDiagnostics) ?? carryCreateFacts?.startupDiagnostics,
|
|
5737
|
+
createReceipt: normalizeSandboxCreateReceipt(data.createReceipt) ?? carryCreateFacts?.createReceipt
|
|
5460
5738
|
};
|
|
5461
5739
|
}
|
|
5462
5740
|
sleep(ms) {
|
|
@@ -6093,10 +6371,24 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6093
6371
|
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
6094
6372
|
}
|
|
6095
6373
|
}
|
|
6374
|
+
interactionTransport() {
|
|
6375
|
+
return {
|
|
6376
|
+
environmentId: this.id,
|
|
6377
|
+
ensureRunning: () => this.ensureRunning(),
|
|
6378
|
+
fetch: (endpoint, request) => this.runtimeFetch(endpoint, request)
|
|
6379
|
+
};
|
|
6380
|
+
}
|
|
6381
|
+
/** @internal — invoked by SandboxSession.interactions(). */
|
|
6382
|
+
async _listInteractions(id, options) {
|
|
6383
|
+
return listSandboxInteractions(this.interactionTransport(), id, options);
|
|
6384
|
+
}
|
|
6385
|
+
/** @internal — invoked by SandboxSession.respondToInteraction(). */
|
|
6386
|
+
async _respondToInteraction(id, command, options) {
|
|
6387
|
+
return submitSandboxInteractionCommand(this.interactionTransport(), id, command, options);
|
|
6388
|
+
}
|
|
6096
6389
|
/** @internal — invoked by SandboxSession.respondToPermission(). */
|
|
6097
6390
|
async _respondToPermission(id, permissionID, options) {
|
|
6098
|
-
|
|
6099
|
-
const body = options.response === "allow" ? {
|
|
6391
|
+
const response = options.response === "allow" ? {
|
|
6100
6392
|
id: permissionID,
|
|
6101
6393
|
outcome: "accepted",
|
|
6102
6394
|
data: { grant: ["allow_once"] }
|
|
@@ -6104,14 +6396,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6104
6396
|
id: permissionID,
|
|
6105
6397
|
outcome: "declined"
|
|
6106
6398
|
};
|
|
6107
|
-
|
|
6108
|
-
method: "POST",
|
|
6109
|
-
body: JSON.stringify(body)
|
|
6110
|
-
});
|
|
6111
|
-
if (!response.ok) {
|
|
6112
|
-
const errBody = await response.text();
|
|
6113
|
-
throw parseErrorResponse(response.status, errBody, void 0, response.headers);
|
|
6114
|
-
}
|
|
6399
|
+
return submitSandboxInteractionResponse(this.interactionTransport(), id, response, options.signal === void 0 ? void 0 : { signal: options.signal });
|
|
6115
6400
|
}
|
|
6116
6401
|
/** @internal — invoked by SandboxSession.interrupt(). */
|
|
6117
6402
|
async _interrupt(id, options) {
|
|
@@ -6172,50 +6457,13 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6172
6457
|
}
|
|
6173
6458
|
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
6174
6459
|
}
|
|
6175
|
-
/**
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
await this.ensureRunning();
|
|
6183
|
-
const listResp = await this.runtimeFetch(`/agents/sessions/${encodeURIComponent(id)}/interactions`, { method: "GET" });
|
|
6184
|
-
if (!listResp.ok) {
|
|
6185
|
-
const body = await listResp.text();
|
|
6186
|
-
throw parseErrorResponse(listResp.status, body, void 0, listResp.headers);
|
|
6187
|
-
}
|
|
6188
|
-
const outstanding = ((await listResp.json()).data?.interactions ?? []).find((r) => r.kind === "question");
|
|
6189
|
-
if (!outstanding) throw new Error("No outstanding question to answer for this session");
|
|
6190
|
-
const positional = Object.values(answers);
|
|
6191
|
-
const data = {};
|
|
6192
|
-
outstanding.answerSpec.fields.forEach((field, index) => {
|
|
6193
|
-
const raw = answers[field.name] ?? answers[String(index)] ?? positional[index] ?? [];
|
|
6194
|
-
switch (field.type) {
|
|
6195
|
-
case "select":
|
|
6196
|
-
data[field.name] = raw;
|
|
6197
|
-
break;
|
|
6198
|
-
case "number":
|
|
6199
|
-
data[field.name] = Number(raw[0] ?? 0);
|
|
6200
|
-
break;
|
|
6201
|
-
case "boolean":
|
|
6202
|
-
data[field.name] = raw[0] === "true";
|
|
6203
|
-
break;
|
|
6204
|
-
default: data[field.name] = raw[0] ?? "";
|
|
6205
|
-
}
|
|
6206
|
-
});
|
|
6207
|
-
const response = await this.runtimeFetch(`/agents/sessions/${encodeURIComponent(id)}/interactions`, {
|
|
6208
|
-
method: "POST",
|
|
6209
|
-
body: JSON.stringify({
|
|
6210
|
-
id: outstanding.id,
|
|
6211
|
-
outcome: "accepted",
|
|
6212
|
-
data
|
|
6213
|
-
})
|
|
6214
|
-
});
|
|
6215
|
-
if (!response.ok) {
|
|
6216
|
-
const body = await response.text();
|
|
6217
|
-
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
6218
|
-
}
|
|
6460
|
+
/** @internal — invoked by SandboxSession.answer(). */
|
|
6461
|
+
async _answerQuestion(id, interactionId, answers, options) {
|
|
6462
|
+
return submitSandboxInteractionResponse(this.interactionTransport(), id, {
|
|
6463
|
+
id: interactionId,
|
|
6464
|
+
outcome: "accepted",
|
|
6465
|
+
data: answers
|
|
6466
|
+
}, options);
|
|
6219
6467
|
}
|
|
6220
6468
|
/** @internal — invoked by SandboxSession.plan(). */
|
|
6221
6469
|
async _currentPlan(sessionId) {
|
|
@@ -6245,11 +6493,25 @@ var SandboxInstance = class SandboxInstance {
|
|
|
6245
6493
|
throw parseErrorResponse(response.status, body, void 0, response.headers);
|
|
6246
6494
|
}
|
|
6247
6495
|
const decoded = await response.json();
|
|
6248
|
-
|
|
6496
|
+
const followUpState = decoded.followUp?.state;
|
|
6497
|
+
if (!decoded.plan || typeof decoded.followUp?.turnId !== "string" || ![
|
|
6498
|
+
"queued",
|
|
6499
|
+
"leased",
|
|
6500
|
+
"started",
|
|
6501
|
+
"completed",
|
|
6502
|
+
"failed"
|
|
6503
|
+
].includes(String(followUpState)) || typeof decoded.idempotent !== "boolean") throw new ServerError("Plan decision response is invalid", 502, {
|
|
6249
6504
|
endpoint: path,
|
|
6250
6505
|
origin: "control-plane"
|
|
6251
6506
|
});
|
|
6252
|
-
return
|
|
6507
|
+
return {
|
|
6508
|
+
plan: decoded.plan,
|
|
6509
|
+
followUp: {
|
|
6510
|
+
turnId: decoded.followUp.turnId,
|
|
6511
|
+
state: followUpState
|
|
6512
|
+
},
|
|
6513
|
+
idempotent: decoded.idempotent
|
|
6514
|
+
};
|
|
6253
6515
|
}
|
|
6254
6516
|
};
|
|
6255
6517
|
function isSessionAwaitingFirstTurn(info) {
|
|
@@ -6350,4 +6612,4 @@ function quoteForShell(value) {
|
|
|
6350
6612
|
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
6351
6613
|
}
|
|
6352
6614
|
//#endregion
|
|
6353
|
-
export {
|
|
6615
|
+
export { parseSSEStream as S, normalizeConnection as _, WorkspaceImages as a, otelTraceIdForTangleTrace as b, TerminalStreamError as c, InteractiveSessionHandle as d, applySandboxEventText as f, isToolBearingEvent as g, getSandboxEventText as h, normalizeStartupDiagnostics as i, SandboxTaskSession as l, collectAgentResponseText as m, createSandboxInstanceFromResponse as n, TERMINAL_WS_ECHO_SUBPROTOCOL as o, collectAgentFinalMessageText as p, normalizeSandboxCreateReceipt as r, TerminalStream as s, SandboxInstance as t, SandboxSession as u, buildTraceExportPayload as v, toOtelJson as x, exportTraceBundle as y };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { AgentProfile, AgentRunCancellationAcknowledgement, AgentRunCancellationRequest } from "@tangle-network/agent-interface";
|
|
1
|
+
import { $n as SandboxEvent, Ar as SandboxPortBinding, At as GitBranch, Bi as WaitForRolloutOptions, Bt as GpuLeaseManager, Ci as TaskSessionCommitResult, Cn as PromptResult, Di as TeeAttestationOptions, Fr as SandboxRuntimeHealth, Ft as GpuLease, Gt as InstalledTool, H as DriveTurnOptions, Hi as WriteManyFile, Hr as SandboxTerminals, Ir as SandboxStatus, Jr as ScopedToken, Jt as IntelligenceReportCompareTo, K as DurablePlan, Kn as SSHCommandDescriptor, Kr as SandboxTraceOptions, Kt as IntelligenceReport, Ln as RestoreSnapshotOptions, Lr as SandboxTerminalAttachOptions, Mr as SandboxResourceUsage, N as CreateSessionOptions, Nt as GitDiff, Or as SandboxInfo, P as CreateTaskSessionOptions, Pi as TurnDriveResult, Pr as SandboxRuntimeCapabilities, Pt as GitStatus, Qt as ListMessagesOptions, R as DispatchPromptOptions, Rn as ResumeOptions, S as CodeLanguage, Si as TaskSessionChanges, Sn as PromptOptions, T as CompletedTurnResult, Ti as TaskSessionInfo, Tn as ProvisionResult, Ui as WriteManyOptions, Un as RolloutStartResult, Ur as SandboxTraceBundle, Vi as WriteFileOptions, Vn as RolloutOptions, W as DriverInfo, Xi as TerminalStreamHandlers, Xr as SearchMatch, Xt as IntelligenceReportWindow, Yn as SandboxConnection, Z as EgressManager, Zn as SandboxCreateReceipt, Zr as SearchOptions, Zt as JsonValue, _ as BranchOptions, _n as ProcessManager, aa as BackendType, b as CodeExecutionOptions, ci as SessionInterruptOptions, dn as PreviewLinkManager, ei as SendSessionMessageOptions, et as EventStreamOptions, fi as SessionResultOptions, gi as SnapshotResult, gt as FileWriteResult, hi as SnapshotOptions, ii as SessionEventStreamOptions, ji as TeePublicKeyResponse, jt as GitCommit, ki as TeeAttestationResponse, l as BackendManager, li as SessionListOptions, ln as PermissionsManager, mi as SnapshotInfo, ni as SentSessionMessage, nt as ExecOptions, oi as SessionForkOptions, on as NetworkManager, q as DurablePlanDecisionResult, qi as TerminalStream, qn as SSHCredentials, qt as IntelligenceReportBudget, rn as MintScopedTokenOptions, rt as ExecResult, s as BackendConfig, si as SessionInfo, ti as SendSessionMessageRequest, ui as SessionMessage, ut as FileSystem, vi as StartupDiagnostics, vr as SandboxFleetTraceBundle, w as CommitTaskSessionOptions, wn as ProvisionEvent, x as CodeExecutionResult, xn as PromptInputPart, z as DispatchedSession, zi as WaitForOptions, zn as Rollout } from "./types-Dpj6Unaq.js";
|
|
2
|
+
import { AgentProfile, AgentRunCancellationAcknowledgement, AgentRunCancellationRequest, InteractionAcknowledgement, InteractionData, InteractionRequest, InteractionResponseCommand } from "@tangle-network/agent-interface";
|
|
3
|
+
import { z } from "zod";
|
|
3
4
|
|
|
4
5
|
//#region src/mcp.d.ts
|
|
5
6
|
/**
|
|
@@ -112,6 +113,52 @@ declare function buildControlPlaneMcpConfig(options: BuildControlPlaneMcpConfigO
|
|
|
112
113
|
config: SandboxMcpConfig;
|
|
113
114
|
};
|
|
114
115
|
//#endregion
|
|
116
|
+
//#region src/interaction-response.d.ts
|
|
117
|
+
declare const REFUSED_INTERACTION_STATUS: z.ZodEnum<{
|
|
118
|
+
already_resolved_different: "already_resolved_different";
|
|
119
|
+
binding_mismatch: "binding_mismatch";
|
|
120
|
+
}>;
|
|
121
|
+
declare const InteractionResolutionSchema: z.ZodObject<{
|
|
122
|
+
status: z.ZodEnum<{
|
|
123
|
+
accepted: "accepted";
|
|
124
|
+
already_resolved_same: "already_resolved_same";
|
|
125
|
+
}>;
|
|
126
|
+
operationId: z.ZodString;
|
|
127
|
+
responseDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
128
|
+
interactionId: z.ZodString;
|
|
129
|
+
sessionId: z.ZodString;
|
|
130
|
+
outcome: z.ZodEnum<{
|
|
131
|
+
accepted: "accepted";
|
|
132
|
+
declined: "declined";
|
|
133
|
+
cancelled: "cancelled";
|
|
134
|
+
}>;
|
|
135
|
+
delivered: z.ZodBoolean;
|
|
136
|
+
resolvedAt: z.ZodString;
|
|
137
|
+
binding: z.ZodOptional<z.ZodObject<{
|
|
138
|
+
requestDigest: z.ZodType<`sha256:${string}`, unknown, z.core.$ZodTypeInternals<`sha256:${string}`, unknown>>;
|
|
139
|
+
runId: z.ZodString;
|
|
140
|
+
provider: z.ZodString;
|
|
141
|
+
environmentId: z.ZodString;
|
|
142
|
+
sessionId: z.ZodString;
|
|
143
|
+
executionId: z.ZodString;
|
|
144
|
+
interactionId: z.ZodString;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
type SandboxInteractionResolution = z.infer<typeof InteractionResolutionSchema>;
|
|
148
|
+
type SandboxInteractionConflict = {
|
|
149
|
+
status: z.infer<typeof REFUSED_INTERACTION_STATUS>;
|
|
150
|
+
message: string;
|
|
151
|
+
existingResponseDigest?: `sha256:${string}`;
|
|
152
|
+
existingOperationId?: string;
|
|
153
|
+
resolvedAt?: string;
|
|
154
|
+
};
|
|
155
|
+
type SandboxInteractionResult = SandboxInteractionResolution | SandboxInteractionConflict;
|
|
156
|
+
/** Canonical acknowledgement and the exact durable server result, when one exists. */
|
|
157
|
+
interface SandboxInteractionCommandResult {
|
|
158
|
+
acknowledgement: InteractionAcknowledgement;
|
|
159
|
+
serverResult?: SandboxInteractionResult;
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
115
162
|
//#region src/interactive.d.ts
|
|
116
163
|
/** CLI auth file materialized into the harness's auth home before launch. */
|
|
117
164
|
interface InteractiveAuthFile {
|
|
@@ -207,6 +254,7 @@ interface InteractiveAttachOptions {
|
|
|
207
254
|
interface RespondToPermissionOptions {
|
|
208
255
|
/** The human's decision for the awaiting permission interaction. */
|
|
209
256
|
response: "allow" | "deny";
|
|
257
|
+
signal?: AbortSignal;
|
|
210
258
|
}
|
|
211
259
|
/** Result of `interrupt`. */
|
|
212
260
|
interface InterruptResult {
|
|
@@ -300,19 +348,27 @@ interface SandboxSessionHost extends InteractiveSessionHost {
|
|
|
300
348
|
_sessionSendMessage(id: string, request: SendSessionMessageRequest, options?: SendSessionMessageOptions): Promise<SentSessionMessage>;
|
|
301
349
|
messages(opts: ListMessagesOptions): Promise<SessionMessage[]>;
|
|
302
350
|
_sessionFork(id: string, opts?: SessionForkOptions): Promise<SessionInfo>;
|
|
303
|
-
_respondToPermission(id: string, permissionID: string, options: RespondToPermissionOptions): Promise<
|
|
351
|
+
_respondToPermission(id: string, permissionID: string, options: RespondToPermissionOptions): Promise<SandboxInteractionResult>;
|
|
352
|
+
_listInteractions(id: string, options?: {
|
|
353
|
+
signal?: AbortSignal;
|
|
354
|
+
}): Promise<InteractionRequest[]>;
|
|
355
|
+
_respondToInteraction(id: string, command: InteractionResponseCommand, options?: {
|
|
356
|
+
signal?: AbortSignal;
|
|
357
|
+
}): Promise<SandboxInteractionCommandResult>;
|
|
304
358
|
_interrupt(id: string, options?: SessionInterruptOptions): Promise<InterruptResult>;
|
|
305
359
|
_cancelRun(id: string, request: AgentRunCancellationRequest, options?: {
|
|
306
360
|
signal?: AbortSignal;
|
|
307
361
|
}): Promise<AgentRunCancellationAcknowledgement>;
|
|
308
|
-
_answerQuestion(id: string,
|
|
362
|
+
_answerQuestion(id: string, interactionId: string, answers: InteractionData, options?: {
|
|
363
|
+
signal?: AbortSignal;
|
|
364
|
+
}): Promise<SandboxInteractionResult>;
|
|
309
365
|
_currentPlan(id: string): Promise<DurablePlan | null>;
|
|
310
366
|
_decidePlan(id: string, planId: string, decision: {
|
|
311
367
|
outcome: "approved";
|
|
312
368
|
} | {
|
|
313
369
|
outcome: "rejected";
|
|
314
370
|
feedback: string;
|
|
315
|
-
}): Promise<
|
|
371
|
+
}): Promise<DurablePlanDecisionResult>;
|
|
316
372
|
}
|
|
317
373
|
/**
|
|
318
374
|
* A single agent session inside a sandbox. Created via
|
|
@@ -397,7 +453,15 @@ declare class SandboxSession {
|
|
|
397
453
|
* forwarding `allow`/`deny` to the blocked agent through the unified
|
|
398
454
|
* interaction channel. Throws if no matching permission is outstanding.
|
|
399
455
|
*/
|
|
400
|
-
respondToPermission(permissionID: string, options: RespondToPermissionOptions): Promise<
|
|
456
|
+
respondToPermission(permissionID: string, options: RespondToPermissionOptions): Promise<SandboxInteractionResult>;
|
|
457
|
+
/** Return every interaction that still awaits a response on this session. */
|
|
458
|
+
interactions(options?: {
|
|
459
|
+
signal?: AbortSignal;
|
|
460
|
+
}): Promise<InteractionRequest[]>;
|
|
461
|
+
/** Respond to one exact interaction with a retry-safe command. */
|
|
462
|
+
respondToInteraction(command: InteractionResponseCommand, options?: {
|
|
463
|
+
signal?: AbortSignal;
|
|
464
|
+
}): Promise<SandboxInteractionCommandResult>;
|
|
401
465
|
/**
|
|
402
466
|
* Interrupt an execution without deleting the session. Pass `executionId`
|
|
403
467
|
* to make the cancellation exact: a newer run on the same session is never
|
|
@@ -413,20 +477,16 @@ declare class SandboxSession {
|
|
|
413
477
|
cancelRun(request: AgentRunCancellationRequest, options?: {
|
|
414
478
|
signal?: AbortSignal;
|
|
415
479
|
}): Promise<AgentRunCancellationAcknowledgement>;
|
|
416
|
-
/**
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
* natively, or CLI backends with `BackendConfig.interactions.question`
|
|
421
|
-
* enabled. Backends with no question support reject loudly.
|
|
422
|
-
*/
|
|
423
|
-
answer(answers: Record<string, string[]>): Promise<void>;
|
|
480
|
+
/** Answer one exact question without selecting another outstanding ask. */
|
|
481
|
+
answer(interactionId: string, answers: InteractionData, options?: {
|
|
482
|
+
signal?: AbortSignal;
|
|
483
|
+
}): Promise<SandboxInteractionResult>;
|
|
424
484
|
/** Return the newest plan awaiting a decision for this session. */
|
|
425
485
|
plan(): Promise<DurablePlan | null>;
|
|
426
486
|
/** Approve a durable plan and enqueue its separate execution turn. */
|
|
427
|
-
approvePlan(planId?: string): Promise<
|
|
487
|
+
approvePlan(planId?: string): Promise<DurablePlanDecisionResult>;
|
|
428
488
|
/** Reject a durable plan with required feedback and enqueue a revision turn. */
|
|
429
|
-
rejectPlan(feedback: string, planId?: string): Promise<
|
|
489
|
+
rejectPlan(feedback: string, planId?: string): Promise<DurablePlanDecisionResult>;
|
|
430
490
|
private requireCurrentPlan;
|
|
431
491
|
}
|
|
432
492
|
//#endregion
|
|
@@ -668,6 +728,23 @@ declare class SandboxInstance {
|
|
|
668
728
|
* ```
|
|
669
729
|
*/
|
|
670
730
|
startupDiagnostics(): StartupDiagnostics | null;
|
|
731
|
+
/**
|
|
732
|
+
* The platform verdict for the create call that returned this sandbox: did
|
|
733
|
+
* the call allocate the environment, or did it replay an earlier create that
|
|
734
|
+
* carried the same idempotency key.
|
|
735
|
+
*
|
|
736
|
+
* Present only on a freshly created box; `null` for a box resolved by id and
|
|
737
|
+
* `null` when the platform reported no receipt. Delete the environment only
|
|
738
|
+
* on a `created` outcome — every other value permits another caller to hold
|
|
739
|
+
* it, and a delete then destroys work that caller depends on.
|
|
740
|
+
*
|
|
741
|
+
* @example
|
|
742
|
+
* ```typescript
|
|
743
|
+
* const receipt = box.createReceipt();
|
|
744
|
+
* if (receipt?.outcome === "created") await box.delete();
|
|
745
|
+
* ```
|
|
746
|
+
*/
|
|
747
|
+
createReceipt(): SandboxCreateReceipt | null;
|
|
671
748
|
/**
|
|
672
749
|
* Serialize to the public sandbox shape for logs and structured
|
|
673
750
|
* output. Secrets in `connection` (currently `authToken`) are
|
|
@@ -1594,6 +1671,17 @@ declare class SandboxInstance {
|
|
|
1594
1671
|
success: boolean;
|
|
1595
1672
|
sessionId: string;
|
|
1596
1673
|
}>;
|
|
1674
|
+
/**
|
|
1675
|
+
* Parse a sandbox API payload into `SandboxInfo`.
|
|
1676
|
+
*
|
|
1677
|
+
* `carryCreateFacts` supplies the create-time facts a refresh must keep:
|
|
1678
|
+
* the GPU lease, the startup diagnostics, and the create receipt each arrive
|
|
1679
|
+
* once on the create response and are absent from every later payload. They
|
|
1680
|
+
* describe ONE environment's creation, so they travel only when the payload
|
|
1681
|
+
* describes that same environment. A payload for a different sandbox — a
|
|
1682
|
+
* branch child parsed through its parent — passes no carry, or the child
|
|
1683
|
+
* would report its parent's create verdict.
|
|
1684
|
+
*/
|
|
1597
1685
|
private parseInfo;
|
|
1598
1686
|
private sleep;
|
|
1599
1687
|
/**
|
|
@@ -1774,21 +1862,27 @@ declare class SandboxInstance {
|
|
|
1774
1862
|
_attachTerminal(connectionId: string, options?: SandboxTerminalAttachOptions): Promise<TerminalStream>;
|
|
1775
1863
|
/** @internal — invoked by InteractiveSessionHandle.stop(). */
|
|
1776
1864
|
_stopInteractive(id: string): Promise<void>;
|
|
1865
|
+
private interactionTransport;
|
|
1866
|
+
/** @internal — invoked by SandboxSession.interactions(). */
|
|
1867
|
+
_listInteractions(id: string, options?: {
|
|
1868
|
+
signal?: AbortSignal;
|
|
1869
|
+
}): Promise<InteractionRequest[]>;
|
|
1870
|
+
/** @internal — invoked by SandboxSession.respondToInteraction(). */
|
|
1871
|
+
_respondToInteraction(id: string, command: InteractionResponseCommand, options?: {
|
|
1872
|
+
signal?: AbortSignal;
|
|
1873
|
+
}): Promise<SandboxInteractionCommandResult>;
|
|
1777
1874
|
/** @internal — invoked by SandboxSession.respondToPermission(). */
|
|
1778
|
-
_respondToPermission(id: string, permissionID: string, options: RespondToPermissionOptions): Promise<
|
|
1875
|
+
_respondToPermission(id: string, permissionID: string, options: RespondToPermissionOptions): Promise<SandboxInteractionResult>;
|
|
1779
1876
|
/** @internal — invoked by SandboxSession.interrupt(). */
|
|
1780
1877
|
_interrupt(id: string, options?: SessionInterruptOptions): Promise<InterruptResult>;
|
|
1781
1878
|
/** @internal — invoked by SandboxSession.cancelRun(). */
|
|
1782
1879
|
_cancelRun(id: string, request: AgentRunCancellationRequest, options?: {
|
|
1783
1880
|
signal?: AbortSignal;
|
|
1784
1881
|
}): Promise<AgentRunCancellationAcknowledgement>;
|
|
1785
|
-
/**
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
* question's `answerSpec` fields in order.
|
|
1790
|
-
*/
|
|
1791
|
-
_answerQuestion(id: string, answers: Record<string, string[]>): Promise<void>;
|
|
1882
|
+
/** @internal — invoked by SandboxSession.answer(). */
|
|
1883
|
+
_answerQuestion(id: string, interactionId: string, answers: InteractionData, options?: {
|
|
1884
|
+
signal?: AbortSignal;
|
|
1885
|
+
}): Promise<SandboxInteractionResult>;
|
|
1792
1886
|
/** @internal — invoked by SandboxSession.plan(). */
|
|
1793
1887
|
_currentPlan(sessionId: string): Promise<DurablePlan | null>;
|
|
1794
1888
|
/** @internal — invoked by SandboxSession.approvePlan()/rejectPlan(). */
|
|
@@ -1797,7 +1891,7 @@ declare class SandboxInstance {
|
|
|
1797
1891
|
} | {
|
|
1798
1892
|
outcome: "rejected";
|
|
1799
1893
|
feedback: string;
|
|
1800
|
-
}): Promise<
|
|
1894
|
+
}): Promise<DurablePlanDecisionResult>;
|
|
1801
1895
|
}
|
|
1802
1896
|
//#endregion
|
|
1803
|
-
export {
|
|
1897
|
+
export { BuildSandboxMcpConfigOptions as A, RespondToPermissionOptions as C, SandboxInteractionResolution as D, SandboxInteractionConflict as E, SandboxMcpServerEntry as F, buildControlPlaneMcpConfig as I, buildSandboxMcpConfig as L, SANDBOX_MCP_SERVER_NAME as M, SandboxMcpConfig as N, SandboxInteractionResult as O, SandboxMcpEndpoint as P, InterruptResult as S, SandboxInteractionCommandResult as T, InteractiveAuthFile as _, WorkspaceImagePublishResult as a, InteractiveSessionInfo as b, TraceExportResult as c, exportTraceBundle as d, otelTraceIdForTangleTrace as f, InteractiveAttachOptions as g, SandboxSession as h, WorkspaceImagePublishRequestOptions as i, CONTROL_PLANE_MCP_SERVER_NAME as j, BuildControlPlaneMcpConfigOptions as k, TraceExportSink as l, SandboxTaskSession as m, SandboxInstance as n, WorkspaceImages as o, toOtelJson as p, WorkspaceImagePublishInput as r, TraceExportFormat as s, HttpClient as t, buildTraceExportPayload as u, InteractiveSessionHandle as v, StartInteractiveOptions as w, InteractiveSessionStatus as x, InteractiveSessionHost as y };
|
package/dist/tangle/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as AgentSandboxBlueprintAbi, d as SandboxCreateParamTypes, f as SandboxCreateResponseParamTypes, i as TANGLE_CHAIN_ID, l as ITangleJobsAbi, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, p as SandboxIdParamTypes, r as JOB_SANDBOX_DELETE, s as TangleSandboxClientConfig, t as TangleSandboxClient, u as JsonResponseParamTypes } from "../index-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as AgentSandboxBlueprintAbi, d as SandboxCreateParamTypes, f as SandboxCreateResponseParamTypes, i as TANGLE_CHAIN_ID, l as ITangleJobsAbi, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, p as SandboxIdParamTypes, r as JOB_SANDBOX_DELETE, s as TangleSandboxClientConfig, t as TangleSandboxClient, u as JsonResponseParamTypes } from "../index-BBZKkva-.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TANGLE_MAINNET_RPC, TangleSandboxClient, TangleSandboxClientConfig };
|
package/dist/tangle/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as TANGLE_JOBS_CONTRACT, c as ITangleJobsAbi, d as SandboxCreateResponseParamTypes, f as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as JsonResponseParamTypes, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../tangle-
|
|
1
|
+
import { a as TANGLE_JOBS_CONTRACT, c as ITangleJobsAbi, d as SandboxCreateResponseParamTypes, f as SandboxIdParamTypes, i as TANGLE_CHAIN_ID, l as JsonResponseParamTypes, n as JOB_SANDBOX_CREATE, o as TANGLE_MAINNET_RPC, r as JOB_SANDBOX_DELETE, s as AgentSandboxBlueprintAbi, t as TangleSandboxClient, u as SandboxCreateParamTypes } from "../tangle-CzFPb4Jm.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TANGLE_MAINNET_RPC, TangleSandboxClient };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { m as parseErrorResponse } from "./errors-D2aWy99l.js";
|
|
2
|
-
import { n as createSandboxInstanceFromResponse } from "./sandbox-
|
|
2
|
+
import { n as createSandboxInstanceFromResponse } from "./sandbox-D2wREqmA.js";
|
|
3
3
|
//#region src/tangle/abi.ts
|
|
4
4
|
/**
|
|
5
5
|
* Tangle Contract ABI Definitions
|
|
@@ -2077,6 +2077,28 @@ interface StartupDiagnostics {
|
|
|
2077
2077
|
/** Derived map of operation name → measured duration in milliseconds. */
|
|
2078
2078
|
phases: Record<string, number>;
|
|
2079
2079
|
}
|
|
2080
|
+
/**
|
|
2081
|
+
* What one `create()` call did to the sandbox environment.
|
|
2082
|
+
*
|
|
2083
|
+
* - `created`: the call allocated the environment. The platform states this
|
|
2084
|
+
* only when the create identity belonged to the call alone.
|
|
2085
|
+
* - `idempotent_replay`: the platform returned the environment that an earlier
|
|
2086
|
+
* call with the same idempotency key allocated. The call allocated nothing.
|
|
2087
|
+
* - `unknown`: the platform cannot prove either outcome, so another caller can
|
|
2088
|
+
* hold the environment.
|
|
2089
|
+
*/
|
|
2090
|
+
type SandboxCreateOutcome = "created" | "idempotent_replay" | "unknown";
|
|
2091
|
+
/**
|
|
2092
|
+
* The platform verdict for one create call.
|
|
2093
|
+
*
|
|
2094
|
+
* Delete the environment only on a `created` outcome. `idempotencyKeyApplied`
|
|
2095
|
+
* reports whether the idempotency key selected the environment: a false value
|
|
2096
|
+
* means a retry of the same request allocates a second sandbox.
|
|
2097
|
+
*/
|
|
2098
|
+
interface SandboxCreateReceipt {
|
|
2099
|
+
outcome: SandboxCreateOutcome;
|
|
2100
|
+
idempotencyKeyApplied: boolean;
|
|
2101
|
+
}
|
|
2080
2102
|
/**
|
|
2081
2103
|
* Full sandbox information returned from the API.
|
|
2082
2104
|
*/
|
|
@@ -2116,6 +2138,13 @@ interface SandboxInfo {
|
|
|
2116
2138
|
* directly.
|
|
2117
2139
|
*/
|
|
2118
2140
|
startupDiagnostics?: StartupDiagnostics;
|
|
2141
|
+
/**
|
|
2142
|
+
* The platform verdict for the create call that returned this sandbox.
|
|
2143
|
+
* Present only on the create response. An absent value means the platform
|
|
2144
|
+
* reported no receipt: treat it as `unknown`, never as `created`. Use
|
|
2145
|
+
* {@link SandboxInstance.createReceipt} rather than reading this directly.
|
|
2146
|
+
*/
|
|
2147
|
+
createReceipt?: SandboxCreateReceipt;
|
|
2119
2148
|
/** Resolved egress policy */
|
|
2120
2149
|
egressPolicy?: EgressPolicy;
|
|
2121
2150
|
/** Source of the egress policy */
|
|
@@ -2495,6 +2524,15 @@ type DurablePlan = DurablePlanSnapshot & ({
|
|
|
2495
2524
|
withdrawnAt: string;
|
|
2496
2525
|
reason: string;
|
|
2497
2526
|
});
|
|
2527
|
+
interface DurablePlanDecisionResult {
|
|
2528
|
+
plan: DurablePlan;
|
|
2529
|
+
followUp: {
|
|
2530
|
+
turnId: string;
|
|
2531
|
+
state: "queued" | "leased" | "started" | "completed" | "failed";
|
|
2532
|
+
};
|
|
2533
|
+
/** True when the server replayed a decision it had already recorded. */
|
|
2534
|
+
idempotent: boolean;
|
|
2535
|
+
}
|
|
2498
2536
|
/**
|
|
2499
2537
|
* A tool the agent invoked during a run. `isError` flags a failed call
|
|
2500
2538
|
* (errored, timed out, or rejected — e.g. a hub approval gate). Failed tools
|
|
@@ -2526,10 +2564,10 @@ interface AgentApprovalRequirement {
|
|
|
2526
2564
|
/**
|
|
2527
2565
|
* A question the agent asked mid-run. Present on a result when
|
|
2528
2566
|
* `status === "awaiting_question"`. Answer via
|
|
2529
|
-
* `box.session(id).answer({ [
|
|
2567
|
+
* `box.session(id).answer(questionId, { [field]: value })`, then re-run.
|
|
2530
2568
|
*/
|
|
2531
2569
|
interface AgentQuestionRequest {
|
|
2532
|
-
/**
|
|
2570
|
+
/** Exact interaction id to pass as the first argument to `session.answer`. */
|
|
2533
2571
|
questionId: string;
|
|
2534
2572
|
/** The questions payload the agent emitted (prompt + options per entry). */
|
|
2535
2573
|
questions: unknown;
|
|
@@ -3127,7 +3165,12 @@ interface SandboxRuntimeCapabilities {
|
|
|
3127
3165
|
eventReplay: boolean;
|
|
3128
3166
|
};
|
|
3129
3167
|
interactions: {
|
|
3130
|
-
/**
|
|
3168
|
+
/** Every acknowledged interaction resolution is recorded: repeating a
|
|
3169
|
+
* response replays the recorded resolution, and a different answer for
|
|
3170
|
+
* a recorded resolution raises a 409 `StateError`. The deployment
|
|
3171
|
+
* refuses with 503 rather than acknowledge a resolution it cannot
|
|
3172
|
+
* record. Absent on an image that predates the flag. */
|
|
3173
|
+
responseDedupe?: boolean;
|
|
3131
3174
|
};
|
|
3132
3175
|
}
|
|
3133
3176
|
/**
|
|
@@ -6260,4 +6303,4 @@ interface CodeExecutionOptions {
|
|
|
6260
6303
|
idempotencyKey?: string;
|
|
6261
6304
|
}
|
|
6262
6305
|
//#endregion
|
|
6263
|
-
export {
|
|
6306
|
+
export { EnsureDevServerOptions as $, BatchBackendStats as $i, SandboxEvent as $n, SecretsManager as $r, ListOptions as $t, CreateSandboxFleetTokenOptions as A, TeePublicKey as Ai, PublishPublicTemplateOptions as An, SandboxPortBinding as Ar, GitBranch as At, DownloadOptions as B, WaitForRolloutOptions as Bi, RolloutChildResult as Bn, SandboxTerminalManager as Br, GpuLeaseManager as Bt, CodeResultPart as C, TaskSessionCommitResult as Ci, PromptResult as Cn, SandboxFleetWorkspace as Cr, FleetExecDispatchOptions as Ct, CreateIntelligenceReportOptions as D, TeeAttestationOptions as Di, ProvisionStep as Dn, SandboxIdentity as Dr, FleetPromptDispatchResult as Dt, CreateGpuLeaseOptions as E, TaskSessionProfile as Ei, ProvisionStatus as En, SandboxFleetWorkspaceSnapshotResult as Er, FleetPromptDispatchOptions as Et, DeleteOptions as F, UpdateUserOptions as Fi, ReconcileSandboxFleetsResult as Fn, SandboxRuntimeHealth as Fr, GpuLease as Ft, DriverType as G, TerminalExitInfo as Gi, RolloutTurnPart as Gn, SandboxTraceExport as Gr, InstalledTool as Gt, DriveTurnOptions as H, WriteManyFile as Hi, RolloutScorer as Hn, SandboxTerminals as Hr, GpuLeaseStatus as Ht, DevServerInfo as I, UploadOptions as Ii, RenameOptions as In, SandboxStatus as Ir, GpuLeaseBilling as It, EffectiveBackend as J, TerminalStreamAuthFormat as Ji, SandboxConfig as Jn, ScopedToken as Jr, IntelligenceReportCompareTo as Jt, DurablePlan as K, TerminalReadyInfo as Ki, SSHCommandDescriptor as Kn, SandboxTraceOptions as Kr, IntelligenceReport as Kt, DirectoryPermission as L, UploadProgress as Li, RestoreSnapshotOptions as Ln, SandboxTerminalAttachOptions as Lr, GpuLeaseCommandResult as Lt, CreateSandboxOptions as M, TokenRefreshHandler as Mi, ReapExpiredSandboxFleetsOptions as Mn, SandboxResourceUsage as Mr, GitConfig as Mt, CreateSessionOptions as N, TokenUsage as Ni, ReapExpiredSandboxFleetsResult as Nn, SandboxResources as Nr, GitDiff as Nt, CreateRequestOptions as O, TeeAttestationReport as Oi, PublicTemplateInfo as On, SandboxInfo as Or, GPU_LEASE_PROVIDER_NAMES as Ot, CreateTaskSessionOptions as P, TurnDriveResult as Pi, ReconcileSandboxFleetsOptions as Pn, SandboxRuntimeCapabilities as Pr, GitStatus as Pt, EgressPolicy as Q, TerminalStreamToken as Qi, SandboxEnvironment as Qn, SecretInfo as Qr, ListMessagesOptions as Qt, DispatchPromptOptions as R, UsageInfo as Ri, ResumeOptions as Rn, SandboxTerminalCreateOptions as Rr, GpuLeaseExecOptions as Rt, CodeLanguage as S, TaskSessionChanges as Si, PromptOptions as Sn, SandboxFleetUsage as Sr, FleetDriveTurnRequest as St, CompletedTurnResult as T, TaskSessionInfo as Ti, ProvisionResult as Tn, SandboxFleetWorkspaceRestoreResult as Tr, FleetMachineId as Tt, DriverConfig as U, WriteManyOptions as Ui, RolloutStartResult as Un, SandboxTraceBundle as Ur, HostAgentDriverConfig as Ut, DownloadProgress as V, WriteFileOptions as Vi, RolloutOptions as Vn, SandboxTerminalRequestOptions as Vr, GpuLeaseProviderName as Vt, DriverInfo as W, TERMINAL_WS_ECHO_SUBPROTOCOL as Wi, RolloutStatus as Wn, SandboxTraceEvent as Wr, HostAgentRuntimeBackend as Wt, EffectiveBackendSource as X, TerminalStreamHandlers as Xi, SandboxCreateOutcome as Xn, SearchMatch as Xr, IntelligenceReportWindow as Xt, EffectiveBackendProfile as Y, TerminalStreamError as Yi, SandboxConnection as Yn, ScopedTokenScope as Yr, IntelligenceReportSubjectType as Yt, EgressManager as Z, TerminalStreamOptions as Zi, SandboxCreateReceipt as Zn, SearchOptions as Zr, JsonValue as Zt, BranchOptions as _, SshKeysManager as _i, ProcessManager as _n, SandboxFleetToken as _r, FleetDispatchCancelResult as _t, AttachSandboxFleetMachineOptions as a, BackendType as aa, SessionFailureReason as ai, NetworkConfig as an, SandboxFleetDriverCapability as ar, FileReadBatchOptions as at, CodeExecutionOptions as b, StorageConfig as bi, ProcessStatus as bn, SandboxFleetTraceExport as br, FleetDispatchStreamOptions as bt, BackendInfo as c, SessionInterruptOptions as ci, PermissionLevel as cn, SandboxFleetIntelligenceEnvelope as cr, FileReadResult as ct, BatchBackend as d, SessionMessageInputPart as di, PreviewLinkManager as dn, SandboxFleetMachineRecord as dr, FileTreeFile as dt, BatchEvent as ea, SendSessionMessageOptions as ei, ListSandboxFleetOptions as en, SandboxFleetArtifact as er, EventStreamOptions as et, BatchResult as f, SessionResultOptions as fi, PreviewLinkWaitOptions as fn, SandboxFleetMachineSpec as fr, FileTreeOptions as ft, BatchTaskResult as g, SnapshotResult as gi, ProcessLogEntry as gn, SandboxFleetPolicy as gr, FileWriteResult as gt, BatchTask as h, SnapshotOptions as hi, ProcessListOptions as hn, SandboxFleetOperationsSummary as hr, FileUsageResult as ht, AttachGpuLeaseOptions as i, PublicBatchRunRequest as ia, SessionEventStreamOptions as ii, MkdirOptions as in, SandboxFleetDispatchResponse as ir, FileInfo as it, CreateSandboxFleetWithCoordinatorOptions as j, TeePublicKeyResponse as ji, PublishPublicTemplateVersionOptions as jn, SandboxPortPreviewLink as jr, GitCommit as jt, CreateSandboxFleetOptions as k, TeeAttestationResponse as ki, PublicTemplateVersionInfo as kn, SandboxIntelligenceEnvelope as kr, GitAuth as kt, BackendManager as l, SessionListOptions as li, PermissionsManager as ln, SandboxFleetMachine as lr, FileRenameResult as lt, BatchRunRequest as m, SnapshotInfo as mi, ProcessInfo as mn, SandboxFleetManifestMachine as mr, FileUsageOptions as mt, AccessPolicyRule as n, BatchSidecarGroup as na, SentSessionMessage as ni, McpServerConfig as nn, SandboxFleetCostEstimate as nr, ExecOptions as nt, BackendCapabilities as o, parseBackendType as oa, SessionForkOptions as oi, NetworkManager as on, SandboxFleetDriverTimings as or, FileReadBatchResult as ot, BatchRunOptions as p, SessionStatus as pi, Process as pn, SandboxFleetManifest as pr, FileTreeResult as pt, DurablePlanDecisionResult as q, TerminalStream as qi, SSHCredentials as qn, SandboxUser as qr, IntelligenceReportBudget as qt, AddUserOptions as r, BatchTaskUsage as ra, SessionBackendCredentials as ri, MintScopedTokenOptions as rn, SandboxFleetDispatchFailureClass as rr, ExecResult as rt, BackendConfig as s, SessionInfo as si, NonHostAgentDriverConfig as sn, SandboxFleetInfo as sr, FileReadError as st, AcceleratorKind as t, BatchEventDataMap as ta, SendSessionMessageRequest as ti, ListSandboxOptions as tn, SandboxFleetArtifactSpec as tr, ExactProcessSpawnOptions as tt, BackendStatus as u, SessionMessage as ui, PreviewLinkInfo as un, SandboxFleetMachineMeteredUsage as ur, FileSystem as ut, ChunkedUploadOptions as v, StartupDiagnostics as vi, ProcessSignal as vn, SandboxFleetTraceBundle as vr, FleetDispatchResultBuffer as vt, CommitTaskSessionOptions as w, TaskSessionFileChange as wi, ProvisionEvent as wn, SandboxFleetWorkspaceReconcileResult as wr, FleetExecDispatchResult as wt, CodeExecutionResult as x, SubscriptionInfo as xi, PromptInputPart as xn, SandboxFleetTraceOptions as xr, FleetDriveTurnOutcome as xt, ChunkedUploadResult as y, StartupOperation as yi, ProcessSpawnOptions as yn, SandboxFleetTraceEvent as yr, FleetDispatchResultBufferOptions as yt, DispatchedSession as z, WaitForOptions as zi, Rollout as zn, SandboxTerminalInfo as zr, GpuLeaseExecResult as zt };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0-develop.20260814092444.5f93bc1",
|
|
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",
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"url": "https://github.com/tangle-network/agent-dev-container/issues"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@tangle-network/agent-core": "0.
|
|
91
|
-
"@tangle-network/agent-interface": "0.
|
|
90
|
+
"@tangle-network/agent-core": "0.7.3",
|
|
91
|
+
"@tangle-network/agent-interface": "0.51.0",
|
|
92
92
|
"zod": "4.4.3"
|
|
93
93
|
},
|
|
94
94
|
"peerDependencies": {
|