@tangle-network/sandbox 1.0.84 → 1.0.86
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 +3 -3
- package/dist/agent/preview.d.ts +1 -1
- package/dist/agent/preview.js +1 -1
- package/dist/{agent-run-outcome-HyzLlfb7.d.ts → agent-run-outcome-5YkPTPuE.d.ts} +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/{browser-interactive-control-controller-WLzM_Lyq.js → browser-interactive-control-controller-BvtNDWql.js} +15 -15
- package/dist/{browser-interactive-control-controller-BelQQ9nb.d.ts → browser-interactive-control-controller-CMdlolu0.d.ts} +1 -1
- package/dist/{chunked-upload-tul4qbe5.js → chunked-upload--QnrxdO9.js} +43 -17
- package/dist/{chunked-upload-file-D9NvCQis.js → chunked-upload-file-an8AfIJx.js} +1 -1
- package/dist/{cli-auth-bundle-DspL04sN.js → cli-auth-bundle-BoK5wpru.js} +1 -1
- package/dist/{client-Y8hjzpdv.d.ts → client-CCF-xlqb.d.ts} +5 -5
- package/dist/{client-B2eSBVFj.js → client-TJrVpqwk.js} +5 -5
- package/dist/{core-BBecAr2M.js → core-w0cPi0zg.js} +3 -3
- package/dist/core.d.ts +6 -6
- package/dist/core.js +3 -3
- package/dist/{harness-D2TXEUu-.js → harness-BnGz2Wng.js} +5 -5
- package/dist/{index-Bqu-Zp7j.d.ts → index-DFeZI9hC.d.ts} +5 -5
- package/dist/index.d.ts +9 -9
- package/dist/index.js +7 -7
- package/dist/interactive-control.d.ts +1 -1
- package/dist/interactive-control.js +1 -1
- package/dist/{interactive-controller-BdGvy0jq.js → interactive-controller-CkiJBT6m.js} +31 -6
- package/dist/{interactive-controller-DjNtSQHC.d.ts → interactive-controller-DlxGadwo.d.ts} +3 -3
- package/dist/{lines-rqwQmFq-.d.ts → lines-Bs8wZ7O8.d.ts} +1 -1
- package/dist/lines.d.ts +1 -1
- package/dist/{local-cli-auth-xqJlVceZ.js → local-cli-auth-bw8Puox2.js} +1 -1
- package/dist/{preview-Q4wJz1Yl.d.ts → preview-ufvsad5Q.d.ts} +3 -3
- package/dist/{profile-schema-D-XJLM1E.js → profile-schema-DFZTAn1S.js} +8 -8
- package/dist/{public-templates-CPwaavCU.d.ts → public-templates-BgYFqTwX.d.ts} +2 -2
- package/dist/public-templates.d.ts +1 -1
- package/dist/runtime.d.ts +5 -5
- package/dist/runtime.js +3 -3
- package/dist/{sandbox-BdWInunU.js → sandbox-CnLNPeh0.js} +708 -286
- package/dist/select-seat-command.d.ts +1 -1
- package/dist/tangle/index.d.ts +1 -1
- package/dist/tangle/index.js +1 -1
- package/dist/{tangle-DjCQ1Un6.js → tangle-Ctnjc764.js} +32 -32
- package/dist/{terminal-stream-types-MjiApwNS.d.ts → terminal-stream-types-CqLXtP8e.d.ts} +14 -14
- package/dist/{types-D9bXe-vp.d.ts → types-R43a0wyS.d.ts} +96 -64
- package/package.json +5 -5
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import {
|
|
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-
|
|
4
|
-
import { a as canonicalAgentProfileValue, r as agentProfileSchema } from "./profile-schema-
|
|
1
|
+
import { A as normalizeRuntimeBackendConfig, C as encodeTextForWire, D as applyRequestedModel, F as withoutRuntimeSecrets, I as createAgentRunOutcomeTracker, L as deriveAgentResultOutcome, M as requestedSecretProfilePublicDigest, O as assertCurrentBackendType, S as encodePromptForWire, T as canUseNodeHttp2, W as normalizeEffectiveBackend, _ as isTraceId, a as assertScopedTokenActive, b as resolveDispatchRunIdentity, c as SandboxRuntimeApi, d as appendSessionIdQuery, f as callHeaders, g as TRACE_ID_HEADER, h as waitForRetryAfter, i as terminalUpgradeHeadersSupported, j as requestedPublicProfileDigest, k as mergeRuntimeBackendConfig, l as normalizeSessionInfo, m as isRetryableCredentialRefusal, n as InteractiveSessionController, p as sessionHeaders, r as TerminalStream, s as requestScopedToken, u as sessionMessageRequestBody, v as mintTraceId, w as runtimeFilesystemPath, x as validateAcceptedDispatchRunRef, y as resolveTraceId } from "./interactive-controller-CkiJBT6m.js";
|
|
2
|
+
import { C as boundedIdentifierSchema, E as boundedStringSchema, g as sha256DigestSchema, o as canonicalCandidateDigest, s as canonicalCandidateJson, u as isCanonicalJsonValue } from "./harness-BnGz2Wng.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-BvtNDWql.js";
|
|
4
|
+
import { a as canonicalAgentProfileValue, r as agentProfileSchema } from "./profile-schema-DFZTAn1S.js";
|
|
5
5
|
import { C as StateError, E as ValidationError, F as SANDBOX_FILE_API_ABSOLUTE_ROOTS, I as isProfileFileMountOutsideRoots, L as profileFileMountOutsideRootsMessage, N as PROFILE_FILE_MOUNT_OUTSIDE_ROOTS_CODE, P as SANDBOX_AGENT_HOME, S as ServerError, T as TimeoutError, a as AuthError, c as CompliancePlacementError, f as GpuProviderNotConfiguredError, g as NotFoundError, h as NetworkError, i as readResponseJson, j as SANDBOX_PROXY_REQUEST_MAX_BYTES, l as EdgeNotReadyError, m as NON_RETRYABLE_CREATE_QUOTA_REASONS, 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-BStusQVc.js";
|
|
6
6
|
import { n as combineAbortSignals, r as delayUntilAborted, t as awaitWithAbort } from "./abort-signal-JVaAyNMP.js";
|
|
7
7
|
import { t as rewrapResponse } from "./response-rewrap-B75N59JT.js";
|
|
8
8
|
import { n as fetchWithKeepAlive, t as emitTiming } from "./keep-alive-fetch--8twRp99.js";
|
|
9
9
|
import { t as SIDECAR_PROXY_ERROR_HEADER } from "./sidecar-proxy-error-DORW8_mD.js";
|
|
10
10
|
import { t as parseSSEStream } from "./sse-parser-BUIKfYAd.js";
|
|
11
|
-
import { s as uploadChunked } from "./chunked-upload
|
|
11
|
+
import { s as uploadChunked } from "./chunked-upload--QnrxdO9.js";
|
|
12
12
|
import { t as runPreparedProcess } from "./prepared-process-GzQXVsX8.js";
|
|
13
|
-
import { a as backendTypeSchema, r as cliAuthReferenceSchema } from "./cli-auth-bundle-
|
|
13
|
+
import { a as backendTypeSchema, r as cliAuthReferenceSchema } from "./cli-auth-bundle-BoK5wpru.js";
|
|
14
14
|
import { n as SandboxLines } from "./lines-D9XmRZMl.js";
|
|
15
15
|
import { z } from "zod";
|
|
16
16
|
import { createHash } from "node:crypto";
|
|
@@ -20,7 +20,7 @@ import "node:fs/promises";
|
|
|
20
20
|
import { readTokenCostUsd, readTokenUsage } from "@tangle-network/agent-core";
|
|
21
21
|
import "@tangle-network/agent-interface/environment-provider";
|
|
22
22
|
import { OTLP_SPAN_KIND, OTLP_STATUS_CODE, msToUnixNano, otlpTraceExport, toOtlpAttributes, toW3CSpanId, toW3CTraceId } from "@tangle-network/agent-trace-contract/otlp";
|
|
23
|
-
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.
|
|
23
|
+
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.2/node_modules/@tangle-network/agent-interface/dist/agent-execution-preparation.js
|
|
24
24
|
/**
|
|
25
25
|
* Canonical RFC 8785/SHA-256 identity for one validated, public AgentProfile.
|
|
26
26
|
* Secret-capable MCP/hook fields are tagged. Other prompt, resource, metadata,
|
|
@@ -31,11 +31,11 @@ import { OTLP_SPAN_KIND, OTLP_STATUS_CODE, msToUnixNano, otlpTraceExport, toOtlp
|
|
|
31
31
|
*/
|
|
32
32
|
function canonicalAgentProfileDigest(profile) {
|
|
33
33
|
const material = canonicalAgentProfileValue(agentProfileSchema.parse(profile));
|
|
34
|
-
if (material === void 0 || !isCanonicalJsonValue
|
|
35
|
-
return canonicalCandidateDigest
|
|
34
|
+
if (material === void 0 || !isCanonicalJsonValue(material)) throw new Error("AgentProfile must contain finite, acyclic RFC 8785 JSON values");
|
|
35
|
+
return canonicalCandidateDigest(material);
|
|
36
36
|
}
|
|
37
37
|
//#endregion
|
|
38
|
-
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.
|
|
38
|
+
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.2/node_modules/@tangle-network/agent-interface/dist/environment-interactive-start.js
|
|
39
39
|
const AgentInteractiveSessionRunCoordinatesSchema = z.strictObject({
|
|
40
40
|
provider: boundedIdentifierSchema,
|
|
41
41
|
environmentId: boundedIdentifierSchema,
|
|
@@ -52,7 +52,7 @@ const AgentInteractiveSessionRunCoordinatesSchema = z.strictObject({
|
|
|
52
52
|
const AgentInteractiveSessionStartSchema = z.strictObject({
|
|
53
53
|
run: AgentExactRunControlRefSchema,
|
|
54
54
|
profile: agentProfileSchema,
|
|
55
|
-
requestedProfileDigest: sha256DigestSchema
|
|
55
|
+
requestedProfileDigest: sha256DigestSchema,
|
|
56
56
|
authMode: z.literal("oauth").optional(),
|
|
57
57
|
initialPrompt: boundedStringSchema.optional(),
|
|
58
58
|
cwd: boundedStringSchema.min(1).optional(),
|
|
@@ -63,7 +63,7 @@ const AgentInteractiveSessionStartSchema = z.strictObject({
|
|
|
63
63
|
function agentInteractiveSessionRequestDigest(coordinates, input) {
|
|
64
64
|
const exactCoordinates = AgentInteractiveSessionRunCoordinatesSchema.parse(coordinates);
|
|
65
65
|
const exactInput = AgentInteractiveSessionStartSchema.omit({ run: true }).parse(input);
|
|
66
|
-
return canonicalCandidateDigest
|
|
66
|
+
return canonicalCandidateDigest({
|
|
67
67
|
kind: "agent-interactive-session-start.v1",
|
|
68
68
|
run: exactCoordinates,
|
|
69
69
|
requestedProfileDigest: exactInput.requestedProfileDigest,
|
|
@@ -112,7 +112,7 @@ function runCoordinates(run) {
|
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
//#endregion
|
|
115
|
-
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.
|
|
115
|
+
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.2/node_modules/@tangle-network/agent-interface/dist/environment-terminal.js
|
|
116
116
|
const terminalDimensionSchema = z.number().int().positive().max(1e4);
|
|
117
117
|
/**
|
|
118
118
|
* Provider-neutral handle for one interactive terminal.
|
|
@@ -488,7 +488,7 @@ const PROFILE_IMPORT_PART_BYTES = 512 * 1024;
|
|
|
488
488
|
const MANAGED_PROFILE_TRANSPORT = "managed-profile-reference-v1";
|
|
489
489
|
/** Cache identity follows JSON wire semantics and RFC 8785 key ordering. */
|
|
490
490
|
function profileCacheSha256(profile) {
|
|
491
|
-
return canonicalCandidateDigest
|
|
491
|
+
return canonicalCandidateDigest(JSON.parse(JSON.stringify(profile))).slice(7);
|
|
492
492
|
}
|
|
493
493
|
//#endregion
|
|
494
494
|
//#region ../../../packages/runtime-contracts/dist/direct-read.js
|
|
@@ -763,7 +763,7 @@ async function responseNeedsProfileImport(response) {
|
|
|
763
763
|
}
|
|
764
764
|
/** Upload the public profile only. Runtime grants remain in the turn backend. */
|
|
765
765
|
async function primeManagedProfile(profile, fetchRuntime) {
|
|
766
|
-
const bytes = new TextEncoder().encode(canonicalCandidateJson
|
|
766
|
+
const bytes = new TextEncoder().encode(canonicalCandidateJson(profile));
|
|
767
767
|
const sha256 = profileCacheSha256(profile);
|
|
768
768
|
if (bytes.length > 8388608) throw new ValidationError("Managed profile exceeds the profile import bound");
|
|
769
769
|
const post = async (body) => {
|
|
@@ -1401,6 +1401,7 @@ const routes = Object.values({
|
|
|
1401
1401
|
"codeExec": {
|
|
1402
1402
|
"method": "POST",
|
|
1403
1403
|
"path": "/code/exec",
|
|
1404
|
+
"pattern": "^/code/exec$",
|
|
1404
1405
|
"auth": {
|
|
1405
1406
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1406
1407
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1419,11 +1420,13 @@ const routes = Object.values({
|
|
|
1419
1420
|
"rateFamily": "process",
|
|
1420
1421
|
"shortTokenRequired": true,
|
|
1421
1422
|
"startsWork": true,
|
|
1422
|
-
"blocking": true
|
|
1423
|
+
"blocking": true,
|
|
1424
|
+
"execActivity": true
|
|
1423
1425
|
},
|
|
1424
1426
|
"processSpawn": {
|
|
1425
1427
|
"method": "POST",
|
|
1426
1428
|
"path": "/process/spawn",
|
|
1429
|
+
"pattern": "^/process/spawn$",
|
|
1427
1430
|
"auth": {
|
|
1428
1431
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1429
1432
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1442,11 +1445,13 @@ const routes = Object.values({
|
|
|
1442
1445
|
"rateFamily": "process",
|
|
1443
1446
|
"shortTokenRequired": true,
|
|
1444
1447
|
"startsWork": true,
|
|
1445
|
-
"blocking": "blocking"
|
|
1448
|
+
"blocking": "blocking",
|
|
1449
|
+
"execActivity": true
|
|
1446
1450
|
},
|
|
1447
1451
|
"ensureDevServer": {
|
|
1448
1452
|
"method": "POST",
|
|
1449
1453
|
"path": "/process/ensure-dev-server",
|
|
1454
|
+
"pattern": "^/process/ensure-dev-server$",
|
|
1450
1455
|
"auth": {
|
|
1451
1456
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1452
1457
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1465,11 +1470,13 @@ const routes = Object.values({
|
|
|
1465
1470
|
"rateFamily": "process",
|
|
1466
1471
|
"shortTokenRequired": true,
|
|
1467
1472
|
"startsWork": true,
|
|
1468
|
-
"blocking": true
|
|
1473
|
+
"blocking": true,
|
|
1474
|
+
"execActivity": true
|
|
1469
1475
|
},
|
|
1470
1476
|
"processList": {
|
|
1471
1477
|
"method": "GET",
|
|
1472
1478
|
"path": "/process",
|
|
1479
|
+
"pattern": "^/process$",
|
|
1473
1480
|
"auth": {
|
|
1474
1481
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1475
1482
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1488,11 +1495,13 @@ const routes = Object.values({
|
|
|
1488
1495
|
"rateFamily": null,
|
|
1489
1496
|
"shortTokenRequired": false,
|
|
1490
1497
|
"startsWork": false,
|
|
1491
|
-
"blocking": false
|
|
1498
|
+
"blocking": false,
|
|
1499
|
+
"execActivity": true
|
|
1492
1500
|
},
|
|
1493
1501
|
"processGet": {
|
|
1494
1502
|
"method": "GET",
|
|
1495
1503
|
"path": "/process/{pid}",
|
|
1504
|
+
"pattern": "^/process/[^/]+$",
|
|
1496
1505
|
"auth": {
|
|
1497
1506
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1498
1507
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1511,11 +1520,13 @@ const routes = Object.values({
|
|
|
1511
1520
|
"rateFamily": null,
|
|
1512
1521
|
"shortTokenRequired": false,
|
|
1513
1522
|
"startsWork": false,
|
|
1514
|
-
"blocking": false
|
|
1523
|
+
"blocking": false,
|
|
1524
|
+
"execActivity": true
|
|
1515
1525
|
},
|
|
1516
1526
|
"kill": {
|
|
1517
1527
|
"method": "DELETE",
|
|
1518
1528
|
"path": "/process/{pid}",
|
|
1529
|
+
"pattern": "^/process/[^/]+$",
|
|
1519
1530
|
"auth": {
|
|
1520
1531
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1521
1532
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1533,12 +1544,14 @@ const routes = Object.values({
|
|
|
1533
1544
|
"auditAction": null,
|
|
1534
1545
|
"rateFamily": null,
|
|
1535
1546
|
"shortTokenRequired": false,
|
|
1536
|
-
"startsWork":
|
|
1537
|
-
"blocking": false
|
|
1547
|
+
"startsWork": false,
|
|
1548
|
+
"blocking": false,
|
|
1549
|
+
"execActivity": true
|
|
1538
1550
|
},
|
|
1539
1551
|
"logs": {
|
|
1540
1552
|
"method": "GET",
|
|
1541
1553
|
"path": "/process/{pid}/logs",
|
|
1554
|
+
"pattern": "^/process/[^/]+/logs$",
|
|
1542
1555
|
"auth": {
|
|
1543
1556
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1544
1557
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1557,11 +1570,13 @@ const routes = Object.values({
|
|
|
1557
1570
|
"rateFamily": null,
|
|
1558
1571
|
"shortTokenRequired": false,
|
|
1559
1572
|
"startsWork": false,
|
|
1560
|
-
"blocking": false
|
|
1573
|
+
"blocking": false,
|
|
1574
|
+
"execActivity": true
|
|
1561
1575
|
},
|
|
1562
1576
|
"listKernels": {
|
|
1563
1577
|
"method": "GET",
|
|
1564
1578
|
"path": "/code/kernels",
|
|
1579
|
+
"pattern": "^/code/kernels$",
|
|
1565
1580
|
"auth": {
|
|
1566
1581
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1567
1582
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1580,11 +1595,13 @@ const routes = Object.values({
|
|
|
1580
1595
|
"rateFamily": null,
|
|
1581
1596
|
"shortTokenRequired": false,
|
|
1582
1597
|
"startsWork": false,
|
|
1583
|
-
"blocking": false
|
|
1598
|
+
"blocking": false,
|
|
1599
|
+
"execActivity": true
|
|
1584
1600
|
},
|
|
1585
1601
|
"restartKernel": {
|
|
1586
1602
|
"method": "POST",
|
|
1587
1603
|
"path": "/code/kernels/{key}/restart",
|
|
1604
|
+
"pattern": "^/code/kernels/[^/]+/restart$",
|
|
1588
1605
|
"auth": {
|
|
1589
1606
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1590
1607
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1603,11 +1620,13 @@ const routes = Object.values({
|
|
|
1603
1620
|
"rateFamily": null,
|
|
1604
1621
|
"shortTokenRequired": false,
|
|
1605
1622
|
"startsWork": true,
|
|
1606
|
-
"blocking": false
|
|
1623
|
+
"blocking": false,
|
|
1624
|
+
"execActivity": true
|
|
1607
1625
|
},
|
|
1608
1626
|
"disposeKernel": {
|
|
1609
1627
|
"method": "DELETE",
|
|
1610
1628
|
"path": "/code/kernels/{key}",
|
|
1629
|
+
"pattern": "^/code/kernels/[^/]+$",
|
|
1611
1630
|
"auth": {
|
|
1612
1631
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1613
1632
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1626,11 +1645,13 @@ const routes = Object.values({
|
|
|
1626
1645
|
"rateFamily": null,
|
|
1627
1646
|
"shortTokenRequired": false,
|
|
1628
1647
|
"startsWork": false,
|
|
1629
|
-
"blocking": false
|
|
1648
|
+
"blocking": false,
|
|
1649
|
+
"execActivity": true
|
|
1630
1650
|
},
|
|
1631
1651
|
"fileWrite": {
|
|
1632
1652
|
"method": "POST",
|
|
1633
1653
|
"path": "/files/write",
|
|
1654
|
+
"pattern": "^/files/write$",
|
|
1634
1655
|
"auth": {
|
|
1635
1656
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1636
1657
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1649,11 +1670,13 @@ const routes = Object.values({
|
|
|
1649
1670
|
"rateFamily": null,
|
|
1650
1671
|
"shortTokenRequired": false,
|
|
1651
1672
|
"startsWork": true,
|
|
1652
|
-
"blocking": false
|
|
1673
|
+
"blocking": false,
|
|
1674
|
+
"execActivity": false
|
|
1653
1675
|
},
|
|
1654
1676
|
"fileRead": {
|
|
1655
1677
|
"method": "POST",
|
|
1656
1678
|
"path": "/files/read",
|
|
1679
|
+
"pattern": "^/files/read$",
|
|
1657
1680
|
"auth": {
|
|
1658
1681
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1659
1682
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1672,11 +1695,13 @@ const routes = Object.values({
|
|
|
1672
1695
|
"rateFamily": null,
|
|
1673
1696
|
"shortTokenRequired": false,
|
|
1674
1697
|
"startsWork": false,
|
|
1675
|
-
"blocking": false
|
|
1698
|
+
"blocking": false,
|
|
1699
|
+
"execActivity": false
|
|
1676
1700
|
},
|
|
1677
1701
|
"fileInfo": {
|
|
1678
1702
|
"method": "POST",
|
|
1679
1703
|
"path": "/files/info",
|
|
1704
|
+
"pattern": "^/files/info$",
|
|
1680
1705
|
"auth": {
|
|
1681
1706
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1682
1707
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1695,11 +1720,13 @@ const routes = Object.values({
|
|
|
1695
1720
|
"rateFamily": null,
|
|
1696
1721
|
"shortTokenRequired": false,
|
|
1697
1722
|
"startsWork": false,
|
|
1698
|
-
"blocking": false
|
|
1723
|
+
"blocking": false,
|
|
1724
|
+
"execActivity": false
|
|
1699
1725
|
},
|
|
1700
1726
|
"fileReadBatch": {
|
|
1701
1727
|
"method": "POST",
|
|
1702
1728
|
"path": "/files/read-batch",
|
|
1729
|
+
"pattern": "^/files/read-batch$",
|
|
1703
1730
|
"auth": {
|
|
1704
1731
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1705
1732
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1718,11 +1745,13 @@ const routes = Object.values({
|
|
|
1718
1745
|
"rateFamily": null,
|
|
1719
1746
|
"shortTokenRequired": false,
|
|
1720
1747
|
"startsWork": false,
|
|
1721
|
-
"blocking": false
|
|
1748
|
+
"blocking": false,
|
|
1749
|
+
"execActivity": false
|
|
1722
1750
|
},
|
|
1723
1751
|
"fileWriteBatch": {
|
|
1724
1752
|
"method": "POST",
|
|
1725
1753
|
"path": "/files/write-batch",
|
|
1754
|
+
"pattern": "^/files/write-batch$",
|
|
1726
1755
|
"auth": {
|
|
1727
1756
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1728
1757
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1741,11 +1770,13 @@ const routes = Object.values({
|
|
|
1741
1770
|
"rateFamily": null,
|
|
1742
1771
|
"shortTokenRequired": false,
|
|
1743
1772
|
"startsWork": true,
|
|
1744
|
-
"blocking": false
|
|
1773
|
+
"blocking": false,
|
|
1774
|
+
"execActivity": false
|
|
1745
1775
|
},
|
|
1746
1776
|
"fileTree": {
|
|
1747
1777
|
"method": "GET",
|
|
1748
1778
|
"path": "/files/tree",
|
|
1779
|
+
"pattern": "^/files/tree$",
|
|
1749
1780
|
"auth": {
|
|
1750
1781
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1751
1782
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1764,11 +1795,13 @@ const routes = Object.values({
|
|
|
1764
1795
|
"rateFamily": null,
|
|
1765
1796
|
"shortTokenRequired": false,
|
|
1766
1797
|
"startsWork": false,
|
|
1767
|
-
"blocking": false
|
|
1798
|
+
"blocking": false,
|
|
1799
|
+
"execActivity": false
|
|
1768
1800
|
},
|
|
1769
1801
|
"fileDelete": {
|
|
1770
1802
|
"method": "POST",
|
|
1771
1803
|
"path": "/files/delete",
|
|
1804
|
+
"pattern": "^/files/delete$",
|
|
1772
1805
|
"auth": {
|
|
1773
1806
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1774
1807
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1787,11 +1820,88 @@ const routes = Object.values({
|
|
|
1787
1820
|
"rateFamily": null,
|
|
1788
1821
|
"shortTokenRequired": false,
|
|
1789
1822
|
"startsWork": true,
|
|
1790
|
-
"blocking": false
|
|
1823
|
+
"blocking": false,
|
|
1824
|
+
"execActivity": false
|
|
1791
1825
|
},
|
|
1792
1826
|
"fileRename": {
|
|
1793
1827
|
"method": "POST",
|
|
1794
1828
|
"path": "/files/rename",
|
|
1829
|
+
"pattern": "^/files/rename$",
|
|
1830
|
+
"auth": {
|
|
1831
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1832
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
1833
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
1834
|
+
"sidecar": "control-or-scoped-session-token"
|
|
1835
|
+
},
|
|
1836
|
+
"layers": [
|
|
1837
|
+
"worker",
|
|
1838
|
+
"orchestrator",
|
|
1839
|
+
"hostAgent",
|
|
1840
|
+
"sidecar",
|
|
1841
|
+
"typescript",
|
|
1842
|
+
"python"
|
|
1843
|
+
],
|
|
1844
|
+
"auditAction": null,
|
|
1845
|
+
"rateFamily": null,
|
|
1846
|
+
"shortTokenRequired": false,
|
|
1847
|
+
"startsWork": true,
|
|
1848
|
+
"blocking": false,
|
|
1849
|
+
"execActivity": false
|
|
1850
|
+
},
|
|
1851
|
+
"fsUpload": {
|
|
1852
|
+
"method": "POST",
|
|
1853
|
+
"path": "/fs/upload",
|
|
1854
|
+
"pattern": "^/fs/upload$",
|
|
1855
|
+
"auth": {
|
|
1856
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1857
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
1858
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
1859
|
+
"sidecar": "control-or-scoped-session-token"
|
|
1860
|
+
},
|
|
1861
|
+
"layers": [
|
|
1862
|
+
"worker",
|
|
1863
|
+
"orchestrator",
|
|
1864
|
+
"hostAgent",
|
|
1865
|
+
"sidecar",
|
|
1866
|
+
"typescript",
|
|
1867
|
+
"python"
|
|
1868
|
+
],
|
|
1869
|
+
"auditAction": null,
|
|
1870
|
+
"rateFamily": null,
|
|
1871
|
+
"shortTokenRequired": false,
|
|
1872
|
+
"startsWork": true,
|
|
1873
|
+
"blocking": false,
|
|
1874
|
+
"execActivity": false
|
|
1875
|
+
},
|
|
1876
|
+
"fsDownload": {
|
|
1877
|
+
"method": "GET",
|
|
1878
|
+
"path": "/fs/download/:path{.*}",
|
|
1879
|
+
"pattern": "^/fs/download/.+$",
|
|
1880
|
+
"auth": {
|
|
1881
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1882
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
1883
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
1884
|
+
"sidecar": "control-or-scoped-session-token"
|
|
1885
|
+
},
|
|
1886
|
+
"layers": [
|
|
1887
|
+
"worker",
|
|
1888
|
+
"orchestrator",
|
|
1889
|
+
"hostAgent",
|
|
1890
|
+
"sidecar",
|
|
1891
|
+
"typescript",
|
|
1892
|
+
"python"
|
|
1893
|
+
],
|
|
1894
|
+
"auditAction": null,
|
|
1895
|
+
"rateFamily": null,
|
|
1896
|
+
"shortTokenRequired": false,
|
|
1897
|
+
"startsWork": false,
|
|
1898
|
+
"blocking": false,
|
|
1899
|
+
"execActivity": false
|
|
1900
|
+
},
|
|
1901
|
+
"fsUploadDirectory": {
|
|
1902
|
+
"method": "POST",
|
|
1903
|
+
"path": "/fs/upload-dir",
|
|
1904
|
+
"pattern": "^/fs/upload-dir$",
|
|
1795
1905
|
"auth": {
|
|
1796
1906
|
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1797
1907
|
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
@@ -1810,11 +1920,387 @@ const routes = Object.values({
|
|
|
1810
1920
|
"rateFamily": null,
|
|
1811
1921
|
"shortTokenRequired": false,
|
|
1812
1922
|
"startsWork": true,
|
|
1813
|
-
"blocking": false
|
|
1923
|
+
"blocking": false,
|
|
1924
|
+
"execActivity": false
|
|
1925
|
+
},
|
|
1926
|
+
"fsDownloadDirectory": {
|
|
1927
|
+
"method": "GET",
|
|
1928
|
+
"path": "/fs/download-dir/:path{.*}",
|
|
1929
|
+
"pattern": "^/fs/download-dir/.+$",
|
|
1930
|
+
"auth": {
|
|
1931
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1932
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
1933
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
1934
|
+
"sidecar": "control-or-scoped-session-token"
|
|
1935
|
+
},
|
|
1936
|
+
"layers": [
|
|
1937
|
+
"worker",
|
|
1938
|
+
"orchestrator",
|
|
1939
|
+
"hostAgent",
|
|
1940
|
+
"sidecar",
|
|
1941
|
+
"typescript",
|
|
1942
|
+
"python"
|
|
1943
|
+
],
|
|
1944
|
+
"auditAction": null,
|
|
1945
|
+
"rateFamily": null,
|
|
1946
|
+
"shortTokenRequired": false,
|
|
1947
|
+
"startsWork": false,
|
|
1948
|
+
"blocking": false,
|
|
1949
|
+
"execActivity": false
|
|
1950
|
+
},
|
|
1951
|
+
"fsList": {
|
|
1952
|
+
"method": "GET",
|
|
1953
|
+
"path": "/fs/list/:path{.*}",
|
|
1954
|
+
"pattern": "^/fs/list/.+$",
|
|
1955
|
+
"auth": {
|
|
1956
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1957
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
1958
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
1959
|
+
"sidecar": "control-or-scoped-session-token"
|
|
1960
|
+
},
|
|
1961
|
+
"layers": [
|
|
1962
|
+
"worker",
|
|
1963
|
+
"orchestrator",
|
|
1964
|
+
"hostAgent",
|
|
1965
|
+
"sidecar",
|
|
1966
|
+
"typescript",
|
|
1967
|
+
"python"
|
|
1968
|
+
],
|
|
1969
|
+
"auditAction": null,
|
|
1970
|
+
"rateFamily": null,
|
|
1971
|
+
"shortTokenRequired": false,
|
|
1972
|
+
"startsWork": false,
|
|
1973
|
+
"blocking": false,
|
|
1974
|
+
"execActivity": false
|
|
1975
|
+
},
|
|
1976
|
+
"fsStat": {
|
|
1977
|
+
"method": "GET",
|
|
1978
|
+
"path": "/fs/stat/:path{.*}",
|
|
1979
|
+
"pattern": "^/fs/stat/.+$",
|
|
1980
|
+
"auth": {
|
|
1981
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
1982
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
1983
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
1984
|
+
"sidecar": "control-or-scoped-session-token"
|
|
1985
|
+
},
|
|
1986
|
+
"layers": [
|
|
1987
|
+
"worker",
|
|
1988
|
+
"orchestrator",
|
|
1989
|
+
"hostAgent",
|
|
1990
|
+
"sidecar",
|
|
1991
|
+
"typescript",
|
|
1992
|
+
"python"
|
|
1993
|
+
],
|
|
1994
|
+
"auditAction": null,
|
|
1995
|
+
"rateFamily": null,
|
|
1996
|
+
"shortTokenRequired": false,
|
|
1997
|
+
"startsWork": false,
|
|
1998
|
+
"blocking": false,
|
|
1999
|
+
"execActivity": false
|
|
2000
|
+
},
|
|
2001
|
+
"fsDelete": {
|
|
2002
|
+
"method": "DELETE",
|
|
2003
|
+
"path": "/fs/:path{.*}",
|
|
2004
|
+
"pattern": "^/fs/.+$",
|
|
2005
|
+
"auth": {
|
|
2006
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
2007
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
2008
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
2009
|
+
"sidecar": "control-or-scoped-session-token"
|
|
2010
|
+
},
|
|
2011
|
+
"layers": [
|
|
2012
|
+
"worker",
|
|
2013
|
+
"orchestrator",
|
|
2014
|
+
"hostAgent",
|
|
2015
|
+
"sidecar",
|
|
2016
|
+
"typescript",
|
|
2017
|
+
"python"
|
|
2018
|
+
],
|
|
2019
|
+
"auditAction": null,
|
|
2020
|
+
"rateFamily": null,
|
|
2021
|
+
"shortTokenRequired": false,
|
|
2022
|
+
"startsWork": true,
|
|
2023
|
+
"blocking": false,
|
|
2024
|
+
"execActivity": false
|
|
2025
|
+
},
|
|
2026
|
+
"fsMkdir": {
|
|
2027
|
+
"method": "POST",
|
|
2028
|
+
"path": "/fs/mkdir/:path{.*}",
|
|
2029
|
+
"pattern": "^/fs/mkdir/.+$",
|
|
2030
|
+
"auth": {
|
|
2031
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
2032
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
2033
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
2034
|
+
"sidecar": "control-or-scoped-session-token"
|
|
2035
|
+
},
|
|
2036
|
+
"layers": [
|
|
2037
|
+
"worker",
|
|
2038
|
+
"orchestrator",
|
|
2039
|
+
"hostAgent",
|
|
2040
|
+
"sidecar",
|
|
2041
|
+
"typescript",
|
|
2042
|
+
"python"
|
|
2043
|
+
],
|
|
2044
|
+
"auditAction": null,
|
|
2045
|
+
"rateFamily": null,
|
|
2046
|
+
"shortTokenRequired": false,
|
|
2047
|
+
"startsWork": true,
|
|
2048
|
+
"blocking": false,
|
|
2049
|
+
"execActivity": false
|
|
2050
|
+
},
|
|
2051
|
+
"fsExists": {
|
|
2052
|
+
"method": "GET",
|
|
2053
|
+
"path": "/fs/exists/:path{.*}",
|
|
2054
|
+
"pattern": "^/fs/exists/.+$",
|
|
2055
|
+
"auth": {
|
|
2056
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
2057
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
2058
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
2059
|
+
"sidecar": "control-or-scoped-session-token"
|
|
2060
|
+
},
|
|
2061
|
+
"layers": [
|
|
2062
|
+
"worker",
|
|
2063
|
+
"orchestrator",
|
|
2064
|
+
"hostAgent",
|
|
2065
|
+
"sidecar",
|
|
2066
|
+
"typescript",
|
|
2067
|
+
"python"
|
|
2068
|
+
],
|
|
2069
|
+
"auditAction": null,
|
|
2070
|
+
"rateFamily": null,
|
|
2071
|
+
"shortTokenRequired": false,
|
|
2072
|
+
"startsWork": false,
|
|
2073
|
+
"blocking": false,
|
|
2074
|
+
"execActivity": false
|
|
2075
|
+
},
|
|
2076
|
+
"uploadSessionInit": {
|
|
2077
|
+
"method": "POST",
|
|
2078
|
+
"path": "/fs/upload-session",
|
|
2079
|
+
"pattern": "^/fs/upload-session$",
|
|
2080
|
+
"auth": {
|
|
2081
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
2082
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
2083
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
2084
|
+
"sidecar": "control-or-scoped-session-token"
|
|
2085
|
+
},
|
|
2086
|
+
"layers": [
|
|
2087
|
+
"worker",
|
|
2088
|
+
"orchestrator",
|
|
2089
|
+
"hostAgent",
|
|
2090
|
+
"sidecar",
|
|
2091
|
+
"typescript",
|
|
2092
|
+
"python"
|
|
2093
|
+
],
|
|
2094
|
+
"auditAction": null,
|
|
2095
|
+
"rateFamily": null,
|
|
2096
|
+
"shortTokenRequired": false,
|
|
2097
|
+
"startsWork": true,
|
|
2098
|
+
"blocking": false,
|
|
2099
|
+
"execActivity": false
|
|
2100
|
+
},
|
|
2101
|
+
"uploadSessionState": {
|
|
2102
|
+
"method": "GET",
|
|
2103
|
+
"path": "/fs/upload-session/{id}",
|
|
2104
|
+
"pattern": "^/fs/upload-session/[^/]+$",
|
|
2105
|
+
"auth": {
|
|
2106
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
2107
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
2108
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
2109
|
+
"sidecar": "control-or-scoped-session-token"
|
|
2110
|
+
},
|
|
2111
|
+
"layers": [
|
|
2112
|
+
"worker",
|
|
2113
|
+
"orchestrator",
|
|
2114
|
+
"hostAgent",
|
|
2115
|
+
"sidecar",
|
|
2116
|
+
"typescript",
|
|
2117
|
+
"python"
|
|
2118
|
+
],
|
|
2119
|
+
"auditAction": null,
|
|
2120
|
+
"rateFamily": null,
|
|
2121
|
+
"shortTokenRequired": false,
|
|
2122
|
+
"startsWork": false,
|
|
2123
|
+
"blocking": false,
|
|
2124
|
+
"execActivity": false
|
|
2125
|
+
},
|
|
2126
|
+
"uploadSessionPart": {
|
|
2127
|
+
"method": "PUT",
|
|
2128
|
+
"path": "/fs/upload-session/{id}/parts/{index}",
|
|
2129
|
+
"pattern": "^/fs/upload-session/[^/]+/parts/[^/]+$",
|
|
2130
|
+
"auth": {
|
|
2131
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
2132
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
2133
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
2134
|
+
"sidecar": "control-or-scoped-session-token"
|
|
2135
|
+
},
|
|
2136
|
+
"layers": [
|
|
2137
|
+
"worker",
|
|
2138
|
+
"orchestrator",
|
|
2139
|
+
"hostAgent",
|
|
2140
|
+
"sidecar",
|
|
2141
|
+
"typescript",
|
|
2142
|
+
"python"
|
|
2143
|
+
],
|
|
2144
|
+
"auditAction": null,
|
|
2145
|
+
"rateFamily": null,
|
|
2146
|
+
"shortTokenRequired": false,
|
|
2147
|
+
"startsWork": true,
|
|
2148
|
+
"blocking": false,
|
|
2149
|
+
"execActivity": false
|
|
2150
|
+
},
|
|
2151
|
+
"uploadSessionCommit": {
|
|
2152
|
+
"method": "POST",
|
|
2153
|
+
"path": "/fs/upload-session/{id}/commit",
|
|
2154
|
+
"pattern": "^/fs/upload-session/[^/]+/commit$",
|
|
2155
|
+
"auth": {
|
|
2156
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
2157
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
2158
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
2159
|
+
"sidecar": "control-or-scoped-session-token"
|
|
2160
|
+
},
|
|
2161
|
+
"layers": [
|
|
2162
|
+
"worker",
|
|
2163
|
+
"orchestrator",
|
|
2164
|
+
"hostAgent",
|
|
2165
|
+
"sidecar",
|
|
2166
|
+
"typescript",
|
|
2167
|
+
"python"
|
|
2168
|
+
],
|
|
2169
|
+
"auditAction": null,
|
|
2170
|
+
"rateFamily": null,
|
|
2171
|
+
"shortTokenRequired": false,
|
|
2172
|
+
"startsWork": true,
|
|
2173
|
+
"blocking": false,
|
|
2174
|
+
"execActivity": false
|
|
2175
|
+
},
|
|
2176
|
+
"uploadSessionDelete": {
|
|
2177
|
+
"method": "DELETE",
|
|
2178
|
+
"path": "/fs/upload-session/{id}",
|
|
2179
|
+
"pattern": "^/fs/upload-session/[^/]+$",
|
|
2180
|
+
"auth": {
|
|
2181
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
2182
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
2183
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
2184
|
+
"sidecar": "control-or-scoped-session-token"
|
|
2185
|
+
},
|
|
2186
|
+
"layers": [
|
|
2187
|
+
"worker",
|
|
2188
|
+
"orchestrator",
|
|
2189
|
+
"hostAgent",
|
|
2190
|
+
"sidecar",
|
|
2191
|
+
"typescript",
|
|
2192
|
+
"python"
|
|
2193
|
+
],
|
|
2194
|
+
"auditAction": null,
|
|
2195
|
+
"rateFamily": null,
|
|
2196
|
+
"shortTokenRequired": false,
|
|
2197
|
+
"startsWork": true,
|
|
2198
|
+
"blocking": false,
|
|
2199
|
+
"execActivity": false
|
|
2200
|
+
},
|
|
2201
|
+
"managedJobSubmit": {
|
|
2202
|
+
"method": "POST",
|
|
2203
|
+
"path": "/process/jobs",
|
|
2204
|
+
"pattern": "^/process/jobs$",
|
|
2205
|
+
"auth": {
|
|
2206
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
2207
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
2208
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
2209
|
+
"sidecar": "control-or-scoped-session-token"
|
|
2210
|
+
},
|
|
2211
|
+
"layers": [
|
|
2212
|
+
"worker",
|
|
2213
|
+
"orchestrator",
|
|
2214
|
+
"hostAgent",
|
|
2215
|
+
"sidecar",
|
|
2216
|
+
"typescript",
|
|
2217
|
+
"python"
|
|
2218
|
+
],
|
|
2219
|
+
"auditAction": null,
|
|
2220
|
+
"rateFamily": null,
|
|
2221
|
+
"shortTokenRequired": false,
|
|
2222
|
+
"startsWork": true,
|
|
2223
|
+
"blocking": false,
|
|
2224
|
+
"execActivity": true
|
|
2225
|
+
},
|
|
2226
|
+
"managedJobGet": {
|
|
2227
|
+
"method": "GET",
|
|
2228
|
+
"path": "/process/jobs/{id}",
|
|
2229
|
+
"pattern": "^/process/jobs/[^/]+$",
|
|
2230
|
+
"auth": {
|
|
2231
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
2232
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
2233
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
2234
|
+
"sidecar": "control-or-scoped-session-token"
|
|
2235
|
+
},
|
|
2236
|
+
"layers": [
|
|
2237
|
+
"worker",
|
|
2238
|
+
"orchestrator",
|
|
2239
|
+
"hostAgent",
|
|
2240
|
+
"sidecar",
|
|
2241
|
+
"typescript",
|
|
2242
|
+
"python"
|
|
2243
|
+
],
|
|
2244
|
+
"auditAction": null,
|
|
2245
|
+
"rateFamily": null,
|
|
2246
|
+
"shortTokenRequired": false,
|
|
2247
|
+
"startsWork": false,
|
|
2248
|
+
"blocking": false,
|
|
2249
|
+
"execActivity": false
|
|
2250
|
+
},
|
|
2251
|
+
"managedJobResume": {
|
|
2252
|
+
"method": "POST",
|
|
2253
|
+
"path": "/process/jobs/{id}/resume",
|
|
2254
|
+
"pattern": "^/process/jobs/[^/]+/resume$",
|
|
2255
|
+
"auth": {
|
|
2256
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
2257
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
2258
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
2259
|
+
"sidecar": "control-or-scoped-session-token"
|
|
2260
|
+
},
|
|
2261
|
+
"layers": [
|
|
2262
|
+
"worker",
|
|
2263
|
+
"orchestrator",
|
|
2264
|
+
"hostAgent",
|
|
2265
|
+
"sidecar",
|
|
2266
|
+
"typescript",
|
|
2267
|
+
"python"
|
|
2268
|
+
],
|
|
2269
|
+
"auditAction": null,
|
|
2270
|
+
"rateFamily": null,
|
|
2271
|
+
"shortTokenRequired": false,
|
|
2272
|
+
"startsWork": true,
|
|
2273
|
+
"blocking": false,
|
|
2274
|
+
"execActivity": true
|
|
2275
|
+
},
|
|
2276
|
+
"managedJobCancel": {
|
|
2277
|
+
"method": "DELETE",
|
|
2278
|
+
"path": "/process/jobs/{id}",
|
|
2279
|
+
"pattern": "^/process/jobs/[^/]+$",
|
|
2280
|
+
"auth": {
|
|
2281
|
+
"worker": "sandbox-owner-or-scoped-runtime-token",
|
|
2282
|
+
"orchestrator": "sandbox-owner-or-scoped-runtime-token",
|
|
2283
|
+
"hostAgent": "ingress-and-scoped-token",
|
|
2284
|
+
"sidecar": "control-or-scoped-session-token"
|
|
2285
|
+
},
|
|
2286
|
+
"layers": [
|
|
2287
|
+
"worker",
|
|
2288
|
+
"orchestrator",
|
|
2289
|
+
"hostAgent",
|
|
2290
|
+
"sidecar",
|
|
2291
|
+
"typescript",
|
|
2292
|
+
"python"
|
|
2293
|
+
],
|
|
2294
|
+
"auditAction": null,
|
|
2295
|
+
"rateFamily": null,
|
|
2296
|
+
"shortTokenRequired": false,
|
|
2297
|
+
"startsWork": false,
|
|
2298
|
+
"blocking": false,
|
|
2299
|
+
"execActivity": true
|
|
1814
2300
|
}
|
|
1815
2301
|
}).map((operation) => ({
|
|
1816
2302
|
...operation,
|
|
1817
|
-
matcher: new RegExp(
|
|
2303
|
+
matcher: new RegExp(operation.pattern)
|
|
1818
2304
|
}));
|
|
1819
2305
|
function sandboxOperation(path, method, layer) {
|
|
1820
2306
|
return routes.find((operation) => operation.method === method && operation.layers.includes(layer) && operation.matcher.test(path));
|
|
@@ -2261,118 +2747,6 @@ async function isRefusedBearer(response) {
|
|
|
2261
2747
|
return false;
|
|
2262
2748
|
}
|
|
2263
2749
|
}
|
|
2264
|
-
//#endregion
|
|
2265
|
-
//#region ../../../node_modules/.pnpm/@tangle-network+agent-interface@5.10.2/node_modules/@tangle-network/agent-interface/dist/agent-candidate-schema-common.js
|
|
2266
|
-
const sha256Pattern = /^sha256:[a-f0-9]{64}$/;
|
|
2267
|
-
const gitObjectPattern = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/;
|
|
2268
|
-
const environmentNamePattern = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
2269
|
-
const headerNamePattern = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
2270
|
-
const mediaTypePattern = /^[a-z0-9][a-z0-9!#$&^_.+-]{0,126}\/[a-z0-9][a-z0-9!#$&^_.+-]{0,126}$/;
|
|
2271
|
-
const githubComponentPattern = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,99}$/;
|
|
2272
|
-
const secretNamePattern = /(?:^|[_-])(?:api[_-]?key|access[_-]?key|private[_-]?key|token|secret|password|credentials?|authorization|cookie|database[_-]?url|dsn|pat)(?:[_-]|$)/i;
|
|
2273
|
-
const obviousSecretValuePattern = /(?:\bsk[-_][-_A-Za-z0-9]{10,}\b|\bgh[pousr]_[A-Za-z0-9]{12,}\b|\bgithub_pat_[A-Za-z0-9_]{12,}\b|\bAKIA[A-Z0-9]{12,}\b|-----BEGIN [A-Z ]*PRIVATE KEY-----|\bBearer\s+\S+)/;
|
|
2274
|
-
const controlCharacterPattern = /[\u0000-\u001f\u007f]/;
|
|
2275
|
-
z.string().regex(sha256Pattern);
|
|
2276
|
-
z.string().regex(gitObjectPattern);
|
|
2277
|
-
const environmentNameSchema = z.string().regex(environmentNamePattern);
|
|
2278
|
-
z.string().regex(headerNamePattern);
|
|
2279
|
-
z.string().regex(mediaTypePattern);
|
|
2280
|
-
function sha256Bytes(value) {
|
|
2281
|
-
const bytes = sha256(value);
|
|
2282
|
-
return `sha256:${Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join("")}`;
|
|
2283
|
-
}
|
|
2284
|
-
/** RFC 8785 serialization used by every candidate-producing package. */
|
|
2285
|
-
function canonicalCandidateJson(value) {
|
|
2286
|
-
if (!isCanonicalJsonValue(value)) throw new Error("candidate document must be finite, acyclic RFC 8785 JSON");
|
|
2287
|
-
return serializeCanonicalCandidate(value);
|
|
2288
|
-
}
|
|
2289
|
-
function canonicalCandidateBytes(value) {
|
|
2290
|
-
return new TextEncoder().encode(canonicalCandidateJson(value));
|
|
2291
|
-
}
|
|
2292
|
-
function canonicalCandidateDigest(value) {
|
|
2293
|
-
return sha256Bytes(canonicalCandidateBytes(value));
|
|
2294
|
-
}
|
|
2295
|
-
function serializeCanonicalCandidate(value) {
|
|
2296
|
-
if (value === null || typeof value === "boolean" || typeof value === "number") return JSON.stringify(value);
|
|
2297
|
-
if (typeof value === "string") return JSON.stringify(value);
|
|
2298
|
-
if (Array.isArray(value)) return `[${value.map(serializeCanonicalCandidate).join(",")}]`;
|
|
2299
|
-
return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${serializeCanonicalCandidate(value[key])}`).join(",")}}`;
|
|
2300
|
-
}
|
|
2301
|
-
function isWellFormedUnicode(value) {
|
|
2302
|
-
for (let index = 0; index < value.length; index++) {
|
|
2303
|
-
const code = value.charCodeAt(index);
|
|
2304
|
-
if (code >= 55296 && code <= 56319) {
|
|
2305
|
-
const next = value.charCodeAt(index + 1);
|
|
2306
|
-
if (!(next >= 56320 && next <= 57343)) return false;
|
|
2307
|
-
index++;
|
|
2308
|
-
} else if (code >= 56320 && code <= 57343) return false;
|
|
2309
|
-
}
|
|
2310
|
-
return true;
|
|
2311
|
-
}
|
|
2312
|
-
function isCanonicalJsonValue(value, ancestors = /* @__PURE__ */ new Set()) {
|
|
2313
|
-
if (value === null || typeof value === "boolean") return true;
|
|
2314
|
-
if (typeof value === "string") return isWellFormedUnicode(value);
|
|
2315
|
-
if (typeof value === "number") return Number.isFinite(value);
|
|
2316
|
-
if (typeof value !== "object" || ancestors.has(value)) return false;
|
|
2317
|
-
const prototype = Object.getPrototypeOf(value);
|
|
2318
|
-
if (!Array.isArray(value) && prototype !== Object.prototype && prototype !== null) return false;
|
|
2319
|
-
const nextAncestors = new Set(ancestors).add(value);
|
|
2320
|
-
if (Array.isArray(value)) {
|
|
2321
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
2322
|
-
if (!(index in value)) return false;
|
|
2323
|
-
if (!isCanonicalJsonValue(value[index], nextAncestors)) return false;
|
|
2324
|
-
}
|
|
2325
|
-
return true;
|
|
2326
|
-
}
|
|
2327
|
-
return Object.entries(value).every(([key, entry]) => isWellFormedUnicode(key) && isCanonicalJsonValue(entry, nextAncestors));
|
|
2328
|
-
}
|
|
2329
|
-
function hasCredentialBearingUrl(value) {
|
|
2330
|
-
try {
|
|
2331
|
-
const url = new URL(value);
|
|
2332
|
-
if (url.username !== "" || url.password !== "") return true;
|
|
2333
|
-
return [...url.searchParams.keys()].some((key) => secretNamePattern.test(key));
|
|
2334
|
-
} catch {
|
|
2335
|
-
return false;
|
|
2336
|
-
}
|
|
2337
|
-
}
|
|
2338
|
-
/**
|
|
2339
|
-
* Whether a string holds an obvious credential: a provider key (`sk-`, `gh*_`,
|
|
2340
|
-
* `github_pat_`, `AKIA`), a PEM private key, a bearer token, or a URL with
|
|
2341
|
-
* userinfo or a credential-named query parameter. The agent-eval redaction
|
|
2342
|
-
* core calls it, so candidate validation and trace redaction agree.
|
|
2343
|
-
*/
|
|
2344
|
-
function looksLikeCredential(value) {
|
|
2345
|
-
return obviousSecretValuePattern.test(value) || hasCredentialBearingUrl(value);
|
|
2346
|
-
}
|
|
2347
|
-
function isPublicConfigValue(value) {
|
|
2348
|
-
return !controlCharacterPattern.test(value) && isWellFormedUnicode(value) && !looksLikeCredential(value);
|
|
2349
|
-
}
|
|
2350
|
-
/** Shared public reference owner; resolution belongs to the trusted executor. */
|
|
2351
|
-
const agentCandidateSecretRefSchema = z.strictObject({
|
|
2352
|
-
kind: z.literal("secret-ref"),
|
|
2353
|
-
key: z.string().min(1).max(500).refine((value) => value.trim().length > 0 && isPublicConfigValue(value), "secret reference key must be a public non-credential identity"),
|
|
2354
|
-
format: z.enum(["raw", "bearer"]).optional()
|
|
2355
|
-
});
|
|
2356
|
-
const agentCandidatePublicValueSchema = z.strictObject({
|
|
2357
|
-
kind: z.literal("public"),
|
|
2358
|
-
value: z.string().refine(isPublicConfigValue, "candidate config cannot carry credentials; the evaluator owns model authorization")
|
|
2359
|
-
});
|
|
2360
|
-
const agentCandidateConfigValueSchema = z.discriminatedUnion("kind", [agentCandidatePublicValueSchema, agentCandidateSecretRefSchema]);
|
|
2361
|
-
function configRecordSchema(keySchema) {
|
|
2362
|
-
return z.record(keySchema, agentCandidateConfigValueSchema).superRefine((config, ctx) => {
|
|
2363
|
-
for (const name of Object.keys(config)) if (secretNamePattern.test(name) && config[name]?.kind !== "secret-ref") ctx.addIssue({
|
|
2364
|
-
code: "custom",
|
|
2365
|
-
path: [name],
|
|
2366
|
-
message: "candidate config cannot declare credential-bearing names"
|
|
2367
|
-
});
|
|
2368
|
-
});
|
|
2369
|
-
}
|
|
2370
|
-
configRecordSchema(environmentNameSchema);
|
|
2371
|
-
z.object({
|
|
2372
|
-
kind: z.literal("github"),
|
|
2373
|
-
owner: z.string().regex(githubComponentPattern).refine((value) => value !== "." && value !== ".."),
|
|
2374
|
-
repo: z.string().regex(githubComponentPattern).refine((value) => value !== "." && value !== "..")
|
|
2375
|
-
}).strict();
|
|
2376
2750
|
const CODEX_SYSTEM_PROMPT_FILE = ".codex/system-prompt.md";
|
|
2377
2751
|
const OPENCODE_APPEND_SYSTEM_PROMPT_FILE = ".opencode/agent-system-prompt.md";
|
|
2378
2752
|
const OPENCODE_CONFIG_FILE = "opencode.json";
|
|
@@ -3572,63 +3946,143 @@ function sandboxShellCommandArgs(command) {
|
|
|
3572
3946
|
return [...["-c"], command];
|
|
3573
3947
|
}
|
|
3574
3948
|
//#endregion
|
|
3949
|
+
//#region ../../../packages/runtime-contracts/dist/managed-process-contract.js
|
|
3950
|
+
const token = z.string().max(65536).refine((s) => !s.includes("\0"));
|
|
3951
|
+
const integer = z.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
3952
|
+
/** Commands must be resumable: interrupted attempts can be executed again. */
|
|
3953
|
+
const managedProcessSpecSchema = z.object({
|
|
3954
|
+
id: z.string().min(1).max(256),
|
|
3955
|
+
executable: token.min(1),
|
|
3956
|
+
args: z.array(token).max(256).default([]),
|
|
3957
|
+
cwd: token.min(1),
|
|
3958
|
+
envKeys: z.array(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/)).default([]),
|
|
3959
|
+
deadlineAt: integer.positive(),
|
|
3960
|
+
restart: z.object({
|
|
3961
|
+
maxAttempts: integer.positive(),
|
|
3962
|
+
initialBackoffMs: integer.positive(),
|
|
3963
|
+
maxBackoffMs: integer.positive(),
|
|
3964
|
+
exitCodes: z.array(z.number().int().min(1).max(255)),
|
|
3965
|
+
afterInterruption: z.boolean()
|
|
3966
|
+
}).strict().refine((r) => r.maxBackoffMs >= r.initialBackoffMs)
|
|
3967
|
+
}).strict();
|
|
3968
|
+
z.object({ id: managedProcessSpecSchema.shape.id });
|
|
3969
|
+
/** Compare the observed failed attempt before explicitly resuming its retained command. */
|
|
3970
|
+
const managedProcessResumeSchema = z.object({
|
|
3971
|
+
expectedAttempt: integer,
|
|
3972
|
+
expectedDigest: z.string().regex(/^[a-f0-9]{64}$/)
|
|
3973
|
+
}).strict();
|
|
3974
|
+
const managedProcessRecordSchema = z.object({
|
|
3975
|
+
schema: z.literal(1),
|
|
3976
|
+
environmentId: z.string().min(1),
|
|
3977
|
+
workspaceRoot: z.string().min(1),
|
|
3978
|
+
spec: managedProcessSpecSchema,
|
|
3979
|
+
digest: z.string().regex(/^[a-f0-9]{64}$/),
|
|
3980
|
+
state: z.enum([
|
|
3981
|
+
"queued",
|
|
3982
|
+
"running",
|
|
3983
|
+
"retrying",
|
|
3984
|
+
"stopping",
|
|
3985
|
+
"succeeded",
|
|
3986
|
+
"failed",
|
|
3987
|
+
"cancelled",
|
|
3988
|
+
"expired"
|
|
3989
|
+
]),
|
|
3990
|
+
attempt: integer,
|
|
3991
|
+
acceptedAt: integer,
|
|
3992
|
+
updatedAt: integer,
|
|
3993
|
+
nextAttemptAt: integer.optional(),
|
|
3994
|
+
pid: integer.positive().optional(),
|
|
3995
|
+
lastExitCode: z.number().int().optional(),
|
|
3996
|
+
interrupted: z.boolean().optional(),
|
|
3997
|
+
stopReason: z.enum([
|
|
3998
|
+
"cancelled",
|
|
3999
|
+
"expired",
|
|
4000
|
+
"failed"
|
|
4001
|
+
]).optional(),
|
|
4002
|
+
failureCode: z.enum([
|
|
4003
|
+
"interrupted",
|
|
4004
|
+
"attempts_exhausted",
|
|
4005
|
+
"process_exit",
|
|
4006
|
+
"launch_failed"
|
|
4007
|
+
]).optional()
|
|
4008
|
+
}).strict();
|
|
4009
|
+
//#endregion
|
|
3575
4010
|
//#region src/managed-process.ts
|
|
4011
|
+
const operations = {
|
|
4012
|
+
managedJobSubmit: {
|
|
4013
|
+
method: "POST",
|
|
4014
|
+
path: (_id) => `/process/jobs`,
|
|
4015
|
+
missing: false,
|
|
4016
|
+
missingCode: "MANAGED_PROCESS_NOT_FOUND"
|
|
4017
|
+
},
|
|
4018
|
+
managedJobGet: {
|
|
4019
|
+
method: "GET",
|
|
4020
|
+
path: (id) => `/process/jobs/${encodeURIComponent(id)}`,
|
|
4021
|
+
missing: true,
|
|
4022
|
+
missingCode: "MANAGED_PROCESS_NOT_FOUND"
|
|
4023
|
+
},
|
|
4024
|
+
managedJobResume: {
|
|
4025
|
+
method: "POST",
|
|
4026
|
+
path: (id) => `/process/jobs/${encodeURIComponent(id)}/resume`,
|
|
4027
|
+
missing: true,
|
|
4028
|
+
missingCode: "MANAGED_PROCESS_NOT_FOUND"
|
|
4029
|
+
},
|
|
4030
|
+
managedJobCancel: {
|
|
4031
|
+
method: "DELETE",
|
|
4032
|
+
path: (id) => `/process/jobs/${encodeURIComponent(id)}`,
|
|
4033
|
+
missing: true,
|
|
4034
|
+
missingCode: "MANAGED_PROCESS_NOT_FOUND"
|
|
4035
|
+
}
|
|
4036
|
+
};
|
|
4037
|
+
const fields = managedProcessRecordSchema.shape;
|
|
3576
4038
|
var ManagedProcessClient = class {
|
|
3577
4039
|
constructor(request, environmentId) {
|
|
3578
4040
|
this.request = request;
|
|
3579
4041
|
this.environmentId = environmentId;
|
|
3580
4042
|
}
|
|
3581
|
-
async call(
|
|
3582
|
-
|
|
4043
|
+
async call(operationName, id, body, options) {
|
|
4044
|
+
const route = operations[operationName];
|
|
4045
|
+
if (!fields.spec.shape.id.safeParse(id).success) throw new ValidationError("Invalid managed process id");
|
|
3583
4046
|
const headers = new Headers({ "Content-Type": "application/json" });
|
|
3584
4047
|
if (options?.sessionId) headers.set("X-Session-Id", options.sessionId);
|
|
3585
|
-
const response = await this.request(
|
|
3586
|
-
method,
|
|
4048
|
+
const response = await this.request(route.path(id), {
|
|
4049
|
+
method: route.method,
|
|
3587
4050
|
headers,
|
|
3588
4051
|
...body ? { body: JSON.stringify(body) } : {}
|
|
3589
4052
|
});
|
|
3590
4053
|
const text = await response.text();
|
|
3591
|
-
let value;
|
|
4054
|
+
let value = null;
|
|
3592
4055
|
try {
|
|
3593
4056
|
value = JSON.parse(text);
|
|
3594
4057
|
} catch {
|
|
3595
|
-
if (
|
|
3596
|
-
throw new ValidationError("Managed process response is not JSON");
|
|
4058
|
+
if (response.ok) throw new ValidationError("Managed process response is not JSON");
|
|
3597
4059
|
}
|
|
3598
4060
|
const envelope = value;
|
|
3599
|
-
if (
|
|
4061
|
+
if (route.missing && response.status === 404 && envelope?.error?.code === route.missingCode) return null;
|
|
3600
4062
|
if (!response.ok) throw parseErrorResponse(response.status, text, void 0, response.headers);
|
|
3601
4063
|
const record = envelope?.data;
|
|
3602
|
-
if (envelope?.success !== true || record
|
|
3603
|
-
"queued",
|
|
3604
|
-
"running",
|
|
3605
|
-
"retrying",
|
|
3606
|
-
"stopping",
|
|
3607
|
-
"succeeded",
|
|
3608
|
-
"failed",
|
|
3609
|
-
"cancelled",
|
|
3610
|
-
"expired"
|
|
3611
|
-
].includes(record.state) || !Number.isSafeInteger(record.attempt) || record.attempt < 0 || typeof record.digest !== "string" || !/^[a-f0-9]{64}$/.test(record.digest)) throw new ValidationError("Managed process response has invalid identity or state");
|
|
4064
|
+
if (envelope?.success !== true || !record || !fields.schema.safeParse(record.schema).success || record.spec?.id !== id || record.environmentId !== this.environmentId || !fields.state.safeParse(record.state).success || !fields.attempt.safeParse(record.attempt).success || !fields.digest.safeParse(record.digest).success) throw new ValidationError("Managed process response has invalid identity or state");
|
|
3612
4065
|
return record;
|
|
3613
4066
|
}
|
|
3614
4067
|
async submit(spec, options) {
|
|
3615
|
-
const record = await this.call("
|
|
4068
|
+
const record = await this.call("managedJobSubmit", spec.id, spec, options);
|
|
3616
4069
|
if (!record) throw new ValidationError("Managed process admission returned no record");
|
|
3617
4070
|
return record;
|
|
3618
4071
|
}
|
|
3619
4072
|
get(id, options) {
|
|
3620
|
-
return this.call("
|
|
4073
|
+
return this.call("managedJobGet", id, void 0, options);
|
|
3621
4074
|
}
|
|
3622
4075
|
resume(id, options) {
|
|
3623
4076
|
const { expectedAttempt, expectedDigest } = options;
|
|
3624
|
-
|
|
3625
|
-
return this.call("POST", id, {
|
|
4077
|
+
const body = {
|
|
3626
4078
|
expectedAttempt,
|
|
3627
4079
|
expectedDigest
|
|
3628
|
-
}
|
|
4080
|
+
};
|
|
4081
|
+
if (!managedProcessResumeSchema.safeParse(body).success) throw new ValidationError("Invalid managed process resume precondition");
|
|
4082
|
+
return this.call("managedJobResume", id, body, options);
|
|
3629
4083
|
}
|
|
3630
4084
|
cancel(id, options) {
|
|
3631
|
-
return this.call("
|
|
4085
|
+
return this.call("managedJobCancel", id, void 0, options);
|
|
3632
4086
|
}
|
|
3633
4087
|
};
|
|
3634
4088
|
//#endregion
|
|
@@ -5545,7 +5999,7 @@ var InteractiveSessionHandle = class {
|
|
|
5545
5999
|
options?.signal?.throwIfAborted();
|
|
5546
6000
|
const binding = this.requireBinding();
|
|
5547
6001
|
const exactCommand = AgentInteractiveSessionPromptCommandSchema.parse(command);
|
|
5548
|
-
if (canonicalCandidateDigest
|
|
6002
|
+
if (canonicalCandidateDigest(exactCommand.ref) !== canonicalCandidateDigest(binding.ref) || canonicalCandidateDigest(exactCommand.control) !== canonicalCandidateDigest(binding.control)) throw new Error(`Interactive session ${this.sessionId} prompt is bound to a different exact ref`);
|
|
5549
6003
|
return (options === void 0 ? this.host._sendInteractivePrompt(this.sessionId, exactCommand) : this.host._sendInteractivePrompt(this.sessionId, exactCommand, options)).then((acknowledgement) => {
|
|
5550
6004
|
const exactAcknowledgement = AgentInteractiveSessionPromptAcknowledgementSchema.parse(acknowledgement);
|
|
5551
6005
|
if (!agentInteractiveSessionPromptAcknowledgementMatchesCommand(exactCommand, exactAcknowledgement)) throw new Error(`Interactive session ${this.sessionId} prompt acknowledgement does not match the command`);
|
|
@@ -5623,8 +6077,8 @@ var InteractiveSessionHandle = class {
|
|
|
5623
6077
|
options?.signal?.throwIfAborted();
|
|
5624
6078
|
const binding = this.requireBinding();
|
|
5625
6079
|
const exactRequest = AgentInteractiveSessionAttachSchema.parse(request);
|
|
5626
|
-
if (!agentInteractiveSessionControlClaimMatchesRef(binding.ref, exactRequest.control) || canonicalCandidateDigest
|
|
5627
|
-
const requestDigest = canonicalCandidateDigest
|
|
6080
|
+
if (!agentInteractiveSessionControlClaimMatchesRef(binding.ref, exactRequest.control) || canonicalCandidateDigest(exactRequest.control) !== canonicalCandidateDigest(binding.control)) throw new Error(`Interactive session ${this.sessionId} terminal attach is bound to a different active control claim`);
|
|
6081
|
+
const requestDigest = canonicalCandidateDigest(exactRequest);
|
|
5628
6082
|
if (this.agentTerminalAttachInFlight !== void 0) {
|
|
5629
6083
|
if (this.agentTerminalAttachDigest !== requestDigest) throw new Error(`Interactive session ${this.sessionId} cannot attach with a different terminal request while another attach is in flight`);
|
|
5630
6084
|
return awaitWithAbort(this.agentTerminalAttachInFlight, options?.signal);
|
|
@@ -5677,7 +6131,7 @@ var InteractiveSessionHandle = class {
|
|
|
5677
6131
|
options?.signal?.throwIfAborted();
|
|
5678
6132
|
const ref = this.requireRef();
|
|
5679
6133
|
const exactRequest = AgentInteractiveSessionControlClaimRequestSchema.parse(request);
|
|
5680
|
-
if (canonicalCandidateDigest
|
|
6134
|
+
if (canonicalCandidateDigest(exactRequest.ref) !== canonicalCandidateDigest(ref)) throw new Error(`Interactive session ${this.sessionId} control claim is bound to a different exact ref`);
|
|
5681
6135
|
return this.host._claimInteractiveControl(this.sessionId, exactRequest, options).then((acknowledgement) => {
|
|
5682
6136
|
const exactAcknowledgement = AgentInteractiveSessionControlClaimAcknowledgementSchema.parse(acknowledgement);
|
|
5683
6137
|
if (!agentInteractiveSessionControlClaimAcknowledgementMatchesRequest(exactRequest, exactAcknowledgement)) throw new Error(`Interactive session ${this.sessionId} control claim acknowledgement does not match the request`);
|
|
@@ -5692,7 +6146,7 @@ var InteractiveSessionHandle = class {
|
|
|
5692
6146
|
options?.signal?.throwIfAborted();
|
|
5693
6147
|
const binding = this.requireBinding();
|
|
5694
6148
|
const exactCommand = AgentInteractiveSessionStopCommandSchema.parse(command);
|
|
5695
|
-
if (canonicalCandidateDigest
|
|
6149
|
+
if (canonicalCandidateDigest(exactCommand.ref) !== canonicalCandidateDigest(binding.ref) || canonicalCandidateDigest(exactCommand.control) !== canonicalCandidateDigest(binding.control)) throw new Error(`Interactive session ${this.sessionId} stop is bound to a different exact ref`);
|
|
5696
6150
|
return (options === void 0 ? this.host._stopInteractive(this.sessionId, exactCommand) : this.host._stopInteractive(this.sessionId, exactCommand, options)).then((acknowledgement) => {
|
|
5697
6151
|
const exactAcknowledgement = AgentInteractiveSessionStopAcknowledgementSchema.parse(acknowledgement);
|
|
5698
6152
|
if (!agentInteractiveSessionStopAcknowledgementMatchesCommand(exactCommand, exactAcknowledgement)) throw new Error(`Interactive session ${this.sessionId} stop acknowledgement does not match the command`);
|
|
@@ -5704,7 +6158,7 @@ var InteractiveSessionHandle = class {
|
|
|
5704
6158
|
const ref = this.requireRef();
|
|
5705
6159
|
return (options === void 0 ? this.host._stopInteractiveLifecycle(this.sessionId, ref) : this.host._stopInteractiveLifecycle(this.sessionId, ref, options)).then((acknowledgement) => {
|
|
5706
6160
|
const exactAcknowledgement = AgentInteractiveSessionStopAcknowledgementSchema.parse(acknowledgement);
|
|
5707
|
-
if (canonicalCandidateDigest
|
|
6161
|
+
if (canonicalCandidateDigest(exactAcknowledgement.ref) !== canonicalCandidateDigest(ref)) throw new Error(`Interactive session ${this.sessionId} lifecycle stop acknowledgement does not match the exact ref`);
|
|
5708
6162
|
if (exactAcknowledgement.status !== "accepted" && exactAcknowledgement.status !== "replayed") throw new Error(`Interactive session ${this.sessionId} lifecycle stop was not confirmed (${exactAcknowledgement.status})`);
|
|
5709
6163
|
if (exactAcknowledgement.effect === "unknown") throw new Error(`Interactive session ${this.sessionId} lifecycle stop returned an unknown outcome`);
|
|
5710
6164
|
return exactAcknowledgement;
|
|
@@ -6834,7 +7288,7 @@ const interactionResolutionDeliveryStateSchema = z.enum([
|
|
|
6834
7288
|
const interactionResolutionAcknowledgementSchema = z.strictObject({
|
|
6835
7289
|
status: z.enum(["accepted", "already_resolved_same"]),
|
|
6836
7290
|
operationId: z.string().min(1),
|
|
6837
|
-
responseDigest: sha256DigestSchema
|
|
7291
|
+
responseDigest: sha256DigestSchema,
|
|
6838
7292
|
interactionId: z.string().min(1),
|
|
6839
7293
|
sessionId: z.string().min(1),
|
|
6840
7294
|
outcome: z.enum([
|
|
@@ -6862,7 +7316,7 @@ const InteractionConflictEnvelopeSchema = z.object({
|
|
|
6862
7316
|
code: z.string().min(1),
|
|
6863
7317
|
message: z.string().min(1),
|
|
6864
7318
|
status: REFUSED_INTERACTION_STATUS,
|
|
6865
|
-
existingResponseDigest: sha256DigestSchema
|
|
7319
|
+
existingResponseDigest: sha256DigestSchema.optional(),
|
|
6866
7320
|
existingOperationId: z.string().min(1).optional(),
|
|
6867
7321
|
resolvedAt: z.string().min(1).optional()
|
|
6868
7322
|
})
|
|
@@ -6890,7 +7344,7 @@ function bindingsEqual(left, right) {
|
|
|
6890
7344
|
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;
|
|
6891
7345
|
}
|
|
6892
7346
|
function assertResolutionMatches(resolution, sessionId, submitted, response, endpoint) {
|
|
6893
|
-
const expectedDigest = canonicalCandidateDigest
|
|
7347
|
+
const expectedDigest = canonicalCandidateDigest(submitted);
|
|
6894
7348
|
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);
|
|
6895
7349
|
}
|
|
6896
7350
|
/** Parse one interaction response without discarding replay information. */
|
|
@@ -7811,7 +8265,7 @@ var SandboxInteractiveCapabilities = class extends SandboxPromptCapabilities {
|
|
|
7811
8265
|
origin: "runtime",
|
|
7812
8266
|
endpoint: `/agents/sessions/${encodeURIComponent(id)}/interactive`
|
|
7813
8267
|
});
|
|
7814
|
-
if (canonicalCandidateDigest
|
|
8268
|
+
if (canonicalCandidateDigest(status.ref) !== canonicalCandidateDigest(exactCommand.ref)) throw new ValidationError("Interactive prompt ref or control does not match the session");
|
|
7815
8269
|
const endpoint = `/agents/sessions/${encodeURIComponent(id)}/interactive/prompt`;
|
|
7816
8270
|
const response = await this.runtimeFetch(endpoint, {
|
|
7817
8271
|
method: "POST",
|
|
@@ -7989,7 +8443,7 @@ var SandboxInteractiveCapabilities = class extends SandboxPromptCapabilities {
|
|
|
7989
8443
|
origin: "runtime"
|
|
7990
8444
|
});
|
|
7991
8445
|
const acknowledgement = parsed.data.data;
|
|
7992
|
-
if (canonicalCandidateDigest
|
|
8446
|
+
if (canonicalCandidateDigest(acknowledgement.ref) !== canonicalCandidateDigest(exactRef)) throw new ServerError("Interactive lifecycle stop acknowledgement does not match the exact ref", 502, {
|
|
7993
8447
|
endpoint,
|
|
7994
8448
|
origin: "runtime"
|
|
7995
8449
|
});
|
|
@@ -10038,6 +10492,75 @@ async function readEgressJson(response, message) {
|
|
|
10038
10492
|
}
|
|
10039
10493
|
}
|
|
10040
10494
|
//#endregion
|
|
10495
|
+
//#region src/generated/sandbox-filesystem-operations.ts
|
|
10496
|
+
function fileInfo(entry) {
|
|
10497
|
+
return {
|
|
10498
|
+
name: entry.name,
|
|
10499
|
+
path: entry.path,
|
|
10500
|
+
size: entry.size,
|
|
10501
|
+
isDir: entry.isDir,
|
|
10502
|
+
isFile: entry.isFile,
|
|
10503
|
+
isSymlink: entry.isSymlink,
|
|
10504
|
+
permissions: entry.permissions,
|
|
10505
|
+
owner: entry.owner,
|
|
10506
|
+
group: entry.group,
|
|
10507
|
+
modTime: new Date(entry.modTime),
|
|
10508
|
+
accessTime: new Date(entry.accessTime)
|
|
10509
|
+
};
|
|
10510
|
+
}
|
|
10511
|
+
var DeclaredFilesystemOperations = class {
|
|
10512
|
+
constructor(host) {
|
|
10513
|
+
this.host = host;
|
|
10514
|
+
}
|
|
10515
|
+
async fsList(path, options) {
|
|
10516
|
+
const params = new URLSearchParams();
|
|
10517
|
+
if (options?.all) params.set("all", "true");
|
|
10518
|
+
if (options?.long) params.set("long", "true");
|
|
10519
|
+
appendSessionIdQuery(params, options?.sessionId);
|
|
10520
|
+
await this.host.ensureRunning();
|
|
10521
|
+
const query = params.toString();
|
|
10522
|
+
const basePath = runtimeFilesystemPath("/fs/list", path);
|
|
10523
|
+
return ((await readResponseJson(await this.host.runtimeFetch(query ? basePath + "?" + query : basePath, { method: "GET" }))).data?.entries ?? []).map(fileInfo);
|
|
10524
|
+
}
|
|
10525
|
+
async fsStat(path) {
|
|
10526
|
+
await this.host.ensureRunning();
|
|
10527
|
+
const basePath = runtimeFilesystemPath("/fs/stat", path);
|
|
10528
|
+
return fileInfo((await readResponseJson(await this.host.runtimeFetch(basePath, { method: "GET" }))).data);
|
|
10529
|
+
}
|
|
10530
|
+
async fsDelete(path, options) {
|
|
10531
|
+
const params = new URLSearchParams();
|
|
10532
|
+
if (options?.recursive) params.set("recursive", "true");
|
|
10533
|
+
const hasSessionScope = appendSessionIdQuery(params, options?.sessionId);
|
|
10534
|
+
await this.host.ensureRunning();
|
|
10535
|
+
if (hasSessionScope && !options?.recursive) {
|
|
10536
|
+
const response = await this.host.runtimeFetch("/files/delete?" + params, {
|
|
10537
|
+
method: "POST",
|
|
10538
|
+
body: JSON.stringify({ path })
|
|
10539
|
+
});
|
|
10540
|
+
if (!response.ok) throw await parseResponseError(response);
|
|
10541
|
+
return;
|
|
10542
|
+
}
|
|
10543
|
+
const query = params.toString();
|
|
10544
|
+
const basePath = runtimeFilesystemPath("/fs", path);
|
|
10545
|
+
const response = await this.host.runtimeFetch(query ? basePath + "?" + query : basePath, { method: "DELETE" });
|
|
10546
|
+
if (!response.ok) throw await parseResponseError(response);
|
|
10547
|
+
}
|
|
10548
|
+
async fsMkdir(path, options) {
|
|
10549
|
+
await this.host.ensureRunning();
|
|
10550
|
+
const params = new URLSearchParams();
|
|
10551
|
+
if (options?.recursive) params.set("recursive", "true");
|
|
10552
|
+
const query = params.toString();
|
|
10553
|
+
const basePath = runtimeFilesystemPath("/fs/mkdir", path);
|
|
10554
|
+
const response = await this.host.runtimeFetch(query ? basePath + "?" + query : basePath, { method: "POST" });
|
|
10555
|
+
if (!response.ok) throw await parseResponseError(response);
|
|
10556
|
+
}
|
|
10557
|
+
async fsExists(path) {
|
|
10558
|
+
await this.host.ensureRunning();
|
|
10559
|
+
const basePath = runtimeFilesystemPath("/fs/exists", path);
|
|
10560
|
+
return (await readResponseJson(await this.host.runtimeFetch(basePath, { method: "GET" }))).data?.exists === true;
|
|
10561
|
+
}
|
|
10562
|
+
};
|
|
10563
|
+
//#endregion
|
|
10041
10564
|
//#region src/lib/file-download.ts
|
|
10042
10565
|
/** Retain only complete downloads; failed streams leave the destination intact. */
|
|
10043
10566
|
async function downloadFile(request, localPath, options = {}) {
|
|
@@ -10224,35 +10747,7 @@ function sliceRanges(total, count) {
|
|
|
10224
10747
|
}
|
|
10225
10748
|
//#endregion
|
|
10226
10749
|
//#region src/sandbox-filesystem-operations.ts
|
|
10227
|
-
|
|
10228
|
-
let decoded = segment;
|
|
10229
|
-
for (let depth = 0; depth < 32; depth++) {
|
|
10230
|
-
if (decoded === "." || decoded === "..") return true;
|
|
10231
|
-
try {
|
|
10232
|
-
const next = decodeURIComponent(decoded);
|
|
10233
|
-
if (next === decoded) return false;
|
|
10234
|
-
decoded = next;
|
|
10235
|
-
} catch {
|
|
10236
|
-
return false;
|
|
10237
|
-
}
|
|
10238
|
-
}
|
|
10239
|
-
return true;
|
|
10240
|
-
}
|
|
10241
|
-
/**
|
|
10242
|
-
* The extra separator is intentional: absolute paths produce `//`, allowing
|
|
10243
|
-
* the runtime route wildcard to retain the path's leading slash.
|
|
10244
|
-
*/
|
|
10245
|
-
function runtimeFilesystemPath(endpoint, path) {
|
|
10246
|
-
const isAbsolute = path.startsWith("/");
|
|
10247
|
-
const segments = path.split("/").filter((segment) => segment.length > 0 && segment !== ".");
|
|
10248
|
-
if (segments.some(isFilesystemTraversalSegment)) throw new ValidationError("Filesystem paths must not contain traversal segments (\"..\")");
|
|
10249
|
-
const encodedPath = segments.map(encodeURIComponent).join("/");
|
|
10250
|
-
return `${endpoint}/${isAbsolute ? "/" : ""}${encodedPath}`;
|
|
10251
|
-
}
|
|
10252
|
-
var SandboxFilesystemOperations = class {
|
|
10253
|
-
constructor(host) {
|
|
10254
|
-
this.host = host;
|
|
10255
|
-
}
|
|
10750
|
+
var SandboxFilesystemOperations = class extends DeclaredFilesystemOperations {
|
|
10256
10751
|
get fs() {
|
|
10257
10752
|
return {
|
|
10258
10753
|
supportsWriteMode: true,
|
|
@@ -10296,7 +10791,7 @@ var SandboxFilesystemOperations = class {
|
|
|
10296
10791
|
totalBytes: size,
|
|
10297
10792
|
percentage: 0
|
|
10298
10793
|
});
|
|
10299
|
-
const { uploadChunkedFromFile } = await import("./chunked-upload-file-
|
|
10794
|
+
const { uploadChunkedFromFile } = await import("./chunked-upload-file-an8AfIJx.js");
|
|
10300
10795
|
await uploadChunkedFromFile({ fetch: (path, init) => this.host.runtimeFetch(path, init) }, remotePath, localPath, {
|
|
10301
10796
|
mode: options?.permissions,
|
|
10302
10797
|
onProgress: options?.onProgress ? (progress) => {
|
|
@@ -10401,82 +10896,9 @@ var SandboxFilesystemOperations = class {
|
|
|
10401
10896
|
await fs.rm(tempDir, { recursive: true }).catch(() => {});
|
|
10402
10897
|
}
|
|
10403
10898
|
}
|
|
10404
|
-
async fsList(path, options) {
|
|
10405
|
-
const params = new URLSearchParams();
|
|
10406
|
-
if (options?.all) params.set("all", "true");
|
|
10407
|
-
if (options?.long) params.set("long", "true");
|
|
10408
|
-
appendSessionIdQuery(params, options?.sessionId);
|
|
10409
|
-
await this.host.ensureRunning();
|
|
10410
|
-
const query = params.toString();
|
|
10411
|
-
const basePath = runtimeFilesystemPath("/fs/list", path);
|
|
10412
|
-
const url = query ? `${basePath}?${query}` : basePath;
|
|
10413
|
-
return ((await readResponseJson(await this.host.runtimeFetch(url, { method: "GET" }))).data?.entries ?? []).map((e) => ({
|
|
10414
|
-
name: e.name,
|
|
10415
|
-
path: e.path,
|
|
10416
|
-
size: e.size,
|
|
10417
|
-
isDir: e.isDir,
|
|
10418
|
-
isFile: e.isFile,
|
|
10419
|
-
isSymlink: e.isSymlink,
|
|
10420
|
-
permissions: e.permissions,
|
|
10421
|
-
owner: e.owner,
|
|
10422
|
-
group: e.group,
|
|
10423
|
-
modTime: new Date(e.modTime),
|
|
10424
|
-
accessTime: new Date(e.accessTime)
|
|
10425
|
-
}));
|
|
10426
|
-
}
|
|
10427
|
-
async fsStat(path) {
|
|
10428
|
-
await this.host.ensureRunning();
|
|
10429
|
-
const e = (await readResponseJson(await this.host.runtimeFetch(runtimeFilesystemPath("/fs/stat", path), { method: "GET" }))).data;
|
|
10430
|
-
return {
|
|
10431
|
-
name: e.name,
|
|
10432
|
-
path: e.path,
|
|
10433
|
-
size: e.size,
|
|
10434
|
-
isDir: e.isDir,
|
|
10435
|
-
isFile: e.isFile,
|
|
10436
|
-
isSymlink: e.isSymlink,
|
|
10437
|
-
permissions: e.permissions,
|
|
10438
|
-
owner: e.owner,
|
|
10439
|
-
group: e.group,
|
|
10440
|
-
modTime: new Date(e.modTime),
|
|
10441
|
-
accessTime: new Date(e.accessTime)
|
|
10442
|
-
};
|
|
10443
|
-
}
|
|
10444
|
-
async fsDelete(path, options) {
|
|
10445
|
-
const params = new URLSearchParams();
|
|
10446
|
-
if (options?.recursive) params.set("recursive", "true");
|
|
10447
|
-
const hasSessionScope = appendSessionIdQuery(params, options?.sessionId);
|
|
10448
|
-
await this.host.ensureRunning();
|
|
10449
|
-
if (hasSessionScope && !options?.recursive) {
|
|
10450
|
-
const response = await this.host.runtimeFetch(`/files/delete?${params}`, {
|
|
10451
|
-
method: "POST",
|
|
10452
|
-
body: JSON.stringify({ path })
|
|
10453
|
-
});
|
|
10454
|
-
if (!response.ok) throw await parseResponseError(response);
|
|
10455
|
-
return;
|
|
10456
|
-
}
|
|
10457
|
-
const query = params.toString();
|
|
10458
|
-
const basePath = runtimeFilesystemPath("/fs", path);
|
|
10459
|
-
const url = query ? `${basePath}?${query}` : basePath;
|
|
10460
|
-
const response = await this.host.runtimeFetch(url, { method: "DELETE" });
|
|
10461
|
-
if (!response.ok) throw await parseResponseError(response);
|
|
10462
|
-
}
|
|
10463
10899
|
async fsRename(sourcePath, destinationPath, options) {
|
|
10464
10900
|
return this.host.runtime().renameFile(sourcePath, destinationPath, options);
|
|
10465
10901
|
}
|
|
10466
|
-
async fsMkdir(path, options) {
|
|
10467
|
-
await this.host.ensureRunning();
|
|
10468
|
-
const params = new URLSearchParams();
|
|
10469
|
-
if (options?.recursive) params.set("recursive", "true");
|
|
10470
|
-
const query = params.toString();
|
|
10471
|
-
const basePath = runtimeFilesystemPath("/fs/mkdir", path);
|
|
10472
|
-
const url = query ? `${basePath}?${query}` : basePath;
|
|
10473
|
-
const response = await this.host.runtimeFetch(url, { method: "POST" });
|
|
10474
|
-
if (!response.ok) throw await parseResponseError(response);
|
|
10475
|
-
}
|
|
10476
|
-
async fsExists(path) {
|
|
10477
|
-
await this.host.ensureRunning();
|
|
10478
|
-
return (await readResponseJson(await this.host.runtimeFetch(runtimeFilesystemPath("/fs/exists", path), { method: "GET" }))).data?.exists === true;
|
|
10479
|
-
}
|
|
10480
10902
|
};
|
|
10481
10903
|
//#endregion
|
|
10482
10904
|
//#region src/sandbox-interactive-terminal.ts
|
|
@@ -10702,7 +11124,7 @@ var SandboxInteractiveTerminalOperations = class {
|
|
|
10702
11124
|
origin: "runtime",
|
|
10703
11125
|
endpoint: `/agents/sessions/${encodeURIComponent(id)}/interactive`
|
|
10704
11126
|
}, "INTERACTIVE_SESSION_EXITED");
|
|
10705
|
-
if (canonicalCandidateDigest
|
|
11127
|
+
if (canonicalCandidateDigest(status.ref) !== canonicalCandidateDigest(exactRef)) throw new ValidationError("Interactive attach ref does not match the current session");
|
|
10706
11128
|
return exactRef;
|
|
10707
11129
|
}
|
|
10708
11130
|
/**
|