@tangle-network/sandbox 1.0.236 → 1.0.238
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/index.d.ts +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-execution-preparation-BJChICex.js → agent-execution-preparation-CjKTjmJ9.js} +3 -3
- package/dist/{agent-execution-preparation-receipt-BIFxqyr5.js → agent-execution-preparation-receipt-AihkqLnd.js} +4 -4
- package/dist/{agent-run-outcome-CEf6hJYp.d.ts → agent-run-outcome-DrhA0Z4S.d.ts} +2 -2
- package/dist/{api-request-DXF7sotx.js → api-request-wjUrfDvm.js} +1 -1
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +2 -2
- package/dist/{browser-interactive-control-controller-CcUjQEfa.d.ts → browser-interactive-control-controller-9RauUsHw.d.ts} +1 -1
- package/dist/{browser-interactive-control-controller-DL5Cz1_6.js → browser-interactive-control-controller-BDVXcCnz.js} +14 -14
- package/dist/{chunked-upload-BlvgxPWx.js → chunked-upload-B1kuuezC.js} +1 -1
- package/dist/{chunked-upload-file-DOeLpMO0.js → chunked-upload-file-DtAW52iW.js} +1 -1
- package/dist/cli-auth-bundle-BinY89CX.js +2 -0
- package/dist/{cli-auth-bundle-C6DtK7GX-mBUPER0R.js → cli-auth-bundle-C6DtK7GX-DoqlFTT-.js} +1 -1
- package/dist/{client-OYkwBKG2.d.ts → client-DsXWyLrM.d.ts} +79 -114
- package/dist/{client-BiKIhMtW.js → client-eoEoMzDD.js} +20 -117
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-CpKTrw6R.js → collaboration-jvzPekSe.js} +2 -2
- package/dist/core.d.ts +7 -7
- package/dist/core.js +6 -6
- package/dist/{errors-nXGKGVFe.js → errors-DQEu-Q7s.js} +20 -21
- package/dist/{file-download-BjkrYzy_.js → file-download-CihyMYH-.js} +2 -2
- package/dist/{harness-DMaNgn0S.js → harness-C5lXV9e5.js} +5 -5
- package/dist/{index-C8YpXh5N.d.ts → index-B_1aVs2B.d.ts} +14 -88
- package/dist/index.d.ts +13 -12
- package/dist/index.js +13 -13
- package/dist/intelligence/index.d.ts +13 -6
- package/dist/intelligence/index.js +61 -9
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-CJ7BBRpv.d.ts → interactive-controller-C2vOFe0u.d.ts} +3 -3
- package/dist/{interactive-controller-Blf5CLeI.js → interactive-controller-CDqa41yU.js} +7 -7
- package/dist/{lines-CSGBHEjR.js → lines-Bsp1TFBM.js} +1 -1
- package/dist/{lines-CCJZUrBP.d.ts → lines-CxWFuuJ3.d.ts} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -1
- package/dist/{local-cli-auth-CO0byocv.js → local-cli-auth-DrNihS9-.js} +1 -1
- package/dist/{mcp-local-oIc-ZtHF.js → mcp-local-CbzPG05W.js} +2 -2
- package/dist/{preview-zpWYtsDJ.d.ts → preview-DFFaAZdF.d.ts} +3 -3
- package/dist/{profile-schema-C1KpT-wS.js → profile-schema-C0n0VgmA.js} +468 -36
- package/dist/{public-templates-DCFFPDEB.d.ts → public-templates-xqtPv6pg.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/public-templates.js +1 -1
- package/dist/{raw-evidence-archive-Cz4j8VMw.js → raw-evidence-archive-DLNEUdij.js} +3 -15
- package/dist/raw-evidence-export-C0ieFpi2.d.ts +354 -0
- package/dist/raw-evidence-export-C6Xdl3nC.js +19 -0
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +5 -5
- package/dist/{sandbox-C1Ffpg9v.js → sandbox-nYoBbiu1.js} +116 -155
- package/dist/{select-seat-B4Y-7vIq.js → select-seat-BHHUFoKh.js} +5 -5
- package/dist/select-seat-command.d.ts +2 -2
- package/dist/select-seat-command.js +2 -2
- package/dist/session-gateway/index.js +1 -1
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-CL6wrVuO.js → tangle-BaGQdAZk.js} +3 -3
- package/dist/{terminal-stream-types-eE97lZ-5.d.ts → terminal-stream-types-D7dMd-NV.d.ts} +40 -26
- package/dist/{types-B5GAxo6l.d.ts → types-ImZuAuFG.d.ts} +299 -1521
- package/package.json +7 -7
- package/dist/cli-auth-bundle-BLAtE6Dc.js +0 -2
- /package/dist/{cli-auth-bundle-B91fSxkR.d.ts → cli-auth-bundle-eUl7Sa1x.d.ts} +0 -0
- /package/dist/{direct-http2-Bgb2lHte.js → direct-http2-zLxsvF44.js} +0 -0
- /package/dist/{index-o31uwAkX.d.ts → index-BTXyTVq4.d.ts} +0 -0
- /package/dist/{index-C-_HY5NY.d.ts → index-ClusTWYM.d.ts} +0 -0
- /package/dist/{sha2-vu4U-x2L.js → sha2-BIoWepwn.js} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { D as assertCurrentBackendType, E as applyRequestedModel, M as withProfileHarness, N as withoutCreateOnlyModelFields, T as isBrowserRuntime, V as backendTypeSchema, k as normalizeRuntimeBackendConfig, o as requestInteractiveSessionToken, x as encodePromptForWire } from "./interactive-controller-
|
|
2
|
-
import { r as agentProfileSchema } from "./profile-schema-
|
|
3
|
-
import { $ as
|
|
4
|
-
import { C as
|
|
1
|
+
import { D as assertCurrentBackendType, E as applyRequestedModel, M as withProfileHarness, N as withoutCreateOnlyModelFields, T as isBrowserRuntime, V as backendTypeSchema, k as normalizeRuntimeBackendConfig, o as requestInteractiveSessionToken, x as encodePromptForWire } from "./interactive-controller-CDqa41yU.js";
|
|
2
|
+
import { r as agentProfileSchema } from "./profile-schema-C0n0VgmA.js";
|
|
3
|
+
import { $ as isDeployWindowCreateError, B as parseLifecycleTimes, D as splitInlineProfileSkills, E as splitInlineProfileFileMounts, F as normalizeCaptureProof, G as CAPACITY_ETA_MARGIN_MS, H as normalizeEgressPolicyFields, I as normalizeSandboxCreateReceipt, J as awaitCreateResend, K as CAPACITY_ETA_WAIT_MAX_MS, L as normalizeStartupDiagnostics, O as validateDeferredProfileFileMounts, Q as isCapacityShortageCreateError, U as normalizeProxySecretReceipt, V as normalizeConnection, W as normalizeSandboxShape, X as extendableDeadline, Y as createRetryDelayMs, Z as generateIdempotencyKey, d as sandboxLedgerUsd, et as isRateLimitCreateError, k as isRetryableProfileFileMaterializeFailure, n as createSandboxInstanceFromResponse, o as exportTraceBundle, q as DEPLOY_WINDOW_RETRY_MS, tt as isRetryableCreateError, x as deleteSandbox, z as dateOf } from "./sandbox-nYoBbiu1.js";
|
|
4
|
+
import { C as SandboxError, D as TimeoutError, O as ValidationError, _ as NetworkError, a as readResponseJson, c as AuthError, i as parseResponseError, r as parseErrorResponse, v as NotFoundError, w as ServerError, y as PartialFailureError } from "./errors-DQEu-Q7s.js";
|
|
5
5
|
import { n as combineAbortSignals } from "./abort-signal-CRxC2dlT.js";
|
|
6
6
|
import { r as abortableSleep, t as RETRY_POLICY } from "./retry-policy-oW3_ljoc.js";
|
|
7
|
-
import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-
|
|
7
|
+
import { i as fetchSandboxApi, n as SDK_TIMEOUTS } from "./api-request-wjUrfDvm.js";
|
|
8
8
|
import { l as SANDBOX_AGENT_HOME, t as isInsideReservedDir } from "./file-transfer-DOSTbUSR.js";
|
|
9
9
|
import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch-sGVP8skk.js";
|
|
10
10
|
import { t as parseSSEStream } from "./sse-parser-BCG3iL9j.js";
|
|
11
|
-
import { t as LinesClient } from "./lines-
|
|
11
|
+
import { t as LinesClient } from "./lines-Bsp1TFBM.js";
|
|
12
12
|
import { PublicTemplatesClient } from "./public-templates.js";
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
//#region ../../../packages/runtime-contracts/dist/git-policy.js
|
|
@@ -1236,11 +1236,11 @@ function isLocalSandboxEndpoint(baseUrl) {
|
|
|
1236
1236
|
}
|
|
1237
1237
|
}
|
|
1238
1238
|
async function resolveLocalCliAuthFiles(backendType) {
|
|
1239
|
-
const { discoverLocalCliAuthFiles } = await import("./local-cli-auth-
|
|
1239
|
+
const { discoverLocalCliAuthFiles } = await import("./local-cli-auth-DrNihS9-.js");
|
|
1240
1240
|
return discoverLocalCliAuthFiles(backendType);
|
|
1241
1241
|
}
|
|
1242
1242
|
async function loadLocalCliAuthExpectation(backendType) {
|
|
1243
|
-
const { describeLocalCliAuthExpectation: describe } = await import("./local-cli-auth-
|
|
1243
|
+
const { describeLocalCliAuthExpectation: describe } = await import("./local-cli-auth-DrNihS9-.js");
|
|
1244
1244
|
return describe(backendType);
|
|
1245
1245
|
}
|
|
1246
1246
|
/**
|
|
@@ -1495,13 +1495,7 @@ async function deleteMatchingSandboxes(client, filter, options) {
|
|
|
1495
1495
|
//#endregion
|
|
1496
1496
|
//#region src/client-sandbox-management.ts
|
|
1497
1497
|
var SandboxManagement = class extends SandboxTransport {
|
|
1498
|
-
/**
|
|
1499
|
-
* Poll a sandbox to `running` by id. Surfaces a real provision failure
|
|
1500
|
-
* as a {@link StateError} (carrying the sandbox's error message) rather
|
|
1501
|
-
* than an opaque timeout, and throws {@link NotFoundError} if the id is
|
|
1502
|
-
* unknown. Use after a {@link create} that timed out client-side but may
|
|
1503
|
-
* have continued provisioning server-side under its idempotency key.
|
|
1504
|
-
*/
|
|
1498
|
+
/** Await running, or report the provisioning StateError/unknown-ID NotFoundError. */
|
|
1505
1499
|
async waitForRunning(id, options) {
|
|
1506
1500
|
const instance = await this.get(id);
|
|
1507
1501
|
if (!instance) throw new NotFoundError(`Sandbox not found: ${id}`, {
|
|
@@ -1516,12 +1510,7 @@ var SandboxManagement = class extends SandboxTransport {
|
|
|
1516
1510
|
});
|
|
1517
1511
|
return instance;
|
|
1518
1512
|
}
|
|
1519
|
-
/**
|
|
1520
|
-
* List the agent backends registered by the Sandbox platform.
|
|
1521
|
-
*
|
|
1522
|
-
* The response contains static capabilities. A specific session can expose
|
|
1523
|
-
* fewer interaction kinds after its configuration is applied.
|
|
1524
|
-
*/
|
|
1513
|
+
/** Serving backend capabilities; individual session configuration may narrow them. */
|
|
1525
1514
|
async listBackends() {
|
|
1526
1515
|
const response = await this.fetch("/v1/backends");
|
|
1527
1516
|
const body = await response.text();
|
|
@@ -1531,31 +1520,11 @@ var SandboxManagement = class extends SandboxTransport {
|
|
|
1531
1520
|
}, response.headers);
|
|
1532
1521
|
return parseBackendRegistryResponseBody(body);
|
|
1533
1522
|
}
|
|
1534
|
-
/**
|
|
1535
|
-
* Get one registered agent backend by its canonical type.
|
|
1536
|
-
*
|
|
1537
|
-
* An absent entry means the authenticated Sandbox deployment does not
|
|
1538
|
-
* advertise that backend. The lookup uses the same typed catalog as
|
|
1539
|
-
* {@link listBackends}; it does not maintain a second registry.
|
|
1540
|
-
*/
|
|
1523
|
+
/** Read one canonical type from the authenticated deployment's backend catalog. */
|
|
1541
1524
|
async getBackend(type) {
|
|
1542
1525
|
return (await this.listBackends()).backends.find((backend) => backend.type === type);
|
|
1543
1526
|
}
|
|
1544
|
-
/**
|
|
1545
|
-
* List all sandboxes.
|
|
1546
|
-
*
|
|
1547
|
-
* @param options - Filtering and pagination options
|
|
1548
|
-
* @returns Array of SandboxInstance objects
|
|
1549
|
-
*
|
|
1550
|
-
* @example
|
|
1551
|
-
* ```typescript
|
|
1552
|
-
* // List all running sandboxes
|
|
1553
|
-
* const running = await client.list({ status: "running" });
|
|
1554
|
-
*
|
|
1555
|
-
* // List with pagination
|
|
1556
|
-
* const page = await client.list({ limit: 10, offset: 0 });
|
|
1557
|
-
* ```
|
|
1558
|
-
*/
|
|
1527
|
+
/** List sandboxes with the requested filters and pagination. */
|
|
1559
1528
|
async list(options) {
|
|
1560
1529
|
const params = new URLSearchParams();
|
|
1561
1530
|
if (options?.status) {
|
|
@@ -1593,20 +1562,7 @@ var SandboxManagement = class extends SandboxTransport {
|
|
|
1593
1562
|
} while (cursor !== null);
|
|
1594
1563
|
return generations;
|
|
1595
1564
|
}
|
|
1596
|
-
/**
|
|
1597
|
-
* Get a sandbox by ID.
|
|
1598
|
-
*
|
|
1599
|
-
* @param id - The sandbox ID
|
|
1600
|
-
* @returns A SandboxInstance or null if not found
|
|
1601
|
-
*
|
|
1602
|
-
* @example
|
|
1603
|
-
* ```typescript
|
|
1604
|
-
* const box = await client.get("sandbox_abc123");
|
|
1605
|
-
* if (box) {
|
|
1606
|
-
* console.log(box.status);
|
|
1607
|
-
* }
|
|
1608
|
-
* ```
|
|
1609
|
-
*/
|
|
1565
|
+
/** Load the exact sandbox, including failed/stopped boxes; return null on HTTP 404. */
|
|
1610
1566
|
async get(id) {
|
|
1611
1567
|
const response = await this.fetch(`/v1/sandboxes/${encodeURIComponent(id)}`);
|
|
1612
1568
|
if (response.status === 404) {
|
|
@@ -1616,66 +1572,18 @@ var SandboxManagement = class extends SandboxTransport {
|
|
|
1616
1572
|
const data = await readResponseJson(response);
|
|
1617
1573
|
return createSandboxInstanceFromResponse(this, this.parseInfo(data), void 0, data);
|
|
1618
1574
|
}
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
* Each sandbox goes through the same delete as {@link SandboxInstance.delete}.
|
|
1624
|
-
* The API deletes a bounded batch per request in ID order; this method
|
|
1625
|
-
* follows its cursor, so one call attempts every match once and a refused
|
|
1626
|
-
* delete never holds back the matches after it. Calling it again is safe: a
|
|
1627
|
-
* sandbox confirmed gone no longer matches.
|
|
1628
|
-
*
|
|
1629
|
-
* `complete` is the teardown verdict. When it is false, `sandboxes` names
|
|
1630
|
-
* each refused delete with its status and code, and `listingComplete` or
|
|
1631
|
-
* `remaining` says whether a match may not have been attempted.
|
|
1632
|
-
*
|
|
1633
|
-
* `complete` covers the sandboxes this call listed. Stop creating
|
|
1634
|
-
* sandboxes that match before calling, and call again once in-flight
|
|
1635
|
-
* creates have settled; a create that registers after the listing, or that
|
|
1636
|
-
* retries with the same idempotency key, can leave a match behind.
|
|
1637
|
-
*
|
|
1638
|
-
* @example
|
|
1639
|
-
* ```typescript
|
|
1640
|
-
* // Remove every sandbox one Agent Runtime run created.
|
|
1641
|
-
* const result = await client.deleteMatching({
|
|
1642
|
-
* metadataPrefix: { retainedIdempotencyKey: `runtime:${runId}:` },
|
|
1643
|
-
* });
|
|
1644
|
-
* if (!result.complete) {
|
|
1645
|
-
* console.warn(result.sandboxes.filter((s) => !s.confirmed));
|
|
1646
|
-
* }
|
|
1647
|
-
* ```
|
|
1648
|
-
*/
|
|
1575
|
+
async delete(id, options) {
|
|
1576
|
+
return deleteSandbox(this, id, options);
|
|
1577
|
+
}
|
|
1578
|
+
/** Delete owned metadata matches. Complete covers the listed set; stop matching creates before confirming cleanup. */
|
|
1649
1579
|
async deleteMatching(filter, options) {
|
|
1650
1580
|
return deleteMatchingSandboxes(this, filter, options);
|
|
1651
1581
|
}
|
|
1652
|
-
/**
|
|
1653
|
-
* Mint the terminal-capable token for one exact interactive session.
|
|
1654
|
-
*
|
|
1655
|
-
* This is a server-side operation. It validates the complete session
|
|
1656
|
-
* reference, derives the sandbox and runtime session IDs from that reference,
|
|
1657
|
-
* and makes one scoped-token request without loading the sandbox first.
|
|
1658
|
-
*/
|
|
1582
|
+
/** Mint a terminal token for the exact interactive reference without loading its sandbox. */
|
|
1659
1583
|
async mintInteractiveSessionToken(ref, options = {}) {
|
|
1660
1584
|
return requestInteractiveSessionToken(this, ref, options);
|
|
1661
1585
|
}
|
|
1662
|
-
/**
|
|
1663
|
-
* The named sandbox sizes, which one is the platform's default, and the
|
|
1664
|
-
* largest shape this account can be granted on the serving deployment.
|
|
1665
|
-
*
|
|
1666
|
-
* The platform owns these numbers; a client that sizes a request from
|
|
1667
|
-
* `ceiling` is never refused with `RESOURCES_EXCEED_LIMIT`, and
|
|
1668
|
-
* {@link sandboxResourcesForSize} accepts `presets` so a named tier expands
|
|
1669
|
-
* to what this deployment actually sells.
|
|
1670
|
-
*
|
|
1671
|
-
* @example
|
|
1672
|
-
* ```typescript
|
|
1673
|
-
* const shapes = await client.shapes();
|
|
1674
|
-
* const box = await client.create({
|
|
1675
|
-
* resources: sandboxResourcesForSize("medium", shapes.presets),
|
|
1676
|
-
* });
|
|
1677
|
-
* ```
|
|
1678
|
-
*/
|
|
1586
|
+
/** Read serving sizes, default and granted ceiling; pass presets to sandboxResourcesForSize. */
|
|
1679
1587
|
async shapes() {
|
|
1680
1588
|
const data = await readResponseJson(await this.fetch("/v1/shapes"));
|
|
1681
1589
|
if (!Array.isArray(data?.presets) || typeof data.default !== "string" || !data.ceiling || typeof data.ceiling.cpuCores !== "number" || typeof data.ceiling.memoryMB !== "number" || typeof data.ceiling.diskGB !== "number") throw new SandboxError("GET /v1/shapes returned no usable shape catalogue", {
|
|
@@ -1684,12 +1592,7 @@ var SandboxManagement = class extends SandboxTransport {
|
|
|
1684
1592
|
});
|
|
1685
1593
|
return data;
|
|
1686
1594
|
}
|
|
1687
|
-
/**
|
|
1688
|
-
* Return the identity the public Sandbox API observed for this credential.
|
|
1689
|
-
*
|
|
1690
|
-
* This is useful for deployment checks that must confirm which account and
|
|
1691
|
-
* API key a service credential resolves to without exposing the key itself.
|
|
1692
|
-
*/
|
|
1595
|
+
/** Read the API-observed owner/key identity without exposing its credential. */
|
|
1693
1596
|
async getIdentity() {
|
|
1694
1597
|
const payload = await readResponseJson(await this.fetch("/v1/me"));
|
|
1695
1598
|
const data = payload.data;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as CollaborationTransportConfig, a as CollaborationClient, c as CollaborationClientConfig, d as CollaborationDocumentRef, f as CollaborationFileBridgeOptions, g as CollaborationTokenRefreshResponse, h as CollaborationTokenRefreshRequest, i as parseCollaborationDocumentId, l as CollaborationDocumentAdapter, m as CollaborationPermissions, n as buildCollaborationDocumentId, o as CollaborationBootstrapRequest, p as CollaborationFileEvent, r as normalizeCollaborationPath, s as CollaborationBootstrapResponse, t as CollaborationFileBridge, u as CollaborationDocumentChange, v as SaveCollaborationSnapshotRequest, y as SaveCollaborationSnapshotResponse } from "../index-
|
|
1
|
+
import { _ as CollaborationTransportConfig, a as CollaborationClient, c as CollaborationClientConfig, d as CollaborationDocumentRef, f as CollaborationFileBridgeOptions, g as CollaborationTokenRefreshResponse, h as CollaborationTokenRefreshRequest, i as parseCollaborationDocumentId, l as CollaborationDocumentAdapter, m as CollaborationPermissions, n as buildCollaborationDocumentId, o as CollaborationBootstrapRequest, p as CollaborationFileEvent, r as normalizeCollaborationPath, s as CollaborationBootstrapResponse, t as CollaborationFileBridge, u as CollaborationDocumentChange, v as SaveCollaborationSnapshotRequest, y as SaveCollaborationSnapshotResponse } from "../index-BTXyTVq4.js";
|
|
2
2
|
export { CollaborationBootstrapRequest, CollaborationBootstrapResponse, CollaborationClient, CollaborationClientConfig, CollaborationDocumentAdapter, CollaborationDocumentChange, CollaborationDocumentRef, CollaborationFileBridge, CollaborationFileBridgeOptions, CollaborationFileEvent, CollaborationPermissions, CollaborationTokenRefreshRequest, CollaborationTokenRefreshResponse, CollaborationTransportConfig, SaveCollaborationSnapshotRequest, SaveCollaborationSnapshotResponse, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
|
|
@@ -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-jvzPekSe.js";
|
|
2
2
|
export { CollaborationClient, CollaborationFileBridge, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as fetchSandboxApi } from "./api-request-
|
|
1
|
+
import { D as TimeoutError, _ as NetworkError, r as parseErrorResponse } from "./errors-DQEu-Q7s.js";
|
|
2
|
+
import { i as fetchSandboxApi } from "./api-request-wjUrfDvm.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, O as SandboxInstance, V as ProfileFileDeliveryReport, z as WorkspaceImagePublishRequestOptions } from "./index-
|
|
2
|
-
import {
|
|
3
|
-
import { En as SandboxConfig, Ga as ExecResult, Gr as ManagedProcessOptions, H as PreviewLinkInfo, Ia as WorkspaceImagePublishInput, In as NetworkConfig, Ja as SandboxEnvRecoveryView, Jr as ManagedProcessRecord, Kr as ManagedProcessResumeOptions, La as WorkspaceImagePublishResult, Ri as ConversationTurnOptions, Tn as CreateSandboxOptions, U as PreviewLinkManager, W as PreviewLinkWaitOptions, Wr as ManagedProcessJobs, Yr as ManagedProcessSpec, an as SandboxInfo, kn as SandboxStatus, oa as SessionMessageAdmission, qa as SandboxEnvRecovery, qr as ManagedProcessState, wi as PromptInputPart, yr as ExecOptions, 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 sandboxFailureKind, Ct as HostedInstance, Et as InstanceRestartingError, Ot as InstancesClient, St as EnsureInstanceOptions, Tt as InstanceRecord, _t as SeatSelectionError, an as BackendRegistryInteractionKind, bt as gatewaySeatTransport, cn as backendRegistryEntrySchema, dn as isBackendRegistryInteractionKind, dt as SandboxResolvedSeat, fn as parseBackendRegistryResponse, ft as SandboxSeatCredentials, gt as SeatResolutionObservation, ht as SeatOwnerTransport, in as BackendRegistryEntry, kt as SandboxFailureKind, ln as backendRegistryInteractionKindSchema, lt as ISOLATED_CREATION_ATTESTATION_VERSION, mt as SeatOwnerReply, on as BackendRegistryResponse, pn as parseBackendRegistryResponseBody, pt as SandboxSeatSelectionInput, rn as BackendRegistryCapabilities, sn as backendRegistryCapabilitiesSchema, t as Sandbox, un as backendRegistryResponseSchema, ut as CreateSelectSeatOptions, vt as SeatSelectionRequest, wt as InstanceProfile, xt as ManagedProcessClient, yt as createSelectSeat } from "./client-
|
|
6
|
-
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-
|
|
7
|
-
export { AuthError, BackendRegistryCapabilities, BackendRegistryEntry, BackendRegistryInteractionKind, BackendRegistryResponse, CapabilityError, ConversationTurnOptions, ConversationTurnResult, CreateSandboxOptions, CreateSelectSeatOptions, EnsureInstanceOptions, ExecOptions, ExecResult, FileWriteConflictError, 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, sandboxFailureKind };
|
|
1
|
+
import { B as WorkspaceImages, O as SandboxInstance, V as ProfileFileDeliveryReport, z as WorkspaceImagePublishRequestOptions } from "./index-B_1aVs2B.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-D7dMd-NV.js";
|
|
3
|
+
import { En as SandboxConfig, Ga as ExecResult, Gr as ManagedProcessOptions, H as PreviewLinkInfo, Ia as WorkspaceImagePublishInput, In as NetworkConfig, Ja as SandboxEnvRecoveryView, Jr as ManagedProcessRecord, Kr as ManagedProcessResumeOptions, La as WorkspaceImagePublishResult, Ri as ConversationTurnOptions, Tn as CreateSandboxOptions, U as PreviewLinkManager, W as PreviewLinkWaitOptions, Wr as ManagedProcessJobs, Yr as ManagedProcessSpec, an as SandboxInfo, kn as SandboxStatus, oa as SessionMessageAdmission, qa as SandboxEnvRecovery, qr as ManagedProcessState, wi as PromptInputPart, yr as ExecOptions, zi as ConversationTurnResult } from "./types-ImZuAuFG.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-CxWFuuJ3.js";
|
|
5
|
+
import { At as sandboxFailureKind, Ct as HostedInstance, Et as InstanceRestartingError, Ot as InstancesClient, St as EnsureInstanceOptions, Tt as InstanceRecord, _t as SeatSelectionError, an as BackendRegistryInteractionKind, bt as gatewaySeatTransport, cn as backendRegistryEntrySchema, dn as isBackendRegistryInteractionKind, dt as SandboxResolvedSeat, fn as parseBackendRegistryResponse, ft as SandboxSeatCredentials, gt as SeatResolutionObservation, ht as SeatOwnerTransport, in as BackendRegistryEntry, kt as SandboxFailureKind, ln as backendRegistryInteractionKindSchema, lt as ISOLATED_CREATION_ATTESTATION_VERSION, mt as SeatOwnerReply, on as BackendRegistryResponse, pn as parseBackendRegistryResponseBody, pt as SandboxSeatSelectionInput, rn as BackendRegistryCapabilities, sn as backendRegistryCapabilitiesSchema, t as Sandbox, un as backendRegistryResponseSchema, ut as CreateSelectSeatOptions, vt as SeatSelectionRequest, wt as InstanceProfile, xt as ManagedProcessClient, yt as createSelectSeat } from "./client-DsXWyLrM.js";
|
|
6
|
+
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-xqtPv6pg.js";
|
|
7
|
+
export { AuthError, BackendRegistryCapabilities, BackendRegistryEntry, BackendRegistryInteractionKind, BackendRegistryResponse, CapabilityError, ConversationTurnOptions, ConversationTurnResult, CreateSandboxOptions, CreateSelectSeatOptions, EnsureInstanceOptions, ExecOptions, ExecResult, FileWriteConflictError, 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 {
|
|
2
|
-
import { C as
|
|
3
|
-
import { a as InstancesClient, d as backendRegistryInteractionKindSchema, f as backendRegistryResponseSchema, h as parseBackendRegistryResponseBody, i as InstanceRestartingError, l as backendRegistryCapabilitiesSchema, m as parseBackendRegistryResponse, p as isBackendRegistryInteractionKind, r as HostedInstance, t as Sandbox, u as backendRegistryEntrySchema } 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-nYoBbiu1.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-DQEu-Q7s.js";
|
|
3
|
+
import { a as InstancesClient, d as backendRegistryInteractionKindSchema, f as backendRegistryResponseSchema, h as parseBackendRegistryResponseBody, i as InstanceRestartingError, l as backendRegistryCapabilitiesSchema, m as parseBackendRegistryResponse, p as isBackendRegistryInteractionKind, r as HostedInstance, t as Sandbox, u as backendRegistryEntrySchema } from "./client-eoEoMzDD.js";
|
|
4
|
+
import { i as profileChannelReference, r as lineInstanceKey, t as LinesClient } from "./lines-Bsp1TFBM.js";
|
|
5
5
|
import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
|
|
6
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-CUZyz-U8.js";
|
|
7
|
-
import { a as gatewaySeatTransport, i as createSelectSeat, r as SeatSelectionError } from "./select-seat-
|
|
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, sandboxFailureKind };
|
|
7
|
+
import { a as gatewaySeatTransport, i as createSelectSeat, r as SeatSelectionError } from "./select-seat-BHHUFoKh.js";
|
|
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 };
|
|
@@ -198,10 +198,7 @@ const ALIAS_CODE = new Map(ALIASES.map(([alias, code]) => [alias, code]));
|
|
|
198
198
|
*
|
|
199
199
|
* The one parse point from an error response to a `SandboxError`.
|
|
200
200
|
*/
|
|
201
|
-
/**
|
|
202
|
-
* The one retry rule: retry a failure when the catalog marks its code
|
|
203
|
-
* retryable. A loop adds only its own deliberate exception.
|
|
204
|
-
*/
|
|
201
|
+
/** Catalog retryability owns retry decisions; loops state their deliberate exceptions. */
|
|
205
202
|
function retryWhen(error) {
|
|
206
203
|
return error instanceof SandboxError && error.retryable;
|
|
207
204
|
}
|
|
@@ -257,21 +254,13 @@ function parseRetryAfterMs(rawValue, data) {
|
|
|
257
254
|
if (typeof data.retryAfterMs === "number" && Number.isFinite(data.retryAfterMs)) return Math.max(0, data.retryAfterMs);
|
|
258
255
|
return parseSandboxRetryAfterHeader(rawValue);
|
|
259
256
|
}
|
|
260
|
-
/**
|
|
261
|
-
* The server's published wait, in seconds. Only a positive finite number is
|
|
262
|
-
* a wait; anything else is absent. Never derived from `Retry-After` — that
|
|
263
|
-
* header is a pacing hint every refusal carries, while `etaSeconds` is a
|
|
264
|
-
* measurement the cell only publishes when it has one.
|
|
265
|
-
*/
|
|
257
|
+
/** Positive cell-measured ETA; independent of Retry-After pacing. */
|
|
266
258
|
function parseEtaSeconds(data) {
|
|
267
259
|
const raw = data.etaSeconds;
|
|
268
260
|
if (typeof raw !== "number" || !Number.isFinite(raw) || raw <= 0) return;
|
|
269
261
|
return raw;
|
|
270
262
|
}
|
|
271
|
-
/**
|
|
272
|
-
* What a capacity refusal publishes: the cell's measured wait, and whether its
|
|
273
|
-
* customer floor refused an internal create (SandboxError.capacityHold).
|
|
274
|
-
*/
|
|
263
|
+
/** Capacity refusal ETA and explicit internal-create customer-floor hold. */
|
|
275
264
|
function capacityRefusalMetadata(data) {
|
|
276
265
|
return {
|
|
277
266
|
etaSeconds: parseEtaSeconds(data),
|
|
@@ -305,12 +294,7 @@ function readFailures(data, errorObj) {
|
|
|
305
294
|
}
|
|
306
295
|
if (typeof errorObj === "object" && errorObj !== null && Array.isArray(errorObj.failures)) return errorObj.failures.filter(isFailureDetail);
|
|
307
296
|
}
|
|
308
|
-
/**
|
|
309
|
-
* Parse an error response from the API.
|
|
310
|
-
* @param status - HTTP status code
|
|
311
|
-
* @param body - Response body text
|
|
312
|
-
* @param context - Optional request context for better error messages
|
|
313
|
-
*/
|
|
297
|
+
/** Parse HTTP refusals into catalog-owned errors with response context. */
|
|
314
298
|
function parseErrorResponse(status, body, context, headers) {
|
|
315
299
|
let data;
|
|
316
300
|
try {
|
|
@@ -339,6 +323,7 @@ function parseErrorResponse(status, body, context, headers) {
|
|
|
339
323
|
const messageWithReason = `${prefix}${reason && !composedMessage.includes(reason) ? `${composedMessage}: ${reason}` : composedMessage}`;
|
|
340
324
|
const message = logTail && !messageWithReason.includes(logTail) ? `${messageWithReason}\n${logTail}` : messageWithReason;
|
|
341
325
|
const metadata = {
|
|
326
|
+
...responseMetadata(status, headers),
|
|
342
327
|
origin: inferOrigin(headers, context),
|
|
343
328
|
endpoint: context?.path ?? headers?.get("x-tangle-request-path") ?? void 0,
|
|
344
329
|
retryAfterMs: parseRetryAfterMs(headers?.get("retry-after") ?? void 0, data),
|
|
@@ -359,6 +344,20 @@ function parseErrorResponse(status, body, context, headers) {
|
|
|
359
344
|
currentState: source.currentState ?? (Alias === StateError ? "unknown" : void 0)
|
|
360
345
|
});
|
|
361
346
|
}
|
|
347
|
+
/** Allowlisted response identity; absent headers never acquire synthetic ids. */
|
|
348
|
+
function responseMetadata(status, headers) {
|
|
349
|
+
const id = (name) => {
|
|
350
|
+
const value = headers?.get(name);
|
|
351
|
+
return value && /^[A-Za-z0-9_.:-]{1,200}$/.test(value) ? value : void 0;
|
|
352
|
+
};
|
|
353
|
+
return {
|
|
354
|
+
status,
|
|
355
|
+
requestId: id("x-request-id"),
|
|
356
|
+
traceId: id("x-tangle-trace-id"),
|
|
357
|
+
method: headers?.get("x-tangle-request-method") ?? void 0,
|
|
358
|
+
endpoint: headers?.get("x-tangle-request-path") ?? void 0
|
|
359
|
+
};
|
|
360
|
+
}
|
|
362
361
|
/** Read a failed HTTP response without changing its typed error or retry metadata. */
|
|
363
362
|
async function parseResponseError(response) {
|
|
364
363
|
const body = await response.text();
|
|
@@ -379,4 +378,4 @@ function readResponseJson(response) {
|
|
|
379
378
|
*/
|
|
380
379
|
var TerminalStreamError = class extends SandboxError {};
|
|
381
380
|
//#endregion
|
|
382
|
-
export {
|
|
381
|
+
export { SandboxError as C, TimeoutError as D, StreamInterruptedError as E, ValidationError as O, ResumeEnvRequiredError as S, StateError as T, NetworkError as _, readResponseJson as a, ProfileFileMountPathError as b, AuthError as c, CompliancePlacementError as d, EdgeNotReadyError as f, KeyBudgetExhaustedError as g, GpuProviderNotConfiguredError as h, parseResponseError as i, BranchFanoutExceedsHostError as l, FileWriteConflictError as m, isTransientWrite as n, responseMetadata as o, EgressProxyRecoveryError as p, parseErrorResponse as r, retryWhen as s, TerminalStreamError as t, CapabilityError as u, NotFoundError as v, ServerError as w, QuotaError as x, PartialFailureError as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as bytesToHex, t as sha256 } from "./sha2-
|
|
2
|
-
import {
|
|
1
|
+
import { n as bytesToHex, t as sha256 } from "./sha2-BIoWepwn.js";
|
|
2
|
+
import { O as ValidationError } from "./errors-DQEu-Q7s.js";
|
|
3
3
|
//#region src/lib/file-download.ts
|
|
4
4
|
function downloadBounds(options) {
|
|
5
5
|
for (const [name, value] of Object.entries({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as sha256 } from "./sha2-
|
|
1
|
+
import { t as sha256 } from "./sha2-BIoWepwn.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.
|
|
3
|
+
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.19/node_modules/@tangle-network/agent-interface/dist/contract-limits.js
|
|
4
4
|
/** Limits applied before a value is hashed, copied, or sent to a provider. */
|
|
5
5
|
const CONTRACT_MAX_STRING_LENGTH = 16384;
|
|
6
6
|
/** Maximum length of one canonical confidential-attestation quote. */
|
|
@@ -144,7 +144,7 @@ const boundedEventContentJsonSchema = z.custom(isBoundedEventContentJson, { mess
|
|
|
144
144
|
const boundedEventContentRecordSchema = z.custom((value) => typeof value === "object" && value !== null && !Array.isArray(value) && isBoundedEventContentJson(value), { message: "event content exceeds its serialized byte bound or is not a JSON object" });
|
|
145
145
|
const boundedEventContentStringSchema = z.custom((value) => typeof value === "string" && isBoundedEventContentJson(value), { message: "event content exceeds its serialized byte bound or is not a string" });
|
|
146
146
|
//#endregion
|
|
147
|
-
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.
|
|
147
|
+
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.19/node_modules/@tangle-network/agent-interface/dist/agent-candidate-schema-common.js
|
|
148
148
|
const sha256Pattern = /^sha256:[a-f0-9]{64}$/;
|
|
149
149
|
const gitObjectPattern = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/;
|
|
150
150
|
const environmentNamePattern = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
@@ -300,7 +300,7 @@ z.object({
|
|
|
300
300
|
repo: z.string().regex(githubComponentPattern).refine((value) => value !== "." && value !== "..")
|
|
301
301
|
}).strict();
|
|
302
302
|
//#endregion
|
|
303
|
-
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.
|
|
303
|
+
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.19/node_modules/@tangle-network/agent-interface/dist/agent-profile.js
|
|
304
304
|
/**
|
|
305
305
|
* Portable reasoning/thinking effort. Backends map it to their native control at materialization:
|
|
306
306
|
* codex `model_reasoning_effort`, kimi `--thinking`/`--no-thinking`, claude thinking budget.
|
|
@@ -328,7 +328,7 @@ function trainedModelIdForArtifact(digest) {
|
|
|
328
328
|
return `${TRAINED_MODEL_PREFIX}${digest.slice(7)}`;
|
|
329
329
|
}
|
|
330
330
|
//#endregion
|
|
331
|
-
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.
|
|
331
|
+
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.19/node_modules/@tangle-network/agent-interface/dist/harness.js
|
|
332
332
|
/**
|
|
333
333
|
* Recognized execution identities, not a deployment's list of installed runners.
|
|
334
334
|
* A profile's authored harness remains part of its canonical identity; execution
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { Dt as AgentProfile, Et as InteractionResponseCommand, R as SandboxError, Rt as ProxySecretReceipt, St as AgentRunCancellationRequest, Tt as InteractionRequest, Y as SandboxCreateReceipt, at as AgentInteractiveSessionStart, ct as AgentInteractiveSessionControlClaimAcknowledgement, dt as AgentInteractiveSessionPromptCommand, ft as AgentInteractiveSessionRef, g as TerminalReadyInfo, gt as AgentInteractiveTerminalSession, ht as AgentInteractiveSessionStopCommand, i as TerminalStreamHandlers, jt as AgentProfileFileMount, l as MintScopedTokenOptions, lt as AgentInteractiveSessionControlClaimRequest, mt as AgentInteractiveSessionStopAcknowledgement, o as TerminalStreamReconnectAuthority, ot as AgentInteractiveSessionAttach, st as AgentInteractiveSessionControlClaim, u as ScopedToken, ut as AgentInteractiveSessionPromptAcknowledgement, vt as TerminalOutputEvent, wt as InteractionAcknowledgement, xt as AgentRunCancellationAcknowledgement, yt as TerminalReplayWindow, zt as InteractionData } from "./terminal-stream-types-D7dMd-NV.js";
|
|
2
|
+
import { $r as ForkCounts, An as SandboxShape, Ar as DriverInfo, Bi as CreateSessionOptions, C as WorkspaceOperationLookup, Ci as IntelligenceReportWindow, Cn as TerminalStream, D as ProvisionResult, Di as SandboxEvent, E as ProvisionEvent, Ei as PromptResult, Fi as CommitTaskSessionOptions, Fn as EgressManager, G as GitBranch, Ga as ExecResult, Gi as ListMessagesOptions, Ha as CodeExecutionResult, Hi as DispatchPromptOptions, Ia as WorkspaceImagePublishInput, J as GitStatus, Ja as SandboxEnvRecoveryView, Ji as SendSessionMessageRequest, K as GitCommit, Ka as WriteFileRequest, Ki as PublicProfileConflict, Kt as SandboxFleetTraceBundle, La as WorkspaceImagePublishResult, Li as CompletedTurnResult, Ln as NetworkManager, Lr as GpuLeaseManager, Mi as SandboxTraceOptions, Mn as SandboxResourceUsage, Mr as GpuLease, N as WaitForOptions, Nn as SandboxRuntimeCapabilities, Pi as TurnBackendConfig, Qi as SessionExecutionInfo, Qr as BranchOptions, Ri as ConversationTurnOptions, S as StopOptions, Sn as TeePublicKeyResponse, Ti as PromptOptions, Tn as CreateSandboxOptions, U as PreviewLinkManager, Ua as CodeLanguage, Ui as DispatchedSession, Ur as CodeExecutionOptions, Vi as CreateTaskSessionOptions, Wi as DriveTurnOptions, Xa as InteractionResolutionAcknowledgement, Xr as HttpClient, Yi as SentSessionMessage, Zi as SessionEventStreamOptions, _ as SnapshotInfo, _r as SearchMatch, aa as SessionMessage, ai as WaitForRolloutOptions, an as SandboxInfo, bi as IntelligenceReportBudget, bn as TeeAttestationResponse, c as SandboxDeleteOptions, ca as SessionResultOptions, cr as FileWriteResult, d as SandboxOperationKind, ei as ForkIdempotency, f as SandboxOperationState, fa as TaskSessionInfo, ga as BackendConfig, gn as StartupDiagnostics, gr as WriteManyOptions, hi as DurablePlanDecisionResult, hn as SandboxTerminals, hr as WriteManyFile, ia as SessionListOptions, ii as RolloutStartResult, in as SandboxConnection, k as ResumeOptions, ki as SandboxTraceBundle, kn as SandboxStatus, la as TaskSessionChanges, ln as SandboxRuntimeHealth, m as SnapshotDeleteAcknowledgement, ma as TurnDriveResult, mi as DurablePlanDecisionOptions, mr as WriteFileOptions, na as SessionInfo, ni as Rollout, nn as SSHCommandDescriptor, nr as FileSystem, o as RestoreSnapshotOptions, oa as SessionMessageAdmission, on as SandboxPortBinding, pi as DurablePlan, q as GitDiff, qa as SandboxEnvRecovery, qi as SendSessionMessageOptions, ra as SessionInterruptOptions, ri as RolloutOptions, rn as SSHCredentials, s as SandboxDeleteAcknowledgement, ta as SessionForkOptions, ti as ForkLookupOptions, u as SandboxOperationInfo, ua as TaskSessionCommitResult, un as SandboxTerminalAttachOptions, v as SnapshotOptions, va as BackendManager, vi as EventStreamOptions, vn as TeeAttestationOptions, vr as SearchOptions, wi as PromptInputPart, x as SnapshotResult, xi as IntelligenceReportCompareTo, y as SnapshotProvenance, yi as IntelligenceReport, yr as ExecOptions, z as ProcessManager, zi as ConversationTurnResult } from "./types-ImZuAuFG.js";
|
|
3
|
+
import { c as RawEvidenceDirectoryExport, l as RawEvidenceExportOptions, o as RawEvidenceBoxDirectoryExport, p as RawEvidenceUnavailable, r as RawEvidenceArchiveManifest, s as RawEvidenceBoxExportOptions } from "./raw-evidence-export-C0ieFpi2.js";
|
|
4
|
+
import { t as CliAuthReference } from "./cli-auth-bundle-eUl7Sa1x.js";
|
|
5
|
+
import { n as SandboxLines } from "./lines-CxWFuuJ3.js";
|
|
6
|
+
import { _ as InteractiveSessionStatus, f as InteractiveAttachOptions, g as InteractiveRequestOptions, h as InteractiveObserveOptions, m as InteractiveControlClaimOptions, p as InteractiveControlClaimAcknowledgement } from "./browser-interactive-control-controller-9RauUsHw.js";
|
|
7
|
+
import { r as InteractiveAttachRequest } from "./interactive-controller-C2vOFe0u.js";
|
|
7
8
|
import { z } from "zod";
|
|
8
9
|
import { OtlpTraceExport } from "@tangle-network/agent-trace-contract/otlp";
|
|
9
10
|
|
|
@@ -1783,13 +1784,7 @@ interface SnapshotRestoreJobStatusResponse {
|
|
|
1783
1784
|
};
|
|
1784
1785
|
createdAt: string;
|
|
1785
1786
|
completedAt?: string;
|
|
1786
|
-
/**
|
|
1787
|
-
* The sandbox as `GET /v1/sandboxes/{id}` answers it, carried on the poll
|
|
1788
|
-
* that observes a successful completion. A restore suspends, swaps the
|
|
1789
|
-
* filesystem and resumes, so the box the caller holds is stale in status,
|
|
1790
|
-
* incarnation and connection until it is read again; this is that read,
|
|
1791
|
-
* answered by the same poll. Present on every successful completion.
|
|
1792
|
-
*/
|
|
1787
|
+
/** Fresh sandbox status/incarnation/connection, returned by every successful restore completion. */
|
|
1793
1788
|
sandbox?: Record<string, unknown>;
|
|
1794
1789
|
}
|
|
1795
1790
|
declare abstract class SandboxSnapshotCapabilities extends SandboxTurnCapabilities {
|
|
@@ -1798,57 +1793,13 @@ declare abstract class SandboxSnapshotCapabilities extends SandboxTurnCapabiliti
|
|
|
1798
1793
|
wait: false;
|
|
1799
1794
|
}): Promise<SandboxOperation>;
|
|
1800
1795
|
snapshot(options?: SnapshotOptions): Promise<SnapshotResult>;
|
|
1801
|
-
/**
|
|
1802
|
-
* List all snapshots for this sandbox.
|
|
1803
|
-
*
|
|
1804
|
-
* If `storage` is provided (BYOS3), lists snapshots from customer-provided
|
|
1805
|
-
* S3 storage.
|
|
1806
|
-
*
|
|
1807
|
-
* @param storage - Optional customer storage config for BYOS3
|
|
1808
|
-
* @returns Array of snapshot metadata
|
|
1809
|
-
*
|
|
1810
|
-
* @example List from our storage
|
|
1811
|
-
* ```typescript
|
|
1812
|
-
* const snapshots = await box.listSnapshots();
|
|
1813
|
-
* for (const snap of snapshots) {
|
|
1814
|
-
* console.log(`${snap.snapshotId}: ${snap.createdAt}`);
|
|
1815
|
-
* }
|
|
1816
|
-
* ```
|
|
1817
|
-
*
|
|
1818
|
-
* @example List from customer S3 (BYOS3)
|
|
1819
|
-
* ```typescript
|
|
1820
|
-
* const snapshots = await box.listSnapshots({
|
|
1821
|
-
* type: "s3",
|
|
1822
|
-
* bucket: "my-snapshots",
|
|
1823
|
-
* credentials: { accessKeyId: "...", secretAccessKey: "..." },
|
|
1824
|
-
* });
|
|
1825
|
-
* ```
|
|
1826
|
-
*/
|
|
1796
|
+
/** List snapshots; storage selects the direct customer-S3 path. */
|
|
1827
1797
|
listSnapshots(storage?: SnapshotOptions["storage"]): Promise<SnapshotInfo[]>;
|
|
1828
|
-
/**
|
|
1829
|
-
* Delete a snapshot.
|
|
1830
|
-
*
|
|
1831
|
-
* Deleting a snapshot that is already gone succeeds and reports
|
|
1832
|
-
* `already_absent`, so a retry after an uncertain failure does not raise. A
|
|
1833
|
-
* 404 means this sandbox is unknown, not that the snapshot was missing.
|
|
1834
|
-
*/
|
|
1798
|
+
/** Delete returns already_absent for a missing snapshot; 404 means the sandbox itself is unknown. */
|
|
1835
1799
|
deleteSnapshot(snapshotId: string, options?: {
|
|
1836
|
-
/**
|
|
1837
|
-
* Deadline for this one request. The client aborts the request itself at
|
|
1838
|
-
* the deadline, so a caller retrying a stalled delete does not leave the
|
|
1839
|
-
* previous attempt in flight. Omit it to use the client's own timeout;
|
|
1840
|
-
* a supplied value that no timer can hold (not a positive integer of at
|
|
1841
|
-
* most 2,147,483,647ms) throws `RangeError` rather than silently
|
|
1842
|
-
* widening to that default.
|
|
1843
|
-
*/
|
|
1844
|
-
timeoutMs?: number;
|
|
1800
|
+
/** Per-call request deadline; invalid timer bounds throw RangeError. Omitted uses the client timeout. */timeoutMs?: number;
|
|
1845
1801
|
}): Promise<SnapshotDeleteAcknowledgement>;
|
|
1846
|
-
/**
|
|
1847
|
-
* Ask whether the snapshot bound to an idempotency key is decided.
|
|
1848
|
-
*
|
|
1849
|
-
* Pass the same options the create carried for an exact-body lookup. Omit
|
|
1850
|
-
* options to read the operation bound to this owner-scoped key.
|
|
1851
|
-
*/
|
|
1802
|
+
/** Read the checkpoint operation by key; options request an exact-body lookup. */
|
|
1852
1803
|
getSnapshotOperation(idempotencyKey: string, options?: Pick<SnapshotOptions, "tags">): Promise<WorkspaceOperationLookup>;
|
|
1853
1804
|
revertToSnapshot(snapshotId: string): Promise<SnapshotResult>;
|
|
1854
1805
|
/**
|
|
@@ -1858,35 +1809,10 @@ declare abstract class SandboxSnapshotCapabilities extends SandboxTurnCapabiliti
|
|
|
1858
1809
|
restorePaths(snapshotId: string, paths: string[]): Promise<SnapshotResult>;
|
|
1859
1810
|
/** One keyed restore: a transport re-send joins its job; a 202 settles from that job. */
|
|
1860
1811
|
private restoreSnapshot;
|
|
1861
|
-
/**
|
|
1862
|
-
* Settle a restore from its job's status. The restore's own 202, held to
|
|
1863
|
-
* the job's end, is the first status read; only an unfinished one polls.
|
|
1864
|
-
*/
|
|
1812
|
+
/** Read the accepted restore job first; poll only while unfinished. */
|
|
1865
1813
|
protected waitForSnapshotRestore(snapshotId: string, accepted: SnapshotRestoreJobStatusResponse): Promise<SnapshotResult>;
|
|
1866
1814
|
protected waitForSnapshotVisible(snapshotId: string, fallback?: Partial<SnapshotResult>): Promise<SnapshotResult>;
|
|
1867
|
-
/**
|
|
1868
|
-
* Restore from the latest snapshot in customer-provided storage.
|
|
1869
|
-
* Only available when using BYOS3 (calls the runtime directly).
|
|
1870
|
-
*
|
|
1871
|
-
* @param storage - Customer storage config (required)
|
|
1872
|
-
* @param destinationPath - Optional path to restore to
|
|
1873
|
-
* @returns Snapshot info if restored, null if no snapshot found
|
|
1874
|
-
*
|
|
1875
|
-
* @example Restore from customer S3
|
|
1876
|
-
* ```typescript
|
|
1877
|
-
* const result = await box.restoreFromStorage({
|
|
1878
|
-
* type: "s3",
|
|
1879
|
-
* bucket: "my-snapshots",
|
|
1880
|
-
* credentials: { accessKeyId: "...", secretAccessKey: "..." },
|
|
1881
|
-
* });
|
|
1882
|
-
*
|
|
1883
|
-
* if (result) {
|
|
1884
|
-
* console.log(`Restored from ${result.snapshotId}`);
|
|
1885
|
-
* } else {
|
|
1886
|
-
* console.log("No snapshot found");
|
|
1887
|
-
* }
|
|
1888
|
-
* ```
|
|
1889
|
-
*/
|
|
1815
|
+
/** Restore the latest customer-storage snapshot directly; null means none found. */
|
|
1890
1816
|
restoreFromStorage(storage: SnapshotOptions["storage"], options?: RestoreSnapshotOptions): Promise<SnapshotResult | null>;
|
|
1891
1817
|
}
|
|
1892
1818
|
//#endregion
|