@tangle-network/sandbox 1.0.132 → 1.0.133
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 +3 -3
- package/dist/{agent-run-outcome-6RpFdvyP.d.ts → agent-run-outcome-DSW47DnU.d.ts} +2 -2
- package/dist/{api-request-B7cnX489.js → api-request-DNrodWdz.js} +1 -1
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +2 -2
- package/dist/{browser-interactive-control-controller-BRz2PPTQ.d.ts → browser-interactive-control-controller-CLxkpYNV.d.ts} +1 -1
- package/dist/{browser-interactive-control-controller-CI-G-lan.js → browser-interactive-control-controller-l4Yqgoug.js} +2 -2
- package/dist/{chunked-upload-BHRGMfDz.js → chunked-upload-CyP-FOeZ.js} +1 -1
- package/dist/{chunked-upload-file-BMeDaILU.js → chunked-upload-file-Dr6i6G5b.js} +2 -2
- package/dist/{cli-auth-bundle-BDGLGvMu-BM8TG3ms.js → cli-auth-bundle-BDGLGvMu-BXdVAPNF.js} +1 -1
- package/dist/cli-auth-bundle-nPm8yuKO.js +2 -0
- package/dist/{client-CDz5Wgc0.js → client-BSK8I_4r.js} +11 -11
- package/dist/{client-uV-nZY3y.d.ts → client-BdoEjuk9.d.ts} +6 -5
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-C1jO3_Pp.js → collaboration-CX_XvFZZ.js} +1 -1
- package/dist/{core-CpQI6Yqe.js → core-DEFF0nLW.js} +6 -6
- package/dist/core.d.ts +6 -6
- package/dist/core.js +5 -5
- package/dist/{direct-http2-B0ztwG7m.js → direct-http2-Bojg02xf.js} +1 -1
- package/dist/{errors-ystNl7Ae.js → errors-BfR-fBvN.js} +1 -1
- package/dist/file-download-CICuFwGb.js +178 -0
- package/dist/harness-Cgp9jduT.js +363 -0
- package/dist/{index-BejHM6F8.d.ts → index-CE4JMgzA.d.ts} +6 -6
- package/dist/index.d.ts +11 -11
- package/dist/index.js +12 -11
- package/dist/intelligence/index.d.ts +3 -1
- package/dist/intelligence/index.js +25 -23
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-CM1FJ0gp.d.ts → interactive-controller-B8mGHsJz.d.ts} +3 -3
- package/dist/{interactive-controller-BzY0se5n.js → interactive-controller-DRWdHdgK.js} +7 -7
- package/dist/lib/prepared-evidence.js +1 -1
- package/dist/lib/prepared-process.js +1 -1
- package/dist/{lines-Dh-39kUV.d.ts → lines-Dc42Gr39.d.ts} +1 -1
- package/dist/{lines-DF4g3X3I.js → lines-DlLR4pHq.js} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -1
- package/dist/{local-cli-auth-D-r9JSUk.js → local-cli-auth-CI2d1Pdh.js} +1 -1
- package/dist/{mcp-local-B7o_k_Ll.js → mcp-local-tBlLJqTb.js} +1 -1
- package/dist/{prepared-evidence-DBSU--pB.js → prepared-evidence-r46MdJM9.js} +1 -1
- package/dist/{prepared-process-GzQXVsX8.js → prepared-process-C-rwZPIZ.js} +1 -1
- package/dist/{preview-BtbrzU_4.d.ts → preview-C7nHXam2.d.ts} +3 -3
- package/dist/{profile-schema-BD1nkqBw.js → profile-schema-nys6Qejd.js} +1 -1
- package/dist/{public-templates-Zec8CB3Y.d.ts → public-templates-DA4_Hn6B.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/public-templates.js +1 -1
- package/dist/{raw-evidence-archive-OHRixF4L.js → raw-evidence-archive-BOXTejc2.js} +11 -31
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +5 -5
- package/dist/{sandbox-NSVkjLQo.js → sandbox-CIfbsytC.js} +22 -205
- package/dist/{secp256k1-BGtA1PsN.js → secp256k1-CZWrpqxW.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 +3 -3
- package/dist/{harness-B63wL8RZ.js → sha2-vu4U-x2L.js} +23 -363
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-QjuaxjRc.js → tangle-bYg24n7e.js} +4 -4
- package/dist/{types-BA5GRheq.d.ts → types-BVyyOVyf.d.ts} +2 -2
- package/package.json +7 -6
- package/dist/cli-auth-bundle-DdAKxGZF.js +0 -2
- /package/dist/{abort-signal-JVaAyNMP.js → abort-signal-CDxyloxz.js} +0 -0
- /package/dist/{cli-auth-bundle-DMbZ1E7W.d.ts → cli-auth-bundle-COQ25k3d.d.ts} +0 -0
- /package/dist/{index-DnZdhFs2.d.ts → index-Dqcr9p97.d.ts} +0 -0
- /package/dist/{index-rbeL2Rct.d.ts → index-Dslyq85a.d.ts} +0 -0
- /package/dist/{keep-alive-fetch--8twRp99.js → keep-alive-fetch-BbSFbRCd.js} +0 -0
- /package/dist/{preview-operations-D2fXB_dc.js → preview-operations-BvgwYaoL.js} +0 -0
- /package/dist/{response-rewrap-B75N59JT.js → response-rewrap-CpNkboDX.js} +0 -0
- /package/dist/{retry-after-header-DrbSlyKY.js → retry-after-header-DUdCC0KJ.js} +0 -0
- /package/dist/{sidecar-proxy-error-DORW8_mD.js → sidecar-proxy-error-5DpLmHeN.js} +0 -0
- /package/dist/{sse-parser-BUIKfYAd.js → sse-parser-DrI47LyG.js} +0 -0
- /package/dist/{terminal-stream-types-CIgaXUM7.d.ts → terminal-stream-types-8-sAl2J0.d.ts} +0 -0
- /package/dist/{utils-CoawKwX_.js → utils-vaFoyyiO.js} +0 -0
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, To as BackendType, Ua as CodeLanguage, Ur as CodeExecutionOptions, Wa as CodeResultPart, ga as BackendConfig, ia as SessionListOptions, 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-CE4JMgzA.js";
|
|
2
|
+
import { Bt as SandboxFleetParent, Ha as CodeExecutionResult, To as BackendType, Ua as CodeLanguage, Ur as CodeExecutionOptions, Wa as CodeResultPart, ga as BackendConfig, ia as SessionListOptions, na as SessionInfo } from "../types-BVyyOVyf.js";
|
|
3
|
+
import { t as Sandbox } from "../client-BdoEjuk9.js";
|
|
4
|
+
import { u as PreviewAuthorizer } from "../preview-C7nHXam2.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 { k as assertCurrentBackendType } from "../interactive-controller-
|
|
3
|
-
import { t as SandboxInstance } from "../sandbox-
|
|
4
|
-
import { C as StateError, E as ValidationError, g as NotFoundError } from "../errors-
|
|
5
|
-
import { t as Sandbox } from "../client-
|
|
1
|
+
import { a as TOOL_SPECS, i as ALL_TOOL_SPECS, o as serializeToolResult, r as bindToolSpecs, t as createMcpServer } from "../mcp-local-tBlLJqTb.js";
|
|
2
|
+
import { k as assertCurrentBackendType } from "../interactive-controller-DRWdHdgK.js";
|
|
3
|
+
import { t as SandboxInstance } from "../sandbox-CIfbsytC.js";
|
|
4
|
+
import { C as StateError, E as ValidationError, g as NotFoundError } from "../errors-BfR-fBvN.js";
|
|
5
|
+
import { t as Sandbox } from "../client-BSK8I_4r.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-C7nHXam2.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
|
-
import { r as agentProfileSchema } from "../profile-schema-
|
|
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-
|
|
1
|
+
import { r as agentProfileSchema } from "../profile-schema-nys6Qejd.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-BvgwYaoL.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-tBlLJqTb.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 { V 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 { V as InteractionRequest } from "./terminal-stream-types-8-sAl2J0.js";
|
|
2
|
+
import { Di as SandboxEvent, _i as DurablePlanSnapshot, ci as AgentApprovalRequirement, di as AgentToolInvocation, li as AgentQuestionRequest, ui as AgentRunStatus } from "./types-BVyyOVyf.js";
|
|
3
3
|
|
|
4
4
|
//#region src/agent-run-outcome.d.ts
|
|
5
5
|
interface AgentRunOutcome {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as rewrapResponse } from "./response-rewrap-
|
|
1
|
+
import { t as rewrapResponse } from "./response-rewrap-CpNkboDX.js";
|
|
2
2
|
//#region src/lib/api-request.mjs
|
|
3
3
|
function withRequestContextHeaders(response, path, method, body = response.body) {
|
|
4
4
|
const headers = new Headers(response.headers);
|
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-COQ25k3d.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-Dslyq85a.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-BDGLGvMu-
|
|
2
|
-
import "../cli-auth-bundle-
|
|
1
|
+
import { i as materializeCliAuthBundle, n as assertCliAuthReferenceSupported, r as cliAuthReferenceSchema } from "../cli-auth-bundle-BDGLGvMu-BXdVAPNF.js";
|
|
2
|
+
import "../cli-auth-bundle-nPm8yuKO.js";
|
|
3
3
|
//#region src/auth/tokens.ts
|
|
4
4
|
const textEncoder = new TextEncoder();
|
|
5
5
|
const textDecoder = new TextDecoder();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AgentInteractiveSessionStatus, C as AgentInteractiveSessionAttach, E as AgentInteractiveSessionControlClaimRequest, T as AgentInteractiveSessionControlClaimAcknowledgement, i as TerminalStreamHandlers, k as AgentInteractiveSessionRef, w as AgentInteractiveSessionControlClaim } from "./terminal-stream-types-
|
|
1
|
+
import { A as AgentInteractiveSessionStatus, C as AgentInteractiveSessionAttach, E as AgentInteractiveSessionControlClaimRequest, T as AgentInteractiveSessionControlClaimAcknowledgement, i as TerminalStreamHandlers, k as AgentInteractiveSessionRef, w as AgentInteractiveSessionControlClaim } from "./terminal-stream-types-8-sAl2J0.js";
|
|
2
2
|
|
|
3
3
|
//#region src/interactive-types.d.ts
|
|
4
4
|
/** Cancellation for an interactive SDK request. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { t as awaitWithAbort } from "./abort-signal-
|
|
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-Cgp9jduT.js";
|
|
2
|
+
import { t as awaitWithAbort } from "./abort-signal-CDxyloxz.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.9/node_modules/@tangle-network/agent-interface/dist/native-session-event.js
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as FILE_UPLOAD_SESSION_MAX_BYTES, O as isFileTooLargeErrorBody, S as ServerError, T as TimeoutError, h as NetworkError, k as isPayloadTooLargeErrorBody, n as parseErrorResponse, x as SandboxError, y as QuotaError } from "./errors-
|
|
1
|
+
import { A as FILE_UPLOAD_SESSION_MAX_BYTES, O as isFileTooLargeErrorBody, S as ServerError, T as TimeoutError, h as NetworkError, k as isPayloadTooLargeErrorBody, n as parseErrorResponse, x as SandboxError, y as QuotaError } from "./errors-BfR-fBvN.js";
|
|
2
2
|
//#region src/generated/sandbox-upload-operations.ts
|
|
3
3
|
function uploadSessionInit(transport, input, init = {}) {
|
|
4
4
|
return transport.fetch(`/fs/upload-session`, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as FILE_UPLOAD_SESSION_MAX_BYTES } from "./errors-
|
|
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 { A as FILE_UPLOAD_SESSION_MAX_BYTES } from "./errors-BfR-fBvN.js";
|
|
2
|
+
import { a as planCompression, i as partCount, n as commitSession, o as putPart, r as initUploadSession, t as abortSession } from "./chunked-upload-CyP-FOeZ.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,4 +1,4 @@
|
|
|
1
|
-
import { n as agentProfileJsonSchema, r as agentProfileSchema } from "./profile-schema-
|
|
1
|
+
import { n as agentProfileJsonSchema, r as agentProfileSchema } from "./profile-schema-nys6Qejd.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import "@tangle-network/agent-interface/harness-capabilities";
|
|
4
4
|
//#region ../../../packages/cli-agent-registry/dist/harness-contracts-CmeBS1Uq.mjs
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { C as encodePromptForWire, D as isBrowserRuntime, F as withoutCreateOnlyModelFields, O as applyRequestedModel, P as withProfileHarness, U as backendTypeSchema, j as normalizeRuntimeBackendConfig, k as assertCurrentBackendType, o as requestInteractiveSessionToken } from "./interactive-controller-
|
|
2
|
-
import { r as agentProfileSchema } from "./profile-schema-
|
|
3
|
-
import { A as
|
|
4
|
-
import { D as isInsideReservedDir, E as ValidationError, S as ServerError, T as TimeoutError, _ as PartialFailureError, a as AuthError, g as NotFoundError, h as NetworkError, i as readResponseJson, n as parseErrorResponse, r as parseResponseError, x as SandboxError } from "./errors-
|
|
5
|
-
import { n as combineAbortSignals } from "./abort-signal-
|
|
6
|
-
import { t as fetchSandboxApi } from "./api-request-
|
|
7
|
-
import { n as fetchWithKeepAlive } from "./keep-alive-fetch
|
|
8
|
-
import { t as parseSSEStream } from "./sse-parser-
|
|
9
|
-
import { t as LinesClient } from "./lines-
|
|
1
|
+
import { C as encodePromptForWire, D as isBrowserRuntime, F as withoutCreateOnlyModelFields, O as applyRequestedModel, P as withProfileHarness, U as backendTypeSchema, j as normalizeRuntimeBackendConfig, k as assertCurrentBackendType, o as requestInteractiveSessionToken } from "./interactive-controller-DRWdHdgK.js";
|
|
2
|
+
import { r as agentProfileSchema } from "./profile-schema-nys6Qejd.js";
|
|
3
|
+
import { A as normalizeStartupDiagnostics, B as generateIdempotencyKey, D as isRetryableProfileFileMaterializeFailure, E as validateDeferredProfileFileMounts, F as normalizeSandboxShape, H as isRateLimitCreateError, M as normalizeConnection, N as normalizeEgressPolicyFields, O as normalizeCaptureProof, P as normalizeProxySecretReceipt, R as DEPLOY_WINDOW_RETRY_MS, T as splitInlineProfileSkills, U as isRetryableCreateError, V as isDeployWindowCreateError, W as waitForCreateRetry, j as parseStopPhase, k as normalizeSandboxCreateReceipt, n as createSandboxInstanceFromResponse, o as exportTraceBundle, w as splitInlineProfileFileMounts, z as createRetryDelayMs } from "./sandbox-CIfbsytC.js";
|
|
4
|
+
import { D as isInsideReservedDir, E as ValidationError, S as ServerError, T as TimeoutError, _ as PartialFailureError, a as AuthError, g as NotFoundError, h as NetworkError, i as readResponseJson, n as parseErrorResponse, r as parseResponseError, x as SandboxError } from "./errors-BfR-fBvN.js";
|
|
5
|
+
import { n as combineAbortSignals } from "./abort-signal-CDxyloxz.js";
|
|
6
|
+
import { t as fetchSandboxApi } from "./api-request-DNrodWdz.js";
|
|
7
|
+
import { n as fetchWithKeepAlive } from "./keep-alive-fetch-BbSFbRCd.js";
|
|
8
|
+
import { t as parseSSEStream } from "./sse-parser-DrI47LyG.js";
|
|
9
|
+
import { t as LinesClient } from "./lines-DlLR4pHq.js";
|
|
10
10
|
import { PublicTemplatesClient } from "./public-templates.js";
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
//#region ../../../packages/runtime-contracts/dist/git-policy.js
|
|
@@ -1211,11 +1211,11 @@ function isLocalSandboxEndpoint(baseUrl) {
|
|
|
1211
1211
|
}
|
|
1212
1212
|
}
|
|
1213
1213
|
async function resolveLocalCliAuthFiles(backendType) {
|
|
1214
|
-
const { discoverLocalCliAuthFiles } = await import("./local-cli-auth-
|
|
1214
|
+
const { discoverLocalCliAuthFiles } = await import("./local-cli-auth-CI2d1Pdh.js");
|
|
1215
1215
|
return discoverLocalCliAuthFiles(backendType);
|
|
1216
1216
|
}
|
|
1217
1217
|
async function loadLocalCliAuthExpectation(backendType) {
|
|
1218
|
-
const { describeLocalCliAuthExpectation: describe } = await import("./local-cli-auth-
|
|
1218
|
+
const { describeLocalCliAuthExpectation: describe } = await import("./local-cli-auth-CI2d1Pdh.js");
|
|
1219
1219
|
return describe(backendType);
|
|
1220
1220
|
}
|
|
1221
1221
|
/**
|
|
@@ -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 { G as AgentProfileConfidential, J as AgentProfileMcpServer, K as AgentProfileConfigValue, U as AgentProfile, X as AgentProfileSeat, Y as AgentProfileMetadata, b as SandboxSizePreset, bt as SandboxError, c as MintInteractiveSessionTokenOptions, k as AgentInteractiveSessionRef, q as AgentProfileFileMount, 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, _o as PublicBatchRunRequest, _t as ListSandboxFleetOptions, a as DeleteMatchingSandboxesResult, an as SandboxInfo, bi as IntelligenceReportBudget, bn as TeeAttestationResponse, bo as BatchEvent, 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, mo as BatchResult, 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, vo as PublicBatchRunRequestInput, 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-CE4JMgzA.js";
|
|
2
|
+
import { G as AgentProfileConfidential, J as AgentProfileMcpServer, K as AgentProfileConfigValue, U as AgentProfile, X as AgentProfileSeat, Y as AgentProfileMetadata, b as SandboxSizePreset, bt as SandboxError, c as MintInteractiveSessionTokenOptions, k as AgentInteractiveSessionRef, q as AgentProfileFileMount, u as ScopedToken } from "./terminal-stream-types-8-sAl2J0.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, _o as PublicBatchRunRequest, _t as ListSandboxFleetOptions, a as DeleteMatchingSandboxesResult, an as SandboxInfo, bi as IntelligenceReportBudget, bn as TeeAttestationResponse, bo as BatchEvent, 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, mo as BatchResult, 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, vo as PublicBatchRunRequestInput, 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-BVyyOVyf.js";
|
|
4
|
+
import { t as LinesClient } from "./lines-Dc42Gr39.js";
|
|
5
|
+
import { a as PublicTemplatesClient } from "./public-templates-DA4_Hn6B.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
|
|
8
8
|
//#region src/backend-registry.d.ts
|
|
@@ -1559,6 +1559,7 @@ declare function collectAgentFinalMessageText(events: SandboxEvent[]): string |
|
|
|
1559
1559
|
type DownloadTransport = (signal?: AbortSignal, init?: {
|
|
1560
1560
|
headers?: Record<string, string>;
|
|
1561
1561
|
}) => Promise<Response>;
|
|
1562
|
+
/** Verify bounded bytes through EOF; cancellation propagates to the response body. */
|
|
1562
1563
|
/** Retain only complete downloads; failed streams leave the destination intact. */
|
|
1563
1564
|
declare function downloadFile(request: DownloadTransport, localPath: string, options?: DownloadOptions): Promise<DownloadResult>;
|
|
1564
1565
|
//#endregion
|
|
@@ -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-Dqcr9p97.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-CX_XvFZZ.js";
|
|
2
2
|
export { CollaborationClient, CollaborationFileBridge, buildCollaborationDocumentId, normalizeCollaborationPath, parseCollaborationDocumentId };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TimeoutError, h as NetworkError, n as parseErrorResponse } from "./errors-
|
|
1
|
+
import { T as TimeoutError, h as NetworkError, n as parseErrorResponse } from "./errors-BfR-fBvN.js";
|
|
2
2
|
//#region src/collaboration/client.ts
|
|
3
3
|
const DEFAULT_TIMEOUT_MS = 3e4;
|
|
4
4
|
function normalizeBaseUrl(url) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { r as agentProfileSchema } from "./profile-schema-
|
|
2
|
-
import {
|
|
3
|
-
import { E as ValidationError, s as CapabilityError, x as SandboxError } from "./errors-
|
|
4
|
-
import { t as awaitWithAbort } from "./abort-signal-
|
|
5
|
-
import { r as cliAuthReferenceSchema } from "./cli-auth-bundle-BDGLGvMu-
|
|
6
|
-
import "./cli-auth-bundle-
|
|
1
|
+
import { r as agentProfileSchema } from "./profile-schema-nys6Qejd.js";
|
|
2
|
+
import { G as canonicalAgentProfileDigest } from "./sandbox-CIfbsytC.js";
|
|
3
|
+
import { E as ValidationError, s as CapabilityError, x as SandboxError } from "./errors-BfR-fBvN.js";
|
|
4
|
+
import { t as awaitWithAbort } from "./abort-signal-CDxyloxz.js";
|
|
5
|
+
import { r as cliAuthReferenceSchema } from "./cli-auth-bundle-BDGLGvMu-BXdVAPNF.js";
|
|
6
|
+
import "./cli-auth-bundle-nPm8yuKO.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/failure-kind.ts
|
|
9
9
|
const LOST_CODES = new Set(["BACKING_CONTAINER_MISSING", "SANDBOX_NOT_FOUND"]);
|
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 { Ct as ServerError, Dt as TimeoutError, Ot as ValidationError, St as SandboxFailureDetail, _t as ProfileFileMountPathError, bt as SandboxError, gt as PartialFailureError, ht as NotFoundError, it as AuthError, mt as NetworkError, ot as CapabilityError, rt as parseErrorResponse, ut as FileWriteConflictError, vt as QuotaError, wt as StateError, xt as SandboxErrorJson } from "./terminal-stream-types-
|
|
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 { Ct as InstanceRestartingError, Dt as sandboxFailureKind, Et as SandboxFailureKind, St as InstanceRecord, Tt as InstancesClient, _t as gatewaySeatTransport, an as backendRegistryEntrySchema, bt as HostedInstance, cn as isBackendRegistryInteractionKind, ct as SandboxResolvedSeat, dt as SeatOwnerReply, en as BackendRegistryCapabilities, ft as SeatOwnerTransport, gt as createSelectSeat, ht as SeatSelectionRequest, in as backendRegistryCapabilitiesSchema, ln as parseBackendRegistryResponse, lt as SandboxSeatCredentials, mt as SeatSelectionError, nn as BackendRegistryInteractionKind, on as backendRegistryInteractionKindSchema, ot as ISOLATED_CREATION_ATTESTATION_VERSION, pt as SeatResolutionObservation, rn as BackendRegistryResponse, sn as backendRegistryResponseSchema, st as CreateSelectSeatOptions, t as Sandbox, tn as BackendRegistryEntry, un as parseBackendRegistryResponseBody, ut as SandboxSeatSelectionInput, vt as ManagedProcessClient, xt as InstanceProfile, yt as EnsureInstanceOptions } from "./client-
|
|
6
|
-
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-
|
|
1
|
+
import { B as WorkspaceImages, O as SandboxInstance, V as ProfileFileDeliveryReport, z as WorkspaceImagePublishRequestOptions } from "./index-CE4JMgzA.js";
|
|
2
|
+
import { Ct as ServerError, Dt as TimeoutError, Ot as ValidationError, St as SandboxFailureDetail, _t as ProfileFileMountPathError, bt as SandboxError, gt as PartialFailureError, ht as NotFoundError, it as AuthError, mt as NetworkError, ot as CapabilityError, rt as parseErrorResponse, ut as FileWriteConflictError, vt as QuotaError, wt as StateError, xt as SandboxErrorJson } from "./terminal-stream-types-8-sAl2J0.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-BVyyOVyf.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-Dc42Gr39.js";
|
|
5
|
+
import { Ct as InstanceRestartingError, Dt as sandboxFailureKind, Et as SandboxFailureKind, St as InstanceRecord, Tt as InstancesClient, _t as gatewaySeatTransport, an as backendRegistryEntrySchema, bt as HostedInstance, cn as isBackendRegistryInteractionKind, ct as SandboxResolvedSeat, dt as SeatOwnerReply, en as BackendRegistryCapabilities, ft as SeatOwnerTransport, gt as createSelectSeat, ht as SeatSelectionRequest, in as backendRegistryCapabilitiesSchema, ln as parseBackendRegistryResponse, lt as SandboxSeatCredentials, mt as SeatSelectionError, nn as BackendRegistryInteractionKind, on as backendRegistryInteractionKindSchema, ot as ISOLATED_CREATION_ATTESTATION_VERSION, pt as SeatResolutionObservation, rn as BackendRegistryResponse, sn as backendRegistryResponseSchema, st as CreateSelectSeatOptions, t as Sandbox, tn as BackendRegistryEntry, un as parseBackendRegistryResponseBody, ut as SandboxSeatSelectionInput, vt as ManagedProcessClient, xt as InstanceProfile, yt as EnsureInstanceOptions } from "./client-BdoEjuk9.js";
|
|
6
|
+
import { a as PublicTemplatesClient, i as PublicTemplatePublishRequestOptions, n as PublicTemplatePublishError, r as PublicTemplatePublishJob, t as PublicTemplatePublishArtifact } from "./public-templates-DA4_Hn6B.js";
|
|
7
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 };
|
package/dist/core.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
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, n as parseErrorResponse, s as CapabilityError, v as ProfileFileMountPathError, x as SandboxError, y as QuotaError } from "./errors-
|
|
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 { b as ManagedProcessClient, r as WorkspaceImages, t as SandboxInstance } from "./sandbox-CIfbsytC.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, n as parseErrorResponse, s as CapabilityError, v as ProfileFileMountPathError, x as SandboxError, y as QuotaError } from "./errors-BfR-fBvN.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-BSK8I_4r.js";
|
|
4
|
+
import { i as profileChannelReference, r as lineInstanceKey, t as LinesClient } from "./lines-DlLR4pHq.js";
|
|
5
5
|
import { PublicTemplatePublishError, PublicTemplatesClient } from "./public-templates.js";
|
|
6
|
-
import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-
|
|
6
|
+
import { a as LINE_APPLICATION_REPLY_MAX_CHARS, c as parseLineApplicationResult, i as gatewaySeatTransport, l as sandboxFailureKind, n as SeatSelectionError, o as LINE_APPLICATION_REQUEST_MAX_BYTES, r as createSelectSeat, s as parseLineApplicationRequest, t as ISOLATED_CREATION_ATTESTATION_VERSION } from "./core-DEFF0nLW.js";
|
|
7
7
|
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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as parseSandboxRetryAfterHeader } from "./retry-after-header-
|
|
1
|
+
import { t as parseSandboxRetryAfterHeader } from "./retry-after-header-DUdCC0KJ.js";
|
|
2
2
|
//#region ../../../packages/runtime-contracts/dist/file-api-roots.js
|
|
3
3
|
/**
|
|
4
4
|
* The agent user's home directory inside a sandbox. A profile mount path
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { n as bytesToHex, t as sha256 } from "./sha2-vu4U-x2L.js";
|
|
2
|
+
import { E as ValidationError } from "./errors-BfR-fBvN.js";
|
|
3
|
+
//#region src/lib/file-download.ts
|
|
4
|
+
function downloadBounds(options) {
|
|
5
|
+
for (const [name, value] of Object.entries({
|
|
6
|
+
maxBytes: options.maxBytes,
|
|
7
|
+
expectedSize: options.expectedSize
|
|
8
|
+
})) if (value !== void 0 && (!Number.isSafeInteger(value) || value < 0)) throw new ValidationError(`${name} must be a non-negative safe integer`);
|
|
9
|
+
const expectedHash = options.expectedSha256?.replace(/^sha256:/, "");
|
|
10
|
+
if (expectedHash !== void 0 && !/^[a-f0-9]{64}$/i.test(expectedHash)) throw new ValidationError("expectedSha256 must be a SHA-256 digest");
|
|
11
|
+
const maxBytes = options.maxBytes ?? Number.MAX_SAFE_INTEGER;
|
|
12
|
+
if (options.expectedSize !== void 0 && options.expectedSize > maxBytes) throw new ValidationError("expectedSize exceeds download maxBytes");
|
|
13
|
+
return {
|
|
14
|
+
maxBytes,
|
|
15
|
+
expectedHash: expectedHash?.toLowerCase()
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** Verify bounded bytes through EOF; cancellation propagates to the response body. */
|
|
19
|
+
function verifyDownload(response, options, complete = () => {}) {
|
|
20
|
+
try {
|
|
21
|
+
const { maxBytes, expectedHash } = downloadBounds(options);
|
|
22
|
+
options.signal?.throwIfAborted();
|
|
23
|
+
const length = response.headers.get("content-length");
|
|
24
|
+
const totalBytes = length === null ? void 0 : Number(length);
|
|
25
|
+
if (length !== null && (!/^\d+$/.test(length) || !Number.isSafeInteger(totalBytes))) throw new Error("Download returned an invalid content-length");
|
|
26
|
+
if (totalBytes !== void 0 && totalBytes > maxBytes) throw new Error("Download exceeds maxBytes");
|
|
27
|
+
if (options.expectedSize !== void 0 && totalBytes !== void 0 && totalBytes !== options.expectedSize) throw new Error("Download size does not match expectedSize");
|
|
28
|
+
const hash = sha256.create();
|
|
29
|
+
let sizeBytes = 0;
|
|
30
|
+
if (totalBytes !== void 0 && totalBytes > 0) options.onProgress?.({
|
|
31
|
+
bytesDownloaded: 0,
|
|
32
|
+
totalBytes,
|
|
33
|
+
percentage: 0
|
|
34
|
+
});
|
|
35
|
+
return (response.body ?? new Blob().stream()).pipeThrough(new TransformStream({
|
|
36
|
+
transform(chunk, controller) {
|
|
37
|
+
sizeBytes += chunk.byteLength;
|
|
38
|
+
if (sizeBytes > maxBytes) throw new Error("Download exceeds maxBytes");
|
|
39
|
+
if (options.expectedSize !== void 0 && sizeBytes > options.expectedSize) throw new Error("Download size does not match expectedSize");
|
|
40
|
+
hash.update(chunk);
|
|
41
|
+
if (totalBytes !== void 0 && sizeBytes < totalBytes) options.onProgress?.({
|
|
42
|
+
bytesDownloaded: sizeBytes,
|
|
43
|
+
totalBytes,
|
|
44
|
+
percentage: sizeBytes / totalBytes * 100
|
|
45
|
+
});
|
|
46
|
+
controller.enqueue(chunk);
|
|
47
|
+
},
|
|
48
|
+
flush() {
|
|
49
|
+
options.signal?.throwIfAborted();
|
|
50
|
+
if (totalBytes !== void 0 && sizeBytes !== totalBytes || options.expectedSize !== void 0 && sizeBytes !== options.expectedSize) throw new Error("Download was truncated or its size changed");
|
|
51
|
+
const digest = bytesToHex(hash.digest());
|
|
52
|
+
if (expectedHash !== void 0 && digest !== expectedHash) throw new Error("Download SHA-256 does not match expectedSha256");
|
|
53
|
+
complete({
|
|
54
|
+
sizeBytes,
|
|
55
|
+
sha256: digest
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}), { signal: options.signal });
|
|
59
|
+
} catch (error) {
|
|
60
|
+
response.body?.cancel(error).catch(() => {});
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/** Retain only complete downloads; failed streams leave the destination intact. */
|
|
65
|
+
async function downloadFile(request, localPath, options = {}) {
|
|
66
|
+
downloadBounds(options);
|
|
67
|
+
options.signal?.throwIfAborted();
|
|
68
|
+
const capable = options.parallel && options.parallel > 1 ? await probeRangeSupport(request, options.signal) : void 0;
|
|
69
|
+
const fs = await import("node:fs/promises");
|
|
70
|
+
const path = await import("node:path");
|
|
71
|
+
await fs.mkdir(path.dirname(localPath), { recursive: true });
|
|
72
|
+
const directory = await fs.mkdtemp(path.join(path.dirname(localPath), ".sandbox-download-"));
|
|
73
|
+
const temporaryPath = path.join(directory, "content");
|
|
74
|
+
let opened;
|
|
75
|
+
try {
|
|
76
|
+
const file = await fs.open(temporaryPath, "wx+", 384);
|
|
77
|
+
opened = file;
|
|
78
|
+
let result;
|
|
79
|
+
if (capable !== void 0) result = await downloadParallel(request, file, options, capable, options.parallel ?? 1);
|
|
80
|
+
else await verifyDownload(await request(options.signal), options, (value) => {
|
|
81
|
+
result = value;
|
|
82
|
+
}).pipeTo(new WritableStream({ write: (chunk) => file.writeFile(chunk) }));
|
|
83
|
+
await file.close();
|
|
84
|
+
opened = void 0;
|
|
85
|
+
options.signal?.throwIfAborted();
|
|
86
|
+
if (options.overwrite === false) await fs.link(temporaryPath, localPath);
|
|
87
|
+
else await fs.rename(temporaryPath, localPath);
|
|
88
|
+
options.onProgress?.({
|
|
89
|
+
bytesDownloaded: result.sizeBytes,
|
|
90
|
+
totalBytes: result.sizeBytes,
|
|
91
|
+
percentage: 100
|
|
92
|
+
});
|
|
93
|
+
return result;
|
|
94
|
+
} finally {
|
|
95
|
+
try {
|
|
96
|
+
await opened?.close();
|
|
97
|
+
} finally {
|
|
98
|
+
await fs.rm(directory, {
|
|
99
|
+
recursive: true,
|
|
100
|
+
force: true
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
/** Probe with a one-byte range: only a 206 with a parseable Content-Range
|
|
106
|
+
* counts as capability (200 = ignored Range, anything else = no). */
|
|
107
|
+
async function probeRangeSupport(request, signal) {
|
|
108
|
+
signal?.throwIfAborted();
|
|
109
|
+
const response = await request(signal, { headers: { Range: "bytes=0-0" } });
|
|
110
|
+
if (response.status !== 206) return void 0;
|
|
111
|
+
const contentRange = response.headers.get("content-range");
|
|
112
|
+
const total = contentRange ? /\/(\d+)$/.exec(contentRange)?.[1] : void 0;
|
|
113
|
+
if (total === void 0) return void 0;
|
|
114
|
+
await response.arrayBuffer().catch(() => void 0);
|
|
115
|
+
const totalBytes = Number(total);
|
|
116
|
+
return Number.isSafeInteger(totalBytes) ? totalBytes : void 0;
|
|
117
|
+
}
|
|
118
|
+
/** Parallel range download: N slices fetched concurrently, written at their
|
|
119
|
+
* offsets into one temp file, hashed in order on a single sequential re-read,
|
|
120
|
+
* published atomically. A failed or truncated slice fails loud — the
|
|
121
|
+
* destination never sees a partial file. */
|
|
122
|
+
async function downloadParallel(request, file, options, totalBytes, parallel) {
|
|
123
|
+
const { maxBytes } = downloadBounds(options);
|
|
124
|
+
if (totalBytes > maxBytes) throw new Error("Download exceeds maxBytes");
|
|
125
|
+
if (options.expectedSize !== void 0 && totalBytes !== options.expectedSize) throw new Error("Download size does not match expectedSize");
|
|
126
|
+
let received = 0;
|
|
127
|
+
options.onProgress?.({
|
|
128
|
+
bytesDownloaded: 0,
|
|
129
|
+
totalBytes,
|
|
130
|
+
percentage: 0
|
|
131
|
+
});
|
|
132
|
+
const cancelled = new AbortController();
|
|
133
|
+
const signal = AbortSignal.any([cancelled.signal, ...options.signal ? [options.signal] : []]);
|
|
134
|
+
const slices = sliceRanges(totalBytes, parallel).map(async ({ start, end }) => {
|
|
135
|
+
signal.throwIfAborted();
|
|
136
|
+
const response = await request(signal, { headers: { Range: `bytes=${start}-${end}` } });
|
|
137
|
+
if (response.status !== 206) throw new Error(`Range request answered ${response.status} after a 206 probe`);
|
|
138
|
+
const sliceBytes = end - start + 1;
|
|
139
|
+
const buffer = Buffer.from(await response.arrayBuffer());
|
|
140
|
+
if (buffer.byteLength !== sliceBytes) throw new Error(`Range slice ${start}-${end} returned ${buffer.byteLength} bytes (truncated)`);
|
|
141
|
+
await file.write(buffer, 0, sliceBytes, start);
|
|
142
|
+
received += sliceBytes;
|
|
143
|
+
options.onProgress?.({
|
|
144
|
+
bytesDownloaded: received,
|
|
145
|
+
totalBytes,
|
|
146
|
+
percentage: received / totalBytes * 100
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
try {
|
|
150
|
+
await Promise.all(slices);
|
|
151
|
+
} finally {
|
|
152
|
+
cancelled.abort();
|
|
153
|
+
await Promise.allSettled(slices);
|
|
154
|
+
}
|
|
155
|
+
const { Readable } = await import("node:stream");
|
|
156
|
+
let result;
|
|
157
|
+
await verifyDownload(new Response(Readable.toWeb(file.createReadStream({ autoClose: false }))), {
|
|
158
|
+
...options,
|
|
159
|
+
expectedSize: totalBytes,
|
|
160
|
+
onProgress: void 0
|
|
161
|
+
}, (value) => {
|
|
162
|
+
result = value;
|
|
163
|
+
}).pipeTo(new WritableStream());
|
|
164
|
+
if (received !== totalBytes) throw new Error("Download was truncated or its size changed");
|
|
165
|
+
return result;
|
|
166
|
+
}
|
|
167
|
+
/** Split [0, total) into `count` contiguous inclusive ranges. */
|
|
168
|
+
function sliceRanges(total, count) {
|
|
169
|
+
const chunk = Math.ceil(total / count);
|
|
170
|
+
const ranges = [];
|
|
171
|
+
for (let start = 0; start < total; start += chunk) ranges.push({
|
|
172
|
+
start,
|
|
173
|
+
end: Math.min(start + chunk, total) - 1
|
|
174
|
+
});
|
|
175
|
+
return ranges;
|
|
176
|
+
}
|
|
177
|
+
//#endregion
|
|
178
|
+
export { verifyDownload as n, downloadFile as t };
|