@tangle-network/sandbox 1.0.509 → 1.0.510
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +5 -5
- package/dist/agent/preview.d.ts +1 -1
- package/dist/agent/preview.js +2 -2
- package/dist/{agent-run-outcome-IWbQgIbt.d.ts → agent-run-outcome-hucdyrR6.d.ts} +1 -1
- package/dist/{api-request-CJ9M-TN7.js → api-request-Da3Gy5v5.js} +13 -4
- package/dist/auth/index.js +2 -2
- package/dist/{browser-interactive-control-controller-CNqYrsK-.d.ts → browser-interactive-control-controller-CD8b8KFn.d.ts} +1 -1
- package/dist/{browser-interactive-control-controller-cfE_Hhvr.js → browser-interactive-control-controller-CT6ThlkW.js} +1 -1
- package/dist/{chunked-upload-6M8Y9Sry.js → chunked-upload-ClIgZBWm.js} +3 -3
- package/dist/{chunked-upload-file-BAqjjSIN.js → chunked-upload-file-rgkPRmQb.js} +2 -2
- package/dist/cli-auth-bundle-ECDHagkC.js +2 -0
- package/dist/{client-DL_Q0ixz.js → client-4msWs7Tt.js} +48 -36
- package/dist/{client-Bb4VO8Tv.d.ts → client-DFaxpuf9.d.ts} +6 -5
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-ZcNePxyN.js → collaboration-BD6TvBWe.js} +2 -2
- package/dist/core.d.ts +6 -6
- package/dist/core.js +6 -6
- package/dist/{direct-http2-Dm88_AQC.js → direct-http2-Drov3Qp5.js} +2 -2
- package/dist/{error-catalog-DMNep7Y3.js → error-catalog-DwxHMZQZ.js} +3 -0
- package/dist/{errors-CgHRBUnE.js → errors-BuEDuIrs.js} +1 -1
- package/dist/{file-download-CeikrxZL.js → file-download-BEPpLHi7.js} +1 -1
- package/dist/gpu-lease/index.js +2 -2
- package/dist/{index-D7dMz_US.d.ts → index-CtrSdLo2.d.ts} +9 -8
- package/dist/index.d.ts +9 -9
- package/dist/index.js +14 -14
- package/dist/intelligence/index.js +4 -4
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-zv5TV56E.js → interactive-controller-D1FTM_Uc.js} +6 -6
- package/dist/{interactive-controller-RKI6dXBi.d.ts → interactive-controller-DJpf6ofh.d.ts} +3 -3
- package/dist/{keep-alive-fetch-DjzdPAP3.js → keep-alive-fetch-xLyOpHAc.js} +1 -1
- package/dist/lib/prepared-evidence.js +1 -1
- package/dist/lib/prepared-process.js +1 -1
- package/dist/lifecycle-trace-CDGgSOVP.js +36 -0
- package/dist/{lines-DkfkbLSV.d.ts → lines-Ce4UmKfm.d.ts} +1 -1
- package/dist/{lines-CdfEanMh.js → lines-D3DKzzQT.js} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -1
- package/dist/{local-cli-auth-CueE1l0F.js → local-cli-auth-BVXWKaty.js} +1 -1
- package/dist/{mcp-local-LIZ1E1uA.js → mcp-local-DHtlG49d.js} +4 -4
- package/dist/{prepared-evidence-BMADfSad.js → prepared-evidence-BKtdRWT7.js} +1 -1
- package/dist/{prepared-process-B4DuLmEg.js → prepared-process-ZCv_G1q4.js} +1 -1
- package/dist/{preview-tqaVk0Af.d.ts → preview-C4nOdGvR.d.ts} +3 -3
- package/dist/{public-templates-maL22HQt.d.ts → public-templates-GebzRZgV.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/public-templates.js +1 -1
- package/dist/{raw-evidence-archive-GuIfCwo8.js → raw-evidence-archive-_aeJodxs.js} +3 -3
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +5 -5
- package/dist/{sandbox-BTTAoCMR.js → sandbox-CmeidNvi.js} +90 -44
- package/dist/{secp256k1-DIwypP5B.js → secp256k1-B2arMxku.js} +1 -1
- package/dist/{select-seat-Cq1LrUG-.js → select-seat-D_L4pss9.js} +3 -3
- package/dist/select-seat-command.d.ts +2 -2
- package/dist/select-seat-command.js +2 -2
- package/dist/session-gateway/index.js +2 -2
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +2 -2
- package/dist/{tangle-DBx6JdWz.js → tangle-CCpUk8qc.js} +6 -6
- package/dist/{terminal-stream-types-RAsy75gD.d.ts → terminal-stream-types-BMLdhwUQ.d.ts} +3 -0
- package/dist/{trace-id-8KPKajMl.js → trace-id-DX218plN.js} +8 -2
- package/dist/{types-5by8R76_.d.ts → types-DOngB_Rs.d.ts} +4 -1
- package/package.json +4 -4
- package/dist/cli-auth-bundle-DqIHmlbG.js +0 -2
- /package/dist/{abi-pcDt2Adp.js → abi-CQYNCS4F.js} +0 -0
- /package/dist/{cli-auth-bundle-CXI4ysvr-DMV1Pos7.js → cli-auth-bundle-CXI4ysvr-CGgx1JDO.js} +0 -0
- /package/dist/{core-CBWUEURz.js → core-BWiEs9yv.js} +0 -0
- /package/dist/{file-transfer-DOSTbUSR.js → file-transfer-CnCWFYua.js} +0 -0
- /package/dist/{preview-operations-BTHZR1w2.js → preview-operations-DYH3y0cn.js} +0 -0
- /package/dist/{raw-evidence-export-Dog7W5zP.js → raw-evidence-export-gCbAD5ZV.js} +0 -0
- /package/dist/{retry-policy-oW3_ljoc.js → retry-policy-BlkQJ7_e.js} +0 -0
- /package/dist/{sse-parser-BCG3iL9j.js → sse-parser-DTgSRcZC.js} +0 -0
- /package/dist/{utils-BvN0Mk3j.js → utils-fYi8g-M-.js} +0 -0
package/README.md
CHANGED
|
@@ -142,7 +142,7 @@ try {
|
|
|
142
142
|
Keep `delete()` in `finally` unless the sandbox must outlive the process.
|
|
143
143
|
`delete()` answers once the sandbox is dead and billed; its container, volume and network are reclaimed behind the answer, and the acknowledgement reports `removal: "pending"`.
|
|
144
144
|
The sandbox is already gone for every read at that point.
|
|
145
|
-
Deleted customer snapshot repositories, including their final snapshot, remain until their owner explicitly deletes them. Platform-managed repositories of internal-account boxes retire automatically after the deleted-retention window, subject to preservation holds and active exports/restores. The serving window comes from the storage owner; see [deleted repository retention](../../../docs/sandbox-lifecycle-reliability.md#deleted-snapshot-repository-retirement).
|
|
145
|
+
Deleted customer snapshot repositories, including their final snapshot when the delete took one, remain until their owner explicitly deletes them. A delete takes a final snapshot of every sandbox, unless the deployment takes delete backups on request: then only of a sandbox created with `retain` paths or `retain.publication`, required native session capture or customer storage. A sandbox stopped with `retain` keeps the snapshot that stop confirmed as its final one. Otherwise the newest snapshot confirmed before the delete, if any, is the last one. Platform-managed repositories of internal-account boxes retire automatically after the deleted-retention window, subject to preservation holds and active exports/restores. The serving window comes from the storage owner; see [deleted repository retention](../../../docs/sandbox-lifecycle-reliability.md#deleted-snapshot-repository-retirement).
|
|
146
146
|
Pass `await box.delete({ until: "removed" })` when you need the reclaim itself, for example before reusing the same host capacity in a test; it reports `removal: "complete"`, or `"pending"` if the wait runs out.
|
|
147
147
|
|
|
148
148
|
To remove every sandbox that one job created, tag them with metadata at create time and delete them by prefix:
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { I as SandboxTaskSession, O as SandboxInstance, R as SandboxSession } from "../index-
|
|
2
|
-
import { Ga as CodeLanguage, Ka as CodeResultPart, Wa as CodeExecutionResult, ga as BackendConfig, hr as CodeExecutionOptions, ia as SessionListOptions, io as BackendType, na as SessionInfo, vt as SandboxFleetParent } from "../types-
|
|
3
|
-
import { t as Sandbox } from "../client-
|
|
4
|
-
import { u as PreviewAuthorizer } from "../preview-
|
|
1
|
+
import { I as SandboxTaskSession, O as SandboxInstance, R as SandboxSession } from "../index-CtrSdLo2.js";
|
|
2
|
+
import { Ga as CodeLanguage, Ka as CodeResultPart, Wa as CodeExecutionResult, ga as BackendConfig, hr as CodeExecutionOptions, ia as SessionListOptions, io as BackendType, na as SessionInfo, vt as SandboxFleetParent } from "../types-DOngB_Rs.js";
|
|
3
|
+
import { t as Sandbox } from "../client-DFaxpuf9.js";
|
|
4
|
+
import { u as PreviewAuthorizer } from "../preview-C4nOdGvR.js";
|
|
5
5
|
import * as _$_modelcontextprotocol_sdk_server_index_js0 from "@modelcontextprotocol/sdk/server/index.js";
|
|
6
6
|
import { JSONSchema } from "zod/v4/core";
|
|
7
7
|
import { ToolSet } from "ai";
|
package/dist/agent/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-
|
|
2
|
-
import { x as assertCurrentBackendType } from "../interactive-controller-
|
|
3
|
-
import { t as SandboxInstance } from "../sandbox-
|
|
4
|
-
import { O as ValidationError, T as StateError, v as NotFoundError } from "../errors-
|
|
5
|
-
import { t as Sandbox } from "../client-
|
|
1
|
+
import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-DHtlG49d.js";
|
|
2
|
+
import { x as assertCurrentBackendType } from "../interactive-controller-D1FTM_Uc.js";
|
|
3
|
+
import { t as SandboxInstance } from "../sandbox-CmeidNvi.js";
|
|
4
|
+
import { O as ValidationError, T as StateError, v as NotFoundError } from "../errors-BuEDuIrs.js";
|
|
5
|
+
import { t as Sandbox } from "../client-4msWs7Tt.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/agent/instances.ts
|
|
8
8
|
const managers = /* @__PURE__ */ new WeakMap();
|
package/dist/agent/preview.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as publishAgentPreview, a as previewOperationTool, c as AgentPreviewOptions, d as PreviewExecutionContext, f as PublishAgentPreviewOptions, g as listAgentPreviews, h as getAgentPreview, i as PreviewTool, l as PreviewAuthorizationRequest, m as ensureAgentPreview, n as PREVIEW_MCP_ALIAS, o as previewToolsForProfile, p as assertPreviewId, r as PREVIEW_TOOLS, s as AgentPreviewError, t as servePreviewMcp, u as PreviewAuthorizer, v as removeAgentPreview, y as resolveSelfSandbox } from "../preview-
|
|
1
|
+
import { _ as publishAgentPreview, a as previewOperationTool, c as AgentPreviewOptions, d as PreviewExecutionContext, f as PublishAgentPreviewOptions, g as listAgentPreviews, h as getAgentPreview, i as PreviewTool, l as PreviewAuthorizationRequest, m as ensureAgentPreview, n as PREVIEW_MCP_ALIAS, o as previewToolsForProfile, p as assertPreviewId, r as PREVIEW_TOOLS, s as AgentPreviewError, t as servePreviewMcp, u as PreviewAuthorizer, v as removeAgentPreview, y as resolveSelfSandbox } from "../preview-C4nOdGvR.js";
|
|
2
2
|
export { AgentPreviewError, AgentPreviewOptions, PREVIEW_MCP_ALIAS, PREVIEW_TOOLS, PreviewAuthorizationRequest, PreviewAuthorizer, PreviewExecutionContext, PreviewTool, PublishAgentPreviewOptions, assertPreviewId, ensureAgentPreview, getAgentPreview, listAgentPreviews, previewOperationTool, previewToolsForProfile, publishAgentPreview, removeAgentPreview, resolveSelfSandbox, servePreviewMcp };
|
package/dist/agent/preview.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as agentProfileSchema } from "../profile-schema-BHeC7cOf.js";
|
|
2
|
-
import { a as listAgentPreviews, c as resolveSelfSandbox, i as getAgentPreview, n as assertPreviewId, o as publishAgentPreview, r as ensureAgentPreview, s as removeAgentPreview, t as AgentPreviewError } from "../preview-operations-
|
|
2
|
+
import { a as listAgentPreviews, c as resolveSelfSandbox, i as getAgentPreview, n as assertPreviewId, o as publishAgentPreview, r as ensureAgentPreview, s as removeAgentPreview, t as AgentPreviewError } from "../preview-operations-DYH3y0cn.js";
|
|
3
3
|
//#region src/agent/preview-policy.ts
|
|
4
4
|
/** Channel-neutral preview tool selection from a host-authored profile. */
|
|
5
5
|
const PREVIEW_TOOLS = [
|
|
@@ -66,7 +66,7 @@ async function servePreviewMcp(request, config) {
|
|
|
66
66
|
if (typeof config.authorize !== "function") throw new Error("Preview MCP requires a host authorization callback");
|
|
67
67
|
const tools = config.tools ?? PREVIEW_TOOLS;
|
|
68
68
|
if (!tools.length || tools.some((tool) => !PREVIEW_TOOLS.includes(tool))) throw new Error("Preview MCP requires an explicit nonempty preview-only tool grant");
|
|
69
|
-
const [{ createMcpServer }, { WebStandardStreamableHTTPServerTransport }] = await Promise.all([import("../mcp-local-
|
|
69
|
+
const [{ createMcpServer }, { WebStandardStreamableHTTPServerTransport }] = await Promise.all([import("../mcp-local-DHtlG49d.js").then((n) => n.n), import("@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js")]);
|
|
70
70
|
const handle = await createMcpServer(config.box, {
|
|
71
71
|
name: "tangle-previews",
|
|
72
72
|
sessionId: config.sessionId,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as InteractionRequest } from "./index-V_pXOH3B.js";
|
|
2
|
-
import { Ei as SandboxEvent, ci as AgentQuestionRequest, gi as DurablePlanSnapshot, li as AgentRunStatus, si as AgentApprovalRequirement, ui as AgentToolInvocation } from "./types-
|
|
2
|
+
import { Ei as SandboxEvent, ci as AgentQuestionRequest, gi as DurablePlanSnapshot, li as AgentRunStatus, si as AgentApprovalRequirement, ui as AgentToolInvocation } from "./types-DOngB_Rs.js";
|
|
3
3
|
|
|
4
4
|
//#region src/agent-run-outcome.d.ts
|
|
5
5
|
interface AgentRunOutcome {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { r as catalogEntry, t as ERROR_CATALOG } from "./error-catalog-
|
|
1
|
+
import { r as catalogEntry, t as ERROR_CATALOG } from "./error-catalog-DwxHMZQZ.js";
|
|
2
2
|
import { n as plannedRestartDeadline, t as parseSandboxRetryAfterHeader } from "./retry-after-header-DyAWSQ4m.js";
|
|
3
|
-
import {
|
|
3
|
+
import { n as childTraceparent, r as parseTraceparent, t as TRACEPARENT_HEADER } from "./lifecycle-trace-CDGgSOVP.js";
|
|
4
|
+
import { c as retryBudget, n as SANDBOX_API_RETRY_SCOPE, o as isUndelivered, r as abortableSleep, s as planResend } from "./retry-policy-BlkQJ7_e.js";
|
|
5
|
+
import { toW3CTraceId } from "@tangle-network/agent-trace-contract/otlp";
|
|
4
6
|
//#region src/lib/response-rewrap.mjs
|
|
5
7
|
/**
|
|
6
8
|
* Response wrappers that must outlive the fetch Response they wrap.
|
|
@@ -30,7 +32,7 @@ function rewrapResponse(original, headers, body = original.body) {
|
|
|
30
32
|
//#endregion
|
|
31
33
|
//#region src/lib/api-request.mjs
|
|
32
34
|
/** The package version tsdown.config.ts defines; unbuilt source reports 0.0.0. */
|
|
33
|
-
const SDK_VERSION = "1.0.
|
|
35
|
+
const SDK_VERSION = "1.0.510";
|
|
34
36
|
function withRequestContextHeaders(response, path, method, body = response.body) {
|
|
35
37
|
const headers = new Headers(response.headers);
|
|
36
38
|
headers.set("x-tangle-request-path", path);
|
|
@@ -88,7 +90,7 @@ async function retryDelayMs(response, attempt, window, safe) {
|
|
|
88
90
|
}
|
|
89
91
|
/** SDK/probe transport retries replayable idempotent/keyed calls, or any verb after a proven failed dial or a planned-restart refusal.
|
|
90
92
|
* x-no-retry forbids replay; the caller deadline bounds attempts, and headers finalize an answer. */
|
|
91
|
-
async function fetchSandboxApi({ baseUrl, apiKey, timeoutMs = SDK_TIMEOUTS.default, signal, fetchImpl = fetch, networkError = (error) => error, timeoutError = () => new DOMException("The operation was aborted due to timeout", "TimeoutError") }, path, options, fetchOptions) {
|
|
93
|
+
async function fetchSandboxApi({ baseUrl, apiKey, lifecycleTraceContext, timeoutMs = SDK_TIMEOUTS.default, signal, fetchImpl = fetch, networkError = (error) => error, timeoutError = () => new DOMException("The operation was aborted due to timeout", "TimeoutError") }, path, options, fetchOptions) {
|
|
92
94
|
const url = `${baseUrl.replace(/\/+$/, "")}${path}`;
|
|
93
95
|
const requestTimeoutMs = typeof fetchOptions?.timeoutMs === "number" && fetchOptions.timeoutMs > 0 ? fetchOptions.timeoutMs : timeoutMs;
|
|
94
96
|
const deadline = Date.now() + requestTimeoutMs;
|
|
@@ -114,6 +116,12 @@ async function fetchSandboxApi({ baseUrl, apiKey, timeoutMs = SDK_TIMEOUTS.defau
|
|
|
114
116
|
}
|
|
115
117
|
const isFormDataBody = typeof FormData !== "undefined" && options?.body instanceof FormData;
|
|
116
118
|
if (!headers.has("Content-Type") && !isFormDataBody) headers.set("Content-Type", "application/json");
|
|
119
|
+
const legacyId = headers.get("x-tangle-trace-id");
|
|
120
|
+
let parent;
|
|
121
|
+
if (lifecycleTraceContext && typeof globalThis.crypto?.getRandomValues === "function") {
|
|
122
|
+
const supplied = headers.get(TRACEPARENT_HEADER);
|
|
123
|
+
parent = parseTraceparent(supplied) ? supplied : childTraceparent(void 0, legacyId ? toW3CTraceId(legacyId) : void 0);
|
|
124
|
+
} else if (lifecycleTraceContext !== void 0) headers.delete(TRACEPARENT_HEADER);
|
|
117
125
|
const method = (options?.method ?? "GET").toUpperCase();
|
|
118
126
|
const repeatable = !headers.has("x-no-retry") && isReplayableBody(options?.body);
|
|
119
127
|
const safe = IDEMPOTENT_METHODS.has(method) || headers.has("Idempotency-Key");
|
|
@@ -122,6 +130,7 @@ async function fetchSandboxApi({ baseUrl, apiKey, timeoutMs = SDK_TIMEOUTS.defau
|
|
|
122
130
|
let response;
|
|
123
131
|
let lost;
|
|
124
132
|
for (let attempt = 1;; attempt++) {
|
|
133
|
+
if (parent) headers.set(TRACEPARENT_HEADER, childTraceparent(parent));
|
|
125
134
|
retryBudget(SANDBOX_API_RETRY_SCOPE).sent();
|
|
126
135
|
try {
|
|
127
136
|
response = await fetchImpl(url, {
|
package/dist/auth/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema } from "../cli-auth-bundle-CXI4ysvr-
|
|
2
|
-
import "../cli-auth-bundle-
|
|
1
|
+
import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema } from "../cli-auth-bundle-CXI4ysvr-CGgx1JDO.js";
|
|
2
|
+
import "../cli-auth-bundle-ECDHagkC.js";
|
|
3
3
|
//#region src/auth/tokens.ts
|
|
4
4
|
const textEncoder = new TextEncoder();
|
|
5
5
|
const textDecoder = new TextDecoder();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as TerminalStreamHandlers } from "./terminal-stream-types-
|
|
1
|
+
import { i as TerminalStreamHandlers } from "./terminal-stream-types-BMLdhwUQ.js";
|
|
2
2
|
import { a as AgentInteractiveSessionControlClaim, d as AgentInteractiveSessionStatus, i as AgentInteractiveSessionAttach, o as AgentInteractiveSessionControlClaimAcknowledgement, s as AgentInteractiveSessionControlClaimRequest, u as AgentInteractiveSessionRef } from "./index-V_pXOH3B.js";
|
|
3
3
|
|
|
4
4
|
//#region src/interactive-types.d.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { C as boundedEventContentRecordSchema, D as boundedJsonSchema, E as boundedJsonRecordSchema, O as boundedStringSchema, S as boundedEventContentJsonSchema, T as boundedIdentifierSchema, k as isBoundedEventContentJson, s as canonicalCandidateDigest, v as sha256DigestSchema, w as boundedEventContentStringSchema, x as CONTRACT_MAX_STRING_LENGTH, y as CONTRACT_MAX_ARRAY_LENGTH } from "./harness-QlDF8rzb.js";
|
|
2
2
|
import { t as agentExecutionPreparationReceiptSchema } from "./agent-execution-preparation-receipt-Cc9RZhlS.js";
|
|
3
3
|
import { t as awaitWithAbort } from "./abort-signal-BsriwJ8L.js";
|
|
4
|
-
import { i as fetchSandboxApi } from "./api-request-
|
|
4
|
+
import { i as fetchSandboxApi } from "./api-request-Da3Gy5v5.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.28/node_modules/@tangle-network/agent-interface/dist/native-session-event.js
|
|
7
7
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as SandboxError, n as isTransientWrite, r as parseErrorResponse } from "./errors-
|
|
2
|
-
import { c as retryBudget, i as awaitResend, n as SANDBOX_API_RETRY_SCOPE, r as abortableSleep } from "./retry-policy-
|
|
3
|
-
import { i as FILE_UPLOAD_SESSION_MAX_BYTES, n as isFileTooLargeErrorBody, r as isPayloadTooLargeErrorBody } from "./file-transfer-
|
|
1
|
+
import { C as SandboxError, n as isTransientWrite, r as parseErrorResponse } from "./errors-BuEDuIrs.js";
|
|
2
|
+
import { c as retryBudget, i as awaitResend, n as SANDBOX_API_RETRY_SCOPE, r as abortableSleep } from "./retry-policy-BlkQJ7_e.js";
|
|
3
|
+
import { i as FILE_UPLOAD_SESSION_MAX_BYTES, n as isFileTooLargeErrorBody, r as isPayloadTooLargeErrorBody } from "./file-transfer-CnCWFYua.js";
|
|
4
4
|
//#region src/lib/sdk-retry.ts
|
|
5
5
|
const takeSdkTurn = (maxWaitMs) => retryBudget(SANDBOX_API_RETRY_SCOPE).take(maxWaitMs);
|
|
6
6
|
const awaitSdkResend = (resend, o) => awaitResend(SANDBOX_API_RETRY_SCOPE, resend, o);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as FILE_UPLOAD_SESSION_MAX_BYTES } from "./file-transfer-
|
|
2
|
-
import { a as partWire, i as partCount, n as commitSession, o as planCompression, r as initUploadSession, s as putPart, t as abortSession } from "./chunked-upload-
|
|
1
|
+
import { i as FILE_UPLOAD_SESSION_MAX_BYTES } from "./file-transfer-CnCWFYua.js";
|
|
2
|
+
import { a as partWire, i as partCount, n as commitSession, o as planCompression, r as initUploadSession, s as putPart, t as abortSession } from "./chunked-upload-ClIgZBWm.js";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { open } from "node:fs/promises";
|
|
5
5
|
//#region src/lib/chunked-upload-file.ts
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { C as normalizeRuntimeBackendConfig, D as withoutCreateOnlyModelFields, E as withProfileHarness, I as backendTypeSchema, _ as encodePromptForWire, b as applyRequestedModel, o as requestInteractiveSessionToken, x as assertCurrentBackendType } from "./interactive-controller-
|
|
1
|
+
import { C as normalizeRuntimeBackendConfig, D as withoutCreateOnlyModelFields, E as withProfileHarness, I as backendTypeSchema, _ as encodePromptForWire, b as applyRequestedModel, o as requestInteractiveSessionToken, x as assertCurrentBackendType } from "./interactive-controller-D1FTM_Uc.js";
|
|
2
2
|
import { r as agentProfileSchema } from "./profile-schema-BHeC7cOf.js";
|
|
3
|
-
import { $ as isCapacityShortageCreateError, B as parseLifecycleTimes, E as validateDeferredProfileFileMounts, F as normalizeCaptureProof, G as normalizeSandboxShape, H as normalizeConnection, I as normalizeSandboxCreateReceipt, J as DEPLOY_WINDOW_RETRY_MS, K as CAPACITY_ETA_MARGIN_MS, L as normalizeStartupDiagnostics, P as DirectRuntimeHttpClient, Q as generateIdempotencyKey, T as splitInlineProfileSkills, U as normalizeEgressPolicyFields, V as state, W as normalizeProxySecretReceipt, X as createRetryDelayMs, Y as awaitCreateResend, Z as extendableDeadline, d as sandboxLedgerUsd, et as isDeployWindowCreateError, n as createSandboxInstanceFromResponse, nt as isRetryableCreateError, o as exportTraceBundle, q as CAPACITY_ETA_WAIT_MAX_MS, rt as runtimeWorkspaceCwdSchema, tt as isRateLimitCreateError, w as splitInlineProfileFileMounts, x as deleteSandbox, z as dateOf } from "./sandbox-
|
|
4
|
-
import { C as SandboxError, D as TimeoutError, O as ValidationError, _ as NetworkError, a as readResponseJson, c as AuthError, i as parseResponseError, k as SANDBOX_CREATE_DEADLINE_HEADER, r as parseErrorResponse, v as NotFoundError, w as ServerError, y as PartialFailureError } from "./errors-
|
|
3
|
+
import { $ as isCapacityShortageCreateError, B as parseLifecycleTimes, E as validateDeferredProfileFileMounts, F as normalizeCaptureProof, G as normalizeSandboxShape, H as normalizeConnection, I as normalizeSandboxCreateReceipt, J as DEPLOY_WINDOW_RETRY_MS, K as CAPACITY_ETA_MARGIN_MS, L as normalizeStartupDiagnostics, P as DirectRuntimeHttpClient, Q as generateIdempotencyKey, T as splitInlineProfileSkills, U as normalizeEgressPolicyFields, V as state, W as normalizeProxySecretReceipt, X as createRetryDelayMs, Y as awaitCreateResend, Z as extendableDeadline, d as sandboxLedgerUsd, et as isDeployWindowCreateError, n as createSandboxInstanceFromResponse, nt as isRetryableCreateError, o as exportTraceBundle, q as CAPACITY_ETA_WAIT_MAX_MS, rt as runtimeWorkspaceCwdSchema, tt as isRateLimitCreateError, w as splitInlineProfileFileMounts, x as deleteSandbox, z as dateOf } from "./sandbox-CmeidNvi.js";
|
|
4
|
+
import { C as SandboxError, D as TimeoutError, O as ValidationError, _ as NetworkError, a as readResponseJson, c as AuthError, i as parseResponseError, k as SANDBOX_CREATE_DEADLINE_HEADER, r as parseErrorResponse, v as NotFoundError, w as ServerError, y as PartialFailureError } from "./errors-BuEDuIrs.js";
|
|
5
5
|
import { n as combineAbortSignals } from "./abort-signal-BsriwJ8L.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
6
|
+
import { t as TRACEPARENT_HEADER } from "./lifecycle-trace-CDGgSOVP.js";
|
|
7
|
+
import { r as abortableSleep, t as RETRY_POLICY } from "./retry-policy-BlkQJ7_e.js";
|
|
8
|
+
import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-Da3Gy5v5.js";
|
|
9
|
+
import { l as SANDBOX_AGENT_HOME } from "./file-transfer-CnCWFYua.js";
|
|
10
|
+
import { a as resolveTraceId, l as isBrowserRuntime, r as lifecycleTraceHeaders } from "./trace-id-DX218plN.js";
|
|
11
|
+
import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch-xLyOpHAc.js";
|
|
12
|
+
import { t as parseSSEStream } from "./sse-parser-DTgSRcZC.js";
|
|
13
|
+
import { t as LinesClient } from "./lines-D3DKzzQT.js";
|
|
13
14
|
import { PublicTemplatesClient } from "./public-templates.js";
|
|
14
15
|
import { z } from "zod";
|
|
15
16
|
//#region ../../../packages/runtime-contracts/dist/git-policy.js
|
|
@@ -1203,11 +1204,11 @@ function isLocalSandboxEndpoint(baseUrl) {
|
|
|
1203
1204
|
}
|
|
1204
1205
|
}
|
|
1205
1206
|
async function resolveLocalCliAuthFiles(backendType) {
|
|
1206
|
-
const { discoverLocalCliAuthFiles } = await import("./local-cli-auth-
|
|
1207
|
+
const { discoverLocalCliAuthFiles } = await import("./local-cli-auth-BVXWKaty.js");
|
|
1207
1208
|
return discoverLocalCliAuthFiles(backendType);
|
|
1208
1209
|
}
|
|
1209
1210
|
async function loadLocalCliAuthExpectation(backendType) {
|
|
1210
|
-
const { describeLocalCliAuthExpectation: describe } = await import("./local-cli-auth-
|
|
1211
|
+
const { describeLocalCliAuthExpectation: describe } = await import("./local-cli-auth-BVXWKaty.js");
|
|
1211
1212
|
return describe(backendType);
|
|
1212
1213
|
}
|
|
1213
1214
|
/**
|
|
@@ -1258,6 +1259,7 @@ var SandboxTransport = class {
|
|
|
1258
1259
|
onDirectRuntimeResponse;
|
|
1259
1260
|
/** See `SandboxConfig.directExec`. */
|
|
1260
1261
|
directExec;
|
|
1262
|
+
lifecycleTraceContext;
|
|
1261
1263
|
signal;
|
|
1262
1264
|
constructor(config) {
|
|
1263
1265
|
if (!config.apiKey) throw new AuthError("API key is required");
|
|
@@ -1270,6 +1272,7 @@ var SandboxTransport = class {
|
|
|
1270
1272
|
this.trustLocalCliAuth = config.trustLocalCliAuth === true;
|
|
1271
1273
|
this.onTiming = config.onTiming;
|
|
1272
1274
|
this.onDirectRuntimeResponse = config.onDirectRuntimeResponse;
|
|
1275
|
+
this.lifecycleTraceContext = config.lifecycleTraceContext ?? true;
|
|
1273
1276
|
this.directExec = config.directExec ?? !isBrowserRuntime();
|
|
1274
1277
|
this.signal = config.signal;
|
|
1275
1278
|
}
|
|
@@ -1299,6 +1302,7 @@ var SandboxTransport = class {
|
|
|
1299
1302
|
async fetch(path, options, fetchOptions) {
|
|
1300
1303
|
return fetchSandboxApi({
|
|
1301
1304
|
baseUrl: this.baseUrl,
|
|
1305
|
+
lifecycleTraceContext: this.lifecycleTraceContext,
|
|
1302
1306
|
apiKey: this.#apiKey,
|
|
1303
1307
|
timeoutMs: this.timeoutMs,
|
|
1304
1308
|
signal: this.signal,
|
|
@@ -1724,6 +1728,34 @@ function verbatimCreateFields(options) {
|
|
|
1724
1728
|
egressPolicy: options?.egressPolicy
|
|
1725
1729
|
};
|
|
1726
1730
|
}
|
|
1731
|
+
/** Keep the create operation attached until the returned allocation is ready. */
|
|
1732
|
+
async function waitForCreatedSandbox(instance, info, idempotencyKey, deadline, traceparent, signal) {
|
|
1733
|
+
const remainingMs = Math.max(0, deadline - Date.now());
|
|
1734
|
+
state(instance).createWaitTraceparent = traceparent;
|
|
1735
|
+
try {
|
|
1736
|
+
await instance.waitFor("running", {
|
|
1737
|
+
timeoutMs: remainingMs,
|
|
1738
|
+
signal
|
|
1739
|
+
});
|
|
1740
|
+
} catch (cause) {
|
|
1741
|
+
throw new PartialFailureError(`Sandbox ${info.id} did not become ready: ${cause instanceof Error ? cause.message : String(cause)}`, {
|
|
1742
|
+
code: "SANDBOX_CREATE_READINESS_FAILED",
|
|
1743
|
+
status: 502,
|
|
1744
|
+
origin: "sandbox-api",
|
|
1745
|
+
endpoint: "/v1/sandboxes",
|
|
1746
|
+
failures: [{
|
|
1747
|
+
sandboxId: info.id,
|
|
1748
|
+
idempotencyKey
|
|
1749
|
+
}],
|
|
1750
|
+
cause,
|
|
1751
|
+
allocationId: info.id,
|
|
1752
|
+
idempotencyKey,
|
|
1753
|
+
createReceipt: info.createReceipt ?? null
|
|
1754
|
+
});
|
|
1755
|
+
} finally {
|
|
1756
|
+
delete state(instance).createWaitTraceparent;
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1727
1759
|
var SandboxCreation = class extends SandboxManagement {
|
|
1728
1760
|
/** Fresh execution with no ambient owner context. Old hosts reject this
|
|
1729
1761
|
* explicit field before provisioning; no best-effort security downgrade. */
|
|
@@ -1749,6 +1781,7 @@ var SandboxCreation = class extends SandboxManagement {
|
|
|
1749
1781
|
const timeoutMs = requestOptions?.timeoutMs ?? (options?.gpuLease ? SDK_TIMEOUTS.gpuCreate : SDK_TIMEOUTS.create);
|
|
1750
1782
|
const idempotencyKey = options?.idempotencyKey ?? generateIdempotencyKey();
|
|
1751
1783
|
const traceId = requestOptions?.traceId === void 0 && !globalThis.crypto ? void 0 : resolveTraceId(requestOptions?.traceId);
|
|
1784
|
+
const context = lifecycleTraceHeaders(this, traceId);
|
|
1752
1785
|
const startedAt = Date.now();
|
|
1753
1786
|
let deadline = startedAt + timeoutMs;
|
|
1754
1787
|
let deployWindowDeadline = Math.min(deadline, startedAt + DEPLOY_WINDOW_RETRY_MS);
|
|
@@ -1885,6 +1918,7 @@ var SandboxCreation = class extends SandboxManagement {
|
|
|
1885
1918
|
method: "POST",
|
|
1886
1919
|
headers: {
|
|
1887
1920
|
"Idempotency-Key": idempotencyKey,
|
|
1921
|
+
...context,
|
|
1888
1922
|
...traceId && { ["x-tangle-trace-id"]: traceId },
|
|
1889
1923
|
"x-no-retry": "1",
|
|
1890
1924
|
[SANDBOX_CREATE_DEADLINE_HEADER]: String(deadline)
|
|
@@ -1955,30 +1989,7 @@ var SandboxCreation = class extends SandboxManagement {
|
|
|
1955
1989
|
const instance = createSandboxInstanceFromResponse(this, info, withoutCreateOnlyModelFields(handleBackend), data);
|
|
1956
1990
|
const runtimeClient = state(instance).client;
|
|
1957
1991
|
if (runtimeClient instanceof DirectRuntimeHttpClient) runtimeClient.preconnect();
|
|
1958
|
-
if (instance.status === "provisioning" || instance.status === "pending")
|
|
1959
|
-
const remainingMs = Math.max(0, deadline - Date.now());
|
|
1960
|
-
try {
|
|
1961
|
-
await instance.waitFor("running", {
|
|
1962
|
-
timeoutMs: remainingMs,
|
|
1963
|
-
signal: requestOptions?.signal
|
|
1964
|
-
});
|
|
1965
|
-
} catch (cause) {
|
|
1966
|
-
throw new PartialFailureError(`Sandbox ${info.id} did not become ready: ${cause instanceof Error ? cause.message : String(cause)}`, {
|
|
1967
|
-
code: "SANDBOX_CREATE_READINESS_FAILED",
|
|
1968
|
-
status: 502,
|
|
1969
|
-
origin: "sandbox-api",
|
|
1970
|
-
endpoint: "/v1/sandboxes",
|
|
1971
|
-
failures: [{
|
|
1972
|
-
sandboxId: info.id,
|
|
1973
|
-
idempotencyKey
|
|
1974
|
-
}],
|
|
1975
|
-
cause,
|
|
1976
|
-
allocationId: info.id,
|
|
1977
|
-
idempotencyKey,
|
|
1978
|
-
createReceipt: info.createReceipt ?? null
|
|
1979
|
-
});
|
|
1980
|
-
}
|
|
1981
|
-
}
|
|
1992
|
+
if (instance.status === "provisioning" || instance.status === "pending") await waitForCreatedSandbox(instance, info, idempotencyKey, deadline, context[TRACEPARENT_HEADER], requestOptions?.signal);
|
|
1982
1993
|
if (pendingProfile) instance.deferProfileDelivery(pendingProfile, deferredProfileForPriming);
|
|
1983
1994
|
return instance;
|
|
1984
1995
|
}
|
|
@@ -4437,6 +4448,7 @@ var Sandbox = class Sandbox extends SandboxBatch {
|
|
|
4437
4448
|
timeoutMs: this.timeoutMs,
|
|
4438
4449
|
...this.signal ? { signal: this.signal } : {},
|
|
4439
4450
|
directExec: this.directExec,
|
|
4451
|
+
lifecycleTraceContext: this.lifecycleTraceContext,
|
|
4440
4452
|
trustLocalCliAuth: this.trustLocalCliAuth,
|
|
4441
4453
|
onTiming: this.onTiming
|
|
4442
4454
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as TraceExportResult, G as MaterializeProfileFileMountsResult, K as ProfileFileMountBox, O as SandboxInstance, W as MaterializeProfileFileMountsOptions, j as TraceExportSink, xt as SandboxOperation } from "./index-
|
|
2
|
-
import { R as SandboxError, X as BatchCustody, Z as BatchResult, c as MintInteractiveSessionTokenOptions, it as BatchEvent, nt as PublicBatchRunRequestInput, tt as PublicBatchRunRequest, u as ScopedToken } from "./terminal-stream-types-
|
|
1
|
+
import { A as TraceExportResult, G as MaterializeProfileFileMountsResult, K as ProfileFileMountBox, O as SandboxInstance, W as MaterializeProfileFileMountsOptions, j as TraceExportSink, xt as SandboxOperation } from "./index-CtrSdLo2.js";
|
|
2
|
+
import { R as SandboxError, X as BatchCustody, Z as BatchResult, c as MintInteractiveSessionTokenOptions, it as BatchEvent, nt as PublicBatchRunRequestInput, tt as PublicBatchRunRequest, u as ScopedToken } from "./terminal-stream-types-BMLdhwUQ.js";
|
|
3
3
|
import { A as AgentProfileMcpServer, D as AgentProfileConfidential, M as AgentProfileSeat, O as AgentProfileConfigValue, T as AgentProfile, j as AgentProfileMetadata, k as AgentProfileFileMount, n as SandboxSizePreset, u as AgentInteractiveSessionRef, x as AgentRuntimeAttachments } from "./index-V_pXOH3B.js";
|
|
4
|
-
import { $ as SandboxFleetAgent, A as CreateSandboxFleetOptions, At as SandboxFleetWorkspaceReconcileResult, B as FleetDispatchStreamOptions, Br as SandboxDeleteOptions, Bt as SandboxRunGeneration, Ci as PromptInputPart, Cn as DownloadOptions, Cr as SdkTimingHook, Ct as SandboxFleetToken, D as FleetDriveTurnRequest, Dt as SandboxFleetTraceOptions, E as FleetDriveTurnOutcome, Ei as SandboxEvent, F as FleetAgentResult, Fr as DeleteMatchingSandboxesFilter, G as FleetPromptDispatchResult, H as FleetExecDispatchResult, Ir as DeleteMatchingSandboxesOptions, J as ListSandboxFleetOptions, K as FleetRunEvent, L as FleetDispatchCancelResult, Lr as DeleteMatchingSandboxesResult, Lt as SandboxInfo, M as CreateSandboxFleetWithCoordinatorOptions, Mr as AccountSnapshotInfo, Mt as SandboxFleetWorkspaceSnapshotResult, N as FleetAgentId, Nt as ListSandboxOptions, O as TokenRefreshHandler, Ot as SandboxFleetUsage, Pa as GpuLeaseProviderName, Pi as TurnBackendConfig, Q as ReconcileSandboxFleetsResult, Qn as PublishPublicTemplateOptions, Qt as TeeAttestationResponse, R as FleetDispatchResultBuffer, Ri as ConversationTurnOptions, Si as IntelligenceReportWindow, Sr as HttpClient, St as SandboxFleetSpend, Ti as PromptResult, Tn as DownloadResult, U as FleetMachineId, V as FleetExecDispatchOptions, W as FleetPromptDispatchOptions, X as ReapExpiredSandboxFleetsResult, Y as ReapExpiredSandboxFleetsOptions, Yn as ExecOptions, Z as ReconcileSandboxFleetsOptions, Zt as TeeAttestationReport, _r as ManagedProcessOptions, _t as SandboxFleetOperationsSummary, an as SandboxResources, bi as IntelligenceReportCompareTo, br as ManagedProcessRecord, bt as SandboxFleetPolicy, c as SubscriptionInfo, di as CreateIntelligenceReportOptions, dt as SandboxFleetMachine, er as SandboxEnvironment, ga as BackendConfig, gr as ManagedProcessJobs, ht as SandboxFleetManifest, in as SandboxConfig, it as SandboxFleetCostEstimate, j as CreateSandboxFleetTokenOptions, jt as SandboxFleetWorkspaceRestoreResult, k as AttachSandboxFleetMachineOptions, l as UsageInfo, ln as SandboxShapePreset, lt as SandboxFleetInfo, mt as SandboxFleetMachineSpec, n as SshKeysManager, nn as CreateRequestOptions, nt as SandboxFleetArtifactSpec, oi as BatchRunOptions, on as SandboxShapesInfo, ot as SandboxFleetDispatchResponse, pt as SandboxFleetMachineRecord, q as FleetRunOptions, qa as ExecResult, rn as CreateSandboxOptions, rt as SandboxFleetCancelResult, s as SandboxIdentity, st as SandboxFleetDriverCapability, t as SecretsManager, tt as SandboxFleetArtifact, vi as IntelligenceReport, vr as ManagedProcessResumeOptions, vt as SandboxFleetParent, wa as SecretBindingOptions, wi as PromptOptions, wt as SandboxFleetTraceBundle, xr as ManagedProcessSpec, yi as IntelligenceReportBudget, z as FleetDispatchResultBufferOptions, zi as ConversationTurnResult, zr as SandboxDeleteAcknowledgement } from "./types-
|
|
5
|
-
import { t as LinesClient } from "./lines-
|
|
6
|
-
import { a as PublicTemplatesClient } from "./public-templates-
|
|
4
|
+
import { $ as SandboxFleetAgent, A as CreateSandboxFleetOptions, At as SandboxFleetWorkspaceReconcileResult, B as FleetDispatchStreamOptions, Br as SandboxDeleteOptions, Bt as SandboxRunGeneration, Ci as PromptInputPart, Cn as DownloadOptions, Cr as SdkTimingHook, Ct as SandboxFleetToken, D as FleetDriveTurnRequest, Dt as SandboxFleetTraceOptions, E as FleetDriveTurnOutcome, Ei as SandboxEvent, F as FleetAgentResult, Fr as DeleteMatchingSandboxesFilter, G as FleetPromptDispatchResult, H as FleetExecDispatchResult, Ir as DeleteMatchingSandboxesOptions, J as ListSandboxFleetOptions, K as FleetRunEvent, L as FleetDispatchCancelResult, Lr as DeleteMatchingSandboxesResult, Lt as SandboxInfo, M as CreateSandboxFleetWithCoordinatorOptions, Mr as AccountSnapshotInfo, Mt as SandboxFleetWorkspaceSnapshotResult, N as FleetAgentId, Nt as ListSandboxOptions, O as TokenRefreshHandler, Ot as SandboxFleetUsage, Pa as GpuLeaseProviderName, Pi as TurnBackendConfig, Q as ReconcileSandboxFleetsResult, Qn as PublishPublicTemplateOptions, Qt as TeeAttestationResponse, R as FleetDispatchResultBuffer, Ri as ConversationTurnOptions, Si as IntelligenceReportWindow, Sr as HttpClient, St as SandboxFleetSpend, Ti as PromptResult, Tn as DownloadResult, U as FleetMachineId, V as FleetExecDispatchOptions, W as FleetPromptDispatchOptions, X as ReapExpiredSandboxFleetsResult, Y as ReapExpiredSandboxFleetsOptions, Yn as ExecOptions, Z as ReconcileSandboxFleetsOptions, Zt as TeeAttestationReport, _r as ManagedProcessOptions, _t as SandboxFleetOperationsSummary, an as SandboxResources, bi as IntelligenceReportCompareTo, br as ManagedProcessRecord, bt as SandboxFleetPolicy, c as SubscriptionInfo, di as CreateIntelligenceReportOptions, dt as SandboxFleetMachine, er as SandboxEnvironment, ga as BackendConfig, gr as ManagedProcessJobs, ht as SandboxFleetManifest, in as SandboxConfig, it as SandboxFleetCostEstimate, j as CreateSandboxFleetTokenOptions, jt as SandboxFleetWorkspaceRestoreResult, k as AttachSandboxFleetMachineOptions, l as UsageInfo, ln as SandboxShapePreset, lt as SandboxFleetInfo, mt as SandboxFleetMachineSpec, n as SshKeysManager, nn as CreateRequestOptions, nt as SandboxFleetArtifactSpec, oi as BatchRunOptions, on as SandboxShapesInfo, ot as SandboxFleetDispatchResponse, pt as SandboxFleetMachineRecord, q as FleetRunOptions, qa as ExecResult, rn as CreateSandboxOptions, rt as SandboxFleetCancelResult, s as SandboxIdentity, st as SandboxFleetDriverCapability, t as SecretsManager, tt as SandboxFleetArtifact, vi as IntelligenceReport, vr as ManagedProcessResumeOptions, vt as SandboxFleetParent, wa as SecretBindingOptions, wi as PromptOptions, wt as SandboxFleetTraceBundle, xr as ManagedProcessSpec, yi as IntelligenceReportBudget, z as FleetDispatchResultBufferOptions, zi as ConversationTurnResult, zr as SandboxDeleteAcknowledgement } from "./types-DOngB_Rs.js";
|
|
5
|
+
import { t as LinesClient } from "./lines-Ce4UmKfm.js";
|
|
6
|
+
import { a as PublicTemplatesClient } from "./public-templates-GebzRZgV.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
|
|
9
9
|
//#region src/backend-registry.d.ts
|
|
@@ -106,6 +106,7 @@ declare class SandboxTransport {
|
|
|
106
106
|
readonly onDirectRuntimeResponse: SandboxConfig["onDirectRuntimeResponse"];
|
|
107
107
|
/** See `SandboxConfig.directExec`. */
|
|
108
108
|
readonly directExec: boolean;
|
|
109
|
+
readonly lifecycleTraceContext: boolean;
|
|
109
110
|
readonly signal: AbortSignal | undefined;
|
|
110
111
|
constructor(config: SandboxConfig);
|
|
111
112
|
getApiKey(): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "../collaboration-
|
|
1
|
+
import { a as CollaborationClient, i as parseCollaborationDocumentId, n as buildCollaborationDocumentId, r as normalizeCollaborationPath, t as CollaborationFileBridge } from "../collaboration-BD6TvBWe.js";
|
|
2
2
|
export { CollaborationClient, CollaborationFileBridge, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as TimeoutError, _ as NetworkError, r as parseErrorResponse } from "./errors-
|
|
2
|
-
import { i as fetchSandboxApi } from "./api-request-
|
|
1
|
+
import { D as TimeoutError, _ as NetworkError, r as parseErrorResponse } from "./errors-BuEDuIrs.js";
|
|
2
|
+
import { i as fetchSandboxApi } from "./api-request-Da3Gy5v5.js";
|
|
3
3
|
//#region src/collaboration/client.ts
|
|
4
4
|
function normalizeBaseUrl(url) {
|
|
5
5
|
return url.replace(/\/+$/, "");
|
package/dist/core.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as WorkspaceImages, H as WorkspaceImagePublishResult, O as SandboxInstance, U as ProfileFileDeliveryReport, V as WorkspaceImagePublishInput, z as WorkspaceImagePublishRequestOptions } from "./index-
|
|
2
|
-
import { F as ProfileFileMountPathError, H as ServerError, I as QuotaError, K as TimeoutError, M as NetworkError, N as NotFoundError, O as FileWriteConflictError, P as PartialFailureError, R as SandboxError, S as AuthError, U as StateError, V as SandboxFailureDetail, b as parseErrorResponse, q as ValidationError, w as CapabilityError, x as responseMetadata, z as SandboxErrorJson } from "./terminal-stream-types-
|
|
3
|
-
import { Ci as PromptInputPart, Lt as SandboxInfo, Ri as ConversationTurnOptions, Xa as SandboxEnvRecoveryView, Ya as SandboxEnvRecovery, Yn as ExecOptions, _r as ManagedProcessOptions, b as PreviewLinkManager, br as ManagedProcessRecord, fn as NetworkConfig, gr as ManagedProcessJobs, in as SandboxConfig, oa as SessionMessageAdmission, qa as ExecResult, rn as CreateSandboxOptions, sn as SandboxStatus, vr as ManagedProcessResumeOptions, x as PreviewLinkWaitOptions, xr as ManagedProcessSpec, y as PreviewLinkInfo, yr as ManagedProcessState, zi as ConversationTurnResult } from "./types-
|
|
4
|
-
import { D as LineReplyCode, E as LineReminderPreferences, F as LineSenderVerification, G as LineApplicationRequest, H as LINE_APPLICATION_REPLY_MAX_CHARS, I as LineSenderVerificationStart, J as LineApplicationView, K as LineApplicationResult, N as LineSendInput, O as LineReplyCodeInput, P as LineSendReceipt, T as LineProvider, U as LINE_APPLICATION_REQUEST_MAX_BYTES, W as LineApplication, X as parseLineApplicationResult, Y as parseLineApplicationRequest, _ as LineInstanceCreate, a as Line, b as LineMemberInstance, d as LineAttachment, f as LineAttachmentReauthorization, g as LineInstanceAttachOptions, h as LineImage, i as profileChannelReference, l as LineApplicationAttachOptions, o as LineAgentRolePolicy, p as LineExecutionKey, q as LineApplicationState, r as lineInstanceKey, t as LinesClient, w as LineNumberInventory, y as LineMember } from "./lines-
|
|
5
|
-
import { At as InstancesClient, Ct as ManagedProcessClient, Dt as InstanceRecord, Et as InstanceProfile, Mt as sandboxFailureKind, Ot as InstanceRestartingError, St as gatewaySeatTransport, Tt as HostedInstance, _t as SeatOwnerTransport, an as BackendRegistryCapabilities, bt as SeatSelectionRequest, cn as BackendRegistryResponse, dn as backendRegistryInteractionKindSchema, dt as GatewaySeatTransportOptions, fn as backendRegistryResponseSchema, gt as SeatOwnerReply, hn as parseBackendRegistryResponseBody, ht as SandboxSeatSelectionInput, jt as SandboxFailureKind, ln as backendRegistryCapabilitiesSchema, lt as ISOLATED_CREATION_ATTESTATION_VERSION, mn as parseBackendRegistryResponse, mt as SandboxSeatCredentials, on as BackendRegistryEntry, pn as isBackendRegistryInteractionKind, pt as SandboxResolvedSeat, sn as BackendRegistryInteractionKind, t as Sandbox, un as backendRegistryEntrySchema, ut as CreateSelectSeatOptions, vt as SeatResolutionObservation, wt as EnsureInstanceOptions, xt as createSelectSeat, yt as SeatSelectionError } from "./client-
|
|
6
|
-
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-
|
|
1
|
+
import { B as WorkspaceImages, H as WorkspaceImagePublishResult, O as SandboxInstance, U as ProfileFileDeliveryReport, V as WorkspaceImagePublishInput, z as WorkspaceImagePublishRequestOptions } from "./index-CtrSdLo2.js";
|
|
2
|
+
import { F as ProfileFileMountPathError, H as ServerError, I as QuotaError, K as TimeoutError, M as NetworkError, N as NotFoundError, O as FileWriteConflictError, P as PartialFailureError, R as SandboxError, S as AuthError, U as StateError, V as SandboxFailureDetail, b as parseErrorResponse, q as ValidationError, w as CapabilityError, x as responseMetadata, z as SandboxErrorJson } from "./terminal-stream-types-BMLdhwUQ.js";
|
|
3
|
+
import { Ci as PromptInputPart, Lt as SandboxInfo, Ri as ConversationTurnOptions, Xa as SandboxEnvRecoveryView, Ya as SandboxEnvRecovery, Yn as ExecOptions, _r as ManagedProcessOptions, b as PreviewLinkManager, br as ManagedProcessRecord, fn as NetworkConfig, gr as ManagedProcessJobs, in as SandboxConfig, oa as SessionMessageAdmission, qa as ExecResult, rn as CreateSandboxOptions, sn as SandboxStatus, vr as ManagedProcessResumeOptions, x as PreviewLinkWaitOptions, xr as ManagedProcessSpec, y as PreviewLinkInfo, yr as ManagedProcessState, zi as ConversationTurnResult } from "./types-DOngB_Rs.js";
|
|
4
|
+
import { D as LineReplyCode, E as LineReminderPreferences, F as LineSenderVerification, G as LineApplicationRequest, H as LINE_APPLICATION_REPLY_MAX_CHARS, I as LineSenderVerificationStart, J as LineApplicationView, K as LineApplicationResult, N as LineSendInput, O as LineReplyCodeInput, P as LineSendReceipt, T as LineProvider, U as LINE_APPLICATION_REQUEST_MAX_BYTES, W as LineApplication, X as parseLineApplicationResult, Y as parseLineApplicationRequest, _ as LineInstanceCreate, a as Line, b as LineMemberInstance, d as LineAttachment, f as LineAttachmentReauthorization, g as LineInstanceAttachOptions, h as LineImage, i as profileChannelReference, l as LineApplicationAttachOptions, o as LineAgentRolePolicy, p as LineExecutionKey, q as LineApplicationState, r as lineInstanceKey, t as LinesClient, w as LineNumberInventory, y as LineMember } from "./lines-Ce4UmKfm.js";
|
|
5
|
+
import { At as InstancesClient, Ct as ManagedProcessClient, Dt as InstanceRecord, Et as InstanceProfile, Mt as sandboxFailureKind, Ot as InstanceRestartingError, St as gatewaySeatTransport, Tt as HostedInstance, _t as SeatOwnerTransport, an as BackendRegistryCapabilities, bt as SeatSelectionRequest, cn as BackendRegistryResponse, dn as backendRegistryInteractionKindSchema, dt as GatewaySeatTransportOptions, fn as backendRegistryResponseSchema, gt as SeatOwnerReply, hn as parseBackendRegistryResponseBody, ht as SandboxSeatSelectionInput, jt as SandboxFailureKind, ln as backendRegistryCapabilitiesSchema, lt as ISOLATED_CREATION_ATTESTATION_VERSION, mn as parseBackendRegistryResponse, mt as SandboxSeatCredentials, on as BackendRegistryEntry, pn as isBackendRegistryInteractionKind, pt as SandboxResolvedSeat, sn as BackendRegistryInteractionKind, t as Sandbox, un as backendRegistryEntrySchema, ut as CreateSelectSeatOptions, vt as SeatResolutionObservation, wt as EnsureInstanceOptions, xt as createSelectSeat, yt as SeatSelectionError } from "./client-DFaxpuf9.js";
|
|
6
|
+
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-GebzRZgV.js";
|
|
7
7
|
export { AuthError, BackendRegistryCapabilities, BackendRegistryEntry, BackendRegistryInteractionKind, BackendRegistryResponse, CapabilityError, ConversationTurnOptions, ConversationTurnResult, CreateSandboxOptions, CreateSelectSeatOptions, EnsureInstanceOptions, ExecOptions, ExecResult, FileWriteConflictError, GatewaySeatTransportOptions, HostedInstance, ISOLATED_CREATION_ATTESTATION_VERSION, InstanceProfile, InstanceRecord, InstanceRestartingError, InstancesClient, LINE_APPLICATION_REPLY_MAX_CHARS, LINE_APPLICATION_REQUEST_MAX_BYTES, Line, LineAgentRolePolicy, LineApplication, LineApplicationAttachOptions, LineApplicationRequest, LineApplicationResult, LineApplicationState, LineApplicationView, LineAttachment, LineAttachmentReauthorization, LineExecutionKey, LineImage, LineInstanceAttachOptions, LineInstanceCreate, LineMember, LineMemberInstance, LineNumberInventory, LineProvider, LineReminderPreferences, LineReplyCode, LineReplyCodeInput, LineSendInput, LineSendReceipt, LineSenderVerification, LineSenderVerificationStart, LinesClient, ManagedProcessClient, ManagedProcessJobs, ManagedProcessOptions, ManagedProcessRecord, ManagedProcessResumeOptions, ManagedProcessSpec, ManagedProcessState, NetworkConfig, NetworkError, NotFoundError, PartialFailureError, PreviewLinkInfo, PreviewLinkManager, PreviewLinkWaitOptions, ProfileFileDeliveryReport, ProfileFileMountPathError, PromptInputPart, PublicTemplatePublishArtifact, PublicTemplatePublishError, PublicTemplatePublishJob, PublicTemplatePublishRequestOptions, PublicTemplatesClient, QuotaError, Sandbox, SandboxConfig, SandboxEnvRecovery, SandboxEnvRecoveryView, SandboxError, SandboxErrorJson, SandboxFailureDetail, SandboxFailureKind, SandboxInfo, SandboxInstance, SandboxResolvedSeat, SandboxSeatCredentials, SandboxSeatSelectionInput, SandboxStatus, SeatOwnerReply, SeatOwnerTransport, SeatResolutionObservation, SeatSelectionError, SeatSelectionRequest, ServerError, SessionMessageAdmission, StateError, TimeoutError, ValidationError, WorkspaceImagePublishInput, WorkspaceImagePublishRequestOptions, WorkspaceImagePublishResult, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, createSelectSeat, gatewaySeatTransport, isBackendRegistryInteractionKind, lineInstanceKey, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseErrorResponse, parseLineApplicationRequest, parseLineApplicationResult, profileChannelReference, responseMetadata, sandboxFailureKind };
|
package/dist/core.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { S as ManagedProcessClient, r as WorkspaceImages, t as SandboxInstance } from "./sandbox-
|
|
2
|
-
import { C as SandboxError, D as TimeoutError, O as ValidationError, T as StateError, _ as NetworkError, b as ProfileFileMountPathError, c as AuthError, m as FileWriteConflictError, o as responseMetadata, r as parseErrorResponse, u as CapabilityError, v as NotFoundError, w as ServerError, x as QuotaError, y as PartialFailureError } from "./errors-
|
|
3
|
-
import { a as InstancesClient, c as backendRegistryCapabilitiesSchema, d as backendRegistryResponseSchema, f as isBackendRegistryInteractionKind, i as InstanceRestartingError, l as backendRegistryEntrySchema, m as parseBackendRegistryResponseBody, p as parseBackendRegistryResponse, r as HostedInstance, t as Sandbox, u as backendRegistryInteractionKindSchema } from "./client-
|
|
4
|
-
import { i as profileChannelReference, r as lineInstanceKey, t as LinesClient } from "./lines-
|
|
1
|
+
import { S as ManagedProcessClient, r as WorkspaceImages, t as SandboxInstance } from "./sandbox-CmeidNvi.js";
|
|
2
|
+
import { C as SandboxError, D as TimeoutError, O as ValidationError, T as StateError, _ as NetworkError, b as ProfileFileMountPathError, c as AuthError, m as FileWriteConflictError, o as responseMetadata, r as parseErrorResponse, u as CapabilityError, v as NotFoundError, w as ServerError, x as QuotaError, y as PartialFailureError } from "./errors-BuEDuIrs.js";
|
|
3
|
+
import { a as InstancesClient, c as backendRegistryCapabilitiesSchema, d as backendRegistryResponseSchema, f as isBackendRegistryInteractionKind, i as InstanceRestartingError, l as backendRegistryEntrySchema, m as parseBackendRegistryResponseBody, p as parseBackendRegistryResponse, r as HostedInstance, t as Sandbox, u as backendRegistryInteractionKindSchema } from "./client-4msWs7Tt.js";
|
|
4
|
+
import { i as profileChannelReference, r as lineInstanceKey, t as LinesClient } from "./lines-D3DKzzQT.js";
|
|
5
5
|
import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
|
|
6
|
-
import { a as parseLineApplicationResult, i as parseLineApplicationRequest, n as LINE_APPLICATION_REPLY_MAX_CHARS, o as sandboxFailureKind, r as LINE_APPLICATION_REQUEST_MAX_BYTES, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-
|
|
7
|
-
import { a as createSelectSeat, i as SeatSelectionError, o as gatewaySeatTransport } from "./select-seat-
|
|
6
|
+
import { a as parseLineApplicationResult, i as parseLineApplicationRequest, n as LINE_APPLICATION_REPLY_MAX_CHARS, o as sandboxFailureKind, r as LINE_APPLICATION_REQUEST_MAX_BYTES, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-BWiEs9yv.js";
|
|
7
|
+
import { a as createSelectSeat, i as SeatSelectionError, o as gatewaySeatTransport } from "./select-seat-D_L4pss9.js";
|
|
8
8
|
export { AuthError, CapabilityError, FileWriteConflictError, HostedInstance, ISOLATED_CREATION_ATTESTATION_VERSION, InstanceRestartingError, InstancesClient, LINE_APPLICATION_REPLY_MAX_CHARS, LINE_APPLICATION_REQUEST_MAX_BYTES, LinesClient, ManagedProcessClient, NetworkError, NotFoundError, PartialFailureError, ProfileFileMountPathError, PublicTemplatePublishError, PublicTemplatesClient, QuotaError, Sandbox, SandboxError, SandboxInstance, SeatSelectionError, ServerError, StateError, TimeoutError, ValidationError, WorkspaceImages, backendRegistryCapabilitiesSchema, backendRegistryEntrySchema, backendRegistryInteractionKindSchema, backendRegistryResponseSchema, createSelectSeat, gatewaySeatTransport, isBackendRegistryInteractionKind, lineInstanceKey, parseBackendRegistryResponse, parseBackendRegistryResponseBody, parseErrorResponse, parseLineApplicationRequest, parseLineApplicationResult, profileChannelReference, responseMetadata, sandboxFailureKind };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as emitTiming } from "./keep-alive-fetch-
|
|
1
|
+
import { o as responseTraceId } from "./trace-id-DX218plN.js";
|
|
2
|
+
import { t as emitTiming } from "./keep-alive-fetch-xLyOpHAc.js";
|
|
3
3
|
//#region src/lib/direct-http2.ts
|
|
4
4
|
const sessions = /* @__PURE__ */ new Map();
|
|
5
5
|
const inFlight = /* @__PURE__ */ new WeakMap();
|
|
@@ -33,6 +33,7 @@ const ERROR_CATALOG = {
|
|
|
33
33
|
UPSTREAM_ERROR: "502 retry | An upstream service failed or answered outside its contract. | Retry with backoff; report the request id if it persists.",
|
|
34
34
|
UNAVAILABLE: "503 retry | A dependency or capacity is temporarily unavailable. | Retry after the Retry-After interval.",
|
|
35
35
|
UPSTREAM_UNAVAILABLE: "503 retry | The sandbox controller did not answer, or answered without a code the catalog knows. | Retry after the Retry-After interval.",
|
|
36
|
+
CONTROLLER_RESTARTING: "503 retry | The controller is restarting. | Retry reads or repeat with the same operation key. Check unkeyed writes before repeating them.",
|
|
36
37
|
NOT_READY: "503 retry | The target is starting, restarting, recovering or draining. | Retry after the Retry-After interval.",
|
|
37
38
|
BACKEND_UNAVAILABLE: "503 retry | The agent backend did not answer. | Retry after the Retry-After interval.",
|
|
38
39
|
MESSAGE_RETRIEVAL_UNAVAILABLE: "503 retry | Message storage did not answer. | Retry after the Retry-After interval.",
|
|
@@ -54,6 +55,7 @@ const ERROR_CATALOG = {
|
|
|
54
55
|
BRANCH_PARENT_NOT_RUNNING: "409 final | The branch parent is not running. | Resume the parent sandbox, then branch again.",
|
|
55
56
|
BRANCH_NOT_MATERIALIZED: "409 final | The branch parent was removed before any child materialized. | Branch a live sandbox with a new idempotency key.",
|
|
56
57
|
CONTAINER_RESERVATION_CONFLICT: "409 retry | Another lifecycle operation holds this sandbox. | Wait for that operation to finish, then retry.",
|
|
58
|
+
CONTAINER_GENERATION_MISMATCH: "409 final | The stopped Docker generation differs from the sandbox checkpoint. | Resume the sandbox from its confirmed checkpoint.",
|
|
57
59
|
CONTAINER_NETWORK_MISSING: "409 final | The stopped sandbox lost its network, so it cannot start in place; its files remain. | Resume the sandbox so the platform recreates it.",
|
|
58
60
|
EGRESS_DISABLED: "409 final | Egress is not enabled on this host. | Place the sandbox on a host with egress enabled.",
|
|
59
61
|
NATIVE_CAPTURE_UNAVAILABLE: "409 final | The host cannot prove the native capture image this create requires. | Retry on another host, or create without native capture.",
|
|
@@ -62,6 +64,7 @@ const ERROR_CATALOG = {
|
|
|
62
64
|
SNAPSHOT_LIMIT_REACHED: "409 final | The sandbox holds as many snapshots as its plan allows. | Delete a snapshot of this sandbox, or move to a plan with a higher snapshot limit.",
|
|
63
65
|
SNAPSHOT_NOT_SYNCED: "409 retry | The snapshot has not finished uploading. | Retry after the upload completes.",
|
|
64
66
|
WARM_CLAIM_REMOVED: "409 final | Another lifecycle operation removed the claimed warm sandbox. | Create the sandbox again.",
|
|
67
|
+
GOLDEN_SEED_SPENT: "503 final | This warm-pool seed captured the golden snapshot and was retired, since its identity is in that memory. | Nothing to do; the pool's next seed restores from that snapshot.",
|
|
65
68
|
WORKSPACE_STORAGE_MISSING: "409 final | The stopped sandbox storage is gone or replaced, so the host refused to start it. | Restore the sandbox from a snapshot.",
|
|
66
69
|
RESTORE_QUOTA_EXCEEDED: "413 final | The snapshot is larger than the workspace quota. | Create with a larger disk, or restore a smaller snapshot.",
|
|
67
70
|
GIT_CLONE_REFUSED: "422 final | The repository refused the clone credential, or the credential cannot see it. | Fix the git credential or repository URL, then create again.",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as HOST_AGENT_RESTART_KINDS, r as catalogEntry, t as ERROR_CATALOG } from "./error-catalog-
|
|
1
|
+
import { n as HOST_AGENT_RESTART_KINDS, r as catalogEntry, t as ERROR_CATALOG } from "./error-catalog-DwxHMZQZ.js";
|
|
2
2
|
import { n as plannedRestartDeadline, t as parseSandboxRetryAfterHeader } from "./retry-after-header-DyAWSQ4m.js";
|
|
3
3
|
//#region ../../../packages/runtime-contracts/dist/sandbox-create-headers.js
|
|
4
4
|
/** The caller's absolute create deadline (epoch ms), shared by every attempt. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as bytesToHex, t as sha256 } from "./sha2--74Uh_Sg.js";
|
|
2
|
-
import { O as ValidationError } from "./errors-
|
|
2
|
+
import { O as ValidationError } from "./errors-BuEDuIrs.js";
|
|
3
3
|
import { n as combineAbortSignals } from "./abort-signal-BsriwJ8L.js";
|
|
4
4
|
//#region src/lib/file-download.ts
|
|
5
5
|
function downloadBounds(options) {
|
package/dist/gpu-lease/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as fetchSandboxApi } from "../api-request-
|
|
2
|
-
import { t as ITangleJobsAbi } from "../abi-
|
|
1
|
+
import { i as fetchSandboxApi } from "../api-request-Da3Gy5v5.js";
|
|
2
|
+
import { t as ITangleJobsAbi } from "../abi-CQYNCS4F.js";
|
|
3
3
|
import { createPublicClient, createWalletClient, decodeAbiParameters, encodeAbiParameters, encodeFunctionData, hexToBytes, http, keccak256, parseAbi, parseAbiParameters, parseEventLogs, recoverMessageAddress, stringToHex } from "viem";
|
|
4
4
|
import { privateKeyToAccount } from "viem/accounts";
|
|
5
5
|
//#region src/gpu-lease/vault.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { R as SandboxError, Y as SandboxCreateReceipt, g as TerminalReadyInfo, i as TerminalStreamHandlers, l as MintScopedTokenOptions, o as TerminalStreamReconnectAuthority, u as ScopedToken } from "./terminal-stream-types-
|
|
1
|
+
import { R as SandboxError, Y as SandboxCreateReceipt, g as TerminalReadyInfo, i as TerminalStreamHandlers, l as MintScopedTokenOptions, o as TerminalStreamReconnectAuthority, u as ScopedToken } from "./terminal-stream-types-BMLdhwUQ.js";
|
|
2
2
|
import { C as InteractionRequest, F as ProxySecretReceipt, I as InteractionData, S as InteractionAcknowledgement, T as AgentProfile, _ as TerminalReplayWindow, a as AgentInteractiveSessionControlClaim, b as AgentRunCancellationRequest, c as AgentInteractiveSessionPromptAcknowledgement, f as AgentInteractiveSessionStopAcknowledgement, g as TerminalOutputEvent, i as AgentInteractiveSessionAttach, k as AgentProfileFileMount, l as AgentInteractiveSessionPromptCommand, m as AgentInteractiveTerminalSession, o as AgentInteractiveSessionControlClaimAcknowledgement, p as AgentInteractiveSessionStopCommand, r as AgentInteractiveSessionStart, s as AgentInteractiveSessionControlClaimRequest, u as AgentInteractiveSessionRef, w as InteractionResponseCommand, y as AgentRunCancellationAcknowledgement } from "./index-V_pXOH3B.js";
|
|
3
|
-
import { $r as SnapshotResult, Ar as RolloutStartResult, Bi as CreateSessionOptions, Br as SandboxDeleteOptions, C as GitCommit, Ci as PromptInputPart, Dr as ForkLookupOptions, Ei as SandboxEvent, Er as ForkIdempotency, Fi as CommitTaskSessionOptions, Ft as SSHCredentials, Ga as CodeLanguage, Gi as ListMessagesOptions, Gn as WriteManyFile, Hi as DispatchPromptOptions, Hr as SandboxOperationInfo, Ht as SandboxTerminalAttachOptions, It as SandboxConnection, Ja as WriteFileRequest, Ji as SendSessionMessageRequest, Jn as SearchOptions, Jt as StartupDiagnostics, Ki as PublicProfileConflict, Kn as WriteManyOptions, Kr as SnapshotDeleteAcknowledgement, Li as CompletedTurnResult, Lt as SandboxInfo, Mi as SandboxTraceOptions, Mn as FileSystem, Or as Rollout, Pi as TurnBackendConfig, Pt as SSHCommandDescriptor, Qa as InteractionResolutionAcknowledgement, Qi as SessionExecutionInfo, Qt as TeeAttestationResponse, Ri as ConversationTurnOptions, Rn as FileWriteResult, Rr as RestoreSnapshotOptions, Rt as SandboxPortBinding, S as GitBranch, Si as IntelligenceReportWindow, Sr as HttpClient, T as GitStatus, Ti as PromptResult, Tr as ForkCounts, Ui as DispatchedSession, Ur as SandboxOperationKind, Vi as CreateTaskSessionOptions, Vt as SandboxRuntimeHealth, Wa as CodeExecutionResult, Wi as DriveTurnOptions, Wn as WriteFileOptions, Wr as SandboxOperationState, Xa as SandboxEnvRecoveryView, Xr as SnapshotOptions, Xt as TeeAttestationOptions, Ya as SandboxEnvRecovery, Yi as SentSessionMessage, Yn as ExecOptions, Yr as SnapshotInfo, Zi as SessionEventStreamOptions, Zr as SnapshotProvenance, _i as EventStreamOptions, aa as SessionMessage, ar as DriverInfo, b as PreviewLinkManager, bi as IntelligenceReportCompareTo, ca as SessionResultOptions, cn as SandboxShape, ei as StopOptions, en as TeePublicKeyResponse, fa as TaskSessionInfo, fi as DurablePlan, fr as GpuLeaseManager, g as ProcessManager, ga as BackendConfig, hr as CodeExecutionOptions, i as ProvisionResult, ia as SessionListOptions, jr as WaitForRolloutOptions, ki as SandboxTraceBundle, kr as RolloutOptions, la as TaskSessionChanges, ma as TurnDriveResult, mi as DurablePlanDecisionResult, na as SessionInfo, ni as SandboxResourceUsage, o as ResumeOptions, oa as SessionMessageAdmission, pi as DurablePlanDecisionOptions, pn as NetworkManager, qa as ExecResult, qi as SendSessionMessageOptions, qn as SearchMatch, qt as SandboxTerminals, r as ProvisionEvent, ra as SessionInterruptOptions, ri as SandboxRuntimeCapabilities, rn as CreateSandboxOptions, sn as SandboxStatus, sr as GpuLease, ta as SessionForkOptions, ti as WorkspaceOperationLookup, tn as TerminalStream, u as WaitForOptions, ua as TaskSessionCommitResult, un as EgressManager, va as BackendManager, vi as IntelligenceReport, w as GitDiff, wi as PromptOptions, wr as BranchOptions, wt as SandboxFleetTraceBundle, yi as IntelligenceReportBudget, za as RetainedWorkspacePublication, zi as ConversationTurnResult, zr as SandboxDeleteAcknowledgement } from "./types-
|
|
3
|
+
import { $r as SnapshotResult, Ar as RolloutStartResult, Bi as CreateSessionOptions, Br as SandboxDeleteOptions, C as GitCommit, Ci as PromptInputPart, Dr as ForkLookupOptions, Ei as SandboxEvent, Er as ForkIdempotency, Fi as CommitTaskSessionOptions, Ft as SSHCredentials, Ga as CodeLanguage, Gi as ListMessagesOptions, Gn as WriteManyFile, Hi as DispatchPromptOptions, Hr as SandboxOperationInfo, Ht as SandboxTerminalAttachOptions, It as SandboxConnection, Ja as WriteFileRequest, Ji as SendSessionMessageRequest, Jn as SearchOptions, Jt as StartupDiagnostics, Ki as PublicProfileConflict, Kn as WriteManyOptions, Kr as SnapshotDeleteAcknowledgement, Li as CompletedTurnResult, Lt as SandboxInfo, Mi as SandboxTraceOptions, Mn as FileSystem, Or as Rollout, Pi as TurnBackendConfig, Pt as SSHCommandDescriptor, Qa as InteractionResolutionAcknowledgement, Qi as SessionExecutionInfo, Qt as TeeAttestationResponse, Ri as ConversationTurnOptions, Rn as FileWriteResult, Rr as RestoreSnapshotOptions, Rt as SandboxPortBinding, S as GitBranch, Si as IntelligenceReportWindow, Sr as HttpClient, T as GitStatus, Ti as PromptResult, Tr as ForkCounts, Ui as DispatchedSession, Ur as SandboxOperationKind, Vi as CreateTaskSessionOptions, Vt as SandboxRuntimeHealth, Wa as CodeExecutionResult, Wi as DriveTurnOptions, Wn as WriteFileOptions, Wr as SandboxOperationState, Xa as SandboxEnvRecoveryView, Xr as SnapshotOptions, Xt as TeeAttestationOptions, Ya as SandboxEnvRecovery, Yi as SentSessionMessage, Yn as ExecOptions, Yr as SnapshotInfo, Zi as SessionEventStreamOptions, Zr as SnapshotProvenance, _i as EventStreamOptions, aa as SessionMessage, ar as DriverInfo, b as PreviewLinkManager, bi as IntelligenceReportCompareTo, ca as SessionResultOptions, cn as SandboxShape, ei as StopOptions, en as TeePublicKeyResponse, fa as TaskSessionInfo, fi as DurablePlan, fr as GpuLeaseManager, g as ProcessManager, ga as BackendConfig, hr as CodeExecutionOptions, i as ProvisionResult, ia as SessionListOptions, jr as WaitForRolloutOptions, ki as SandboxTraceBundle, kr as RolloutOptions, la as TaskSessionChanges, ma as TurnDriveResult, mi as DurablePlanDecisionResult, na as SessionInfo, ni as SandboxResourceUsage, o as ResumeOptions, oa as SessionMessageAdmission, pi as DurablePlanDecisionOptions, pn as NetworkManager, qa as ExecResult, qi as SendSessionMessageOptions, qn as SearchMatch, qt as SandboxTerminals, r as ProvisionEvent, ra as SessionInterruptOptions, ri as SandboxRuntimeCapabilities, rn as CreateSandboxOptions, sn as SandboxStatus, sr as GpuLease, ta as SessionForkOptions, ti as WorkspaceOperationLookup, tn as TerminalStream, u as WaitForOptions, ua as TaskSessionCommitResult, un as EgressManager, va as BackendManager, vi as IntelligenceReport, w as GitDiff, wi as PromptOptions, wr as BranchOptions, wt as SandboxFleetTraceBundle, yi as IntelligenceReportBudget, za as RetainedWorkspacePublication, zi as ConversationTurnResult, zr as SandboxDeleteAcknowledgement } from "./types-DOngB_Rs.js";
|
|
4
4
|
import { c as RawEvidenceDirectoryExport, l as RawEvidenceExportOptions, o as RawEvidenceBoxDirectoryExport, p as RawEvidenceUnavailable, r as RawEvidenceArchiveManifest, s as RawEvidenceBoxExportOptions } from "./raw-evidence-export-1ygyhNsS.js";
|
|
5
5
|
import { r as CliAuthReference } from "./cli-auth-bundle-Dx3AAWdJ.js";
|
|
6
|
-
import { n as SandboxLines } from "./lines-
|
|
7
|
-
import { _ as InteractiveSessionStatus, f as InteractiveAttachOptions, g as InteractiveRequestOptions, h as InteractiveObserveOptions, m as InteractiveControlClaimOptions, p as InteractiveControlClaimAcknowledgement } from "./browser-interactive-control-controller-
|
|
8
|
-
import { r as InteractiveAttachRequest } from "./interactive-controller-
|
|
6
|
+
import { n as SandboxLines } from "./lines-Ce4UmKfm.js";
|
|
7
|
+
import { _ as InteractiveSessionStatus, f as InteractiveAttachOptions, g as InteractiveRequestOptions, h as InteractiveObserveOptions, m as InteractiveControlClaimOptions, p as InteractiveControlClaimAcknowledgement } from "./browser-interactive-control-controller-CD8b8KFn.js";
|
|
8
|
+
import { r as InteractiveAttachRequest } from "./interactive-controller-DJpf6ofh.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
import { OtlpTraceExport } from "@tangle-network/agent-trace-contract/otlp";
|
|
11
11
|
|
|
@@ -128,7 +128,7 @@ declare class SandboxOperationFailedError extends SandboxError {
|
|
|
128
128
|
}
|
|
129
129
|
declare class SandboxOperation {
|
|
130
130
|
#private;
|
|
131
|
-
constructor(info: SandboxOperationInfo, client: HttpClient | null, onSettled?: (info: SandboxOperationInfo) => void | Promise<void>);
|
|
131
|
+
constructor(info: SandboxOperationInfo, client: HttpClient | null, onSettled?: (info: SandboxOperationInfo) => void | Promise<void>, traceHeaders?: Record<string, string>);
|
|
132
132
|
static completed(kind: SandboxOperationKind, sandboxId: string, result?: SandboxOperationInfo["result"]): SandboxOperation;
|
|
133
133
|
get id(): string;
|
|
134
134
|
get state(): SandboxOperationState;
|
|
@@ -1772,6 +1772,7 @@ declare abstract class SandboxSnapshotCapabilities extends SandboxTurnCapabiliti
|
|
|
1772
1772
|
snapshot(options?: SnapshotOptions): Promise<SnapshotResult>;
|
|
1773
1773
|
/** List snapshots; storage selects the direct customer-S3 path. */
|
|
1774
1774
|
listSnapshots(storage?: SnapshotOptions["storage"]): Promise<SnapshotInfo[]>;
|
|
1775
|
+
private readSnapshotList;
|
|
1775
1776
|
/** Delete returns already_absent for a missing snapshot; 404 means the sandbox itself is unknown. */
|
|
1776
1777
|
deleteSnapshot(snapshotId: string, options?: {
|
|
1777
1778
|
/** Per-call request deadline; invalid timer bounds throw RangeError. Omitted uses the client timeout. */timeoutMs?: number;
|
|
@@ -1787,8 +1788,8 @@ declare abstract class SandboxSnapshotCapabilities extends SandboxTurnCapabiliti
|
|
|
1787
1788
|
/** One keyed restore: a transport re-send joins its job; a 202 settles from that job. */
|
|
1788
1789
|
private restoreSnapshot;
|
|
1789
1790
|
/** Read the accepted restore job first; poll only while unfinished. */
|
|
1790
|
-
protected waitForSnapshotRestore(snapshotId: string, accepted: SnapshotRestoreJobStatusResponse): Promise<SnapshotResult>;
|
|
1791
|
-
protected waitForSnapshotVisible(snapshotId: string, fallback?: Partial<SnapshotResult>): Promise<SnapshotResult>;
|
|
1791
|
+
protected waitForSnapshotRestore(snapshotId: string, accepted: SnapshotRestoreJobStatusResponse, trace?: Record<string, string>): Promise<SnapshotResult>;
|
|
1792
|
+
protected waitForSnapshotVisible(snapshotId: string, fallback?: Partial<SnapshotResult>, trace?: Record<string, string>): Promise<SnapshotResult>;
|
|
1792
1793
|
/** Restore the latest customer-storage snapshot directly; null means none found. */
|
|
1793
1794
|
restoreFromStorage(storage: SnapshotOptions["storage"], options?: RestoreSnapshotOptions): Promise<SnapshotResult | null>;
|
|
1794
1795
|
}
|