@cloudflare/sandbox 0.13.0-next.797.1 → 0.13.0-next.808.1

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 (43) hide show
  1. package/README.md +7 -0
  2. package/dist/bridge/index.js +23 -14
  3. package/dist/bridge/index.js.map +1 -1
  4. package/dist/{contexts-1EsLHByO.d.ts → contexts-DNFVmC9N.d.ts} +4 -1
  5. package/dist/contexts-DNFVmC9N.d.ts.map +1 -0
  6. package/dist/errors/index.d.ts +2 -2
  7. package/dist/errors/index.js +2 -2
  8. package/dist/{errors-QYlSkVGz.js → errors--yR3zLC_.js} +2 -2
  9. package/dist/{errors-QYlSkVGz.js.map → errors--yR3zLC_.js.map} +1 -1
  10. package/dist/{errors-CXR0xBpw.js → errors-Bb3s6nBS.js} +7 -1
  11. package/dist/errors-Bb3s6nBS.js.map +1 -0
  12. package/dist/extensions/index.d.ts +2 -2
  13. package/dist/extensions/index.js +3 -3
  14. package/dist/{extensions-Be5HnDGt.js → extensions-038QzSIg.js} +7 -3
  15. package/dist/extensions-038QzSIg.js.map +1 -0
  16. package/dist/{filesystem-Y5aF3nmJ.d.ts → filesystem-Cd6xd_Pe.d.ts} +5 -1
  17. package/dist/filesystem-Cd6xd_Pe.d.ts.map +1 -0
  18. package/dist/git/index.d.ts +2 -2
  19. package/dist/git/index.js +3 -3
  20. package/dist/{index-HNYBk-az.d.ts → index-CfpTXmNv.d.ts} +2 -2
  21. package/dist/{index-HNYBk-az.d.ts.map → index-CfpTXmNv.d.ts.map} +1 -1
  22. package/dist/{index-DfXx3uZL.d.ts → index-Fbdwkfft.d.ts} +9 -3
  23. package/dist/index-Fbdwkfft.d.ts.map +1 -0
  24. package/dist/index.d.ts +6 -5
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +4 -4
  27. package/dist/interpreter/index.d.ts +2 -2
  28. package/dist/interpreter/index.js +3 -3
  29. package/dist/openai/index.d.ts +2 -2
  30. package/dist/openai/index.js +1 -1
  31. package/dist/opencode/index.d.ts +3 -3
  32. package/dist/opencode/index.js +3 -3
  33. package/dist/{sandbox-BEhPgFZx.js → sandbox-CpelK4pU.js} +227 -68
  34. package/dist/sandbox-CpelK4pU.js.map +1 -0
  35. package/dist/{sandbox-CBkS3tGv.d.ts → sandbox-D1BoB5f7.d.ts} +2 -2
  36. package/dist/{sandbox-CBkS3tGv.d.ts.map → sandbox-D1BoB5f7.d.ts.map} +1 -1
  37. package/package.json +1 -1
  38. package/dist/contexts-1EsLHByO.d.ts.map +0 -1
  39. package/dist/errors-CXR0xBpw.js.map +0 -1
  40. package/dist/extensions-Be5HnDGt.js.map +0 -1
  41. package/dist/filesystem-Y5aF3nmJ.d.ts.map +0 -1
  42. package/dist/index-DfXx3uZL.d.ts.map +0 -1
  43. package/dist/sandbox-BEhPgFZx.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/file-stream.ts","../src/platform-errors.ts","../src/pty/rpc-types.ts","../src/pty/proxy.ts","../src/backup/restore-fault-injection.ts","../src/storage-mount/errors.ts","../src/storage-mount/outbound/container-proxy.ts","../src/tunnels/tunnel-service.ts","../src/sandbox.ts","../src/request-handler.ts","../src/sse-parser.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAmFA;;;;;;;AA+DA;;;;AAEY,iBAjEW,UAAA,CAiEX,MAAA,EAhEF,cAgEE,CAhEa,UAgEb,CAAA,CAAA,EA/DT,cA+DS,CA/DM,SA+DN,EA/DiB,YA+DjB,CAAA;;;;;;AC1GZ;AA2BA;;;;AC9DA;;;;AAGc,iBFwIQ,WAAA,CExIR,MAAA,EFwI4B,cExI5B,CFwI2C,UExI3C,CAAA,CAAA,EFwIyD,OExIzD,CAAA;EAC0B,OAAA,EAAA,MAAA,GFwIpB,UExIoB;EAA3B,QAAA,EFyID,YEzIC;CAAR,CAAA;;;;;;;;;iBD+BW,8BAAA;;;;;ADwGM,iBC7EN,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CAAA,EFk7FG,mBEl7FH,CAAA,EFm7FL,OEn7FK,CFm7FG,kBEn7FH,CAAA;EACC;;;;AAyFX;;;;;;AAuBA;;;;;;;;;;;;;;;;;;;;GF23FG,kBAAA,GAGO;;;;;MAIsD;;;;;;;;;;;;8BAY5B;;;;;qCAQI;;;;;;;;;;+BASH;;;;;;;kDAUmB;;;;;;;;;;;;;;;;;;;;iBAuBvC;;;;;;;;;;;;;;;wBAsDa,gBAAgB,QAAQ;;;;;;;;;wBAYxB,kBAAkB,QAAQ;2CAK7C,gCACN;qCAKO,4BACP;;;;;UCvoGY,qBAAqB,eAAe;WAC1C,uBAAuB;;iBAaZ,yBACV,wBACA,WAAW,aACZ,cAAc,IAAI,QAAQ;;;;;;;;;;;;iBCVd,0BACb,eAAe,sBACd,cACR,cAAc;AVoEjB;;;;;AAEG,iBUkBoB,uBVlBpB,CAAA,CAAA,CAAA,CAAA,QAAA,EUmBS,QVnBT,EAAA,MAAA,CAAA,EUoBQ,WVpBR,CAAA,EUqBA,aVrBA,CUqBc,CVrBd,CAAA;;AA6DH;;;;;AAAuE,iBUpBvD,wBVoBuD,CAAA,CAAA,CAAA,CAAA,MAAA,EUnB7D,aVmB6D,CUnB/C,CVmB+C,CAAA,EAAA,QAAA,EAAA;EAAO,MAAA,CAAA,EUjBjE,WViBiE;sBUhBtD;IAErB,eAAe"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/file-stream.ts","../src/platform-errors.ts","../src/pty/rpc-types.ts","../src/pty/proxy.ts","../src/backup/restore-fault-injection.ts","../src/storage-mount/errors.ts","../src/storage-mount/outbound/container-proxy.ts","../src/tunnels/tunnel-service.ts","../src/sandbox.ts","../src/request-handler.ts","../src/sse-parser.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAmFA;;;;;;;AA+DA;;;;AAEY,iBAjEW,UAAA,CAiEX,MAAA,EAhEF,cAgEE,CAhEa,UAgEb,CAAA,CAAA,EA/DT,cA+DS,CA/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errors-CXR0xBpw.js";
