wrangler 4.20.1 → 4.20.3

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.
@@ -26020,7 +26020,7 @@ function getComplianceRegionSubdomain(complianceConfig) {
26020
26020
  function getStagingSubdomain() {
26021
26021
  return getCloudflareApiEnvironmentFromEnv() === "staging" ? ".staging" : "";
26022
26022
  }
26023
- var import_node_path2, getC3CommandFromEnv, getWranglerSendMetricsFromEnv, getCloudflareApiEnvironmentFromEnv, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareComplianceRegionFromEnv, getCloudflareComplianceRegion, getCloudflareApiBaseUrlFromEnv, getCloudflareApiBaseUrl, getSanitizeLogs, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCIGeneratePreviewAlias, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getRegistryPath, getDockerPath;
26023
+ var import_node_path2, getC3CommandFromEnv, getWranglerSendMetricsFromEnv, getCloudflareApiEnvironmentFromEnv, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareComplianceRegionFromEnv, getCloudflareComplianceRegion, getCloudflareApiBaseUrlFromEnv, getCloudflareApiBaseUrl, getSanitizeLogs, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCIGeneratePreviewAlias, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getRegistryPath, getDockerPath, getDockerHost;
26024
26024
  var init_misc_variables = __esm({
26025
26025
  "src/environment-variables/misc-variables.ts"() {
26026
26026
  init_import_meta_url();
@@ -26115,6 +26115,12 @@ var init_misc_variables = __esm({
26115
26115
  return "docker";
26116
26116
  }
26117
26117
  });
26118
+ getDockerHost = getEnvironmentVariableFactory({
26119
+ variableName: "WRANGLER_DOCKER_HOST",
26120
+ defaultValue() {
26121
+ return process.platform === "win32" ? "//./pipe/docker_engine" : "unix:/var/run/docker.sock";
26122
+ }
26123
+ });
26118
26124
  }
26119
26125
  });
26120
26126
 
