@tangle-network/sandbox 1.0.21 → 1.0.23
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-I1nMkkrz.d.ts → agent-run-outcome-DQjHjmTQ.d.ts} +2 -2
- package/dist/{api-request-EseiF9B1.js → api-request-DNrodWdz.js} +1 -1
- package/dist/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{browser-interactive-control-controller-Bt1vcu9c.js → browser-interactive-control-controller-EhML8YjF.js} +186 -2131
- package/dist/{browser-interactive-control-controller-CVnME80O.d.ts → browser-interactive-control-controller-i9JtmJDf.d.ts} +1 -1
- package/dist/{chunked-upload-Df_5Q2x8.js → chunked-upload-KRWmiJsw.js} +1 -1
- package/dist/{chunked-upload-file-Dtm1GBkE.js → chunked-upload-file-DPSyrGUb.js} +2 -2
- package/dist/cli-auth-bundle-V7sPQYej.js +1594 -0
- package/dist/{client-DEvdnu0z.d.ts → client-1bgxaNQD.d.ts} +5 -5
- package/dist/{client-HMGk7nNW.js → client-DC1Q6oJb.js} +11 -11
- package/dist/collaboration/index.d.ts +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/{collaboration-BTGTf3We.js → collaboration-DPukGUcF.js} +1 -1
- package/dist/{core-DvYE_89H.js → core-0iCiDt_5.js} +5 -5
- package/dist/core.d.ts +6 -6
- package/dist/core.js +5 -5
- package/dist/{direct-http2-B0ra_xhU.js → direct-http2-C0H7zN9h.js} +1 -1
- package/dist/{errors-ZmDrrk4f.js → errors-BUPIDjn4.js} +1 -1
- package/dist/{sha2-BUPMvGTk.js → harness-DkCl2wJv.js} +417 -1
- package/dist/{index-C3GQDkDm.d.ts → index-vcweImuL.d.ts} +6 -6
- package/dist/index.d.ts +11 -11
- package/dist/index.js +11 -11
- package/dist/intelligence/index.js +2 -2
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-Bf8yrdzR.d.ts → interactive-controller-B16SZKZt.d.ts} +3 -3
- package/dist/{interactive-controller-BkfV4Cs_.js → interactive-controller-kZk52Eff.js} +19 -21
- package/dist/lib/prepared-evidence.js +1 -1
- package/dist/lib/prepared-process.js +1 -1
- package/dist/{lines-BqZOl_io.js → lines-BnAWHGX3.js} +1 -1
- package/dist/{lines-CA1IbRzE.d.ts → lines-BxCEZUkf.d.ts} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/lines.js +1 -1
- package/dist/{local-cli-auth-DzovETOu.js → local-cli-auth-CJuKPr1j.js} +1 -1
- package/dist/{mcp-local-BcRLN_Ic.js → mcp-local-C88efQL3.js} +1 -1
- package/dist/{prepared-evidence-CuUh_mz6.js → prepared-evidence-DC-M4WEF.js} +1 -1
- package/dist/{preview-DQs0Zh9L.d.ts → preview-QcwZWgzk.d.ts} +3 -3
- package/dist/{profile-schema-CT3hB1mG.js → profile-schema-1WmjXjE9.js} +23 -12
- package/dist/{public-templates-COGktcNu.d.ts → public-templates-GNIKn_wg.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/public-templates.js +1 -1
- package/dist/{raw-evidence-archive-CqarcYcp.js → raw-evidence-archive-Bc-OdA_Q.js} +1 -1
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +5 -5
- package/dist/{sandbox-BAhF5QaX.js → sandbox-Qn9ScVvS.js} +46 -48
- package/dist/{secp256k1-CZWrpqxW.js → secp256k1-BGtA1PsN.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/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-CwfZovBM.js → tangle-DOwUAne4.js} +4 -4
- package/dist/{terminal-stream-types-DwXQzUbH.d.ts → terminal-stream-types-BM5J4lt0.d.ts} +155 -769
- package/dist/{types-BF8se4_x.d.ts → types-MYaFNkH5.d.ts} +7 -7
- package/package.json +8 -8
- package/dist/cli-auth-bundle-KtV88h1f.js +0 -2597
- package/dist/harness-BD_OISom.js +0 -201
- package/dist/harness-DWL2MM4q.js +0 -418
- /package/dist/{abort-signal-jU-SEjLT.js → abort-signal-CDxyloxz.js} +0 -0
- /package/dist/{cli-auth-bundle-MskLEgtA.d.ts → cli-auth-bundle-CFZx0muA.d.ts} +0 -0
- /package/dist/{index-Dqcr9p97.d.ts → index-DnZdhFs2.d.ts} +0 -0
- /package/dist/{index-Dslyq85a.d.ts → index-rbeL2Rct.d.ts} +0 -0
- /package/dist/{keep-alive-fetch-C2DX2_rG.js → keep-alive-fetch-BbSFbRCd.js} +0 -0
- /package/dist/{prepared-process-LjBfQnZ5.js → prepared-process-BQUSksTH.js} +0 -0
- /package/dist/{preview-operations-BvgwYaoL.js → preview-operations-D2fXB_dc.js} +0 -0
- /package/dist/{response-rewrap-MBztoTLx.js → response-rewrap-CpNkboDX.js} +0 -0
- /package/dist/{retry-after-header-BZbs5rig.js → retry-after-header-DUdCC0KJ.js} +0 -0
- /package/dist/{sidecar-proxy-error-Dty4zmN7.js → sidecar-proxy-error-5DpLmHeN.js} +0 -0
- /package/dist/{sse-parser-CJ52bhG3.js → sse-parser-CKkE9zWy.js} +0 -0
- /package/dist/{utils-vaFoyyiO.js → utils-CoawKwX_.js} +0 -0
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import { a as normalizeEffectiveBackend, r as backendTypeSchema } from "./backend-types-CLvdSX8V.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import { r as
|
|
6
|
-
import { A as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { t as runPreparedProcess } from "./prepared-process-LjBfQnZ5.js";
|
|
17
|
-
import { n as SandboxLines } from "./lines-BqZOl_io.js";
|
|
2
|
+
import { C as boundedIdentifierSchema, E as boundedStringSchema, _ as sha256, g as sha256DigestSchema$1, o as canonicalCandidateDigest$1, s as canonicalCandidateJson$1, u as isCanonicalJsonValue$1 } from "./harness-DkCl2wJv.js";
|
|
3
|
+
import { A as agentInteractiveSessionStatusMatchesRef, B as PlanContinuationSchema, C as AgentInteractiveSessionStopAcknowledgementSchema, D as agentInteractiveSessionControlClaimMatchesRef, E as agentInteractiveSessionControlClaimIsNewer, F as AgentRunCancellationAcknowledgementSchema, G as InteractionResponseSchema, H as InteractionBindingSchema, I as AgentRunCancellationRequestSchema, L as agentRunCancellationAcknowledgementMatchesRequest, M as agentInteractiveDimensionSchema, N as sameAgentExactRun, O as agentInteractiveSessionPromptAcknowledgementMatchesCommand, P as AgentExactRunControlRefSchema, S as AgentInteractiveSessionStatusSchema, T as agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, U as InteractionRequestSchema, V as InteractionAcknowledgementSchema, W as InteractionResponseCommandSchema, _ as AgentInteractiveSessionControlClaimRequestSchema, b as AgentInteractiveSessionPromptCommandSchema, d as interactiveSessionControlClaimResponseSchema, f as interactiveSessionControlReleaseResponseSchema, g as AgentInteractiveSessionControlClaimAcknowledgementSchema, h as AgentInteractiveSessionAttachSchema, j as agentInteractiveSessionStopAcknowledgementMatchesCommand, l as createInteractiveControlHolderId, m as interactiveSessionStatusResponseSchema, p as interactiveSessionControlValidationResponseSchema, v as AgentInteractiveSessionControlClaimSchema, w as AgentInteractiveSessionStopCommandSchema, x as AgentInteractiveSessionRefSchema, y as AgentInteractiveSessionPromptAcknowledgementSchema } from "./browser-interactive-control-controller-EhML8YjF.js";
|
|
4
|
+
import { a as canonicalAgentProfileValue, r as agentProfileSchema } from "./profile-schema-1WmjXjE9.js";
|
|
5
|
+
import { A as requestedPublicProfileDigest, C as encodeTextForWire, E as assertCurrentBackendType, F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, O as mergeRuntimeBackendConfig, P as withoutRuntimeSecrets, S as encodePromptForWire, T as applyRequestedModel, _ as mintTraceId, a as assertScopedTokenActive, b as resolveDispatchRunIdentity, c as SandboxRuntimeApi, d as appendSessionIdQuery, f as sessionHeaders, g as isTraceId, h as TRACE_ID_HEADER, i as terminalUpgradeHeadersSupported, j as requestedSecretProfilePublicDigest, k as normalizeRuntimeBackendConfig, l as normalizeSessionInfo, m as waitForRetryAfter, n as InteractiveSessionController, p as isRetryableCredentialRefusal, r as TerminalStream, s as requestScopedToken, u as sessionMessageRequestBody, v as resolveTraceId, w as canUseNodeHttp2, x as validateAcceptedDispatchRunRef, y as traceHeaders } from "./interactive-controller-kZk52Eff.js";
|
|
6
|
+
import { A as SANDBOX_PROXY_REQUEST_MAX_BYTES, C as StateError, E as ValidationError, F as isProfileFileMountOutsideRoots, I as profileFileMountOutsideRootsMessage, M as PROFILE_FILE_MOUNT_OUTSIDE_ROOTS_CODE, N as SANDBOX_AGENT_HOME, P as SANDBOX_FILE_API_ABSOLUTE_ROOTS, S as ServerError, T as TimeoutError, a as AuthError, g as NotFoundError, h as NetworkError, i as readResponseJson, l as EdgeNotReadyError, n as parseErrorResponse, r as parseResponseError, s as CapabilityError, t as TerminalStreamError, v as ProfileFileMountPathError, w as StreamInterruptedError, x as SandboxError, y as QuotaError } from "./errors-BUPIDjn4.js";
|
|
7
|
+
import { n as combineAbortSignals, r as delayUntilAborted, t as awaitWithAbort } from "./abort-signal-CDxyloxz.js";
|
|
8
|
+
import { t as rewrapResponse } from "./response-rewrap-CpNkboDX.js";
|
|
9
|
+
import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch-BbSFbRCd.js";
|
|
10
|
+
import { t as SIDECAR_PROXY_ERROR_HEADER } from "./sidecar-proxy-error-5DpLmHeN.js";
|
|
11
|
+
import { t as parseSSEStream } from "./sse-parser-CKkE9zWy.js";
|
|
12
|
+
import { s as uploadChunked } from "./chunked-upload-KRWmiJsw.js";
|
|
13
|
+
import { t as runPreparedProcess } from "./prepared-process-BQUSksTH.js";
|
|
14
|
+
import { r as cliAuthReferenceSchema } from "./cli-auth-bundle-V7sPQYej.js";
|
|
15
|
+
import { n as SandboxLines } from "./lines-BnAWHGX3.js";
|
|
18
16
|
import { z } from "zod";
|
|
19
17
|
import { createHash } from "node:crypto";
|
|
20
18
|
import { constants } from "node:fs";
|
|
@@ -23,7 +21,7 @@ import "node:fs/promises";
|
|
|
23
21
|
import { readTokenCostUsd, readTokenUsage } from "@tangle-network/agent-core";
|
|
24
22
|
import "@tangle-network/agent-interface/environment-provider";
|
|
25
23
|
import { OTLP_SPAN_KIND, OTLP_STATUS_CODE, msToUnixNano, otlpTraceExport, toOtlpAttributes, toW3CSpanId, toW3CTraceId } from "@tangle-network/agent-trace-contract/otlp";
|
|
26
|
-
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.
|
|
24
|
+
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.9.0/node_modules/@tangle-network/agent-interface/dist/agent-execution-preparation.js
|
|
27
25
|
/**
|
|
28
26
|
* Canonical RFC 8785/SHA-256 identity for one validated, public AgentProfile.
|
|
29
27
|
* Secret-capable MCP/hook fields are tagged. Other prompt, resource, metadata,
|
|
@@ -35,10 +33,10 @@ import { OTLP_SPAN_KIND, OTLP_STATUS_CODE, msToUnixNano, otlpTraceExport, toOtlp
|
|
|
35
33
|
function canonicalAgentProfileDigest(profile) {
|
|
36
34
|
const material = canonicalAgentProfileValue(agentProfileSchema.parse(profile));
|
|
37
35
|
if (material === void 0 || !isCanonicalJsonValue$1(material)) throw new Error("AgentProfile must contain finite, acyclic RFC 8785 JSON values");
|
|
38
|
-
return canonicalCandidateDigest$
|
|
36
|
+
return canonicalCandidateDigest$1(material);
|
|
39
37
|
}
|
|
40
38
|
//#endregion
|
|
41
|
-
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.
|
|
39
|
+
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.9.0/node_modules/@tangle-network/agent-interface/dist/environment-interactive-start.js
|
|
42
40
|
const AgentInteractiveSessionRunCoordinatesSchema = z.strictObject({
|
|
43
41
|
provider: boundedIdentifierSchema,
|
|
44
42
|
environmentId: boundedIdentifierSchema,
|
|
@@ -55,7 +53,7 @@ const AgentInteractiveSessionRunCoordinatesSchema = z.strictObject({
|
|
|
55
53
|
const AgentInteractiveSessionStartSchema = z.strictObject({
|
|
56
54
|
run: AgentExactRunControlRefSchema,
|
|
57
55
|
profile: agentProfileSchema,
|
|
58
|
-
requestedProfileDigest: sha256DigestSchema$
|
|
56
|
+
requestedProfileDigest: sha256DigestSchema$1,
|
|
59
57
|
authMode: z.literal("oauth").optional(),
|
|
60
58
|
initialPrompt: boundedStringSchema.optional(),
|
|
61
59
|
cwd: boundedStringSchema.min(1).optional(),
|
|
@@ -66,7 +64,7 @@ const AgentInteractiveSessionStartSchema = z.strictObject({
|
|
|
66
64
|
function agentInteractiveSessionRequestDigest(coordinates, input) {
|
|
67
65
|
const exactCoordinates = AgentInteractiveSessionRunCoordinatesSchema.parse(coordinates);
|
|
68
66
|
const exactInput = AgentInteractiveSessionStartSchema.omit({ run: true }).parse(input);
|
|
69
|
-
return canonicalCandidateDigest$
|
|
67
|
+
return canonicalCandidateDigest$1({
|
|
70
68
|
kind: "agent-interactive-session-start.v1",
|
|
71
69
|
run: exactCoordinates,
|
|
72
70
|
requestedProfileDigest: exactInput.requestedProfileDigest,
|
|
@@ -115,7 +113,7 @@ function runCoordinates(run) {
|
|
|
115
113
|
};
|
|
116
114
|
}
|
|
117
115
|
//#endregion
|
|
118
|
-
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.
|
|
116
|
+
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.9.0/node_modules/@tangle-network/agent-interface/dist/environment-terminal.js
|
|
119
117
|
const terminalDimensionSchema = z.number().int().positive().max(1e4);
|
|
120
118
|
/**
|
|
121
119
|
* Provider-neutral handle for one interactive terminal.
|
|
@@ -1670,7 +1668,7 @@ var DirectRuntimeHttpClient = class {
|
|
|
1670
1668
|
};
|
|
1671
1669
|
if (!route) throw new NetworkError("Direct runtime route was withdrawn");
|
|
1672
1670
|
if ((route.useHost || route.useExec) && canUseNodeHttp2()) {
|
|
1673
|
-
const { fetchDirectHttp2 } = await import("./direct-http2-
|
|
1671
|
+
const { fetchDirectHttp2 } = await import("./direct-http2-C0H7zN9h.js");
|
|
1674
1672
|
return fetchDirectHttp2(route.url, request, timing);
|
|
1675
1673
|
}
|
|
1676
1674
|
return fetchWithKeepAlive(route.url, request, timing);
|
|
@@ -4606,8 +4604,8 @@ const interactiveSessionStopResponseSchema = z.object({
|
|
|
4606
4604
|
success: z.literal(true),
|
|
4607
4605
|
data: AgentInteractiveSessionStopAcknowledgementSchema
|
|
4608
4606
|
}).strict();
|
|
4609
|
-
z.object({ ref: AgentInteractiveSessionRefSchema
|
|
4610
|
-
z.object({ incarnationId: AgentInteractiveSessionRefSchema
|
|
4607
|
+
z.object({ ref: AgentInteractiveSessionRefSchema }).strict();
|
|
4608
|
+
z.object({ incarnationId: AgentInteractiveSessionRefSchema.shape.incarnationId }).strict();
|
|
4611
4609
|
//#endregion
|
|
4612
4610
|
//#region src/interactive-terminal-session.ts
|
|
4613
4611
|
const MAX_RETAINED_TERMINAL_FRAMES = 4096;
|
|
@@ -5049,7 +5047,7 @@ var InteractiveSessionHandle = class {
|
|
|
5049
5047
|
if (exactStart.run.sessionId !== this.sessionId) throw new Error(`Interactive session ${this.sessionId} start is bound to session ${exactStart.run.sessionId}`);
|
|
5050
5048
|
return (requestOptions === void 0 ? this.host._startInteractive(this.sessionId, exactStart) : this.host._startInteractive(this.sessionId, exactStart, requestOptions)).then((info) => {
|
|
5051
5049
|
const ref = AgentInteractiveSessionRefSchema.parse(info.ref);
|
|
5052
|
-
const control = AgentInteractiveSessionControlClaimSchema
|
|
5050
|
+
const control = AgentInteractiveSessionControlClaimSchema.parse(info.control);
|
|
5053
5051
|
if (!agentInteractiveSessionRefMatchesStart(exactStart, ref) || !agentInteractiveSessionControlClaimMatchesRef(ref, control)) throw new Error(`Interactive session ${this.sessionId} start returned an inexact ref or control claim`);
|
|
5054
5052
|
const exactInfo = {
|
|
5055
5053
|
...info,
|
|
@@ -5065,7 +5063,7 @@ var InteractiveSessionHandle = class {
|
|
|
5065
5063
|
requireBinding() {
|
|
5066
5064
|
const ref = this.requireRef();
|
|
5067
5065
|
if (!this.control) throw new Error(`Interactive session ${this.sessionId} handle is not bound to an exact ref and control claim`);
|
|
5068
|
-
const control = AgentInteractiveSessionControlClaimSchema
|
|
5066
|
+
const control = AgentInteractiveSessionControlClaimSchema.parse(this.control);
|
|
5069
5067
|
if (!agentInteractiveSessionControlClaimMatchesRef(ref, control)) throw new Error(`Interactive session ${this.sessionId} handle is not bound to a control claim for its exact ref`);
|
|
5070
5068
|
return {
|
|
5071
5069
|
ref,
|
|
@@ -5082,9 +5080,9 @@ var InteractiveSessionHandle = class {
|
|
|
5082
5080
|
options?.signal?.throwIfAborted();
|
|
5083
5081
|
const binding = this.requireBinding();
|
|
5084
5082
|
const exactCommand = AgentInteractiveSessionPromptCommandSchema.parse(command);
|
|
5085
|
-
if (canonicalCandidateDigest$
|
|
5083
|
+
if (canonicalCandidateDigest$1(exactCommand.ref) !== canonicalCandidateDigest$1(binding.ref) || canonicalCandidateDigest$1(exactCommand.control) !== canonicalCandidateDigest$1(binding.control)) throw new Error(`Interactive session ${this.sessionId} prompt is bound to a different exact ref`);
|
|
5086
5084
|
return (options === void 0 ? this.host._sendInteractivePrompt(this.sessionId, exactCommand) : this.host._sendInteractivePrompt(this.sessionId, exactCommand, options)).then((acknowledgement) => {
|
|
5087
|
-
const exactAcknowledgement = AgentInteractiveSessionPromptAcknowledgementSchema
|
|
5085
|
+
const exactAcknowledgement = AgentInteractiveSessionPromptAcknowledgementSchema.parse(acknowledgement);
|
|
5088
5086
|
if (!agentInteractiveSessionPromptAcknowledgementMatchesCommand(exactCommand, exactAcknowledgement)) throw new Error(`Interactive session ${this.sessionId} prompt acknowledgement does not match the command`);
|
|
5089
5087
|
return exactAcknowledgement;
|
|
5090
5088
|
});
|
|
@@ -5093,7 +5091,7 @@ var InteractiveSessionHandle = class {
|
|
|
5093
5091
|
validateControl(control, options) {
|
|
5094
5092
|
options?.signal?.throwIfAborted();
|
|
5095
5093
|
const ref = this.requireRef();
|
|
5096
|
-
const exactControl = AgentInteractiveSessionControlClaimSchema
|
|
5094
|
+
const exactControl = AgentInteractiveSessionControlClaimSchema.parse(control);
|
|
5097
5095
|
if (!agentInteractiveSessionControlClaimMatchesRef(ref, exactControl)) throw new Error(`Interactive session ${this.sessionId} control claim is bound to a different exact ref`);
|
|
5098
5096
|
return options === void 0 ? this.host._validateInteractiveControl(this.sessionId, ref, exactControl) : this.host._validateInteractiveControl(this.sessionId, ref, exactControl, options);
|
|
5099
5097
|
}
|
|
@@ -5149,8 +5147,8 @@ var InteractiveSessionHandle = class {
|
|
|
5149
5147
|
options?.signal?.throwIfAborted();
|
|
5150
5148
|
const binding = this.requireBinding();
|
|
5151
5149
|
const exactRequest = AgentInteractiveSessionAttachSchema.parse(request);
|
|
5152
|
-
if (!agentInteractiveSessionControlClaimMatchesRef(binding.ref, exactRequest.control) || canonicalCandidateDigest$
|
|
5153
|
-
const requestDigest = canonicalCandidateDigest$
|
|
5150
|
+
if (!agentInteractiveSessionControlClaimMatchesRef(binding.ref, exactRequest.control) || canonicalCandidateDigest$1(exactRequest.control) !== canonicalCandidateDigest$1(binding.control)) throw new Error(`Interactive session ${this.sessionId} terminal attach is bound to a different active control claim`);
|
|
5151
|
+
const requestDigest = canonicalCandidateDigest$1(exactRequest);
|
|
5154
5152
|
if (this.agentTerminalAttachInFlight !== void 0) {
|
|
5155
5153
|
if (this.agentTerminalAttachDigest !== requestDigest) throw new Error(`Interactive session ${this.sessionId} cannot attach with a different terminal request while another attach is in flight`);
|
|
5156
5154
|
return awaitWithAbort(this.agentTerminalAttachInFlight, options?.signal);
|
|
@@ -5203,12 +5201,12 @@ var InteractiveSessionHandle = class {
|
|
|
5203
5201
|
options?.signal?.throwIfAborted();
|
|
5204
5202
|
const ref = this.requireRef();
|
|
5205
5203
|
const exactRequest = AgentInteractiveSessionControlClaimRequestSchema.parse(request);
|
|
5206
|
-
if (canonicalCandidateDigest$
|
|
5204
|
+
if (canonicalCandidateDigest$1(exactRequest.ref) !== canonicalCandidateDigest$1(ref)) throw new Error(`Interactive session ${this.sessionId} control claim is bound to a different exact ref`);
|
|
5207
5205
|
return this.host._claimInteractiveControl(this.sessionId, exactRequest, options).then((acknowledgement) => {
|
|
5208
5206
|
const exactAcknowledgement = AgentInteractiveSessionControlClaimAcknowledgementSchema.parse(acknowledgement);
|
|
5209
5207
|
if (!agentInteractiveSessionControlClaimAcknowledgementMatchesRequest(exactRequest, exactAcknowledgement)) throw new Error(`Interactive session ${this.sessionId} control claim acknowledgement does not match the request`);
|
|
5210
5208
|
if ((exactAcknowledgement.status === "accepted" || exactAcknowledgement.status === "replayed") && exactAcknowledgement.control) {
|
|
5211
|
-
const current = this.control ? AgentInteractiveSessionControlClaimSchema
|
|
5209
|
+
const current = this.control ? AgentInteractiveSessionControlClaimSchema.parse(this.control) : void 0;
|
|
5212
5210
|
if (current === void 0 || agentInteractiveSessionControlClaimIsNewer(exactAcknowledgement.control, current)) this.control = exactAcknowledgement.control;
|
|
5213
5211
|
}
|
|
5214
5212
|
return exactAcknowledgement;
|
|
@@ -5218,9 +5216,9 @@ var InteractiveSessionHandle = class {
|
|
|
5218
5216
|
options?.signal?.throwIfAborted();
|
|
5219
5217
|
const binding = this.requireBinding();
|
|
5220
5218
|
const exactCommand = AgentInteractiveSessionStopCommandSchema.parse(command);
|
|
5221
|
-
if (canonicalCandidateDigest$
|
|
5219
|
+
if (canonicalCandidateDigest$1(exactCommand.ref) !== canonicalCandidateDigest$1(binding.ref) || canonicalCandidateDigest$1(exactCommand.control) !== canonicalCandidateDigest$1(binding.control)) throw new Error(`Interactive session ${this.sessionId} stop is bound to a different exact ref`);
|
|
5222
5220
|
return (options === void 0 ? this.host._stopInteractive(this.sessionId, exactCommand) : this.host._stopInteractive(this.sessionId, exactCommand, options)).then((acknowledgement) => {
|
|
5223
|
-
const exactAcknowledgement = AgentInteractiveSessionStopAcknowledgementSchema
|
|
5221
|
+
const exactAcknowledgement = AgentInteractiveSessionStopAcknowledgementSchema.parse(acknowledgement);
|
|
5224
5222
|
if (!agentInteractiveSessionStopAcknowledgementMatchesCommand(exactCommand, exactAcknowledgement)) throw new Error(`Interactive session ${this.sessionId} stop acknowledgement does not match the command`);
|
|
5225
5223
|
return exactAcknowledgement;
|
|
5226
5224
|
});
|
|
@@ -5229,8 +5227,8 @@ var InteractiveSessionHandle = class {
|
|
|
5229
5227
|
options?.signal?.throwIfAborted();
|
|
5230
5228
|
const ref = this.requireRef();
|
|
5231
5229
|
return (options === void 0 ? this.host._stopInteractiveLifecycle(this.sessionId, ref) : this.host._stopInteractiveLifecycle(this.sessionId, ref, options)).then((acknowledgement) => {
|
|
5232
|
-
const exactAcknowledgement = AgentInteractiveSessionStopAcknowledgementSchema
|
|
5233
|
-
if (canonicalCandidateDigest$
|
|
5230
|
+
const exactAcknowledgement = AgentInteractiveSessionStopAcknowledgementSchema.parse(acknowledgement);
|
|
5231
|
+
if (canonicalCandidateDigest$1(exactAcknowledgement.ref) !== canonicalCandidateDigest$1(ref)) throw new Error(`Interactive session ${this.sessionId} lifecycle stop acknowledgement does not match the exact ref`);
|
|
5234
5232
|
if (exactAcknowledgement.status !== "accepted" && exactAcknowledgement.status !== "replayed") throw new Error(`Interactive session ${this.sessionId} lifecycle stop was not confirmed (${exactAcknowledgement.status})`);
|
|
5235
5233
|
if (exactAcknowledgement.effect === "unknown") throw new Error(`Interactive session ${this.sessionId} lifecycle stop returned an unknown outcome`);
|
|
5236
5234
|
return exactAcknowledgement;
|
|
@@ -6504,7 +6502,7 @@ const InteractionConflictEnvelopeSchema = z.object({
|
|
|
6504
6502
|
code: z.string().min(1),
|
|
6505
6503
|
message: z.string().min(1),
|
|
6506
6504
|
status: REFUSED_INTERACTION_STATUS,
|
|
6507
|
-
existingResponseDigest: sha256DigestSchema$
|
|
6505
|
+
existingResponseDigest: sha256DigestSchema$1.optional(),
|
|
6508
6506
|
existingOperationId: z.string().min(1).optional(),
|
|
6509
6507
|
resolvedAt: z.string().min(1).optional()
|
|
6510
6508
|
})
|
|
@@ -6532,7 +6530,7 @@ function bindingsEqual(left, right) {
|
|
|
6532
6530
|
return left.requestDigest === right.requestDigest && left.runId === right.runId && left.provider === right.provider && left.environmentId === right.environmentId && left.sessionId === right.sessionId && left.executionId === right.executionId && left.interactionId === right.interactionId;
|
|
6533
6531
|
}
|
|
6534
6532
|
function assertResolutionMatches(resolution, sessionId, submitted, response, endpoint) {
|
|
6535
|
-
const expectedDigest = canonicalCandidateDigest$
|
|
6533
|
+
const expectedDigest = canonicalCandidateDigest$1(submitted);
|
|
6536
6534
|
if (resolution.sessionId !== sessionId || resolution.interactionId !== submitted.id || resolution.outcome !== submitted.outcome || resolution.responseDigest !== expectedDigest) throw invalidRuntimeResponse("Sidecar returned a resolution for another interaction response", response, endpoint);
|
|
6537
6535
|
}
|
|
6538
6536
|
/** Parse one interaction response without discarding replay information. */
|
|
@@ -7584,7 +7582,7 @@ var SandboxInteractiveCapabilities = class extends SandboxPromptCapabilities {
|
|
|
7584
7582
|
origin: "runtime",
|
|
7585
7583
|
endpoint: `/agents/sessions/${encodeURIComponent(id)}/interactive`
|
|
7586
7584
|
});
|
|
7587
|
-
if (canonicalCandidateDigest$
|
|
7585
|
+
if (canonicalCandidateDigest$1(status.ref) !== canonicalCandidateDigest$1(exactCommand.ref)) throw new ValidationError("Interactive prompt ref or control does not match the session");
|
|
7588
7586
|
const endpoint = `/agents/sessions/${encodeURIComponent(id)}/interactive/prompt`;
|
|
7589
7587
|
const response = await this.runtimeFetch(endpoint, {
|
|
7590
7588
|
method: "POST",
|
|
@@ -7633,7 +7631,7 @@ var SandboxInteractiveCapabilities = class extends SandboxPromptCapabilities {
|
|
|
7633
7631
|
async _releaseInteractiveControl(id, ref, control, options) {
|
|
7634
7632
|
options?.signal?.throwIfAborted();
|
|
7635
7633
|
const exactRef = AgentInteractiveSessionRefSchema.parse(ref);
|
|
7636
|
-
const exactControl = AgentInteractiveSessionControlClaimSchema
|
|
7634
|
+
const exactControl = AgentInteractiveSessionControlClaimSchema.parse(control);
|
|
7637
7635
|
if (exactRef.run.sessionId !== id) throw new ValidationError("Interactive control release does not belong to the session");
|
|
7638
7636
|
assertInteractiveRefBelongsToSandbox(exactRef, state(this).interactiveEnvironmentId);
|
|
7639
7637
|
if (!agentInteractiveSessionControlClaimMatchesRef(exactRef, exactControl)) throw new ValidationError("Interactive control release does not match the session ref");
|
|
@@ -7655,7 +7653,7 @@ var SandboxInteractiveCapabilities = class extends SandboxPromptCapabilities {
|
|
|
7655
7653
|
async _validateInteractiveControl(id, ref, control, options) {
|
|
7656
7654
|
options?.signal?.throwIfAborted();
|
|
7657
7655
|
const exactRef = AgentInteractiveSessionRefSchema.parse(ref);
|
|
7658
|
-
const exactControl = AgentInteractiveSessionControlClaimSchema
|
|
7656
|
+
const exactControl = AgentInteractiveSessionControlClaimSchema.parse(control);
|
|
7659
7657
|
if (exactRef.run.sessionId !== id) throw new ValidationError("Interactive control validation does not belong to the session");
|
|
7660
7658
|
assertInteractiveRefBelongsToSandbox(exactRef, state(this).interactiveEnvironmentId);
|
|
7661
7659
|
if (!agentInteractiveSessionControlClaimMatchesRef(exactRef, exactControl)) throw new ValidationError("Interactive control validation does not match the session ref");
|
|
@@ -7758,7 +7756,7 @@ var SandboxInteractiveCapabilities = class extends SandboxPromptCapabilities {
|
|
|
7758
7756
|
origin: "runtime"
|
|
7759
7757
|
});
|
|
7760
7758
|
const acknowledgement = parsed.data.data;
|
|
7761
|
-
if (canonicalCandidateDigest$
|
|
7759
|
+
if (canonicalCandidateDigest$1(acknowledgement.ref) !== canonicalCandidateDigest$1(exactRef)) throw new ServerError("Interactive lifecycle stop acknowledgement does not match the exact ref", 502, {
|
|
7762
7760
|
endpoint,
|
|
7763
7761
|
origin: "runtime"
|
|
7764
7762
|
});
|
|
@@ -7770,7 +7768,7 @@ var SandboxInteractiveCapabilities = class extends SandboxPromptCapabilities {
|
|
|
7770
7768
|
var SandboxSessionEvidenceCapabilities = class extends SandboxInteractiveCapabilities {
|
|
7771
7769
|
/** @internal — invoked before the sandbox is deleted. */
|
|
7772
7770
|
async _sessionExportRawEvidence(id, destination, options) {
|
|
7773
|
-
const { exportRawEvidenceDirectory } = await import("./raw-evidence-archive-
|
|
7771
|
+
const { exportRawEvidenceDirectory } = await import("./raw-evidence-archive-Bc-OdA_Q.js");
|
|
7774
7772
|
await this.ensureRunning();
|
|
7775
7773
|
await this.refresh();
|
|
7776
7774
|
return exportRawEvidenceDirectory((signal, archiveId, cancel) => this.runtimeFetch(`/agents/sessions/${encodeURIComponent(id)}/raw-evidence/archive?${new URLSearchParams([
|
|
@@ -7801,7 +7799,7 @@ var SandboxSessionEvidenceCapabilities = class extends SandboxInteractiveCapabil
|
|
|
7801
7799
|
* and the byte and file bounds are verified before the directory appears.
|
|
7802
7800
|
*/
|
|
7803
7801
|
async exportRawEvidence(destination, options) {
|
|
7804
|
-
const { exportRawEvidenceDirectory } = await import("./raw-evidence-archive-
|
|
7802
|
+
const { exportRawEvidenceDirectory } = await import("./raw-evidence-archive-Bc-OdA_Q.js");
|
|
7805
7803
|
await this.ensureRunning();
|
|
7806
7804
|
await this.refresh();
|
|
7807
7805
|
return exportRawEvidenceDirectory((signal, archiveId, cancel) => this.runtimeFetch(`/agents/raw-evidence/archive?${new URLSearchParams({
|
|
@@ -10049,7 +10047,7 @@ var SandboxFilesystemOperations = class {
|
|
|
10049
10047
|
totalBytes: size,
|
|
10050
10048
|
percentage: 0
|
|
10051
10049
|
});
|
|
10052
|
-
const { uploadChunkedFromFile } = await import("./chunked-upload-file-
|
|
10050
|
+
const { uploadChunkedFromFile } = await import("./chunked-upload-file-DPSyrGUb.js");
|
|
10053
10051
|
await uploadChunkedFromFile({ fetch: (path, init) => this.host.runtimeFetch(path, init) }, remotePath, localPath, {
|
|
10054
10052
|
mode: options?.permissions,
|
|
10055
10053
|
onProgress: options?.onProgress ? (progress) => {
|
|
@@ -10422,7 +10420,7 @@ var SandboxInteractiveTerminalOperations = class {
|
|
|
10422
10420
|
origin: "runtime",
|
|
10423
10421
|
endpoint: `/agents/sessions/${encodeURIComponent(id)}/interactive`
|
|
10424
10422
|
}, "INTERACTIVE_SESSION_EXITED");
|
|
10425
|
-
if (canonicalCandidateDigest$
|
|
10423
|
+
if (canonicalCandidateDigest$1(status.ref) !== canonicalCandidateDigest$1(exactRef)) throw new ValidationError("Interactive attach ref does not match the current session");
|
|
10426
10424
|
const stream = await this.connectStream(id, `/terminals/${encodeURIComponent(id)}/ws`, {
|
|
10427
10425
|
connectionId: id,
|
|
10428
10426
|
cols: exactRequest.cols,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as anumber, c as concatBytes$1, f as randomBytes, h as toBytes, i as ahash, l as createHasher$1, n as abytes$1, o as aoutput, p as rotr, r as aexists, s as clean, t as Hash, u as createView, x as split } from "./utils-
|
|
1
|
+
import { a as anumber, c as concatBytes$1, f as randomBytes, h as toBytes, i as ahash, l as createHasher$1, n as abytes$1, o as aoutput, p as rotr, r as aexists, s as clean, t as Hash, u as createView, x as split } from "./utils-CoawKwX_.js";
|
|
2
2
|
//#region ../../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/_md.js
|
|
3
3
|
/**
|
|
4
4
|
* Internal Merkle-Damgard hash utils.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as combineAbortSignals } from "../abort-signal-
|
|
2
|
-
import "../sidecar-proxy-error-
|
|
3
|
-
import { t as parseSSEStream } from "../sse-parser-
|
|
1
|
+
import { n as combineAbortSignals } from "../abort-signal-CDxyloxz.js";
|
|
2
|
+
import "../sidecar-proxy-error-5DpLmHeN.js";
|
|
3
|
+
import { t as parseSSEStream } from "../sse-parser-CKkE9zWy.js";
|
|
4
4
|
//#region ../../../packages/runtime-contracts/dist/session-gateway.js
|
|
5
5
|
/**
|
|
6
6
|
* Calculate connection quality from metrics.
|
package/dist/tangle/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as JOB_SANDBOX_DELETE, T as SandboxCreateResponseParamTypes, _ as TANGLE_JOBS_CONTRACT, a as fetchQuote, b as AgentSandboxBlueprintAbi, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as TANGLE_CHAIN_ID, h as TangleSandboxClient, i as SignedQuote, l as validateQuote, m as SignMessage, n as QuoteDomain, o as inputsHashOf, p as OperatorSessionToken, r as QuoteError, s as jobQuoteDigest, t as JobQuoteDetails, u as OperatorChallenge, v as TangleSandboxClientConfig, w as SandboxCreateParamTypes, x as JOB_SANDBOX_CREATE, y as ITangleJobsAbi } from "../index-
|
|
1
|
+
import { C as JsonResponseParamTypes, E as SandboxIdParamTypes, S as JOB_SANDBOX_DELETE, T as SandboxCreateResponseParamTypes, _ as TANGLE_JOBS_CONTRACT, a as fetchQuote, b as AgentSandboxBlueprintAbi, c as parseQuoteResponse, d as OperatorSession, f as OperatorSessionError, g as TANGLE_CHAIN_ID, h as TangleSandboxClient, i as SignedQuote, l as validateQuote, m as SignMessage, n as QuoteDomain, o as inputsHashOf, p as OperatorSessionToken, r as QuoteError, s as jobQuoteDigest, t as JobQuoteDetails, u as OperatorChallenge, v as TangleSandboxClientConfig, w as SandboxCreateParamTypes, x as JOB_SANDBOX_CREATE, y as ITangleJobsAbi } from "../index-vcweImuL.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JobQuoteDetails, JsonResponseParamTypes, OperatorChallenge, OperatorSession, OperatorSessionError, OperatorSessionToken, QuoteDomain, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, SignMessage, SignedQuote, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, TangleSandboxClientConfig, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
|
package/dist/tangle/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as TangleSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-
|
|
1
|
+
import { _ as SandboxCreateParamTypes, a as parseQuoteResponse, c as OperatorSession, d as TANGLE_JOBS_CONTRACT, f as ITangleJobsAbi, g as JsonResponseParamTypes, h as JOB_SANDBOX_DELETE, i as jobQuoteDigest, l as OperatorSessionError, m as JOB_SANDBOX_CREATE, n as fetchQuote, o as validateQuote, p as AgentSandboxBlueprintAbi, r as inputsHashOf, s as TangleSandboxClient, t as QuoteError, u as TANGLE_CHAIN_ID, v as SandboxCreateResponseParamTypes, y as SandboxIdParamTypes } from "../tangle-DOwUAne4.js";
|
|
2
2
|
export { AgentSandboxBlueprintAbi, ITangleJobsAbi, JOB_SANDBOX_CREATE, JOB_SANDBOX_DELETE, JsonResponseParamTypes, OperatorSession, OperatorSessionError, QuoteError, SandboxCreateParamTypes, SandboxCreateResponseParamTypes, SandboxIdParamTypes, TANGLE_CHAIN_ID, TANGLE_JOBS_CONTRACT, TangleSandboxClient, fetchQuote, inputsHashOf, jobQuoteDigest, parseQuoteResponse, validateQuote };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as createSandboxInstanceFromResponse } from "./sandbox-
|
|
2
|
-
import { i as readResponseJson } from "./errors-
|
|
3
|
-
import { _ as rotlBH, a as anumber, b as rotlSL, d as createXOFer, g as u32, h as toBytes$1, l as createHasher, m as swap32IfBE, n as abytes, o as aoutput, r as aexists, s as clean, t as Hash, v as rotlBL, x as split, y as rotlSH } from "./utils-
|
|
1
|
+
import { n as createSandboxInstanceFromResponse } from "./sandbox-Qn9ScVvS.js";
|
|
2
|
+
import { i as readResponseJson } from "./errors-BUPIDjn4.js";
|
|
3
|
+
import { _ as rotlBH, a as anumber, b as rotlSL, d as createXOFer, g as u32, h as toBytes$1, l as createHasher, m as swap32IfBE, n as abytes, o as aoutput, r as aexists, s as clean, t as Hash, v as rotlBL, x as split, y as rotlSH } from "./utils-CoawKwX_.js";
|
|
4
4
|
//#region ../../../packages/runtime-contracts/dist/tangle-blueprint-abi.js
|
|
5
5
|
/**
|
|
6
6
|
* Tangle blueprint wire contract shared by the orchestrator's Tangle driver and
|
|
@@ -2376,7 +2376,7 @@ function isAddressEqual(a, b) {
|
|
|
2376
2376
|
//#region ../../../node_modules/.pnpm/viem@2.57.10_bufferutil@4.1.0_typescript@6.0.3_utf-8-validate@5.0.10_zod@4.6.6/node_modules/viem/_esm/utils/signature/recoverPublicKey.js
|
|
2377
2377
|
async function recoverPublicKey({ hash, signature }) {
|
|
2378
2378
|
const hashHex = isHex(hash) ? hash : toHex(hash);
|
|
2379
|
-
const { secp256k1 } = await import("./secp256k1-
|
|
2379
|
+
const { secp256k1 } = await import("./secp256k1-BGtA1PsN.js");
|
|
2380
2380
|
return `0x${(() => {
|
|
2381
2381
|
if (typeof signature === "object" && "r" in signature && "s" in signature) {
|
|
2382
2382
|
const { r, s, v, yParity } = signature;
|