2
- import { $ as TerminalControlError, G as BackupRestoreError, H as BackupCreateError, J as InvalidTerminalCursorError, K as ContainerUnavailableError, Q as StaleTerminalHandleError, U as BackupExpiredError, W as BackupNotFoundError, X as OperationInterruptedError, Y as InvalidTerminalCwdError, Z as RPCTransportError, _ as StaleProcessHandleError, c as InvalidProcessEnvironmentError, d as ProcessExitedBeforeLogError, et as TerminalNotFoundError, f as ProcessExitedBeforeReadyError, g as ProcessWaitTimeoutError, h as ProcessSpawnFailedError, l as ProcessAbortedError, m as ProcessReadyTimeoutError, n as RuntimeIdentityInactiveError, o as InvalidProcessCursorError, p as ProcessNotFoundError, q as InvalidBackupConfigError, r as RuntimeControlProtocolError, s as InvalidProcessCwdError, u as ProcessError } from "./errors-QYlSkVGz.js";
1
+ import "./errors-Bb3s6nBS.js";
2
+ import { $ as TerminalControlError, G as BackupRestoreError, H as BackupCreateError, J as InvalidTerminalCursorError, K as ContainerUnavailableError, Q as StaleTerminalHandleError, U as BackupExpiredError, W as BackupNotFoundError, X as OperationInterruptedError, Y as InvalidTerminalCwdError, Z as RPCTransportError, _ as StaleProcessHandleError, c as InvalidProcessEnvironmentError, d as ProcessExitedBeforeLogError, et as TerminalNotFoundError, f as ProcessExitedBeforeReadyError, g as ProcessWaitTimeoutError, h as ProcessSpawnFailedError, l as ProcessAbortedError, m as ProcessReadyTimeoutError, n as RuntimeIdentityInactiveError, o as InvalidProcessCursorError, p as ProcessNotFoundError, q as InvalidBackupConfigError, r as RuntimeControlProtocolError, s as InvalidProcessCwdError, u as ProcessError } from "./errors--yR3zLC_.js";
3
3
  import { a as TraceContext, r as createLogger } from "./dist-n_eniPAR.js";
4
- import { _ as proxyTerminal, a as responseToAsyncIterable, b as collectFile, c as BucketUnmountError, d as S3FSMountError, f as parsePreviewRoute, i as parseSSEStream, l as InvalidMountConfigError, n as getSandbox, o as ContainerProxy, p as withPreviewProxyMetadata, r as asyncIterableToSSEStream, s as BucketMountError, t as Sandbox, u as MissingCredentialsError, v as isDurableObjectCodeUpdateReset, x as streamFile, y as isPlatformTransientError } from "./sandbox-BEhPgFZx.js";
5
- import "./extensions-Be5HnDGt.js";
4
+ import { _ as proxyTerminal, a as responseToAsyncIterable, b as collectFile, c as BucketUnmountError, d as S3FSMountError, f as parsePreviewRoute, i as parseSSEStream, l as InvalidMountConfigError, n as getSandbox, o as ContainerProxy, p as withPreviewProxyMetadata, r as asyncIterableToSSEStream, s as BucketMountError, t as Sandbox, u as MissingCredentialsError, v as isDurableObjectCodeUpdateReset, x as streamFile, y as isPlatformTransientError } from "./sandbox-CpelK4pU.js";
5
+ import "./extensions-038QzSIg.js";
6
6
 
7
7
  //#region src/request-handler.ts
