@tangle-network/sandbox 1.0.84 → 1.0.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/agent/index.d.ts +4 -4
  2. package/dist/agent/index.js +3 -3
  3. package/dist/agent/preview.d.ts +1 -1
  4. package/dist/agent/preview.js +1 -1
  5. package/dist/{agent-run-outcome-HyzLlfb7.d.ts → agent-run-outcome-C-spjmpO.d.ts} +2 -2
  6. package/dist/auth/index.js +1 -1
  7. package/dist/{browser-interactive-control-controller-WLzM_Lyq.js → browser-interactive-control-controller-BvtNDWql.js} +15 -15
  8. package/dist/{browser-interactive-control-controller-BelQQ9nb.d.ts → browser-interactive-control-controller-CMdlolu0.d.ts} +1 -1
  9. package/dist/{chunked-upload-tul4qbe5.js → chunked-upload--QnrxdO9.js} +43 -17
  10. package/dist/{chunked-upload-file-D9NvCQis.js → chunked-upload-file-an8AfIJx.js} +1 -1
  11. package/dist/{cli-auth-bundle-DspL04sN.js → cli-auth-bundle-BoK5wpru.js} +1 -1
  12. package/dist/{client-Y8hjzpdv.d.ts → client-C9MO8LIK.d.ts} +5 -5
  13. package/dist/{client-B2eSBVFj.js → client-DbQhnheE.js} +5 -5
  14. package/dist/{core-BBecAr2M.js → core-hC1zr8YQ.js} +3 -3
  15. package/dist/core.d.ts +6 -6
  16. package/dist/core.js +3 -3
  17. package/dist/{harness-D2TXEUu-.js → harness-BnGz2Wng.js} +5 -5
  18. package/dist/{index-Bqu-Zp7j.d.ts → index-sQwAEhFX.d.ts} +5 -5
  19. package/dist/index.d.ts +9 -9
  20. package/dist/index.js +7 -7
  21. package/dist/interactive-control.d.ts +1 -1
  22. package/dist/interactive-control.js +1 -1
  23. package/dist/{interactive-controller-DjNtSQHC.d.ts → interactive-controller-Bm3diCYK.d.ts} +3 -3
  24. package/dist/{interactive-controller-BdGvy0jq.js → interactive-controller-CkiJBT6m.js} +31 -6
  25. package/dist/{lines-rqwQmFq-.d.ts → lines-Dr8YagSZ.d.ts} +1 -1
  26. package/dist/lines.d.ts +1 -1
  27. package/dist/{local-cli-auth-xqJlVceZ.js → local-cli-auth-bw8Puox2.js} +1 -1
  28. package/dist/{preview-Q4wJz1Yl.d.ts → preview-Cp2U18Qf.d.ts} +3 -3
  29. package/dist/{profile-schema-D-XJLM1E.js → profile-schema-DFZTAn1S.js} +8 -8
  30. package/dist/{public-templates-CPwaavCU.d.ts → public-templates-BtVRh-az.d.ts} +2 -2
  31. package/dist/public-templates.d.ts +1 -1
  32. package/dist/runtime.d.ts +5 -5
  33. package/dist/runtime.js +3 -3
  34. package/dist/{sandbox-BdWInunU.js → sandbox-CzRLjpZn.js} +504 -262
  35. package/dist/select-seat-command.d.ts +1 -1
  36. package/dist/tangle/index.d.ts +1 -1
  37. package/dist/tangle/index.js +1 -1
  38. package/dist/{tangle-DjCQ1Un6.js → tangle-CA-ADYF3.js} +32 -32
  39. package/dist/{terminal-stream-types-MjiApwNS.d.ts → terminal-stream-types-CqLXtP8e.d.ts} +14 -14
  40. package/dist/{types-D9bXe-vp.d.ts → types-B150etc6.d.ts} +18 -24
  41. package/package.json +5 -5
