@cloudflare/vite-plugin 1.53.0 → 1.53.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.
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import { a as __require$1, i as __name$3, n as __commonJS$1, o as __require$1$1,
3
3
  import * as nodeModule from "node:module";
4
4
  import { builtinModules, createRequire } from "node:module";
5
5
  import * as fs$1 from "node:fs";
6
- import fs2, { accessSync, chmodSync, constants, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
6
+ import fs2, { accessSync, appendFileSync, chmodSync, constants, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
7
7
  import os, { arch } from "node:os";
8
8
  import * as path2 from "node:path";
9
9
  import path2__default, { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
@@ -43,8 +43,8 @@ import { basename as basename$1, dirname as dirname$1, isAbsolute as isAbsolute$
43
43
  import { fileURLToPath as fileURLToPath$1 } from "url";
44
44
  import { createRequire as createRequire$1 } from "module";
45
45
 
46
- //#region ../workers-utils/dist/chunk-IV7UMGT2.mjs
47
- var DEFAULT_COMPAT_DATE = "2026-08-15";
46
+ //#region ../workers-utils/dist/chunk-QKX75RGI.mjs
47
+ var DEFAULT_COMPAT_DATE = "2026-08-20";
48
48
  function assertNever(_value) {}
49
49
  __name$5(assertNever, "assertNever");
50
50
  function mapWorkerMetadataBindings(bindings$1) {
@@ -499,43 +499,43 @@ function hasKnownExportType$2(entry) {
499
499
  return type === "durable-object" || type === "worker";
500
500
  }
501
501
  __name$5(hasKnownExportType$2, "hasKnownExportType");
502
- function partitionExports$2(exports$2) {
502
+ function partitionExports$2(exports$1$1) {
503
503
  const partitioned = {
504
504
  "durable-object": {},
505
505
  worker: {}
506
506
  };
507
- if (exports$2 === void 0) return partitioned;
508
- for (const [name, entry] of Object.entries(exports$2)) {
507
+ if (exports$1$1 === void 0) return partitioned;
508
+ for (const [name, entry] of Object.entries(exports$1$1)) {
509
509
  if (!hasKnownExportType$2(entry)) continue;
510
510
  partitioned[entry.type][name] = entry;
511
511
  }
512
512
  return partitioned;
513
513
  }
514
514
  __name$5(partitionExports$2, "partitionExports");
515
- function getDurableObjectExports$2(exports$2) {
516
- return partitionExports$2(exports$2)["durable-object"];
515
+ function getDurableObjectExports$2(exports$1$1) {
516
+ return partitionExports$2(exports$1$1)["durable-object"];
517
517
  }
518
518
  __name$5(getDurableObjectExports$2, "getDurableObjectExports");
519
- function hasDurableObjectExports$2(exports$2) {
520
- return Object.keys(getDurableObjectExports$2(exports$2)).length > 0;
519
+ function hasDurableObjectExports$2(exports$1$1) {
520
+ return Object.keys(getDurableObjectExports$2(exports$1$1)).length > 0;
521
521
  }
522
522
  __name$5(hasDurableObjectExports$2, "hasDurableObjectExports");
523
- function getContainerNameToClassNameMap$2(exports$2) {
523
+ function getContainerNameToClassNameMap$2(exports$1$1) {
524
524
  const containerNameToClassName = /* @__PURE__ */ new Map();
525
- for (const [className, entry] of Object.entries(getDurableObjectExports$2(exports$2))) if ("container" in entry && typeof entry.container === "string" && !containerNameToClassName.has(entry.container)) containerNameToClassName.set(entry.container, className);
525
+ for (const [className, entry] of Object.entries(getDurableObjectExports$2(exports$1$1))) if ("container" in entry && typeof entry.container === "string" && !containerNameToClassName.has(entry.container)) containerNameToClassName.set(entry.container, className);
526
526
  return containerNameToClassName;
527
527
  }
528
528
  __name$5(getContainerNameToClassNameMap$2, "getContainerNameToClassNameMap");
529
- function resolveContainerClassName(container, exports$2) {
529
+ function resolveContainerClassName(container, exports$1$1) {
530
530
  if (container.class_name !== void 0) return container.class_name;
531
531
  if (container.name === void 0) return;
532
- return getContainerNameToClassNameMap$2(exports$2).get(container.name);
532
+ return getContainerNameToClassNameMap$2(exports$1$1).get(container.name);
533
533
  }
534
534
  __name$5(resolveContainerClassName, "resolveContainerClassName");
535
- function getContainerDurableObjectClassNames$2(containers, exports$2) {
535
+ function getContainerDurableObjectClassNames$2(containers, exports$1$1) {
536
536
  const classNames = /* @__PURE__ */ new Set();
537
537
  for (const container of containers ?? []) {
538
- const className = resolveContainerClassName(container, exports$2);
538
+ const className = resolveContainerClassName(container, exports$1$1);
539
539
  if (className !== void 0) classNames.add(className);
540
540
  }
541
541
  return classNames;
@@ -25308,7 +25308,7 @@ var require_undici = /* @__PURE__ */ __commonJS$4({ "../../node_modules/.pnpm/un
25308
25308
  //#endregion
25309
25309
  //#region ../workers-utils/dist/index.mjs
25310
25310
  var import_undici$4 = require_undici();
25311
- var require_vendors$2 = __commonJS$3({ "../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json"(exports$2, module$1) {
25311
+ var require_vendors$2 = __commonJS$3({ "../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json"(exports$1$1, module$1) {
25312
25312
  module$1.exports = [
25313
25313
  {
25314
25314
  name: "Agola CI",
@@ -25634,26 +25634,26 @@ var require_vendors$2 = __commonJS$3({ "../../node_modules/.pnpm/ci-info@4.4.0/n
25634
25634
  }
25635
25635
  ];
25636
25636
  } });
25637
- var require_ci_info$2 = __commonJS$3({ "../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js"(exports$2) {
25637
+ var require_ci_info$2 = __commonJS$3({ "../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/index.js"(exports$1$1) {
25638
25638
  var vendors$1 = require_vendors$2();
25639
25639
  var env$3 = process.env;
25640
- Object.defineProperty(exports$2, "_vendors", { value: vendors$1.map(function(v) {
25640
+ Object.defineProperty(exports$1$1, "_vendors", { value: vendors$1.map(function(v) {
25641
25641
  return v.constant;
25642
25642
  }) });
25643
- exports$2.name = null;
25644
- exports$2.isPR = null;
25645
- exports$2.id = null;
25643
+ exports$1$1.name = null;
25644
+ exports$1$1.isPR = null;
25645
+ exports$1$1.id = null;
25646
25646
  if (env$3.CI !== "false") vendors$1.forEach(function(vendor) {
25647
25647
  const isCI2 = (Array.isArray(vendor.env) ? vendor.env : [vendor.env]).every(function(obj) {
25648
25648
  return checkEnv$1(obj);
25649
25649
  });
25650
- exports$2[vendor.constant] = isCI2;
25650
+ exports$1$1[vendor.constant] = isCI2;
25651
25651
  if (!isCI2) return;
25652
- exports$2.name = vendor.name;
25653
- exports$2.isPR = checkPR$1(vendor);
25654
- exports$2.id = vendor.constant;
25652
+ exports$1$1.name = vendor.name;
25653
+ exports$1$1.isPR = checkPR$1(vendor);
25654
+ exports$1$1.id = vendor.constant;
25655
25655
  });
25656
- exports$2.isCI = !!(env$3.CI !== "false" && (env$3.BUILD_ID || env$3.BUILD_NUMBER || env$3.CI || env$3.CI_APP_ID || env$3.CI_BUILD_ID || env$3.CI_BUILD_NUMBER || env$3.CI_NAME || env$3.CONTINUOUS_INTEGRATION || env$3.RUN_ID || exports$2.name || false));
25656
+ exports$1$1.isCI = !!(env$3.CI !== "false" && (env$3.BUILD_ID || env$3.BUILD_NUMBER || env$3.CI || env$3.CI_APP_ID || env$3.CI_BUILD_ID || env$3.CI_BUILD_NUMBER || env$3.CI_NAME || env$3.CONTINUOUS_INTEGRATION || env$3.RUN_ID || exports$1$1.name || false));
25657
25657
  function checkEnv$1(obj) {
25658
25658
  if (typeof obj === "string") return !!env$3[obj];
25659
25659
  if ("env" in obj) return env$3[obj.env] && env$3[obj.env].includes(obj.includes);
@@ -25681,7 +25681,7 @@ var require_ci_info$2 = __commonJS$3({ "../../node_modules/.pnpm/ci-info@4.4.0/n
25681
25681
  }
25682
25682
  __name$5(checkPR$1, "checkPR");
25683
25683
  } });
25684
- var require_command_exists$3 = __commonJS$3({ "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js"(exports$2, module$1) {
25684
+ var require_command_exists$3 = __commonJS$3({ "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/lib/command-exists.js"(exports$1$1, module$1) {
25685
25685
  var exec$3 = __require$2("child_process").exec;
25686
25686
  var execSync$2 = __require$2("child_process").execSync;
25687
25687
  var fs3 = __require$2("fs");
@@ -25762,17 +25762,17 @@ var require_command_exists$3 = __commonJS$3({ "../../node_modules/.pnpm/command-
25762
25762
  }, "cleanInput");
25763
25763
  if (isUsingWindows$1) cleanInput$1 = /* @__PURE__ */ __name$5(function(s) {
25764
25764
  if (/[\\]/.test(s)) {
25765
- var dirname3 = "\"" + path6.dirname(s) + "\"";
25765
+ var dirname4 = "\"" + path6.dirname(s) + "\"";
25766
25766
  var basename2 = "\"" + path6.basename(s) + "\"";
25767
- return dirname3 + ":" + basename2;
25767
+ return dirname4 + ":" + basename2;
25768
25768
  }
25769
25769
  return "\"" + s + "\"";
25770
25770
  }, "cleanInput");
25771
25771
  module$1.exports = /* @__PURE__ */ __name$5(function commandExists(commandName, callback$1) {
25772
25772
  var cleanedCommandName = cleanInput$1(commandName);
25773
- if (!callback$1 && typeof Promise !== "undefined") return new Promise(function(resolve2, reject) {
25773
+ if (!callback$1 && typeof Promise !== "undefined") return new Promise(function(resolve3, reject) {
25774
25774
  commandExists(commandName, function(error51, output) {
25775
- if (output) resolve2(commandName);
25775
+ if (output) resolve3(commandName);
25776
25776
  else reject(error51);
25777
25777
  });
25778
25778
  });
@@ -25785,14 +25785,14 @@ var require_command_exists$3 = __commonJS$3({ "../../node_modules/.pnpm/command-
25785
25785
  else return commandExistsUnixSync$1(commandName, cleanedCommandName);
25786
25786
  };
25787
25787
  } });
25788
- var require_command_exists2$1 = __commonJS$3({ "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/index.js"(exports$2, module$1) {
25788
+ var require_command_exists2$1 = __commonJS$3({ "../../node_modules/.pnpm/command-exists@1.2.9/node_modules/command-exists/index.js"(exports$1$1, module$1) {
25789
25789
  module$1.exports = require_command_exists$3();
25790
25790
  } });
25791
- var require_ini$1 = __commonJS$3({ "../../node_modules/.pnpm/ini@1.3.8/node_modules/ini/ini.js"(exports$2) {
25792
- exports$2.parse = exports$2.decode = decode3;
25793
- exports$2.stringify = exports$2.encode = encode3;
25794
- exports$2.safe = safe;
25795
- exports$2.unsafe = unsafe;
25791
+ var require_ini$1 = __commonJS$3({ "../../node_modules/.pnpm/ini@1.3.8/node_modules/ini/ini.js"(exports$1$1) {
25792
+ exports$1$1.parse = exports$1$1.decode = decode3;
25793
+ exports$1$1.stringify = exports$1$1.encode = encode3;
25794
+ exports$1$1.safe = safe;
25795
+ exports$1$1.unsafe = unsafe;
25796
25796
  var eol = typeof process !== "undefined" && process.platform === "win32" ? "\r\n" : "\n";
25797
25797
  function encode3(obj, opt) {
25798
25798
  var children = [];
@@ -25924,7 +25924,7 @@ var require_ini$1 = __commonJS$3({ "../../node_modules/.pnpm/ini@1.3.8/node_modu
25924
25924
  }
25925
25925
  __name$5(unsafe, "unsafe");
25926
25926
  } });
25927
- var require_strip_json_comments$1 = __commonJS$3({ "../../node_modules/.pnpm/strip-json-comments@2.0.1/node_modules/strip-json-comments/index.js"(exports$2, module$1) {
25927
+ var require_strip_json_comments$1 = __commonJS$3({ "../../node_modules/.pnpm/strip-json-comments@2.0.1/node_modules/strip-json-comments/index.js"(exports$1$1, module$1) {
25928
25928
  var singleComment = 1;
25929
25929
  var multiComment = 2;
25930
25930
  function stripWithoutWhitespace() {
@@ -25983,16 +25983,16 @@ var require_strip_json_comments$1 = __commonJS$3({ "../../node_modules/.pnpm/str
25983
25983
  return ret + (insideComment ? strip(str.substr(offset)) : str.substr(offset));
25984
25984
  };
25985
25985
  } });
25986
- var require_utils$3 = __commonJS$3({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(exports$2) {
25986
+ var require_utils$3 = __commonJS$3({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/lib/utils.js"(exports$1$1) {
25987
25987
  var fs3 = __require$2("fs");
25988
25988
  var ini = require_ini$1();
25989
25989
  var path6 = __require$2("path");
25990
25990
  var stripJsonComments = require_strip_json_comments$1();
25991
- var parse3$3 = exports$2.parse = function(content) {
25991
+ var parse3$3 = exports$1$1.parse = function(content) {
25992
25992
  if (/^\s*{/.test(content)) return JSON.parse(stripJsonComments(content));
25993
25993
  return ini.parse(content);
25994
25994
  };
25995
- var file2 = exports$2.file = function() {
25995
+ var file2 = exports$1$1.file = function() {
25996
25996
  var args = [].slice.call(arguments).filter(function(arg) {
25997
25997
  return arg != null;
25998
25998
  });
@@ -26004,11 +26004,11 @@ var require_utils$3 = __commonJS$3({ "../../node_modules/.pnpm/rc@1.2.8/node_mod
26004
26004
  return;
26005
26005
  }
26006
26006
  };
26007
- exports$2.json = function() {
26007
+ exports$1$1.json = function() {
26008
26008
  var content = file2.apply(null, arguments);
26009
26009
  return content ? parse3$3(content) : null;
26010
26010
  };
26011
- exports$2.env = function(prefix, env2) {
26011
+ exports$1$1.env = function(prefix, env2) {
26012
26012
  env2 = env2 || process.env;
26013
26013
  var obj = {};
26014
26014
  var l = prefix.length;
@@ -26026,7 +26026,7 @@ var require_utils$3 = __commonJS$3({ "../../node_modules/.pnpm/rc@1.2.8/node_mod
26026
26026
  }
26027
26027
  return obj;
26028
26028
  };
26029
- exports$2.find = function() {
26029
+ exports$1$1.find = function() {
26030
26030
  var rel = path6.join.apply(null, [].slice.call(arguments));
26031
26031
  function find2(start, rel2) {
26032
26032
  var file3 = path6.join(start, rel2);
@@ -26041,7 +26041,7 @@ var require_utils$3 = __commonJS$3({ "../../node_modules/.pnpm/rc@1.2.8/node_mod
26041
26041
  return find2(process.cwd(), rel);
26042
26042
  };
26043
26043
  } });
26044
- var require_deep_extend$1 = __commonJS$3({ "../../node_modules/.pnpm/deep-extend@0.6.0/node_modules/deep-extend/lib/deep-extend.js"(exports$2, module$1) {
26044
+ var require_deep_extend$1 = __commonJS$3({ "../../node_modules/.pnpm/deep-extend@0.6.0/node_modules/deep-extend/lib/deep-extend.js"(exports$1$1, module$1) {
26045
26045
  function isSpecificValue(val) {
26046
26046
  return val instanceof Buffer || val instanceof Date || val instanceof RegExp ? true : false;
26047
26047
  }
@@ -26104,7 +26104,7 @@ var require_deep_extend$1 = __commonJS$3({ "../../node_modules/.pnpm/deep-extend
26104
26104
  return target$1;
26105
26105
  };
26106
26106
  } });
26107
- var require_minimist$1 = __commonJS$3({ "../../node_modules/.pnpm/minimist@1.2.6/node_modules/minimist/index.js"(exports$2, module$1) {
26107
+ var require_minimist$1 = __commonJS$3({ "../../node_modules/.pnpm/minimist@1.2.6/node_modules/minimist/index.js"(exports$1$1, module$1) {
26108
26108
  module$1.exports = function(args, opts) {
26109
26109
  if (!opts) opts = {};
26110
26110
  var flags = {
@@ -26279,7 +26279,7 @@ var require_minimist$1 = __commonJS$3({ "../../node_modules/.pnpm/minimist@1.2.6
26279
26279
  }
26280
26280
  __name$5(isConstructorOrProto, "isConstructorOrProto");
26281
26281
  } });
26282
- var require_rc$1 = __commonJS$3({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/index.js"(exports$2, module$1) {
26282
+ var require_rc$1 = __commonJS$3({ "../../node_modules/.pnpm/rc@1.2.8/node_modules/rc/index.js"(exports$1$1, module$1) {
26283
26283
  var cc = require_utils$3();
26284
26284
  var join3 = __require$2("path").join;
26285
26285
  var deepExtend = require_deep_extend$1();
@@ -26323,14 +26323,14 @@ var require_rc$1 = __commonJS$3({ "../../node_modules/.pnpm/rc@1.2.8/node_module
26323
26323
  ]));
26324
26324
  };
26325
26325
  } });
26326
- var require_registry_url$1 = __commonJS$3({ "../../node_modules/.pnpm/registry-url@3.1.0/node_modules/registry-url/index.js"(exports$2, module$1) {
26326
+ var require_registry_url$1 = __commonJS$3({ "../../node_modules/.pnpm/registry-url@3.1.0/node_modules/registry-url/index.js"(exports$1$1, module$1) {
26327
26327
  module$1.exports = function(scope) {
26328
26328
  var rc = require_rc$1()("npm", { registry: "https://registry.npmjs.org/" });
26329
26329
  var url2 = rc[scope + ":registry"] || rc.registry;
26330
26330
  return url2.slice(-1) === "/" ? url2 : url2 + "/";
26331
26331
  };
26332
26332
  } });
26333
- var require_safe_buffer$1 = __commonJS$3({ "../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports$2, module$1) {
26333
+ var require_safe_buffer$1 = __commonJS$3({ "../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js"(exports$1$1, module$1) {
26334
26334
  var buffer$1 = __require$2("buffer");
26335
26335
  var Buffer2 = buffer$1.Buffer;
26336
26336
  function copyProps(src$1, dst) {
@@ -26339,8 +26339,8 @@ var require_safe_buffer$1 = __commonJS$3({ "../../node_modules/.pnpm/safe-buffer
26339
26339
  __name$5(copyProps, "copyProps");
26340
26340
  if (Buffer2.from && Buffer2.alloc && Buffer2.allocUnsafe && Buffer2.allocUnsafeSlow) module$1.exports = buffer$1;
26341
26341
  else {
26342
- copyProps(buffer$1, exports$2);
26343
- exports$2.Buffer = SafeBuffer;
26342
+ copyProps(buffer$1, exports$1$1);
26343
+ exports$1$1.Buffer = SafeBuffer;
26344
26344
  }
26345
26345
  function SafeBuffer(arg, encodingOrOffset, length) {
26346
26346
  return Buffer2(arg, encodingOrOffset, length);
@@ -26369,7 +26369,7 @@ var require_safe_buffer$1 = __commonJS$3({ "../../node_modules/.pnpm/safe-buffer
26369
26369
  return buffer$1.SlowBuffer(size);
26370
26370
  };
26371
26371
  } });
26372
- var require_base64$1 = __commonJS$3({ "../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/base64.js"(exports$2, module$1) {
26372
+ var require_base64$1 = __commonJS$3({ "../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/base64.js"(exports$1$1, module$1) {
26373
26373
  var safeBuffer = require_safe_buffer$1().Buffer;
26374
26374
  function decodeBase64(base643) {
26375
26375
  return safeBuffer.from(base643, "base64").toString("utf8");
@@ -26384,7 +26384,7 @@ var require_base64$1 = __commonJS$3({ "../../node_modules/.pnpm/registry-auth-to
26384
26384
  encodeBase64
26385
26385
  };
26386
26386
  } });
26387
- var require_registry_auth_token$1 = __commonJS$3({ "../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/index.js"(exports$2, module$1) {
26387
+ var require_registry_auth_token$1 = __commonJS$3({ "../../node_modules/.pnpm/registry-auth-token@3.3.2/node_modules/registry-auth-token/index.js"(exports$1$1, module$1) {
26388
26388
  var url2 = __require$2("url");
26389
26389
  var base643 = require_base64$1();
26390
26390
  var decodeBase64 = base643.decodeBase64;
@@ -26459,7 +26459,7 @@ var require_registry_auth_token$1 = __commonJS$3({ "../../node_modules/.pnpm/reg
26459
26459
  }
26460
26460
  __name$5(getTokenForUsernameAndPassword, "getTokenForUsernameAndPassword");
26461
26461
  } });
26462
- var require_update_check$1 = __commonJS$3({ "../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js"(exports$2, module$1) {
26462
+ var require_update_check$1 = __commonJS$3({ "../../node_modules/.pnpm/update-check@1.5.4/node_modules/update-check/index.js"(exports$1$1, module$1) {
26463
26463
  var { URL: URL2 } = __require$2("url");
26464
26464
  var { join: join3 } = __require$2("path");
26465
26465
  var fs3 = __require$2("fs");
@@ -26498,7 +26498,7 @@ var require_update_check$1 = __commonJS$3({ "../../node_modules/.pnpm/update-che
26498
26498
  lastUpdate
26499
26499
  }), "utf8");
26500
26500
  }, "updateCache");
26501
- var loadPackage = /* @__PURE__ */ __name$5((url2, authInfo) => new Promise((resolve2, reject) => {
26501
+ var loadPackage = /* @__PURE__ */ __name$5((url2, authInfo) => new Promise((resolve3, reject) => {
26502
26502
  const options = {
26503
26503
  host: url2.hostname,
26504
26504
  path: url2.pathname,
@@ -26524,7 +26524,7 @@ var require_update_check$1 = __commonJS$3({ "../../node_modules/.pnpm/update-che
26524
26524
  });
26525
26525
  response.on("end", () => {
26526
26526
  try {
26527
- resolve2(JSON.parse(rawData));
26527
+ resolve3(JSON.parse(rawData));
26528
26528
  } catch (e2) {
26529
26529
  reject(e2);
26530
26530
  }
@@ -26625,6 +26625,7 @@ var defaultWranglerConfig$1 = {
26625
26625
  producers: [],
26626
26626
  consumers: []
26627
26627
  },
26628
+ connect: [],
26628
26629
  r2_buckets: [],
26629
26630
  d1_databases: [],
26630
26631
  vectorize: [],
@@ -40540,8 +40541,8 @@ var getSanitizeLogs = getBooleanEnvironmentVariableFactory({
40540
40541
  variableName: "WRANGLER_LOG_SANITIZE",
40541
40542
  defaultValue: true
40542
40543
  });
40543
- var getOutputFileDirectoryFromEnv = getEnvironmentVariableFactory({ variableName: "WRANGLER_OUTPUT_FILE_DIRECTORY" });
40544
- var getOutputFilePathFromEnv = getEnvironmentVariableFactory({ variableName: "WRANGLER_OUTPUT_FILE_PATH" });
40544
+ var getOutputFileDirectoryFromEnv$1 = getEnvironmentVariableFactory({ variableName: "WRANGLER_OUTPUT_FILE_DIRECTORY" });
40545
+ var getOutputFilePathFromEnv$1 = getEnvironmentVariableFactory({ variableName: "WRANGLER_OUTPUT_FILE_PATH" });
40545
40546
  var getCIMatchTag = getEnvironmentVariableFactory({ variableName: "WRANGLER_CI_MATCH_TAG" });
40546
40547
  var getCIOverrideName$1 = getEnvironmentVariableFactory({ variableName: "WRANGLER_CI_OVERRIDE_NAME" });
40547
40548
  var getCIOverrideNetworkModeHost = getEnvironmentVariableFactory({ variableName: "WRANGLER_CI_OVERRIDE_NETWORK_MODE_HOST" });
@@ -41419,6 +41420,7 @@ function normalizeAndValidateEnvironment$1(diagnostics, configPath, rawEnv, isDi
41419
41420
  producers: [],
41420
41421
  consumers: []
41421
41422
  }),
41423
+ connect: notInheritable$1(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "connect", validateConnectHandlers$1(envName), []),
41422
41424
  r2_buckets: notInheritable$1(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "r2_buckets", validateBindingArray$1(envName, validateR2Binding$1), []),
41423
41425
  d1_databases: notInheritable$1(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "d1_databases", validateBindingArray$1(envName, validateD1Binding$1), []),
41424
41426
  vectorize: notInheritable$1(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "vectorize", validateBindingArray$1(envName, validateVectorizeBinding$1), []),
@@ -41461,7 +41463,7 @@ function normalizeAndValidateEnvironment$1(diagnostics, configPath, rawEnv, isDi
41461
41463
  cache: inheritable$1(diagnostics, topLevelEnv, rawEnv, "cache", validateCache$1, void 0),
41462
41464
  compliance_region: inheritable$1(diagnostics, topLevelEnv, rawEnv, "compliance_region", isOneOf$1("public", "fedramp_high"), void 0),
41463
41465
  python_modules: inheritable$1(diagnostics, topLevelEnv, rawEnv, "python_modules", validatePythonModules$1, { exclude: ["**/*.pyc"] }),
41464
- previews: inheritable$1(diagnostics, topLevelEnv, rawEnv, "previews", validatePreviewsConfig$1(envName), void 0)
41466
+ previews: inheritable$1(diagnostics, topLevelEnv, rawEnv, "previews", validatePreviewsConfig$1(envName, configPath), void 0)
41465
41467
  };
41466
41468
  warnIfDurableObjectsHaveNoLifecycleConfig$1(diagnostics, environment.durable_objects, environment.migrations, environment.exports, configPath);
41467
41469
  errorIfMigrationsAndExportsBothSet$1(diagnostics, environment.migrations, environment.exports);
@@ -41768,10 +41770,6 @@ var validateWorkflowBinding$1 = /* @__PURE__ */ __name$5((diagnostics, field, va
41768
41770
  diagnostics.errors.push(`"${field}" bindings should, optionally, have a string "script_name" field but got ${JSON.stringify(value)}.`);
41769
41771
  isValid = false;
41770
41772
  }
41771
- if (!isOptionalProperty$1(value, "remote", "boolean")) {
41772
- diagnostics.errors.push(`"${field}" bindings should, optionally, have a boolean "remote" field but got ${JSON.stringify(value)}.`);
41773
- isValid = false;
41774
- }
41775
41773
  if (hasProperty$1(value, "schedules") && value.schedules !== void 0) if (typeof value.schedules === "string") {
41776
41774
  if (value.schedules.length === 0) {
41777
41775
  diagnostics.errors.push(`"${field}" bindings "schedules" field must not be an empty string.`);
@@ -41810,7 +41808,6 @@ var validateWorkflowBinding$1 = /* @__PURE__ */ __name$5((diagnostics, field, va
41810
41808
  "name",
41811
41809
  "class_name",
41812
41810
  "script_name",
41813
- "remote",
41814
41811
  "limits",
41815
41812
  "schedules"
41816
41813
  ]);
@@ -42005,7 +42002,36 @@ function validateSshPublicKeys$1(diagnostics, field, value, nameRequired) {
42005
42002
  }
42006
42003
  }
42007
42004
  __name$5(validateSshPublicKeys$1, "validateSshPublicKeys");
42008
- function validateContainerApp$1(envName, topLevelName, configPath) {
42005
+ function validatePreviewsContainers$1(envName, configPath) {
42006
+ const innerValidator = validateContainerApp$1(envName, void 0, configPath, { generateDefaultName: false });
42007
+ return (diagnostics, field, value, config2) => {
42008
+ if (Array.isArray(value)) {
42009
+ const nameFields = [...value.entries()].filter(([, entry]) => entry && typeof entry === "object" && "name" in entry).map(([index]) => `"${field}[${index}].name"`);
42010
+ if (nameFields.length > 0) {
42011
+ diagnostics.errors.push(`${nameFields.join(", ")} cannot be set. A preview container's application name is generated from the worker name, preview slug, and Durable Object class name, so that separate previews of the same Worker do not collide. Remove it and identify the container with "class_name".`);
42012
+ return false;
42013
+ }
42014
+ const seenClasses = /* @__PURE__ */ new Set();
42015
+ const duplicateClasses = /* @__PURE__ */ new Set();
42016
+ for (const entry of value) {
42017
+ if (!entry || typeof entry !== "object") continue;
42018
+ if (typeof entry.class_name === "string") {
42019
+ if (seenClasses.has(entry.class_name)) duplicateClasses.add(entry.class_name);
42020
+ seenClasses.add(entry.class_name);
42021
+ }
42022
+ }
42023
+ if (duplicateClasses.size > 0) {
42024
+ const classList = [...duplicateClasses].map((className) => `"${className}"`).join(", ");
42025
+ diagnostics.errors.push(`"${field}" declares more than one container for the Durable Object class ${classList}; each Durable Object class may appear at most once.`);
42026
+ return false;
42027
+ }
42028
+ }
42029
+ return innerValidator(diagnostics, field, value, config2);
42030
+ };
42031
+ }
42032
+ __name$5(validatePreviewsContainers$1, "validatePreviewsContainers");
42033
+ function validateContainerApp$1(envName, topLevelName, configPath, options = {}) {
42034
+ const { generateDefaultName = true } = options;
42009
42035
  return (diagnostics, field, value, config2) => {
42010
42036
  if (!value) return true;
42011
42037
  if (!Array.isArray(value)) {
@@ -42015,7 +42041,7 @@ function validateContainerApp$1(envName, topLevelName, configPath) {
42015
42041
  for (const containerAppOptional of value) {
42016
42042
  validateOptionalProperty$1(diagnostics, field, "class_name", containerAppOptional.class_name, "string");
42017
42043
  validateOptionalProperty$1(diagnostics, field, "name", containerAppOptional.name, "string");
42018
- if (!containerAppOptional.name) if (containerAppOptional.class_name === void 0) diagnostics.errors.push(`"containers.name" is required when "containers.class_name" is not defined, because there is no class name to derive a default name from. Either name this container and reference it from a Durable Object's \`exports\` entry, or set "containers.class_name".`);
42044
+ if (generateDefaultName && !containerAppOptional.name) if (containerAppOptional.class_name === void 0) diagnostics.errors.push(`"containers.name" is required when "containers.class_name" is not defined, because there is no class name to derive a default name from. Either name this container and reference it from a Durable Object's \`exports\` entry, or set "containers.class_name".`);
42019
42045
  else if (!topLevelName) diagnostics.errors.push(`Must have either a top level "name" and "containers.class_name" field defined, or have field "containers.name" defined.`);
42020
42046
  else {
42021
42047
  let name = `${topLevelName}-${containerAppOptional.class_name}`;
@@ -42830,6 +42856,63 @@ var validateConsumer$1 = /* @__PURE__ */ __name$5((diagnostics, field, value, _c
42830
42856
  }
42831
42857
  return isValid;
42832
42858
  }, "validateConsumer");
42859
+ function validateConnectHandlers$1(envName) {
42860
+ return (diagnostics, field, value, config2) => {
42861
+ if (value === void 0) return true;
42862
+ const fieldPath = config2 === void 0 ? `${field}` : `env.${envName}.${field}`;
42863
+ if (!Array.isArray(value)) {
42864
+ diagnostics.errors.push(`The field "${fieldPath}" should be an array but got ${JSON.stringify(value)}.`);
42865
+ return false;
42866
+ }
42867
+ let isValid = true;
42868
+ for (let i$1 = 0; i$1 < value.length; i$1++) if (!validateConnectHandler$1(diagnostics, `${fieldPath}[${i$1}]`, value[i$1], config2)) isValid = false;
42869
+ const firstIndexByKey = /* @__PURE__ */ new Map();
42870
+ for (let i$1 = 0; i$1 < value.length; i$1++) {
42871
+ const handler = value[i$1];
42872
+ if (typeof handler !== "object" || handler === null || typeof handler.port !== "number" || typeof handler.protocol !== "string") continue;
42873
+ const { protocol, port } = handler;
42874
+ const key = `${protocol}:${port}`;
42875
+ const firstIndex = firstIndexByKey.get(key);
42876
+ if (firstIndex !== void 0) {
42877
+ diagnostics.errors.push(`"${fieldPath}[${i$1}]" has the same "protocol" (${protocol}) and "port" (${port}) as "${fieldPath}[${firstIndex}]". Each entry in "connect" must use a unique protocol/port combination.`);
42878
+ isValid = false;
42879
+ } else firstIndexByKey.set(key, i$1);
42880
+ }
42881
+ return isValid;
42882
+ };
42883
+ }
42884
+ __name$5(validateConnectHandlers$1, "validateConnectHandlers");
42885
+ var validateConnectHandler$1 = /* @__PURE__ */ __name$5((diagnostics, field, value) => {
42886
+ if (typeof value !== "object" || value === null) {
42887
+ diagnostics.errors.push(`"${field}" should be an object, but got ${JSON.stringify(value)}`);
42888
+ return false;
42889
+ }
42890
+ let isValid = true;
42891
+ if (!validateAdditionalProperties$1(diagnostics, field, Object.keys(value), [
42892
+ "protocol",
42893
+ "port",
42894
+ "address"
42895
+ ])) isValid = false;
42896
+ if ("protocol" in value && value.protocol !== "tcp") {
42897
+ diagnostics.errors.push(`"${field}" should have a "protocol" field of "tcp" but got ${JSON.stringify(value.protocol)}.`);
42898
+ isValid = false;
42899
+ } else if (!("protocol" in value)) {
42900
+ diagnostics.errors.push(`"${field}" should have a "protocol" field of "tcp" but got ${JSON.stringify(value)}.`);
42901
+ isValid = false;
42902
+ }
42903
+ if (!isRequiredProperty$1(value, "port", "number")) {
42904
+ diagnostics.errors.push(`"${field}" should have a number "port" field but got ${JSON.stringify(value)}.`);
42905
+ isValid = false;
42906
+ } else if (!Number.isInteger(value.port) || value.port < 1 || value.port > 65535) {
42907
+ diagnostics.errors.push(`"${field}" should have an integer "port" field between 1 and 65535 but got ${JSON.stringify(value)}.`);
42908
+ isValid = false;
42909
+ }
42910
+ if (!isOptionalProperty$1(value, "address", "string")) {
42911
+ diagnostics.errors.push(`"${field}" should, optionally, have a string "address" field but got ${JSON.stringify(value)}.`);
42912
+ isValid = false;
42913
+ }
42914
+ return isValid;
42915
+ }, "validateConnectHandler");
42833
42916
  var validateCompatibilityDate$1 = /* @__PURE__ */ __name$5((diagnostics, field, value) => {
42834
42917
  if (value === void 0) return true;
42835
42918
  if (typeof value !== "string") {
@@ -43011,7 +43094,7 @@ function normalizeAndValidateLimits$1(diagnostics, topLevelEnv, rawEnv) {
43011
43094
  return inheritable$1(diagnostics, topLevelEnv, rawEnv, "limits", () => true, void 0);
43012
43095
  }
43013
43096
  __name$5(normalizeAndValidateLimits$1, "normalizeAndValidateLimits");
43014
- var validatePreviewsConfig$1 = /* @__PURE__ */ __name$5((envName) => (diagnostics, field, value) => {
43097
+ var validatePreviewsConfig$1 = /* @__PURE__ */ __name$5((envName, configPath) => (diagnostics, field, value) => {
43015
43098
  if (value === void 0) return true;
43016
43099
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
43017
43100
  diagnostics.errors.push(`The field "${field}" should be an object but got ${JSON.stringify(value)}.`);
@@ -43052,6 +43135,7 @@ var validatePreviewsConfig$1 = /* @__PURE__ */ __name$5((envName) => (diagnostic
43052
43135
  "ratelimits",
43053
43136
  "vpc_services",
43054
43137
  "version_metadata",
43138
+ "containers",
43055
43139
  "logpush",
43056
43140
  "observability",
43057
43141
  "limits",
@@ -43089,6 +43173,7 @@ var validatePreviewsConfig$1 = /* @__PURE__ */ __name$5((envName) => (diagnostic
43089
43173
  isValid = validateBindingArray$1(envName, validateRateLimitBinding$1)(diagnostics, `${field}.ratelimits`, previews.ratelimits, void 0) && isValid;
43090
43174
  isValid = validateBindingArray$1(envName, validateVpcServiceBinding$1)(diagnostics, `${field}.vpc_services`, previews.vpc_services, void 0) && isValid;
43091
43175
  if (previews.version_metadata !== void 0) isValid = validateVersionMetadataBinding$1(envName)(diagnostics, `${field}.version_metadata`, previews.version_metadata, void 0) && isValid;
43176
+ if (previews.containers !== void 0) isValid = validatePreviewsContainers$1(envName, configPath)(diagnostics, `${field}.containers`, previews.containers, void 0) && isValid;
43092
43177
  isValid = isBoolean$1(diagnostics, `${field}.logpush`, previews.logpush, void 0) && isValid;
43093
43178
  isValid = validateObservability$1(diagnostics, `${field}.observability`, previews.observability, void 0) && isValid;
43094
43179
  if (previews.limits) {
@@ -43381,11 +43466,11 @@ var validateCache$1 = /* @__PURE__ */ __name$5((diagnostics, field, value) => {
43381
43466
  isValid = validateAdditionalProperties$1(diagnostics, field, Object.keys(val), ["enabled", "cross_version_cache"]) && isValid;
43382
43467
  return isValid;
43383
43468
  }, "validateCache");
43384
- function warnIfDurableObjectsHaveNoLifecycleConfig$1(diagnostics, durableObjects, migrations, exports$2, configPath) {
43469
+ function warnIfDurableObjectsHaveNoLifecycleConfig$1(diagnostics, durableObjects, migrations, exports$1$1, configPath) {
43385
43470
  if (!Array.isArray(durableObjects.bindings) || durableObjects.bindings.length === 0) return;
43386
43471
  const exportedDurableObjects = durableObjects.bindings.filter((binding) => !binding.script_name);
43387
43472
  const exportsCovers = /* @__PURE__ */ __name$5((className) => {
43388
- const entry = exports$2?.[className];
43473
+ const entry = exports$1$1?.[className];
43389
43474
  if (entry === void 0 || entry.type !== "durable-object") return false;
43390
43475
  const state = entry.state ?? "created";
43391
43476
  return state === "created" || state === "expecting-transfer";
@@ -43407,11 +43492,11 @@ function warnIfDurableObjectsHaveNoLifecycleConfig$1(diagnostics, durableObjects
43407
43492
  \`\`\``);
43408
43493
  }
43409
43494
  __name$5(warnIfDurableObjectsHaveNoLifecycleConfig$1, "warnIfDurableObjectsHaveNoLifecycleConfig");
43410
- function errorIfMigrationsAndExportsBothSet$1(diagnostics, migrations, exports$2) {
43411
- if (migrations.length > 0 && exports$2 !== void 0 && Object.values(exports$2).some((entry) => entry.type === "durable-object")) diagnostics.errors.push(`\`migrations\` and \`exports\` are mutually exclusive. Choose one or the other to declare your Durable Object lifecycle, but not both.`);
43495
+ function errorIfMigrationsAndExportsBothSet$1(diagnostics, migrations, exports$1$1) {
43496
+ if (migrations.length > 0 && exports$1$1 !== void 0 && Object.values(exports$1$1).some((entry) => entry.type === "durable-object")) diagnostics.errors.push(`\`migrations\` and \`exports\` are mutually exclusive. Choose one or the other to declare your Durable Object lifecycle, but not both.`);
43412
43497
  }
43413
43498
  __name$5(errorIfMigrationsAndExportsBothSet$1, "errorIfMigrationsAndExportsBothSet");
43414
- function validateContainerExportLinks$1(diagnostics, containers, exports$2, containersDeclaredElsewhere) {
43499
+ function validateContainerExportLinks$1(diagnostics, containers, exports$1$1, containersDeclaredElsewhere) {
43415
43500
  if (containers !== void 0 && !Array.isArray(containers)) return;
43416
43501
  if (containers === void 0 && containersDeclaredElsewhere) return;
43417
43502
  const containersByName = /* @__PURE__ */ new Map();
@@ -43429,7 +43514,7 @@ function validateContainerExportLinks$1(diagnostics, containers, exports$2, cont
43429
43514
  }
43430
43515
  const overSubscribedClassNames = new Set([...containerCountByClassName].filter(([, count]) => count > 1).map(([className]) => className));
43431
43516
  for (const className of [...overSubscribedClassNames].sort()) diagnostics.errors.push(`More than one container is attached to the Durable Object "${className}". A Durable Object can only have one container attached to it.`);
43432
- const durableObjectExports = getDurableObjectExports$2(exports$2);
43517
+ const durableObjectExports = getDurableObjectExports$2(exports$1$1);
43433
43518
  const liveExportClassNames = /* @__PURE__ */ new Set();
43434
43519
  const classNamesByContainerName = /* @__PURE__ */ new Map();
43435
43520
  for (const [className, entry] of Object.entries(durableObjectExports)) {
@@ -43443,7 +43528,7 @@ function validateContainerExportLinks$1(diagnostics, containers, exports$2, cont
43443
43528
  classNamesByContainerName.set(entry.container, [...classNamesByContainerName.get(entry.container) ?? [], className]);
43444
43529
  }
43445
43530
  for (const [containerName, classNames] of classNamesByContainerName) if (classNames.length > 1) diagnostics.errors.push(`The container "${containerName}" is referenced by more than one Durable Object export (${classNames.join(", ")}). A container can only back a single Durable Object.`);
43446
- const containerNameToClassName = getContainerNameToClassNameMap$2(exports$2);
43531
+ const containerNameToClassName = getContainerNameToClassNameMap$2(exports$1$1);
43447
43532
  const usesDurableObjectExports = Object.keys(durableObjectExports).length > 0;
43448
43533
  for (const container of containers ?? []) {
43449
43534
  if (typeof container.name !== "string") continue;
@@ -43534,7 +43619,7 @@ var BINDING_LOCAL_SUPPORT$1 = {
43534
43619
  kv_namespace: "local-and-remote",
43535
43620
  r2_bucket: "local-and-remote",
43536
43621
  d1: "local-and-remote",
43537
- workflow: "local-and-remote",
43622
+ workflow: "local-only",
43538
43623
  browser: "local-and-remote",
43539
43624
  images: "local-and-remote",
43540
43625
  stream: "local-and-remote",
@@ -43649,6 +43734,10 @@ function getPackagePath$1(packageName, projectPath) {
43649
43734
  try {
43650
43735
  return path2__default.dirname(__require$2.resolve(packageName, { paths: [projectPath] }));
43651
43736
  } catch {}
43737
+ try {
43738
+ const candidate = path2__default.join(projectPath, "node_modules", packageName, "package.json");
43739
+ if (statSync(candidate).isFile()) return path2__default.dirname(candidate);
43740
+ } catch {}
43652
43741
  }
43653
43742
  __name$5(getPackagePath$1, "getPackagePath");
43654
43743
  function isPackageInstalled$1(packageName, projectPath) {
@@ -44544,7 +44633,7 @@ function terminateCloudflared$1(cloudflared) {
44544
44633
  }
44545
44634
  __name$5(terminateCloudflared$1, "terminateCloudflared");
44546
44635
  function waitForQuickTunnelReady$1(cloudflared, timeoutMs, options) {
44547
- return new Promise((resolve2, reject) => {
44636
+ return new Promise((resolve3, reject) => {
44548
44637
  let resolved = false;
44549
44638
  let stderrOutput = "";
44550
44639
  const logger$1 = options?.logger;
@@ -44565,7 +44654,7 @@ function waitForQuickTunnelReady$1(cloudflared, timeoutMs, options) {
44565
44654
  if (match && !resolved) {
44566
44655
  resolved = true;
44567
44656
  clearTimeout(timeoutId);
44568
- resolve2({
44657
+ resolve3({
44569
44658
  mode: "quick",
44570
44659
  publicUrl: new URL(match[0])
44571
44660
  });
@@ -44884,7 +44973,7 @@ async function fetchLatestNpmVersion(name, version2) {
44884
44973
  __name$5(fetchLatestNpmVersion, "fetchLatestNpmVersion");
44885
44974
  async function openInBrowser(url2, logger$1) {
44886
44975
  try {
44887
- const { default: open$1 } = await import("./open-PBXRGS4R-BtaaKU2N.mjs");
44976
+ const { default: open$1 } = await import("./open-PBXRGS4R-rCTko7Ic.mjs");
44888
44977
  (await open$1(url2)).on("error", (err) => {
44889
44978
  handleBrowserOpenError$1(url2, err, logger$1);
44890
44979
  });
@@ -44903,6 +44992,31 @@ ${url2}`);
44903
44992
  logger$1.debug(err instanceof Error ? err.stack ?? String(err) : String(err));
44904
44993
  }
44905
44994
  __name$5(handleBrowserOpenError$1, "handleBrowserOpenError");
44995
+ function writeOutput$1(entry) {
44996
+ if (outputFilePath$1 === void 0) outputFilePath$1 = getOutputFilePath$1();
44997
+ if (outputFilePath$1 !== null) {
44998
+ mkdirSync(dirname(outputFilePath$1), { recursive: true });
44999
+ const entryJSON = JSON.stringify({
45000
+ ...entry,
45001
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
45002
+ });
45003
+ appendFileSync(outputFilePath$1, entryJSON + "\n");
45004
+ }
45005
+ }
45006
+ __name$5(writeOutput$1, "writeOutput");
45007
+ function clearOutputFilePath$1() {
45008
+ outputFilePath$1 = void 0;
45009
+ }
45010
+ __name$5(clearOutputFilePath$1, "clearOutputFilePath");
45011
+ var outputFilePath$1 = void 0;
45012
+ function getOutputFilePath$1() {
45013
+ const outputFilePathFromEnv = getOutputFilePathFromEnv$1();
45014
+ if (outputFilePathFromEnv) return outputFilePathFromEnv;
45015
+ const outputFileDirectoryFromEnv = getOutputFileDirectoryFromEnv$1();
45016
+ if (outputFileDirectoryFromEnv) return resolve(outputFileDirectoryFromEnv, `wrangler-output-${(/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-").replace(".", "_").replace("T", "_").replace("Z", "")}-${randomBytes(3).toString("hex")}.json`);
45017
+ return null;
45018
+ }
45019
+ __name$5(getOutputFilePath$1, "getOutputFilePath");
44906
45020
  var MAX_ATTEMPTS$1 = 3;
44907
45021
  var MAX_RETRY_AFTER_MS$1 = 6e4;
44908
45022
  async function retryOnAPIFailure(action, logger$1, backoff = 0, attempts = MAX_ATTEMPTS$1, abortSignal) {
@@ -49262,7 +49376,7 @@ function assertIsPreview(ctx) {
49262
49376
  }
49263
49377
 
49264
49378
  //#endregion
49265
- //#region ../config/dist/public-CgtRnd2s.mjs
49379
+ //#region ../config/dist/public-BwQqexwo.mjs
49266
49380
  const DEFINITION = Symbol.for("@cloudflare/config:definition");
49267
49381
  /**
49268
49382
  * Unwrap an authored config from its value / promise / function shape, awaiting
@@ -53838,7 +53952,15 @@ const R2BindingSchema = strictObject$1({
53838
53952
  type: literal$2("r2"),
53839
53953
  name: string$1().optional(),
53840
53954
  jurisdiction: string$1().optional(),
53841
- remote: boolean$1().optional()
53955
+ remote: boolean$1().optional(),
53956
+ localDev: strictObject$1({ experimentalS3Credentials: object$1({
53957
+ accessKeyId: string$1(),
53958
+ secretAccessKey: string$1()
53959
+ }).optional() }).optional()
53960
+ });
53961
+ const AnalyticsEngineDatasetBindingSchema = strictObject$1({
53962
+ type: literal$2("analytics-engine-dataset"),
53963
+ name: string$1().optional()
53842
53964
  });
53843
53965
  const FlagshipBindingSchema = strictObject$1({
53844
53966
  type: literal$2("flagship"),
@@ -53870,10 +53992,7 @@ const KnownBindingSchema = discriminatedUnion$1("type", [
53870
53992
  namespace: string$1(),
53871
53993
  remote: boolean$1().optional()
53872
53994
  }),
53873
- strictObject$1({
53874
- type: literal$2("analytics-engine-dataset"),
53875
- name: string$1().optional()
53876
- }),
53995
+ AnalyticsEngineDatasetBindingSchema,
53877
53996
  strictObject$1({
53878
53997
  type: literal$2("artifacts"),
53879
53998
  namespace: string$1(),
@@ -54153,6 +54272,12 @@ const TriggerSchema = discriminatedUnion$1("type", [
54153
54272
  strictObject$1({
54154
54273
  type: literal$2("scheduled"),
54155
54274
  schedule: string$1()
54275
+ }),
54276
+ strictObject$1({
54277
+ type: literal$2("connect"),
54278
+ protocol: _enum$1(["tcp"]),
54279
+ port: number$1(),
54280
+ address: string$1().optional()
54156
54281
  })
54157
54282
  ]);
54158
54283
  const UnsafeSchema = strictObject$1({
@@ -54338,43 +54463,43 @@ function hasKnownExportType$1(entry) {
54338
54463
  return type === "durable-object" || type === "worker";
54339
54464
  }
54340
54465
  __name$4(hasKnownExportType$1, "hasKnownExportType");
54341
- function partitionExports$1(exports$2) {
54466
+ function partitionExports$1(exports$1$1) {
54342
54467
  const partitioned = {
54343
54468
  "durable-object": {},
54344
54469
  worker: {}
54345
54470
  };
54346
- if (exports$2 === void 0) return partitioned;
54347
- for (const [name, entry] of Object.entries(exports$2)) {
54471
+ if (exports$1$1 === void 0) return partitioned;
54472
+ for (const [name, entry] of Object.entries(exports$1$1)) {
54348
54473
  if (!hasKnownExportType$1(entry)) continue;
54349
54474
  partitioned[entry.type][name] = entry;
54350
54475
  }
54351
54476
  return partitioned;
54352
54477
  }
54353
54478
  __name$4(partitionExports$1, "partitionExports");
54354
- function getDurableObjectExports$1(exports$2) {
54355
- return partitionExports$1(exports$2)["durable-object"];
54479
+ function getDurableObjectExports$1(exports$1$1) {
54480
+ return partitionExports$1(exports$1$1)["durable-object"];
54356
54481
  }
54357
54482
  __name$4(getDurableObjectExports$1, "getDurableObjectExports");
54358
- function hasDurableObjectExports$1(exports$2) {
54359
- return Object.keys(getDurableObjectExports$1(exports$2)).length > 0;
54483
+ function hasDurableObjectExports$1(exports$1$1) {
54484
+ return Object.keys(getDurableObjectExports$1(exports$1$1)).length > 0;
54360
54485
  }
54361
54486
  __name$4(hasDurableObjectExports$1, "hasDurableObjectExports");
54362
- function getContainerNameToClassNameMap$1(exports$2) {
54487
+ function getContainerNameToClassNameMap$1(exports$1$1) {
54363
54488
  const containerNameToClassName = /* @__PURE__ */ new Map();
54364
- for (const [className, entry] of Object.entries(getDurableObjectExports$1(exports$2))) if ("container" in entry && typeof entry.container === "string" && !containerNameToClassName.has(entry.container)) containerNameToClassName.set(entry.container, className);
54489
+ for (const [className, entry] of Object.entries(getDurableObjectExports$1(exports$1$1))) if ("container" in entry && typeof entry.container === "string" && !containerNameToClassName.has(entry.container)) containerNameToClassName.set(entry.container, className);
54365
54490
  return containerNameToClassName;
54366
54491
  }
54367
54492
  __name$4(getContainerNameToClassNameMap$1, "getContainerNameToClassNameMap");
54368
- function resolveContainerClassName$2(container, exports$2) {
54493
+ function resolveContainerClassName$2(container, exports$1$1) {
54369
54494
  if (container.class_name !== void 0) return container.class_name;
54370
54495
  if (container.name === void 0) return;
54371
- return getContainerNameToClassNameMap$1(exports$2).get(container.name);
54496
+ return getContainerNameToClassNameMap$1(exports$1$1).get(container.name);
54372
54497
  }
54373
54498
  __name$4(resolveContainerClassName$2, "resolveContainerClassName");
54374
- function getContainerDurableObjectClassNames$1(containers, exports$2) {
54499
+ function getContainerDurableObjectClassNames$1(containers, exports$1$1) {
54375
54500
  const classNames = /* @__PURE__ */ new Set();
54376
54501
  for (const container of containers ?? []) {
54377
- const className = resolveContainerClassName$2(container, exports$2);
54502
+ const className = resolveContainerClassName$2(container, exports$1$1);
54378
54503
  if (className !== void 0) classNames.add(className);
54379
54504
  }
54380
54505
  return classNames;
@@ -57109,14 +57234,17 @@ function convertBindingsAndAssets(config$3, result) {
57109
57234
  simple: binding.simple
57110
57235
  });
57111
57236
  break;
57112
- case "r2":
57237
+ case "r2": {
57238
+ const experimentalS3Credentials = binding.localDev?.experimentalS3Credentials;
57113
57239
  r2Buckets.push(omitUndefined({
57114
57240
  binding: name,
57115
57241
  bucket_name: binding.name,
57116
57242
  jurisdiction: binding.jurisdiction,
57117
- remote: binding.remote
57243
+ remote: binding.remote,
57244
+ local_dev: experimentalS3Credentials === void 0 ? void 0 : { experimental_s3_credentials: experimentalS3Credentials }
57118
57245
  }));
57119
57246
  break;
57247
+ }
57120
57248
  case "secret":
57121
57249
  secretsRequired.push(name);
57122
57250
  break;
@@ -57300,6 +57428,7 @@ function convertTriggers(config$3, result) {
57300
57428
  const crons = [];
57301
57429
  const routes = result.routes ? [...result.routes] : [];
57302
57430
  const queueConsumers = result.queues?.consumers ? [...result.queues.consumers] : [];
57431
+ const connectHandlers = result.connect ? [...result.connect] : [];
57303
57432
  let addresses;
57304
57433
  for (const trigger of triggers$1) switch (trigger.type) {
57305
57434
  case "email":
@@ -57332,6 +57461,13 @@ function convertTriggers(config$3, result) {
57332
57461
  visibility_timeout_ms: trigger.visibilityTimeoutMs
57333
57462
  }));
57334
57463
  break;
57464
+ case "connect":
57465
+ connectHandlers.push(omitUndefined({
57466
+ protocol: trigger.protocol,
57467
+ port: trigger.port,
57468
+ address: trigger.address
57469
+ }));
57470
+ break;
57335
57471
  }
57336
57472
  if (crons.length) result.triggers = { crons };
57337
57473
  if (routes.length) result.routes = routes;
@@ -57339,6 +57475,7 @@ function convertTriggers(config$3, result) {
57339
57475
  ...result.queues ?? {},
57340
57476
  consumers: queueConsumers
57341
57477
  };
57478
+ if (connectHandlers.length) result.connect = connectHandlers;
57342
57479
  if (addresses !== void 0) result.addresses = addresses;
57343
57480
  }
57344
57481
  function convertDomains(config$3, result) {
@@ -82520,17 +82657,17 @@ var require_command_exists$2 = __commonJS({ "../../node_modules/.pnpm/command-ex
82520
82657
  }, "cleanInput");
82521
82658
  if (isUsingWindows$1) cleanInput$1 = /* @__PURE__ */ __name$3(function(s) {
82522
82659
  if (/[\\]/.test(s)) {
82523
- var dirname3 = "\"" + path6.dirname(s) + "\"";
82660
+ var dirname4 = "\"" + path6.dirname(s) + "\"";
82524
82661
  var basename2 = "\"" + path6.basename(s) + "\"";
82525
- return dirname3 + ":" + basename2;
82662
+ return dirname4 + ":" + basename2;
82526
82663
  }
82527
82664
  return "\"" + s + "\"";
82528
82665
  }, "cleanInput");
82529
82666
  module$1.exports = /* @__PURE__ */ __name$3(function commandExists(commandName, callback$1) {
82530
82667
  var cleanedCommandName = cleanInput$1(commandName);
82531
- if (!callback$1 && typeof Promise !== "undefined") return new Promise(function(resolve2, reject) {
82668
+ if (!callback$1 && typeof Promise !== "undefined") return new Promise(function(resolve3, reject) {
82532
82669
  commandExists(commandName, function(error51, output) {
82533
- if (output) resolve2(commandName);
82670
+ if (output) resolve3(commandName);
82534
82671
  else reject(error51);
82535
82672
  });
82536
82673
  });
@@ -83256,7 +83393,7 @@ var require_update_check = __commonJS({ "../../node_modules/.pnpm/update-check@1
83256
83393
  lastUpdate
83257
83394
  }), "utf8");
83258
83395
  }, "updateCache");
83259
- var loadPackage = /* @__PURE__ */ __name$3((url2, authInfo) => new Promise((resolve2, reject) => {
83396
+ var loadPackage = /* @__PURE__ */ __name$3((url2, authInfo) => new Promise((resolve3, reject) => {
83260
83397
  const options = {
83261
83398
  host: url2.hostname,
83262
83399
  path: url2.pathname,
@@ -83282,7 +83419,7 @@ var require_update_check = __commonJS({ "../../node_modules/.pnpm/update-check@1
83282
83419
  });
83283
83420
  response.on("end", () => {
83284
83421
  try {
83285
- resolve2(JSON.parse(rawData));
83422
+ resolve3(JSON.parse(rawData));
83286
83423
  } catch (e2) {
83287
83424
  reject(e2);
83288
83425
  }
@@ -83383,6 +83520,7 @@ var defaultWranglerConfig = {
83383
83520
  producers: [],
83384
83521
  consumers: []
83385
83522
  },
83523
+ connect: [],
83386
83524
  r2_buckets: [],
83387
83525
  d1_databases: [],
83388
83526
  vectorize: [],
@@ -97296,8 +97434,8 @@ getBooleanEnvironmentVariableFactory$1({
97296
97434
  variableName: "WRANGLER_LOG_SANITIZE",
97297
97435
  defaultValue: true
97298
97436
  });
97299
- getEnvironmentVariableFactory$1({ variableName: "WRANGLER_OUTPUT_FILE_DIRECTORY" });
97300
- getEnvironmentVariableFactory$1({ variableName: "WRANGLER_OUTPUT_FILE_PATH" });
97437
+ var getOutputFileDirectoryFromEnv = getEnvironmentVariableFactory$1({ variableName: "WRANGLER_OUTPUT_FILE_DIRECTORY" });
97438
+ var getOutputFilePathFromEnv = getEnvironmentVariableFactory$1({ variableName: "WRANGLER_OUTPUT_FILE_PATH" });
97301
97439
  getEnvironmentVariableFactory$1({ variableName: "WRANGLER_CI_MATCH_TAG" });
97302
97440
  var getCIOverrideName = getEnvironmentVariableFactory$1({ variableName: "WRANGLER_CI_OVERRIDE_NAME" });
97303
97441
  getEnvironmentVariableFactory$1({ variableName: "WRANGLER_CI_OVERRIDE_NETWORK_MODE_HOST" });
@@ -98175,6 +98313,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
98175
98313
  producers: [],
98176
98314
  consumers: []
98177
98315
  }),
98316
+ connect: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "connect", validateConnectHandlers(envName), []),
98178
98317
  r2_buckets: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "r2_buckets", validateBindingArray(envName, validateR2Binding), []),
98179
98318
  d1_databases: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "d1_databases", validateBindingArray(envName, validateD1Binding), []),
98180
98319
  vectorize: notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, "vectorize", validateBindingArray(envName, validateVectorizeBinding), []),
@@ -98217,7 +98356,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
98217
98356
  cache: inheritable(diagnostics, topLevelEnv, rawEnv, "cache", validateCache, void 0),
98218
98357
  compliance_region: inheritable(diagnostics, topLevelEnv, rawEnv, "compliance_region", isOneOf("public", "fedramp_high"), void 0),
98219
98358
  python_modules: inheritable(diagnostics, topLevelEnv, rawEnv, "python_modules", validatePythonModules, { exclude: ["**/*.pyc"] }),
98220
- previews: inheritable(diagnostics, topLevelEnv, rawEnv, "previews", validatePreviewsConfig(envName), void 0)
98359
+ previews: inheritable(diagnostics, topLevelEnv, rawEnv, "previews", validatePreviewsConfig(envName, configPath), void 0)
98221
98360
  };
98222
98361
  warnIfDurableObjectsHaveNoLifecycleConfig(diagnostics, environment.durable_objects, environment.migrations, environment.exports, configPath);
98223
98362
  errorIfMigrationsAndExportsBothSet(diagnostics, environment.migrations, environment.exports);
@@ -98524,10 +98663,6 @@ var validateWorkflowBinding = /* @__PURE__ */ __name$3((diagnostics, field, valu
98524
98663
  diagnostics.errors.push(`"${field}" bindings should, optionally, have a string "script_name" field but got ${JSON.stringify(value)}.`);
98525
98664
  isValid = false;
98526
98665
  }
98527
- if (!isOptionalProperty(value, "remote", "boolean")) {
98528
- diagnostics.errors.push(`"${field}" bindings should, optionally, have a boolean "remote" field but got ${JSON.stringify(value)}.`);
98529
- isValid = false;
98530
- }
98531
98666
  if (hasProperty(value, "schedules") && value.schedules !== void 0) if (typeof value.schedules === "string") {
98532
98667
  if (value.schedules.length === 0) {
98533
98668
  diagnostics.errors.push(`"${field}" bindings "schedules" field must not be an empty string.`);
@@ -98566,7 +98701,6 @@ var validateWorkflowBinding = /* @__PURE__ */ __name$3((diagnostics, field, valu
98566
98701
  "name",
98567
98702
  "class_name",
98568
98703
  "script_name",
98569
- "remote",
98570
98704
  "limits",
98571
98705
  "schedules"
98572
98706
  ]);
@@ -98761,7 +98895,36 @@ function validateSshPublicKeys(diagnostics, field, value, nameRequired) {
98761
98895
  }
98762
98896
  }
98763
98897
  __name$3(validateSshPublicKeys, "validateSshPublicKeys");
98764
- function validateContainerApp(envName, topLevelName, configPath) {
98898
+ function validatePreviewsContainers(envName, configPath) {
98899
+ const innerValidator = validateContainerApp(envName, void 0, configPath, { generateDefaultName: false });
98900
+ return (diagnostics, field, value, config2) => {
98901
+ if (Array.isArray(value)) {
98902
+ const nameFields = [...value.entries()].filter(([, entry]) => entry && typeof entry === "object" && "name" in entry).map(([index]) => `"${field}[${index}].name"`);
98903
+ if (nameFields.length > 0) {
98904
+ diagnostics.errors.push(`${nameFields.join(", ")} cannot be set. A preview container's application name is generated from the worker name, preview slug, and Durable Object class name, so that separate previews of the same Worker do not collide. Remove it and identify the container with "class_name".`);
98905
+ return false;
98906
+ }
98907
+ const seenClasses = /* @__PURE__ */ new Set();
98908
+ const duplicateClasses = /* @__PURE__ */ new Set();
98909
+ for (const entry of value) {
98910
+ if (!entry || typeof entry !== "object") continue;
98911
+ if (typeof entry.class_name === "string") {
98912
+ if (seenClasses.has(entry.class_name)) duplicateClasses.add(entry.class_name);
98913
+ seenClasses.add(entry.class_name);
98914
+ }
98915
+ }
98916
+ if (duplicateClasses.size > 0) {
98917
+ const classList = [...duplicateClasses].map((className) => `"${className}"`).join(", ");
98918
+ diagnostics.errors.push(`"${field}" declares more than one container for the Durable Object class ${classList}; each Durable Object class may appear at most once.`);
98919
+ return false;
98920
+ }
98921
+ }
98922
+ return innerValidator(diagnostics, field, value, config2);
98923
+ };
98924
+ }
98925
+ __name$3(validatePreviewsContainers, "validatePreviewsContainers");
98926
+ function validateContainerApp(envName, topLevelName, configPath, options = {}) {
98927
+ const { generateDefaultName = true } = options;
98765
98928
  return (diagnostics, field, value, config2) => {
98766
98929
  if (!value) return true;
98767
98930
  if (!Array.isArray(value)) {
@@ -98771,7 +98934,7 @@ function validateContainerApp(envName, topLevelName, configPath) {
98771
98934
  for (const containerAppOptional of value) {
98772
98935
  validateOptionalProperty(diagnostics, field, "class_name", containerAppOptional.class_name, "string");
98773
98936
  validateOptionalProperty(diagnostics, field, "name", containerAppOptional.name, "string");
98774
- if (!containerAppOptional.name) if (containerAppOptional.class_name === void 0) diagnostics.errors.push(`"containers.name" is required when "containers.class_name" is not defined, because there is no class name to derive a default name from. Either name this container and reference it from a Durable Object's \`exports\` entry, or set "containers.class_name".`);
98937
+ if (generateDefaultName && !containerAppOptional.name) if (containerAppOptional.class_name === void 0) diagnostics.errors.push(`"containers.name" is required when "containers.class_name" is not defined, because there is no class name to derive a default name from. Either name this container and reference it from a Durable Object's \`exports\` entry, or set "containers.class_name".`);
98775
98938
  else if (!topLevelName) diagnostics.errors.push(`Must have either a top level "name" and "containers.class_name" field defined, or have field "containers.name" defined.`);
98776
98939
  else {
98777
98940
  let name = `${topLevelName}-${containerAppOptional.class_name}`;
@@ -99586,6 +99749,63 @@ var validateConsumer = /* @__PURE__ */ __name$3((diagnostics, field, value, _con
99586
99749
  }
99587
99750
  return isValid;
99588
99751
  }, "validateConsumer");
99752
+ function validateConnectHandlers(envName) {
99753
+ return (diagnostics, field, value, config2) => {
99754
+ if (value === void 0) return true;
99755
+ const fieldPath = config2 === void 0 ? `${field}` : `env.${envName}.${field}`;
99756
+ if (!Array.isArray(value)) {
99757
+ diagnostics.errors.push(`The field "${fieldPath}" should be an array but got ${JSON.stringify(value)}.`);
99758
+ return false;
99759
+ }
99760
+ let isValid = true;
99761
+ for (let i$1 = 0; i$1 < value.length; i$1++) if (!validateConnectHandler(diagnostics, `${fieldPath}[${i$1}]`, value[i$1], config2)) isValid = false;
99762
+ const firstIndexByKey = /* @__PURE__ */ new Map();
99763
+ for (let i$1 = 0; i$1 < value.length; i$1++) {
99764
+ const handler = value[i$1];
99765
+ if (typeof handler !== "object" || handler === null || typeof handler.port !== "number" || typeof handler.protocol !== "string") continue;
99766
+ const { protocol, port } = handler;
99767
+ const key = `${protocol}:${port}`;
99768
+ const firstIndex = firstIndexByKey.get(key);
99769
+ if (firstIndex !== void 0) {
99770
+ diagnostics.errors.push(`"${fieldPath}[${i$1}]" has the same "protocol" (${protocol}) and "port" (${port}) as "${fieldPath}[${firstIndex}]". Each entry in "connect" must use a unique protocol/port combination.`);
99771
+ isValid = false;
99772
+ } else firstIndexByKey.set(key, i$1);
99773
+ }
99774
+ return isValid;
99775
+ };
99776
+ }
99777
+ __name$3(validateConnectHandlers, "validateConnectHandlers");
99778
+ var validateConnectHandler = /* @__PURE__ */ __name$3((diagnostics, field, value) => {
99779
+ if (typeof value !== "object" || value === null) {
99780
+ diagnostics.errors.push(`"${field}" should be an object, but got ${JSON.stringify(value)}`);
99781
+ return false;
99782
+ }
99783
+ let isValid = true;
99784
+ if (!validateAdditionalProperties(diagnostics, field, Object.keys(value), [
99785
+ "protocol",
99786
+ "port",
99787
+ "address"
99788
+ ])) isValid = false;
99789
+ if ("protocol" in value && value.protocol !== "tcp") {
99790
+ diagnostics.errors.push(`"${field}" should have a "protocol" field of "tcp" but got ${JSON.stringify(value.protocol)}.`);
99791
+ isValid = false;
99792
+ } else if (!("protocol" in value)) {
99793
+ diagnostics.errors.push(`"${field}" should have a "protocol" field of "tcp" but got ${JSON.stringify(value)}.`);
99794
+ isValid = false;
99795
+ }
99796
+ if (!isRequiredProperty(value, "port", "number")) {
99797
+ diagnostics.errors.push(`"${field}" should have a number "port" field but got ${JSON.stringify(value)}.`);
99798
+ isValid = false;
99799
+ } else if (!Number.isInteger(value.port) || value.port < 1 || value.port > 65535) {
99800
+ diagnostics.errors.push(`"${field}" should have an integer "port" field between 1 and 65535 but got ${JSON.stringify(value)}.`);
99801
+ isValid = false;
99802
+ }
99803
+ if (!isOptionalProperty(value, "address", "string")) {
99804
+ diagnostics.errors.push(`"${field}" should, optionally, have a string "address" field but got ${JSON.stringify(value)}.`);
99805
+ isValid = false;
99806
+ }
99807
+ return isValid;
99808
+ }, "validateConnectHandler");
99589
99809
  var validateCompatibilityDate = /* @__PURE__ */ __name$3((diagnostics, field, value) => {
99590
99810
  if (value === void 0) return true;
99591
99811
  if (typeof value !== "string") {
@@ -99767,7 +99987,7 @@ function normalizeAndValidateLimits(diagnostics, topLevelEnv, rawEnv) {
99767
99987
  return inheritable(diagnostics, topLevelEnv, rawEnv, "limits", () => true, void 0);
99768
99988
  }
99769
99989
  __name$3(normalizeAndValidateLimits, "normalizeAndValidateLimits");
99770
- var validatePreviewsConfig = /* @__PURE__ */ __name$3((envName) => (diagnostics, field, value) => {
99990
+ var validatePreviewsConfig = /* @__PURE__ */ __name$3((envName, configPath) => (diagnostics, field, value) => {
99771
99991
  if (value === void 0) return true;
99772
99992
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
99773
99993
  diagnostics.errors.push(`The field "${field}" should be an object but got ${JSON.stringify(value)}.`);
@@ -99808,6 +100028,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name$3((envName) => (diagnostics,
99808
100028
  "ratelimits",
99809
100029
  "vpc_services",
99810
100030
  "version_metadata",
100031
+ "containers",
99811
100032
  "logpush",
99812
100033
  "observability",
99813
100034
  "limits",
@@ -99845,6 +100066,7 @@ var validatePreviewsConfig = /* @__PURE__ */ __name$3((envName) => (diagnostics,
99845
100066
  isValid = validateBindingArray(envName, validateRateLimitBinding)(diagnostics, `${field}.ratelimits`, previews.ratelimits, void 0) && isValid;
99846
100067
  isValid = validateBindingArray(envName, validateVpcServiceBinding)(diagnostics, `${field}.vpc_services`, previews.vpc_services, void 0) && isValid;
99847
100068
  if (previews.version_metadata !== void 0) isValid = validateVersionMetadataBinding(envName)(diagnostics, `${field}.version_metadata`, previews.version_metadata, void 0) && isValid;
100069
+ if (previews.containers !== void 0) isValid = validatePreviewsContainers(envName, configPath)(diagnostics, `${field}.containers`, previews.containers, void 0) && isValid;
99848
100070
  isValid = isBoolean(diagnostics, `${field}.logpush`, previews.logpush, void 0) && isValid;
99849
100071
  isValid = validateObservability(diagnostics, `${field}.observability`, previews.observability, void 0) && isValid;
99850
100072
  if (previews.limits) {
@@ -100290,7 +100512,7 @@ var BINDING_LOCAL_SUPPORT = {
100290
100512
  kv_namespace: "local-and-remote",
100291
100513
  r2_bucket: "local-and-remote",
100292
100514
  d1: "local-and-remote",
100293
- workflow: "local-and-remote",
100515
+ workflow: "local-only",
100294
100516
  browser: "local-and-remote",
100295
100517
  images: "local-and-remote",
100296
100518
  stream: "local-and-remote",
@@ -100405,6 +100627,10 @@ function getPackagePath(packageName, projectPath) {
100405
100627
  try {
100406
100628
  return path2__default.dirname(__require$1.resolve(packageName, { paths: [projectPath] }));
100407
100629
  } catch {}
100630
+ try {
100631
+ const candidate = path2__default.join(projectPath, "node_modules", packageName, "package.json");
100632
+ if (statSync(candidate).isFile()) return path2__default.dirname(candidate);
100633
+ } catch {}
100408
100634
  }
100409
100635
  __name$3(getPackagePath, "getPackagePath");
100410
100636
  function isPackageInstalled(packageName, projectPath) {
@@ -101300,7 +101526,7 @@ function terminateCloudflared(cloudflared) {
101300
101526
  }
101301
101527
  __name$3(terminateCloudflared, "terminateCloudflared");
101302
101528
  function waitForQuickTunnelReady(cloudflared, timeoutMs, options) {
101303
- return new Promise((resolve2, reject) => {
101529
+ return new Promise((resolve3, reject) => {
101304
101530
  let resolved = false;
101305
101531
  let stderrOutput = "";
101306
101532
  const logger$1 = options?.logger;
@@ -101321,7 +101547,7 @@ function waitForQuickTunnelReady(cloudflared, timeoutMs, options) {
101321
101547
  if (match && !resolved) {
101322
101548
  resolved = true;
101323
101549
  clearTimeout(timeoutId);
101324
- resolve2({
101550
+ resolve3({
101325
101551
  mode: "quick",
101326
101552
  publicUrl: new URL(match[0])
101327
101553
  });
@@ -101640,7 +101866,7 @@ async function fetchLatestNpmVersion$1(name, version2) {
101640
101866
  __name$3(fetchLatestNpmVersion$1, "fetchLatestNpmVersion");
101641
101867
  async function openInBrowser$1(url2, logger$1) {
101642
101868
  try {
101643
- const { default: open$1 } = await import("./open-PBXRGS4R-qOWuyhJy-DF6hl_jp.mjs");
101869
+ const { default: open$1 } = await import("./open-PBXRGS4R-DmJH7r1k-rXrDiJei.mjs");
101644
101870
  (await open$1(url2)).on("error", (err) => {
101645
101871
  handleBrowserOpenError(url2, err, logger$1);
101646
101872
  });
@@ -101659,6 +101885,31 @@ ${url2}`);
101659
101885
  logger$1.debug(err instanceof Error ? err.stack ?? String(err) : String(err));
101660
101886
  }
101661
101887
  __name$3(handleBrowserOpenError, "handleBrowserOpenError");
101888
+ function writeOutput(entry) {
101889
+ if (outputFilePath === void 0) outputFilePath = getOutputFilePath();
101890
+ if (outputFilePath !== null) {
101891
+ mkdirSync(dirname(outputFilePath), { recursive: true });
101892
+ const entryJSON = JSON.stringify({
101893
+ ...entry,
101894
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
101895
+ });
101896
+ appendFileSync(outputFilePath, entryJSON + "\n");
101897
+ }
101898
+ }
101899
+ __name$3(writeOutput, "writeOutput");
101900
+ function clearOutputFilePath() {
101901
+ outputFilePath = void 0;
101902
+ }
101903
+ __name$3(clearOutputFilePath, "clearOutputFilePath");
101904
+ var outputFilePath = void 0;
101905
+ function getOutputFilePath() {
101906
+ const outputFilePathFromEnv = getOutputFilePathFromEnv();
101907
+ if (outputFilePathFromEnv) return outputFilePathFromEnv;
101908
+ const outputFileDirectoryFromEnv = getOutputFileDirectoryFromEnv();
101909
+ if (outputFileDirectoryFromEnv) return resolve(outputFileDirectoryFromEnv, `wrangler-output-${(/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-").replace(".", "_").replace("T", "_").replace("Z", "")}-${randomBytes(3).toString("hex")}.json`);
101910
+ return null;
101911
+ }
101912
+ __name$3(getOutputFilePath, "getOutputFilePath");
101662
101913
  var MAX_ATTEMPTS = 3;
101663
101914
  var MAX_RETRY_AFTER_MS = 6e4;
101664
101915
  async function retryOnAPIFailure$1(action, logger$1, backoff = 0, attempts = MAX_ATTEMPTS, abortSignal) {
@@ -118136,7 +118387,7 @@ var __name$1 = (target$1, value) => __defProp$1(target$1, "name", {
118136
118387
  });
118137
118388
 
118138
118389
  //#endregion
118139
- //#region ../workers-auth/dist/chunk-LXNXA7SZ.mjs
118390
+ //#region ../workers-auth/dist/chunk-EGLFJKUK.mjs
118140
118391
  var import_undici$2 = require_undici();
118141
118392
  var hasWarnedAboutDeprecatedV1ApiToken = false;
118142
118393
  function readStoredAuthState(options) {
@@ -120620,11 +120871,20 @@ function getInstalledBindingPath(installDir) {
120620
120871
  return path2__default.join(installDir, "node_modules", "@napi-rs", "keyring");
120621
120872
  }
120622
120873
  __name$1(getInstalledBindingPath, "getInstalledBindingPath");
120874
+ function canLoadKeyringBinding(candidate) {
120875
+ try {
120876
+ createRequire(candidate)(candidate);
120877
+ return true;
120878
+ } catch {
120879
+ return false;
120880
+ }
120881
+ }
120882
+ __name$1(canLoadKeyringBinding, "canLoadKeyringBinding");
120623
120883
  function findKeyringBinding(installDir) {
120624
120884
  const cached$3 = cachedBindingPathByDir.get(installDir);
120625
120885
  if (cached$3 !== void 0) return cached$3;
120626
120886
  const lazy$3 = getInstalledBindingPath(installDir);
120627
- if (existsSync(path2__default.join(lazy$3, "index.js"))) {
120887
+ if (existsSync(path2__default.join(lazy$3, "index.js")) && canLoadKeyringBinding(lazy$3)) {
120628
120888
  cachedBindingPathByDir.set(installDir, lazy$3);
120629
120889
  return lazy$3;
120630
120890
  }
@@ -120632,7 +120892,7 @@ function findKeyringBinding(installDir) {
120632
120892
  const r$1 = npmRunner(["root", "-g"]);
120633
120893
  if (r$1.status === 0) {
120634
120894
  const global$3 = path2__default.join(r$1.stdout.trim(), "@napi-rs", "keyring");
120635
- if (existsSync(path2__default.join(global$3, "index.js"))) {
120895
+ if (existsSync(path2__default.join(global$3, "index.js")) && canLoadKeyringBinding(global$3)) {
120636
120896
  cachedBindingPathByDir.set(installDir, global$3);
120637
120897
  return global$3;
120638
120898
  }
@@ -120675,6 +120935,12 @@ ${r$1.stderr?.trim() ?? "(no stderr)"}
120675
120935
  Retry once the underlying issue is fixed, or install the binding globally:
120676
120936
  npm install -g @napi-rs/keyring@${PINNED_KEYRING_VERSION}`, { telemetryMessage: "workers-auth keyring npm install failed" });
120677
120937
  cachedBindingPathByDir.delete(installDir);
120938
+ if (findKeyringBinding(installDir) === null) throw new UserError(`\`npm\` reported success but the \`@napi-rs/keyring\` native binding still cannot be loaded.
120939
+
120940
+ Its platform-specific binary ships as a separate optional package, so a download that was skipped or interrupted leaves the binding unusable.
120941
+
120942
+ Retry once the underlying issue is fixed, or install the binding globally:
120943
+ npm install -g @napi-rs/keyring@${PINNED_KEYRING_VERSION}`, { telemetryMessage: "workers-auth keyring install incomplete" });
120678
120944
  }
120679
120945
  __name$1(installKeyringBindingSync, "installKeyringBindingSync");
120680
120946
  var entryFactoryOverride;
@@ -120685,7 +120951,10 @@ __name$1(setKeyringEntryFactory, "setKeyringEntryFactory");
120685
120951
  function resolveKeyringEntryFactory(installDir) {
120686
120952
  if (entryFactoryOverride !== void 0) return entryFactoryOverride;
120687
120953
  const bindingPath = findKeyringBinding(installDir);
120688
- if (bindingPath === null) throw new Error("`@napi-rs/keyring` binding not found. Call `installKeyringBindingSync()` first.");
120954
+ if (bindingPath === null) throw new UserError(`The \`@napi-rs/keyring\` native binding is not available.
120955
+
120956
+ Retry the command, or install the binding globally:
120957
+ npm install -g @napi-rs/keyring@${PINNED_KEYRING_VERSION}`, { telemetryMessage: "workers-auth keyring binding not loadable" });
120689
120958
  const mod$1 = createRequire(bindingPath)(bindingPath);
120690
120959
  return (service, account) => new mod$1.Entry(service, account);
120691
120960
  }
@@ -121074,7 +121343,7 @@ function scrubEncryptedCredentials(options) {
121074
121343
  __name$1(scrubEncryptedCredentials, "scrubEncryptedCredentials");
121075
121344
 
121076
121345
  //#endregion
121077
- //#region ../workers-auth/dist/chunk-5EWNHNLD.mjs
121346
+ //#region ../workers-auth/dist/chunk-X7ZLU22G.mjs
121078
121347
  function createPreferences(getConfigPath) {
121079
121348
  function getUserPreferencesPath() {
121080
121349
  return path2__default.resolve(getConfigPath(), "preferences.json");
@@ -121997,6 +122266,8 @@ ${accounts.map((account) => ` \`${redactAccountName ? "(redacted)" : account.na
121997
122266
  async function requireAuth(config$3) {
121998
122267
  if (oauthFlow.isTemporaryAllowed()) {
121999
122268
  if (getCloudflareComplianceRegion(config$3) !== "public") throw new UserError("Temporary accounts aren't available when the compliance region is not set to public.", { telemetryMessage: "user temporary account unavailable in compliance region" });
122269
+ const latchedTemporaryAccount = oauthFlow.getActiveTemporaryAccount();
122270
+ if (latchedTemporaryAccount) return latchedTemporaryAccount.account.id;
122000
122271
  if (getAPIToken$1()) throw new UserError("You're already authenticated with Cloudflare, so `--temporary` can't be used. Temporary preview accounts are only for unauthenticated use. Either remove `--temporary` to use your existing account, or log out (and unset CLOUDFLARE_API_TOKEN) first.", { telemetryMessage: "user temporary account already authenticated" });
122001
122272
  const { account: temporaryPreviewAccount, cached: cached$3 } = await oauthFlow.activateTemporaryAccount();
122002
122273
  logTemporaryPreviewAccount(logger$1, temporaryPreviewAccount, cached$3);
@@ -123506,7 +123777,7 @@ __name(createWorkerUploadForm, "createWorkerUploadForm");
123506
123777
  //#endregion
123507
123778
  //#region ../remote-bindings/dist/index.mjs
123508
123779
  var import_undici = require_undici();
123509
- var version$2 = "0.0.13";
123780
+ var version$2 = "0.0.14";
123510
123781
  var NoDefaultValueProvided = class extends UserError {
123511
123782
  constructor() {
123512
123783
  super("This command cannot be run in a non-interactive context", { telemetryMessage: "remote bindings prompt default missing" });