8
8
  function createProxyLogger(request) {
@@ -1,6 +1,6 @@
1
1
  import "../process-types-GStiZ8f8.js";
2
- import "../filesystem-Y5aF3nmJ.js";
3
- import { c as SandboxExtension, l as SandboxLike } from "../index-DfXx3uZL.js";
2
+ import "../filesystem-Cd6xd_Pe.js";
3
+ import { c as SandboxExtension, l as SandboxLike } from "../index-Fbdwkfft.js";
4
4
 
5
5
  //#region ../../extensions/interpreter/src/types.d.ts
6
6
 
@@ -1,7 +1,7 @@
1
- import "../errors-CXR0xBpw.js";
2
- import "../errors-QYlSkVGz.js";
1
+ import "../errors-Bb3s6nBS.js";
2
+ import "../errors--yR3zLC_.js";
3
3
  import "../dist-n_eniPAR.js";
4
- import { t as SandboxExtension } from "../extensions-Be5HnDGt.js";
4
+ import { t as SandboxExtension } from "../extensions-038QzSIg.js";
5
5
 
6
6
  //#region rolldown:runtime
7
7
  var __toBinaryNode = (base64) => new Uint8Array(Buffer.from(base64, "base64"));
@@ -1,6 +1,6 @@
1
1
  import "../process-types-GStiZ8f8.js";
2
- import "../filesystem-Y5aF3nmJ.js";
3
- import { t as ISandbox } from "../sandbox-CBkS3tGv.js";
2
+ import "../filesystem-Cd6xd_Pe.js";
3
+ import { t as ISandbox } from "../sandbox-D1BoB5f7.js";
4
4
  import { ApplyPatchOperation, ApplyPatchResult, Editor as Editor$1, Shell as Shell$1, ShellAction, ShellResult } from "@openai/agents";
5
5
 
6
6
  //#region src/openai/index.d.ts
@@ -1,4 +1,4 @@
1
- import "../errors-CXR0xBpw.js";
1
+ import "../errors-Bb3s6nBS.js";
2
2
  import { r as createLogger } from "../dist-n_eniPAR.js";
3
3
  import { applyDiff } from "@openai/agents";
4
4
 
@@ -1,7 +1,7 @@
1
- import { D as OpenCodeStartupContext } from "../contexts-1EsLHByO.js";
1
+ import { D as OpenCodeStartupContext } from "../contexts-DNFVmC9N.js";
2
2
  import "../process-types-GStiZ8f8.js";
3
- import "../filesystem-Y5aF3nmJ.js";
4
- import { c as SandboxExtension, l as SandboxLike } from "../index-DfXx3uZL.js";
3
+ import "../filesystem-Cd6xd_Pe.js";
4
+ import { c as SandboxExtension, l as SandboxLike } from "../index-Fbdwkfft.js";
5
5
  import { OpencodeClient } from "@opencode-ai/sdk/v2/client";
6
6
  import { Config } from "@opencode-ai/sdk/v2";
7
7
 
@@ -1,7 +1,7 @@
1
- import { i as ErrorCode } from "../errors-CXR0xBpw.js";
2
- import "../errors-QYlSkVGz.js";
1
+ import { i as ErrorCode } from "../errors-Bb3s6nBS.js";
2
+ import "../errors--yR3zLC_.js";
3
3
  import { r as createLogger } from "../dist-n_eniPAR.js";
4
- import { n as createExtensionProcessSandbox, t as SandboxExtension } from "../extensions-Be5HnDGt.js";
4
+ import { n as createExtensionProcessSandbox, t as SandboxExtension } from "../extensions-038QzSIg.js";
5
5
 
6
6
  //#region ../../extensions/opencode/src/client.ts
7
7
  let createSDKClient;
@@ -1,7 +1,7 @@
1
- import { i as ErrorCode, n as getSuggestion, r as getHttpStatus } from "./errors-CXR0xBpw.js";
2
- import { $ as TerminalControlError, G as BackupRestoreError, H as BackupCreateError, Q as StaleTerminalHandleError, U as BackupExpiredError, W as BackupNotFoundError, X as OperationInterruptedError, Z as RPCTransportError, _ as StaleProcessHandleError, n as RuntimeIdentityInactiveError, p as ProcessNotFoundError, q as InvalidBackupConfigError, r as RuntimeControlProtocolError, t as createErrorFromResponse, tt as SandboxError, v as CustomDomainRequiredError } from "./errors-QYlSkVGz.js";
1
+ import { i as ErrorCode, n as getSuggestion, r as getHttpStatus } from "./errors-Bb3s6nBS.js";
2
+ import { $ as TerminalControlError, G as BackupRestoreError, H as BackupCreateError, Q as StaleTerminalHandleError, U as BackupExpiredError, W as BackupNotFoundError, X as OperationInterruptedError, Z as RPCTransportError, _ as StaleProcessHandleError, n as RuntimeIdentityInactiveError, p as ProcessNotFoundError, q as InvalidBackupConfigError, r as RuntimeControlProtocolError, t as createErrorFromResponse, tt as SandboxError, v as CustomDomainRequiredError } from "./errors--yR3zLC_.js";
3
3
  import { a as TraceContext, d as partitionEnvVars, i as createNoOpLogger, o as logCanonicalEvent, r as createLogger, t as parseSSEFrames, u as getEnvString } from "./dist-n_eniPAR.js";
4
- import { a as PullSubscriptionTarget, i as createSandboxProcess, o as openRemoteSubscription, r as sandboxRuntimeCall, s as translateRPCError, t as SandboxExtension } from "./extensions-Be5HnDGt.js";
4
+ import { a as PullSubscriptionTarget, i as createSandboxProcess, o as openRemoteSubscription, r as sandboxRuntimeCall, s as translateRPCError, t as SandboxExtension } from "./extensions-038QzSIg.js";
5
5
  import { Container, ContainerProxy, getContainer, switchPort } from "@cloudflare/containers";
6
6
  import { RpcTarget } from "cloudflare:workers";
7
7
  import { AwsClient } from "aws4fetch";
@@ -190,7 +190,7 @@ function isPlatformTransientError(error) {
190
190
 
191
191
  //#endregion
192
192
  //#region src/pty/proxy.ts
193
- function terminalHandle(stub, snapshot, runtimeIncarnationID, outputProtocol = "stream") {
193
+ function terminalHandle(stub, snapshot, runtimeIncarnationID, outputProtocol = "stream", release = () => void 0) {
194
194
  const id = snapshot.id;
195
195
  return {
196
196
  id,
@@ -211,7 +211,8 @@ function terminalHandle(stub, snapshot, runtimeIncarnationID, outputProtocol = "
211
211
  ...options,
212
212
  runtimeIncarnationID
213
213
  });
214
- }
214
+ },
215
+ [Symbol.dispose]: release
215
216
  };
216
217
  }
217
218
  function terminalHandleFromRPCDescriptor(descriptor, fetch$1) {
@@ -224,7 +225,7 @@ function terminalHandleFromRPCDescriptor(descriptor, fetch$1) {
224
225
  interrupt: () => capability.interrupt(),
225
226
  terminate: () => capability.terminate(),
226
227
  fetch: fetch$1
227
- }, descriptor.snapshot, descriptor.runtimeIncarnationID, "pull");
228
+ }, descriptor.snapshot, descriptor.runtimeIncarnationID, "pull", () => capability[Symbol.dispose]?.());
228
229
  }