@@ -1,16 +1,16 @@
1
- import { A as requestedPublicProfileDigest, C as encodeTextForWire, D as assertCurrentBackendType, E as applyRequestedModel, F as createAgentRunOutcomeTracker, I as deriveAgentResultOutcome, O as mergeRuntimeBackendConfig, P as withoutRuntimeSecrets, S as encodePromptForWire, U 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 requestedSecretProfilePublicDigest, k as normalizeRuntimeBackendConfig, 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 canUseNodeHttp2, x as validateAcceptedDispatchRunRef, y as resolveTraceId } from "./interactive-controller-BdGvy0jq.js";
2
- import { D as boundedStringSchema, _ as sha256, g as sha256DigestSchema$1, o as canonicalCandidateDigest$1, s as canonicalCandidateJson$1, u as isCanonicalJsonValue$1, w as boundedIdentifierSchema } from "./harness-D2TXEUu-.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-WLzM_Lyq.js";
4
- import { a as canonicalAgentProfileValue, r as agentProfileSchema } from "./profile-schema-D-XJLM1E.js";
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-tul4qbe5.js";
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-DspL04sN.js";
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.4/node_modules/@tangle-network/agent-interface/dist/agent-execution-preparation.js
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$1(material)) throw new Error("AgentProfile must contain finite, acyclic RFC 8785 JSON values");
35
- return canonicalCandidateDigest$1(material);
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.4/node_modules/@tangle-network/agent-interface/dist/environment-interactive-start.js
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$1,
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$1({
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.4/node_modules/@tangle-network/agent-interface/dist/environment-terminal.js
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$1(JSON.parse(JSON.stringify(profile))).slice(7);
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$1(profile));
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": true,
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,263 @@ 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$",
1905
+ "auth": {
1906
+ "worker": "sandbox-owner-or-scoped-runtime-token",
1907
+ "orchestrator": "sandbox-owner-or-scoped-runtime-token",
1908
+ "hostAgent": "ingress-and-scoped-token",
1909
+ "sidecar": "control-or-scoped-session-token"
1910
+ },
1911
+ "layers": [
1912
+ "worker",
1913
+ "orchestrator",
1914
+ "hostAgent",
1915
+ "sidecar",
1916
+ "typescript",
1917
+ "python"
1918
+ ],
1919
+ "auditAction": null,
1920
+ "rateFamily": null,
1921
+ "shortTokenRequired": false,
1922
+ "startsWork": true,
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$",
1795
2080
  "auth": {
1796
2081
  "worker": "sandbox-owner-or-scoped-runtime-token",
1797
2082
  "orchestrator": "sandbox-owner-or-scoped-runtime-token",
@@ -1810,11 +2095,112 @@ const routes = Object.values({
1810
2095
  "rateFamily": null,
1811
2096
  "shortTokenRequired": false,
1812
2097
  "startsWork": true,
1813
- "blocking": false
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
1814
2200
  }
1815
2201
  }).map((operation) => ({
1816
2202
  ...operation,
1817
- matcher: new RegExp("^" + operation.path.replace(/\{[^}]+\}/g, "[^/]+") + "$")
2203
+ matcher: new RegExp(operation.pattern)
1818
2204
  }));
1819
2205
  function sandboxOperation(path, method, layer) {
1820
2206
  return routes.find((operation) => operation.method === method && operation.layers.includes(layer) && operation.matcher.test(path));
@@ -2261,118 +2647,6 @@ async function isRefusedBearer(response) {
2261
2647
  return false;
2262
2648
  }
2263
2649
  }
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
2650
  const CODEX_SYSTEM_PROMPT_FILE = ".codex/system-prompt.md";
2377
2651
  const OPENCODE_APPEND_SYSTEM_PROMPT_FILE = ".opencode/agent-system-prompt.md";
2378
2652
  const OPENCODE_CONFIG_FILE = "opencode.json";
