@tangle-network/sandbox 1.0.231 → 1.0.232
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 +22 -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-DMaHbXAk.d.ts → agent-run-outcome-MsLkgPNu.d.ts} +2 -2
- package/dist/{api-request-_SFFNVqY.js → api-request-B0BPgzdp.js} +34 -9
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +2 -2
- package/dist/{browser-interactive-control-controller-BiP6TJFP.js → browser-interactive-control-controller-Bf-DbRCA.js} +14 -4
- package/dist/{browser-interactive-control-controller-qv26Bpfx.d.ts → browser-interactive-control-controller-D17JJ8B0.d.ts} +1 -1
- package/dist/{chunked-upload-BjkxykZD.js → chunked-upload-BGwaw5np.js} +4 -5
- package/dist/{chunked-upload-file-B2KFimpz.js → chunked-upload-file-BnV8qgwV.js} +2 -2
- package/dist/cli-auth-bundle-DvmJ71bO.js +2 -0
- package/dist/{client-DvvRMxKx.d.ts → client-BTpWpGs-.d.ts} +36 -30
- package/dist/{client-OlxlnLwV.js → client-CgZADtPk.js} +36 -46
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-DZ8ptALs.js → collaboration-DneF_7bo.js} +20 -27
- package/dist/{core-D7czAW25.js → core-Cxww35JL.js} +5 -5
- package/dist/core.d.ts +6 -6
- package/dist/core.js +5 -5
- package/dist/{direct-http2-DU2SK2Wo.js → direct-http2-B5bdFrtg.js} +1 -1
- package/dist/{errors-A-bhwwsE.js → error-catalog-CGhVLVNq.js} +1 -382
- package/dist/errors-dK3-2RCh.js +382 -0
- package/dist/{file-download-UhMKbMbD.js → file-download-CUNdbymj.js} +1 -1
- package/dist/{index-Cip3q_xe.d.ts → index-CHP8U613.d.ts} +13 -23
- package/dist/index.d.ts +12 -12
- package/dist/index.js +28 -25
- package/dist/intelligence/index.js +3 -3
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-D4gZ4f2I.js → interactive-controller-Bs7VQ04W.js} +17 -54
- package/dist/{interactive-controller-P0yy6sGl.d.ts → interactive-controller-DbNjY09X.d.ts} +3 -3
- package/dist/lib/prepared-evidence.js +1 -1
- package/dist/lib/prepared-process.js +1 -1
- package/dist/{lines-7VecgiGd.js → lines-DtssoioA.js} +1 -1
- package/dist/{lines-DNXdVbGO.d.ts → lines-n-mBURry.d.ts} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -1
- package/dist/{local-cli-auth-CPS9yuTc.js → local-cli-auth-8Ndf1jRw.js} +1 -1
- package/dist/{mcp-local-CIXZFqF4.js → mcp-local-tA5cB3zq.js} +4 -4
- package/dist/{prepared-evidence-Byty5p51.js → prepared-evidence-DBE_xYjq.js} +2 -2
- package/dist/{prepared-process-u1B0b94R.js → prepared-process-B1kSkhn-.js} +2 -2
- package/dist/{preview-CNfYklE6.d.ts → preview-BHee3FzP.d.ts} +3 -3
- package/dist/{public-templates-CPvDf8CH.d.ts → public-templates-ZrUJ507X.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/public-templates.js +1 -1
- package/dist/{raw-evidence-archive-BgWqaQcM.js → raw-evidence-archive-Cfy_3_3y.js} +2 -2
- package/dist/{retry-policy-Dh-VezcE.js → retry-policy-CI5tyUGr.js} +2 -24
- package/dist/runtime.d.ts +7 -7
- package/dist/runtime.js +9 -9
- package/dist/{sandbox-Dvk2PYnL.js → sandbox-DOvm9OvM.js} +59 -74
- package/dist/{secp256k1-Cbp9tbkX.js → secp256k1-DZM5U2gv.js} +1 -1
- package/dist/select-seat-command.d.ts +1 -1
- package/dist/select-seat-command.js +1 -1
- package/dist/session-gateway/index.js +11 -20
- package/dist/sidecar-proxy-error-CeNM5eJj.js +4 -0
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-DWzUnb1Y.js → tangle-DFmy_0hM.js} +22 -17
- package/dist/{terminal-stream-types-DB8V0hiG.d.ts → terminal-stream-types-NBdVKKFu.d.ts} +0 -1
- package/dist/{types-Cmv31xBh.d.ts → types-CuMa305b.d.ts} +13 -57
- package/package.json +5 -5
- package/dist/cli-auth-bundle-CMJWI99l.js +0 -2
- package/dist/sidecar-proxy-error-DpBLxIof.js +0 -24
- /package/dist/{abort-signal-BbJTt2QJ.js → abort-signal-C0_9B1Hm.js} +0 -0
- /package/dist/{cli-auth-bundle-Wg3x2hd2.d.ts → cli-auth-bundle-BE_EfLUx.d.ts} +0 -0
- /package/dist/{cli-auth-bundle-C6DtK7GX-BbbiAn-Z.js → cli-auth-bundle-C6DtK7GX-Cjs6D-9c.js} +0 -0
- /package/dist/{file-transfer-BSe4ayU9.js → file-transfer-CSL53pv9.js} +0 -0
- /package/dist/{index-YbAo-so_.d.ts → index-D0zHNMSe.d.ts} +0 -0
- /package/dist/{index-CDtEPygc.d.ts → index-DsX2pOIn.d.ts} +0 -0
- /package/dist/{keep-alive-fetch-BIaDMUtu.js → keep-alive-fetch-C2DX2_rG.js} +0 -0
- /package/dist/{preview-operations-B3TTvqlm.js → preview-operations-BBF0BNuZ.js} +0 -0
- /package/dist/{retry-after-header-DUdCC0KJ.js → retry-after-header-Bt-XvU-x.js} +0 -0
- /package/dist/{sse-parser-DOCszo1K.js → sse-parser-CBQzZvkZ.js} +0 -0
- /package/dist/{utils-CK-x8vXj.js → utils-DqiOGAK5.js} +0 -0
package/README.md
CHANGED
|
@@ -20,7 +20,28 @@ export SANDBOX_BASE_URL=https://sandbox.tangle.tools
|
|
|
20
20
|
The oldest supported SDK is `@tangle-network/sandbox@1.0.151`, the first version that accepts a capability or enum value it does not know instead of refusing the whole response.
|
|
21
21
|
Older versions fail when the Sandbox API advertises a new value; upgrade to this version or later.
|
|
22
22
|
This line is the one place the floor is stated: the production journey (`scripts/production-journey.sh`) reads it and runs every cell's journey on it.
|
|
23
|
-
Every request from the [shared raw transport](src/lib/api-request.mjs) and the Python SDK sends `x-sdk-version: <package version>`, and the Sandbox Worker's invocation log records it as `$workers.event.request.headers.x-sdk-version`, so the versions customers run can be counted.
|
|
23
|
+
Every account-authenticated request from the [shared raw transport](src/lib/api-request.mjs) and the Python SDK sends `x-sdk-version: <package version>`, and the Sandbox Worker's invocation log records it as `$workers.event.request.headers.x-sdk-version`, so the versions customers run can be counted.
|
|
24
|
+
|
|
25
|
+
## Timeouts and retries
|
|
26
|
+
|
|
27
|
+
Every HTTP request has a default deadline, including direct runtime, Platform, browser control, collaboration and Tangle operator calls. [`SDK_TIMEOUTS`](src/lib/api-request.mjs) owns the values (milliseconds); import it from `@tangle-network/sandbox`. `SandboxConfig.timeoutMs` replaces `default`; an operation's own timeout replaces that client default. Caller cancellation still applies.
|
|
28
|
+
|
|
29
|
+
| Calls | Default policy |
|
|
30
|
+
|---|---|
|
|
31
|
+
| Calls without an exception below | `default` |
|
|
32
|
+
| `create()` | `create`, or `gpuCreate` for a GPU lease, including retries; a capacity ETA may extend an omitted timeout within the create recovery window |
|
|
33
|
+
| `exec()` | Execution limit from the operation contract plus `margin` |
|
|
34
|
+
| `runCode()` | Kernel limit (`runCode`), plus `margin`; a zero kernel limit leaves a finite default request deadline |
|
|
35
|
+
| Fleet `dispatchExec` / `dispatchPrompt` | Larger of the requested duration and `fleetDispatch`, plus `margin` |
|
|
36
|
+
| `snapshot`, retained `stop`, snapshot restore, image build | `snapshot`; image build accepts `timeout` |
|
|
37
|
+
| Workspace image publication | `workspaceImage` |
|
|
38
|
+
| `deleteMatching` | `deleteMatching`, or `deleteMatchingUntilRemoved` |
|
|
39
|
+
| Operation wait / preview readiness / terminal token / terminal connect | `operationWait` / `previewReady` / `interactiveToken` / `terminalConnect` |
|
|
40
|
+
| Session gateway status read / attestation signing keys | Their bounded read limits in the owning modules |
|
|
41
|
+
|
|
42
|
+
JSON and error bodies remain bounded through consumption. Successful event streams, downloads and batch streams use the request deadline through response headers; their lifetime is controlled by caller cancellation and the operation's stream policy. A timeout ends the client's wait; work already accepted by the server may continue. Rejoin a keyed create or batch using its original key.
|
|
43
|
+
|
|
44
|
+
Retries require both a replay-safe request and a retryable catalog error. Recovery may first refresh an expired bearer, supply a missing profile or wait for a retained snapshot's copy; these state changes preserve their existing recovery behavior. Transport retries retain shared pacing, `Retry-After`, caller cancellation and their deadline. `x-no-retry` disables transport replay.
|
|
24
45
|
|
|
25
46
|
## Choose an entrypoint
|
|
26
47
|
|
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 { Bt as SandboxFleetParent, Ha as CodeExecutionResult, Ua as CodeLanguage, Ur as CodeExecutionOptions, Wa as CodeResultPart, ga as BackendConfig, ia as SessionListOptions, mo as BackendType, na as SessionInfo } 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-CHP8U613.js";
|
|
2
|
+
import { Bt as SandboxFleetParent, Ha as CodeExecutionResult, Ua as CodeLanguage, Ur as CodeExecutionOptions, Wa as CodeResultPart, ga as BackendConfig, ia as SessionListOptions, mo as BackendType, na as SessionInfo } from "../types-CuMa305b.js";
|
|
3
|
+
import { t as Sandbox } from "../client-BTpWpGs-.js";
|
|
4
|
+
import { u as PreviewAuthorizer } from "../preview-BHee3FzP.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 { D as assertCurrentBackendType } from "../interactive-controller-
|
|
3
|
-
import { t as SandboxInstance } from "../sandbox-
|
|
4
|
-
import { D as ValidationError, _ as NotFoundError, w as StateError } 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-tA5cB3zq.js";
|
|
2
|
+
import { D as assertCurrentBackendType } from "../interactive-controller-Bs7VQ04W.js";
|
|
3
|
+
import { t as SandboxInstance } from "../sandbox-DOvm9OvM.js";
|
|
4
|
+
import { D as ValidationError, _ as NotFoundError, w as StateError } from "../errors-dK3-2RCh.js";
|
|
5
|
+
import { t as Sandbox } from "../client-CgZADtPk.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-BHee3FzP.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-C1KpT-wS.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-BBF0BNuZ.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-tA5cB3zq.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
|
-
import { Ct as InteractionRequest } from "./terminal-stream-types-
|
|
2
|
-
import { Di as SandboxEvent, _i as DurablePlanSnapshot, ci as AgentApprovalRequirement, di as AgentToolInvocation, li as AgentQuestionRequest, ui as AgentRunStatus } from "./types-
|
|
1
|
+
import { Ct as InteractionRequest } from "./terminal-stream-types-NBdVKKFu.js";
|
|
2
|
+
import { Di as SandboxEvent, _i as DurablePlanSnapshot, ci as AgentApprovalRequirement, di as AgentToolInvocation, li as AgentQuestionRequest, ui as AgentRunStatus } from "./types-CuMa305b.js";
|
|
3
3
|
|
|
4
4
|
//#region src/agent-run-outcome.d.ts
|
|
5
5
|
interface AgentRunOutcome {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
1
|
+
import { r as catalogEntry, t as ERROR_CATALOG } from "./error-catalog-CGhVLVNq.js";
|
|
2
|
+
import { t as parseSandboxRetryAfterHeader } from "./retry-after-header-Bt-XvU-x.js";
|
|
3
|
+
import { c as retryBudget, n as SANDBOX_API_RETRY_SCOPE, o as isUndelivered, r as abortableSleep, s as planResend } from "./retry-policy-CI5tyUGr.js";
|
|
3
4
|
//#region src/lib/response-rewrap.mjs
|
|
4
5
|
/**
|
|
5
6
|
* Response wrappers that must outlive the fetch Response they wrap.
|
|
@@ -29,13 +30,30 @@ function rewrapResponse(original, headers, body = original.body) {
|
|
|
29
30
|
//#endregion
|
|
30
31
|
//#region src/lib/api-request.mjs
|
|
31
32
|
/** The package version tsdown.config.ts defines; unbuilt source reports 0.0.0. */
|
|
32
|
-
const SDK_VERSION = "1.0.
|
|
33
|
+
const SDK_VERSION = "1.0.232";
|
|
33
34
|
function withRequestContextHeaders(response, path, method, body = response.body) {
|
|
34
35
|
const headers = new Headers(response.headers);
|
|
35
36
|
headers.set("x-tangle-request-path", path);
|
|
36
37
|
if (method) headers.set("x-tangle-request-method", method);
|
|
37
38
|
return rewrapResponse(response, headers, body);
|
|
38
39
|
}
|
|
40
|
+
/** The SDK's one timeout table, in ms (documented in api-request.d.mts). */
|
|
41
|
+
const SDK_TIMEOUTS = Object.freeze({
|
|
42
|
+
default: 3e4,
|
|
43
|
+
margin: 15e3,
|
|
44
|
+
create: 12e4,
|
|
45
|
+
gpuCreate: 9e5,
|
|
46
|
+
runCode: 6e4,
|
|
47
|
+
fleetDispatch: 6e5,
|
|
48
|
+
deleteMatching: 12e4,
|
|
49
|
+
deleteMatchingUntilRemoved: 3e5,
|
|
50
|
+
snapshot: 6e5,
|
|
51
|
+
workspaceImage: 99e4,
|
|
52
|
+
operationWait: 6e5,
|
|
53
|
+
previewReady: 12e4,
|
|
54
|
+
interactiveToken: 5e3,
|
|
55
|
+
terminalConnect: 15e3
|
|
56
|
+
});
|
|
39
57
|
/** RFC 9110 idempotent methods: applying one twice leaves what once did. */
|
|
40
58
|
const IDEMPOTENT_METHODS = new Set([
|
|
41
59
|
"GET",
|
|
@@ -51,10 +69,15 @@ function isReplayableBody(body) {
|
|
|
51
69
|
return !(Symbol.asyncIterator in body);
|
|
52
70
|
}
|
|
53
71
|
/** The wait before resending after `response` (none: connection lost) on the shared pacing, or undefined when it is final or cannot go before `deadline`. */
|
|
54
|
-
function retryDelayMs(response, attempt, deadline) {
|
|
72
|
+
async function retryDelayMs(response, attempt, deadline) {
|
|
55
73
|
const after = parseSandboxRetryAfterHeader(response?.headers.get("retry-after"));
|
|
56
74
|
const status = response?.status ?? 503;
|
|
57
75
|
if (!(status >= 502 && status <= 504 || status === 429 && after !== void 0)) return void 0;
|
|
76
|
+
if (response) {
|
|
77
|
+
const body = await response.clone().json().catch(() => null);
|
|
78
|
+
const code = body?.error?.code ?? body?.code;
|
|
79
|
+
if (typeof code === "string" && Object.hasOwn(ERROR_CATALOG, code) && !catalogEntry(code).retryable) return void 0;
|
|
80
|
+
}
|
|
58
81
|
return planResend(SANDBOX_API_RETRY_SCOPE, attempt, {
|
|
59
82
|
retryAfterMs: after,
|
|
60
83
|
deadlineAt: deadline,
|
|
@@ -63,7 +86,7 @@ function retryDelayMs(response, attempt, deadline) {
|
|
|
63
86
|
}
|
|
64
87
|
/** SDK/probe transport retries replayable idempotent/keyed calls, or any verb after a proven failed dial.
|
|
65
88
|
* x-no-retry forbids replay; the caller deadline bounds attempts, and headers finalize an answer. */
|
|
66
|
-
async function fetchSandboxApi({ baseUrl, apiKey, timeoutMs =
|
|
89
|
+
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) {
|
|
67
90
|
const url = `${baseUrl.replace(/\/+$/, "")}${path}`;
|
|
68
91
|
const requestTimeoutMs = typeof fetchOptions?.timeoutMs === "number" && fetchOptions.timeoutMs > 0 ? fetchOptions.timeoutMs : timeoutMs;
|
|
69
92
|
const deadline = Date.now() + requestTimeoutMs;
|
|
@@ -83,8 +106,10 @@ async function fetchSandboxApi({ baseUrl, apiKey, timeoutMs = 3e4, signal, fetch
|
|
|
83
106
|
};
|
|
84
107
|
try {
|
|
85
108
|
const headers = new Headers(options?.headers);
|
|
86
|
-
|
|
87
|
-
|
|
109
|
+
if (apiKey) {
|
|
110
|
+
headers.set("Authorization", `Bearer ${apiKey}`);
|
|
111
|
+
headers.set("x-sdk-version", SDK_VERSION);
|
|
112
|
+
}
|
|
88
113
|
const isFormDataBody = typeof FormData !== "undefined" && options?.body instanceof FormData;
|
|
89
114
|
if (!headers.has("Content-Type") && !isFormDataBody) headers.set("Content-Type", "application/json");
|
|
90
115
|
const method = (options?.method ?? "GET").toUpperCase();
|
|
@@ -106,7 +131,7 @@ async function fetchSandboxApi({ baseUrl, apiKey, timeoutMs = 3e4, signal, fetch
|
|
|
106
131
|
lost = error;
|
|
107
132
|
}
|
|
108
133
|
const undelivered = !response && isUndelivered(lost);
|
|
109
|
-
const delayMs = repeatable && (undelivered || safe) && attempt < 4 ? retryDelayMs(response, attempt, deadline) : void 0;
|
|
134
|
+
const delayMs = repeatable && (undelivered || safe) && attempt < 4 ? await retryDelayMs(response, attempt, deadline) : void 0;
|
|
110
135
|
if (delayMs === void 0) {
|
|
111
136
|
if (!response) throw lost;
|
|
112
137
|
break;
|
|
@@ -166,4 +191,4 @@ async function fetchSandboxApi({ baseUrl, apiKey, timeoutMs = 3e4, signal, fetch
|
|
|
166
191
|
}
|
|
167
192
|
}
|
|
168
193
|
//#endregion
|
|
169
|
-
export {
|
|
194
|
+
export { isReplayableBody as a, fetchSandboxApi as i, SDK_TIMEOUTS as n, rewrapResponse as o, SDK_VERSION as r, IDEMPOTENT_METHODS as t };
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema, t as CliAuthReference } from "../cli-auth-bundle-
|
|
2
|
-
import { _ as ReadTokenPayload, a as issueCollaborationToken, c as issueSessionScopedToken, d as AnyTokenPayload, f as BatchScopedTokenPayload, g as ProjectScopedTokenPayload, h as IssueCollaborationTokenOptions, i as issueBatchScopedToken, l as unsafeDecodeToken, m as CollaborationTokenPayload, n as getTokenTTL, o as issueProjectScopedToken, p as CollaborationAccess, r as isTokenExpiringSoon, s as issueReadToken, t as ProductTokenIssuer, u as verifyToken, v as SessionScopedTokenPayload, y as TokenScope } from "../index-
|
|
1
|
+
import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema, t as CliAuthReference } from "../cli-auth-bundle-BE_EfLUx.js";
|
|
2
|
+
import { _ as ReadTokenPayload, a as issueCollaborationToken, c as issueSessionScopedToken, d as AnyTokenPayload, f as BatchScopedTokenPayload, g as ProjectScopedTokenPayload, h as IssueCollaborationTokenOptions, i as issueBatchScopedToken, l as unsafeDecodeToken, m as CollaborationTokenPayload, n as getTokenTTL, o as issueProjectScopedToken, p as CollaborationAccess, r as isTokenExpiringSoon, s as issueReadToken, t as ProductTokenIssuer, u as verifyToken, v as SessionScopedTokenPayload, y as TokenScope } from "../index-DsX2pOIn.js";
|
|
3
3
|
export { AnyTokenPayload, BatchScopedTokenPayload, CliAuthReference, CollaborationAccess, CollaborationTokenPayload, IssueCollaborationTokenOptions, ProductTokenIssuer, ProjectScopedTokenPayload, ReadTokenPayload, SessionScopedTokenPayload, TokenScope, assertCliAuthReferenceSupported, cliAuthReferenceSchema, getTokenTTL, isTokenExpiringSoon, issueBatchScopedToken, issueCollaborationToken, issueProjectScopedToken, issueReadToken, issueSessionScopedToken, materializeCliAuthBundle, unsafeDecodeToken, verifyToken };
|
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-C6DtK7GX-
|
|
2
|
-
import "../cli-auth-bundle-
|
|
1
|
+
import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema } from "../cli-auth-bundle-C6DtK7GX-Cjs6D-9c.js";
|
|
2
|
+
import "../cli-auth-bundle-DvmJ71bO.js";
|
|
3
3
|
//#region src/auth/tokens.ts
|
|
4
4
|
const textEncoder = new TextEncoder();
|
|
5
5
|
const textDecoder = new TextDecoder();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { C as boundedIdentifierSchema, D as isBoundedEventContentJson, E as boundedStringSchema, S as boundedEventContentStringSchema, T as boundedJsonSchema, _ as CONTRACT_MAX_ARRAY_LENGTH, b as boundedEventContentJsonSchema, g as sha256DigestSchema, h as omitTopLevelDigest, m as looksLikeCredential, n as REASONING_EFFORTS, o as canonicalCandidateDigest, p as isWellFormedUnicode, s as canonicalCandidateJson, t as harnessTypeSchema, u as isCanonicalJsonValue, w as boundedJsonRecordSchema, x as boundedEventContentRecordSchema, y as CONTRACT_MAX_STRING_LENGTH } from "./harness-DMaNgn0S.js";
|
|
2
|
-
import { t as awaitWithAbort } from "./abort-signal-
|
|
2
|
+
import { t as awaitWithAbort } from "./abort-signal-C0_9B1Hm.js";
|
|
3
|
+
import { i as fetchSandboxApi } from "./api-request-B0BPgzdp.js";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.13/node_modules/@tangle-network/agent-interface/dist/native-session-event.js
|
|
5
6
|
/**
|
|
@@ -2035,7 +2036,10 @@ function createBrowserInteractiveSessionControlTransport(options) {
|
|
|
2035
2036
|
if (typeof fetchImpl !== "function") throw new Error("Interactive browser controller requires fetch");
|
|
2036
2037
|
return {
|
|
2037
2038
|
async status(sessionId, incarnationId, requestOptions) {
|
|
2038
|
-
const response = await
|
|
2039
|
+
const response = await fetchSandboxApi({
|
|
2040
|
+
baseUrl: "",
|
|
2041
|
+
fetchImpl
|
|
2042
|
+
}, `${browserInteractiveSessionEndpoint(options.sessionApiUrl, sessionId)}?incarnationId=${encodeURIComponent(incarnationId)}`, {
|
|
2039
2043
|
headers: authHeaders(options.token),
|
|
2040
2044
|
...requestOptions?.signal === void 0 ? {} : { signal: requestOptions.signal }
|
|
2041
2045
|
});
|
|
@@ -2046,7 +2050,10 @@ function createBrowserInteractiveSessionControlTransport(options) {
|
|
|
2046
2050
|
return parsed.data.data.status;
|
|
2047
2051
|
},
|
|
2048
2052
|
async claimControl(sessionId, request, requestOptions) {
|
|
2049
|
-
const response = await
|
|
2053
|
+
const response = await fetchSandboxApi({
|
|
2054
|
+
baseUrl: "",
|
|
2055
|
+
fetchImpl
|
|
2056
|
+
}, browserInteractiveSessionEndpoint(options.sessionApiUrl, sessionId, "/control"), {
|
|
2050
2057
|
method: "POST",
|
|
2051
2058
|
headers: authHeaders(options.token, true),
|
|
2052
2059
|
body: JSON.stringify(request),
|
|
@@ -2062,7 +2069,10 @@ function createBrowserInteractiveSessionControlTransport(options) {
|
|
|
2062
2069
|
ref,
|
|
2063
2070
|
control
|
|
2064
2071
|
});
|
|
2065
|
-
const response = await
|
|
2072
|
+
const response = await fetchSandboxApi({
|
|
2073
|
+
baseUrl: "",
|
|
2074
|
+
fetchImpl
|
|
2075
|
+
}, browserInteractiveSessionEndpoint(options.sessionApiUrl, sessionId, "/control/release"), {
|
|
2066
2076
|
method: "POST",
|
|
2067
2077
|
headers: authHeaders(options.token, true),
|
|
2068
2078
|
body: JSON.stringify(body),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { at as AgentInteractiveSessionAttach, ct as AgentInteractiveSessionControlClaimRequest, dt as AgentInteractiveSessionRef, ft as AgentInteractiveSessionStatus, i as TerminalStreamHandlers, ot as AgentInteractiveSessionControlClaim, st as AgentInteractiveSessionControlClaimAcknowledgement } from "./terminal-stream-types-
|
|
1
|
+
import { at as AgentInteractiveSessionAttach, ct as AgentInteractiveSessionControlClaimRequest, dt as AgentInteractiveSessionRef, ft as AgentInteractiveSessionStatus, i as TerminalStreamHandlers, ot as AgentInteractiveSessionControlClaim, st as AgentInteractiveSessionControlClaimAcknowledgement } from "./terminal-stream-types-NBdVKKFu.js";
|
|
2
2
|
|
|
3
3
|
//#region src/interactive-types.d.ts
|
|
4
4
|
/** Cancellation for an interactive SDK request. */
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { S 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 { S as SandboxError, n as isTransientWrite, r as parseErrorResponse } from "./errors-dK3-2RCh.js";
|
|
2
|
+
import { c as retryBudget, i as awaitResend, n as SANDBOX_API_RETRY_SCOPE, r as abortableSleep } from "./retry-policy-CI5tyUGr.js";
|
|
3
|
+
import { i as FILE_UPLOAD_SESSION_MAX_BYTES, n as isFileTooLargeErrorBody, r as isPayloadTooLargeErrorBody } from "./file-transfer-CSL53pv9.js";
|
|
4
4
|
//#region src/lib/sdk-retry.ts
|
|
5
|
-
const countSdkRequest = () => retryBudget(SANDBOX_API_RETRY_SCOPE).sent();
|
|
6
5
|
const takeSdkTurn = (maxWaitMs) => retryBudget(SANDBOX_API_RETRY_SCOPE).take(maxWaitMs);
|
|
7
6
|
const awaitSdkResend = (resend, o) => awaitResend(SANDBOX_API_RETRY_SCOPE, resend, o);
|
|
8
7
|
//#endregion
|
|
@@ -387,4 +386,4 @@ var ChunkedUploadInterruptedError = class extends Error {
|
|
|
387
386
|
}
|
|
388
387
|
};
|
|
389
388
|
//#endregion
|
|
390
|
-
export { planCompression as a, awaitSdkResend as c, partCount as i,
|
|
389
|
+
export { planCompression as a, awaitSdkResend as c, partCount as i, takeSdkTurn as l, commitSession as n, putPart as o, initUploadSession as r, uploadChunked as s, abortSession as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as FILE_UPLOAD_SESSION_MAX_BYTES } from "./file-transfer-
|
|
2
|
-
import { a as planCompression, i as partCount, n as commitSession, o as putPart, r as initUploadSession, t as abortSession } from "./chunked-upload-
|
|
1
|
+
import { i as FILE_UPLOAD_SESSION_MAX_BYTES } from "./file-transfer-CSL53pv9.js";
|
|
2
|
+
import { a as planCompression, i as partCount, n as commitSession, o as putPart, r as initUploadSession, t as abortSession } from "./chunked-upload-BGwaw5np.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,8 +1,8 @@
|
|
|
1
|
-
import { A as TraceExportResult, H as MaterializeProfileFileMountsOptions, O as SandboxInstance, U as MaterializeProfileFileMountsResult, W as ProfileFileMountBox, j as TraceExportSink } from "./index-
|
|
2
|
-
import { $ as PublicBatchRunRequest, At as AgentProfileMcpServer, Bt as BatchEvent, Dt as AgentProfileConfidential, Ft as HarnessType, J as BatchCustody, L as SandboxError, Mt as AgentProfileSeat, Ot as AgentProfileConfigValue, Tt as AgentProfile, Y as BatchResult, c as MintInteractiveSessionTokenOptions, dt as AgentInteractiveSessionRef, et as PublicBatchRunRequestInput, jt as AgentProfileMetadata, kt as AgentProfileFileMount, nt as SandboxSizePreset, rt as AgentRuntimeAttachments, u as ScopedToken } from "./terminal-stream-types-
|
|
3
|
-
import { $ as CreateSandboxFleetOptions, $t as SandboxFleetWorkspaceRestoreResult, A as SandboxIdentity, Bt as SandboxFleetParent, Ci as IntelligenceReportWindow, Di as SandboxEvent, Dn as SandboxResources, Ei as PromptResult, En as SandboxConfig, Et as SandboxFleetCostEstimate, Ft as SandboxFleetMachineRecord, Ga as ExecResult, Gr as ManagedProcessOptions, Gt as SandboxFleetToken, Ht as SandboxFleetPolicy, It as SandboxFleetMachineSpec, Jr as ManagedProcessRecord, Kr as ManagedProcessResumeOptions, Kt as SandboxFleetTraceBundle, Lt as SandboxFleetManifest, M as UsageInfo, Ma as GpuLeaseProviderName, Nt as SandboxFleetMachine, On as SandboxShapesInfo, Ot as SandboxFleetDispatchResponse, Pi as TurnBackendConfig, Q as AttachSandboxFleetMachineOptions, Qt as SandboxFleetWorkspaceReconcileResult, Ri as ConversationTurnOptions, St as SandboxFleetAgent, T as SshKeysManager, Ti as PromptOptions, Tn as CreateSandboxOptions, Tt as SandboxFleetArtifactSpec, Wr as ManagedProcessJobs, Wt as SandboxFleetSpend, X as FleetDriveTurnRequest, Xr as HttpClient, Xt as SandboxFleetUsage, Y as FleetDriveTurnOutcome, Yn as DownloadResult, Yr as ManagedProcessSpec, Yt as SandboxFleetTraceOptions, Z as TokenRefreshHandler, Zr as SdkTimingHook, _t as ListSandboxFleetOptions, a as DeleteMatchingSandboxesResult, an as SandboxInfo, bi as IntelligenceReportBudget, bn as TeeAttestationResponse, bt as ReconcileSandboxFleetsOptions, cn as SandboxRunGeneration, ct as FleetDispatchResultBufferOptions, dt as FleetExecDispatchResult, en as SandboxFleetWorkspaceSnapshotResult, et as CreateSandboxFleetTokenOptions, fi as CreateIntelligenceReportOptions, ft as FleetMachineId, ga as BackendConfig, gt as FleetRunOptions, ht as FleetRunEvent, i as DeleteMatchingSandboxesOptions, it as FleetAgentResult, j as SubscriptionInfo, jn as SandboxShapePreset, jt as SandboxFleetInfo, kt as SandboxFleetDriverCapability, lt as FleetDispatchStreamOptions, mt as FleetPromptDispatchResult, nt as FleetAgentId, ot as FleetDispatchCancelResult, pt as FleetPromptDispatchOptions, qn as DownloadOptions, r as DeleteMatchingSandboxesFilter, si as BatchRunOptions, st as FleetDispatchResultBuffer, tn as ListSandboxOptions, tt as CreateSandboxFleetWithCoordinatorOptions, ut as FleetExecDispatchOptions, vt as ReapExpiredSandboxFleetsOptions, w as SecretsManager, wa as SecretBindingOptions, wi as PromptInputPart, wn as CreateRequestOptions, wr as SandboxEnvironment, wt as SandboxFleetArtifact, xi as IntelligenceReportCompareTo, xt as ReconcileSandboxFleetsResult, yi as IntelligenceReport, yn as TeeAttestationReport, yr as ExecOptions, yt as ReapExpiredSandboxFleetsResult, zi as ConversationTurnResult, zt as SandboxFleetOperationsSummary } from "./types-
|
|
4
|
-
import { t as LinesClient } from "./lines-
|
|
5
|
-
import { a as PublicTemplatesClient } from "./public-templates-
|
|
1
|
+
import { A as TraceExportResult, H as MaterializeProfileFileMountsOptions, O as SandboxInstance, U as MaterializeProfileFileMountsResult, W as ProfileFileMountBox, j as TraceExportSink } from "./index-CHP8U613.js";
|
|
2
|
+
import { $ as PublicBatchRunRequest, At as AgentProfileMcpServer, Bt as BatchEvent, Dt as AgentProfileConfidential, Ft as HarnessType, J as BatchCustody, L as SandboxError, Mt as AgentProfileSeat, Ot as AgentProfileConfigValue, Tt as AgentProfile, Y as BatchResult, c as MintInteractiveSessionTokenOptions, dt as AgentInteractiveSessionRef, et as PublicBatchRunRequestInput, jt as AgentProfileMetadata, kt as AgentProfileFileMount, nt as SandboxSizePreset, rt as AgentRuntimeAttachments, u as ScopedToken } from "./terminal-stream-types-NBdVKKFu.js";
|
|
3
|
+
import { $ as CreateSandboxFleetOptions, $t as SandboxFleetWorkspaceRestoreResult, A as SandboxIdentity, Bt as SandboxFleetParent, Ci as IntelligenceReportWindow, Di as SandboxEvent, Dn as SandboxResources, Ei as PromptResult, En as SandboxConfig, Et as SandboxFleetCostEstimate, Ft as SandboxFleetMachineRecord, Ga as ExecResult, Gr as ManagedProcessOptions, Gt as SandboxFleetToken, Ht as SandboxFleetPolicy, It as SandboxFleetMachineSpec, Jr as ManagedProcessRecord, Kr as ManagedProcessResumeOptions, Kt as SandboxFleetTraceBundle, Lt as SandboxFleetManifest, M as UsageInfo, Ma as GpuLeaseProviderName, Nt as SandboxFleetMachine, On as SandboxShapesInfo, Ot as SandboxFleetDispatchResponse, Pi as TurnBackendConfig, Q as AttachSandboxFleetMachineOptions, Qt as SandboxFleetWorkspaceReconcileResult, Ri as ConversationTurnOptions, St as SandboxFleetAgent, T as SshKeysManager, Ti as PromptOptions, Tn as CreateSandboxOptions, Tt as SandboxFleetArtifactSpec, Wr as ManagedProcessJobs, Wt as SandboxFleetSpend, X as FleetDriveTurnRequest, Xr as HttpClient, Xt as SandboxFleetUsage, Y as FleetDriveTurnOutcome, Yn as DownloadResult, Yr as ManagedProcessSpec, Yt as SandboxFleetTraceOptions, Z as TokenRefreshHandler, Zr as SdkTimingHook, _t as ListSandboxFleetOptions, a as DeleteMatchingSandboxesResult, an as SandboxInfo, bi as IntelligenceReportBudget, bn as TeeAttestationResponse, bt as ReconcileSandboxFleetsOptions, cn as SandboxRunGeneration, ct as FleetDispatchResultBufferOptions, dt as FleetExecDispatchResult, en as SandboxFleetWorkspaceSnapshotResult, et as CreateSandboxFleetTokenOptions, fi as CreateIntelligenceReportOptions, ft as FleetMachineId, ga as BackendConfig, gt as FleetRunOptions, ht as FleetRunEvent, i as DeleteMatchingSandboxesOptions, it as FleetAgentResult, j as SubscriptionInfo, jn as SandboxShapePreset, jt as SandboxFleetInfo, kt as SandboxFleetDriverCapability, lt as FleetDispatchStreamOptions, mt as FleetPromptDispatchResult, nt as FleetAgentId, ot as FleetDispatchCancelResult, pt as FleetPromptDispatchOptions, qn as DownloadOptions, r as DeleteMatchingSandboxesFilter, si as BatchRunOptions, st as FleetDispatchResultBuffer, tn as ListSandboxOptions, tt as CreateSandboxFleetWithCoordinatorOptions, ut as FleetExecDispatchOptions, vt as ReapExpiredSandboxFleetsOptions, w as SecretsManager, wa as SecretBindingOptions, wi as PromptInputPart, wn as CreateRequestOptions, wr as SandboxEnvironment, wt as SandboxFleetArtifact, xi as IntelligenceReportCompareTo, xt as ReconcileSandboxFleetsResult, yi as IntelligenceReport, yn as TeeAttestationReport, yr as ExecOptions, yt as ReapExpiredSandboxFleetsResult, zi as ConversationTurnResult, zt as SandboxFleetOperationsSummary } from "./types-CuMa305b.js";
|
|
4
|
+
import { t as LinesClient } from "./lines-n-mBURry.js";
|
|
5
|
+
import { a as PublicTemplatesClient } from "./public-templates-ZrUJ507X.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
|
|
8
8
|
//#region src/backend-registry.d.ts
|
|
@@ -94,7 +94,8 @@ declare class SandboxTransport {
|
|
|
94
94
|
#private;
|
|
95
95
|
protected readonly baseUrl: string;
|
|
96
96
|
protected readonly platformUrl: string | undefined;
|
|
97
|
-
|
|
97
|
+
/** This client's default deadline: `SandboxConfig.timeoutMs`, else `SDK_TIMEOUTS.default`. */
|
|
98
|
+
readonly timeoutMs: number;
|
|
98
99
|
protected readonly trustLocalCliAuth: boolean;
|
|
99
100
|
/** Receives the SDK's timing spans; see `SandboxConfig.onTiming`. */
|
|
100
101
|
readonly onTiming: SdkTimingHook | undefined;
|
|
@@ -505,7 +506,7 @@ interface FleetClientHost<TFleets> {
|
|
|
505
506
|
create(options?: CreateSandboxOptions): Promise<SandboxInstance>;
|
|
506
507
|
list(options?: ListSandboxOptions): Promise<SandboxInstance[]>;
|
|
507
508
|
get(id: string): Promise<SandboxInstance | null>;
|
|
508
|
-
fetch
|
|
509
|
+
fetch: HttpClient["fetch"];
|
|
509
510
|
/** Fetch from the Platform API (agent-profile catalog, keys) with the same key. */
|
|
510
511
|
platformFetch(path: string, options?: RequestInit): Promise<Response>;
|
|
511
512
|
/** A host with the same settings that authenticates with `apiKey`. */
|
|
@@ -1097,27 +1098,7 @@ declare function createSelectSeat<TBackend extends {
|
|
|
1097
1098
|
declare const ISOLATED_CREATION_ATTESTATION_VERSION: 1;
|
|
1098
1099
|
//#endregion
|
|
1099
1100
|
//#region src/image.d.ts
|
|
1100
|
-
/**
|
|
1101
|
-
* Image Builder for Sandbox SDK
|
|
1102
|
-
*
|
|
1103
|
-
* Provides a chainable API for building custom container images.
|
|
1104
|
-
*
|
|
1105
|
-
* @example Basic usage
|
|
1106
|
-
* ```typescript
|
|
1107
|
-
* import { Image, Sandbox } from "@tangle-network/sandbox";
|
|
1108
|
-
*
|
|
1109
|
-
* const client = new Sandbox({ apiKey: "sk_sandbox_...", baseUrl: "https://your-sandbox-api.example.com" });
|
|
1110
|
-
*
|
|
1111
|
-
* const image = await Image.create()
|
|
1112
|
-
* .python("3.11")
|
|
1113
|
-
* .addPackages(["numpy", "pandas"])
|
|
1114
|
-
* .addCommands(["apt-get update && apt-get install -y ffmpeg"])
|
|
1115
|
-
* .withSecrets(["HF_TOKEN"])
|
|
1116
|
-
* .build({ client });
|
|
1117
|
-
*
|
|
1118
|
-
* const box = await client.create({ environment: image.id });
|
|
1119
|
-
* ```
|
|
1120
|
-
*/
|
|
1101
|
+
/** Container image specs and builds, with progress read through shared SSE. */
|
|
1121
1102
|
/**
|
|
1122
1103
|
* Build result for an image.
|
|
1123
1104
|
*/
|
|
@@ -1161,7 +1142,9 @@ interface ImageBuildClientConfig {
|
|
|
1161
1142
|
apiKey: string;
|
|
1162
1143
|
}
|
|
1163
1144
|
interface ImageBuildFetchClient {
|
|
1164
|
-
fetch: (path: string, options?: RequestInit
|
|
1145
|
+
fetch: (path: string, options?: RequestInit, fetchOptions?: {
|
|
1146
|
+
timeoutMs?: number;
|
|
1147
|
+
}) => Promise<Response>;
|
|
1165
1148
|
}
|
|
1166
1149
|
type ImageBuildClient = ImageBuildClientConfig | ImageBuildFetchClient;
|
|
1167
1150
|
/**
|
|
@@ -1477,6 +1460,25 @@ declare function isToolBearingEvent(event: SandboxEvent): boolean;
|
|
|
1477
1460
|
*/
|
|
1478
1461
|
declare function collectAgentFinalMessageText(events: SandboxEvent[]): string | undefined;
|
|
1479
1462
|
//#endregion
|
|
1463
|
+
//#region src/lib/api-request.d.mts
|
|
1464
|
+
/** Default deadlines in ms; see README "Timeouts and retries" for operation mapping. */
|
|
1465
|
+
declare const SDK_TIMEOUTS: Readonly<{
|
|
1466
|
+
default: number;
|
|
1467
|
+
margin: number;
|
|
1468
|
+
create: number;
|
|
1469
|
+
gpuCreate: number;
|
|
1470
|
+
runCode: number;
|
|
1471
|
+
fleetDispatch: number;
|
|
1472
|
+
deleteMatching: number;
|
|
1473
|
+
deleteMatchingUntilRemoved: number;
|
|
1474
|
+
snapshot: number;
|
|
1475
|
+
workspaceImage: number;
|
|
1476
|
+
operationWait: number;
|
|
1477
|
+
previewReady: number;
|
|
1478
|
+
interactiveToken: number;
|
|
1479
|
+
terminalConnect: number;
|
|
1480
|
+
}>;
|
|
1481
|
+
//#endregion
|
|
1480
1482
|
//#region src/lib/file-download.d.ts
|
|
1481
1483
|
/**
|
|
1482
1484
|
* The transport a caller wires this module to. The optional `headers`
|
|
@@ -5903,6 +5905,7 @@ interface RouterSearchConfig {
|
|
|
5903
5905
|
body_template: Record<string, unknown>;
|
|
5904
5906
|
};
|
|
5905
5907
|
}
|
|
5908
|
+
/** The Router's search config. Timeout: `SDK_TIMEOUTS.default`. */
|
|
5906
5909
|
declare function fetchTangleRouterSearchConfig(options?: RouterSearchConfigOptions): Promise<RouterSearchConfig>;
|
|
5907
5910
|
declare function buildTangleRouterSearchProfile(config: RouterSearchConfig, options?: {
|
|
5908
5911
|
name?: string;
|
|
@@ -6269,6 +6272,7 @@ declare class SandboxFleet {
|
|
|
6269
6272
|
collectArtifacts(artifacts: readonly SandboxFleetArtifactSpec[]): Promise<SandboxFleetArtifact[]>;
|
|
6270
6273
|
exec(machineId: FleetMachineId, command: string, options?: ExecOptions): Promise<ExecResult>;
|
|
6271
6274
|
dispatchExec(command: string, options?: FleetExecDispatchOptions): Promise<FleetExecDispatchResult[]>;
|
|
6275
|
+
/** Timeout: the larger of `timeoutMs` and `SDK_TIMEOUTS.fleetDispatch`, plus `SDK_TIMEOUTS.margin`. */
|
|
6272
6276
|
dispatchExecDetailed(command: string, options?: FleetExecDispatchOptions): Promise<SandboxFleetDispatchResponse<FleetExecDispatchResult>>;
|
|
6273
6277
|
/**
|
|
6274
6278
|
* Run one prompt on one machine's default agent through the API's fleet
|
|
@@ -6278,6 +6282,8 @@ declare class SandboxFleet {
|
|
|
6278
6282
|
prompt(machineId: FleetMachineId, message: string | PromptInputPart[], options?: PromptOptions): Promise<PromptResult>;
|
|
6279
6283
|
dispatchPrompt(message: string | PromptInputPart[], options?: FleetPromptDispatchOptions): Promise<FleetPromptDispatchResult[]>;
|
|
6280
6284
|
dispatchPromptDetailed(message: string | PromptInputPart[], options?: FleetPromptDispatchOptions): Promise<SandboxFleetDispatchResponse<FleetPromptDispatchResult>>;
|
|
6285
|
+
/** The API runs a dispatch to its `timeoutMs` (10 min by default), and the request waits for it. */
|
|
6286
|
+
private dispatch;
|
|
6281
6287
|
/**
|
|
6282
6288
|
* Run one turn on each selected agent, all at once, and yield each agent's
|
|
6283
6289
|
* start and result as they happen. Every turn goes through the same
|
|
@@ -6523,4 +6529,4 @@ declare class Sandbox extends SandboxBatch implements HttpClient, ScopedTokenHtt
|
|
|
6523
6529
|
constructor(config: SandboxConfig);
|
|
6524
6530
|
}
|
|
6525
6531
|
//#endregion
|
|
6526
|
-
export {
|
|
6532
|
+
export { getSandboxEventText as $, Team as $t, buildTangleRouterResponsesWebSearchRequest as A, sandboxFailureKind as At, validateProfileForCreate as B, requestedPublicProfileDigest as Bt, RunTangleRouterEvalMatrixInSandboxOptions as C, HostedInstance as Ct, RouterSearchConfigOptions as D, InstanceStart as Dt, RouterSearchConfig as E, InstanceRestartingError as Et, SANDBOX_SIZE_PRESETS as F, generateAttestationNonce as Ft, ManageSandboxesToolOptions as G, BuildProgressEvent as Gt, MANAGE_SANDBOXES_TOOL_NAME as H, TeeAttestationHeartbeatOptions as Ht, resolveSandboxResources as I, BatchResultAccumulator as It, downloadFile as J, ParseSSEStreamOptions as Jt, createManageSandboxesTool as K, ImageSpec as Kt, sandboxResourcesForSize as L, createBatchResultAccumulator as Lt, buildTangleRouterSearchProfile as M, ConfidentialTeeType as Mt, fetchTangleRouterSearchConfig as N, CreateConfidentialSandboxOptions as Nt, TangleSearchProvider as O, InstancesClient as Ot, DEFAULT_SANDBOX_SIZE as P, createConfidentialSandbox as Pt, collectAgentResponseText as Q, InviteTeamMemberOptions as Qt, materializeProfileFileMounts as R, validateBatchRunRequest as Rt, RouterImportedRunResponse as S, EnsureInstanceOptions as St, runTangleRouterEvalMatrixInSandbox as T, InstanceRecord as Tt, ManageSandboxesInput as U, TeeAttestationHeartbeatSample as Ut, MANAGE_SANDBOXES_PARAMETERS as V, TeeAttestationHeartbeat as Vt, ManageSandboxesTool as W, startTeeAttestationHeartbeat as Wt, applySandboxEventText as X, parseSSEStream as Xt, SDK_TIMEOUTS as Y, ParsedSSEEvent as Yt, collectAgentFinalMessageText as Z, CreateTeamOptions as Zt, RouterEvalMatrixPayload as _, SeatSelectionError as _t, SessionBroadcastEvent as a, BackendRegistryInteractionKind as an, ImageBuildOptions as at, RouterEvalMatrixScenario as b, gatewaySeatTransport as bt, RunPlacement as c, backendRegistryEntrySchema as cn, generateDockerfile as ct, RunWaitOptions as d, isBackendRegistryInteractionKind as dn, SandboxResolvedSeat as dt, TeamInvitation as en, isToolBearingEvent as et, RunsClient as f, parseBackendRegistryResponse as fn, SandboxSeatCredentials as ft, RouterEvalMatrixHarness as g, SeatResolutionObservation as gt, RouterEvalMatrixCaseResult as h, SeatOwnerTransport as ht, terminalUpgradeHeadersSupported as i, BackendRegistryEntry as in, ImageBuildFetchClient as it, buildTangleRouterSearchBackend as j, ConfidentialSandboxResult as jt, buildTangleRouterEvalMatrixRequest as k, SandboxFailureKind as kt, RunPlacementRecord as l, backendRegistryInteractionKindSchema as ln, ISOLATED_CREATION_ATTESTATION_VERSION as lt, RouterEvalMatrixAgentProfile as m, SeatOwnerReply as mt, SandboxFleetClient as n, IntelligenceClient as nn, ImageBuildClient as nt, SessionBroadcastResult as o, BackendRegistryResponse as on, ImageBuildResult as ot, RunsHttpClient as p, parseBackendRegistryResponseBody as pn, SandboxSeatSelectionInput as pt, manageSandboxesInputSchema as q, DEFAULT_MAX_EXECUTION_TTL_MS as qt, SandboxFleet as r, BackendRegistryCapabilities as rn, ImageBuildClientConfig as rt, RunOptions as s, backendRegistryCapabilitiesSchema as sn, ImageBuilder as st, Sandbox as t, TeamMember as tn, Image as tt, RunRecord as u, backendRegistryResponseSchema as un, CreateSelectSeatOptions as ut, RouterEvalMatrixSandboxBox as v, SeatSelectionRequest as vt, RunTangleRouterEvalMatrixInSandboxResult as w, InstanceProfile as wt, RouterEvalMatrixSuiteResponse as x, ManagedProcessClient as xt, RouterEvalMatrixSandboxClient as y, createSelectSeat as yt, ProfileCreateVerdict as z, normalizeRuntimeBackendConfig as zt };
|