@@ -26479,7 +26485,6 @@ var init_logger = __esm({
26479
26485
  __name(getLoggerLevel, "getLoggerLevel");
26480
26486
  overrideLoggerLevel = new import_node_async_hooks.AsyncLocalStorage();
26481
26487
  runWithLogLevel = /* @__PURE__ */ __name((overrideLogLevel, cb2) => overrideLoggerLevel.run({ logLevel: overrideLogLevel }, cb2), "runWithLogLevel");
26482
- overrideLoggerLevel.getStore;
26483
26488
  __name(consoleMethodToLoggerLevel, "consoleMethodToLoggerLevel");
26484
26489
  Logger = class _Logger {
26485
26490
  static {
@@ -26905,7 +26910,7 @@ var name, version;
26905
26910
  var init_package = __esm({
26906
26911
  "package.json"() {
26907
26912
  name = "wrangler";
26908
- version = "4.20.1";
26913
+ version = "4.20.3";
26909
26914
  }
26910
26915
  });
26911
26916
 
@@ -33958,29 +33963,33 @@ function printBindings(bindings, tailConsumers = [], context2 = {}) {
33958
33963
  }
33959
33964
  if (workflows !== void 0 && workflows.length > 0) {
33960
33965
  output.push(
33961
- ...workflows.map(({ class_name, script_name, binding, remote }) => {
33962
- let value = class_name;
33963
- if (script_name) {
33964
- value += ` (defined in ${script_name})`;
33966
+ ...workflows.map(
33967
+ ({ class_name, script_name, binding, experimental_remote }) => {
33968
+ let value = class_name;
33969
+ if (script_name) {
33970
+ value += ` (defined in ${script_name})`;
33971
+ }
33972
+ return {
33973
+ name: binding,
33974
+ type: friendlyBindingNames.workflows,
33975
+ value,
33976
+ mode: getMode({
33977
+ isSimulatedLocally: script_name ? !experimental_remote : true
33978
+ })
33979
+ };
33965
33980
  }
33966
- return {
33967
- name: binding,
33968
- type: friendlyBindingNames.workflows,
33969
- value,
33970
- mode: getMode({ isSimulatedLocally: script_name ? !remote : true })
33971
- };
33972
- })
33981
+ )
33973
33982
  );
33974
33983
  }
33975
33984
  if (kv_namespaces !== void 0 && kv_namespaces.length > 0) {
33976
33985
  output.push(
33977
- ...kv_namespaces.map(({ binding, id, remote }) => {
33986
+ ...kv_namespaces.map(({ binding, id, experimental_remote }) => {
33978
33987
  return {
33979
33988
  name: binding,
33980
33989
  type: friendlyBindingNames.kv_namespaces,
33981
33990
  value: id,
33982
33991
  mode: getMode({
33983
- isSimulatedLocally: !remote
33992
+ isSimulatedLocally: !experimental_remote
33984
33993
  })
33985
33994
  };
33986
33995
  })
@@ -34002,13 +34011,13 @@ function printBindings(bindings, tailConsumers = [], context2 = {}) {
34002
34011
  }
34003
34012
  if (queues !== void 0 && queues.length > 0) {
34004
34013
  output.push(
34005
- ...queues.map(({ binding, queue_name, remote }) => {
34014
+ ...queues.map(({ binding, queue_name, experimental_remote }) => {
34006
34015
  return {
34007
34016
  name: binding,
34008
34017
  type: friendlyBindingNames.queues,
34009
34018
  value: queue_name,
34010
34019
  mode: getMode({
34011
- isSimulatedLocally: !remote
34020
+ isSimulatedLocally: !experimental_remote
34012
34021
  })
34013
34022
  };
34014
34023
  })
@@ -34022,14 +34031,14 @@ function printBindings(bindings, tailConsumers = [], context2 = {}) {
34022
34031
  database_name,
34023
34032
  database_id,
34024
34033
  preview_database_id,
34025
- remote
34034
+ experimental_remote
34026
34035
  }) => {
34027
34036
  const value = typeof database_id == "symbol" ? database_id : preview_database_id ?? database_name ?? database_id;
34028
34037
  return {
34029
34038
  name: binding,
34030
34039
  type: friendlyBindingNames.d1_databases,
34031
34040
  mode: getMode({
34032
- isSimulatedLocally: !remote
34041
+ isSimulatedLocally: !experimental_remote
34033
34042
  }),
34034
34043
  value
34035
34044
  };
@@ -34039,13 +34048,13 @@ function printBindings(bindings, tailConsumers = [], context2 = {}) {
34039
34048
  }
34040
34049
  if (vectorize !== void 0 && vectorize.length > 0) {
34041
34050
  output.push(
34042
- ...vectorize.map(({ binding, index_name, remote }) => {
34051
+ ...vectorize.map(({ binding, index_name, experimental_remote }) => {
34043
34052
  return {
34044
34053
  name: binding,
34045
34054
  type: friendlyBindingNames.vectorize,
34046
34055
  value: index_name,
34047
34056
  mode: getMode({
34048
- isSimulatedLocally: getFlag("MIXED_MODE") ? remote ? false : void 0 : context2.vectorizeBindToProd ? false : (
34057
+ isSimulatedLocally: getFlag("REMOTE_BINDINGS") ? experimental_remote ? false : void 0 : context2.vectorizeBindToProd ? false : (
34049
34058
  /* Vectorize doesn't support local mode */
34050
34059
  void 0
34051
34060
  )
@@ -34068,17 +34077,19 @@ function printBindings(bindings, tailConsumers = [], context2 = {}) {
34068
34077
  }
34069
34078
  if (r2_buckets !== void 0 && r2_buckets.length > 0) {
34070
34079
  output.push(
34071
- ...r2_buckets.map(({ binding, bucket_name, jurisdiction, remote }) => {
34072
- const value = typeof bucket_name === "symbol" ? bucket_name : bucket_name ? `${bucket_name}${jurisdiction ? ` (${jurisdiction})` : ""}` : void 0;
34073
- return {
34074
- name: binding,
34075
- type: friendlyBindingNames.r2_buckets,
34076
- value,
34077
- mode: getMode({
34078
- isSimulatedLocally: !remote
34079
- })
34080
- };
34081
- })
34080
+ ...r2_buckets.map(
34081
+ ({ binding, bucket_name, jurisdiction, experimental_remote }) => {
34082
+ const value = typeof bucket_name === "symbol" ? bucket_name : bucket_name ? `${bucket_name}${jurisdiction ? ` (${jurisdiction})` : ""}` : void 0;
34083
+ return {
34084
+ name: binding,
34085
+ type: friendlyBindingNames.r2_buckets,
34086
+ value,
34087
+ mode: getMode({
34088
+ isSimulatedLocally: !experimental_remote
34089
+ })
34090
+ };
34091
+ }
34092
+ )
34082
34093
  );
34083
34094
  }
34084
34095
  if (logfwdr !== void 0 && logfwdr.bindings.length > 0) {
@@ -34119,30 +34130,32 @@ function printBindings(bindings, tailConsumers = [], context2 = {}) {
34119
34130
  }
34120
34131
  if (services !== void 0 && services.length > 0) {
34121
34132
  output.push(
34122
- ...services.map(({ binding, service, entrypoint, remote }) => {
34123
- let value = service;
34124
- let mode = void 0;
34125
- if (entrypoint) {
34126
- value += `#${entrypoint}`;
34127
- }
34128
- if (remote) {
34129
- mode = getMode({ isSimulatedLocally: false });
34130
- } else if (context2.local && context2.registry !== null) {
34131
- const registryDefinition = context2.registry?.[service];
34132
- hasConnectionStatus = true;
34133
- if (registryDefinition && (!entrypoint || registryDefinition.entrypointAddresses?.[entrypoint])) {
34134
- mode = getMode({ isSimulatedLocally: true, connected: true });
34135
- } else {
34136
- mode = getMode({ isSimulatedLocally: true, connected: false });
34133
+ ...services.map(
34134
+ ({ binding, service, entrypoint, experimental_remote }) => {
34135
+ let value = service;
34136
+ let mode = void 0;
34137
+ if (entrypoint) {
34138
+ value += `#${entrypoint}`;
34139
+ }
34140
+ if (experimental_remote) {
34141
+ mode = getMode({ isSimulatedLocally: false });
34142
+ } else if (context2.local && context2.registry !== null) {
34143
+ const registryDefinition = context2.registry?.[service];
34144
+ hasConnectionStatus = true;
34145
+ if (registryDefinition && (!entrypoint || registryDefinition.entrypointAddresses?.[entrypoint])) {
34146
+ mode = getMode({ isSimulatedLocally: true, connected: true });
34147
+ } else {
34148
+ mode = getMode({ isSimulatedLocally: true, connected: false });
34149
+ }
34137
34150
  }
34151
+ return {
34152
+ name: binding,
34153
+ type: friendlyBindingNames.services,
34154
+ value,
34155
+ mode
34156
+ };
34138
34157
  }
34139
- return {
34140
- name: binding,
34141
- type: friendlyBindingNames.services,
34142
- value,
34143
- mode
34144
- };
34145
- })
34158
+ )
34146
34159
  );
34147
34160
  }
34148
34161
  if (analytics_engine_datasets !== void 0 && analytics_engine_datasets.length > 0) {
@@ -34173,7 +34186,7 @@ function printBindings(bindings, tailConsumers = [], context2 = {}) {
34173
34186
  type: friendlyBindingNames.browser,
34174
34187
  value: void 0,
34175
34188
  mode: getMode({
34176
- isSimulatedLocally: getFlag("MIXED_MODE") && browser.remote ? false : void 0
34189
+ isSimulatedLocally: getFlag("REMOTE_BINDINGS") && browser.experimental_remote ? false : void 0
34177
34190
  })
34178
34191
  });
34179
34192
  }
@@ -34183,7 +34196,7 @@ function printBindings(bindings, tailConsumers = [], context2 = {}) {
34183
34196
  type: friendlyBindingNames.images,
34184
34197
  value: void 0,
34185
34198
  mode: getMode({
34186
- isSimulatedLocally: getFlag("MIXED_MODE") ? images.remote === true || images.remote === void 0 ? false : void 0 : !!context2.imagesLocalMode
34199
+ isSimulatedLocally: getFlag("REMOTE_BINDINGS") ? images.experimental_remote === true || images.experimental_remote === void 0 ? false : void 0 : !!context2.imagesLocalMode
34187
34200
  })
34188
34201
  });
34189
34202
  }
@@ -34193,7 +34206,7 @@ function printBindings(bindings, tailConsumers = [], context2 = {}) {
34193
34206
  type: friendlyBindingNames.ai,
34194
34207
  value: ai2.staging ? `staging` : void 0,
34195
34208
  mode: getMode({
34196
- isSimulatedLocally: getFlag("MIXED_MODE") ? ai2.remote === true || ai2.remote === void 0 ? false : void 0 : false
34209
+ isSimulatedLocally: getFlag("REMOTE_BINDINGS") ? ai2.experimental_remote === true || ai2.experimental_remote === void 0 ? false : void 0 : false
34197
34210
  })
34198
34211
  });
34199
34212
  }
@@ -34265,30 +34278,34 @@ function printBindings(bindings, tailConsumers = [], context2 = {}) {
34265
34278
  }
34266
34279
  if (dispatch_namespaces !== void 0 && dispatch_namespaces.length > 0) {
34267
34280
  output.push(
34268
- ...dispatch_namespaces.map(({ binding, namespace, outbound, remote }) => {
34269
- return {
34270
- name: binding,
34271
- type: friendlyBindingNames.dispatch_namespaces,
34272
- value: outbound ? `${namespace} (outbound -> ${outbound.service})` : namespace,
34273
- mode: getMode({
34274
- isSimulatedLocally: getFlag("MIXED_MODE") ? remote ? false : void 0 : void 0
34275
- })
34276
- };
34277
- })
34281
+ ...dispatch_namespaces.map(
34282
+ ({ binding, namespace, outbound, experimental_remote }) => {
34283
+ return {
34284
+ name: binding,
34285
+ type: friendlyBindingNames.dispatch_namespaces,
34286
+ value: outbound ? `${namespace} (outbound -> ${outbound.service})` : namespace,
34287
+ mode: getMode({
34288
+ isSimulatedLocally: getFlag("REMOTE_BINDINGS") ? experimental_remote ? false : void 0 : void 0
34289
+ })
34290
+ };
34291
+ }
34292
+ )
34278
34293
  );
34279
34294
  }
34280
34295
  if (mtls_certificates !== void 0 && mtls_certificates.length > 0) {
34281
34296
  output.push(
34282
- ...mtls_certificates.map(({ binding, certificate_id, remote }) => {
34283
- return {
34284
- name: binding,
34285
- type: friendlyBindingNames.mtls_certificates,
34286
- value: certificate_id,
34287
- mode: getMode({
34288
- isSimulatedLocally: getFlag("MIXED_MODE") ? remote === true || remote === void 0 ? false : void 0 : false
34289
- })
34290
- };
34291
- })
34297
+ ...mtls_certificates.map(
34298
+ ({ binding, certificate_id, experimental_remote }) => {
34299
+ return {
34300
+ name: binding,
34301
+ type: friendlyBindingNames.mtls_certificates,
34302
+ value: certificate_id,
34303
+ mode: getMode({
34304
+ isSimulatedLocally: getFlag("REMOTE_BINDINGS") ? experimental_remote === true || experimental_remote === void 0 ? false : void 0 : false
34305
+ })
34306
+ };
34307
+ }
34308
+ )
34292
34309
  );
34293
34310
  }
34294
34311
  if (unsafe?.metadata !== void 0) {
@@ -34427,17 +34444,17 @@ function warnOrError(type, remote, supports2) {
34427
34444
  }
34428
34445
  if (remote === false && supports2 === "remote") {
34429
34446
  throw new UserError(
34430
- `${friendlyBindingNames[type]} bindings do not support local development. You may be able to set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`
34447
+ `${friendlyBindingNames[type]} bindings do not support local development. You may be able to set \`experimental_remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`
34431
34448
  );
34432
34449
  }
34433
34450
  if (remote === void 0 && supports2 === "remote") {
34434
34451
  logger.warn(
34435
- `${friendlyBindingNames[type]} bindings do not support local development, and so parts of your Worker may not work correctly. You may be able to set \`remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`
34452
+ `${friendlyBindingNames[type]} bindings do not support local development, and so parts of your Worker may not work correctly. You may be able to set \`experimental_remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`
34436
34453
  );
34437
34454
  }
34438
34455
  if (remote === void 0 && supports2 === "always-remote") {
34439
34456
  logger.warn(
34440
- `${friendlyBindingNames[type]} bindings always access remote resources, and so may incur usage charges even in local dev. To suppress this warning, set \`remote: true\` for the binding definition in your configuration file.`
34457
+ `${friendlyBindingNames[type]} bindings always access remote resources, and so may incur usage charges even in local dev. To suppress this warning, set \`experimental_remote: true\` for the binding definition in your configuration file.`
34441
34458
  );
34442
34459
  }
34443
34460
  }
@@ -35159,7 +35176,8 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
35159
35176
  localProtocol: localProtocolArg,
35160
35177
  upstreamProtocol: upstreamProtocolArg,
35161
35178
  remote: remoteArg,
35162
- enableContainers: enableContainersArg
35179
+ enableContainers: enableContainersArg,
35180
+ containerEngine: containerEngineArg
35163
35181
  } = args;
35164
35182
  (0, import_node_assert.default)(
35165
35183
  localProtocolArg === void 0 || localProtocolArg === "http" || localProtocolArg === "https"
@@ -35171,6 +35189,9 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
35171
35189
  (0, import_node_assert.default)(
35172
35190
  enableContainersArg === void 0 || typeof enableContainersArg === "boolean"
35173
35191
  );
35192
+ (0, import_node_assert.default)(
35193
+ containerEngineArg === void 0 || typeof containerEngineArg === "string" || typeof containerEngineArg?.localDocker?.socketPath === "string"
35194
+ );
35174
35195
  const {
35175
35196
  // On Windows, when specifying `localhost` as the socket hostname, `workerd`
35176
35197
  // will only listen on the IPv4 loopback `127.0.0.1`, not the IPv6 `::1`:
@@ -35230,7 +35251,8 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
35230
35251
  local_protocol,
35231
35252
  upstream_protocol,
35232
35253
  host,
35233
- enable_containers
35254
+ enable_containers,
35255
+ container_engine: containerEngineArg
35234
35256
  };
35235
35257
  }
35236
35258
  function normalizeAndValidateAssets(diagnostics, topLevelEnv, rawEnv) {
@@ -36109,12 +36131,12 @@ function warnIfDurableObjectsHaveNoMigrations(diagnostics, durableObjects, migra
36109
36131
  }
36110
36132
  }
36111
36133
  function isRemoteValid(targetObject, fieldPath, diagnostics) {
36112
- if (!getFlag("MIXED_MODE")) {
36134
+ if (!getFlag("REMOTE_BINDINGS")) {
36113
36135
  return true;
36114
36136
  }
36115
- if (!isOptionalProperty(targetObject, "remote", "boolean")) {
36137
+ if (!isOptionalProperty(targetObject, "experimental_remote", "boolean")) {
36116
36138
  diagnostics.errors.push(
36117
- `"${fieldPath}" should, optionally, have a boolean "remote" field but got ${JSON.stringify(
36139
+ `"${fieldPath}" should, optionally, have a boolean "experimental_remote" field but got ${JSON.stringify(
36118
36140
  targetObject
36119
36141
  )}.`
36120
36142
  );
@@ -36702,7 +36724,7 @@ Please add a binding for each to "${fieldPath}.bindings":
36702
36724
  }
36703
36725
  validateAdditionalProperties(diagnostics, field, Object.keys(value), [
36704
36726
  "binding",
36705
- ...getFlag("MIXED_MODE") ? ["remote"] : []
36727
+ ...getFlag("REMOTE_BINDINGS") ? ["experimental_remote"] : []
36706
36728
  ]);
36707
36729
  return isValid2;
36708
36730
  }, "validateNamedSimpleBinding");
@@ -36973,7 +36995,7 @@ Please add a binding for "${configBindingName}" to "env.${envName}.${field}.bind
36973
36995
  "binding",
36974
36996
  "id",
36975
36997
  "preview_id",
36976
- ...getFlag("MIXED_MODE") ? ["remote"] : []
36998
+ ...getFlag("REMOTE_BINDINGS") ? ["experimental_remote"] : []
36977
36999
  ]);
36978
37000
  return isValid2;
36979
37001
  }, "validateKVBinding");
@@ -37036,7 +37058,7 @@ Please add a binding for "${configBindingName}" to "env.${envName}.${field}.bind
37036
37058
  "binding",
37037
37059
  "queue",
37038
37060
  "delivery_delay",
37039
- ...getFlag("MIXED_MODE") ? ["remote"] : []
37061
+ ...getFlag("REMOTE_BINDINGS") ? ["experimental_remote"] : []
37040
37062
  ])) {
37041
37063
  return false;
37042
37064
  }
@@ -37133,7 +37155,7 @@ Please add a binding for "${configBindingName}" to "env.${envName}.${field}.bind
37133
37155
  "bucket_name",
37134
37156
  "preview_bucket_name",
37135
37157
  "jurisdiction",
37136
- ...getFlag("MIXED_MODE") ? ["remote"] : []
37158
+ ...getFlag("REMOTE_BINDINGS") ? ["experimental_remote"] : []
37137
37159
  ]);
37138
37160
  return isValid2;
37139
37161
  }, "validateR2Binding");
@@ -37186,7 +37208,7 @@ Please add a binding for "${configBindingName}" to "env.${envName}.${field}.bind
37186
37208
  "migrations_dir",
37187
37209
  "migrations_table",
37188
37210
  "preview_database_id",
37189
- ...getFlag("MIXED_MODE") ? ["remote"] : []
37211
+ ...getFlag("REMOTE_BINDINGS") ? ["experimental_remote"] : []
37190
37212
  ]);
37191
37213
  return isValid2;
37192
37214
  }, "validateD1Binding");
@@ -37220,7 +37242,7 @@ Please add a binding for "${configBindingName}" to "env.${envName}.${field}.bind
37220
37242
  validateAdditionalProperties(diagnostics, field, Object.keys(value), [
37221
37243
  "binding",
37222
37244
  "index_name",
37223
- ...getFlag("MIXED_MODE") ? ["remote"] : []
37245
+ ...getFlag("REMOTE_BINDINGS") ? ["experimental_remote"] : []
37224
37246
  ]);
37225
37247
  return isValid2;
37226
37248
  }, "validateVectorizeBinding");
@@ -37460,7 +37482,7 @@ ${resolution}`);
37460
37482
  validateAdditionalProperties(diagnostics, field, Object.keys(value), [
37461
37483
  "binding",
37462
37484
  "certificate_id",
37463
- ...getFlag("MIXED_MODE") ? ["remote"] : []
37485
+ ...getFlag("REMOTE_BINDINGS") ? ["experimental_remote"] : []
37464
37486
  ]);
37465
37487
  if (!isRemoteValid(value, field, diagnostics)) {
37466
37488
  isValid2 = false;
@@ -37825,7 +37847,8 @@ var init_config = __esm({
37825
37847
  upstream_protocol: "http",
37826
37848
  host: void 0,
37827
37849
  // Note this one is also workers only
37828
- enable_containers: true
37850
+ enable_containers: true,
37851
+ container_engine: void 0
37829
37852
  },
37830
37853
  /** INHERITABLE ENVIRONMENT FIELDS **/
37831
37854
  name: void 0,
@@ -38082,7 +38105,7 @@ function readConfig(args, options = {}) {
38082
38105
  {
38083
38106
  RESOURCES_PROVISION: getFlag("RESOURCES_PROVISION") ?? false,
38084
38107
  MULTIWORKER: getFlag("MULTIWORKER") ?? false,
38085
- MIXED_MODE: options.experimental?.mixedModeEnabled ?? getFlag("MIXED_MODE") ?? false
38108
+ REMOTE_BINDINGS: options.experimental?.remoteBindingsEnabled ?? getFlag("REMOTE_BINDINGS") ?? false
38086
38109
  },
38087
38110
  () => {
38088
38111
  return normalizeAndValidateConfig(
@@ -51451,37 +51474,42 @@ async function buildSourceOptions(config) {
51451
51474
  function getRemoteId(id) {
51452
51475
  return typeof id === "string" ? id : null;
51453
51476
  }
51454
- function kvNamespaceEntry({ binding, id: originalId, remote }, mixedModeConnectionString) {
51477
+ function kvNamespaceEntry({ binding, id: originalId, experimental_remote }, remoteProxyConnectionString) {
51455
51478
  const id = getRemoteId(originalId) ?? binding;
51456
- if (!mixedModeConnectionString || !remote) {
51479
+ if (!remoteProxyConnectionString || !experimental_remote) {
51457
51480
  return [binding, { id }];
51458
51481
  }
51459
- return [binding, { id, mixedModeConnectionString }];
51482
+ return [binding, { id, remoteProxyConnectionString }];
51460
51483
  }
51461
- function r2BucketEntry({ binding, bucket_name, remote }, mixedModeConnectionString) {
51484
+ function r2BucketEntry({ binding, bucket_name, experimental_remote }, remoteProxyConnectionString) {
51462
51485
  const id = getRemoteId(bucket_name) ?? binding;
51463
- if (!mixedModeConnectionString || !remote) {
51486
+ if (!remoteProxyConnectionString || !experimental_remote) {
51464
51487
  return [binding, { id }];
51465
51488
  }
51466
- return [binding, { id, mixedModeConnectionString }];
51489
+ return [binding, { id, remoteProxyConnectionString }];
51467
51490
  }
51468
- function d1DatabaseEntry({ binding, database_id, preview_database_id, remote }, mixedModeConnectionString) {
51491
+ function d1DatabaseEntry({
51492
+ binding,
51493
+ database_id,
51494
+ preview_database_id,
51495
+ experimental_remote
51496
+ }, remoteProxyConnectionString) {
51469
51497
  const id = getRemoteId(preview_database_id ?? database_id) ?? binding;
51470
- if (!mixedModeConnectionString || !remote) {
51498
+ if (!remoteProxyConnectionString || !experimental_remote) {
51471
51499
  return [binding, { id }];
51472
51500
  }
51473
- return [binding, { id, mixedModeConnectionString }];
51501
+ return [binding, { id, remoteProxyConnectionString }];
51474
51502
  }
51475
51503
  function queueProducerEntry({
51476
51504
  binding,
51477
51505
  queue_name: queueName,
51478
51506
  delivery_delay: deliveryDelay,
51479
- remote
51480
- }, mixedModeConnectionString) {
51481
- if (!mixedModeConnectionString || !remote) {
51507
+ experimental_remote
51508
+ }, remoteProxyConnectionString) {
51509
+ if (!remoteProxyConnectionString || !experimental_remote) {
51482
51510
  return [binding, { queueName, deliveryDelay }];
51483
51511
  }
51484
- return [binding, { queueName, deliveryDelay, mixedModeConnectionString }];
51512
+ return [binding, { queueName, deliveryDelay, remoteProxyConnectionString }];
51485
51513
  }
51486
51514
  function pipelineEntry(pipeline) {
51487
51515
  return [pipeline.binding, pipeline.pipeline];
@@ -51494,9 +51522,9 @@ function workflowEntry({
51494
51522
  name: name2,
51495
51523
  class_name: className,
51496
51524
  script_name: scriptName,
51497
- remote
51498
- }, mixedModeConnectionString) {
51499
- if (!mixedModeConnectionString || !remote) {
51525
+ experimental_remote
51526
+ }, remoteProxyConnectionString) {
51527
+ if (!remoteProxyConnectionString || !experimental_remote) {
51500
51528
  return [
51501
51529
  binding,
51502
51530
  {
@@ -51512,15 +51540,15 @@ function workflowEntry({
51512
51540
  name: name2,
51513
51541
  className,
51514
51542
  scriptName,
51515
- mixedModeConnectionString
51543
+ remoteProxyConnectionString
51516
51544
  }
51517
51545
  ];
51518
51546
  }
51519
- function dispatchNamespaceEntry({ binding, namespace, remote }, mixedModeConnectionString) {
51520
- if (!mixedModeConnectionString || !remote) {
51547
+ function dispatchNamespaceEntry({ binding, namespace, experimental_remote }, remoteProxyConnectionString) {
51548
+ if (!remoteProxyConnectionString || !experimental_remote) {
51521
51549
  return [binding, { namespace }];
51522
51550
  }
51523
- return [binding, { namespace, mixedModeConnectionString }];
51551
+ return [binding, { namespace, remoteProxyConnectionString }];
51524
51552
  }
51525
51553
  function ratelimitEntry(ratelimit) {
51526
51554
  return [ratelimit.name, ratelimit];
@@ -51535,7 +51563,7 @@ function queueConsumerEntry(consumer) {
51535
51563
  };
51536
51564
  return [consumer.queue, options];
51537
51565
  }
51538
- function buildMiniflareBindingOptions(config, mixedModeConnectionString, mixedModeEnabled) {
51566
+ function buildMiniflareBindingOptions(config, remoteProxyConnectionString, remoteBindingsEnabled) {
51539
51567
  const bindings = config.bindings;
51540
51568
  const textBlobBindings = { ...bindings.text_blobs };
51541
51569
  const dataBlobBindings = { ...bindings.data_blobs };
@@ -51558,12 +51586,12 @@ function buildMiniflareBindingOptions(config, mixedModeConnectionString, mixedMo
51558
51586
  };
51559
51587
  const notFoundServices = /* @__PURE__ */ new Set();
51560
51588
  for (const service of config.services ?? []) {
51561
- if (mixedModeConnectionString && service.remote) {
51589
+ if (remoteProxyConnectionString && service.experimental_remote) {
51562
51590
  serviceBindings[service.binding] = {
51563
51591
  name: service.service,
51564
51592
  props: service.props,
51565
51593
  entrypoint: service.entrypoint,
51566
- mixedModeConnectionString
51594
+ remoteProxyConnectionString
51567
51595
  };
51568
51596
  continue;
51569
51597
  }
@@ -51657,22 +51685,29 @@ function buildMiniflareBindingOptions(config, mixedModeConnectionString, mixedMo
51657
51685
  const classNameToUseSQLite = getClassNamesWhichUseSQLite(config.migrations);
51658
51686
  const internalObjects = [];
51659
51687
  const externalObjects = [];
51660
- const externalWorkers = [];
51661
51688
  for (const binding of bindings.durable_objects?.bindings ?? []) {
51662
- const internal = binding.script_name === void 0 || binding.script_name === config.name;
51663
- (internal ? internalObjects : externalObjects).push(binding);
51689
+ const isInternal = binding.script_name === void 0 || binding.script_name === config.name;
51690
+ if (isInternal) {
51691
+ internalObjects.push(binding);
51692
+ } else {
51693
+ externalObjects.push(binding);
51694
+ }
51664
51695
  }
51696
+ const externalWorkers = [];
51665
51697
  if (config.workerDefinitions !== null) {
51666
51698
  externalWorkers.push({
51667
51699
  name: EXTERNAL_SERVICE_WORKER_NAME,
51668
51700
  // Bind all internal objects, so they're accessible by all other sessions
51669
51701
  // that proxy requests for our objects to this worker
51670
51702
  durableObjects: Object.fromEntries(
51671
- internalObjects.map(({ class_name }) => {
51672
- const useSQLite = classNameToUseSQLite.get(class_name);
51703
+ internalObjects.map(({ class_name: className }) => {
51673
51704
  return [
51674
- class_name,
51675
- { className: class_name, scriptName: getName(config), useSQLite }
51705
+ className,
51706
+ {
51707
+ className,
51708
+ scriptName: getName(config),
51709
+ useSQLite: classNameToUseSQLite.get(className)
51710
+ }
51676
51711
  ];
51677
51712
  })
51678
51713
  ),
@@ -51713,7 +51748,7 @@ function buildMiniflareBindingOptions(config, mixedModeConnectionString, mixedMo
51713
51748
  });
51714
51749
  }
51715
51750
  const wrappedBindings = {};
51716
- if (bindings.ai?.binding && !mixedModeEnabled) {
51751
+ if (bindings.ai?.binding && !remoteBindingsEnabled) {
51717
51752
  externalWorkers.push({
51718
51753
  name: `${EXTERNAL_AI_WORKER_NAME}:${config.name}`,
51719
51754
  modules: [
@@ -51733,18 +51768,18 @@ function buildMiniflareBindingOptions(config, mixedModeConnectionString, mixedMo
51733
51768
  scriptName: `${EXTERNAL_AI_WORKER_NAME}:${config.name}`
51734
51769
  };
51735
51770
  }
51736
- if (bindings.ai && mixedModeEnabled) {
51737
- warnOrError("ai", bindings.ai.remote, "always-remote");
51771
+ if (bindings.ai && remoteBindingsEnabled) {
51772
+ warnOrError("ai", bindings.ai.experimental_remote, "always-remote");
51738
51773
  }
51739
- if (bindings.browser && mixedModeEnabled) {
51740
- warnOrError("browser", bindings.browser.remote, "remote");
51774
+ if (bindings.browser && remoteBindingsEnabled) {
51775
+ warnOrError("browser", bindings.browser.experimental_remote, "remote");
51741
51776
  }
51742
- if (bindings.mtls_certificates && mixedModeEnabled) {
51777
+ if (bindings.mtls_certificates && remoteBindingsEnabled) {
51743
51778
  for (const mtls of bindings.mtls_certificates) {
51744
- warnOrError("ai", mtls.remote, "always-remote");
51779
+ warnOrError("ai", mtls.experimental_remote, "always-remote");
51745
51780
  }
51746
51781
  }
51747
- if (bindings.images?.binding && !config.imagesLocalMode && !mixedModeEnabled) {
51782
+ if (bindings.images?.binding && !config.imagesLocalMode && !remoteBindingsEnabled) {
51748
51783
  externalWorkers.push({
51749
51784
  name: `${EXTERNAL_IMAGES_WORKER_NAME}:${config.name}`,
51750
51785
  modules: [
@@ -51764,7 +51799,7 @@ function buildMiniflareBindingOptions(config, mixedModeConnectionString, mixedMo
51764
51799
  scriptName: `${EXTERNAL_IMAGES_WORKER_NAME}:${config.name}`
51765
51800
  };
51766
51801
  }
51767
- if (bindings.vectorize && !mixedModeEnabled) {
51802
+ if (bindings.vectorize && !remoteBindingsEnabled) {
51768
51803
  for (const vectorizeBinding of bindings.vectorize) {
51769
51804
  const bindingName = vectorizeBinding.binding;
51770
51805
  const indexName = vectorizeBinding.index_name;
@@ -51803,28 +51838,28 @@ function buildMiniflareBindingOptions(config, mixedModeConnectionString, mixedMo
51803
51838
  textBlobBindings,
51804
51839
  dataBlobBindings,
51805
51840
  wasmBindings,
51806
- ai: bindings.ai && mixedModeConnectionString ? {
51841
+ ai: bindings.ai && remoteProxyConnectionString ? {
51807
51842
  binding: bindings.ai.binding,
51808
- mixedModeConnectionString
51843
+ remoteProxyConnectionString
51809
51844
  } : void 0,
51810
51845
  kvNamespaces: Object.fromEntries(
51811
51846
  bindings.kv_namespaces?.map(
51812
- (kv) => kvNamespaceEntry(kv, mixedModeConnectionString)
51847
+ (kv) => kvNamespaceEntry(kv, remoteProxyConnectionString)
51813
51848
  ) ?? []
51814
51849
  ),
51815
51850
  r2Buckets: Object.fromEntries(
51816
51851
  bindings.r2_buckets?.map(
51817
- (r22) => r2BucketEntry(r22, mixedModeConnectionString)
51852
+ (r22) => r2BucketEntry(r22, remoteProxyConnectionString)
51818
51853
  ) ?? []
51819
51854
  ),
51820
51855
  d1Databases: Object.fromEntries(
51821
51856
  bindings.d1_databases?.map(
51822
- (d1) => d1DatabaseEntry(d1, mixedModeConnectionString)
51857
+ (d1) => d1DatabaseEntry(d1, remoteProxyConnectionString)
51823
51858
  ) ?? []
51824
51859
  ),
51825
51860
  queueProducers: Object.fromEntries(
51826
51861
  bindings.queues?.map(
51827
- (queue) => queueProducerEntry(queue, mixedModeConnectionString)
51862
+ (queue) => queueProducerEntry(queue, remoteProxyConnectionString)
51828
51863
  ) ?? []
51829
51864
  ),
51830
51865
  queueConsumers: Object.fromEntries(
@@ -51842,7 +51877,7 @@ function buildMiniflareBindingOptions(config, mixedModeConnectionString, mixedMo
51842
51877
  ),
51843
51878
  workflows: Object.fromEntries(
51844
51879
  bindings.workflows?.map(
51845
- (workflow) => workflowEntry(workflow, mixedModeConnectionString)
51880
+ (workflow) => workflowEntry(workflow, remoteProxyConnectionString)
51846
51881
  ) ?? []
51847
51882
  ),
51848
51883
  secretsStoreSecrets: Object.fromEntries(
@@ -51860,86 +51895,96 @@ function buildMiniflareBindingOptions(config, mixedModeConnectionString, mixedMo
51860
51895
  email: {
51861
51896
  send_email: bindings.send_email
51862
51897
  },
51863
- images: bindings.images && (config.imagesLocalMode || mixedModeEnabled) ? {
51898
+ images: bindings.images && (config.imagesLocalMode || remoteBindingsEnabled) ? {
51864
51899
  binding: bindings.images.binding,
51865
- mixedModeConnectionString: bindings.images.remote && mixedModeConnectionString ? mixedModeConnectionString : void 0
51900
+ remoteProxyConnectionString: bindings.images.experimental_remote && remoteProxyConnectionString ? remoteProxyConnectionString : void 0
51866
51901
  } : void 0,
51867
- browserRendering: mixedModeEnabled && mixedModeConnectionString && bindings.browser?.remote ? {
51902
+ browserRendering: remoteBindingsEnabled && remoteProxyConnectionString && bindings.browser?.experimental_remote ? {
51868
51903
  binding: bindings.browser.binding,
51869
- mixedModeConnectionString
51904
+ remoteProxyConnectionString
51870
51905
  } : void 0,
51871
- vectorize: mixedModeEnabled && mixedModeConnectionString ? Object.fromEntries(
51906
+ vectorize: remoteBindingsEnabled && remoteProxyConnectionString ? Object.fromEntries(
51872
51907
  bindings.vectorize?.filter((v7) => {
51873
- warnOrError("vectorize", v7.remote, "remote");
51874
- return v7.remote;
51908
+ warnOrError("vectorize", v7.experimental_remote, "remote");
51909
+ return v7.experimental_remote;
51875
51910
  }).map((vectorize) => {
51876
51911
  return [
51877
51912
  vectorize.binding,
51878
51913
  {
51879
51914
  index_name: vectorize.index_name,
51880
- mixedModeConnectionString
51915
+ remoteProxyConnectionString
51881
51916
  }
51882
51917
  ];
51883
51918
  }) ?? []
51884
51919
  ) : void 0,
51885
- dispatchNamespaces: mixedModeEnabled && mixedModeConnectionString ? Object.fromEntries(
51920
+ dispatchNamespaces: remoteBindingsEnabled && remoteProxyConnectionString ? Object.fromEntries(
51886
51921
  bindings.dispatch_namespaces?.filter((d6) => {
51887
- warnOrError("dispatch_namespaces", d6.remote, "remote");
51888
- return d6.remote;
51922
+ warnOrError(
51923
+ "dispatch_namespaces",
51924
+ d6.experimental_remote,
51925
+ "remote"
51926
+ );
51927
+ return d6.experimental_remote;
51889
51928
  }).map(
51890
51929
  (dispatchNamespace) => dispatchNamespaceEntry(
51891
51930
  dispatchNamespace,
51892
- mixedModeConnectionString
51931
+ remoteProxyConnectionString
51893
51932
  )
51894
51933
  ) ?? []
51895
51934
  ) : void 0,
51896
51935
  durableObjects: Object.fromEntries([
51897
- ...internalObjects.map(({ name: name2, class_name }) => {
51898
- const useSQLite = classNameToUseSQLite.get(class_name);
51936
+ ...internalObjects.map(({ name: name2, class_name: className }) => {
51899
51937
  return [
51900
51938
  name2,
51901
51939
  {
51902
- className: class_name,
51903
- useSQLite
51940
+ className,
51941
+ useSQLite: classNameToUseSQLite.get(className),
51942
+ container: getContainerOptions(className, config.containers)
51904
51943
  }
51905
51944
  ];
51906
51945
  }),
51907
- ...externalObjects.map(({ name: name2, class_name, script_name }) => {
51908
- const identifier = getIdentifier(`do_${script_name}_${class_name}`);
51909
- const useSQLite = classNameToUseSQLite.get(class_name);
51910
- return config.workerDefinitions === null ? [
51911
- name2,
51912
- {
51913
- className: class_name,
51914
- scriptName: script_name
51915
- }
51916
- ] : [
51917
- name2,
51918
- {
51919
- className: identifier,
51920
- scriptName: EXTERNAL_SERVICE_WORKER_NAME,
51921
- useSQLite,
51922
- // Matches the unique key Miniflare will generate for this object in
51923
- // the target session. We need to do this so workerd generates the
51924
- // same IDs it would if this were part of the same process. workerd
51925
- // doesn't allow IDs from Durable Objects with different unique keys
51926
- // to be used with each other.
51927
- unsafeUniqueKey: `${script_name}-${class_name}`
51928
- }
51929
- ];
51930
- })
51946
+ ...externalObjects.map(
51947
+ ({ name: name2, class_name: className, script_name: scriptName }) => {
51948
+ const identifier = getIdentifier(`do_${scriptName}_${className}`);
51949
+ const useSQLite = classNameToUseSQLite.get(className);
51950
+ return config.workerDefinitions === null ? [
51951
+ name2,
51952
+ {
51953
+ className,
51954
+ scriptName
51955
+ }
51956
+ ] : [
51957
+ name2,
51958
+ {
51959
+ className: identifier,
51960
+ scriptName: EXTERNAL_SERVICE_WORKER_NAME,
51961
+ useSQLite,
51962
+ // Matches the unique key Miniflare will generate for this object in
51963
+ // the target session. We need to do this so workerd generates the
51964
+ // same IDs it would if this were part of the same process. workerd
51965
+ // doesn't allow IDs from Durable Objects with different unique keys
51966
+ // to be used with each other.
51967
+ unsafeUniqueKey: `${scriptName}-${className}`
51968
+ }
51969
+ ];
51970
+ }
51971
+ )
51931
51972
  ]),
51932
51973
  ratelimits: Object.fromEntries(
51933
51974
  bindings.unsafe?.bindings?.filter((b6) => b6.type == "ratelimit").map(ratelimitEntry) ?? []
51934
51975
  ),
51935
- mtlsCertificates: mixedModeEnabled && mixedModeConnectionString ? Object.fromEntries(
51976
+ mtlsCertificates: remoteBindingsEnabled && remoteProxyConnectionString ? Object.fromEntries(
51936
51977
  bindings.mtls_certificates?.filter((d6) => {
51937
- warnOrError("mtls_certificates", d6.remote, "remote");
51938
- return d6.remote;
51978
+ warnOrError(
51979
+ "mtls_certificates",
51980
+ d6.experimental_remote,
51981
+ "remote"
51982
+ );
51983
+ return d6.experimental_remote;
51939
51984
  }).map((mtlsCertificate) => [
51940
51985
  mtlsCertificate.binding,
51941
51986
  {
51942
- mixedModeConnectionString,
51987
+ remoteProxyConnectionString,
51943
51988
  certificate_id: mtlsCertificate.certificate_id
51944
51989
  }
51945
51990
  ]) ?? []
@@ -52050,7 +52095,7 @@ function handleRuntimeStdio(stdout2, stderr2) {
52050
52095
  }
52051
52096
  });
52052
52097
  }
52053
- async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticationSecret, mixedModeConnectionString, mixedModeEnabled) {
52098
+ async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticationSecret, remoteProxyConnectionString, remoteBindingsEnabled) {
52054
52099
  if (config.crons?.length && !config.testScheduled) {
52055
52100
  if (!didWarnMiniflareCronSupport) {
52056
52101
  didWarnMiniflareCronSupport = true;
@@ -52059,7 +52104,7 @@ async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticati
52059
52104
  );
52060
52105
  }
52061
52106
  }
52062
- if (!mixedModeEnabled) {
52107
+ if (!remoteBindingsEnabled) {
52063
52108
  if (config.bindings.ai) {
52064
52109
  if (!didWarnAiAccountUsage) {
52065
52110
  didWarnAiAccountUsage = true;
@@ -52087,8 +52132,8 @@ async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticati
52087
52132
  const { sourceOptions, entrypointNames } = await buildSourceOptions(config);
52088
52133
  const { bindingOptions, internalObjects, externalWorkers } = buildMiniflareBindingOptions(
52089
52134
  config,
52090
- mixedModeConnectionString,
52091
- mixedModeEnabled
52135
+ remoteProxyConnectionString,
52136
+ remoteBindingsEnabled
52092
52137
  );
52093
52138
  const sitesOptions = buildSitesOptions(config);
52094
52139
  const defaultPersistRoot = getDefaultPersistRoot(config.localPersistencePath);
@@ -52137,7 +52182,16 @@ async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticati
52137
52182
  };
52138
52183
  return { options, internalObjects, entrypointNames };
52139
52184
  }
52140
- var import_node_assert5, import_node_crypto4, import_node_path17, import_miniflare8, EXTERNAL_SERVICE_WORKER_NAME, EXTERNAL_SERVICE_WORKER_SCRIPT, WranglerLog, DEFAULT_WORKER_NAME, IDENTIFIER_UNSAFE_REGEXP, didWarnMiniflareCronSupport, didWarnMiniflareVectorizeSupport, didWarnAiAccountUsage;
52185
+ function getContainerOptions(className, containers2) {
52186
+ if (!containers2 || !(className in containers2)) {
52187
+ return void 0;
52188
+ }
52189
+ const container = containers2[className];
52190
+ return {
52191
+ imageName: `${CONTAINER_IMAGE_PREFIX}/${container.name}`
52192
+ };
52193
+ }
52194
+ var import_node_assert5, import_node_crypto4, import_node_path17, import_miniflare8, EXTERNAL_SERVICE_WORKER_NAME, EXTERNAL_SERVICE_WORKER_SCRIPT, WranglerLog, DEFAULT_WORKER_NAME, IDENTIFIER_UNSAFE_REGEXP, didWarnMiniflareCronSupport, didWarnMiniflareVectorizeSupport, didWarnAiAccountUsage, CONTAINER_IMAGE_PREFIX;
52141
52195
  var init_miniflare = __esm({
52142
52196
  "src/dev/miniflare.ts"() {
52143
52197
  init_import_meta_url();
@@ -52318,6 +52372,8 @@ export default {
52318
52372
  didWarnMiniflareVectorizeSupport = false;
52319
52373
  didWarnAiAccountUsage = false;
52320
52374
  __name(buildMiniflareOptions, "buildMiniflareOptions");
52375
+ CONTAINER_IMAGE_PREFIX = "cloudflare-dev";
52376
+ __name(getContainerOptions, "getContainerOptions");
52321
52377
  }
52322
52378
  });
52323
52379
 
@@ -59002,7 +59058,14 @@ var init_client2 = __esm({
59002
59058
  // ../containers-shared/src/build.ts
59003
59059
  async function constructBuildCommand(options, logger4) {
59004
59060
  const platform3 = options.platform ?? "linux/amd64";
59005
- const buildCmd = ["build", "-t", options.tag, "--platform", platform3];
59061
+ const buildCmd = [
59062
+ "build",
59063
+ "-t",
59064
+ options.tag,
59065
+ "--platform",
59066
+ platform3,
59067
+ "--provenance=false"
59068
+ ];
59006
59069
  if (options.args) {
59007
59070
  for (const arg in options.args) {
59008
59071
  buildCmd.push("--build-arg", `${arg}=${options.args[arg]}`);
@@ -59072,7 +59135,7 @@ async function dockerLoginManagedRegistry(pathToDocker) {
59072
59135
  getCloudflareContainerRegistry(),
59073
59136
  {
59074
59137
  expiration_minutes: expirationMinutes,
59075
- permissions: ["push"]
59138
+ permissions: ["push", "pull"]
59076
59139
  }
59077
59140
  );
59078
59141
  const child = (0, import_node_child_process.spawn)(
@@ -59233,6 +59296,34 @@ var init_registry = __esm({
59233
59296
  }
59234
59297
  });
59235
59298
 
59299
+ // ../containers-shared/src/images.ts
59300
+ async function getDockerImageDigest(dockerPath, imageTag) {
59301
+ return new Promise((resolve24, reject) => {
59302
+ (0, import_child_process5.execFile)(
59303
+ dockerPath,
59304
+ ["images", "--digests", "--format", "{{.Digest}}", imageTag],
59305
+ (error2, stdout2, stderr2) => {
59306
+ if (error2) {
59307
+ return reject(
59308
+ new Error(
59309
+ `Failed getting docker image digest for image: ${imageTag} with error: ${error2}.`
59310
+ )
59311
+ );
59312
+ }
59313
+ return resolve24(stdout2.trim());
59314
+ }
59315
+ );
59316
+ });
59317
+ }
59318
+ var import_child_process5;
59319
+ var init_images = __esm({
59320
+ "../containers-shared/src/images.ts"() {
59321
+ init_import_meta_url();
59322
+ import_child_process5 = require("child_process");
59323
+ __name(getDockerImageDigest, "getDockerImageDigest");
59324
+ }
59325
+ });
59326
+
59236
59327
  // ../containers-shared/index.ts
59237
59328
  var init_containers_shared = __esm({
59238
59329
  "../containers-shared/index.ts"() {
@@ -59245,6 +59336,7 @@ var init_containers_shared = __esm({
59245
59336
  init_types3();
59246
59337
  init_inspect();
59247
59338
  init_registry();
59339
+ init_images();
59248
59340
  }
59249
59341
  });
59250
59342
 
@@ -59557,7 +59649,7 @@ async function fillOpenAPIConfiguration(config, json) {
59557
59649
  if (json && err instanceof ApiError) {
59558
59650
  message = JSON.stringify(err);
59559
59651
  }
59560
- throw new UserError("loading Cloudchamber account failed:" + message);
59652
+ throw new UserError("Loading account failed: " + message);
59561
59653
  }
59562
59654
  }
59563
59655
  function interactWithUser(config) {
@@ -60146,7 +60238,7 @@ function containerAppToCreateApplication(containerApp, skipDefaults = false) {
60146
60238
  ...containerApp,
60147
60239
  configuration,
60148
60240
  instances: containerApp.instances ?? 0,
60149
- scheduling_policy: containerApp.scheduling_policy ?? "regional" /* REGIONAL */,
60241
+ scheduling_policy: containerApp.scheduling_policy ?? "default" /* DEFAULT */,
60150
60242
  constraints: {
60151
60243
  ...containerApp.constraints ?? (!skipDefaults ? { tier: 1 } : void 0),
60152
60244
  cities: containerApp.constraints?.cities?.map(
@@ -60325,15 +60417,21 @@ async function apply(args, config) {
60325
60417
  const actions = [];
60326
60418
  log(dim("Container application changes\n"));
60327
60419
  for (const appConfigNoDefaults of config.containers) {
60420
+ const application = applicationByNames[appConfigNoDefaults.name];
60421
+ if (!appConfigNoDefaults.configuration.image && application) {
60422
+ appConfigNoDefaults.configuration.image = application.configuration.image;
60423
+ }
60328
60424
  const appConfig = containerAppToCreateApplication(
60329
60425
  appConfigNoDefaults,
60330
60426
  args.skipDefaults
60331
60427
  );
60332
- const application = applicationByNames[appConfig.name];
60333
60428
  if (application !== void 0 && application !== null) {
60334
60429
  const prevApp = sortObjectRecursive(
60335
60430
  stripUndefined(applicationToCreateApplication(application))
60336
60431
  );
60432
+ if (appConfigNoDefaults.scheduling_policy === void 0) {
60433
+ appConfig.scheduling_policy = prevApp.scheduling_policy;
60434
+ }
60337
60435
  if (prevApp.durable_objects !== void 0 && appConfigNoDefaults.durable_objects !== void 0 && prevApp.durable_objects.namespace_id !== appConfigNoDefaults.durable_objects.namespace_id) {
60338
60436
  throw new UserError(
60339
60437
  `Application "${prevApp.name}" is assigned to durable object ${prevApp.durable_objects.namespace_id}, but a new DO namespace is being assigned to the application,
@@ -60710,7 +60808,25 @@ async function buildAndMaybePush(args, pathToDocker, push, containerConfig) {
60710
60808
  });
60711
60809
  if (push) {
60712
60810
  await dockerLoginManagedRegistry(pathToDocker);
60713
- await runDockerCmd(pathToDocker, ["push", imageTag]);
60811
+ try {
60812
+ const repositoryOnly = imageTag.split(":")[0];
60813
+ const localDigest = await getDockerImageDigest(pathToDocker, imageTag);
60814
+ const digest = repositoryOnly + "@" + localDigest;
60815
+ await runDockerCmd(
60816
+ pathToDocker,
60817
+ ["manifest", "inspect", digest],
60818
+ "ignore"
60819
+ );
60820
+ logger.log("Image already exists remotely, skipping push");
60821
+ logger.debug(
60822
+ `Untagging built image: ${imageTag} since there was no change.`
60823
+ );
60824
+ await runDockerCmd(pathToDocker, ["image", "rm", imageTag]);
60825
+ return "";
60826
+ } catch (error2) {
60827
+ logger.log(`Image does not exist remotely, pushing: ${imageTag}`);
60828
+ await runDockerCmd(pathToDocker, ["push", imageTag]);
60829
+ }
60714
60830
  }
60715
60831
  return imageTag;
60716
60832
  } catch (error2) {
@@ -76262,7 +76378,7 @@ async function handleConfigureImageRegistryCommand(args, _config) {
76262
76378
  );
76263
76379
  }
76264
76380
  var registriesCommand;
76265
- var init_images = __esm({
76381
+ var init_images2 = __esm({
76266
76382
  "src/cloudchamber/images/images.ts"() {
76267
76383
  init_import_meta_url();
76268
76384
  init_cli();
@@ -76975,7 +77091,7 @@ var init_cloudchamber = __esm({
76975
77091
  init_create2();
76976
77092
  init_curl();
76977
77093
  init_delete();
76978
- init_images();
77094
+ init_images2();
76979
77095
  init_list2();
76980
77096
  init_list3();
76981
77097
  init_modify();
@@ -78086,7 +78202,7 @@ function createHandler(def, commandName) {
78086
78202
  const experimentalFlags = def.behaviour?.overrideExperimentalFlags ? def.behaviour?.overrideExperimentalFlags(args) : {
78087
78203
  MULTIWORKER: false,
78088
78204
  RESOURCES_PROVISION: args.experimentalProvision ?? false,
78089
- MIXED_MODE: args.experimentalMixedMode ?? false
78205
+ REMOTE_BINDINGS: args.experimentalRemoteBindings ?? false
78090
78206
  };
78091
78207
  await run(experimentalFlags, () => {
78092
78208
  const config = def.behaviour?.provideConfig ?? true ? readConfig(args, {
@@ -81220,7 +81336,7 @@ var init_deploy3 = __esm({
81220
81336
  overrideExperimentalFlags: /* @__PURE__ */ __name((args) => ({
81221
81337
  MULTIWORKER: false,
81222
81338
  RESOURCES_PROVISION: args.experimentalProvision ?? false,
81223
- MIXED_MODE: false
81339
+ REMOTE_BINDINGS: false
81224
81340
  }), "overrideExperimentalFlags"),
81225
81341
  warnIfMultipleEnvsConfiguredButNoneSpecified: true
81226
81342
  },
@@ -89888,7 +90004,7 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
89888
90004
  {
89889
90005
  MULTIWORKER: Array.isArray(args.config),
89890
90006
  RESOURCES_PROVISION: false,
89891
- MIXED_MODE: false
90007
+ REMOTE_BINDINGS: false
89892
90008
  },
89893
90009
  () => startDev({
89894
90010
  script: scriptEntrypoint,
@@ -89951,7 +90067,7 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
89951
90067
  persistTo: args.persistTo,
89952
90068
  logLevel: args.logLevel ?? "log",
89953
90069
  experimentalProvision: void 0,
89954
- experimentalMixedMode: false,
90070
+ experimentalRemoteBindings: false,
89955
90071
  experimentalVectorizeBindToProd: false,
89956
90072
  experimentalImagesLocalMode: false,
89957
90073
  enableIpc: true,
@@ -118863,12 +118979,12 @@ var init_getValidatedProcessCredentials = __esm({
118863
118979
  });
118864
118980
 
118865
118981
  // ../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js
118866
- var import_child_process5, import_util14, resolveProcessCredentials;
118982
+ var import_child_process6, import_util14, resolveProcessCredentials;
118867
118983
  var init_resolveProcessCredentials = __esm({
118868
118984
  "../../node_modules/.pnpm/@aws-sdk+credential-provider-process@3.716.0/node_modules/@aws-sdk/credential-provider-process/dist-es/resolveProcessCredentials.js"() {
118869
118985
  init_import_meta_url();
118870
118986
  init_dist_es17();
118871
- import_child_process5 = require("child_process");
118987
+ import_child_process6 = require("child_process");
118872
118988
  import_util14 = require("util");
118873
118989
  init_getValidatedProcessCredentials();
118874
118990
  resolveProcessCredentials = /* @__PURE__ */ __name(async (profileName, profiles, logger4) => {
@@ -118876,7 +118992,7 @@ var init_resolveProcessCredentials = __esm({
118876
118992
  if (profiles[profileName]) {
118877
118993
  const credentialProcess = profile["credential_process"];
118878
118994
  if (credentialProcess !== void 0) {
118879
- const execPromise = (0, import_util14.promisify)(import_child_process5.exec);
118995
+ const execPromise = (0, import_util14.promisify)(import_child_process6.exec);
118880
118996
  try {
118881
118997
  const { stdout: stdout2 } = await execPromise(credentialProcess);
118882
118998
  let data;
@@ -137247,9 +137363,9 @@ var init_client9 = __esm({
137247
137363
  }
137248
137364
  });
137249
137365
 
137250
- // ../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/common.js
137366
+ // ../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/common.js
137251
137367
  var require_common2 = __commonJS({
137252
- "../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/common.js"(exports2, module3) {
137368
+ "../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/common.js"(exports2, module3) {
137253
137369
  init_import_meta_url();
137254
137370
  function setup(env6) {
137255
137371
  createDebug.debug = createDebug;
@@ -137355,7 +137471,7 @@ var require_common2 = __commonJS({
137355
137471
  createDebug.namespaces = namespaces;
137356
137472
  createDebug.names = [];
137357
137473
  createDebug.skips = [];
137358
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
137474
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
137359
137475
  for (const ns of split) {
137360
137476
  if (ns[0] === "-") {
137361
137477
  createDebug.skips.push(ns.slice(1));
@@ -137436,9 +137552,9 @@ var require_common2 = __commonJS({
137436
137552
  }
137437
137553
  });
137438
137554
 
137439
- // ../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/browser.js
137555
+ // ../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/browser.js
137440
137556
  var require_browser2 = __commonJS({
137441
- "../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/browser.js"(exports2, module3) {
137557
+ "../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/browser.js"(exports2, module3) {
137442
137558
  init_import_meta_url();
137443
137559
  exports2.formatArgs = formatArgs;
137444
137560
  exports2.save = save;
@@ -137584,7 +137700,7 @@ var require_browser2 = __commonJS({
137584
137700
  function load() {
137585
137701
  let r7;
137586
137702
  try {
137587
- r7 = exports2.storage.getItem("debug");
137703
+ r7 = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
137588
137704
  } catch (error2) {
137589
137705
  }
137590
137706
  if (!r7 && typeof process !== "undefined" && "env" in process) {
@@ -137612,9 +137728,9 @@ var require_browser2 = __commonJS({
137612
137728
  }
137613
137729
  });
137614
137730
 
137615
- // ../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/node.js
137731
+ // ../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/node.js
137616
137732
  var require_node5 = __commonJS({
137617
- "../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/node.js"(exports2, module3) {
137733
+ "../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/node.js"(exports2, module3) {
137618
137734
  init_import_meta_url();
137619
137735
  var tty3 = require("tty");
137620
137736
  var util5 = require("util");
@@ -137794,9 +137910,9 @@ var require_node5 = __commonJS({
137794
137910
  }
137795
137911
  });
137796
137912
 
137797
- // ../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/index.js
137913
+ // ../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/index.js
137798
137914
  var require_src4 = __commonJS({
137799
- "../../node_modules/.pnpm/debug@4.4.0_supports-color@9.2.2/node_modules/debug/src/index.js"(exports2, module3) {
137915
+ "../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/index.js"(exports2, module3) {
137800
137916
  init_import_meta_url();
137801
137917
  if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
137802
137918
  module3.exports = require_browser2();
@@ -139505,7 +139621,7 @@ async function getDarwinInfo() {
139505
139621
  };
139506
139622
  try {
139507
139623
  const output = await new Promise((resolve24, reject) => {
139508
- (0, import_child_process6.execFile)("/usr/bin/sw_vers", (error2, stdout2) => {
139624
+ (0, import_child_process7.execFile)("/usr/bin/sw_vers", (error2, stdout2) => {
139509
139625
  if (error2) {
139510
139626
  reject(error2);
139511
139627
  return;
@@ -139599,12 +139715,12 @@ function getCloudResourceContext() {
139599
139715
  return void 0;
139600
139716
  }
139601
139717
  }
139602
- var import_child_process6, import_fs23, os8, import_path22, import_util16, readFileAsync, readDirAsync, Context, PLATFORM_NAMES, LINUX_DISTROS, LINUX_VERSIONS;
139718
+ var import_child_process7, import_fs23, os8, import_path22, import_util16, readFileAsync, readDirAsync, Context, PLATFORM_NAMES, LINUX_DISTROS, LINUX_VERSIONS;
139603
139719
  var init_context = __esm({
139604
139720
  "../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/context.js"() {
139605
139721
  init_import_meta_url();
139606
139722
  init_esm6();
139607
- import_child_process6 = require("child_process");
139723
+ import_child_process7 = require("child_process");
139608
139724
  import_fs23 = require("fs");
139609
139725
  os8 = __toESM(require("os"));
139610
139726
  import_path22 = require("path");
@@ -145855,7 +145971,7 @@ var init_upload2 = __esm({
145855
145971
  overrideExperimentalFlags: /* @__PURE__ */ __name((args) => ({
145856
145972
  MULTIWORKER: false,
145857
145973
  RESOURCES_PROVISION: args.experimentalProvision ?? false,
145858
- MIXED_MODE: false
145974
+ REMOTE_BINDINGS: false
145859
145975
  }), "overrideExperimentalFlags"),
145860
145976
  warnIfMultipleEnvsConfiguredButNoneSpecified: true
145861
145977
  },
@@ -149911,16 +150027,16 @@ function createCLIParser(argv) {
149911
150027
  log_file_path: debugLogFilepath
149912
150028
  });
149913
150029
  return true;
150030
+ }).option("experimental-remote-bindings", {
150031
+ describe: `Experimental: Enable Remote Bindings`,
150032
+ type: "boolean",
150033
+ hidden: true,
150034
+ alias: ["x-remote-bindings"]
149914
150035
  }).option("experimental-provision", {
149915
150036
  describe: `Experimental: Enable automatic resource provisioning`,
149916
150037
  type: "boolean",
149917
150038
  hidden: true,
149918
150039
  alias: ["x-provision"]
149919
- }).option("experimental-mixed-mode", {
149920
- describe: `Experimental: Enable Mixed Mode`,
149921
- type: "boolean",
149922
- hidden: true,
149923
- alias: ["x-mixed-mode"]
149924
150040
  }).epilogue(
149925
150041
  `Please report any issues to ${source_default.hex("#3B818D")(
149926
150042
  "https://github.com/cloudflare/workers-sdk/issues/new/choose"
@@ -153050,9 +153166,10 @@ async function resolveDevConfig(config, input) {
153050
153166
  bindVectorizeToProd: input.dev?.bindVectorizeToProd ?? false,
153051
153167
  multiworkerPrimary: input.dev?.multiworkerPrimary,
153052
153168
  imagesLocalMode: input.dev?.imagesLocalMode ?? false,
153053
- experimentalMixedMode: input.dev?.experimentalMixedMode ?? getFlag("MIXED_MODE"),
153169
+ experimentalRemoteBindings: input.dev?.experimentalRemoteBindings ?? getFlag("REMOTE_BINDINGS"),
153054
153170
  enableContainers: input.dev?.enableContainers ?? config.dev.enable_containers,
153055
- dockerPath: input.dev?.dockerPath ?? getDockerPath()
153171
+ dockerPath: input.dev?.dockerPath ?? getDockerPath(),
153172
+ containerEngine: input.dev?.containerEngine ?? getDockerHost()
153056
153173
  };
153057
153174
  }
153058
153175
  async function resolveBindings(config, input) {
@@ -153081,7 +153198,7 @@ async function resolveBindings(config, input) {
153081
153198
  input.bindings
153082
153199
  )?.[0]
153083
153200
  },
153084
- input.dev?.experimentalMixedMode
153201
+ input.dev?.experimentalRemoteBindings
153085
153202
  );
153086
153203
  const maskedVars = maskVars(bindings, config);
153087
153204
  printBindings(
@@ -153213,7 +153330,7 @@ If you are trying to develop Pages and Workers together, please use \`wrangler p
153213
153330
  assets: assetsOptions,
153214
153331
  tailConsumers: config.tail_consumers ?? []
153215
153332
  };
153216
- if (extractBindingsOfType("browser", resolved.bindings).length && !resolved.dev.remote && !getFlag("MIXED_MODE")) {
153333
+ if (extractBindingsOfType("browser", resolved.bindings).length && !resolved.dev.remote && !getFlag("REMOTE_BINDINGS")) {
153217
153334
  logger.warn(
153218
153335
  "Browser Rendering is not supported locally. Please use `wrangler dev --remote` instead."
153219
153336
  );
@@ -153257,6 +153374,9 @@ If you are trying to develop Pages and Workers together, please use \`wrangler p
153257
153374
  }
153258
153375
  function resolveContainerConfig(config) {
153259
153376
  const containers2 = {};
153377
+ if (!config.dev.enable_containers) {
153378
+ return containers2;
153379
+ }
153260
153380
  for (const container of config.containers ?? []) {
153261
153381
  containers2[container.class_name] = {
153262
153382
  image: container.image ?? container.configuration.image,
@@ -173369,17 +173489,17 @@ var init_startDevWorker = __esm({
173369
173489
  }
173370
173490
  });
173371
173491
 
173372
- // src/api/mixedMode/index.ts
173373
- var mixedMode_exports = {};
173374
- __export(mixedMode_exports, {
173375
- maybeStartOrUpdateMixedModeSession: () => maybeStartOrUpdateMixedModeSession,
173492
+ // src/api/remoteBindings/index.ts
173493
+ var remoteBindings_exports = {};
173494
+ __export(remoteBindings_exports, {
173495
+ maybeStartOrUpdateRemoteProxySession: () => maybeStartOrUpdateRemoteProxySession,
173376
173496
  pickRemoteBindings: () => pickRemoteBindings,
173377
- startMixedModeSession: () => startMixedModeSession
173497
+ startRemoteProxySession: () => startRemoteProxySession
173378
173498
  });
173379
- async function startMixedModeSession(bindings, options) {
173499
+ async function startRemoteProxySession(bindings, options) {
173380
173500
  const proxyServerWorkerWranglerConfig = import_node_path63.default.resolve(
173381
173501
  getBasePath(),
173382
- "templates/mixedMode/proxyServerWorker/wrangler.jsonc"
173502
+ "templates/remoteBindings/proxyServerWorker/wrangler.jsonc"
173383
173503
  );
173384
173504
  const rawBindings = Object.fromEntries(
173385
173505
  Object.entries(bindings ?? {}).map(([key, binding]) => [
@@ -173401,7 +173521,7 @@ async function startMixedModeSession(bindings, options) {
173401
173521
  },
173402
173522
  bindings: rawBindings
173403
173523
  });
173404
- const mixedModeConnectionString = await worker.url;
173524
+ const remoteProxyConnectionString = await worker.url;
173405
173525
  const updateBindings = /* @__PURE__ */ __name(async (newBindings) => {
173406
173526
  const rawNewBindings = Object.fromEntries(
173407
173527
  Object.entries(newBindings ?? {}).map(([key, binding]) => [
@@ -173413,7 +173533,7 @@ async function startMixedModeSession(bindings, options) {
173413
173533
  }, "updateBindings");
173414
173534
  return {
173415
173535
  ready: worker.ready,
173416
- mixedModeConnectionString,
173536
+ remoteProxyConnectionString,
173417
173537
  updateBindings,
173418
173538
  dispose: worker.dispose
173419
173539
  };
@@ -173424,11 +173544,11 @@ function pickRemoteBindings(bindings) {
173424
173544
  if (binding.type === "ai") {
173425
173545
  return true;
173426
173546
  }
173427
- return "remote" in binding && binding["remote"];
173547
+ return "experimental_remote" in binding && binding["experimental_remote"];
173428
173548
  })
173429
173549
  );
173430
173550
  }
173431
- async function maybeStartOrUpdateMixedModeSession(configPathOrWorkerConfig, preExistingMixedModeSessionData) {
173551
+ async function maybeStartOrUpdateRemoteProxySession(configPathOrWorkerConfig, preExistingRemoteProxySessionData) {
173432
173552
  if (typeof configPathOrWorkerConfig === "string") {
173433
173553
  const configPath = configPathOrWorkerConfig;
173434
173554
  const config = readConfig({ config: configPath });
@@ -173440,26 +173560,26 @@ async function maybeStartOrUpdateMixedModeSession(configPathOrWorkerConfig, preE
173440
173560
  }
173441
173561
  const workerConfigs = configPathOrWorkerConfig;
173442
173562
  const remoteBindings = pickRemoteBindings(workerConfigs.bindings);
173443
- let mixedModeSession = preExistingMixedModeSessionData?.session;
173563
+ let remoteProxySession = preExistingRemoteProxySessionData?.session;
173444
173564
  const remoteBindingsAreSameAsBefore = deepStrictEqual(
173445
173565
  remoteBindings,
173446
- preExistingMixedModeSessionData?.remoteBindings
173566
+ preExistingRemoteProxySessionData?.remoteBindings
173447
173567
  );
173448
173568
  if (!remoteBindingsAreSameAsBefore) {
173449
- if (!mixedModeSession) {
173569
+ if (!remoteProxySession) {
173450
173570
  if (Object.keys(remoteBindings).length > 0) {
173451
- mixedModeSession = await startMixedModeSession(remoteBindings);
173571
+ remoteProxySession = await startRemoteProxySession(remoteBindings);
173452
173572
  }
173453
173573
  } else {
173454
- await mixedModeSession.updateBindings(remoteBindings);
173574
+ await remoteProxySession.updateBindings(remoteBindings);
173455
173575
  }
173456
173576
  }
173457
- await mixedModeSession?.ready;
173458
- if (!mixedModeSession) {
173577
+ await remoteProxySession?.ready;
173578
+ if (!remoteProxySession) {
173459
173579
  return null;
173460
173580
  }
173461
173581
  return {
173462
- session: mixedModeSession,
173582
+ session: remoteProxySession,
173463
173583
  remoteBindings
173464
173584
  };
173465
173585
  }
@@ -173472,8 +173592,8 @@ function deepStrictEqual(source, target) {
173472
173592
  }
173473
173593
  }
173474
173594
  var import_node_assert28, import_node_path63;
173475
- var init_mixedMode = __esm({
173476
- "src/api/mixedMode/index.ts"() {
173595
+ var init_remoteBindings = __esm({
173596
+ "src/api/remoteBindings/index.ts"() {
173477
173597
  init_import_meta_url();
173478
173598
  import_node_assert28 = __toESM(require("assert"));
173479
173599
  import_node_path63 = __toESM(require("path"));
@@ -173481,9 +173601,9 @@ var init_mixedMode = __esm({
173481
173601
  init_config2();
173482
173602
  init_paths();
173483
173603
  init_startDevWorker();
173484
- __name(startMixedModeSession, "startMixedModeSession");
173604
+ __name(startRemoteProxySession, "startRemoteProxySession");
173485
173605
  __name(pickRemoteBindings, "pickRemoteBindings");
173486
- __name(maybeStartOrUpdateMixedModeSession, "maybeStartOrUpdateMixedModeSession");
173606
+ __name(maybeStartOrUpdateRemoteProxySession, "maybeStartOrUpdateRemoteProxySession");
173487
173607
  __name(deepStrictEqual, "deepStrictEqual");
173488
173608
  }
173489
173609
  });
@@ -173592,7 +173712,8 @@ async function convertToConfigBundle(event) {
173592
173712
  tails: event.config.tailConsumers,
173593
173713
  containers: event.config.containers ?? {},
173594
173714
  enableContainers: event.config.dev.enableContainers ?? true,
173595
- dockerPath: event.config.dev.dockerPath ?? "docker"
173715
+ dockerPath: event.config.dev.dockerPath ?? "docker",
173716
+ containerEngine: event.config.dev.containerEngine
173596
173717
  };
173597
173718
  }
173598
173719
  var import_node_crypto14, import_promises37, import_miniflare26, LocalRuntimeController;
@@ -173630,29 +173751,29 @@ var init_LocalRuntimeController = __esm({
173630
173751
  // wrap updates in a mutex, so they're always applied in invocation order.
173631
173752
  #mutex = new import_miniflare26.Mutex();
173632
173753
  #mf;
173633
- #mixedModeSessionData = null;
173754
+ #remoteProxySessionData = null;
173634
173755
  onBundleStart(_4) {
173635
173756
  }
173636
173757
  async #onBundleComplete(data, id) {
173637
173758
  try {
173638
173759
  const configBundle = await convertToConfigBundle(data);
173639
- const experimentalMixedMode = data.config.dev.experimentalMixedMode ?? false;
173640
- if (experimentalMixedMode && !data.config.dev?.remote) {
173641
- const { maybeStartOrUpdateMixedModeSession: maybeStartOrUpdateMixedModeSession2 } = await Promise.resolve().then(() => (init_mixedMode(), mixedMode_exports));
173642
- this.#mixedModeSessionData = await maybeStartOrUpdateMixedModeSession2(
173760
+ const experimentalRemoteBindings = data.config.dev.experimentalRemoteBindings ?? false;
173761
+ if (experimentalRemoteBindings && !data.config.dev?.remote) {
173762
+ const { maybeStartOrUpdateRemoteProxySession: maybeStartOrUpdateRemoteProxySession2 } = await Promise.resolve().then(() => (init_remoteBindings(), remoteBindings_exports));
173763
+ this.#remoteProxySessionData = await maybeStartOrUpdateRemoteProxySession2(
173643
173764
  {
173644
173765
  name: configBundle.name,
173645
173766
  bindings: convertCfWorkerInitBindingsToBindings(configBundle.bindings) ?? {}
173646
173767
  },
173647
- this.#mixedModeSessionData ?? null
173768
+ this.#remoteProxySessionData ?? null
173648
173769
  );
173649
173770
  }
173650
173771
  const { options, internalObjects, entrypointNames } = await buildMiniflareOptions(
173651
173772
  this.#log,
173652
173773
  configBundle,
173653
173774
  this.#proxyToUserWorkerAuthenticationSecret,
173654
- this.#mixedModeSessionData?.session?.mixedModeConnectionString,
173655
- !!experimentalMixedMode
173775
+ this.#remoteProxySessionData?.session?.remoteProxyConnectionString,
173776
+ !!experimentalRemoteBindings
173656
173777
  );
173657
173778
  options.liveReload = false;
173658
173779
  if (this.#mf === void 0) {
@@ -173738,11 +173859,11 @@ var init_LocalRuntimeController = __esm({
173738
173859
  }
173739
173860
  await this.#mf?.dispose();
173740
173861
  this.#mf = void 0;
173741
- if (this.#mixedModeSessionData) {
173862
+ if (this.#remoteProxySessionData) {
173742
173863
  logger.log(source_default.dim("\u2394 Shutting down remote connection..."));
173743
173864
  }
173744
- await this.#mixedModeSessionData?.session?.dispose();
173745
- this.#mixedModeSessionData = null;
173865
+ await this.#remoteProxySessionData?.session?.dispose();
173866
+ this.#remoteProxySessionData = null;
173746
173867
  logger.debug("LocalRuntimeController teardown complete");
173747
173868
  }, "#teardown");
173748
173869
  async teardown() {
@@ -173821,7 +173942,7 @@ var init_MultiworkerRuntimeController = __esm({
173821
173942
  #mutex = new import_miniflare27.Mutex();
173822
173943
  #mf;
173823
173944
  #options = /* @__PURE__ */ new Map();
173824
- #mixedModeSessionsData = /* @__PURE__ */ new Map();
173945
+ #remoteProxySessionsData = /* @__PURE__ */ new Map();
173825
173946
  #canStartMiniflare() {
173826
173947
  return [...this.#options.values()].some((o5) => o5.primary) && [...this.#options.values()].length === this.numWorkers;
173827
173948
  }
@@ -173845,27 +173966,27 @@ var init_MultiworkerRuntimeController = __esm({
173845
173966
  async #onBundleComplete(data, id) {
173846
173967
  try {
173847
173968
  const configBundle = await convertToConfigBundle(data);
173848
- const experimentalMixedMode = data.config.dev.experimentalMixedMode;
173849
- if (experimentalMixedMode && !data.config.dev?.remote) {
173850
- const { maybeStartOrUpdateMixedModeSession: maybeStartOrUpdateMixedModeSession2 } = await Promise.resolve().then(() => (init_mixedMode(), mixedMode_exports));
173851
- const mixedModeSession = await maybeStartOrUpdateMixedModeSession2(
173969
+ const experimentalRemoteBindings = data.config.dev.experimentalRemoteBindings;
173970
+ if (experimentalRemoteBindings && !data.config.dev?.remote) {
173971
+ const { maybeStartOrUpdateRemoteProxySession: maybeStartOrUpdateRemoteProxySession2 } = await Promise.resolve().then(() => (init_remoteBindings(), remoteBindings_exports));
173972
+ const remoteProxySession = await maybeStartOrUpdateRemoteProxySession2(
173852
173973
  {
173853
173974
  name: configBundle.name,
173854
173975
  bindings: convertCfWorkerInitBindingsToBindings(configBundle.bindings) ?? {}
173855
173976
  },
173856
- this.#mixedModeSessionsData.get(data.config.name) ?? null
173977
+ this.#remoteProxySessionsData.get(data.config.name) ?? null
173857
173978
  );
173858
- this.#mixedModeSessionsData.set(
173979
+ this.#remoteProxySessionsData.set(
173859
173980
  data.config.name,
173860
- mixedModeSession ?? null
173981
+ remoteProxySession ?? null
173861
173982
  );
173862
173983
  }
173863
173984
  const { options } = await buildMiniflareOptions(
173864
173985
  this.#log,
173865
173986
  await convertToConfigBundle(data),
173866
173987
  this.#proxyToUserWorkerAuthenticationSecret,
173867
- this.#mixedModeSessionsData.get(data.config.name)?.session?.mixedModeConnectionString,
173868
- !!experimentalMixedMode
173988
+ this.#remoteProxySessionsData.get(data.config.name)?.session?.remoteProxyConnectionString,
173989
+ !!experimentalRemoteBindings
173869
173990
  );
173870
173991
  this.#options.set(data.config.name, {
173871
173992
  options,
@@ -173956,15 +174077,15 @@ var init_MultiworkerRuntimeController = __esm({
173956
174077
  }
173957
174078
  await this.#mf?.dispose();
173958
174079
  this.#mf = void 0;
173959
- if (this.#mixedModeSessionsData.size > 0) {
174080
+ if (this.#remoteProxySessionsData.size > 0) {
173960
174081
  logger.log(source_default.dim("\u2394 Shutting down remote connections..."));
173961
174082
  }
173962
174083
  await Promise.all(
173963
- [...this.#mixedModeSessionsData.values()].map(
173964
- (mixedModeSessionData) => mixedModeSessionData?.session?.dispose()
174084
+ [...this.#remoteProxySessionsData.values()].map(
174085
+ (remoteProxySessionData) => remoteProxySessionData?.session?.dispose()
173965
174086
  )
173966
174087
  );
173967
- this.#mixedModeSessionsData.clear();
174088
+ this.#remoteProxySessionsData.clear();
173968
174089
  logger.debug("MultiworkerRuntimeController teardown complete");
173969
174090
  }, "#teardown");
173970
174091
  async teardown() {
@@ -177032,9 +177153,9 @@ function getResolvedSiteAssetPaths(args, configParam) {
177032
177153
  args.siteExclude
177033
177154
  );
177034
177155
  }
177035
- function getBindings2(configParam, env6, local, args, mixedModeEnabled = getFlag("MIXED_MODE")) {
177156
+ function getBindings2(configParam, env6, local, args, remoteBindingsEnabled = getFlag("REMOTE_BINDINGS")) {
177036
177157
  const kvConfig = (configParam.kv_namespaces || []).map(
177037
- ({ binding, preview_id, id, remote }) => {
177158
+ ({ binding, preview_id, id, experimental_remote }) => {
177038
177159
  if (!preview_id && !local) {
177039
177160
  throw new UserError(
177040
177161
  `In development, you should use a separate kv namespace than the one you'd use in production. Please create a new kv namespace with "wrangler kv namespace create <name> --preview" and add its id as preview_id to the kv_namespace "${binding}" in your ${configFileName(configParam.configPath)} file`
@@ -177043,7 +177164,7 @@ function getBindings2(configParam, env6, local, args, mixedModeEnabled = getFlag
177043
177164
  return {
177044
177165
  binding,
177045
177166
  id: preview_id ?? id,
177046
- remote: mixedModeEnabled && remote
177167
+ experimental_remote: remoteBindingsEnabled && experimental_remote
177047
177168
  };
177048
177169
  }
177049
177170
  );
@@ -177057,7 +177178,7 @@ function getBindings2(configParam, env6, local, args, mixedModeEnabled = getFlag
177057
177178
  if (local) {
177058
177179
  return {
177059
177180
  ...d1Db,
177060
- remote: mixedModeEnabled && d1Db.remote,
177181
+ experimental_remote: remoteBindingsEnabled && d1Db.experimental_remote,
177061
177182
  database_id
177062
177183
  };
177063
177184
  }
@@ -177075,7 +177196,13 @@ function getBindings2(configParam, env6, local, args, mixedModeEnabled = getFlag
177075
177196
  const d1Args = args.d1Databases || [];
177076
177197
  const mergedD1Bindings = mergeWithOverride(d1Config, d1Args, "binding");
177077
177198
  const r2Config = configParam.r2_buckets?.map(
177078
- ({ binding, preview_bucket_name, bucket_name, jurisdiction, remote }) => {
177199
+ ({
177200
+ binding,
177201
+ preview_bucket_name,
177202
+ bucket_name,
177203
+ jurisdiction,
177204
+ experimental_remote
177205
+ }) => {
177079
177206
  if (!preview_bucket_name && !local) {
177080
177207
  throw new UserError(
177081
177208
  `In development, you should use a separate r2 bucket than the one you'd use in production. Please create a new r2 bucket with "wrangler r2 bucket create <name>" and add its name as preview_bucket_name to the r2_buckets "${binding}" in your ${configFileName(configParam.configPath)} file`
@@ -177085,7 +177212,7 @@ function getBindings2(configParam, env6, local, args, mixedModeEnabled = getFlag
177085
177212
  binding,
177086
177213
  bucket_name: preview_bucket_name ?? bucket_name,
177087
177214
  jurisdiction,
177088
- remote: mixedModeEnabled && remote
177215
+ experimental_remote: remoteBindingsEnabled && experimental_remote
177089
177216
  };
177090
177217
  }
177091
177218
  ) || [];
@@ -177097,10 +177224,12 @@ function getBindings2(configParam, env6, local, args, mixedModeEnabled = getFlag
177097
177224
  servicesConfig,
177098
177225
  servicesArgs,
177099
177226
  "binding"
177100
- ).map((service) => ({
177101
- ...service,
177102
- remote: mixedModeEnabled && "remote" in service && !!service.remote
177103
- }));
177227
+ ).map(
177228
+ (service) => ({
177229
+ ...service,
177230
+ experimental_remote: remoteBindingsEnabled && "experimental_remote" in service && !!service.experimental_remote
177231
+ })
177232
+ );
177104
177233
  const hyperdriveBindings = configParam.hyperdrive.map((hyperdrive) => {
177105
177234
  const connectionStringFromEnv = process.env[`WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_${hyperdrive.binding}`];
177106
177235
  if (local && connectionStringFromEnv === void 0 && hyperdrive.localConnectionString === void 0) {
@@ -177122,7 +177251,7 @@ function getBindings2(configParam, env6, local, args, mixedModeEnabled = getFlag
177122
177251
  binding: queue.binding,
177123
177252
  queue_name: queue.queue,
177124
177253
  delivery_delay: queue.delivery_delay,
177125
- remote: mixedModeEnabled && queue.remote
177254
+ experimental_remote: remoteBindingsEnabled && queue.experimental_remote
177126
177255
  };
177127
177256
  })
177128
177257
  ];
@@ -177225,7 +177354,7 @@ var init_dev2 = __esm({
177225
177354
  overrideExperimentalFlags: /* @__PURE__ */ __name((args) => ({
177226
177355
  MULTIWORKER: Array.isArray(args.config),
177227
177356
  RESOURCES_PROVISION: args.experimentalProvision ?? false,
177228
- MIXED_MODE: args.experimentalMixedMode ?? false
177357
+ REMOTE_BINDINGS: args.experimentalRemoteBindings ?? false
177229
177358
  }), "overrideExperimentalFlags")
177230
177359
  },
177231
177360
  metadata: {
@@ -177600,20 +177729,21 @@ unstable_dev()'s behaviour will likely change in future releases`
177600
177729
  logLevel: options?.logLevel ?? defaultLogLevel,
177601
177730
  port: options?.port ?? 0,
177602
177731
  experimentalProvision: void 0,
177603
- experimentalMixedMode: false,
177732
+ experimentalRemoteBindings: false,
177604
177733
  experimentalVectorizeBindToProd: vectorizeBindToProd ?? false,
177605
177734
  experimentalImagesLocalMode: imagesLocalMode ?? false,
177606
177735
  enableIpc: options?.experimental?.enableIpc,
177607
177736
  nodeCompat: void 0,
177608
177737
  enableContainers: options?.experimental?.enableContainers ?? false,
177609
- dockerPath: options?.experimental?.dockerPath ?? getDockerPath()
177738
+ dockerPath: options?.experimental?.dockerPath ?? getDockerPath(),
177739
+ containerEngine: options?.experimental?.containerEngine ?? getDockerHost()
177610
177740
  };
177611
177741
  const devServer = await run(
177612
177742
  {
177613
177743
  // TODO: can we make this work?
177614
177744
  MULTIWORKER: false,
177615
177745
  RESOURCES_PROVISION: false,
177616
- MIXED_MODE: false
177746
+ REMOTE_BINDINGS: false
177617
177747
  },
177618
177748
  () => startDev(devOptions)
177619
177749
  );
@@ -177845,8 +177975,8 @@ async function getPlatformProxy(options = {}) {
177845
177975
  {
177846
177976
  MULTIWORKER: false,
177847
177977
  RESOURCES_PROVISION: false,
177848
- // TODO: when possible mixed mode should be made available for getPlatformProxy
177849
- MIXED_MODE: false
177978
+ // TODO: when possible remote bindings should be made available for getPlatformProxy
177979
+ REMOTE_BINDINGS: false
177850
177980
  },
177851
177981
  () => getMiniflareOptionsFromConfig(rawConfig, env6, options)
177852
177982
  );
@@ -177962,20 +178092,20 @@ function unstable_getMiniflareWorkerOptions(configOrConfigPath, env6, options) {
177962
178092
  tails: config.tail_consumers,
177963
178093
  containers: {}
177964
178094
  },
177965
- options?.mixedModeConnectionString,
177966
- options?.mixedModeEnabled ?? false
178095
+ options?.remoteProxyConnectionString,
178096
+ options?.remoteBindingsEnabled ?? false
177967
178097
  );
177968
178098
  if (bindings.services !== void 0) {
177969
178099
  bindingOptions.serviceBindings = Object.fromEntries(
177970
178100
  bindings.services.map((binding) => {
177971
178101
  const name2 = binding.service === config.name ? import_miniflare31.kCurrentWorker : binding.service;
177972
- if (options?.mixedModeConnectionString && binding.remote) {
178102
+ if (options?.remoteProxyConnectionString && binding.experimental_remote) {
177973
178103
  return [
177974
178104
  binding.binding,
177975
178105
  {
177976
178106
  name: name2,
177977
178107
  entrypoint: binding.entrypoint,
177978
- mixedModeConnectionString: options.mixedModeConnectionString
178108
+ remoteProxyConnectionString: options.remoteProxyConnectionString
177979
178109
  }
177980
178110
  ];
177981
178111
  }
@@ -178067,18 +178197,18 @@ var init_api3 = __esm({
178067
178197
  init_mtls_certificate();
178068
178198
  init_startDevWorker();
178069
178199
  init_integrations4();
178070
- init_mixedMode();
178200
+ init_remoteBindings();
178071
178201
  }
178072
178202
  });
178073
178203
 
178074
178204
  // src/cli.ts
178075
178205
  var cli_exports2 = {};
178076
178206
  __export(cli_exports2, {
178077
- experimental_maybeStartOrUpdateMixedModeSession: () => maybeStartOrUpdateMixedModeSession,
178207
+ experimental_maybeStartOrUpdateRemoteProxySession: () => maybeStartOrUpdateRemoteProxySession,
178078
178208
  experimental_patchConfig: () => experimental_patchConfig,
178079
178209
  experimental_pickRemoteBindings: () => pickRemoteBindings,
178080
178210
  experimental_readRawConfig: () => experimental_readRawConfig,
178081
- experimental_startMixedModeSession: () => startMixedModeSession,
178211
+ experimental_startRemoteProxySession: () => startRemoteProxySession,
178082
178212
  getPlatformProxy: () => getPlatformProxy,
178083
178213
  unstable_DevEnv: () => DevEnv,
178084
178214
  unstable_convertConfigBindingsToStartWorkerBindings: () => convertConfigBindingsToStartWorkerBindings,
@@ -178183,11 +178313,11 @@ var generateASSETSBinding2 = (
178183
178313
  );
178184
178314
  // Annotate the CommonJS export names for ESM import in node:
178185
178315
  0 && (module.exports = {
178186
- experimental_maybeStartOrUpdateMixedModeSession,
178316
+ experimental_maybeStartOrUpdateRemoteProxySession,
178187
178317
  experimental_patchConfig,
178188
178318
  experimental_pickRemoteBindings,
178189
178319
  experimental_readRawConfig,
178190
- experimental_startMixedModeSession,
178320
+ experimental_startRemoteProxySession,
178191
178321
  getPlatformProxy,
178192
178322
  unstable_DevEnv,
178193
178323
  unstable_convertConfigBindingsToStartWorkerBindings,