@@ -5545,7 +5819,7 @@ var InteractiveSessionHandle = class {
5545
5819
  options?.signal?.throwIfAborted();
5546
5820
  const binding = this.requireBinding();
5547
5821
  const exactCommand = AgentInteractiveSessionPromptCommandSchema.parse(command);
5548
- 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`);
5822
+ 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
5823
  return (options === void 0 ? this.host._sendInteractivePrompt(this.sessionId, exactCommand) : this.host._sendInteractivePrompt(this.sessionId, exactCommand, options)).then((acknowledgement) => {
5550
5824
  const exactAcknowledgement = AgentInteractiveSessionPromptAcknowledgementSchema.parse(acknowledgement);
5551
5825
  if (!agentInteractiveSessionPromptAcknowledgementMatchesCommand(exactCommand, exactAcknowledgement)) throw new Error(`Interactive session ${this.sessionId} prompt acknowledgement does not match the command`);
@@ -5623,8 +5897,8 @@ var InteractiveSessionHandle = class {
5623
5897
  options?.signal?.throwIfAborted();
5624
5898
  const binding = this.requireBinding();
5625
5899
  const exactRequest = AgentInteractiveSessionAttachSchema.parse(request);
5626
- 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`);
5627
- const requestDigest = canonicalCandidateDigest$1(exactRequest);
5900
+ 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`);
5901
+ const requestDigest = canonicalCandidateDigest(exactRequest);
5628
5902
  if (this.agentTerminalAttachInFlight !== void 0) {
5629
5903
  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
5904
  return awaitWithAbort(this.agentTerminalAttachInFlight, options?.signal);
@@ -5677,7 +5951,7 @@ var InteractiveSessionHandle = class {
5677
5951
  options?.signal?.throwIfAborted();
5678
5952
  const ref = this.requireRef();
5679
5953
  const exactRequest = AgentInteractiveSessionControlClaimRequestSchema.parse(request);
5680
- if (canonicalCandidateDigest$1(exactRequest.ref) !== canonicalCandidateDigest$1(ref)) throw new Error(`Interactive session ${this.sessionId} control claim is bound to a different exact ref`);
5954
+ if (canonicalCandidateDigest(exactRequest.ref) !== canonicalCandidateDigest(ref)) throw new Error(`Interactive session ${this.sessionId} control claim is bound to a different exact ref`);
5681
5955
  return this.host._claimInteractiveControl(this.sessionId, exactRequest, options).then((acknowledgement) => {
5682
5956
  const exactAcknowledgement = AgentInteractiveSessionControlClaimAcknowledgementSchema.parse(acknowledgement);
5683
5957
  if (!agentInteractiveSessionControlClaimAcknowledgementMatchesRequest(exactRequest, exactAcknowledgement)) throw new Error(`Interactive session ${this.sessionId} control claim acknowledgement does not match the request`);
@@ -5692,7 +5966,7 @@ var InteractiveSessionHandle = class {
5692
5966
  options?.signal?.throwIfAborted();
5693
5967
  const binding = this.requireBinding();
5694
5968
  const exactCommand = AgentInteractiveSessionStopCommandSchema.parse(command);
5695
- 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`);
5969
+ 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
5970
  return (options === void 0 ? this.host._stopInteractive(this.sessionId, exactCommand) : this.host._stopInteractive(this.sessionId, exactCommand, options)).then((acknowledgement) => {
5697
5971
  const exactAcknowledgement = AgentInteractiveSessionStopAcknowledgementSchema.parse(acknowledgement);
5698
5972
  if (!agentInteractiveSessionStopAcknowledgementMatchesCommand(exactCommand, exactAcknowledgement)) throw new Error(`Interactive session ${this.sessionId} stop acknowledgement does not match the command`);
@@ -5704,7 +5978,7 @@ var InteractiveSessionHandle = class {
5704
5978
  const ref = this.requireRef();
5705
5979
  return (options === void 0 ? this.host._stopInteractiveLifecycle(this.sessionId, ref) : this.host._stopInteractiveLifecycle(this.sessionId, ref, options)).then((acknowledgement) => {
5706
5980
  const exactAcknowledgement = AgentInteractiveSessionStopAcknowledgementSchema.parse(acknowledgement);
5707
- if (canonicalCandidateDigest$1(exactAcknowledgement.ref) !== canonicalCandidateDigest$1(ref)) throw new Error(`Interactive session ${this.sessionId} lifecycle stop acknowledgement does not match the exact ref`);
5981
+ if (canonicalCandidateDigest(exactAcknowledgement.ref) !== canonicalCandidateDigest(ref)) throw new Error(`Interactive session ${this.sessionId} lifecycle stop acknowledgement does not match the exact ref`);
5708
5982
  if (exactAcknowledgement.status !== "accepted" && exactAcknowledgement.status !== "replayed") throw new Error(`Interactive session ${this.sessionId} lifecycle stop was not confirmed (${exactAcknowledgement.status})`);
5709
5983
  if (exactAcknowledgement.effect === "unknown") throw new Error(`Interactive session ${this.sessionId} lifecycle stop returned an unknown outcome`);
5710
5984
  return exactAcknowledgement;
@@ -6834,7 +7108,7 @@ const interactionResolutionDeliveryStateSchema = z.enum([
6834
7108
  const interactionResolutionAcknowledgementSchema = z.strictObject({
6835
7109
  status: z.enum(["accepted", "already_resolved_same"]),
6836
7110
  operationId: z.string().min(1),
6837
- responseDigest: sha256DigestSchema$1,
7111
+ responseDigest: sha256DigestSchema,
6838
7112
  interactionId: z.string().min(1),
6839
7113
  sessionId: z.string().min(1),
6840
7114
  outcome: z.enum([
@@ -6862,7 +7136,7 @@ const InteractionConflictEnvelopeSchema = z.object({
6862
7136
  code: z.string().min(1),
6863
7137
  message: z.string().min(1),
6864
7138
  status: REFUSED_INTERACTION_STATUS,
6865
- existingResponseDigest: sha256DigestSchema$1.optional(),
7139
+ existingResponseDigest: sha256DigestSchema.optional(),
6866
7140
  existingOperationId: z.string().min(1).optional(),
6867
7141
  resolvedAt: z.string().min(1).optional()
6868
7142
  })
@@ -6890,7 +7164,7 @@ function bindingsEqual(left, right) {
6890
7164
  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
7165
  }
6892
7166
  function assertResolutionMatches(resolution, sessionId, submitted, response, endpoint) {
6893
- const expectedDigest = canonicalCandidateDigest$1(submitted);
7167
+ const expectedDigest = canonicalCandidateDigest(submitted);
6894
7168
  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
7169
  }
6896
7170
  /** Parse one interaction response without discarding replay information. */
@@ -7811,7 +8085,7 @@ var SandboxInteractiveCapabilities = class extends SandboxPromptCapabilities {
7811
8085
  origin: "runtime",
7812
8086
  endpoint: `/agents/sessions/${encodeURIComponent(id)}/interactive`
7813
8087
  });
7814
- if (canonicalCandidateDigest$1(status.ref) !== canonicalCandidateDigest$1(exactCommand.ref)) throw new ValidationError("Interactive prompt ref or control does not match the session");
8088
+ if (canonicalCandidateDigest(status.ref) !== canonicalCandidateDigest(exactCommand.ref)) throw new ValidationError("Interactive prompt ref or control does not match the session");
7815
8089
  const endpoint = `/agents/sessions/${encodeURIComponent(id)}/interactive/prompt`;
7816
8090
  const response = await this.runtimeFetch(endpoint, {
7817
8091
  method: "POST",
@@ -7989,7 +8263,7 @@ var SandboxInteractiveCapabilities = class extends SandboxPromptCapabilities {
7989
8263
  origin: "runtime"
7990
8264
  });
7991
8265
  const acknowledgement = parsed.data.data;
7992
- if (canonicalCandidateDigest$1(acknowledgement.ref) !== canonicalCandidateDigest$1(exactRef)) throw new ServerError("Interactive lifecycle stop acknowledgement does not match the exact ref", 502, {
8266
+ if (canonicalCandidateDigest(acknowledgement.ref) !== canonicalCandidateDigest(exactRef)) throw new ServerError("Interactive lifecycle stop acknowledgement does not match the exact ref", 502, {
7993
8267
  endpoint,
7994
8268
  origin: "runtime"
7995
8269
  });
@@ -10038,6 +10312,75 @@ async function readEgressJson(response, message) {
10038
10312
  }
10039
10313
  }
10040
10314
  //#endregion
10315
+ //#region src/generated/sandbox-filesystem-operations.ts
10316
+ function fileInfo(entry) {
10317
+ return {
10318
+ name: entry.name,
10319
+ path: entry.path,
10320
+ size: entry.size,
10321
+ isDir: entry.isDir,
10322
+ isFile: entry.isFile,
10323
+ isSymlink: entry.isSymlink,
10324
+ permissions: entry.permissions,
10325
+ owner: entry.owner,
10326
+ group: entry.group,
10327
+ modTime: new Date(entry.modTime),
10328
+ accessTime: new Date(entry.accessTime)
10329
+ };
10330
+ }
10331
+ var DeclaredFilesystemOperations = class {
10332
+ constructor(host) {
10333
+ this.host = host;
10334
+ }
10335
+ async fsList(path, options) {
10336
+ const params = new URLSearchParams();
10337
+ if (options?.all) params.set("all", "true");
10338
+ if (options?.long) params.set("long", "true");
10339
+ appendSessionIdQuery(params, options?.sessionId);
10340
+ await this.host.ensureRunning();
10341
+ const query = params.toString();
10342
+ const basePath = runtimeFilesystemPath("/fs/list", path);
10343
+ return ((await readResponseJson(await this.host.runtimeFetch(query ? basePath + "?" + query : basePath, { method: "GET" }))).data?.entries ?? []).map(fileInfo);
10344
+ }
10345
+ async fsStat(path) {
10346
+ await this.host.ensureRunning();
10347
+ const basePath = runtimeFilesystemPath("/fs/stat", path);
10348
+ return fileInfo((await readResponseJson(await this.host.runtimeFetch(basePath, { method: "GET" }))).data);
10349
+ }
10350
+ async fsDelete(path, options) {
10351
+ const params = new URLSearchParams();
10352
+ if (options?.recursive) params.set("recursive", "true");
10353
+ const hasSessionScope = appendSessionIdQuery(params, options?.sessionId);
10354
+ await this.host.ensureRunning();
10355
+ if (hasSessionScope && !options?.recursive) {
10356
+ const response = await this.host.runtimeFetch("/files/delete?" + params, {
10357
+ method: "POST",
10358
+ body: JSON.stringify({ path })
10359
+ });
10360
+ if (!response.ok) throw await parseResponseError(response);
10361
+ return;
10362
+ }
10363
+ const query = params.toString();
10364
+ const basePath = runtimeFilesystemPath("/fs", path);
10365
+ const response = await this.host.runtimeFetch(query ? basePath + "?" + query : basePath, { method: "DELETE" });
10366
+ if (!response.ok) throw await parseResponseError(response);
10367
+ }
10368
+ async fsMkdir(path, options) {
10369
+ await this.host.ensureRunning();
10370
+ const params = new URLSearchParams();
10371
+ if (options?.recursive) params.set("recursive", "true");
10372
+ const query = params.toString();
10373
+ const basePath = runtimeFilesystemPath("/fs/mkdir", path);
10374
+ const response = await this.host.runtimeFetch(query ? basePath + "?" + query : basePath, { method: "POST" });
10375
+ if (!response.ok) throw await parseResponseError(response);
10376
+ }
10377
+ async fsExists(path) {
10378
+ await this.host.ensureRunning();
10379
+ const basePath = runtimeFilesystemPath("/fs/exists", path);
10380
+ return (await readResponseJson(await this.host.runtimeFetch(basePath, { method: "GET" }))).data?.exists === true;
10381
+ }
10382
+ };
10383
+ //#endregion
10041
10384
  //#region src/lib/file-download.ts
10042
10385
  /** Retain only complete downloads; failed streams leave the destination intact. */
10043
10386
  async function downloadFile(request, localPath, options = {}) {
@@ -10224,35 +10567,7 @@ function sliceRanges(total, count) {
10224
10567
  }
10225
10568
  //#endregion
10226
10569
  //#region src/sandbox-filesystem-operations.ts
10227
- function isFilesystemTraversalSegment(segment) {
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
- }
10570
+ var SandboxFilesystemOperations = class extends DeclaredFilesystemOperations {
10256
10571
  get fs() {
10257
10572
  return {
10258
10573
  supportsWriteMode: true,
@@ -10296,7 +10611,7 @@ var SandboxFilesystemOperations = class {
10296
10611
  totalBytes: size,
10297
10612
  percentage: 0
10298
10613
  });
10299
- const { uploadChunkedFromFile } = await import("./chunked-upload-file-D9NvCQis.js");
10614
+ const { uploadChunkedFromFile } = await import("./chunked-upload-file-an8AfIJx.js");
10300
10615
  await uploadChunkedFromFile({ fetch: (path, init) => this.host.runtimeFetch(path, init) }, remotePath, localPath, {
10301
10616
  mode: options?.permissions,
10302
10617
  onProgress: options?.onProgress ? (progress) => {
@@ -10401,82 +10716,9 @@ var SandboxFilesystemOperations = class {
10401
10716
  await fs.rm(tempDir, { recursive: true }).catch(() => {});
10402
10717
  }
10403
10718
  }
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
10719
  async fsRename(sourcePath, destinationPath, options) {
10464
10720
  return this.host.runtime().renameFile(sourcePath, destinationPath, options);
10465
10721
  }
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
10722
  };
10481
10723
  //#endregion
10482
10724
  //#region src/sandbox-interactive-terminal.ts
@@ -10702,7 +10944,7 @@ var SandboxInteractiveTerminalOperations = class {
10702
10944
  origin: "runtime",
10703
10945
  endpoint: `/agents/sessions/${encodeURIComponent(id)}/interactive`
10704
10946
  }, "INTERACTIVE_SESSION_EXITED");
10705
- if (canonicalCandidateDigest$1(status.ref) !== canonicalCandidateDigest$1(exactRef)) throw new ValidationError("Interactive attach ref does not match the current session");
10947
+ if (canonicalCandidateDigest(status.ref) !== canonicalCandidateDigest(exactRef)) throw new ValidationError("Interactive attach ref does not match the current session");
10706
10948
  return exactRef;
10707
10949
  }
10708
10950
  /**