229
230
  async function terminalOutput(stub, id, options, protocol) {
230
231
  const { signal, ...rpcOptions } = options ?? {};
@@ -1530,16 +1531,53 @@ var ContainerProxy$1 = class extends ContainerProxy {
1530
1531
  };
1531
1532
  ContainerProxy$1.outboundHandlers = SDK_OUTBOUND_HANDLERS;
1532
1533
 
1534
+ //#endregion
1535
+ //#region src/storage-mount/outbound/params.ts
1536
+ function hasExcludedID(excludedIDs, mountId) {
1537
+ if (!excludedIDs) return false;
1538
+ for (const excludedID of excludedIDs) if (excludedID === mountId) return true;
1539
+ return false;
1540
+ }
1541
+ function buildR2EgressParams(mounts, options) {
1542
+ const buckets = {};
1543
+ for (const [, mountInfo] of mounts) if (mountInfo.mountType === "r2-egress" && mountInfo.mountId !== options?.excludeMountId && !hasExcludedID(options?.excludeMountIds, mountInfo.mountId)) buckets[mountInfo.bucket] = {
1544
+ prefix: mountInfo.prefix,
1545
+ readOnly: mountInfo.readOnly
1546
+ };
1547
+ return { buckets };
1548
+ }
1549
+ function buildS3CredentialProxyParams(mounts, options) {
1550
+ const params = {};
1551
+ const addMount = (mountInfo) => {
1552
+ if (!mountInfo.credentialProxy || mountInfo.mountId === options?.excludeMountId || hasExcludedID(options?.excludeMountIds, mountInfo.mountId)) return;
1553
+ params[mountInfo.mountId] = {
1554
+ endpoint: mountInfo.credentialProxy.endpoint,
1555
+ bucket: mountInfo.credentialProxy.bucket,
1556
+ ...mountInfo.credentialProxy.prefix !== void 0 ? { prefix: mountInfo.credentialProxy.prefix } : {},
1557
+ credentials: mountInfo.credentialProxy.credentials,
1558
+ readOnly: mountInfo.credentialProxy.readOnly,
1559
+ provider: mountInfo.credentialProxy.provider,
1560
+ authStrategy: mountInfo.credentialProxy.authStrategy
1561
+ };
1562
+ };
1563
+ for (const [, mountInfo] of mounts) if (mountInfo.mountType === "fuse") addMount(mountInfo);
1564
+ if (options?.includeMount) addMount(options.includeMount);
1565
+ return { mounts: params };
1566
+ }
1567
+
1533
1568
  //#endregion
1534
1569
  //#region src/storage-mount/outbound/index.ts
1535
1570
  function isFetcher(value) {
1536
1571
  return typeof value === "object" && value !== null && "fetch" in value && typeof value.fetch === "function";
1537
1572
  }
1538
- async function configureR2EgressOutbound(host, params) {
1573
+ async function configureR2EgressOutbound(host, activeParams) {
1574
+ const params = { buckets: {
1575
+ ...host.restoredMountRoutes.r2Buckets,
1576
+ ...activeParams.buckets
1577
+ } };
1539
1578
  const ctx = host.ctx;
1540
1579
  if (!ctx.container?.interceptOutboundHttp) throw new InvalidMountConfigError("R2 binding mounts require container outbound interception support");
1541
1580
  if (!ctx.exports?.ContainerProxy) throw new InvalidMountConfigError("R2 binding mounts require exporting ContainerProxy from the Worker entrypoint");
1542
- installSDKOutboundHandlers(host.constructorRef);
1543
1581
  if (Object.keys(params.buckets).length > 0) await host.setOutboundByHost("r2.internal", "r2EgressMount", params);
1544
1582
  else await host.removeOutboundByHost("r2.internal");
1545
1583
  host.logger.debug("r2 egress: registering host interception", {
@@ -1563,7 +1601,6 @@ async function configureGitAuthInterceptor(host, params) {
1563
1601
  const ctx = host.ctx;
1564
1602
  if (!ctx.container?.interceptOutboundHttp) throw new InvalidMountConfigError("Git extension authentication requires container outbound interception support");
1565
1603
  if (!ctx.exports?.ContainerProxy) throw new InvalidMountConfigError("Git extension authentication requires exporting ContainerProxy from the Worker entrypoint. Import ContainerProxy from @cloudflare/sandbox and export it from your Worker to use git auth interception.");
1566
- installSDKOutboundHandlers(host.constructorRef);
1567
1604
  const hostOverrides = {};
1568
1605
  for (const outboundHost of Object.keys(params.hosts)) {
1569
1606
  hostOverrides[outboundHost] = {
@@ -1581,12 +1618,15 @@ async function configureGitAuthInterceptor(host, params) {
1581
1618
  if (!isFetcher(fetcher)) throw new InvalidMountConfigError("Git extension authentication requires ContainerProxy to return a valid Fetcher");
1582
1619
  for (const outboundHost of Object.keys(params.hosts)) await ctx.container.interceptOutboundHttp(outboundHost, fetcher);
1583
1620
  }
1584
- async function configureS3CredentialProxyOutbound(host, params) {
1621
+ async function configureS3CredentialProxyOutbound(host, activeParams) {
1622
+ const params = { mounts: {
1623
+ ...host.restoredMountRoutes.credentialProxyMounts,
1624
+ ...activeParams.mounts
1625
+ } };
1585
1626
  const ctx = host.ctx;
1586
1627
  if (!ctx.container?.interceptOutboundHttp) throw new InvalidMountConfigError("Credential proxy bucket mounts require container outbound interception support");
1587
1628
  if (!ctx.exports?.ContainerProxy) throw new InvalidMountConfigError("Credential proxy bucket mounts require exporting ContainerProxy from the Worker entrypoint");
1588
1629
  const hosts = [S3_CREDENTIAL_PROXY_HOST, S3_CREDENTIAL_PROXY_DIAGNOSTIC_HOST];
1589
- installSDKOutboundHandlers(host.constructorRef);
1590
1630
  if (Object.keys(params.mounts).length > 0) for (const outboundHost of hosts) await host.setOutboundByHost(outboundHost, "s3CredentialProxyMount", params);
1591
1631
  else for (const outboundHost of hosts) await host.removeOutboundByHost(outboundHost);
1592
1632
  const hostOverrides = {};
@@ -1615,6 +1655,70 @@ async function configureS3CredentialProxyOutbound(host, params) {
1615
1655
  }
1616
1656
  for (const outboundHost of hosts) await ctx.container.interceptOutboundHttp(outboundHost, fetcher);
1617
1657
  }
1658
+ /**
1659
+ * Drop the routes restored for the mounts of a container that has stopped.
1660
+ */
1661
+ async function releaseRestoredMountRoutes(host, mounts) {
1662
+ const routes = host.restoredMountRoutes;
1663
+ for (const mountId of Object.keys(routes.credentialProxyMounts)) {
1664
+ evictSigV4ClientCacheEntry(mountId);
1665
+ evictDirectoryMarkerCacheForMount(mountId);
1666
+ }
1667
+ if (Object.keys(routes.r2Buckets).length > 0) routes.staleR2 = true;
1668
+ if (Object.keys(routes.credentialProxyMounts).length > 0) routes.staleCredentialProxy = true;
1669
+ routes.r2Buckets = {};
1670
+ routes.credentialProxyMounts = {};
1671
+ await removeStaleMountRoutes(host, mounts);
1672
+ }
1673
+ /**
1674
+ * Rewrite the routes that still carry a stopped container's restored mounts
1675
+ * so they cover only `mounts`. A failed update stays marked and is retried on
1676
+ * the next container start or stop.
1677
+ */
1678
+ async function removeStaleMountRoutes(host, mounts) {
1679
+ const routes = host.restoredMountRoutes;
1680
+ if (routes.staleR2) try {
1681
+ await configureR2EgressOutbound(host, buildR2EgressParams(mounts));
1682
+ routes.staleR2 = false;
1683
+ } catch (error) {
1684
+ host.logger.warn("Failed to remove stale R2 mount routes", { error: error instanceof Error ? error.message : String(error) });
1685
+ }
1686
+ if (routes.staleCredentialProxy) try {
1687
+ await configureS3CredentialProxyOutbound(host, buildS3CredentialProxyParams(mounts));
1688
+ routes.staleCredentialProxy = false;
1689
+ } catch (error) {
1690
+ host.logger.warn("Failed to remove stale credential proxy mount routes", { error: error instanceof Error ? error.message : String(error) });
1691
+ }
1692
+ }
1693
+
1694
+ //#endregion
1695
+ //#region src/storage-mount/outbound/restored-routes.ts
1696
+ /**
1697
+ * Bucket mount routes restored from a previous instance of this Durable
1698
+ * Object. The mount registry starts empty after a restart, but s3fs mounts in
1699
+ * a container that kept running still send requests, so every route update
1700
+ * keeps these routes until onStop() reports that container stopped. The base
1701
+ * class reports a stop it missed before it starts a new container.
1702
+ */
1703
+ var RestoredMountRoutes = class RestoredMountRoutes {
1704
+ r2Buckets = {};
1705
+ credentialProxyMounts = {};
1706
+ staleR2 = false;
1707
+ staleCredentialProxy = false;
1708
+ /**
1709
+ * Read the overrides the base Container restored from storage in its
1710
+ * constructor. `outboundByHostOverrides` is private in its types.
1711
+ */
1712
+ static fromContainer(container) {
1713
+ const overrides = container.outboundByHostOverrides ?? {};
1714
+ const routes = new RestoredMountRoutes();
1715
+ const r2 = overrides["r2.internal"];
1716
+ if (r2?.method === "r2EgressMount") routes.r2Buckets = { ...r2.params?.buckets };
1717
+ const credentialProxy = overrides[S3_CREDENTIAL_PROXY_HOST];
1718
+ if (credentialProxy?.method === "s3CredentialProxyMount") routes.credentialProxyMounts = { ...credentialProxy.params?.mounts };
1719
+ return routes;
1720
+ }
1721
+ };
1618
1722
 
1619
1723
  //#endregion
1620
1724
  //#region src/storage-mount/registry.ts
@@ -1695,6 +1799,10 @@ function resolveS3fsOptions(provider, userOptions) {
1695
1799
  //#endregion
1696
1800
  //#region src/storage-mount/s3fs/support-files.ts
1697
1801
  const S3FS_DISABLE_EXPECT_HEADER_CONFIG = " Expect:\n";
1802
+ async function writeOwnerOnlyFile(host, operation, path$1, content) {
1803
+ await host.runRuntimeCall(`mount.s3fs.write${operation}`, (control) => control.files.writeFile(path$1, content, { ownerOnly: true }));
1804
+ await host.runRuntimeCall(`mount.s3fs.chmod${operation}`, (control) => control.mounts.chmodOwnerOnly(path$1));
1805
+ }
1698
1806
  function generatePasswordFilePath() {
1699
1807
  return `/tmp/.passwd-s3fs-${crypto.randomUUID()}`;
1700
1808
  }
@@ -1702,13 +1810,10 @@ function generateS3FSAdditionalHeaderFilePath() {
1702
1810
  return `/tmp/.s3fs-ahbe-${crypto.randomUUID()}.conf`;
1703
1811
  }
1704
1812
  async function createDisableExpectHeaderFile(host, headerFilePath) {
1705
- await host.runRuntimeCall("mount.s3fs.writeHeaderFile", (control) => control.files.writeFile(headerFilePath, S3FS_DISABLE_EXPECT_HEADER_CONFIG));
1706
- await host.runRuntimeCall("mount.s3fs.chmodHeaderFile", (control) => control.mounts.chmodOwnerOnly(headerFilePath));
1813
+ await writeOwnerOnlyFile(host, "HeaderFile", headerFilePath, S3FS_DISABLE_EXPECT_HEADER_CONFIG);
1707
1814
  }
1708
1815
  async function createPasswordFile(host, passwordFilePath, bucket, credentials) {
1709
- const content = `${bucket}:${credentials.accessKeyId}:${credentials.secretAccessKey}`;
1710
- await host.runRuntimeCall("mount.s3fs.writePasswordFile", (control) => control.files.writeFile(passwordFilePath, content));
1711
- await host.runRuntimeCall("mount.s3fs.chmodPasswordFile", (control) => control.mounts.chmodOwnerOnly(passwordFilePath));
1816
+ await writeOwnerOnlyFile(host, "PasswordFile", passwordFilePath, `${bucket}:${credentials.accessKeyId}:${credentials.secretAccessKey}`);
1712
1817
  }
1713
1818
  async function deletePasswordFile(host, passwordFilePath) {
1714
1819
  try {
@@ -1794,40 +1899,6 @@ async function unmountTrackedFuseMount(host, mountPath, mountInfo) {
1794
1899
  return true;
1795
1900
  }
1796
1901
 
1797
- //#endregion
1798
- //#region src/storage-mount/outbound/params.ts
1799
- function hasExcludedID(excludedIDs, mountId) {
1800
- if (!excludedIDs) return false;
1801
- for (const excludedID of excludedIDs) if (excludedID === mountId) return true;
1802
- return false;
1803
- }
1804
- function buildR2EgressParams(mounts, options) {
1805
- const buckets = {};
1806
- for (const [, mountInfo] of mounts) if (mountInfo.mountType === "r2-egress" && mountInfo.mountId !== options?.excludeMountId && !hasExcludedID(options?.excludeMountIds, mountInfo.mountId)) buckets[mountInfo.bucket] = {
1807
- prefix: mountInfo.prefix,
1808
- readOnly: mountInfo.readOnly
1809
- };
1810
- return { buckets };
1811
- }
1812
- function buildS3CredentialProxyParams(mounts, options) {
1813
- const params = {};
1814
- const addMount = (mountInfo) => {
1815
- if (!mountInfo.credentialProxy || mountInfo.mountId === options?.excludeMountId || hasExcludedID(options?.excludeMountIds, mountInfo.mountId)) return;
1816
- params[mountInfo.mountId] = {
1817
- endpoint: mountInfo.credentialProxy.endpoint,
1818
- bucket: mountInfo.credentialProxy.bucket,
1819
- ...mountInfo.credentialProxy.prefix !== void 0 ? { prefix: mountInfo.credentialProxy.prefix } : {},
1820
- credentials: mountInfo.credentialProxy.credentials,
1821
- readOnly: mountInfo.credentialProxy.readOnly,
1822
- provider: mountInfo.credentialProxy.provider,
1823
- authStrategy: mountInfo.credentialProxy.authStrategy
1824
- };
1825
- };
1826
- for (const [, mountInfo] of mounts) if (mountInfo.mountType === "fuse") addMount(mountInfo);
1827
- if (options?.includeMount) addMount(options.includeMount);
1828
- return { mounts: params };
1829
- }
1830
-
1831
1902
  //#endregion
1832
1903
  //#region src/storage-mount/lifecycle-cleanup.ts
1833
1904
  async function cleanupBucketMountsForDestroy(host) {
@@ -1895,6 +1966,7 @@ async function cleanupBucketMountsForDestroy(host) {
1895
1966
  }
1896
1967
  async function cleanupBucketMountsForStop(host) {
1897
1968
  return host.runMountOperation(async () => {
1969
+ await releaseRestoredMountRoutes(host.getOutboundHost(), host.registry);
1898
1970
  let hadR2EgressMount = false;
1899
1971
  let hadCredentialProxyMount = false;
1900
1972
  for (const [, mountInfo] of host.registry) if (mountInfo.mountType === "local-sync") mountInfo.syncManager.interrupt();
@@ -2510,6 +2582,8 @@ function validateR2EgressMount(context, bucket, mountPath, options) {
2510
2582
  validateBucketBindingName(bucket, mountPath);
2511
2583
  validateMountPath(context.registry.activeMounts, mountPath);
2512
2584
  validateProtectedS3fsOptions(options.s3fsOptions, "R2 binding");
2585
+ const restoredRoute = context.getOutboundHost().restoredMountRoutes.r2Buckets[bucket];
2586
+ if (restoredRoute && (restoredRoute.prefix !== prefix || (restoredRoute.readOnly ?? false) !== (options.readOnly ?? false))) throw new InvalidMountConfigError(`R2 binding "${bucket}" is already mounted with a different prefix or readOnly setting. Mount the same binding only once, or use the same settings for additional mounts.`);
2513
2587
  for (const [existingMountPath, existingMount] of context.registry) {
2514
2588
  if (existingMount.mountType === "r2-egress" && existingMount.bucket === bucket && existingMount.prefix !== prefix) throw new InvalidMountConfigError(`R2 binding "${bucket}" is already mounted at ${existingMountPath} with a different prefix. Mount the same binding only once, or use the same prefix for additional mounts.`);
2515
2589
  if (existingMount.mountType === "r2-egress" && existingMount.bucket === bucket && existingMount.readOnly !== (options.readOnly ?? false)) throw new InvalidMountConfigError(`R2 binding "${bucket}" is already mounted at ${existingMountPath} with a different readOnly setting. Mount the same binding only once, or use the same readOnly value for additional mounts.`);
@@ -2529,11 +2603,6 @@ async function mountR2EgressBucket(context, bucket, mountPath, options) {
2529
2603
  const lifecycle = await context.lifecycle.capture(context.runtime);
2530
2604
  passwordFilePath = generatePasswordFilePath();
2531
2605
  additionalHeaderFilePath = generateS3FSAdditionalHeaderFilePath();
2532
- await createPasswordFile(context.s3fsHost, passwordFilePath, bucket, {
2533
- accessKeyId: "x",
2534
- secretAccessKey: "x"
2535
- });
2536
- await createDisableExpectHeaderFile(context.s3fsHost, additionalHeaderFilePath);
2537
2606
  mountInfo = {
2538
2607
  mountId: crypto.randomUUID(),
2539
2608
  mountType: "r2-egress",
@@ -2545,14 +2614,21 @@ async function mountR2EgressBucket(context, bucket, mountPath, options) {
2545
2614
  prefix,
2546
2615
  readOnly: options.readOnly ?? false
2547
2616
  };
2548
- await configureR2EgressOutbound(context.getOutboundHost(), { buckets: {
2549
- ...buildR2EgressParams(context.registry).buckets,
2550
- [bucket]: {
2551
- prefix,
2552
- readOnly: options.readOnly ?? false
2553
- }
2554
- } });
2555
- await context.runRuntimeCall("mount.ensureDirectory", (control) => control.mounts.ensureDirectory(mountPath));
2617
+ await allOrFirstError([
2618
+ createPasswordFile(context.s3fsHost, passwordFilePath, bucket, {
2619
+ accessKeyId: "x",
2620
+ secretAccessKey: "x"
2621
+ }),
2622
+ createDisableExpectHeaderFile(context.s3fsHost, additionalHeaderFilePath),
2623
+ configureR2EgressOutbound(context.getOutboundHost(), { buckets: {
2624
+ ...buildR2EgressParams(context.registry).buckets,
2625
+ [bucket]: {
2626
+ prefix,
2627
+ readOnly: options.readOnly ?? false
2628
+ }
2629
+ } }),
2630
+ context.runRuntimeCall("mount.ensureDirectory", (control) => control.mounts.ensureDirectory(mountPath))
2631
+ ]);
2556
2632
  s3fsStarted = true;
2557
2633
  await executeS3FSMount(context.s3fsHost, {
2558
2634
  bucket,
@@ -2616,6 +2692,14 @@ async function mountR2EgressBucket(context, bucket, mountPath, options) {
2616
2692
  });
2617
2693
  }
2618
2694
  }
2695
+ /**
2696
+ * Like `Promise.all`, but waits for every step to settle before rejecting, so
2697
+ * cleanup never runs while a support-file write or route update is in flight.
2698
+ */
2699
+ async function allOrFirstError(steps) {
2700
+ const failure = (await Promise.allSettled(steps)).find((result) => result.status === "rejected");
2701
+ if (failure) throw failure.reason;
2702
+ }
2619
2703
 
2620
2704
  //#endregion
2621
2705
  //#region src/storage-mount/validation/credentials.ts
@@ -2967,7 +3051,10 @@ var BucketMountService = class {
2967
3051
  });
2968
3052
  }
2969
3053
  async mountBucketR2Egress(bucket, mountPath, options) {
2970
- validateR2EgressMount({ registry: this.registry }, bucket, mountPath, options);
3054
+ validateR2EgressMount({
3055
+ registry: this.registry,
3056
+ getOutboundHost: () => this.deps.getOutboundHost()
3057
+ }, bucket, mountPath, options);
2971
3058
  await this.deps.runMountAttempt("mount.r2-egress", async (lease) => {
2972
3059
  const runRuntimeCall = callWithMountControl(lease.control);
2973
3060
  await mountR2EgressBucket({
@@ -3082,6 +3169,14 @@ var BucketMountService = class {
3082
3169
  runMountOperation: (operation) => operation()
3083
3170
  });
3084
3171
  }
3172
+ /**
3173
+ * Retry removing a stopped container's restored mount routes. Runs outside
3174
+ * the mount operation queue because a queued mount can be what started the
3175
+ * container.
3176
+ */
3177
+ async removeStaleRoutes() {
3178
+ await removeStaleMountRoutes(this.deps.getOutboundHost(), this.registry);
3179
+ }
3085
3180
  async cleanupForStop() {
3086
3181
  return cleanupBucketMountsForStop({
3087
3182
  registry: this.registry,
@@ -7610,6 +7705,22 @@ function randomId(size = 20) {
7610
7705
  function createQuickTunnelId() {
7611
7706
  return `quick-${randomId()}`;
7612
7707
  }
7708
+ /**
7709
+ * The run holding `request.port` when the container rejected `request`
7710
+ * with a port conflict, or `null` when the conflict does not name both
7711
+ * the active run and its tunnel, which `stopTunnelRun` needs.
7712
+ */
7713
+ function conflictingRunOnPort(error, request) {
7714
+ const e = error;
7715
+ if (e?.code !== "TUNNEL_RUN_CONFLICT") return null;
7716
+ const runId = e.context?.activeRunId;
7717
+ const tunnelId = e.context?.activeTunnelId;
7718
+ if (e.context?.port !== request.port || typeof runId !== "string" || typeof tunnelId !== "string" || runId === request.runId) return null;
7719
+ return {
7720
+ tunnelId,
7721
+ runId
7722
+ };
7723
+ }
7613
7724
  var TunnelProvisioner = class {
7614
7725
  #host;
7615
7726
  #zoneNamePromise = null;
@@ -7617,7 +7728,7 @@ var TunnelProvisioner = class {
7617
7728
  this.#host = host;
7618
7729
  }
7619
7730
  async provisionQuickTunnel(tunnels, port, tunnelRunId, tunnelId = createQuickTunnelId()) {
7620
- const result = await this.#ensureTunnelRun(tunnels, {
7731
+ const result = await this.#ensureQuickTunnelRun(tunnels, {
7621
7732
  mode: "quick",
7622
7733
  tunnelId,
7623
7734
  runId: tunnelRunId,
@@ -7733,6 +7844,26 @@ var TunnelProvisioner = class {
7733
7844
  async #ensureTunnelRun(tunnels, request) {
7734
7845
  return await tunnels.ensureTunnelRun(request);
7735
7846
  }
7847
+ /**
7848
+ * Start a quick tunnel run. The Durable Object owns every tunnel run in
7849
+ * its container and holds the port lock, so a different run already on
7850
+ * the port lost its storage record. Stop it and retry once instead of
7851
+ * failing every later `get()` for the port.
7852
+ */
7853
+ async #ensureQuickTunnelRun(tunnels, request) {
7854
+ try {
7855
+ return await this.#ensureTunnelRun(tunnels, request);
7856
+ } catch (error) {
7857
+ const orphan = conflictingRunOnPort(error, request);
7858
+ if (!orphan) throw error;
7859
+ this.#host.logger?.warn("tunnel.get: stopping orphaned run on port", {
7860
+ port: request.port,
7861
+ ...orphan
7862
+ });
7863
+ await tunnels.stopTunnelRun(orphan);
7864
+ return await this.#ensureTunnelRun(tunnels, request);
7865
+ }
7866
+ }
7736
7867
  async #getZoneName(config) {
7737
7868
  if (!this.#zoneNamePromise) {
7738
7869
  const pending = getZoneName({
@@ -7965,13 +8096,37 @@ var TunnelService = class {
7965
8096
  await this.#assertSandboxLifetime(lifetime, "committing");
7966
8097
  return spawned;
7967
8098
  } catch (error) {
7968
- if (committedInfo) await this.#invalidateCommittedPortIfUnchanged(port, committedInfo, lease.runtime, runId);
8099
+ try {
8100
+ if (committedInfo) await this.#invalidateCommittedPortIfUnchanged(port, committedInfo, lease.runtime, runId);
8101
+ } finally {
8102
+ await this.#stopAbandonedQuickRun(lease.tunnels, port, {
8103
+ tunnelId,
8104
+ runId
8105
+ });
8106
+ }
7969
8107
  throw error;
7970
8108
  } finally {
7971
8109
  hold.release();
7972
8110
  }
7973
8111
  });
7974
8112
  }
8113
+ /**
8114
+ * Stop a quick tunnel run that provisioning is giving up on, so its
8115
+ * cloudflared does not keep holding the port without a stored record.
8116
+ * Best effort: the run may never have started, or may have died with a
8117
+ * replaced runtime.
8118
+ */
8119
+ async #stopAbandonedQuickRun(tunnels, port, run) {
8120
+ try {
8121
+ await tunnels.stopTunnelRun(run);
8122
+ } catch (error) {
8123
+ this.#host.logger.warn("tunnel.get: abandoned run cleanup failed", {
8124
+ port,
8125
+ ...run,
8126
+ error: error instanceof Error ? error.message : String(error)
8127
+ });
8128
+ }
8129
+ }
7975
8130
  async #provisionNamedTunnel(port, name) {
7976
8131
  const lifetime = await this.#host.currentLifetime?.getOrCreate();
7977
8132
  return await this.#host.runProvision(async (lease) => {
@@ -8816,6 +8971,7 @@ var Sandbox = class extends Container {
8816
8971
  logger;
8817
8972
  keepAliveEnabled = false;
8818
8973
  bucketMounts;
8974
+ restoredMountRoutes;
8819
8975
  currentLifetime;
8820
8976
  backupService;
8821
8977
  previewService;
@@ -8884,7 +9040,9 @@ var Sandbox = class extends Container {
8884
9040
  return stub;
8885
9041
  }
8886
9042
  constructor(ctx, env$1) {
9043
+ if (ctx.exports?.ContainerProxy) installSDKOutboundHandlers(new.target);
8887
9044
  super(ctx, env$1);
9045
+ this.restoredMountRoutes = RestoredMountRoutes.fromContainer(this);
8888
9046
  const envObj = env$1;
8889
9047
  ["SANDBOX_LOG_LEVEL", "SANDBOX_LOG_FORMAT"].forEach((key) => {
8890
9048
  if (envObj?.[key]) this.envVars[key] = String(envObj[key]);
@@ -9257,6 +9415,7 @@ var Sandbox = class extends Container {
9257
9415
  async onStart() {
9258
9416
  const replacementStartTransitionCompleted = this.runtimeLifecycle.markRuntimeStarted();
9259
9417
  this.logger.debug("Sandbox started", { replacementStartTransitionCompleted });
9418
+ await this.bucketMounts.removeStaleRoutes();
9260
9419
  }
9261
9420
  async start(options) {
9262
9421
  await this.runtimeRunner.runWaking("runtime.start", async () => void 0, { startOptions: options });
@@ -10121,7 +10280,7 @@ var Sandbox = class extends Container {
10121
10280
  getMountOutboundHost() {
10122
10281
  return {
10123
10282
  ctx: this.ctx,
10124
- constructorRef: this.constructor,
10283
+ restoredMountRoutes: this.restoredMountRoutes,
10125
10284
  enableInternet: this.enableInternet,
10126
10285
  logger: this.logger,
10127
10286
  setOutboundByHost: (host, method, params) => this.setOutboundByHost(host, method, params),
@@ -10132,4 +10291,4 @@ var Sandbox = class extends Container {
10132
10291
 
10133
10292
  //#endregion
10134
10293
  export { proxyTerminal as _, responseToAsyncIterable as a, collectFile as b, BucketUnmountError as c, S3FSMountError as d, parsePreviewRoute as f, validateTunnelName as g, validatePort as h, parseSSEStream as i, InvalidMountConfigError as l, SandboxSecurityError as m, getSandbox as n, ContainerProxy$1 as o, withPreviewProxyMetadata as p, asyncIterableToSSEStream as r, BucketMountError as s, Sandbox as t, MissingCredentialsError as u, isDurableObjectCodeUpdateReset as v, streamFile as x, isPlatformTransientError as y };
10135
- //# sourceMappingURL=sandbox-BEhPgFZx.js.map
10294
+ //# sourceMappingURL=sandbox-CpelK4pU.js.map