@tangle-network/sandbox 0.60.78-develop.20261025165214.899782a → 0.60.78-develop.20261026083210.7e89627
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 +2 -2
- 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-DdsouF9L.d.ts → agent-run-outcome-Cp8hzV98.d.ts} +1 -1
- package/dist/api-request-D8Mni27A.js +89 -0
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{browser-interactive-control-controller-DmuOTpD1.d.ts → browser-interactive-control-controller-CH7CLpmc.d.ts} +1 -1
- package/dist/{chunked-upload-D1DL0f88.js → chunked-upload-CbtLVV6-.js} +1 -1
- package/dist/{chunked-upload-file-BpfpPCsE.js → chunked-upload-file-CbbWlCFt.js} +2 -2
- package/dist/{client-D7emKV41.js → client-Dl8XOOyt.js} +53 -111
- package/dist/{client-CuRp6nJP.d.ts → client-aBXGR6bc.d.ts} +26 -6
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-Tn2ygatK.js → collaboration-Ox7K-TN6.js} +1 -1
- package/dist/{core-DnrLA0im.js → core-DgUywLjg.js} +33 -3
- package/dist/core.d.ts +7 -7
- package/dist/core.js +6 -6
- package/dist/{direct-http2-6fHIO7eF.js → direct-http2--35cHOv5.js} +24 -11
- package/dist/{errors-CfQHPcLX.js → errors-Bs5G7JdV.js} +15 -1
- package/dist/{index-0eZStBT2.d.ts → index-EebEqYqj.d.ts} +12 -7
- package/dist/index.d.ts +12 -12
- package/dist/index.js +9 -9
- package/dist/intelligence/index.js +14 -32
- package/dist/interactive-control.d.ts +1 -1
- package/dist/{interactive-controller-CIHMF8C4.d.ts → interactive-controller-Mh7Ud5DQ.d.ts} +3 -3
- package/dist/{interactive-controller-DoYo8Kq5.js → interactive-controller-ThIeP_oZ.js} +2 -2
- package/dist/lib/prepared-evidence.js +1 -1
- package/dist/lib/prepared-process.js +1 -1
- package/dist/{lines-DuELZcNj.d.ts → lines-BTIFNxRO.d.ts} +1 -1
- package/dist/{lines-BdF6b46c.js → lines-DgRXUg5y.js} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -1
- package/dist/{local-cli-auth--crCWGcG.js → local-cli-auth-fCKtTFG9.js} +1 -1
- package/dist/{mcp-local-CjcoVT7f.js → mcp-local-ClJ5TD-m.js} +1 -1
- package/dist/openai/index.js +23 -8
- package/dist/{preview-BRJcdA7Y.d.ts → preview-D6tTCcmv.d.ts} +3 -3
- package/dist/{public-templates-DsozsQ0T.d.ts → public-templates-sZe-0Qvi.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/public-templates.js +1 -1
- package/dist/{raw-evidence-archive-Dh6E0L0h.js → raw-evidence-archive-iDPF8eF_.js} +1 -1
- package/dist/response-rewrap-Bsj87BIq.js +28 -0
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +15 -23
- package/dist/{sandbox-C_DMDlO5.js → sandbox-DB-j-O2G.js} +117 -117
- package/dist/{secp256k1-_-uZfzOX.js → secp256k1-CoRKQn1k.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.d.ts +10 -12
- package/dist/session-gateway/index.js +35 -11
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-CedA3iP4.js → tangle-BO2p4BNH.js} +48 -37
- package/dist/{terminal-stream-types-BTqOP3Zi.d.ts → terminal-stream-types-yAt76vk7.d.ts} +11 -1
- package/dist/{types-0pIxzm2k.d.ts → types-DUNlmyED.d.ts} +43 -8
- package/package.json +15 -28
- /package/dist/{cli-auth-bundle-DKp1d5dJ.d.ts → cli-auth-bundle-Can3oLKY.d.ts} +0 -0
- /package/dist/{cli-auth-bundle-Ymv99-5G.js → cli-auth-bundle-yr4ZESxY.js} +0 -0
- /package/dist/{index-BMbJOPfn.d.ts → index-B8xo7y26.d.ts} +0 -0
- /package/dist/{index-DcEJnM4x.d.ts → index-mz8_2rr2.d.ts} +0 -0
- /package/dist/{keep-alive-fetch-_KZcsAS_.js → keep-alive-fetch-C92u8Kce.js} +0 -0
- /package/dist/{prepared-evidence-Bqxb-qWc.js → prepared-evidence-Di89Tatw.js} +0 -0
- /package/dist/{prepared-process-DNX-AVJ3.js → prepared-process-DuWP6Kb7.js} +0 -0
- /package/dist/{preview-operations-D5hsnCHF.js → preview-operations-BL7YCkes.js} +0 -0
- /package/dist/{utils-Bl-H3KsQ.js → utils-C86i6t3C.js} +0 -0
package/dist/openai/index.js
CHANGED
|
@@ -1109,7 +1109,10 @@ function emptyResponseUsage() {
|
|
|
1109
1109
|
input_tokens: 0,
|
|
1110
1110
|
output_tokens: 0,
|
|
1111
1111
|
total_tokens: 0,
|
|
1112
|
-
input_tokens_details: {
|
|
1112
|
+
input_tokens_details: {
|
|
1113
|
+
cached_tokens: 0,
|
|
1114
|
+
cache_write_tokens: 0
|
|
1115
|
+
},
|
|
1113
1116
|
output_tokens_details: { reasoning_tokens: 0 }
|
|
1114
1117
|
};
|
|
1115
1118
|
}
|
|
@@ -1118,7 +1121,10 @@ function usageFromTokens(usage) {
|
|
|
1118
1121
|
input_tokens: usage.prompt_tokens,
|
|
1119
1122
|
output_tokens: usage.completion_tokens,
|
|
1120
1123
|
total_tokens: usage.total_tokens,
|
|
1121
|
-
input_tokens_details: {
|
|
1124
|
+
input_tokens_details: {
|
|
1125
|
+
cached_tokens: 0,
|
|
1126
|
+
cache_write_tokens: 0
|
|
1127
|
+
},
|
|
1122
1128
|
output_tokens_details: { reasoning_tokens: 0 }
|
|
1123
1129
|
};
|
|
1124
1130
|
}
|
|
@@ -1549,7 +1555,10 @@ function emptyUsage() {
|
|
|
1549
1555
|
input_tokens: 0,
|
|
1550
1556
|
output_tokens: 0,
|
|
1551
1557
|
total_tokens: 0,
|
|
1552
|
-
input_tokens_details: {
|
|
1558
|
+
input_tokens_details: {
|
|
1559
|
+
cached_tokens: 0,
|
|
1560
|
+
cache_write_tokens: 0
|
|
1561
|
+
},
|
|
1553
1562
|
output_tokens_details: { reasoning_tokens: 0 }
|
|
1554
1563
|
};
|
|
1555
1564
|
}
|
|
@@ -1559,14 +1568,16 @@ function readUsageFromEvent(event) {
|
|
|
1559
1568
|
const output = Number(u.output_tokens ?? u.completion_tokens ?? u.outputTokens ?? 0);
|
|
1560
1569
|
if (input === 0 && output === 0 && !("total_tokens" in u)) return null;
|
|
1561
1570
|
const total = Number(u.total_tokens ?? input + output);
|
|
1562
|
-
const
|
|
1563
|
-
const reasoning = Number(u.output_tokens_details?.reasoning_tokens ?? u.reasoning_tokens ?? 0);
|
|
1571
|
+
const detail = (group, key) => Number(u[group]?.[key] ?? u[key] ?? 0);
|
|
1564
1572
|
return {
|
|
1565
1573
|
input_tokens: input,
|
|
1566
1574
|
output_tokens: output,
|
|
1567
1575
|
total_tokens: total,
|
|
1568
|
-
input_tokens_details: {
|
|
1569
|
-
|
|
1576
|
+
input_tokens_details: {
|
|
1577
|
+
cached_tokens: detail("input_tokens_details", "cached_tokens"),
|
|
1578
|
+
cache_write_tokens: detail("input_tokens_details", "cache_write_tokens")
|
|
1579
|
+
},
|
|
1580
|
+
output_tokens_details: { reasoning_tokens: detail("output_tokens_details", "reasoning_tokens") }
|
|
1570
1581
|
};
|
|
1571
1582
|
}
|
|
1572
1583
|
function readToolInvocationFromRaw(event) {
|
|
@@ -1695,11 +1706,15 @@ function assembleResponseOutput(events) {
|
|
|
1695
1706
|
};
|
|
1696
1707
|
}
|
|
1697
1708
|
function foldUsage(a, b) {
|
|
1709
|
+
const input = (k) => a.input_tokens_details[k] + b.input_tokens_details[k];
|
|
1698
1710
|
return {
|
|
1699
1711
|
input_tokens: a.input_tokens + b.input_tokens,
|
|
1700
1712
|
output_tokens: a.output_tokens + b.output_tokens,
|
|
1701
1713
|
total_tokens: a.total_tokens + b.total_tokens,
|
|
1702
|
-
input_tokens_details: {
|
|
1714
|
+
input_tokens_details: {
|
|
1715
|
+
cached_tokens: input("cached_tokens"),
|
|
1716
|
+
cache_write_tokens: input("cache_write_tokens")
|
|
1717
|
+
},
|
|
1703
1718
|
output_tokens_details: { reasoning_tokens: a.output_tokens_details.reasoning_tokens + b.output_tokens_details.reasoning_tokens }
|
|
1704
1719
|
};
|
|
1705
1720
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { O as SandboxInstance } from "./index-
|
|
2
|
-
import { F as EnsureDevServerOptions, H as PreviewLinkInfo } from "./types-
|
|
3
|
-
import { t as Sandbox } from "./client-
|
|
1
|
+
import { O as SandboxInstance } from "./index-EebEqYqj.js";
|
|
2
|
+
import { F as EnsureDevServerOptions, H as PreviewLinkInfo } from "./types-DUNlmyED.js";
|
|
3
|
+
import { t as Sandbox } from "./client-aBXGR6bc.js";
|
|
4
4
|
|
|
5
5
|
//#region src/agent/preview-operations.d.ts
|
|
6
6
|
type AgentPreviewOptions = Pick<EnsureDevServerOptions, "sessionId" | "cwd"> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Pi as HttpClient, ai as PublishPublicTemplateVersionOptions, ii as PublishPublicTemplateOptions, ni as PublicTemplateInfo, ri as PublicTemplateVersionInfo } from "./types-
|
|
1
|
+
import { I as SandboxError } from "./terminal-stream-types-yAt76vk7.js";
|
|
2
|
+
import { Pi as HttpClient, ai as PublishPublicTemplateVersionOptions, ii as PublishPublicTemplateOptions, ni as PublicTemplateInfo, ri as PublicTemplateVersionInfo } from "./types-DUNlmyED.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/public-templates.d.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-
|
|
1
|
+
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-sZe-0Qvi.js";
|
|
2
2
|
export { PublicTemplatePublishArtifact, PublicTemplatePublishError, PublicTemplatePublishJob, PublicTemplatePublishRequestOptions, PublicTemplatesClient };
|
package/dist/public-templates.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as runPreparedEvidence } from "./prepared-evidence-
|
|
1
|
+
import { t as runPreparedEvidence } from "./prepared-evidence-Di89Tatw.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/lib/raw-evidence-archive.ts
|
|
4
4
|
const digest = z.string().regex(/^sha256:[a-f0-9]{64}$/).transform((value) => `sha256:${value.slice(7)}`);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/lib/response-rewrap.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Response wrappers that must outlive the fetch Response they wrap.
|
|
4
|
+
*
|
|
5
|
+
* Node's fetch (undici) cancels a response body when the Response object that
|
|
6
|
+
* fetch returned is garbage collected while its body is still unread. A
|
|
7
|
+
* wrapper built with `new Response(original.body, …)` shares that body stream
|
|
8
|
+
* but not that lifetime: once the original is collected, the wrapper's body is
|
|
9
|
+
* already cancelled and every read throws `TypeError: Body is unusable: Body
|
|
10
|
+
* has already been read`. It depends on when the collector runs, so it shows
|
|
11
|
+
* up as a rare failure on any call whose body is read after a longer await.
|
|
12
|
+
*
|
|
13
|
+
* The map holds each original for as long as its wrapper is reachable, so the
|
|
14
|
+
* body stays readable. When both are unreachable, undici's own cleanup runs.
|
|
15
|
+
*/
|
|
16
|
+
const originals = /* @__PURE__ */ new WeakMap();
|
|
17
|
+
/** A Response retaining `original`'s lifetime, with optional body decoration. */
|
|
18
|
+
function rewrapResponse(original, headers, body = original.body) {
|
|
19
|
+
const wrapper = new Response(body, {
|
|
20
|
+
status: original.status,
|
|
21
|
+
statusText: original.statusText,
|
|
22
|
+
headers
|
|
23
|
+
});
|
|
24
|
+
originals.set(wrapper, original);
|
|
25
|
+
return wrapper;
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { rewrapResponse as t };
|
package/dist/runtime.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { Bn as SandboxPortBinding, Br as FileTreeResult, Ct as SessionMessageAdmission, Dt as TaskSessionCommitResult, Er as ChunkedUploadResult, Et as TaskSessionChanges, Gn as SandboxTerminalCreateOptions, Hr as FileUsageResult, Ir as FileRenameResult, Jn as SandboxTerminalRequestOptions, Jr as UploadProgress, Kn as SandboxTerminalInfo, Kr as RenameOptions, Mr as FileReadBatchOptions, Nr as FileReadBatchResult, Q as CommitTaskSessionOptions, St as SessionMessage, Tr as ChunkedUploadOptions, Un as SandboxRuntimeHealth, Ur as FileWriteResult, Vr as FileUsageOptions, Yr as WriteFileOptions, ct as ListMessagesOptions, dt as SendSessionMessageRequest, fa as SandboxEvent, ft as SentSessionMessage, gt as SessionExecutionStatus, ht as SessionExecutionInfo, it as CreateTaskSessionOptions, kt as TaskSessionInfo, mt as SessionEventStreamOptions, qn as SandboxTerminalManager, rr as TerminalStream, rt as CreateSessionOptions, ut as SendSessionMessageOptions, yt as SessionInfo, zr as FileTreeOptions } from "./types-
|
|
3
|
-
import { c as InteractiveSessionIdentity, l as InteractiveSessionNotRunningError, r as browserInteractiveControlHolderId } from "./browser-interactive-control-controller-
|
|
4
|
-
import { t as BrowserInteractiveSessionController } from "./interactive-controller-
|
|
5
|
-
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, o as projectAgentTerminalRecord, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-
|
|
1
|
+
import { A as NetworkError, B as StateError, E as FileWriteConflictError, I as SandboxError, L as SandboxErrorJson, M as PartialFailureError, N as ProfileFileMountPathError, P as QuotaError, R as SandboxFailureDetail, S as CapabilityError, U as TimeoutError, W as ValidationError, b as AuthError, j as NotFoundError, u as ScopedToken, z as ServerError } from "./terminal-stream-types-yAt76vk7.js";
|
|
2
|
+
import { Bn as SandboxPortBinding, Br as FileTreeResult, Ct as SessionMessageAdmission, Dt as TaskSessionCommitResult, Er as ChunkedUploadResult, Et as TaskSessionChanges, Gn as SandboxTerminalCreateOptions, Hr as FileUsageResult, Ir as FileRenameResult, Jn as SandboxTerminalRequestOptions, Jr as UploadProgress, Kn as SandboxTerminalInfo, Kr as RenameOptions, Mr as FileReadBatchOptions, Nr as FileReadBatchResult, Q as CommitTaskSessionOptions, St as SessionMessage, Tr as ChunkedUploadOptions, Un as SandboxRuntimeHealth, Ur as FileWriteResult, Vr as FileUsageOptions, Yr as WriteFileOptions, ct as ListMessagesOptions, dt as SendSessionMessageRequest, fa as SandboxEvent, ft as SentSessionMessage, gt as SessionExecutionStatus, ht as SessionExecutionInfo, it as CreateTaskSessionOptions, kt as TaskSessionInfo, mt as SessionEventStreamOptions, qn as SandboxTerminalManager, rr as TerminalStream, rt as CreateSessionOptions, ut as SendSessionMessageOptions, yt as SessionInfo, zr as FileTreeOptions } from "./types-DUNlmyED.js";
|
|
3
|
+
import { c as InteractiveSessionIdentity, l as InteractiveSessionNotRunningError, r as browserInteractiveControlHolderId } from "./browser-interactive-control-controller-CH7CLpmc.js";
|
|
4
|
+
import { t as BrowserInteractiveSessionController } from "./interactive-controller-Mh7Ud5DQ.js";
|
|
5
|
+
import { a as deriveAgentRunOutcome, i as deriveAgentResultOutcome, n as AgentRunOutcomeTracker, o as projectAgentTerminalRecord, r as createAgentRunOutcomeTracker, t as AgentRunOutcome } from "./agent-run-outcome-Cp8hzV98.js";
|
|
6
6
|
|
|
7
7
|
//#region src/lib/chunked-upload.d.ts
|
|
8
8
|
/** The transport a caller wires this module to — {@link SandboxInstance.runtimeFetch}
|
package/dist/runtime.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, R as deriveAgentRunOutcome, c as SandboxRuntimeApi, t as BrowserInteractiveSessionController, z as projectAgentTerminalRecord } from "./interactive-controller-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, R as deriveAgentRunOutcome, c as SandboxRuntimeApi, t as BrowserInteractiveSessionController, z as projectAgentTerminalRecord } from "./interactive-controller-ThIeP_oZ.js";
|
|
2
|
+
import { C as StateError, E as ValidationError, S as ServerError, T as TimeoutError, _ as PartialFailureError, a as AuthError, d as FileWriteConflictError, g as NotFoundError, h as NetworkError, s as CapabilityError, v as ProfileFileMountPathError, x as SandboxError, y as QuotaError } from "./errors-Bs5G7JdV.js";
|
|
3
|
+
import { n as browserInteractiveControlHolderId, s as InteractiveSessionNotRunningError } from "./browser-interactive-control-controller-k1KkqDGF.js";
|
|
4
|
+
import { t as fetchSandboxApi } from "./api-request-D8Mni27A.js";
|
|
5
|
+
import { s as uploadChunked } from "./chunked-upload-CbtLVV6-.js";
|
|
5
6
|
//#region src/runtime-client.ts
|
|
6
7
|
const DEFAULT_RUNTIME_TIMEOUT_MS = 3e4;
|
|
7
8
|
function requireToken(token) {
|
|
@@ -46,29 +47,20 @@ var SandboxRuntimeClient = class extends SandboxRuntimeApi {
|
|
|
46
47
|
ensureRunning: async () => void 0,
|
|
47
48
|
fetch: async (path, init = {}) => {
|
|
48
49
|
if (!path.startsWith("/") || path.startsWith("//")) throw new ValidationError("Scoped runtime request paths must start with one slash");
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
try {
|
|
56
|
-
return await fetchImpl(`${baseUrl}${path}`, {
|
|
57
|
-
...init,
|
|
58
|
-
headers,
|
|
59
|
-
signal
|
|
60
|
-
});
|
|
61
|
-
} catch (error) {
|
|
62
|
-
if (timeoutSignal.aborted && !init.signal?.aborted) throw new TimeoutError(timeoutMs, void 0, {
|
|
50
|
+
return fetchSandboxApi({
|
|
51
|
+
baseUrl,
|
|
52
|
+
apiKey: auth.token,
|
|
53
|
+
timeoutMs,
|
|
54
|
+
fetchImpl,
|
|
55
|
+
timeoutError: (ms) => new TimeoutError(ms, void 0, {
|
|
63
56
|
origin: "runtime",
|
|
64
57
|
endpoint: path
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
throw new NetworkError(`Scoped runtime request failed: ${path}`, error instanceof Error ? error : new Error(String(error)), {
|
|
58
|
+
}),
|
|
59
|
+
networkError: (error) => new NetworkError(`Scoped runtime request failed: ${path}`, error instanceof Error ? error : new Error(String(error)), {
|
|
68
60
|
origin: "runtime",
|
|
69
61
|
endpoint: path
|
|
70
|
-
})
|
|
71
|
-
}
|
|
62
|
+
})
|
|
63
|
+
}, path, init, { bodyDeadline: false });
|
|
72
64
|
}
|
|
73
65
|
});
|
|
74
66
|
this.#auth = auth;
|