@tangle-network/sandbox 0.9.4-develop.20260628204341.d400617 → 0.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.ts +2 -2
- package/dist/{client-QRSrhhlr.d.ts → client-DUY6Pdwf.d.ts} +1 -1
- package/dist/{client-vx9ze5bL.js → client-Y5RIIHCp.js} +1 -1
- package/dist/core.d.ts +2 -2
- package/dist/core.js +2 -2
- package/dist/{index-DXa7OlnO.d.ts → index-CAay0NFR.d.ts} +1 -1
- package/dist/index.d.ts +4 -29
- package/dist/index.js +4 -279
- package/dist/{sandbox-C4TLW3Ue.js → sandbox-CZGUBb3U.js} +28 -7
- package/dist/{sandbox-C2x9Yumw.d.ts → sandbox-DcOyvnIy.d.ts} +8 -3
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-BNRnUKEO.js → tangle-BInShBah.js} +1 -1
- package/package.json +1 -1
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { G as CodeExecutionOptions, K as CodeExecutionResult, Y as CodeResultPart, n as SandboxInstance, q as CodeLanguage } from "../sandbox-
|
|
2
|
-
import { i as SandboxClient } from "../client-
|
|
1
|
+
import { G as CodeExecutionOptions, K as CodeExecutionResult, Y as CodeResultPart, n as SandboxInstance, q as CodeLanguage } from "../sandbox-DcOyvnIy.js";
|
|
2
|
+
import { i as SandboxClient } from "../client-DUY6Pdwf.js";
|
|
3
3
|
import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
|
|
4
4
|
|
|
5
5
|
//#region src/agent/tools/_specs.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as CreateSandboxFleetOptions, $n as SandboxFleetTraceBundle, A as AttachSandboxFleetMachineOptions, B as BatchTask, Bn as SandboxFleetDriverCapability, Cn as PublishPublicTemplateVersionOptions, Ct as FleetDispatchStreamOptions, Dn as ReconcileSandboxFleetsResult, Dt as FleetPromptDispatchOptions, En as ReconcileSandboxFleetsOptions, Et as FleetMachineId, Fn as SandboxFleetArtifact, Gr as TokenRefreshHandler, Gt as IntelligenceReportWindow, Hn as SandboxFleetInfo, Ht as IntelligenceReportBudget, In as SandboxFleetArtifactSpec, Jn as SandboxFleetManifest, Jt as ListSandboxFleetOptions, Kn as SandboxFleetMachineRecord, L as BatchEvent, Ln as SandboxFleetCostEstimate, Lr as SubscriptionInfo, Nn as SandboxEnvironment, Nr as SshKeysManager, Ot as FleetPromptDispatchResult, Q as CreateRequestOptions, Qn as SandboxFleetToken, R as BatchOptions, Sn as PublishPublicTemplateOptions, St as FleetDispatchResultBufferOptions, Tn as ReapExpiredSandboxFleetsResult, Tt as FleetExecDispatchResult, Ut as IntelligenceReportCompareTo, Vt as IntelligenceReport, Xn as SandboxFleetOperationsSummary, Yt as ListSandboxOptions, Z as CreateIntelligenceReportOptions, Zr as UsageInfo, _t as ExecResult, a as TraceExportSink, ar as SandboxFleetWorkspaceReconcileResult, bn as PublicTemplateInfo, bt as FleetDispatchCancelResult, cr as SandboxInfo, et as CreateSandboxFleetTokenOptions, gt as ExecOptions, hn as PromptResult, i as TraceExportResult, jn as SandboxClientConfig, mn as PromptOptions, n as SandboxInstance, nr as SandboxFleetTraceOptions, nt as CreateSandboxOptions, or as SandboxFleetWorkspaceRestoreResult, pn as PromptInputPart, rr as SandboxFleetUsage, sr as SandboxFleetWorkspaceSnapshotResult, t as HttpClient, tt as CreateSandboxFleetWithCoordinatorOptions, wn as ReapExpiredSandboxFleetsOptions, wr as SecretsManager, wt as FleetExecDispatchOptions, xn as PublicTemplateVersionInfo, xt as FleetDispatchResultBuffer, z as BatchResult, zn as SandboxFleetDispatchResponse } from "./sandbox-
|
|
1
|
+
import { $ as CreateSandboxFleetOptions, $n as SandboxFleetTraceBundle, A as AttachSandboxFleetMachineOptions, B as BatchTask, Bn as SandboxFleetDriverCapability, Cn as PublishPublicTemplateVersionOptions, Ct as FleetDispatchStreamOptions, Dn as ReconcileSandboxFleetsResult, Dt as FleetPromptDispatchOptions, En as ReconcileSandboxFleetsOptions, Et as FleetMachineId, Fn as SandboxFleetArtifact, Gr as TokenRefreshHandler, Gt as IntelligenceReportWindow, Hn as SandboxFleetInfo, Ht as IntelligenceReportBudget, In as SandboxFleetArtifactSpec, Jn as SandboxFleetManifest, Jt as ListSandboxFleetOptions, Kn as SandboxFleetMachineRecord, L as BatchEvent, Ln as SandboxFleetCostEstimate, Lr as SubscriptionInfo, Nn as SandboxEnvironment, Nr as SshKeysManager, Ot as FleetPromptDispatchResult, Q as CreateRequestOptions, Qn as SandboxFleetToken, R as BatchOptions, Sn as PublishPublicTemplateOptions, St as FleetDispatchResultBufferOptions, Tn as ReapExpiredSandboxFleetsResult, Tt as FleetExecDispatchResult, Ut as IntelligenceReportCompareTo, Vt as IntelligenceReport, Xn as SandboxFleetOperationsSummary, Yt as ListSandboxOptions, Z as CreateIntelligenceReportOptions, Zr as UsageInfo, _t as ExecResult, a as TraceExportSink, ar as SandboxFleetWorkspaceReconcileResult, bn as PublicTemplateInfo, bt as FleetDispatchCancelResult, cr as SandboxInfo, et as CreateSandboxFleetTokenOptions, gt as ExecOptions, hn as PromptResult, i as TraceExportResult, jn as SandboxClientConfig, mn as PromptOptions, n as SandboxInstance, nr as SandboxFleetTraceOptions, nt as CreateSandboxOptions, or as SandboxFleetWorkspaceRestoreResult, pn as PromptInputPart, rr as SandboxFleetUsage, sr as SandboxFleetWorkspaceSnapshotResult, t as HttpClient, tt as CreateSandboxFleetWithCoordinatorOptions, wn as ReapExpiredSandboxFleetsOptions, wr as SecretsManager, wt as FleetExecDispatchOptions, xn as PublicTemplateVersionInfo, xt as FleetDispatchResultBuffer, z as BatchResult, zn as SandboxFleetDispatchResponse } from "./sandbox-DcOyvnIy.js";
|
|
2
2
|
|
|
3
3
|
//#region src/lib/sse-parser.d.ts
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as encodePromptForWire, l as exportTraceBundle,
|
|
1
|
+
import { f as encodePromptForWire, l as exportTraceBundle, p as parseSSEStream, s as normalizeConnection, t as SandboxInstance } from "./sandbox-CZGUBb3U.js";
|
|
2
2
|
import { d as ValidationError, f as parseErrorResponse, i as NotFoundError, r as NetworkError, t as AuthError, u as TimeoutError } from "./errors-DZsfJUuc.js";
|
|
3
3
|
//#region src/resources.ts
|
|
4
4
|
/**
|
package/dist/core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $t as NetworkConfig, _t as ExecResult, an as PreviewLinkManager, cr as SandboxInfo, gt as ExecOptions, in as PreviewLinkInfo, jn as SandboxClientConfig, n as SandboxInstance, nt as CreateSandboxOptions, pr as SandboxStatus } from "./sandbox-
|
|
2
|
-
import { i as SandboxClient } from "./client-
|
|
1
|
+
import { $t as NetworkConfig, _t as ExecResult, an as PreviewLinkManager, cr as SandboxInfo, gt as ExecOptions, in as PreviewLinkInfo, jn as SandboxClientConfig, n as SandboxInstance, nt as CreateSandboxOptions, pr as SandboxStatus } from "./sandbox-DcOyvnIy.js";
|
|
2
|
+
import { i as SandboxClient } from "./client-DUY6Pdwf.js";
|
|
3
3
|
import { a as PartialFailureError, c as SandboxErrorJson, d as StateError, f as TimeoutError, i as NotFoundError, l as SandboxFailureDetail, n as CapabilityError, o as QuotaError, p as ValidationError, r as NetworkError, s as SandboxError, t as AuthError, u as ServerError } from "./errors-1Se5ATyZ.js";
|
|
4
4
|
export { AuthError, CapabilityError, type CreateSandboxOptions, type ExecOptions, type ExecResult, type NetworkConfig, NetworkError, NotFoundError, PartialFailureError, type PreviewLinkInfo, type PreviewLinkManager, QuotaError, SandboxClient as Sandbox, SandboxClient, type SandboxClientConfig, SandboxError, type SandboxErrorJson, type SandboxFailureDetail, type SandboxInfo, SandboxInstance, type SandboxStatus, ServerError, StateError, TimeoutError, ValidationError };
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as SandboxInstance } from "./sandbox-
|
|
1
|
+
import { t as SandboxInstance } from "./sandbox-CZGUBb3U.js";
|
|
2
2
|
import { a as PartialFailureError, c as ServerError, d as ValidationError, i as NotFoundError, l as StateError, n as CapabilityError, o as QuotaError, r as NetworkError, s as SandboxError, t as AuthError, u as TimeoutError } from "./errors-DZsfJUuc.js";
|
|
3
|
-
import { n as SandboxClient } from "./client-
|
|
3
|
+
import { n as SandboxClient } from "./client-Y5RIIHCp.js";
|
|
4
4
|
export { AuthError, CapabilityError, NetworkError, NotFoundError, PartialFailureError, QuotaError, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxInstance, ServerError, StateError, TimeoutError, ValidationError };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { $ as CreateSandboxFleetOptions, $n as SandboxFleetTraceBundle, $r as WriteFileOptions, $t as NetworkConfig, A as AttachSandboxFleetMachineOptions, An as SSHCredentials, Ar as SnapshotInfo, At as ForkResult, B as BatchTask, Bn as SandboxFleetDriverCapability, Br as TeeAttestationOptions, Bt as InstalledTool, C as SandboxMcpEndpoint, Cn as PublishPublicTemplateVersionOptions, Cr as SecretInfo, Ct as FleetDispatchStreamOptions, D as AcceleratorKind, Dn as ReconcileSandboxFleetsResult, Dr as SessionListOptions, Dt as FleetPromptDispatchOptions, E as buildSandboxMcpConfig, En as ReconcileSandboxFleetsOptions, Er as SessionInfo, Et as FleetMachineId, F as BackendStatus, Fn as SandboxFleetArtifact, Fr as StartupOperation, Ft as GitDiff, Gn as SandboxFleetMachineMeteredUsage, Gr as TokenRefreshHandler, Gt as IntelligenceReportWindow, H as CheckpointInfo, Hn as SandboxFleetInfo, Hr as TeeAttestationResponse, Ht as IntelligenceReportBudget, I as BackendType, In as SandboxFleetArtifactSpec, Ir as StorageConfig, It as GitStatus, J as CodeResult, Jn as SandboxFleetManifest, Jr as UpdateUserOptions, Jt as ListSandboxFleetOptions, Kn as SandboxFleetMachineRecord, Kr as ToolsConfig, Kt as ListMessagesOptions, L as BatchEvent, Ln as SandboxFleetCostEstimate, Lr as SubscriptionInfo, Lt as GpuType, M as BackendConfig, Mn as SandboxConnection, Mr as SnapshotResult, Mt as GitBranch, N as BackendInfo, Nn as SandboxEnvironment, Nt as GitCommit, O as AccessPolicyRule, On as RunCodeOptions, Or as SessionMessage, P as BackendManager, Pn as SandboxEvent, Pr as StartupDiagnostics, Pt as GitConfig, Qn as SandboxFleetToken, Qr as WaitForOptions, Qt as MkdirOptions, R as BatchOptions, Rn as SandboxFleetDispatchFailureClass, Rr as TaskOptions, Rt as HostAgentDriverConfig, S as SandboxMcpConfig, Sn as PublishPublicTemplateOptions, Sr as SearchOptions, St as FleetDispatchResultBufferOptions, T as buildControlPlaneMcpConfig, Tn as ReapExpiredSandboxFleetsResult, Tr as SessionEventStreamOptions, U as CheckpointOptions, Un as SandboxFleetIntelligenceEnvelope, Ur as TeePublicKey, Ut as IntelligenceReportCompareTo, V as BatchTaskResult, Vn as SandboxFleetDriverTimings, Vr as TeeAttestationReport, Vt as IntelligenceReport, W as CheckpointResult, Wn as SandboxFleetMachine, Wr as TeePublicKeyResponse, Wt as IntelligenceReportSubjectType, X as CompletedTurnResult, Xn as SandboxFleetOperationsSummary, Xr as UploadProgress, Xt as McpServerConfig, Yn as SandboxFleetManifestMachine, Yr as UploadOptions, Yt as ListSandboxOptions, Z as CreateIntelligenceReportOptions, Zn as SandboxFleetPolicy, Zr as UsageInfo, Zt as MintScopedTokenOptions, _ as StartInteractiveOptions, _i as defineGitHubResource, _n as ProvisionResult, _r as SandboxTraceOptions, _t as ExecResult, a as TraceExportSink, ai as AgentProfileConnection, an as PreviewLinkManager, ar as SandboxFleetWorkspaceReconcileResult, at as DispatchPromptOptions, b as CONTROL_PLANE_MCP_SERVER_NAME, bn as PublicTemplateInfo, br as ScopedTokenScope, bt as FleetDispatchCancelResult, c as otelTraceIdForTangleTrace, ci as AgentProfileModelHints, cn as ProcessLogEntry, cr as SandboxInfo, ct as DownloadProgress, d as InteractiveAuthFile, di as AgentProfileResourceRef, dn as ProcessSpawnOptions, dr as SandboxResourceUsage, dt as DriverInfo, ei as WriteManyFile, en as NetworkManager, er as SandboxFleetTraceEvent, f as InteractiveSessionHandle, fi as AgentProfileResources, fn as ProcessStatus, fr as SandboxResources, ft as DriverType, g as RespondToPermissionOptions, gi as defineAgentProfile, gn as ProvisionEvent, gr as SandboxTraceExport, gt as ExecOptions, h as InterruptResult, hi as AgentSubagentProfile, hn as PromptResult, hr as SandboxTraceEvent, ht as EventStreamOptions, i as TraceExportResult, ii as AgentProfileConfidential, in as PreviewLinkInfo, ir as SandboxFleetWorkspace, it as DirectoryPermission, j as BackendCapabilities, jn as SandboxClientConfig, jr as SnapshotOptions, jt as GitAuth, k as AddUserOptions, kn as SSHCommandDescriptor, kr as SessionStatus, kt as ForkOptions, l as toOtelJson, li as AgentProfilePermissionValue, ln as ProcessManager, lr as SandboxIntelligenceEnvelope, lt as DriveTurnOptions, m as InteractiveSessionInfo, mi as AgentProfileValidationResult, mn as PromptOptions, mr as SandboxTraceBundle, mt as EgressPolicy, n as SandboxInstance, ni as AgentProfile, nn as PermissionLevel, nr as SandboxFleetTraceOptions, nt as CreateSandboxOptions, o as buildTraceExportPayload, oi as AgentProfileFileMount, on as Process, or as SandboxFleetWorkspaceRestoreResult, ot as DispatchedSession, p as InteractiveSessionHost, pi as AgentProfileValidationIssue, pr as SandboxStatus, pt as EgressManager, qn as SandboxFleetMachineSpec, qr as TurnDriveResult, qt as ListOptions, r as TraceExportFormat, ri as AgentProfileCapabilities, rn as PermissionsManager, rr as SandboxFleetUsage, rt as DeleteOptions, s as exportTraceBundle, si as AgentProfileMcpServer, sn as ProcessInfo, sr as SandboxFleetWorkspaceSnapshotResult, st as DownloadOptions, ti as WriteManyOptions, tn as NonHostAgentDriverConfig, tr as SandboxFleetTraceExport, tt as CreateSandboxFleetWithCoordinatorOptions, u as SandboxSession, ui as AgentProfilePrompt, un as ProcessSignal, ur as SandboxPermissionsConfig, ut as DriverConfig, v as BuildControlPlaneMcpConfigOptions, vi as defineInlineResource, vn as ProvisionStatus, vr as SandboxUser, vt as FileInfo, w as SandboxMcpServerEntry, wn as ReapExpiredSandboxFleetsOptions, wr as SecretsManager, wt as FleetExecDispatchOptions, x as SANDBOX_MCP_SERVER_NAME, xn as PublicTemplateVersionInfo, xr as SearchMatch, xt as FleetDispatchResultBuffer, y as BuildSandboxMcpConfigOptions, yi as mergeAgentProfiles, yn as ProvisionStep, yr as ScopedToken, yt as FileSystem, z as BatchResult, zn as SandboxFleetDispatchResponse, zr as TaskResult, zt as HostAgentRuntimeBackend } from "./sandbox-
|
|
2
|
-
import { a as Team, c as SandboxFleet, d as ParsedSSEEvent, f as parseSSEStream, i as SandboxClient, l as SandboxFleetClient, n as IntelligenceClient, o as TeamInvitation, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as ParseSSEStreamOptions } from "./client-
|
|
1
|
+
import { $ as CreateSandboxFleetOptions, $n as SandboxFleetTraceBundle, $r as WriteFileOptions, $t as NetworkConfig, A as AttachSandboxFleetMachineOptions, An as SSHCredentials, Ar as SnapshotInfo, At as ForkResult, B as BatchTask, Bn as SandboxFleetDriverCapability, Br as TeeAttestationOptions, Bt as InstalledTool, C as SandboxMcpEndpoint, Cn as PublishPublicTemplateVersionOptions, Cr as SecretInfo, Ct as FleetDispatchStreamOptions, D as AcceleratorKind, Dn as ReconcileSandboxFleetsResult, Dr as SessionListOptions, Dt as FleetPromptDispatchOptions, E as buildSandboxMcpConfig, En as ReconcileSandboxFleetsOptions, Er as SessionInfo, Et as FleetMachineId, F as BackendStatus, Fn as SandboxFleetArtifact, Fr as StartupOperation, Ft as GitDiff, Gn as SandboxFleetMachineMeteredUsage, Gr as TokenRefreshHandler, Gt as IntelligenceReportWindow, H as CheckpointInfo, Hn as SandboxFleetInfo, Hr as TeeAttestationResponse, Ht as IntelligenceReportBudget, I as BackendType, In as SandboxFleetArtifactSpec, Ir as StorageConfig, It as GitStatus, J as CodeResult, Jn as SandboxFleetManifest, Jr as UpdateUserOptions, Jt as ListSandboxFleetOptions, Kn as SandboxFleetMachineRecord, Kr as ToolsConfig, Kt as ListMessagesOptions, L as BatchEvent, Ln as SandboxFleetCostEstimate, Lr as SubscriptionInfo, Lt as GpuType, M as BackendConfig, Mn as SandboxConnection, Mr as SnapshotResult, Mt as GitBranch, N as BackendInfo, Nn as SandboxEnvironment, Nt as GitCommit, O as AccessPolicyRule, On as RunCodeOptions, Or as SessionMessage, P as BackendManager, Pn as SandboxEvent, Pr as StartupDiagnostics, Pt as GitConfig, Qn as SandboxFleetToken, Qr as WaitForOptions, Qt as MkdirOptions, R as BatchOptions, Rn as SandboxFleetDispatchFailureClass, Rr as TaskOptions, Rt as HostAgentDriverConfig, S as SandboxMcpConfig, Sn as PublishPublicTemplateOptions, Sr as SearchOptions, St as FleetDispatchResultBufferOptions, T as buildControlPlaneMcpConfig, Tn as ReapExpiredSandboxFleetsResult, Tr as SessionEventStreamOptions, U as CheckpointOptions, Un as SandboxFleetIntelligenceEnvelope, Ur as TeePublicKey, Ut as IntelligenceReportCompareTo, V as BatchTaskResult, Vn as SandboxFleetDriverTimings, Vr as TeeAttestationReport, Vt as IntelligenceReport, W as CheckpointResult, Wn as SandboxFleetMachine, Wr as TeePublicKeyResponse, Wt as IntelligenceReportSubjectType, X as CompletedTurnResult, Xn as SandboxFleetOperationsSummary, Xr as UploadProgress, Xt as McpServerConfig, Yn as SandboxFleetManifestMachine, Yr as UploadOptions, Yt as ListSandboxOptions, Z as CreateIntelligenceReportOptions, Zn as SandboxFleetPolicy, Zr as UsageInfo, Zt as MintScopedTokenOptions, _ as StartInteractiveOptions, _i as defineGitHubResource, _n as ProvisionResult, _r as SandboxTraceOptions, _t as ExecResult, a as TraceExportSink, ai as AgentProfileConnection, an as PreviewLinkManager, ar as SandboxFleetWorkspaceReconcileResult, at as DispatchPromptOptions, b as CONTROL_PLANE_MCP_SERVER_NAME, bn as PublicTemplateInfo, br as ScopedTokenScope, bt as FleetDispatchCancelResult, c as otelTraceIdForTangleTrace, ci as AgentProfileModelHints, cn as ProcessLogEntry, cr as SandboxInfo, ct as DownloadProgress, d as InteractiveAuthFile, di as AgentProfileResourceRef, dn as ProcessSpawnOptions, dr as SandboxResourceUsage, dt as DriverInfo, ei as WriteManyFile, en as NetworkManager, er as SandboxFleetTraceEvent, f as InteractiveSessionHandle, fi as AgentProfileResources, fn as ProcessStatus, fr as SandboxResources, ft as DriverType, g as RespondToPermissionOptions, gi as defineAgentProfile, gn as ProvisionEvent, gr as SandboxTraceExport, gt as ExecOptions, h as InterruptResult, hi as AgentSubagentProfile, hn as PromptResult, hr as SandboxTraceEvent, ht as EventStreamOptions, i as TraceExportResult, ii as AgentProfileConfidential, in as PreviewLinkInfo, ir as SandboxFleetWorkspace, it as DirectoryPermission, j as BackendCapabilities, jn as SandboxClientConfig, jr as SnapshotOptions, jt as GitAuth, k as AddUserOptions, kn as SSHCommandDescriptor, kr as SessionStatus, kt as ForkOptions, l as toOtelJson, li as AgentProfilePermissionValue, ln as ProcessManager, lr as SandboxIntelligenceEnvelope, lt as DriveTurnOptions, m as InteractiveSessionInfo, mi as AgentProfileValidationResult, mn as PromptOptions, mr as SandboxTraceBundle, mt as EgressPolicy, n as SandboxInstance, ni as AgentProfile, nn as PermissionLevel, nr as SandboxFleetTraceOptions, nt as CreateSandboxOptions, o as buildTraceExportPayload, oi as AgentProfileFileMount, on as Process, or as SandboxFleetWorkspaceRestoreResult, ot as DispatchedSession, p as InteractiveSessionHost, pi as AgentProfileValidationIssue, pr as SandboxStatus, pt as EgressManager, qn as SandboxFleetMachineSpec, qr as TurnDriveResult, qt as ListOptions, r as TraceExportFormat, ri as AgentProfileCapabilities, rn as PermissionsManager, rr as SandboxFleetUsage, rt as DeleteOptions, s as exportTraceBundle, si as AgentProfileMcpServer, sn as ProcessInfo, sr as SandboxFleetWorkspaceSnapshotResult, st as DownloadOptions, ti as WriteManyOptions, tn as NonHostAgentDriverConfig, tr as SandboxFleetTraceExport, tt as CreateSandboxFleetWithCoordinatorOptions, u as SandboxSession, ui as AgentProfilePrompt, un as ProcessSignal, ur as SandboxPermissionsConfig, ut as DriverConfig, v as BuildControlPlaneMcpConfigOptions, vi as defineInlineResource, vn as ProvisionStatus, vr as SandboxUser, vt as FileInfo, w as SandboxMcpServerEntry, wn as ReapExpiredSandboxFleetsOptions, wr as SecretsManager, wt as FleetExecDispatchOptions, x as SANDBOX_MCP_SERVER_NAME, xn as PublicTemplateVersionInfo, xr as SearchMatch, xt as FleetDispatchResultBuffer, y as BuildSandboxMcpConfigOptions, yi as mergeAgentProfiles, yn as ProvisionStep, yr as ScopedToken, yt as FileSystem, z as BatchResult, zn as SandboxFleetDispatchResponse, zr as TaskResult, zt as HostAgentRuntimeBackend } from "./sandbox-DcOyvnIy.js";
|
|
2
|
+
import { a as Team, c as SandboxFleet, d as ParsedSSEEvent, f as parseSSEStream, i as SandboxClient, l as SandboxFleetClient, n as IntelligenceClient, o as TeamInvitation, r as InviteTeamMemberOptions, s as TeamMember, t as CreateTeamOptions, u as ParseSSEStreamOptions } from "./client-DUY6Pdwf.js";
|
|
3
3
|
import { d as AnyTokenPayload, h as IssueCollaborationTokenOptions, m as CollaborationTokenPayload, p as CollaborationAccess } from "./index-D-2pH_70.js";
|
|
4
4
|
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-D7bwmNs8.js";
|
|
5
5
|
import { a as PartialFailureError, c as SandboxErrorJson, d as StateError, f as TimeoutError, i as NotFoundError, l as SandboxFailureDetail, n as CapabilityError, o as QuotaError, p as ValidationError, r as NetworkError, s as SandboxError, t as AuthError, u as ServerError } from "./errors-1Se5ATyZ.js";
|
|
6
|
-
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-
|
|
6
|
+
import { s as TangleSandboxClientConfig, t as TangleSandboxClient } from "./index-CAay0NFR.js";
|
|
7
7
|
|
|
8
8
|
//#region src/attestation-heartbeat.d.ts
|
|
9
9
|
interface TeeAttestationHeartbeatSample {
|
|
@@ -606,31 +606,6 @@ declare const MANAGE_SANDBOXES_PARAMETERS: {
|
|
|
606
606
|
};
|
|
607
607
|
};
|
|
608
608
|
//#endregion
|
|
609
|
-
//#region src/profile-file-mounts.d.ts
|
|
610
|
-
interface SplitInlineProfileFileMountsResult {
|
|
611
|
-
leanProfile: AgentProfile;
|
|
612
|
-
deferredFiles: AgentProfileFileMount[];
|
|
613
|
-
}
|
|
614
|
-
interface MaterializeProfileFileMountsOptions extends WriteManyOptions {
|
|
615
|
-
/** Hard timeout per exec fallback command. */
|
|
616
|
-
execTimeoutMs?: number;
|
|
617
|
-
/**
|
|
618
|
-
* Absolute sandbox paths the file API may write directly. Relative paths are
|
|
619
|
-
* file API eligible when safe; `~/...` and other absolute paths use exec.
|
|
620
|
-
*/
|
|
621
|
-
fileApiAbsolutePrefixes?: readonly string[];
|
|
622
|
-
}
|
|
623
|
-
interface MaterializeProfileFileMountsResult {
|
|
624
|
-
written: number;
|
|
625
|
-
viaFileApi: number;
|
|
626
|
-
viaExec: number;
|
|
627
|
-
}
|
|
628
|
-
type ProfileFileMountBox = Pick<SandboxInstance, "exec"> & {
|
|
629
|
-
fs?: Pick<SandboxInstance["fs"], "supportsWriteMode" | "writeMany">;
|
|
630
|
-
};
|
|
631
|
-
declare function splitInlineProfileFileMounts(profile: AgentProfile): SplitInlineProfileFileMountsResult;
|
|
632
|
-
declare function materializeProfileFileMounts(box: ProfileFileMountBox, files: readonly AgentProfileFileMount[], options?: MaterializeProfileFileMountsOptions): Promise<MaterializeProfileFileMountsResult>;
|
|
633
|
-
//#endregion
|
|
634
609
|
//#region src/resources.d.ts
|
|
635
610
|
/**
|
|
636
611
|
* Compute tiers, ordered smallest → largest. Defined HERE (not imported from
|
|
@@ -932,4 +907,4 @@ interface RouterEvalMatrixCaseResult {
|
|
|
932
907
|
}
|
|
933
908
|
declare function runTangleRouterEvalMatrixInSandbox(options: RunTangleRouterEvalMatrixInSandboxOptions): Promise<RunTangleRouterEvalMatrixInSandboxResult>;
|
|
934
909
|
//#endregion
|
|
935
|
-
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 AgentProfileValidationIssue, type AgentProfileValidationResult, type AgentSubagentProfile, type AnyTokenPayload, type AttachSandboxFleetMachineOptions, AuthError, type BackendCapabilities, type BackendConfig, type BackendInfo, type BackendManager, type BackendStatus, type BackendType, type BatchEvent, type BatchOptions, type BatchResult, type BatchTask, type BatchTaskResult, type BuildControlPlaneMcpConfigOptions, type BuildProgressEvent, type BuildSandboxMcpConfigOptions, CONTROL_PLANE_MCP_SERVER_NAME, CapabilityError, type CheckpointInfo, type CheckpointOptions, type CheckpointResult, type CodeResult, 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 CompletedTurnResult, type ConfidentialSandboxResult, type ConfidentialTeeType, type CreateConfidentialSandboxOptions, type CreateIntelligenceReportOptions, type CreateSandboxFleetOptions, type CreateSandboxFleetWithCoordinatorOptions, type CreateSandboxOptions, type CreateTeamOptions, DEFAULT_SANDBOX_SIZE, type DeleteOptions, type DirectoryPermission, type DispatchPromptOptions, type DispatchedSession, type DownloadOptions, type DownloadProgress, type DriveTurnOptions, type DriverConfig, type DriverInfo, type DriverType, type EgressManager, type EgressPolicy, type EventStreamOptions, type ExecOptions, type ExecResult, type FileInfo, type FileSystem, type FleetDispatchCancelResult, type FleetDispatchResultBuffer, type FleetDispatchResultBufferOptions, type FleetDispatchStreamOptions, type FleetExecDispatchOptions, type FleetMachineId, type FleetPromptDispatchOptions, type ForkOptions, type ForkResult, type GitAuth, type GitBranch, type GitCommit, type GitConfig, type GitDiff, type GitStatus, type GpuType, 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 InteractiveAuthFile, InteractiveSessionHandle, type InteractiveSessionHost, type InteractiveSessionInfo, 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
|
|
910
|
+
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 AgentProfileValidationIssue, type AgentProfileValidationResult, type AgentSubagentProfile, type AnyTokenPayload, type AttachSandboxFleetMachineOptions, AuthError, type BackendCapabilities, type BackendConfig, type BackendInfo, type BackendManager, type BackendStatus, type BackendType, type BatchEvent, type BatchOptions, type BatchResult, type BatchTask, type BatchTaskResult, type BuildControlPlaneMcpConfigOptions, type BuildProgressEvent, type BuildSandboxMcpConfigOptions, CONTROL_PLANE_MCP_SERVER_NAME, CapabilityError, type CheckpointInfo, type CheckpointOptions, type CheckpointResult, type CodeResult, 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 CompletedTurnResult, type ConfidentialSandboxResult, type ConfidentialTeeType, type CreateConfidentialSandboxOptions, type CreateIntelligenceReportOptions, type CreateSandboxFleetOptions, type CreateSandboxFleetWithCoordinatorOptions, type CreateSandboxOptions, type CreateTeamOptions, DEFAULT_SANDBOX_SIZE, type DeleteOptions, type DirectoryPermission, type DispatchPromptOptions, type DispatchedSession, type DownloadOptions, type DownloadProgress, type DriveTurnOptions, type DriverConfig, type DriverInfo, type DriverType, type EgressManager, type EgressPolicy, type EventStreamOptions, type ExecOptions, type ExecResult, type FileInfo, type FileSystem, type FleetDispatchCancelResult, type FleetDispatchResultBuffer, type FleetDispatchResultBufferOptions, type FleetDispatchStreamOptions, type FleetExecDispatchOptions, type FleetMachineId, type FleetPromptDispatchOptions, type ForkOptions, type ForkResult, type GitAuth, type GitBranch, type GitCommit, type GitConfig, type GitDiff, type GitStatus, type GpuType, 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 InteractiveAuthFile, InteractiveSessionHandle, type InteractiveSessionHost, type InteractiveSessionInfo, 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 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 Process, type ProcessInfo, type ProcessLogEntry, type ProcessManager, type ProcessSignal, type ProcessSpawnOptions, type ProcessStatus, 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 RespondToPermissionOptions, type RouterEvalMatrixAgentProfile, type RouterEvalMatrixCaseResult, type RouterEvalMatrixHarness, type RouterEvalMatrixPayload, type RouterEvalMatrixSandboxBox, type RouterEvalMatrixSandboxClient, type RouterEvalMatrixScenario, type RouterEvalMatrixSuiteResponse, type RouterImportedRunResponse, type RouterSearchConfig, type RouterSearchConfigOptions, type RunCodeOptions, type RunTangleRouterEvalMatrixInSandboxOptions, type RunTangleRouterEvalMatrixInSandboxResult, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, type SSHCommandDescriptor, type SSHCredentials, SandboxClient as Sandbox, SandboxClient, type SandboxClientConfig, 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 SandboxInfo, SandboxInstance, type SandboxIntelligenceEnvelope, type SandboxMcpConfig, type SandboxMcpEndpoint, type SandboxMcpServerEntry, type SandboxPermissionsConfig, type SandboxResourceUsage, type SandboxResources, SandboxSession, type SandboxSizePreset, type SandboxStatus, 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, ServerError, type SessionEventStreamOptions, type SessionInfo, type SessionListOptions, type SessionMessage, type SessionStatus, type SnapshotInfo, type SnapshotOptions, type SnapshotResult, type StartInteractiveOptions, type StartupDiagnostics, type StartupOperation, StateError, type StorageConfig, type SubscriptionInfo, TangleSandboxClient, type TangleSandboxClientConfig, type TangleSearchProvider, type TaskOptions, type TaskResult, type Team, type TeamInvitation, type TeamMember, type TeeAttestationHeartbeat, type TeeAttestationHeartbeatOptions, type TeeAttestationHeartbeatSample, type TeeAttestationOptions, type TeeAttestationReport, type TeeAttestationResponse, type TeePublicKey, type TeePublicKeyResponse, TimeoutError, type TokenRefreshHandler, type ToolsConfig, type TraceExportFormat, type TraceExportResult, type TraceExportSink, type TurnDriveResult, type UpdateUserOptions, type UploadOptions, type UploadProgress, type UsageInfo, ValidationError, type WaitForOptions, type WriteFileOptions, type WriteManyFile, type WriteManyOptions, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, collectAgentResponseText, createConfidentialSandbox, createManageSandboxesTool, defineAgentProfile, defineGitHubResource, defineInlineResource, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, mergeAgentProfiles, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, serializeForSidecar, startTeeAttestationHeartbeat, toOtelJson };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as collectAgentResponseText, c as buildTraceExportPayload, d as toOtelJson,
|
|
1
|
+
import { a as collectAgentResponseText, c as buildTraceExportPayload, d as toOtelJson, h as serializeForSidecar, i as applySandboxEventText, l as exportTraceBundle, m as normalizeRuntimeBackendConfig, n as SandboxSession, o as getSandboxEventText, p as parseSSEStream, r as InteractiveSessionHandle, t as SandboxInstance, u as otelTraceIdForTangleTrace } from "./sandbox-CZGUBb3U.js";
|
|
2
2
|
import { a as PartialFailureError, c as ServerError, d as ValidationError, i as NotFoundError, l as StateError, n as CapabilityError, o as QuotaError, r as NetworkError, s as SandboxError, t as AuthError, u as TimeoutError } from "./errors-DZsfJUuc.js";
|
|
3
|
-
import { a as DEFAULT_SANDBOX_SIZE, c as resolveSandboxResources, i as SandboxFleetClient, l as sandboxResourcesForSize, n as SandboxClient, o as SANDBOX_SIZE_PRESETS, r as SandboxFleet, s as SANDBOX_SIZE_PRESET_NAMES, t as IntelligenceClient } from "./client-
|
|
3
|
+
import { a as DEFAULT_SANDBOX_SIZE, c as resolveSandboxResources, i as SandboxFleetClient, l as sandboxResourcesForSize, n as SandboxClient, o as SANDBOX_SIZE_PRESETS, r as SandboxFleet, s as SANDBOX_SIZE_PRESET_NAMES, t as IntelligenceClient } from "./client-Y5RIIHCp.js";
|
|
4
4
|
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "./collaboration-BxlfZ2Uh.js";
|
|
5
|
-
import { t as TangleSandboxClient } from "./tangle-
|
|
5
|
+
import { t as TangleSandboxClient } from "./tangle-BInShBah.js";
|
|
6
6
|
import { defineAgentProfile, defineGitHubResource, defineInlineResource, mergeAgentProfiles } from "@tangle-network/agent-interface";
|
|
7
7
|
//#region src/confidential.ts
|
|
8
8
|
function generateAttestationNonce(bytes = 32) {
|
|
@@ -784,281 +784,6 @@ function buildControlPlaneMcpConfig(options) {
|
|
|
784
784
|
};
|
|
785
785
|
}
|
|
786
786
|
//#endregion
|
|
787
|
-
//#region src/profile-file-mounts.ts
|
|
788
|
-
const PROFILE_FILE_MOUNT_B64_CHUNK_CHARS = 3e3;
|
|
789
|
-
const PROFILE_FILE_MOUNT_MAX_RETRIES = 4;
|
|
790
|
-
const PROFILE_FILE_MOUNT_RETRY_BASE_MS = 250;
|
|
791
|
-
const PROFILE_FILE_MOUNT_RETRY_MAX_MS = 2e3;
|
|
792
|
-
const PROFILE_FILE_MOUNT_EXEC_TIMEOUT_MS = 3e4;
|
|
793
|
-
const PROFILE_FILE_MOUNT_PACE_MS = 150;
|
|
794
|
-
const PROFILE_BIN_DIR_RE = /(^|\/)(s?bin)\//;
|
|
795
|
-
const DEFAULT_PROFILE_FILE_API_ABSOLUTE_PREFIXES = [
|
|
796
|
-
["/home", "agent"].join("/"),
|
|
797
|
-
["/home", "user"].join("/"),
|
|
798
|
-
"/tmp",
|
|
799
|
-
"/output"
|
|
800
|
-
];
|
|
801
|
-
function inlineContent(mount) {
|
|
802
|
-
const resource = mount.resource;
|
|
803
|
-
if (resource.kind !== "inline") throw new Error(`materializeProfileFileMounts: ${mount.path} requires an inline resource`);
|
|
804
|
-
if (typeof resource.content !== "string") throw new Error(`materializeProfileFileMounts: ${mount.path} inline resource requires string content`);
|
|
805
|
-
return resource.content;
|
|
806
|
-
}
|
|
807
|
-
function splitInlineProfileFileMounts(profile) {
|
|
808
|
-
const files = profile.resources?.files ?? [];
|
|
809
|
-
const deferredFiles = [];
|
|
810
|
-
const keptFiles = [];
|
|
811
|
-
for (const mount of files) if (mount.resource.kind === "inline") deferredFiles.push(mount);
|
|
812
|
-
else keptFiles.push(mount);
|
|
813
|
-
if (deferredFiles.length === 0) return {
|
|
814
|
-
leanProfile: profile,
|
|
815
|
-
deferredFiles
|
|
816
|
-
};
|
|
817
|
-
return {
|
|
818
|
-
leanProfile: {
|
|
819
|
-
...profile,
|
|
820
|
-
resources: {
|
|
821
|
-
...profile.resources ?? {},
|
|
822
|
-
files: keptFiles
|
|
823
|
-
}
|
|
824
|
-
},
|
|
825
|
-
deferredFiles
|
|
826
|
-
};
|
|
827
|
-
}
|
|
828
|
-
function shellSingleQuote(value) {
|
|
829
|
-
return `'${value.replace(/'/g, `'\\''`)}'`;
|
|
830
|
-
}
|
|
831
|
-
function shellPath(path) {
|
|
832
|
-
if (path === "~") return "\"$HOME\"";
|
|
833
|
-
if (path.startsWith("~/")) {
|
|
834
|
-
const rest = path.slice(2);
|
|
835
|
-
return rest ? `"$HOME"/${shellSingleQuote(rest)}` : "\"$HOME\"";
|
|
836
|
-
}
|
|
837
|
-
return shellSingleQuote(path);
|
|
838
|
-
}
|
|
839
|
-
function validateProfileFilePath(path) {
|
|
840
|
-
if (!path) throw new Error("materializeProfileFileMounts: file path is required");
|
|
841
|
-
if (path.endsWith("/")) throw new Error(`materializeProfileFileMounts: refusing directory-shaped file path ${path}`);
|
|
842
|
-
if (hasControlCharacter(path)) throw new Error(`materializeProfileFileMounts: refusing unsafe file path ${JSON.stringify(path)}`);
|
|
843
|
-
if (path === "~" || /^~[^/]/.test(path)) throw new Error(`materializeProfileFileMounts: refusing unsupported home path ${path}`);
|
|
844
|
-
if (hasUnsafeFileApiSegment(path)) throw new Error(`materializeProfileFileMounts: refusing unsafe file path ${path}`);
|
|
845
|
-
}
|
|
846
|
-
function hasUnsafeFileApiSegment(path) {
|
|
847
|
-
return path.split("/").some((segment) => segment === "." || segment === ".." || segment === ".sidecar");
|
|
848
|
-
}
|
|
849
|
-
function hasControlCharacter(value) {
|
|
850
|
-
for (let i = 0; i < value.length; i++) {
|
|
851
|
-
const code = value.charCodeAt(i);
|
|
852
|
-
if (code < 32 || code === 127) return true;
|
|
853
|
-
}
|
|
854
|
-
return false;
|
|
855
|
-
}
|
|
856
|
-
function normalizeAbsolutePrefixes(prefixes) {
|
|
857
|
-
return prefixes.map((prefix) => {
|
|
858
|
-
const normalized = prefix.trim().replace(/\/+$/, "");
|
|
859
|
-
if (!normalized.startsWith("/") || hasControlCharacter(normalized)) throw new Error(`materializeProfileFileMounts: fileApiAbsolutePrefixes must contain absolute paths; received ${JSON.stringify(prefix)}`);
|
|
860
|
-
if (hasUnsafeFileApiSegment(normalized)) throw new Error(`materializeProfileFileMounts: fileApiAbsolutePrefixes contains unsafe path ${JSON.stringify(prefix)}`);
|
|
861
|
-
return normalized;
|
|
862
|
-
});
|
|
863
|
-
}
|
|
864
|
-
function isAllowedAbsoluteFileApiPath(path, prefixes) {
|
|
865
|
-
for (const prefix of prefixes) if (path === prefix || path.startsWith(`${prefix}/`)) return true;
|
|
866
|
-
return false;
|
|
867
|
-
}
|
|
868
|
-
function fileApiTarget(mount, absolutePrefixes) {
|
|
869
|
-
if (mount.path.startsWith("~/")) return null;
|
|
870
|
-
if (mount.path.startsWith("/")) return isAllowedAbsoluteFileApiPath(mount.path, absolutePrefixes) ? mount.path : null;
|
|
871
|
-
if (mount.path.startsWith("~")) return null;
|
|
872
|
-
if (mount.path.length === 0) return null;
|
|
873
|
-
return mount.path;
|
|
874
|
-
}
|
|
875
|
-
function isExecutableProfileFile(mount) {
|
|
876
|
-
return mount.executable ?? PROFILE_BIN_DIR_RE.test(mount.path);
|
|
877
|
-
}
|
|
878
|
-
function profileFileMode(mount) {
|
|
879
|
-
return isExecutableProfileFile(mount) ? 493 : void 0;
|
|
880
|
-
}
|
|
881
|
-
function fileApiSupportsMode(box) {
|
|
882
|
-
return box.fs?.supportsWriteMode === true;
|
|
883
|
-
}
|
|
884
|
-
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
885
|
-
var ProfileFileMountExecTimeoutError = class extends Error {
|
|
886
|
-
constructor(timeoutMs) {
|
|
887
|
-
super(`exec exceeded ${timeoutMs}ms`);
|
|
888
|
-
this.name = "ProfileFileMountExecTimeoutError";
|
|
889
|
-
}
|
|
890
|
-
};
|
|
891
|
-
function execWithTimeout(box, cmd, timeoutMs) {
|
|
892
|
-
return new Promise((resolve, reject) => {
|
|
893
|
-
let settled = false;
|
|
894
|
-
const timer = setTimeout(() => {
|
|
895
|
-
if (settled) return;
|
|
896
|
-
settled = true;
|
|
897
|
-
reject(new ProfileFileMountExecTimeoutError(timeoutMs));
|
|
898
|
-
}, timeoutMs);
|
|
899
|
-
box.exec(cmd, { timeoutMs }).then((res) => {
|
|
900
|
-
if (settled) return;
|
|
901
|
-
settled = true;
|
|
902
|
-
clearTimeout(timer);
|
|
903
|
-
resolve(res);
|
|
904
|
-
}, (err) => {
|
|
905
|
-
if (settled) return;
|
|
906
|
-
settled = true;
|
|
907
|
-
clearTimeout(timer);
|
|
908
|
-
reject(err);
|
|
909
|
-
});
|
|
910
|
-
});
|
|
911
|
-
}
|
|
912
|
-
const TRANSIENT_EXEC_STATUS_CODES = new Set([
|
|
913
|
-
408,
|
|
914
|
-
409,
|
|
915
|
-
425,
|
|
916
|
-
429,
|
|
917
|
-
500,
|
|
918
|
-
502,
|
|
919
|
-
503,
|
|
920
|
-
504
|
|
921
|
-
]);
|
|
922
|
-
const TRANSIENT_EXEC_CODE_RE = /^(ECONNRESET|ECONNREFUSED|ETIMEDOUT|EPIPE|ECONNABORTED)$/i;
|
|
923
|
-
const TRANSIENT_EXEC_MESSAGE_RE = /\b(408|409|425|429|500|502|503|504)\b|rate.?limit|too many requests|\bfetch failed\b|network error|connection reset|socket hang up|timed? out|service unavailable|bad gateway|gateway timeout|internal server error|\b(?:sidecar|runtime|exec(?:ution)?|terminal|sandbox|service|command(?:s)?|proxy)\b.{0,80}\bnot ready\b|\bnot ready\b.{0,80}\b(?:sidecar|runtime|exec(?:ution)?|terminal|sandbox|service|command(?:s)?|proxy)\b/i;
|
|
924
|
-
function errorStatus(err) {
|
|
925
|
-
const rawStatus = err.status ?? err.statusCode ?? (err.response && typeof err.response === "object" ? err.response.status : void 0);
|
|
926
|
-
if (typeof rawStatus === "number") return rawStatus;
|
|
927
|
-
if (typeof rawStatus === "string" && /^\d+$/.test(rawStatus)) return Number(rawStatus);
|
|
928
|
-
}
|
|
929
|
-
function retryAfterMs(err, seen = /* @__PURE__ */ new Set()) {
|
|
930
|
-
if (!err || typeof err !== "object") return void 0;
|
|
931
|
-
if (seen.has(err)) return void 0;
|
|
932
|
-
seen.add(err);
|
|
933
|
-
const e = err;
|
|
934
|
-
if (typeof e.retryAfterMs === "number") return e.retryAfterMs;
|
|
935
|
-
return retryAfterMs(e.cause, seen);
|
|
936
|
-
}
|
|
937
|
-
function isTransientExecError(err, seen = /* @__PURE__ */ new Set()) {
|
|
938
|
-
if (!err || typeof err !== "object") return false;
|
|
939
|
-
if (seen.has(err)) return false;
|
|
940
|
-
seen.add(err);
|
|
941
|
-
const e = err;
|
|
942
|
-
const status = errorStatus(e);
|
|
943
|
-
if (status !== void 0 && TRANSIENT_EXEC_STATUS_CODES.has(status)) return true;
|
|
944
|
-
if (typeof e.code === "string") {
|
|
945
|
-
if (TRANSIENT_EXEC_CODE_RE.test(e.code)) return true;
|
|
946
|
-
if (/rate.?limit|too.?many.?requests|429|server.?error|service.?unavailable/i.test(e.code)) return true;
|
|
947
|
-
}
|
|
948
|
-
if (typeof e.message === "string" && TRANSIENT_EXEC_MESSAGE_RE.test(e.message)) return true;
|
|
949
|
-
return isTransientExecError(e.cause, seen);
|
|
950
|
-
}
|
|
951
|
-
function transientExecError(err) {
|
|
952
|
-
if (err instanceof ProfileFileMountExecTimeoutError) return { retryable: false };
|
|
953
|
-
if (isTransientExecError(err)) return {
|
|
954
|
-
retryable: true,
|
|
955
|
-
retryAfterMs: retryAfterMs(err)
|
|
956
|
-
};
|
|
957
|
-
return { retryable: false };
|
|
958
|
-
}
|
|
959
|
-
async function sha256Hex(content) {
|
|
960
|
-
const bytes = new TextEncoder().encode(content);
|
|
961
|
-
const webSubtle = globalThis.crypto?.subtle;
|
|
962
|
-
if (webSubtle) {
|
|
963
|
-
const digest = await webSubtle.digest("SHA-256", bytes);
|
|
964
|
-
return Array.from(new Uint8Array(digest)).map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
965
|
-
}
|
|
966
|
-
const { createHash } = await import("node:crypto");
|
|
967
|
-
return createHash("sha256").update(content, "utf8").digest("hex");
|
|
968
|
-
}
|
|
969
|
-
async function execProfileFileMount(box, mount, content, options, execState) {
|
|
970
|
-
const maxRetries = options.maxRetries ?? PROFILE_FILE_MOUNT_MAX_RETRIES;
|
|
971
|
-
const path = mount.path;
|
|
972
|
-
const b64 = encodeTextForWire(content);
|
|
973
|
-
const b64Chunks = [];
|
|
974
|
-
for (let i = 0; i < b64.length; i += PROFILE_FILE_MOUNT_B64_CHUNK_CHARS) b64Chunks.push(b64.slice(i, i + PROFILE_FILE_MOUNT_B64_CHUNK_CHARS));
|
|
975
|
-
const expectedSha256 = await sha256Hex(content);
|
|
976
|
-
const dir = path.replace(/\/[^/]*$/, "");
|
|
977
|
-
const executable = isExecutableProfileFile(mount);
|
|
978
|
-
const q = shellPath(path);
|
|
979
|
-
const qb64 = shellPath(`${path}.b64`);
|
|
980
|
-
const qtmp = shellPath(`${path}.tmp`);
|
|
981
|
-
const qpartPrefix = shellPath(`${path}.b64.part.`);
|
|
982
|
-
const homeGuard = path.startsWith("~/") ? `[ -n "$HOME" ] || { echo ${shellSingleQuote(`materializeProfileFileMounts: HOME is unset for ${path}`)} >&2; exit 1; }; ` : "";
|
|
983
|
-
const run = async (cmd) => {
|
|
984
|
-
for (let attempt = 0;; attempt++) {
|
|
985
|
-
if (execState.started && options.paceMs > 0) await sleep(options.paceMs);
|
|
986
|
-
execState.started = true;
|
|
987
|
-
try {
|
|
988
|
-
return await execWithTimeout(box, cmd, options.execTimeoutMs);
|
|
989
|
-
} catch (err) {
|
|
990
|
-
const { retryable, retryAfterMs: retryAfter } = transientExecError(err);
|
|
991
|
-
if (retryable && attempt < maxRetries) {
|
|
992
|
-
const backoff = Math.min(PROFILE_FILE_MOUNT_RETRY_BASE_MS * 2 ** attempt, PROFILE_FILE_MOUNT_RETRY_MAX_MS);
|
|
993
|
-
await sleep(Math.min(retryAfter ?? backoff, PROFILE_FILE_MOUNT_RETRY_MAX_MS));
|
|
994
|
-
continue;
|
|
995
|
-
}
|
|
996
|
-
throw new Error(`materializeProfileFileMounts: exec failed for ${path}`, { cause: err });
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
};
|
|
1000
|
-
const step = async (cmd) => {
|
|
1001
|
-
const result = await run(`${homeGuard}${cmd}`);
|
|
1002
|
-
if (result.exitCode !== 0) throw new Error(`materializeProfileFileMounts: failed to write ${path} (exit ${result.exitCode}): ${result.stderr.slice(0, 500)}`);
|
|
1003
|
-
};
|
|
1004
|
-
await step(dir ? `mkdir -p ${shellPath(dir)}` : ":");
|
|
1005
|
-
for (let i = 0; i < b64Chunks.length; i++) {
|
|
1006
|
-
const slice = b64Chunks[i];
|
|
1007
|
-
if (slice === void 0) continue;
|
|
1008
|
-
await step(`printf '%s' '${slice}' > ${shellPath(`${path}.b64.part.${i}`)}`);
|
|
1009
|
-
}
|
|
1010
|
-
const chmod = executable ? `chmod +x ${q} || exit 1; ` : "";
|
|
1011
|
-
const checksumMismatch = shellSingleQuote(`materializeProfileFileMounts: checksum mismatch for ${path}`);
|
|
1012
|
-
await step(`cleanup() { ${`rm -f ${qb64} ${qtmp}; i=0; while [ "$i" -lt ${b64Chunks.length} ]; do rm -f ${qpartPrefix}$i; i=$((i+1)); done`}; }; trap cleanup EXIT; expected='${expectedSha256}'; if [ -f ${q} ] && [ "$(sha256sum ${q} | awk '{print $1}')" = "$expected" ]; then ${chmod}exit 0; fi; : > ${qb64} && i=0; while [ "$i" -lt ${b64Chunks.length} ]; do cat ${qpartPrefix}$i >> ${qb64} || exit 1; i=$((i+1)); done && base64 -d ${qb64} > ${qtmp} && [ "$(sha256sum ${qtmp} | awk '{print $1}')" = "$expected" ] || { echo ${checksumMismatch} >&2; exit 1; }; mv ${qtmp} ${q} && ${executable ? `chmod +x ${q} && ` : ""}[ "$(sha256sum ${q} | awk '{print $1}')" = "$expected" ] || { echo ${checksumMismatch} >&2; exit 1; }`);
|
|
1013
|
-
}
|
|
1014
|
-
async function materializeProfileFileMounts(box, files, options = {}) {
|
|
1015
|
-
const execTimeoutMs = options.execTimeoutMs ?? PROFILE_FILE_MOUNT_EXEC_TIMEOUT_MS;
|
|
1016
|
-
const paceMs = options.paceMs ?? PROFILE_FILE_MOUNT_PACE_MS;
|
|
1017
|
-
const maxRetries = options.maxRetries ?? PROFILE_FILE_MOUNT_MAX_RETRIES;
|
|
1018
|
-
const absolutePrefixes = normalizeAbsolutePrefixes(options.fileApiAbsolutePrefixes ?? DEFAULT_PROFILE_FILE_API_ABSOLUTE_PREFIXES);
|
|
1019
|
-
const fs = box.fs;
|
|
1020
|
-
const fileApiAvailable = typeof fs?.writeMany === "function";
|
|
1021
|
-
const modeAwareFileApi = fileApiSupportsMode(box);
|
|
1022
|
-
const viaFileApi = [];
|
|
1023
|
-
const viaExec = [];
|
|
1024
|
-
for (const mount of files) {
|
|
1025
|
-
const content = inlineContent(mount);
|
|
1026
|
-
validateProfileFilePath(mount.path);
|
|
1027
|
-
const target = fileApiAvailable ? fileApiTarget(mount, absolutePrefixes) : null;
|
|
1028
|
-
const executable = isExecutableProfileFile(mount);
|
|
1029
|
-
if (target !== null && (!executable || modeAwareFileApi)) {
|
|
1030
|
-
const mode = profileFileMode(mount);
|
|
1031
|
-
viaFileApi.push({
|
|
1032
|
-
path: target,
|
|
1033
|
-
content,
|
|
1034
|
-
...mode !== void 0 ? { mode } : {}
|
|
1035
|
-
});
|
|
1036
|
-
} else viaExec.push({
|
|
1037
|
-
mount,
|
|
1038
|
-
content
|
|
1039
|
-
});
|
|
1040
|
-
}
|
|
1041
|
-
if (viaFileApi.length > 0) try {
|
|
1042
|
-
await fs?.writeMany(viaFileApi, {
|
|
1043
|
-
paceMs,
|
|
1044
|
-
maxRetries
|
|
1045
|
-
});
|
|
1046
|
-
} catch (err) {
|
|
1047
|
-
throw new Error("materializeProfileFileMounts: file API batch write failed", { cause: err });
|
|
1048
|
-
}
|
|
1049
|
-
const execState = { started: false };
|
|
1050
|
-
for (const item of viaExec) await execProfileFileMount(box, item.mount, item.content, {
|
|
1051
|
-
execTimeoutMs,
|
|
1052
|
-
paceMs,
|
|
1053
|
-
maxRetries
|
|
1054
|
-
}, execState);
|
|
1055
|
-
return {
|
|
1056
|
-
written: viaFileApi.length + viaExec.length,
|
|
1057
|
-
viaFileApi: viaFileApi.length,
|
|
1058
|
-
viaExec: viaExec.length
|
|
1059
|
-
};
|
|
1060
|
-
}
|
|
1061
|
-
//#endregion
|
|
1062
787
|
//#region src/router-search.ts
|
|
1063
788
|
const DEFAULT_ROUTER_URL = "https://router.tangle.tools";
|
|
1064
789
|
async function fetchTangleRouterSearchConfig(options = {}) {
|
|
@@ -1452,4 +1177,4 @@ function stripUndefined(value) {
|
|
|
1452
1177
|
return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== void 0).map(([k, v]) => [k, stripUndefined(v)]));
|
|
1453
1178
|
}
|
|
1454
1179
|
//#endregion
|
|
1455
|
-
export { AuthError, CONTROL_PLANE_MCP_SERVER_NAME, CapabilityError, CollaborationClient, CollaborationFileBridge, DEFAULT_SANDBOX_SIZE, Image, ImageBuilder, IntelligenceClient, InteractiveSessionHandle, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, NetworkError, NotFoundError, PartialFailureError, QuotaError, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxFleet, SandboxFleetClient, SandboxInstance, SandboxSession, ServerError, StateError, TangleSandboxClient, TimeoutError, ValidationError, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, collectAgentResponseText, createConfidentialSandbox, createManageSandboxesTool, defineAgentProfile, defineGitHubResource, defineInlineResource, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText,
|
|
1180
|
+
export { AuthError, CONTROL_PLANE_MCP_SERVER_NAME, CapabilityError, CollaborationClient, CollaborationFileBridge, DEFAULT_SANDBOX_SIZE, Image, ImageBuilder, IntelligenceClient, InteractiveSessionHandle, MANAGE_SANDBOXES_PARAMETERS, MANAGE_SANDBOXES_TOOL_NAME, NetworkError, NotFoundError, PartialFailureError, QuotaError, SANDBOX_MCP_SERVER_NAME, SANDBOX_SIZE_PRESETS, SANDBOX_SIZE_PRESET_NAMES, SandboxClient as Sandbox, SandboxClient, SandboxError, SandboxFleet, SandboxFleetClient, SandboxInstance, SandboxSession, ServerError, StateError, TangleSandboxClient, TimeoutError, ValidationError, applySandboxEventText, buildCollaborationDocumentId, buildControlPlaneMcpConfig, buildSandboxMcpConfig, buildTangleRouterEvalMatrixRequest, buildTangleRouterResponsesWebSearchRequest, buildTangleRouterSearchBackend, buildTangleRouterSearchProfile, buildTraceExportPayload, collectAgentResponseText, createConfidentialSandbox, createManageSandboxesTool, defineAgentProfile, defineGitHubResource, defineInlineResource, exportTraceBundle, fetchTangleRouterSearchConfig, generateAttestationNonce, generateDockerfile, getSandboxEventText, mergeAgentProfiles, normalizeCollaborationPath, normalizeRuntimeBackendConfig, otelTraceIdForTangleTrace, parseCollaborationDocumentId, parseSSEStream, resolveSandboxResources, runTangleRouterEvalMatrixInSandbox, sandboxResourcesForSize, serializeForSidecar, startTeeAttestationHeartbeat, toOtelJson };
|
|
@@ -825,8 +825,8 @@ function isTransientSnapshotVisibilityError(error) {
|
|
|
825
825
|
* `prompt`/`task`/`_sessionResult`/turn settling. A run succeeds only when it
|
|
826
826
|
* reached a terminal event, raised no run-level error, hit no approval gate,
|
|
827
827
|
* left no unanswered question, and recorded no failed (`isError`) tool. A
|
|
828
|
-
* tool-only turn with no text succeeds
|
|
829
|
-
* narrated around) fails.
|
|
828
|
+
* tool-only turn with no text succeeds unless the server enforces visible-output
|
|
829
|
+
* requirements; a turn whose tool failed (even if narrated around) fails.
|
|
830
830
|
*/
|
|
831
831
|
function deriveOutcome(inputs) {
|
|
832
832
|
if (inputs.question) return {
|
|
@@ -842,7 +842,8 @@ function deriveOutcome(inputs) {
|
|
|
842
842
|
if (inputs.runError) return {
|
|
843
843
|
status: "failed",
|
|
844
844
|
success: false,
|
|
845
|
-
error: inputs.runError
|
|
845
|
+
error: inputs.runError,
|
|
846
|
+
errorCode: inputs.runErrorCode
|
|
846
847
|
};
|
|
847
848
|
const failedTool = inputs.toolInvocations?.find((t) => t.isError === true);
|
|
848
849
|
if (failedTool) return {
|
|
@@ -1460,6 +1461,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1460
1461
|
const startTime = Date.now();
|
|
1461
1462
|
let responseText;
|
|
1462
1463
|
let runError;
|
|
1464
|
+
let runErrorCode;
|
|
1463
1465
|
let traceId;
|
|
1464
1466
|
let usage;
|
|
1465
1467
|
let costUsd;
|
|
@@ -1482,12 +1484,16 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1482
1484
|
if (event.type === "result" || event.type === "done") terminalReached = true;
|
|
1483
1485
|
if (event.type === "interaction") question = readQuestionEvent(event.data) ?? question;
|
|
1484
1486
|
if (event.type === "trace.id") traceId = event.data.traceId;
|
|
1485
|
-
if (event.type === "error")
|
|
1487
|
+
if (event.type === "error") {
|
|
1488
|
+
runError = event.data.message;
|
|
1489
|
+
runErrorCode = event.data.code;
|
|
1490
|
+
}
|
|
1486
1491
|
}
|
|
1487
1492
|
const approval = detectHubApproval(toolInvocations);
|
|
1488
1493
|
const outcome = deriveOutcome({
|
|
1489
1494
|
terminalReached,
|
|
1490
1495
|
runError,
|
|
1496
|
+
runErrorCode,
|
|
1491
1497
|
toolInvocations,
|
|
1492
1498
|
approval,
|
|
1493
1499
|
question
|
|
@@ -1497,6 +1503,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1497
1503
|
status: outcome.status,
|
|
1498
1504
|
response: responseText,
|
|
1499
1505
|
error: outcome.error,
|
|
1506
|
+
errorCode: outcome.errorCode,
|
|
1500
1507
|
toolInvocations,
|
|
1501
1508
|
approval,
|
|
1502
1509
|
question,
|
|
@@ -1594,6 +1601,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1594
1601
|
sessionId: options?.sessionId,
|
|
1595
1602
|
turnId: options?.turnId,
|
|
1596
1603
|
metadata: options?.context,
|
|
1604
|
+
requireVisibleAssistantOutput: options?.requireVisibleAssistantOutput,
|
|
1597
1605
|
...options?.detach ? { detach: true } : {},
|
|
1598
1606
|
backend: normalizeRuntimeBackendConfig(options?.backend ?? this.defaultRuntimeBackend, { model: options?.model })
|
|
1599
1607
|
})
|
|
@@ -1849,6 +1857,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1849
1857
|
const sessionId = options?.sessionId ?? `task-${crypto.randomUUID()}`;
|
|
1850
1858
|
let responseText;
|
|
1851
1859
|
let runError;
|
|
1860
|
+
let runErrorCode;
|
|
1852
1861
|
let traceId;
|
|
1853
1862
|
let usage;
|
|
1854
1863
|
let costUsd;
|
|
@@ -1872,12 +1881,16 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1872
1881
|
if (event.type === "result" || event.type === "done") terminalReached = true;
|
|
1873
1882
|
if (event.type === "interaction") question = readQuestionEvent(event.data) ?? question;
|
|
1874
1883
|
if (event.type === "trace.id") traceId = event.data.traceId;
|
|
1875
|
-
if (event.type === "error")
|
|
1884
|
+
if (event.type === "error") {
|
|
1885
|
+
runError = event.data.message;
|
|
1886
|
+
runErrorCode = event.data.code;
|
|
1887
|
+
}
|
|
1876
1888
|
}
|
|
1877
1889
|
const approval = detectHubApproval(toolInvocations);
|
|
1878
1890
|
const outcome = deriveOutcome({
|
|
1879
1891
|
terminalReached,
|
|
1880
1892
|
runError,
|
|
1893
|
+
runErrorCode,
|
|
1881
1894
|
toolInvocations,
|
|
1882
1895
|
approval,
|
|
1883
1896
|
question
|
|
@@ -1887,6 +1900,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
1887
1900
|
status: outcome.status,
|
|
1888
1901
|
response: responseText,
|
|
1889
1902
|
error: outcome.error,
|
|
1903
|
+
errorCode: outcome.errorCode,
|
|
1890
1904
|
toolInvocations,
|
|
1891
1905
|
approval,
|
|
1892
1906
|
question,
|
|
@@ -4222,6 +4236,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
4222
4236
|
const startTime = Date.now();
|
|
4223
4237
|
let response;
|
|
4224
4238
|
let runError;
|
|
4239
|
+
let runErrorCode;
|
|
4225
4240
|
let traceId;
|
|
4226
4241
|
let usage;
|
|
4227
4242
|
let costUsd;
|
|
@@ -4241,7 +4256,11 @@ var SandboxInstance = class SandboxInstance {
|
|
|
4241
4256
|
}
|
|
4242
4257
|
if (event.type === "interaction") question = readQuestionEvent(event.data) ?? question;
|
|
4243
4258
|
if (event.type === "trace.id") traceId = event.data.traceId;
|
|
4244
|
-
if (event.type === "error")
|
|
4259
|
+
if (event.type === "error") {
|
|
4260
|
+
const data = event.data;
|
|
4261
|
+
runError = data.message;
|
|
4262
|
+
runErrorCode = data.code;
|
|
4263
|
+
}
|
|
4245
4264
|
if (event.type === "done" || event.type === "result") {
|
|
4246
4265
|
terminalReached = true;
|
|
4247
4266
|
break;
|
|
@@ -4251,6 +4270,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
4251
4270
|
const outcome = deriveOutcome({
|
|
4252
4271
|
terminalReached,
|
|
4253
4272
|
runError,
|
|
4273
|
+
runErrorCode,
|
|
4254
4274
|
toolInvocations,
|
|
4255
4275
|
approval,
|
|
4256
4276
|
question
|
|
@@ -4260,6 +4280,7 @@ var SandboxInstance = class SandboxInstance {
|
|
|
4260
4280
|
status: outcome.status,
|
|
4261
4281
|
response,
|
|
4262
4282
|
error: outcome.error,
|
|
4283
|
+
errorCode: outcome.errorCode,
|
|
4263
4284
|
toolInvocations,
|
|
4264
4285
|
approval,
|
|
4265
4286
|
question,
|
|
@@ -4500,4 +4521,4 @@ function quoteForShell(value) {
|
|
|
4500
4521
|
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
4501
4522
|
}
|
|
4502
4523
|
//#endregion
|
|
4503
|
-
export { collectAgentResponseText as a, buildTraceExportPayload as c, toOtelJson as d, encodePromptForWire as f, serializeForSidecar as
|
|
4524
|
+
export { collectAgentResponseText as a, buildTraceExportPayload as c, toOtelJson as d, encodePromptForWire as f, serializeForSidecar as h, applySandboxEventText as i, exportTraceBundle as l, normalizeRuntimeBackendConfig as m, SandboxSession as n, getSandboxEventText as o, parseSSEStream as p, InteractiveSessionHandle as r, normalizeConnection as s, SandboxInstance as t, otelTraceIdForTangleTrace as u };
|
|
@@ -986,7 +986,8 @@ interface InstalledTool {
|
|
|
986
986
|
/**
|
|
987
987
|
* Granular outcome of an agent run.
|
|
988
988
|
* - `success` — reached a terminal event with no run-level error and no failed
|
|
989
|
-
* tool. A tool-only turn
|
|
989
|
+
* tool. A tool-only turn succeeds unless the caller opts into visible-output
|
|
990
|
+
* enforcement.
|
|
990
991
|
* - `failed` — a run-level error event, or any failed (`isError`) tool, or the
|
|
991
992
|
* stream ended with no terminal event.
|
|
992
993
|
* - `blocked_on_approval` — a tool hit a hub approval gate; resolve it, then
|
|
@@ -1038,8 +1039,8 @@ interface PromptResult {
|
|
|
1038
1039
|
/**
|
|
1039
1040
|
* Whether the run succeeded. Shorthand for `status === "success"`: true only
|
|
1040
1041
|
* when the run reached a terminal event with no run-level error and no failed
|
|
1041
|
-
* tool.
|
|
1042
|
-
*
|
|
1042
|
+
* tool. Text presence is not required unless `requireVisibleAssistantOutput`
|
|
1043
|
+
* is set and no visible output was produced.
|
|
1043
1044
|
*/
|
|
1044
1045
|
success: boolean;
|
|
1045
1046
|
/** Granular run outcome. */
|
|
@@ -1048,6 +1049,8 @@ interface PromptResult {
|
|
|
1048
1049
|
response?: string;
|
|
1049
1050
|
/** Error message when the run did not succeed */
|
|
1050
1051
|
error?: string;
|
|
1052
|
+
/** Machine-readable error code from the runtime, e.g. `empty_visible_output`. */
|
|
1053
|
+
errorCode?: string;
|
|
1051
1054
|
/** Tool calls the agent made this run, including failures (`isError`). */
|
|
1052
1055
|
toolInvocations?: AgentToolInvocation[];
|
|
1053
1056
|
/** Set when `status === "blocked_on_approval"`. */
|
|
@@ -1102,6 +1105,8 @@ interface PromptOptions {
|
|
|
1102
1105
|
timeoutMs?: number;
|
|
1103
1106
|
/** Additional context */
|
|
1104
1107
|
context?: Record<string, unknown>;
|
|
1108
|
+
/** Fail chat-like runs that finish with no text or renderable interaction. */
|
|
1109
|
+
requireVisibleAssistantOutput?: boolean;
|
|
1105
1110
|
/** AbortSignal for cancellation */
|
|
1106
1111
|
signal?: AbortSignal;
|
|
1107
1112
|
/**
|
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-CAay0NFR.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-BInShBah.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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/sandbox",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
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",
|