@tangle-network/sandbox 1.0.208 → 1.0.210

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.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/dist/abort-signal-BbJTt2QJ.js +31 -0
  3. package/dist/agent/index.d.ts +4 -4
  4. package/dist/agent/index.js +4 -4
  5. package/dist/agent/preview.d.ts +1 -1
  6. package/dist/agent/preview.js +1 -1
  7. package/dist/{agent-run-outcome-1NHcTtoo.d.ts → agent-run-outcome-CP2N40aT.d.ts} +1 -1
  8. package/dist/api-request-CUIrVFhJ.js +173 -0
  9. package/dist/{browser-interactive-control-controller-BYbNLahH.js → browser-interactive-control-controller-BiP6TJFP.js} +1 -1
  10. package/dist/{chunked-upload-BTdDxWFj.js → chunked-upload-D6ZCQ-iN.js} +15 -11
  11. package/dist/{chunked-upload-file-5GlXGjhY.js → chunked-upload-file-D3YxQdAl.js} +2 -2
  12. package/dist/{client-Bp3Gqf0e.d.ts → client-DiLd0XGB.d.ts} +4 -4
  13. package/dist/{client-DN4Ug-ub.js → client-DyKdtYDZ.js} +24 -29
  14. package/dist/{core-7rGEb0lF.js → core-DDgUWBS7.js} +2 -2
  15. package/dist/core.d.ts +5 -5
  16. package/dist/core.js +3 -3
  17. package/dist/{direct-http2-Bqtn2jg3.js → direct-http2-DU2SK2Wo.js} +1 -1
  18. package/dist/{index-BVEpMspL.d.ts → index-DyFU9hy7.d.ts} +5 -6
  19. package/dist/index.d.ts +7 -7
  20. package/dist/index.js +7 -7
  21. package/dist/intelligence/index.js +1 -1
  22. package/dist/interactive-control.js +1 -1
  23. package/dist/{interactive-controller-DuyS5n9z.d.ts → interactive-controller-BzObb8aT.d.ts} +1 -1
  24. package/dist/{interactive-controller-B09YfFqP.js → interactive-controller-C-CuPVMA.js} +8 -6
  25. package/dist/lib/prepared-evidence.js +1 -1
  26. package/dist/lib/prepared-process.js +1 -1
  27. package/dist/{lines-DGke3URt.d.ts → lines-D0dHQ3X5.d.ts} +1 -1
  28. package/dist/lines.d.ts +1 -1
  29. package/dist/{mcp-local-BHCdMtdh.js → mcp-local-BW6W0Vh8.js} +3 -3
  30. package/dist/{prepared-evidence-4prvV0YK.js → prepared-evidence--rjwnXGD.js} +2 -12
  31. package/dist/{prepared-process-BSpZXDDw.js → prepared-process-N-y0xr9S.js} +2 -14
  32. package/dist/{preview-Din4zRB-.d.ts → preview-CrXG9Y8a.d.ts} +3 -3
  33. package/dist/{public-templates-k5rHh7Up.d.ts → public-templates-Ba-DTf2O.d.ts} +1 -1
  34. package/dist/public-templates.d.ts +1 -1
  35. package/dist/{raw-evidence-archive-C5H8BaHr.js → raw-evidence-archive-DrgeV9_0.js} +1 -1
  36. package/dist/retry-policy-0_NCh5OB.js +88 -0
  37. package/dist/runtime.d.ts +3 -3
  38. package/dist/runtime.js +4 -4
  39. package/dist/{sandbox-BQ_u_Fjy.js → sandbox-DRZ1nTd3.js} +123 -156
  40. package/dist/select-seat-command.d.ts +1 -1
  41. package/dist/session-gateway/index.js +3 -3
  42. package/dist/tangle/index.d.ts +1 -1
  43. package/dist/tangle/index.js +1 -1
  44. package/dist/{tangle-B-Sv_5XW.js → tangle-BPDYjDpX.js} +1 -1
  45. package/dist/{types-BVcWpKvF.d.ts → types-BE70nj5h.d.ts} +2 -2
  46. package/package.json +5 -5
  47. package/dist/abort-signal-Cu4F2VVz.js +0 -62
  48. package/dist/api-request-BBNFh7Zx.js +0 -92
  49. package/dist/response-rewrap-Cjoxh2wZ.js +0 -28
  50. /package/dist/{file-transfer-Cr9Ossea.js → file-transfer-BSe4ayU9.js} +0 -0
  51. /package/dist/{keep-alive-fetch-C2lFwrMA.js → keep-alive-fetch-BIaDMUtu.js} +0 -0
  52. /package/dist/{sidecar-proxy-error-DTJbOAWL.js → sidecar-proxy-error-DpBLxIof.js} +0 -0
  53. /package/dist/{sse-parser-DXRUx6gh.js → sse-parser-DOCszo1K.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { M as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-BQ_u_Fjy.js";
1
+ import { M as readFilesystemIncarnationTuple, n as createSandboxInstanceFromResponse } from "./sandbox-DRZ1nTd3.js";
2
2
  import { a as readResponseJson } from "./errors-CNszZUZ2.js";
3
3
  import { _ as rotlBH, a as anumber, b as rotlSL, d as createXOFer, g as u32, h as toBytes$1, l as createHasher, m as swap32IfBE, n as abytes, o as aoutput, r as aexists, s as clean, t as Hash, v as rotlBL, x as split, y as rotlSH } from "./utils-CK-x8vXj.js";
4
4
  //#region ../../../packages/runtime-contracts/dist/tangle-blueprint-abi.js
@@ -4453,7 +4453,7 @@ interface ChunkedUploadOptions {
4453
4453
  * carrying the uploadId, instead of deleting the session. Default false
4454
4454
  * (a failed upload cleans up after itself). */
4455
4455
  keepSessionOnFailure?: boolean;
4456
- /** Max retries per part on a transient error before failing loud. Default 4. */
4456
+ /** Max retries per part on a transient error before failing loud. Default 6. */
4457
4457
  maxRetries?: number;
4458
4458
  }
4459
4459
  /**
@@ -4649,7 +4649,7 @@ interface WriteFileOptions {
4649
4649
  interface WriteManyOptions {
4650
4650
  /** Delay between batch requests or sequential writes. Default 0. */
4651
4651
  paceMs?: number;
4652
- /** Max retries per sequential write on a transient error. Default 4. */
4652
+ /** Max retries per sequential write on a transient error. Default 6. */
4653
4653
  maxRetries?: number;
4654
4654
  }
4655
4655
  interface FileSystem {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/sandbox",
3
- "version": "1.0.208",
3
+ "version": "1.0.210",
4
4
  "description": "Client SDK for the Tangle Sandbox platform - build AI agent applications with dev containers",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -153,15 +153,15 @@
153
153
  "vitest": "^4.1.12",
154
154
  "ws": "^8.22.0",
155
155
  "yjs": "13.6.33",
156
- "@products/sandbox-test-utils": "0.0.0",
157
- "@tangle-network/agent-profile-materialize": "0.27.1",
158
156
  "@repo/shared": "0.0.0",
157
+ "@tangle-network/agent-profile-materialize": "0.27.1",
159
158
  "@tangle-network/cli-agent-registry": "0.15.0",
159
+ "@products/sandbox-test-utils": "0.0.0",
160
160
  "@tangle-network/runtime-contracts": "0.20.0"
161
161
  },
162
162
  "tangleRelease": {
163
- "sourceSha": "3d38743f5d5aca37aab92580cc4c84ef59806159",
164
- "mergedAt": "2026-11-03T23:31:31-08:00"
163
+ "sourceSha": "60679bcbdb68a85898eb11b0aff6d7a420748c8c",
164
+ "mergedAt": "2026-11-04T00:46:00-08:00"
165
165
  },
166
166
  "scripts": {
167
167
  "build": "node scripts/build-dist.mjs",
@@ -1,62 +0,0 @@
1
- //#region src/lib/abort-signal.ts
2
- function combineAbortSignals(signals) {
3
- return AbortSignal.any(signals);
4
- }
5
- /** Resolve after `ms`; reject with the signal's reason the moment it aborts. */
6
- function abortableSleep(ms, signal) {
7
- if (signal?.aborted) return Promise.reject(signal.reason);
8
- if (ms <= 0) return Promise.resolve();
9
- return new Promise((resolve, reject) => {
10
- const timer = setTimeout(() => {
11
- signal?.removeEventListener("abort", onAbort);
12
- resolve();
13
- }, ms);
14
- const onAbort = () => {
15
- clearTimeout(timer);
16
- reject(signal?.reason);
17
- };
18
- signal?.addEventListener("abort", onAbort, { once: true });
19
- });
20
- }
21
- function awaitWithAbort(work, signal) {
22
- if (!signal) return work;
23
- signal.throwIfAborted();
24
- return new Promise((resolve, reject) => {
25
- let settled = false;
26
- const onAbort = () => {
27
- if (settled) return;
28
- settled = true;
29
- signal.removeEventListener("abort", onAbort);
30
- reject(signal.reason ?? new DOMException("The request was aborted", "AbortError"));
31
- };
32
- signal.addEventListener("abort", onAbort, { once: true });
33
- work.then((value) => {
34
- if (settled) return;
35
- settled = true;
36
- signal.removeEventListener("abort", onAbort);
37
- resolve(value);
38
- }, (cause) => {
39
- if (settled) return;
40
- settled = true;
41
- signal.removeEventListener("abort", onAbort);
42
- reject(cause);
43
- });
44
- });
45
- }
46
- const delayUntilAborted = (ms, signal) => new Promise((resolve, reject) => {
47
- if (signal?.aborted) {
48
- reject(signal.reason ?? /* @__PURE__ */ new Error("aborted"));
49
- return;
50
- }
51
- const timer = setTimeout(() => {
52
- signal?.removeEventListener("abort", onAbort);
53
- resolve();
54
- }, ms);
55
- function onAbort() {
56
- clearTimeout(timer);
57
- reject(signal?.reason ?? /* @__PURE__ */ new Error("aborted"));
58
- }
59
- signal?.addEventListener("abort", onAbort, { once: true });
60
- });
61
- //#endregion
62
- export { delayUntilAborted as i, awaitWithAbort as n, combineAbortSignals as r, abortableSleep as t };
@@ -1,92 +0,0 @@
1
- import { t as rewrapResponse } from "./response-rewrap-Cjoxh2wZ.js";
2
- //#region src/lib/api-request.mjs
3
- /** The package version tsdown.config.ts defines; unbuilt source reports 0.0.0. */
4
- const SDK_VERSION = "1.0.208";
5
- function withRequestContextHeaders(response, path, method, body = response.body) {
6
- const headers = new Headers(response.headers);
7
- headers.set("x-tangle-request-path", path);
8
- if (method) headers.set("x-tangle-request-method", method);
9
- return rewrapResponse(response, headers, body);
10
- }
11
- /** The SDK's authenticated raw transport, also shipped with standalone probes. */
12
- async function fetchSandboxApi({ baseUrl, apiKey, timeoutMs = 3e4, signal, fetchImpl = fetch, networkError = (error) => error, timeoutError = () => new DOMException("The operation was aborted due to timeout", "TimeoutError") }, path, options, fetchOptions) {
13
- const url = `${baseUrl.replace(/\/+$/, "")}${path}`;
14
- const requestTimeoutMs = typeof fetchOptions?.timeoutMs === "number" && fetchOptions.timeoutMs > 0 ? fetchOptions.timeoutMs : timeoutMs;
15
- const controller = new AbortController();
16
- const timeoutId = setTimeout(() => controller.abort(), requestTimeoutMs);
17
- timeoutId.unref?.();
18
- const requestSignal = AbortSignal.any([
19
- controller.signal,
20
- ...options?.signal ? [options.signal] : [],
21
- ...signal ? [signal] : []
22
- ]);
23
- let bodyOwnsTimeout = false;
24
- let reading = false;
25
- const failure = (error, network = false) => {
26
- if (!requestSignal.aborted) return network ? networkError(error) : error;
27
- return requestSignal.reason === controller.signal.reason ? timeoutError(requestTimeoutMs) : requestSignal.reason ?? error;
28
- };
29
- try {
30
- const headers = new Headers(options?.headers);
31
- headers.set("Authorization", `Bearer ${apiKey}`);
32
- headers.set("x-sdk-version", SDK_VERSION);
33
- const isFormDataBody = typeof FormData !== "undefined" && options?.body instanceof FormData;
34
- if (!headers.has("Content-Type") && !isFormDataBody) headers.set("Content-Type", "application/json");
35
- const response = await fetchImpl(url, {
36
- ...options,
37
- headers,
38
- signal: requestSignal
39
- });
40
- if (fetchOptions?.read) {
41
- reading = true;
42
- return await fetchOptions.read(withRequestContextHeaders(response, path, options?.method));
43
- }
44
- const mediaType = response.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase();
45
- if (fetchOptions?.bodyDeadline !== false && response.body !== null && (!response.ok || mediaType === "application/json" || mediaType?.endsWith("+json") === true)) {
46
- const reader = response.body.getReader();
47
- let settled = false;
48
- const body = new ReadableStream({
49
- type: "bytes",
50
- async pull(stream) {
51
- try {
52
- const chunk = await reader.read();
53
- if (settled) return;
54
- if (chunk.done) {
55
- settled = true;
56
- clearTimeout(timeoutId);
57
- reader.releaseLock();
58
- stream.close();
59
- stream.byobRequest?.respond(0);
60
- } else stream.enqueue(chunk.value);
61
- } catch (error) {
62
- if (settled) return;
63
- settled = true;
64
- clearTimeout(timeoutId);
65
- reader.releaseLock();
66
- stream.error(failure(error));
67
- }
68
- },
69
- async cancel(reason) {
70
- if (settled) return;
71
- settled = true;
72
- clearTimeout(timeoutId);
73
- try {
74
- await reader.cancel(reason);
75
- } finally {
76
- reader.releaseLock();
77
- }
78
- }
79
- });
80
- const wrapped = withRequestContextHeaders(response, path, options?.method, body);
81
- bodyOwnsTimeout = true;
82
- return wrapped;
83
- }
84
- return withRequestContextHeaders(response, path, options?.method);
85
- } catch (err) {
86
- throw failure(err, !reading);
87
- } finally {
88
- if (!bodyOwnsTimeout) clearTimeout(timeoutId);
89
- }
90
- }
91
- //#endregion
92
- export { fetchSandboxApi as n, SDK_VERSION as t };
@@ -1,28 +0,0 @@
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 };