wrangler 4.69.0 → 4.71.0

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.
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var assert50 = require('assert');
3
+ var assert51 = require('assert');
4
4
  var module2 = require('module');
5
5
  var path3 = require('path');
6
6
  var fs23 = require('fs');
@@ -52,7 +52,7 @@ function _interopNamespace(e) {
52
52
  return Object.freeze(n);
53
53
  }
54
54
 
55
- var assert50__default = /*#__PURE__*/_interopDefault(assert50);
55
+ var assert51__default = /*#__PURE__*/_interopDefault(assert51);
56
56
  var module2__default = /*#__PURE__*/_interopDefault(module2);
57
57
  var path3__namespace = /*#__PURE__*/_interopNamespace(path3);
58
58
  var fs23__namespace = /*#__PURE__*/_interopNamespace(fs23);
@@ -266,7 +266,7 @@ function isCompatDate(str) {
266
266
  }
267
267
  function formatCompatibilityDate(date) {
268
268
  const compatDate = date.toISOString().slice(0, 10);
269
- assert50__default.default(isCompatDate(compatDate));
269
+ assert51__default.default(isCompatDate(compatDate));
270
270
  return compatDate;
271
271
  }
272
272
  function assertNever(_value) {
@@ -3949,7 +3949,7 @@ function normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args,
3949
3949
  );
3950
3950
  }
3951
3951
  const envName = args.env ?? getCloudflareEnv();
3952
- assert50__default.default(envName === void 0 || typeof envName === "string");
3952
+ assert51__default.default(envName === void 0 || typeof envName === "string");
3953
3953
  let activeEnv = topLevelEnv;
3954
3954
  if (envName) {
3955
3955
  if (isRedirectedConfig) {
@@ -4153,7 +4153,7 @@ function normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {
4153
4153
  }
4154
4154
  }
4155
4155
  function normalizeAndValidateDev(diagnostics, rawDev, args) {
4156
- assert50__default.default(typeof args === "object" && args !== null && !Array.isArray(args));
4156
+ assert51__default.default(typeof args === "object" && args !== null && !Array.isArray(args));
4157
4157
  const {
4158
4158
  localProtocol: localProtocolArg,
4159
4159
  upstreamProtocol: upstreamProtocolArg,
@@ -4161,17 +4161,17 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
4161
4161
  enableContainers: enableContainersArg,
4162
4162
  generateTypes: generateTypesArg
4163
4163
  } = args;
4164
- assert50__default.default(
4164
+ assert51__default.default(
4165
4165
  localProtocolArg === void 0 || localProtocolArg === "http" || localProtocolArg === "https"
4166
4166
  );
4167
- assert50__default.default(
4167
+ assert51__default.default(
4168
4168
  upstreamProtocolArg === void 0 || upstreamProtocolArg === "http" || upstreamProtocolArg === "https"
4169
4169
  );
4170
- assert50__default.default(remoteArg === void 0 || typeof remoteArg === "boolean");
4171
- assert50__default.default(
4170
+ assert51__default.default(remoteArg === void 0 || typeof remoteArg === "boolean");
4171
+ assert51__default.default(
4172
4172
  enableContainersArg === void 0 || typeof enableContainersArg === "boolean"
4173
4173
  );
4174
- assert50__default.default(
4174
+ assert51__default.default(
4175
4175
  generateTypesArg === void 0 || typeof generateTypesArg === "boolean"
4176
4176
  );
4177
4177
  const {
@@ -7675,12 +7675,45 @@ Please add a binding for each to "${fieldPath}.bindings":
7675
7675
  );
7676
7676
  isValid2 = false;
7677
7677
  }
7678
+ if (hasProperty(value, "limits") && value.limits !== void 0) {
7679
+ if (typeof value.limits !== "object" || value.limits === null || Array.isArray(value.limits)) {
7680
+ diagnostics.errors.push(
7681
+ `"${field}" bindings should, optionally, have an object "limits" field but got ${JSON.stringify(
7682
+ value
7683
+ )}.`
7684
+ );
7685
+ isValid2 = false;
7686
+ } else {
7687
+ const limits = value.limits;
7688
+ if (limits.steps !== void 0) {
7689
+ if (typeof limits.steps !== "number" || !Number.isInteger(limits.steps) || limits.steps < 1) {
7690
+ diagnostics.errors.push(
7691
+ `"${field}" bindings "limits.steps" field must be a positive integer but got ${JSON.stringify(
7692
+ limits.steps
7693
+ )}.`
7694
+ );
7695
+ isValid2 = false;
7696
+ } else if (limits.steps > 25e3) {
7697
+ diagnostics.warnings.push(
7698
+ `"${field}" has a step limit of ${limits.steps}, which exceeds the production maximum of 25,000. This configuration may not work when deployed.`
7699
+ );
7700
+ }
7701
+ }
7702
+ validateAdditionalProperties(
7703
+ diagnostics,
7704
+ `${field}.limits`,
7705
+ Object.keys(limits),
7706
+ ["steps"]
7707
+ );
7708
+ }
7709
+ }
7678
7710
  validateAdditionalProperties(diagnostics, field, Object.keys(value), [
7679
7711
  "binding",
7680
7712
  "name",
7681
7713
  "class_name",
7682
7714
  "script_name",
7683
- "remote"
7715
+ "remote",
7716
+ "limits"
7684
7717
  ]);
7685
7718
  return isValid2;
7686
7719
  }, "validateWorkflowBinding");
@@ -10879,8 +10912,8 @@ var init_esm = __esm({
10879
10912
  mainFilename = __dirname2.substring(0, __dirname2.lastIndexOf("node_modules"));
10880
10913
  esm_default2 = {
10881
10914
  assert: {
10882
- notStrictEqual: assert50.notStrictEqual,
10883
- strictEqual: assert50.strictEqual
10915
+ notStrictEqual: assert51.notStrictEqual,
10916
+ strictEqual: assert51.strictEqual
10884
10917
  },
10885
10918
  cliui: ui,
10886
10919
  findUp: sync_default,
@@ -11972,7 +12005,7 @@ var require_tree = __commonJS({
11972
12005
  var require_util = __commonJS({
11973
12006
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/core/util.js"(exports, module4) {
11974
12007
  init_import_meta_url();
11975
- var assert58 = __require("assert");
12008
+ var assert59 = __require("assert");
11976
12009
  var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols();
11977
12010
  var { IncomingMessage } = __require("http");
11978
12011
  var stream2 = __require("stream");
@@ -11993,7 +12026,7 @@ var require_util = __commonJS({
11993
12026
  this[kBodyUsed] = false;
11994
12027
  }
11995
12028
  async *[Symbol.asyncIterator]() {
11996
- assert58(!this[kBodyUsed], "disturbed");
12029
+ assert59(!this[kBodyUsed], "disturbed");
11997
12030
  this[kBodyUsed] = true;
11998
12031
  yield* this[kBody];
11999
12032
  }
@@ -12005,7 +12038,7 @@ var require_util = __commonJS({
12005
12038
  if (isStream2(body)) {
12006
12039
  if (bodyLength(body) === 0) {
12007
12040
  body.on("data", function() {
12008
- assert58(false);
12041
+ assert59(false);
12009
12042
  });
12010
12043
  }
12011
12044
  if (typeof body.readableDidRead !== "boolean") {
@@ -12123,7 +12156,7 @@ var require_util = __commonJS({
12123
12156
  function getHostname(host) {
12124
12157
  if (host[0] === "[") {
12125
12158
  const idx2 = host.indexOf("]");
12126
- assert58(idx2 !== -1);
12159
+ assert59(idx2 !== -1);
12127
12160
  return host.substring(1, idx2);
12128
12161
  }
12129
12162
  const idx = host.indexOf(":");
@@ -12135,7 +12168,7 @@ var require_util = __commonJS({
12135
12168
  if (!host) {
12136
12169
  return null;
12137
12170
  }
12138
- assert58(typeof host === "string");
12171
+ assert59(typeof host === "string");
12139
12172
  const servername = getHostname(host);
12140
12173
  if (net2.isIP(servername)) {
12141
12174
  return "";
@@ -12692,7 +12725,7 @@ var require_util = __commonJS({
12692
12725
  function errorRequest(client, request4, err) {
12693
12726
  try {
12694
12727
  request4.onError(err);
12695
- assert58(request4.aborted);
12728
+ assert59(request4.aborted);
12696
12729
  } catch (err2) {
12697
12730
  client.emit("error", err2);
12698
12731
  }
@@ -13095,7 +13128,7 @@ var require_request = __commonJS({
13095
13128
  InvalidArgumentError,
13096
13129
  NotSupportedError
13097
13130
  } = require_errors();
13098
- var assert58 = __require("assert");
13131
+ var assert59 = __require("assert");
13099
13132
  var {
13100
13133
  isValidHTTPToken,
13101
13134
  isValidHeaderValue,
@@ -13275,8 +13308,8 @@ var require_request = __commonJS({
13275
13308
  }
13276
13309
  }
13277
13310
  onConnect(abort) {
13278
- assert58(!this.aborted);
13279
- assert58(!this.completed);
13311
+ assert59(!this.aborted);
13312
+ assert59(!this.completed);
13280
13313
  if (this.error) {
13281
13314
  abort(this.error);
13282
13315
  } else {
@@ -13288,8 +13321,8 @@ var require_request = __commonJS({
13288
13321
  return this[kHandler].onResponseStarted?.();
13289
13322
  }
13290
13323
  onHeaders(statusCode, headers, resume, statusText) {
13291
- assert58(!this.aborted);
13292
- assert58(!this.completed);
13324
+ assert59(!this.aborted);
13325
+ assert59(!this.completed);
13293
13326
  if (channels.headers.hasSubscribers) {
13294
13327
  channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
13295
13328
  }
@@ -13300,8 +13333,8 @@ var require_request = __commonJS({
13300
13333
  }
13301
13334
  }
13302
13335
  onData(chunk) {
13303
- assert58(!this.aborted);
13304
- assert58(!this.completed);
13336
+ assert59(!this.aborted);
13337
+ assert59(!this.completed);
13305
13338
  if (channels.bodyChunkReceived.hasSubscribers) {
13306
13339
  channels.bodyChunkReceived.publish({ request: this, chunk });
13307
13340
  }
@@ -13313,14 +13346,14 @@ var require_request = __commonJS({
13313
13346
  }
13314
13347
  }
13315
13348
  onUpgrade(statusCode, headers, socket) {
13316
- assert58(!this.aborted);
13317
- assert58(!this.completed);
13349
+ assert59(!this.aborted);
13350
+ assert59(!this.completed);
13318
13351
  return this[kHandler].onUpgrade(statusCode, headers, socket);
13319
13352
  }
13320
13353
  onComplete(trailers) {
13321
13354
  this.onFinally();
13322
- assert58(!this.aborted);
13323
- assert58(!this.completed);
13355
+ assert59(!this.aborted);
13356
+ assert59(!this.completed);
13324
13357
  this.completed = true;
13325
13358
  if (channels.trailers.hasSubscribers) {
13326
13359
  channels.trailers.publish({ request: this, trailers });
@@ -13783,7 +13816,7 @@ var require_connect = __commonJS({
13783
13816
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/core/connect.js"(exports, module4) {
13784
13817
  init_import_meta_url();
13785
13818
  var net2 = __require("net");
13786
- var assert58 = __require("assert");
13819
+ var assert59 = __require("assert");
13787
13820
  var util3 = require_util();
13788
13821
  var { InvalidArgumentError } = require_errors();
13789
13822
  var tls;
@@ -13832,7 +13865,7 @@ var require_connect = __commonJS({
13832
13865
  }
13833
13866
  servername = servername || options.servername || util3.getServerName(host) || null;
13834
13867
  const sessionKey = servername || hostname2;
13835
- assert58(sessionKey);
13868
+ assert59(sessionKey);
13836
13869
  const session = customSession || sessionCache.get(sessionKey) || null;
13837
13870
  port = port || 443;
13838
13871
  socket = tls.connect({
@@ -13852,7 +13885,7 @@ var require_connect = __commonJS({
13852
13885
  sessionCache.set(sessionKey, session2);
13853
13886
  });
13854
13887
  } else {
13855
- assert58(!httpSocket, "httpSocket can only be sent on TLS update");
13888
+ assert59(!httpSocket, "httpSocket can only be sent on TLS update");
13856
13889
  port = port || 80;
13857
13890
  socket = net2.connect({
13858
13891
  highWaterMark: 64 * 1024,
@@ -14852,7 +14885,7 @@ var require_encoding = __commonJS({
14852
14885
  var require_infra = __commonJS({
14853
14886
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/web/infra/index.js"(exports, module4) {
14854
14887
  init_import_meta_url();
14855
- var assert58 = __require("assert");
14888
+ var assert59 = __require("assert");
14856
14889
  var { utf8DecodeBytes } = require_encoding();
14857
14890
  function collectASequenceOfCodePoints(condition, input, position) {
14858
14891
  let result = "";
@@ -14923,7 +14956,7 @@ var require_infra = __commonJS({
14923
14956
  __name(isomorphicDecode, "isomorphicDecode");
14924
14957
  var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/;
14925
14958
  function isomorphicEncode(input) {
14926
- assert58(!invalidIsomorphicEncodeValueRegex.test(input));
14959
+ assert59(!invalidIsomorphicEncodeValueRegex.test(input));
14927
14960
  return input;
14928
14961
  }
14929
14962
  __name(isomorphicEncode, "isomorphicEncode");
@@ -14952,7 +14985,7 @@ var require_infra = __commonJS({
14952
14985
  if (result === void 0) {
14953
14986
  throw new TypeError("Value is not JSON serializable");
14954
14987
  }
14955
- assert58(typeof result === "string");
14988
+ assert59(typeof result === "string");
14956
14989
  return result;
14957
14990
  }
14958
14991
  __name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");
@@ -14975,14 +15008,14 @@ var require_infra = __commonJS({
14975
15008
  var require_data_url = __commonJS({
14976
15009
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/web/fetch/data-url.js"(exports, module4) {
14977
15010
  init_import_meta_url();
14978
- var assert58 = __require("assert");
15011
+ var assert59 = __require("assert");
14979
15012
  var { forgivingBase64, collectASequenceOfCodePoints, collectASequenceOfCodePointsFast, isomorphicDecode, removeASCIIWhitespace, removeChars } = require_infra();
14980
15013
  var encoder = new TextEncoder();
14981
15014
  var HTTP_TOKEN_CODEPOINTS = /^[-!#$%&'*+.^_|~A-Za-z0-9]+$/u;
14982
15015
  var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/u;
14983
15016
  var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/u;
14984
15017
  function dataURLProcessor(dataURL) {
14985
- assert58(dataURL.protocol === "data:");
15018
+ assert59(dataURL.protocol === "data:");
14986
15019
  let input = URLSerializer(dataURL, true);
14987
15020
  input = input.slice(5);
14988
15021
  const position = { position: 0 };
@@ -15154,7 +15187,7 @@ var require_data_url = __commonJS({
15154
15187
  function collectAnHTTPQuotedString(input, position, extractValue3 = false) {
15155
15188
  const positionStart = position.position;
15156
15189
  let value = "";
15157
- assert58(input[position.position] === '"');
15190
+ assert59(input[position.position] === '"');
15158
15191
  position.position++;
15159
15192
  while (true) {
15160
15193
  value += collectASequenceOfCodePoints(
@@ -15175,7 +15208,7 @@ var require_data_url = __commonJS({
15175
15208
  value += input[position.position];
15176
15209
  position.position++;
15177
15210
  } else {
15178
- assert58(quoteOrBackslash === '"');
15211
+ assert59(quoteOrBackslash === '"');
15179
15212
  break;
15180
15213
  }
15181
15214
  }
@@ -15186,7 +15219,7 @@ var require_data_url = __commonJS({
15186
15219
  }
15187
15220
  __name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");
15188
15221
  function serializeAMimeType(mimeType) {
15189
- assert58(mimeType !== "failure");
15222
+ assert59(mimeType !== "failure");
15190
15223
  const { parameters, essence } = mimeType;
15191
15224
  let serialization = essence;
15192
15225
  for (let [name2, value] of parameters.entries()) {
@@ -15960,7 +15993,7 @@ var require_util2 = __commonJS({
15960
15993
  var { collectAnHTTPQuotedString, parseMIMEType } = require_data_url();
15961
15994
  var { performance: performance2 } = __require("perf_hooks");
15962
15995
  var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util();
15963
- var assert58 = __require("assert");
15996
+ var assert59 = __require("assert");
15964
15997
  var { isUint8Array } = __require("util/types");
15965
15998
  var { webidl } = require_webidl();
15966
15999
  var { isomorphicEncode, collectASequenceOfCodePoints, removeChars } = require_infra();
@@ -16163,7 +16196,7 @@ var require_util2 = __commonJS({
16163
16196
  __name(clonePolicyContainer, "clonePolicyContainer");
16164
16197
  function determineRequestsReferrer(request4) {
16165
16198
  const policy = request4.referrerPolicy;
16166
- assert58(policy);
16199
+ assert59(policy);
16167
16200
  let referrerSource = null;
16168
16201
  if (request4.referrer === "client") {
16169
16202
  const globalOrigin = getGlobalOrigin();
@@ -16227,7 +16260,7 @@ var require_util2 = __commonJS({
16227
16260
  }
16228
16261
  __name(determineRequestsReferrer, "determineRequestsReferrer");
16229
16262
  function stripURLForReferrer(url4, originOnly = false) {
16230
- assert58(webidl.is.URL(url4));
16263
+ assert59(webidl.is.URL(url4));
16231
16264
  url4 = new URL(url4);
16232
16265
  if (urlIsLocal(url4)) {
16233
16266
  return "no-referrer";
@@ -16491,7 +16524,7 @@ var require_util2 = __commonJS({
16491
16524
  }
16492
16525
  __name(readAllBytes, "readAllBytes");
16493
16526
  function urlIsLocal(url4) {
16494
- assert58("protocol" in url4);
16527
+ assert59("protocol" in url4);
16495
16528
  const protocol = url4.protocol;
16496
16529
  return protocol === "about:" || protocol === "blob:" || protocol === "data:";
16497
16530
  }
@@ -16501,7 +16534,7 @@ var require_util2 = __commonJS({
16501
16534
  }
16502
16535
  __name(urlHasHttpsScheme, "urlHasHttpsScheme");
16503
16536
  function urlIsHttpHttpsScheme(url4) {
16504
- assert58("protocol" in url4);
16537
+ assert59("protocol" in url4);
16505
16538
  const protocol = url4.protocol;
16506
16539
  return protocol === "http:" || protocol === "https:";
16507
16540
  }
@@ -16674,7 +16707,7 @@ var require_util2 = __commonJS({
16674
16707
  continue;
16675
16708
  }
16676
16709
  } else {
16677
- assert58(input.charCodeAt(position.position) === 44);
16710
+ assert59(input.charCodeAt(position.position) === 44);
16678
16711
  position.position++;
16679
16712
  }
16680
16713
  }
@@ -16934,7 +16967,7 @@ var require_formdata_parser = __commonJS({
16934
16967
  var { HTTP_TOKEN_CODEPOINTS } = require_data_url();
16935
16968
  var { makeEntry } = require_formdata();
16936
16969
  var { webidl } = require_webidl();
16937
- var assert58 = __require("assert");
16970
+ var assert59 = __require("assert");
16938
16971
  var { isomorphicDecode } = require_infra();
16939
16972
  var { utf8DecodeBytes } = require_encoding();
16940
16973
  var dd = Buffer.from("--");
@@ -16963,7 +16996,7 @@ var require_formdata_parser = __commonJS({
16963
16996
  }
16964
16997
  __name(validateBoundary, "validateBoundary");
16965
16998
  function multipartFormDataParser(input, mimeType) {
16966
- assert58(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
16999
+ assert59(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
16967
17000
  const boundaryString = mimeType.parameters.get("boundary");
16968
17001
  if (boundaryString === void 0) {
16969
17002
  throw parsingError("missing boundary in content-type header");
@@ -17019,8 +17052,8 @@ var require_formdata_parser = __commonJS({
17019
17052
  } else {
17020
17053
  value = utf8DecodeBytes(Buffer.from(body));
17021
17054
  }
17022
- assert58(webidl.is.USVString(name2));
17023
- assert58(typeof value === "string" && webidl.is.USVString(value) || webidl.is.File(value));
17055
+ assert59(webidl.is.USVString(name2));
17056
+ assert59(typeof value === "string" && webidl.is.USVString(value) || webidl.is.File(value));
17024
17057
  entryList.push(makeEntry(name2, value, filename));
17025
17058
  }
17026
17059
  }
@@ -17295,7 +17328,7 @@ var require_body = __commonJS({
17295
17328
  } = require_util2();
17296
17329
  var { FormData: FormData13, setFormDataState } = require_formdata();
17297
17330
  var { webidl } = require_webidl();
17298
- var assert58 = __require("assert");
17331
+ var assert59 = __require("assert");
17299
17332
  var { isErrored, isDisturbed } = __require("stream");
17300
17333
  var { isArrayBuffer: isArrayBuffer3 } = __require("util/types");
17301
17334
  var { serializeAMimeType } = require_data_url();
@@ -17335,7 +17368,7 @@ var require_body = __commonJS({
17335
17368
  type: "bytes"
17336
17369
  });
17337
17370
  }
17338
- assert58(webidl.is.ReadableStream(stream2));
17371
+ assert59(webidl.is.ReadableStream(stream2));
17339
17372
  let action = null;
17340
17373
  let source = null;
17341
17374
  let length = null;
@@ -17453,8 +17486,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
17453
17486
  __name(extractBody, "extractBody");
17454
17487
  function safelyExtractBody(object, keepalive = false) {
17455
17488
  if (webidl.is.ReadableStream(object)) {
17456
- assert58(!util3.isDisturbed(object), "The body has already been consumed.");
17457
- assert58(!object.locked, "The stream is locked.");
17489
+ assert59(!util3.isDisturbed(object), "The body has already been consumed.");
17490
+ assert59(!object.locked, "The stream is locked.");
17458
17491
  }
17459
17492
  return extractBody(object, keepalive);
17460
17493
  }
@@ -17591,7 +17624,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
17591
17624
  var require_client_h1 = __commonJS({
17592
17625
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/dispatcher/client-h1.js"(exports, module4) {
17593
17626
  init_import_meta_url();
17594
- var assert58 = __require("assert");
17627
+ var assert59 = __require("assert");
17595
17628
  var util3 = require_util();
17596
17629
  var { channels } = require_diagnostics();
17597
17630
  var timers = require_timers();
@@ -17682,7 +17715,7 @@ var require_client_h1 = __commonJS({
17682
17715
  * @returns {number}
17683
17716
  */
17684
17717
  wasm_on_status: /* @__PURE__ */ __name((p7, at3, len) => {
17685
- assert58(currentParser.ptr === p7);
17718
+ assert59(currentParser.ptr === p7);
17686
17719
  const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
17687
17720
  return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len));
17688
17721
  }, "wasm_on_status"),
@@ -17691,7 +17724,7 @@ var require_client_h1 = __commonJS({
17691
17724
  * @returns {number}
17692
17725
  */
17693
17726
  wasm_on_message_begin: /* @__PURE__ */ __name((p7) => {
17694
- assert58(currentParser.ptr === p7);
17727
+ assert59(currentParser.ptr === p7);
17695
17728
  return currentParser.onMessageBegin();
17696
17729
  }, "wasm_on_message_begin"),
17697
17730
  /**
@@ -17701,7 +17734,7 @@ var require_client_h1 = __commonJS({
17701
17734
  * @returns {number}
17702
17735
  */
17703
17736
  wasm_on_header_field: /* @__PURE__ */ __name((p7, at3, len) => {
17704
- assert58(currentParser.ptr === p7);
17737
+ assert59(currentParser.ptr === p7);
17705
17738
  const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
17706
17739
  return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len));
17707
17740
  }, "wasm_on_header_field"),
@@ -17712,7 +17745,7 @@ var require_client_h1 = __commonJS({
17712
17745
  * @returns {number}
17713
17746
  */
17714
17747
  wasm_on_header_value: /* @__PURE__ */ __name((p7, at3, len) => {
17715
- assert58(currentParser.ptr === p7);
17748
+ assert59(currentParser.ptr === p7);
17716
17749
  const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
17717
17750
  return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len));
17718
17751
  }, "wasm_on_header_value"),
@@ -17724,7 +17757,7 @@ var require_client_h1 = __commonJS({
17724
17757
  * @returns {number}
17725
17758
  */
17726
17759
  wasm_on_headers_complete: /* @__PURE__ */ __name((p7, statusCode, upgrade, shouldKeepAlive) => {
17727
- assert58(currentParser.ptr === p7);
17760
+ assert59(currentParser.ptr === p7);
17728
17761
  return currentParser.onHeadersComplete(statusCode, upgrade === 1, shouldKeepAlive === 1);
17729
17762
  }, "wasm_on_headers_complete"),
17730
17763
  /**
@@ -17734,7 +17767,7 @@ var require_client_h1 = __commonJS({
17734
17767
  * @returns {number}
17735
17768
  */
17736
17769
  wasm_on_body: /* @__PURE__ */ __name((p7, at3, len) => {
17737
- assert58(currentParser.ptr === p7);
17770
+ assert59(currentParser.ptr === p7);
17738
17771
  const start = at3 - currentBufferPtr + currentBufferRef.byteOffset;
17739
17772
  return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len));
17740
17773
  }, "wasm_on_body"),
@@ -17743,7 +17776,7 @@ var require_client_h1 = __commonJS({
17743
17776
  * @returns {number}
17744
17777
  */
17745
17778
  wasm_on_message_complete: /* @__PURE__ */ __name((p7) => {
17746
- assert58(currentParser.ptr === p7);
17779
+ assert59(currentParser.ptr === p7);
17747
17780
  return currentParser.onMessageComplete();
17748
17781
  }, "wasm_on_message_complete")
17749
17782
  }
@@ -17818,10 +17851,10 @@ var require_client_h1 = __commonJS({
17818
17851
  if (this.socket.destroyed || !this.paused) {
17819
17852
  return;
17820
17853
  }
17821
- assert58(this.ptr != null);
17822
- assert58(currentParser === null);
17854
+ assert59(this.ptr != null);
17855
+ assert59(currentParser === null);
17823
17856
  this.llhttp.llhttp_resume(this.ptr);
17824
- assert58(this.timeoutType === TIMEOUT_BODY);
17857
+ assert59(this.timeoutType === TIMEOUT_BODY);
17825
17858
  if (this.timeout) {
17826
17859
  if (this.timeout.refresh) {
17827
17860
  this.timeout.refresh();
@@ -17844,9 +17877,9 @@ var require_client_h1 = __commonJS({
17844
17877
  * @param {Buffer} chunk
17845
17878
  */
17846
17879
  execute(chunk) {
17847
- assert58(currentParser === null);
17848
- assert58(this.ptr != null);
17849
- assert58(!this.paused);
17880
+ assert59(currentParser === null);
17881
+ assert59(this.ptr != null);
17882
+ assert59(!this.paused);
17850
17883
  const { socket, llhttp } = this;
17851
17884
  if (chunk.length > currentBufferSize) {
17852
17885
  if (currentBufferPtr) {
@@ -17888,8 +17921,8 @@ var require_client_h1 = __commonJS({
17888
17921
  }
17889
17922
  }
17890
17923
  destroy() {
17891
- assert58(currentParser === null);
17892
- assert58(this.ptr != null);
17924
+ assert59(currentParser === null);
17925
+ assert59(this.ptr != null);
17893
17926
  this.llhttp.llhttp_free(this.ptr);
17894
17927
  this.ptr = null;
17895
17928
  this.timeout && timers.clearTimeout(this.timeout);
@@ -17975,14 +18008,14 @@ var require_client_h1 = __commonJS({
17975
18008
  */
17976
18009
  onUpgrade(head) {
17977
18010
  const { upgrade, client, socket, headers, statusCode } = this;
17978
- assert58(upgrade);
17979
- assert58(client[kSocket] === socket);
17980
- assert58(!socket.destroyed);
17981
- assert58(!this.paused);
17982
- assert58((headers.length & 1) === 0);
18011
+ assert59(upgrade);
18012
+ assert59(client[kSocket] === socket);
18013
+ assert59(!socket.destroyed);
18014
+ assert59(!this.paused);
18015
+ assert59((headers.length & 1) === 0);
17983
18016
  const request4 = client[kQueue][client[kRunningIdx]];
17984
- assert58(request4);
17985
- assert58(request4.upgrade || request4.method === "CONNECT");
18017
+ assert59(request4);
18018
+ assert59(request4.upgrade || request4.method === "CONNECT");
17986
18019
  this.statusCode = 0;
17987
18020
  this.statusText = "";
17988
18021
  this.shouldKeepAlive = false;
@@ -18020,8 +18053,8 @@ var require_client_h1 = __commonJS({
18020
18053
  if (!request4) {
18021
18054
  return -1;
18022
18055
  }
18023
- assert58(!this.upgrade);
18024
- assert58(this.statusCode < 200);
18056
+ assert59(!this.upgrade);
18057
+ assert59(this.statusCode < 200);
18025
18058
  if (statusCode === 100) {
18026
18059
  util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket)));
18027
18060
  return -1;
@@ -18030,7 +18063,7 @@ var require_client_h1 = __commonJS({
18030
18063
  util3.destroy(socket, new SocketError("bad upgrade", util3.getSocketInfo(socket)));
18031
18064
  return -1;
18032
18065
  }
18033
- assert58(this.timeoutType === TIMEOUT_HEADERS);
18066
+ assert59(this.timeoutType === TIMEOUT_HEADERS);
18034
18067
  this.statusCode = statusCode;
18035
18068
  this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.
18036
18069
  request4.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive";
@@ -18043,16 +18076,16 @@ var require_client_h1 = __commonJS({
18043
18076
  }
18044
18077
  }
18045
18078
  if (request4.method === "CONNECT") {
18046
- assert58(client[kRunning] === 1);
18079
+ assert59(client[kRunning] === 1);
18047
18080
  this.upgrade = true;
18048
18081
  return 2;
18049
18082
  }
18050
18083
  if (upgrade) {
18051
- assert58(client[kRunning] === 1);
18084
+ assert59(client[kRunning] === 1);
18052
18085
  this.upgrade = true;
18053
18086
  return 2;
18054
18087
  }
18055
- assert58((this.headers.length & 1) === 0);
18088
+ assert59((this.headers.length & 1) === 0);
18056
18089
  this.headers = [];
18057
18090
  this.headersSize = 0;
18058
18091
  if (this.shouldKeepAlive && client[kPipelining]) {
@@ -18099,14 +18132,14 @@ var require_client_h1 = __commonJS({
18099
18132
  return -1;
18100
18133
  }
18101
18134
  const request4 = client[kQueue][client[kRunningIdx]];
18102
- assert58(request4);
18103
- assert58(this.timeoutType === TIMEOUT_BODY);
18135
+ assert59(request4);
18136
+ assert59(this.timeoutType === TIMEOUT_BODY);
18104
18137
  if (this.timeout) {
18105
18138
  if (this.timeout.refresh) {
18106
18139
  this.timeout.refresh();
18107
18140
  }
18108
18141
  }
18109
- assert58(statusCode >= 200);
18142
+ assert59(statusCode >= 200);
18110
18143
  if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
18111
18144
  util3.destroy(socket, new ResponseExceededMaxSizeError());
18112
18145
  return -1;
@@ -18128,10 +18161,10 @@ var require_client_h1 = __commonJS({
18128
18161
  if (upgrade) {
18129
18162
  return 0;
18130
18163
  }
18131
- assert58(statusCode >= 100);
18132
- assert58((this.headers.length & 1) === 0);
18164
+ assert59(statusCode >= 100);
18165
+ assert59((this.headers.length & 1) === 0);
18133
18166
  const request4 = client[kQueue][client[kRunningIdx]];
18134
- assert58(request4);
18167
+ assert59(request4);
18135
18168
  this.statusCode = 0;
18136
18169
  this.statusText = "";
18137
18170
  this.bytesRead = 0;
@@ -18150,7 +18183,7 @@ var require_client_h1 = __commonJS({
18150
18183
  request4.onComplete(headers);
18151
18184
  client[kQueue][client[kRunningIdx]++] = null;
18152
18185
  if (socket[kWriting]) {
18153
- assert58(client[kRunning] === 0);
18186
+ assert59(client[kRunning] === 0);
18154
18187
  util3.destroy(socket, new InformationalError("reset"));
18155
18188
  return constants4.ERROR.PAUSED;
18156
18189
  } else if (!shouldKeepAlive) {
@@ -18171,7 +18204,7 @@ var require_client_h1 = __commonJS({
18171
18204
  const { socket, timeoutType, client, paused } = parser2.deref();
18172
18205
  if (timeoutType === TIMEOUT_HEADERS) {
18173
18206
  if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
18174
- assert58(!paused, "cannot be paused while waiting for headers");
18207
+ assert59(!paused, "cannot be paused while waiting for headers");
18175
18208
  util3.destroy(socket, new HeadersTimeoutError());
18176
18209
  }
18177
18210
  } else if (timeoutType === TIMEOUT_BODY) {
@@ -18179,7 +18212,7 @@ var require_client_h1 = __commonJS({
18179
18212
  util3.destroy(socket, new BodyTimeoutError());
18180
18213
  }
18181
18214
  } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
18182
- assert58(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
18215
+ assert59(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
18183
18216
  util3.destroy(socket, new InformationalError("socket idle timeout"));
18184
18217
  }
18185
18218
  }
@@ -18258,7 +18291,7 @@ var require_client_h1 = __commonJS({
18258
18291
  }
18259
18292
  __name(connectH1, "connectH1");
18260
18293
  function onHttpSocketError(err) {
18261
- assert58(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
18294
+ assert59(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
18262
18295
  const parser2 = this[kParser];
18263
18296
  if (err.code === "ECONNRESET" && parser2.statusCode && !parser2.shouldKeepAlive) {
18264
18297
  parser2.onMessageComplete();
@@ -18295,7 +18328,7 @@ var require_client_h1 = __commonJS({
18295
18328
  client[kSocket] = null;
18296
18329
  client[kHTTPContext] = null;
18297
18330
  if (client.destroyed) {
18298
- assert58(client[kPending] === 0);
18331
+ assert59(client[kPending] === 0);
18299
18332
  const requests = client[kQueue].splice(client[kRunningIdx]);
18300
18333
  for (let i7 = 0; i7 < requests.length; i7++) {
18301
18334
  const request4 = requests[i7];
@@ -18307,7 +18340,7 @@ var require_client_h1 = __commonJS({
18307
18340
  util3.errorRequest(client, request4, err);
18308
18341
  }
18309
18342
  client[kPendingIdx] = client[kRunningIdx];
18310
- assert58(client[kRunning] === 0);
18343
+ assert59(client[kRunning] === 0);
18311
18344
  client.emit("disconnect", client[kUrl], [client], err);
18312
18345
  client[kResume]();
18313
18346
  }
@@ -18463,13 +18496,13 @@ upgrade: ${upgrade}\r
18463
18496
  } else if (util3.isIterable(body)) {
18464
18497
  writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload);
18465
18498
  } else {
18466
- assert58(false);
18499
+ assert59(false);
18467
18500
  }
18468
18501
  return true;
18469
18502
  }
18470
18503
  __name(writeH1, "writeH1");
18471
18504
  function writeStream(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
18472
- assert58(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
18505
+ assert59(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
18473
18506
  let finished = false;
18474
18507
  const writer = new AsyncWriter({ abort, socket, request: request4, contentLength, client, expectsPayload, header });
18475
18508
  const onData = /* @__PURE__ */ __name(function(chunk) {
@@ -18506,7 +18539,7 @@ upgrade: ${upgrade}\r
18506
18539
  return;
18507
18540
  }
18508
18541
  finished = true;
18509
- assert58(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
18542
+ assert59(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
18510
18543
  socket.off("drain", onDrain).off("error", onFinished);
18511
18544
  body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose);
18512
18545
  if (!err) {
@@ -18546,12 +18579,12 @@ upgrade: ${upgrade}\r
18546
18579
  \r
18547
18580
  `, "latin1");
18548
18581
  } else {
18549
- assert58(contentLength === null, "no body must not have content length");
18582
+ assert59(contentLength === null, "no body must not have content length");
18550
18583
  socket.write(`${header}\r
18551
18584
  `, "latin1");
18552
18585
  }
18553
18586
  } else if (util3.isBuffer(body)) {
18554
- assert58(contentLength === body.byteLength, "buffer body must have content length");
18587
+ assert59(contentLength === body.byteLength, "buffer body must have content length");
18555
18588
  socket.cork();
18556
18589
  socket.write(`${header}content-length: ${contentLength}\r
18557
18590
  \r
@@ -18571,7 +18604,7 @@ upgrade: ${upgrade}\r
18571
18604
  }
18572
18605
  __name(writeBuffer, "writeBuffer");
18573
18606
  async function writeBlob(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
18574
- assert58(contentLength === body.size, "blob body must have content length");
18607
+ assert59(contentLength === body.size, "blob body must have content length");
18575
18608
  try {
18576
18609
  if (contentLength != null && contentLength !== body.size) {
18577
18610
  throw new RequestContentLengthMismatchError();
@@ -18595,7 +18628,7 @@ upgrade: ${upgrade}\r
18595
18628
  }
18596
18629
  __name(writeBlob, "writeBlob");
18597
18630
  async function writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
18598
- assert58(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
18631
+ assert59(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
18599
18632
  let callback = null;
18600
18633
  function onDrain() {
18601
18634
  if (callback) {
@@ -18606,7 +18639,7 @@ upgrade: ${upgrade}\r
18606
18639
  }
18607
18640
  __name(onDrain, "onDrain");
18608
18641
  const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve31, reject) => {
18609
- assert58(callback === null);
18642
+ assert59(callback === null);
18610
18643
  if (socket[kError]) {
18611
18644
  reject(socket[kError]);
18612
18645
  } else {
@@ -18759,7 +18792,7 @@ ${len.toString(16)}\r
18759
18792
  const { socket, client, abort } = this;
18760
18793
  socket[kWriting] = false;
18761
18794
  if (err) {
18762
- assert58(client[kRunning] <= 1, "pipeline should only contain this request");
18795
+ assert59(client[kRunning] <= 1, "pipeline should only contain this request");
18763
18796
  abort(err);
18764
18797
  }
18765
18798
  }
@@ -18772,7 +18805,7 @@ ${len.toString(16)}\r
18772
18805
  var require_client_h2 = __commonJS({
18773
18806
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/dispatcher/client-h2.js"(exports, module4) {
18774
18807
  init_import_meta_url();
18775
- var assert58 = __require("assert");
18808
+ var assert59 = __require("assert");
18776
18809
  var { pipeline } = __require("stream");
18777
18810
  var util3 = require_util();
18778
18811
  var {
@@ -18952,7 +18985,7 @@ var require_client_h2 = __commonJS({
18952
18985
  }
18953
18986
  __name(onHttp2RemoteSettings, "onHttp2RemoteSettings");
18954
18987
  function onHttp2SessionError(err) {
18955
- assert58(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
18988
+ assert59(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
18956
18989
  this[kSocket][kError] = err;
18957
18990
  this[kClient][kOnError](err);
18958
18991
  }
@@ -18985,7 +19018,7 @@ var require_client_h2 = __commonJS({
18985
19018
  util3.errorRequest(client, request4, err);
18986
19019
  client[kPendingIdx] = client[kRunningIdx];
18987
19020
  }
18988
- assert58(client[kRunning] === 0);
19021
+ assert59(client[kRunning] === 0);
18989
19022
  client.emit("disconnect", client[kUrl], [client], err);
18990
19023
  client.emit("connectionError", client[kUrl], [client], err);
18991
19024
  client[kResume]();
@@ -18998,7 +19031,7 @@ var require_client_h2 = __commonJS({
18998
19031
  client[kSocket] = null;
18999
19032
  client[kHTTPContext] = null;
19000
19033
  if (client.destroyed) {
19001
- assert58(client[kPending] === 0);
19034
+ assert59(client[kPending] === 0);
19002
19035
  const requests = client[kQueue].splice(client[kRunningIdx]);
19003
19036
  for (let i7 = 0; i7 < requests.length; i7++) {
19004
19037
  const request4 = requests[i7];
@@ -19016,13 +19049,13 @@ var require_client_h2 = __commonJS({
19016
19049
  this[kHTTP2Session].destroy(err);
19017
19050
  }
19018
19051
  client[kPendingIdx] = client[kRunningIdx];
19019
- assert58(client[kRunning] === 0);
19052
+ assert59(client[kRunning] === 0);
19020
19053
  client.emit("disconnect", client[kUrl], [client], err);
19021
19054
  client[kResume]();
19022
19055
  }
19023
19056
  __name(onHttp2SocketClose, "onHttp2SocketClose");
19024
19057
  function onHttp2SocketError(err) {
19025
- assert58(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
19058
+ assert59(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
19026
19059
  this[kError] = err;
19027
19060
  this[kClient][kOnError](err);
19028
19061
  }
@@ -19179,7 +19212,7 @@ var require_client_h2 = __commonJS({
19179
19212
  process.emitWarning(new RequestContentLengthMismatchError());
19180
19213
  }
19181
19214
  if (contentLength != null) {
19182
- assert58(body || contentLength === 0, "no body must not have content length");
19215
+ assert59(body || contentLength === 0, "no body must not have content length");
19183
19216
  headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`;
19184
19217
  }
19185
19218
  session.ref();
@@ -19346,7 +19379,7 @@ var require_client_h2 = __commonJS({
19346
19379
  expectsPayload
19347
19380
  );
19348
19381
  } else {
19349
- assert58(false);
19382
+ assert59(false);
19350
19383
  }
19351
19384
  }
19352
19385
  }
@@ -19354,7 +19387,7 @@ var require_client_h2 = __commonJS({
19354
19387
  function writeBuffer(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
19355
19388
  try {
19356
19389
  if (body != null && util3.isBuffer(body)) {
19357
- assert58(contentLength === body.byteLength, "buffer body must have content length");
19390
+ assert59(contentLength === body.byteLength, "buffer body must have content length");
19358
19391
  h2stream.cork();
19359
19392
  h2stream.write(body);
19360
19393
  h2stream.uncork();
@@ -19372,7 +19405,7 @@ var require_client_h2 = __commonJS({
19372
19405
  }
19373
19406
  __name(writeBuffer, "writeBuffer");
19374
19407
  function writeStream(abort, socket, expectsPayload, h2stream, body, client, request4, contentLength) {
19375
- assert58(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
19408
+ assert59(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
19376
19409
  const pipe = pipeline(
19377
19410
  body,
19378
19411
  h2stream,
@@ -19398,7 +19431,7 @@ var require_client_h2 = __commonJS({
19398
19431
  }
19399
19432
  __name(writeStream, "writeStream");
19400
19433
  async function writeBlob(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
19401
- assert58(contentLength === body.size, "blob body must have content length");
19434
+ assert59(contentLength === body.size, "blob body must have content length");
19402
19435
  try {
19403
19436
  if (contentLength != null && contentLength !== body.size) {
19404
19437
  throw new RequestContentLengthMismatchError();
@@ -19420,7 +19453,7 @@ var require_client_h2 = __commonJS({
19420
19453
  }
19421
19454
  __name(writeBlob, "writeBlob");
19422
19455
  async function writeIterable(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
19423
- assert58(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
19456
+ assert59(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
19424
19457
  let callback = null;
19425
19458
  function onDrain() {
19426
19459
  if (callback) {
@@ -19431,7 +19464,7 @@ var require_client_h2 = __commonJS({
19431
19464
  }
19432
19465
  __name(onDrain, "onDrain");
19433
19466
  const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve31, reject) => {
19434
- assert58(callback === null);
19467
+ assert59(callback === null);
19435
19468
  if (socket[kError]) {
19436
19469
  reject(socket[kError]);
19437
19470
  } else {
@@ -19471,7 +19504,7 @@ var require_client_h2 = __commonJS({
19471
19504
  var require_client = __commonJS({
19472
19505
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/dispatcher/client.js"(exports, module4) {
19473
19506
  init_import_meta_url();
19474
- var assert58 = __require("assert");
19507
+ var assert59 = __require("assert");
19475
19508
  var net2 = __require("net");
19476
19509
  var http6 = __require("http");
19477
19510
  var util3 = require_util();
@@ -19763,25 +19796,25 @@ var require_client = __commonJS({
19763
19796
  };
19764
19797
  function onError(client, err) {
19765
19798
  if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
19766
- assert58(client[kPendingIdx] === client[kRunningIdx]);
19799
+ assert59(client[kPendingIdx] === client[kRunningIdx]);
19767
19800
  const requests = client[kQueue].splice(client[kRunningIdx]);
19768
19801
  for (let i7 = 0; i7 < requests.length; i7++) {
19769
19802
  const request4 = requests[i7];
19770
19803
  util3.errorRequest(client, request4, err);
19771
19804
  }
19772
- assert58(client[kSize] === 0);
19805
+ assert59(client[kSize] === 0);
19773
19806
  }
19774
19807
  }
19775
19808
  __name(onError, "onError");
19776
19809
  function connect(client) {
19777
- assert58(!client[kConnecting]);
19778
- assert58(!client[kHTTPContext]);
19810
+ assert59(!client[kConnecting]);
19811
+ assert59(!client[kHTTPContext]);
19779
19812
  let { host, hostname: hostname2, protocol, port } = client[kUrl];
19780
19813
  if (hostname2[0] === "[") {
19781
19814
  const idx = hostname2.indexOf("]");
19782
- assert58(idx !== -1);
19815
+ assert59(idx !== -1);
19783
19816
  const ip = hostname2.substring(1, idx);
19784
- assert58(net2.isIPv6(ip));
19817
+ assert59(net2.isIPv6(ip));
19785
19818
  hostname2 = ip;
19786
19819
  }
19787
19820
  client[kConnecting] = true;
@@ -19817,7 +19850,7 @@ var require_client = __commonJS({
19817
19850
  client[kResume]();
19818
19851
  return;
19819
19852
  }
19820
- assert58(socket);
19853
+ assert59(socket);
19821
19854
  try {
19822
19855
  client[kHTTPContext] = socket.alpnProtocol === "h2" ? connectH2(client, socket) : connectH1(client, socket);
19823
19856
  } catch (err2) {
@@ -19872,7 +19905,7 @@ var require_client = __commonJS({
19872
19905
  });
19873
19906
  }
19874
19907
  if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
19875
- assert58(client[kRunning] === 0);
19908
+ assert59(client[kRunning] === 0);
19876
19909
  while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
19877
19910
  const request4 = client[kQueue][client[kPendingIdx]++];
19878
19911
  util3.errorRequest(client, request4, err);
@@ -19905,7 +19938,7 @@ var require_client = __commonJS({
19905
19938
  function _resume(client, sync) {
19906
19939
  while (true) {
19907
19940
  if (client.destroyed) {
19908
- assert58(client[kPending] === 0);
19941
+ assert59(client[kPending] === 0);
19909
19942
  return;
19910
19943
  }
19911
19944
  if (client[kClosedResolve] && !client[kSize]) {
@@ -21111,7 +21144,7 @@ var require_env_http_proxy_agent = __commonJS({
21111
21144
  var require_retry_handler = __commonJS({
21112
21145
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/handler/retry-handler.js"(exports, module4) {
21113
21146
  init_import_meta_url();
21114
- var assert58 = __require("assert");
21147
+ var assert59 = __require("assert");
21115
21148
  var { kRetryHandlerDefaultRetry } = require_symbols();
21116
21149
  var { RequestRetryError } = require_errors();
21117
21150
  var WrapHandler = require_wrap_handler();
@@ -21298,8 +21331,8 @@ var require_retry_handler = __commonJS({
21298
21331
  });
21299
21332
  }
21300
21333
  const { start, size, end = size ? size - 1 : null } = contentRange;
21301
- assert58(this.start === start, "content-range mismatch");
21302
- assert58(this.end == null || this.end === end, "content-range mismatch");
21334
+ assert59(this.start === start, "content-range mismatch");
21335
+ assert59(this.end == null || this.end === end, "content-range mismatch");
21303
21336
  return;
21304
21337
  }
21305
21338
  if (this.end == null) {
@@ -21316,11 +21349,11 @@ var require_retry_handler = __commonJS({
21316
21349
  return;
21317
21350
  }
21318
21351
  const { start, size, end = size ? size - 1 : null } = range;
21319
- assert58(
21352
+ assert59(
21320
21353
  start != null && Number.isFinite(start),
21321
21354
  "content-range mismatch"
21322
21355
  );
21323
- assert58(end != null && Number.isFinite(end), "invalid content-length");
21356
+ assert59(end != null && Number.isFinite(end), "invalid content-length");
21324
21357
  this.start = start;
21325
21358
  this.end = end;
21326
21359
  }
@@ -21328,8 +21361,8 @@ var require_retry_handler = __commonJS({
21328
21361
  const contentLength = headers["content-length"];
21329
21362
  this.end = contentLength != null ? Number(contentLength) - 1 : null;
21330
21363
  }
21331
- assert58(Number.isFinite(this.start));
21332
- assert58(
21364
+ assert59(Number.isFinite(this.start));
21365
+ assert59(
21333
21366
  this.end == null || Number.isFinite(this.end),
21334
21367
  "invalid content-length"
21335
21368
  );
@@ -21510,7 +21543,7 @@ var require_h2c_client = __commonJS({
21510
21543
  var require_readable = __commonJS({
21511
21544
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/api/readable.js"(exports, module4) {
21512
21545
  init_import_meta_url();
21513
- var assert58 = __require("assert");
21546
+ var assert59 = __require("assert");
21514
21547
  var { Readable: Readable11 } = __require("stream");
21515
21548
  var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError2 } = require_errors();
21516
21549
  var util3 = require_util();
@@ -21707,7 +21740,7 @@ var require_readable = __commonJS({
21707
21740
  this[kBody] = ReadableStreamFrom(this);
21708
21741
  if (this[kConsume]) {
21709
21742
  this[kBody].getReader();
21710
- assert58(this[kBody].locked);
21743
+ assert59(this[kBody].locked);
21711
21744
  }
21712
21745
  }
21713
21746
  return this[kBody];
@@ -21778,7 +21811,7 @@ var require_readable = __commonJS({
21778
21811
  }
21779
21812
  __name(isUnusable, "isUnusable");
21780
21813
  function consume(stream2, type) {
21781
- assert58(!stream2[kConsume]);
21814
+ assert59(!stream2[kConsume]);
21782
21815
  return new Promise((resolve31, reject) => {
21783
21816
  if (isUnusable(stream2)) {
21784
21817
  const rState = stream2._readableState;
@@ -21924,7 +21957,7 @@ var require_readable = __commonJS({
21924
21957
  var require_api_request = __commonJS({
21925
21958
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/api/api-request.js"(exports, module4) {
21926
21959
  init_import_meta_url();
21927
- var assert58 = __require("assert");
21960
+ var assert59 = __require("assert");
21928
21961
  var { AsyncResource } = __require("async_hooks");
21929
21962
  var { Readable: Readable11 } = require_readable();
21930
21963
  var { InvalidArgumentError, RequestAbortedError } = require_errors();
@@ -21995,7 +22028,7 @@ var require_api_request = __commonJS({
21995
22028
  abort(this.reason);
21996
22029
  return;
21997
22030
  }
21998
- assert58(this.callback);
22031
+ assert59(this.callback);
21999
22032
  this.abort = abort;
22000
22033
  this.context = context2;
22001
22034
  }
@@ -22161,7 +22194,7 @@ var require_abort_signal = __commonJS({
22161
22194
  var require_api_stream = __commonJS({
22162
22195
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/api/api-stream.js"(exports, module4) {
22163
22196
  init_import_meta_url();
22164
- var assert58 = __require("assert");
22197
+ var assert59 = __require("assert");
22165
22198
  var { finished } = __require("stream");
22166
22199
  var { AsyncResource } = __require("async_hooks");
22167
22200
  var { InvalidArgumentError, InvalidReturnValueError } = require_errors();
@@ -22224,7 +22257,7 @@ var require_api_stream = __commonJS({
22224
22257
  abort(this.reason);
22225
22258
  return;
22226
22259
  }
22227
- assert58(this.callback);
22260
+ assert59(this.callback);
22228
22261
  this.abort = abort;
22229
22262
  this.context = context2;
22230
22263
  }
@@ -22332,7 +22365,7 @@ var require_api_pipeline = __commonJS({
22332
22365
  Duplex: Duplex2,
22333
22366
  PassThrough: PassThrough4
22334
22367
  } = __require("stream");
22335
- var assert58 = __require("assert");
22368
+ var assert59 = __require("assert");
22336
22369
  var { AsyncResource } = __require("async_hooks");
22337
22370
  var {
22338
22371
  InvalidArgumentError,
@@ -22456,7 +22489,7 @@ var require_api_pipeline = __commonJS({
22456
22489
  abort(this.reason);
22457
22490
  return;
22458
22491
  }
22459
- assert58(!res, "pipeline cannot be retried");
22492
+ assert59(!res, "pipeline cannot be retried");
22460
22493
  this.abort = abort;
22461
22494
  this.context = context2;
22462
22495
  }
@@ -22541,7 +22574,7 @@ var require_api_upgrade = __commonJS({
22541
22574
  init_import_meta_url();
22542
22575
  var { InvalidArgumentError, SocketError } = require_errors();
22543
22576
  var { AsyncResource } = __require("async_hooks");
22544
- var assert58 = __require("assert");
22577
+ var assert59 = __require("assert");
22545
22578
  var util3 = require_util();
22546
22579
  var { kHTTP2Stream } = require_symbols();
22547
22580
  var { addSignal, removeSignal } = require_abort_signal();
@@ -22573,7 +22606,7 @@ var require_api_upgrade = __commonJS({
22573
22606
  abort(this.reason);
22574
22607
  return;
22575
22608
  }
22576
- assert58(this.callback);
22609
+ assert59(this.callback);
22577
22610
  this.abort = abort;
22578
22611
  this.context = null;
22579
22612
  }
@@ -22581,7 +22614,7 @@ var require_api_upgrade = __commonJS({
22581
22614
  throw new SocketError("bad upgrade", null);
22582
22615
  }
22583
22616
  onUpgrade(statusCode, rawHeaders, socket) {
22584
- assert58(socket[kHTTP2Stream] === true ? statusCode === 200 : statusCode === 101);
22617
+ assert59(socket[kHTTP2Stream] === true ? statusCode === 200 : statusCode === 101);
22585
22618
  const { callback, opaque, context: context2 } = this;
22586
22619
  removeSignal(this);
22587
22620
  this.callback = null;
@@ -22637,7 +22670,7 @@ var require_api_upgrade = __commonJS({
22637
22670
  var require_api_connect = __commonJS({
22638
22671
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/api/api-connect.js"(exports, module4) {
22639
22672
  init_import_meta_url();
22640
- var assert58 = __require("assert");
22673
+ var assert59 = __require("assert");
22641
22674
  var { AsyncResource } = __require("async_hooks");
22642
22675
  var { InvalidArgumentError, SocketError } = require_errors();
22643
22676
  var util3 = require_util();
@@ -22669,7 +22702,7 @@ var require_api_connect = __commonJS({
22669
22702
  abort(this.reason);
22670
22703
  return;
22671
22704
  }
22672
- assert58(this.callback);
22705
+ assert59(this.callback);
22673
22706
  this.abort = abort;
22674
22707
  this.context = context2;
22675
22708
  }
@@ -24724,7 +24757,7 @@ var require_global2 = __commonJS({
24724
24757
  var require_decorator_handler = __commonJS({
24725
24758
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/handler/decorator-handler.js"(exports, module4) {
24726
24759
  init_import_meta_url();
24727
- var assert58 = __require("assert");
24760
+ var assert59 = __require("assert");
24728
24761
  var WrapHandler = require_wrap_handler();
24729
24762
  module4.exports = class DecoratorHandler {
24730
24763
  static {
@@ -24744,25 +24777,25 @@ var require_decorator_handler = __commonJS({
24744
24777
  this.#handler.onRequestStart?.(...args);
24745
24778
  }
24746
24779
  onRequestUpgrade(...args) {
24747
- assert58(!this.#onCompleteCalled);
24748
- assert58(!this.#onErrorCalled);
24780
+ assert59(!this.#onCompleteCalled);
24781
+ assert59(!this.#onErrorCalled);
24749
24782
  return this.#handler.onRequestUpgrade?.(...args);
24750
24783
  }
24751
24784
  onResponseStart(...args) {
24752
- assert58(!this.#onCompleteCalled);
24753
- assert58(!this.#onErrorCalled);
24754
- assert58(!this.#onResponseStartCalled);
24785
+ assert59(!this.#onCompleteCalled);
24786
+ assert59(!this.#onErrorCalled);
24787
+ assert59(!this.#onResponseStartCalled);
24755
24788
  this.#onResponseStartCalled = true;
24756
24789
  return this.#handler.onResponseStart?.(...args);
24757
24790
  }
24758
24791
  onResponseData(...args) {
24759
- assert58(!this.#onCompleteCalled);
24760
- assert58(!this.#onErrorCalled);
24792
+ assert59(!this.#onCompleteCalled);
24793
+ assert59(!this.#onErrorCalled);
24761
24794
  return this.#handler.onResponseData?.(...args);
24762
24795
  }
24763
24796
  onResponseEnd(...args) {
24764
- assert58(!this.#onCompleteCalled);
24765
- assert58(!this.#onErrorCalled);
24797
+ assert59(!this.#onCompleteCalled);
24798
+ assert59(!this.#onErrorCalled);
24766
24799
  this.#onCompleteCalled = true;
24767
24800
  return this.#handler.onResponseEnd?.(...args);
24768
24801
  }
@@ -24785,7 +24818,7 @@ var require_redirect_handler = __commonJS({
24785
24818
  init_import_meta_url();
24786
24819
  var util3 = require_util();
24787
24820
  var { kBodyUsed } = require_symbols();
24788
- var assert58 = __require("assert");
24821
+ var assert59 = __require("assert");
24789
24822
  var { InvalidArgumentError } = require_errors();
24790
24823
  var EE = __require("events");
24791
24824
  var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
@@ -24801,7 +24834,7 @@ var require_redirect_handler = __commonJS({
24801
24834
  this[kBodyUsed] = false;
24802
24835
  }
24803
24836
  async *[Symbol.asyncIterator]() {
24804
- assert58(!this[kBodyUsed], "disturbed");
24837
+ assert59(!this[kBodyUsed], "disturbed");
24805
24838
  this[kBodyUsed] = true;
24806
24839
  yield* this[kBody];
24807
24840
  }
@@ -24831,7 +24864,7 @@ var require_redirect_handler = __commonJS({
24831
24864
  if (util3.isStream(this.opts.body)) {
24832
24865
  if (util3.bodyLength(this.opts.body) === 0) {
24833
24866
  this.opts.body.on("data", function() {
24834
- assert58(false);
24867
+ assert59(false);
24835
24868
  });
24836
24869
  }
24837
24870
  if (typeof this.opts.body.readableDidRead !== "boolean") {
@@ -24937,7 +24970,7 @@ var require_redirect_handler = __commonJS({
24937
24970
  }
24938
24971
  }
24939
24972
  } else {
24940
- assert58(headers == null, "headers must be an object or an array");
24973
+ assert59(headers == null, "headers must be an object or an array");
24941
24974
  }
24942
24975
  return ret;
24943
24976
  }
@@ -26857,7 +26890,7 @@ var require_memory_cache_store = __commonJS({
26857
26890
  var require_cache_revalidation_handler = __commonJS({
26858
26891
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/handler/cache-revalidation-handler.js"(exports, module4) {
26859
26892
  init_import_meta_url();
26860
- var assert58 = __require("assert");
26893
+ var assert59 = __require("assert");
26861
26894
  var CacheRevalidationHandler = class {
26862
26895
  static {
26863
26896
  __name(this, "CacheRevalidationHandler");
@@ -26897,7 +26930,7 @@ var require_cache_revalidation_handler = __commonJS({
26897
26930
  this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket);
26898
26931
  }
26899
26932
  onResponseStart(controller, statusCode, headers, statusMessage) {
26900
- assert58(this.#callback != null);
26933
+ assert59(this.#callback != null);
26901
26934
  this.#successful = statusCode === 304 || this.#allowErrorStatusCodes && statusCode >= 500 && statusCode <= 504;
26902
26935
  this.#callback(this.#successful, this.#context);
26903
26936
  this.#callback = null;
@@ -26947,7 +26980,7 @@ var require_cache_revalidation_handler = __commonJS({
26947
26980
  var require_cache2 = __commonJS({
26948
26981
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/interceptor/cache.js"(exports, module4) {
26949
26982
  init_import_meta_url();
26950
- var assert58 = __require("assert");
26983
+ var assert59 = __require("assert");
26951
26984
  var { Readable: Readable11 } = __require("stream");
26952
26985
  var util3 = require_util();
26953
26986
  var CacheHandler = require_cache_handler();
@@ -27030,8 +27063,8 @@ var require_cache2 = __commonJS({
27030
27063
  __name(handleUncachedResponse, "handleUncachedResponse");
27031
27064
  function sendCachedValue(handler, opts, result, age, context2, isStale2) {
27032
27065
  const stream2 = util3.isStream(result.body) ? result.body : Readable11.from(result.body ?? []);
27033
- assert58(!stream2.destroyed, "stream should not be destroyed");
27034
- assert58(!stream2.readableDidRead, "stream should not be readableDidRead");
27066
+ assert59(!stream2.destroyed, "stream should not be destroyed");
27067
+ assert59(!stream2.readableDidRead, "stream should not be readableDidRead");
27035
27068
  const controller = {
27036
27069
  resume() {
27037
27070
  stream2.resume();
@@ -28124,7 +28157,7 @@ var require_headers = __commonJS({
28124
28157
  isValidHeaderValue
28125
28158
  } = require_util2();
28126
28159
  var { webidl } = require_webidl();
28127
- var assert58 = __require("assert");
28160
+ var assert59 = __require("assert");
28128
28161
  var util3 = __require("util");
28129
28162
  function isHTTPWhiteSpaceCharCode(code) {
28130
28163
  return code === 10 || code === 13 || code === 9 || code === 32;
@@ -28349,11 +28382,11 @@ var require_headers = __commonJS({
28349
28382
  const iterator = this.headersMap[Symbol.iterator]();
28350
28383
  const firstValue = iterator.next().value;
28351
28384
  array[0] = [firstValue[0], firstValue[1].value];
28352
- assert58(firstValue[1].value !== null);
28385
+ assert59(firstValue[1].value !== null);
28353
28386
  for (let i7 = 1, j7 = 0, right2 = 0, left2 = 0, pivot = 0, x7, value; i7 < size; ++i7) {
28354
28387
  value = iterator.next().value;
28355
28388
  x7 = array[i7] = [value[0], value[1].value];
28356
- assert58(x7[1] !== null);
28389
+ assert59(x7[1] !== null);
28357
28390
  left2 = 0;
28358
28391
  right2 = i7;
28359
28392
  while (left2 < right2) {
@@ -28380,7 +28413,7 @@ var require_headers = __commonJS({
28380
28413
  let i7 = 0;
28381
28414
  for (const { 0: name2, 1: { value } } of this.headersMap) {
28382
28415
  array[i7++] = [name2, value];
28383
- assert58(value !== null);
28416
+ assert59(value !== null);
28384
28417
  }
28385
28418
  return array.sort(compareHeaderName);
28386
28419
  }
@@ -28608,7 +28641,7 @@ var require_response = __commonJS({
28608
28641
  var { webidl } = require_webidl();
28609
28642
  var { URLSerializer } = require_data_url();
28610
28643
  var { kConstruct } = require_symbols();
28611
- var assert58 = __require("assert");
28644
+ var assert59 = __require("assert");
28612
28645
  var { isomorphicEncode, serializeJavascriptValueToJSONString } = require_infra();
28613
28646
  var textEncoder = new TextEncoder("utf-8");
28614
28647
  var Response11 = class _Response {
@@ -28872,7 +28905,7 @@ var require_response = __commonJS({
28872
28905
  return p7 in state2 ? state2[p7] : target[p7];
28873
28906
  },
28874
28907
  set(target, p7, value) {
28875
- assert58(!(p7 in state2));
28908
+ assert59(!(p7 in state2));
28876
28909
  target[p7] = value;
28877
28910
  return true;
28878
28911
  }
@@ -28907,12 +28940,12 @@ var require_response = __commonJS({
28907
28940
  body: null
28908
28941
  });
28909
28942
  } else {
28910
- assert58(false);
28943
+ assert59(false);
28911
28944
  }
28912
28945
  }
28913
28946
  __name(filterResponse, "filterResponse");
28914
28947
  function makeAppropriateNetworkError(fetchParams, err = null) {
28915
- assert58(isCancelled(fetchParams));
28948
+ assert59(isCancelled(fetchParams));
28916
28949
  return isAborted2(fetchParams) ? makeNetworkError(Object.assign(new DOMException("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException("Request was cancelled."), { cause: err }));
28917
28950
  }
28918
28951
  __name(makeAppropriateNetworkError, "makeAppropriateNetworkError");
@@ -29046,7 +29079,7 @@ var require_request2 = __commonJS({
29046
29079
  var { webidl } = require_webidl();
29047
29080
  var { URLSerializer } = require_data_url();
29048
29081
  var { kConstruct } = require_symbols();
29049
- var assert58 = __require("assert");
29082
+ var assert59 = __require("assert");
29050
29083
  var { getMaxListeners, setMaxListeners, defaultMaxListeners } = __require("events");
29051
29084
  var kAbortController = Symbol("abortController");
29052
29085
  var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {
@@ -29126,7 +29159,7 @@ var require_request2 = __commonJS({
29126
29159
  request4 = makeRequest({ urlList: [parsedURL] });
29127
29160
  fallbackMode = "cors";
29128
29161
  } else {
29129
- assert58(webidl.is.Request(input));
29162
+ assert59(webidl.is.Request(input));
29130
29163
  request4 = input.#state;
29131
29164
  signal = input.#signal;
29132
29165
  this.#dispatcher = init4.dispatcher || input.#dispatcher;
@@ -29784,7 +29817,7 @@ var require_request2 = __commonJS({
29784
29817
  var require_subresource_integrity = __commonJS({
29785
29818
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js"(exports, module4) {
29786
29819
  init_import_meta_url();
29787
- var assert58 = __require("assert");
29820
+ var assert59 = __require("assert");
29788
29821
  var { runtimeFeatures } = require_runtime_features();
29789
29822
  var validSRIHashAlgorithmTokenSet = /* @__PURE__ */ new Map([["sha256", 0], ["sha384", 1], ["sha512", 2]]);
29790
29823
  var crypto9;
@@ -29832,7 +29865,7 @@ var require_subresource_integrity = __commonJS({
29832
29865
  const result = [];
29833
29866
  let strongest = null;
29834
29867
  for (const item of metadataList) {
29835
- assert58(isValidSRIHashAlgorithm(item.alg), "Invalid SRI hash algorithm token");
29868
+ assert59(isValidSRIHashAlgorithm(item.alg), "Invalid SRI hash algorithm token");
29836
29869
  if (result.length === 0) {
29837
29870
  result.push(item);
29838
29871
  strongest = item;
@@ -29968,7 +30001,7 @@ var require_fetch = __commonJS({
29968
30001
  createInflate,
29969
30002
  extractMimeType
29970
30003
  } = require_util2();
29971
- var assert58 = __require("assert");
30004
+ var assert59 = __require("assert");
29972
30005
  var { safelyExtractBody, extractBody } = require_body();
29973
30006
  var {
29974
30007
  redirectStatusSet,
@@ -30055,7 +30088,7 @@ var require_fetch = __commonJS({
30055
30088
  requestObject.signal,
30056
30089
  () => {
30057
30090
  locallyAborted = true;
30058
- assert58(controller != null);
30091
+ assert59(controller != null);
30059
30092
  controller.abort(requestObject.signal.reason);
30060
30093
  const realResponse = responseObject?.deref();
30061
30094
  abortFetch(p7, request4, realResponse, requestObject.signal.reason);
@@ -30161,7 +30194,7 @@ var require_fetch = __commonJS({
30161
30194
  dispatcher = getGlobalDispatcher2()
30162
30195
  // undici
30163
30196
  }) {
30164
- assert58(dispatcher);
30197
+ assert59(dispatcher);
30165
30198
  let taskDestination = null;
30166
30199
  let crossOriginIsolatedCapability = false;
30167
30200
  if (request4.client != null) {
@@ -30184,7 +30217,7 @@ var require_fetch = __commonJS({
30184
30217
  taskDestination,
30185
30218
  crossOriginIsolatedCapability
30186
30219
  };
30187
- assert58(!request4.body || request4.body.stream);
30220
+ assert59(!request4.body || request4.body.stream);
30188
30221
  if (request4.window === "client") {
30189
30222
  request4.window = request4.client?.globalObject?.constructor?.name === "Window" ? request4.client : "no-window";
30190
30223
  }
@@ -30272,7 +30305,7 @@ var require_fetch = __commonJS({
30272
30305
  } else if (request4.responseTainting === "opaque") {
30273
30306
  response = filterResponse(response, "opaque");
30274
30307
  } else {
30275
- assert58(false);
30308
+ assert59(false);
30276
30309
  }
30277
30310
  }
30278
30311
  let internalResponse = response.status === 0 ? response : response.internalResponse;
@@ -30505,7 +30538,7 @@ var require_fetch = __commonJS({
30505
30538
  } else if (request4.redirect === "follow") {
30506
30539
  response = await httpRedirectFetch(fetchParams, response);
30507
30540
  } else {
30508
- assert58(false);
30541
+ assert59(false);
30509
30542
  }
30510
30543
  }
30511
30544
  response.timingInfo = timingInfo;
@@ -30559,7 +30592,7 @@ var require_fetch = __commonJS({
30559
30592
  request4.headersList.delete("host", true);
30560
30593
  }
30561
30594
  if (request4.body != null) {
30562
- assert58(request4.body.source != null);
30595
+ assert59(request4.body.source != null);
30563
30596
  request4.body = safelyExtractBody(request4.body.source)[0];
30564
30597
  }
30565
30598
  const timingInfo = fetchParams.timingInfo;
@@ -30683,7 +30716,7 @@ var require_fetch = __commonJS({
30683
30716
  }
30684
30717
  __name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");
30685
30718
  async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
30686
- assert58(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
30719
+ assert59(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
30687
30720
  fetchParams.controller.connection = {
30688
30721
  abort: null,
30689
30722
  destroyed: false,
@@ -30993,7 +31026,7 @@ var require_fetch = __commonJS({
30993
31026
  var require_util3 = __commonJS({
30994
31027
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/web/cache/util.js"(exports, module4) {
30995
31028
  init_import_meta_url();
30996
- var assert58 = __require("assert");
31029
+ var assert59 = __require("assert");
30997
31030
  var { URLSerializer } = require_data_url();
30998
31031
  var { isValidHeaderName } = require_util2();
30999
31032
  function urlEquals(A4, B4, excludeFragment = false) {
@@ -31003,7 +31036,7 @@ var require_util3 = __commonJS({
31003
31036
  }
31004
31037
  __name(urlEquals, "urlEquals");
31005
31038
  function getFieldValues(header) {
31006
- assert58(header !== null);
31039
+ assert59(header !== null);
31007
31040
  const values = [];
31008
31041
  for (let value of header.split(",")) {
31009
31042
  value = value.trim();
@@ -31025,7 +31058,7 @@ var require_util3 = __commonJS({
31025
31058
  var require_cache3 = __commonJS({
31026
31059
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/web/cache/cache.js"(exports, module4) {
31027
31060
  init_import_meta_url();
31028
- var assert58 = __require("assert");
31061
+ var assert59 = __require("assert");
31029
31062
  var { kConstruct } = require_symbols();
31030
31063
  var { urlEquals, getFieldValues } = require_util3();
31031
31064
  var { kEnumerableProperty, isDisturbed } = require_util();
@@ -31278,7 +31311,7 @@ var require_cache3 = __commonJS({
31278
31311
  return false;
31279
31312
  }
31280
31313
  } else {
31281
- assert58(typeof request4 === "string");
31314
+ assert59(typeof request4 === "string");
31282
31315
  r9 = getRequestState(new Request7(request4));
31283
31316
  }
31284
31317
  const operations = [];
@@ -31389,7 +31422,7 @@ var require_cache3 = __commonJS({
31389
31422
  }
31390
31423
  for (const requestResponse of requestResponses) {
31391
31424
  const idx = cache6.indexOf(requestResponse);
31392
- assert58(idx !== -1);
31425
+ assert59(idx !== -1);
31393
31426
  cache6.splice(idx, 1);
31394
31427
  }
31395
31428
  } else if (operation.type === "put") {
@@ -31421,7 +31454,7 @@ var require_cache3 = __commonJS({
31421
31454
  requestResponses = this.#queryCache(operation.request);
31422
31455
  for (const requestResponse of requestResponses) {
31423
31456
  const idx = cache6.indexOf(requestResponse);
31424
- assert58(idx !== -1);
31457
+ assert59(idx !== -1);
31425
31458
  cache6.splice(idx, 1);
31426
31459
  }
31427
31460
  cache6.push([operation.request, operation.response]);
@@ -31884,7 +31917,7 @@ var require_parse = __commonJS({
31884
31917
  var { collectASequenceOfCodePointsFast } = require_infra();
31885
31918
  var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4();
31886
31919
  var { isCTLExcludingHtab } = require_util4();
31887
- var assert58 = __require("assert");
31920
+ var assert59 = __require("assert");
31888
31921
  var { unescape: qsUnescape } = __require("querystring");
31889
31922
  function parseSetCookie(header) {
31890
31923
  if (isCTLExcludingHtab(header)) {
@@ -31928,7 +31961,7 @@ var require_parse = __commonJS({
31928
31961
  if (unparsedAttributes.length === 0) {
31929
31962
  return cookieAttributeList;
31930
31963
  }
31931
- assert58(unparsedAttributes[0] === ";");
31964
+ assert59(unparsedAttributes[0] === ";");
31932
31965
  unparsedAttributes = unparsedAttributes.slice(1);
31933
31966
  let cookieAv = "";
31934
31967
  if (unparsedAttributes.includes(";")) {
@@ -32803,7 +32836,7 @@ var require_connection = __commonJS({
32803
32836
  var { Headers: Headers5, getHeadersList } = require_headers();
32804
32837
  var { getDecodeSplit } = require_util2();
32805
32838
  var { WebsocketFrameSend } = require_frame();
32806
- var assert58 = __require("assert");
32839
+ var assert59 = __require("assert");
32807
32840
  var { runtimeFeatures } = require_runtime_features();
32808
32841
  var crypto9 = runtimeFeatures.has("crypto") ? __require("crypto") : null;
32809
32842
  var warningEmitted2 = false;
@@ -32908,7 +32941,7 @@ var require_connection = __commonJS({
32908
32941
  if (reason.length !== 0 && code === null) {
32909
32942
  code = 1e3;
32910
32943
  }
32911
- assert58(code === null || Number.isInteger(code));
32944
+ assert59(code === null || Number.isInteger(code));
32912
32945
  if (code === null && reason.length === 0) {
32913
32946
  frame.frameData = emptyBuffer;
32914
32947
  } else if (code !== null && reason === null) {
@@ -33012,7 +33045,7 @@ var require_receiver = __commonJS({
33012
33045
  "../../node_modules/.pnpm/undici@7.18.2/node_modules/undici/lib/web/websocket/receiver.js"(exports, module4) {
33013
33046
  init_import_meta_url();
33014
33047
  var { Writable: Writable5 } = __require("stream");
33015
- var assert58 = __require("assert");
33048
+ var assert59 = __require("assert");
33016
33049
  var { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants5();
33017
33050
  var {
33018
33051
  isValidStatusCode,
@@ -33252,7 +33285,7 @@ var require_receiver = __commonJS({
33252
33285
  return output;
33253
33286
  }
33254
33287
  parseCloseBody(data) {
33255
- assert58(data.length !== 1);
33288
+ assert59(data.length !== 1);
33256
33289
  let code;
33257
33290
  if (data.length >= 2) {
33258
33291
  code = data.readUInt16BE(0);
@@ -35933,6 +35966,19 @@ var init_EventType = __esm({
35933
35966
  }
35934
35967
  });
35935
35968
 
35969
+ // ../containers-shared/src/client/models/ExternalRegistryKind.ts
35970
+ var ExternalRegistryKind;
35971
+ var init_ExternalRegistryKind = __esm({
35972
+ "../containers-shared/src/client/models/ExternalRegistryKind.ts"() {
35973
+ init_import_meta_url();
35974
+ ExternalRegistryKind = /* @__PURE__ */ ((ExternalRegistryKind2) => {
35975
+ ExternalRegistryKind2["ECR"] = "ECR";
35976
+ ExternalRegistryKind2["DOCKER_HUB"] = "DockerHub";
35977
+ return ExternalRegistryKind2;
35978
+ })(ExternalRegistryKind || {});
35979
+ }
35980
+ });
35981
+
35936
35982
  // ../containers-shared/src/client/models/HTTPMethod.ts
35937
35983
  var init_HTTPMethod = __esm({
35938
35984
  "../containers-shared/src/client/models/HTTPMethod.ts"() {
@@ -37762,6 +37808,7 @@ var init_client = __esm({
37762
37808
  init_DurableObjectStatusHealth();
37763
37809
  init_EventName();
37764
37810
  init_EventType();
37811
+ init_ExternalRegistryKind();
37765
37812
  init_HTTPMethod();
37766
37813
  init_ImageRegistryAlreadyExistsError();
37767
37814
  init_ImageRegistryIsPublic();
@@ -38175,19 +38222,14 @@ var init_types = __esm({
38175
38222
  }
38176
38223
  });
38177
38224
 
38178
- // ../containers-shared/src/client/models/ExternalRegistryKind.ts
38179
- var ExternalRegistryKind;
38180
- var init_ExternalRegistryKind = __esm({
38181
- "../containers-shared/src/client/models/ExternalRegistryKind.ts"() {
38182
- init_import_meta_url();
38183
- ExternalRegistryKind = /* @__PURE__ */ ((ExternalRegistryKind2) => {
38184
- ExternalRegistryKind2["ECR"] = "ECR";
38185
- return ExternalRegistryKind2;
38186
- })(ExternalRegistryKind || {});
38187
- }
38188
- });
38189
-
38190
38225
  // ../containers-shared/src/images.ts
38226
+ function getEgressInterceptorImage() {
38227
+ return process.env.MINIFLARE_CONTAINER_EGRESS_IMAGE ?? DEFAULT_CONTAINER_EGRESS_INTERCEPTOR_IMAGE;
38228
+ }
38229
+ async function pullEgressInterceptorImage(dockerPath) {
38230
+ const image = getEgressInterceptorImage();
38231
+ await runDockerCmd(dockerPath, ["pull", image, "--platform", "linux/amd64"]);
38232
+ }
38191
38233
  async function pullImage(dockerPath, options, logger4, isVite) {
38192
38234
  const domain2 = new URL(`http://${options.image_uri}`).hostname;
38193
38235
  const isExternalRegistry = domain2 !== getCloudflareContainerRegistry();
@@ -38283,6 +38325,9 @@ async function prepareContainerImagesForDev(args) {
38283
38325
  await checkExposedPorts(dockerPath, options);
38284
38326
  }
38285
38327
  }
38328
+ if (!aborted && args.compatibilityFlags?.includes("experimental")) {
38329
+ await pullEgressInterceptorImage(dockerPath);
38330
+ }
38286
38331
  }
38287
38332
  function resolveImageName(accountId, image) {
38288
38333
  let url4;
@@ -38314,7 +38359,7 @@ Current account: "${accountId}"`
38314
38359
  }
38315
38360
  return `${url4.hostname}/${accountId}${url4.pathname}`;
38316
38361
  }
38317
- var getAndValidateRegistryType;
38362
+ var DEFAULT_CONTAINER_EGRESS_INTERCEPTOR_IMAGE, getAndValidateRegistryType;
38318
38363
  var init_images = __esm({
38319
38364
  "../containers-shared/src/images.ts"() {
38320
38365
  init_import_meta_url();
@@ -38325,6 +38370,9 @@ var init_images = __esm({
38325
38370
  init_login();
38326
38371
  init_registry2();
38327
38372
  init_utils();
38373
+ DEFAULT_CONTAINER_EGRESS_INTERCEPTOR_IMAGE = "cloudflare/proxy-everything:4dc6c7f@sha256:9621ef445ef120409e5d95bbd845ab2fa0f613636b59a01d998f5704f4096ae2";
38374
+ __name(getEgressInterceptorImage, "getEgressInterceptorImage");
38375
+ __name(pullEgressInterceptorImage, "pullEgressInterceptorImage");
38328
38376
  __name(pullImage, "pullImage");
38329
38377
  __name(prepareContainerImagesForDev, "prepareContainerImagesForDev");
38330
38378
  __name(resolveImageName, "resolveImageName");
@@ -38352,6 +38400,12 @@ ${e9.message}`);
38352
38400
  name: "AWS ECR",
38353
38401
  secretType: "AWS Secret Access Key"
38354
38402
  },
38403
+ {
38404
+ type: "DockerHub" /* DOCKER_HUB */,
38405
+ pattern: /^docker\.io$/,
38406
+ name: "DockerHub",
38407
+ secretType: "DockerHub PAT Token"
38408
+ },
38355
38409
  {
38356
38410
  type: "cloudflare",
38357
38411
  // Make a regex based on the env var CLOUDFLARE_CONTAINER_REGISTRY
@@ -38448,8 +38502,8 @@ function createDeferred(previousDeferred) {
38448
38502
  resolve31 = _resolve;
38449
38503
  reject = _reject;
38450
38504
  });
38451
- assert50__default.default(resolve31);
38452
- assert50__default.default(reject);
38505
+ assert51__default.default(resolve31);
38506
+ assert51__default.default(reject);
38453
38507
  previousDeferred?.resolve(newPromise);
38454
38508
  return {
38455
38509
  promise: newPromise,
@@ -42170,7 +42224,7 @@ var require_signal_exit = __commonJS({
42170
42224
  };
42171
42225
  };
42172
42226
  } else {
42173
- assert58 = __require("assert");
42227
+ assert59 = __require("assert");
42174
42228
  signals = require_signals();
42175
42229
  isWin = /^win/i.test(process12.platform);
42176
42230
  EE = __require("events");
@@ -42193,7 +42247,7 @@ var require_signal_exit = __commonJS({
42193
42247
  return function() {
42194
42248
  };
42195
42249
  }
42196
- assert58.equal(typeof cb2, "function", "a callback must be provided for exit handler");
42250
+ assert59.equal(typeof cb2, "function", "a callback must be provided for exit handler");
42197
42251
  if (loaded === false) {
42198
42252
  load();
42199
42253
  }
@@ -42299,7 +42353,7 @@ var require_signal_exit = __commonJS({
42299
42353
  }
42300
42354
  }, "processEmit");
42301
42355
  }
42302
- var assert58;
42356
+ var assert59;
42303
42357
  var signals;
42304
42358
  var isWin;
42305
42359
  var EE;
@@ -49836,7 +49890,7 @@ function getSourceMappingPrepareStackTrace(retrieveSourceMap) {
49836
49890
  }
49837
49891
  });
49838
49892
  sourceMappingPrepareStackTrace = Error.prepareStackTrace;
49839
- assert50__default.default(sourceMappingPrepareStackTrace !== void 0);
49893
+ assert51__default.default(sourceMappingPrepareStackTrace !== void 0);
49840
49894
  Error.prepareStackTrace = originalPrepareStackTrace;
49841
49895
  return sourceMappingPrepareStackTrace;
49842
49896
  }
@@ -49879,7 +49933,7 @@ function getSourceMappedString(value, retrieveSourceMap) {
49879
49933
  }
49880
49934
  const callSiteLine = callSiteLines[i7][0];
49881
49935
  const callSiteAtIndex = callSiteLine.indexOf("at");
49882
- assert50__default.default(callSiteAtIndex !== -1);
49936
+ assert51__default.default(callSiteAtIndex !== -1);
49883
49937
  const callSiteLineLeftPad = callSiteLine.substring(0, callSiteAtIndex);
49884
49938
  value = value.replace(
49885
49939
  callSiteLine,
@@ -51030,7 +51084,7 @@ var name, version;
51030
51084
  var init_package = __esm({
51031
51085
  "package.json"() {
51032
51086
  name = "wrangler";
51033
- version = "4.69.0";
51087
+ version = "4.71.0";
51034
51088
  }
51035
51089
  });
51036
51090
 
@@ -51957,15 +52011,18 @@ function workflowEntry({
51957
52011
  name: name2,
51958
52012
  class_name: className,
51959
52013
  script_name: scriptName,
51960
- remote
52014
+ remote,
52015
+ limits
51961
52016
  }, remoteProxyConnectionString) {
52017
+ const stepLimit = limits?.steps;
51962
52018
  if (!remoteProxyConnectionString || !remote) {
51963
52019
  return [
51964
52020
  binding,
51965
52021
  {
51966
52022
  name: name2,
51967
52023
  className,
51968
- scriptName
52024
+ scriptName,
52025
+ ...stepLimit !== void 0 && { stepLimit }
51969
52026
  }
51970
52027
  ];
51971
52028
  }
@@ -51975,7 +52032,8 @@ function workflowEntry({
51975
52032
  name: name2,
51976
52033
  className,
51977
52034
  scriptName,
51978
- remoteProxyConnectionString
52035
+ remoteProxyConnectionString,
52036
+ ...stepLimit !== void 0 && { stepLimit }
51979
52037
  }
51980
52038
  ];
51981
52039
  }
@@ -52130,7 +52188,7 @@ function buildMiniflareBindingOptions(config, remoteProxyConnectionString) {
52130
52188
  (b11) => isUnsafeServiceBindingWithDevCfg(b11[1])
52131
52189
  );
52132
52190
  for (const [name2, unsafeBinding] of unsafeBindingsWithLocalDev) {
52133
- assert50__default.default(isUnsafeServiceBindingWithDevCfg(unsafeBinding));
52191
+ assert51__default.default(isUnsafeServiceBindingWithDevCfg(unsafeBinding));
52134
52192
  const {
52135
52193
  type,
52136
52194
  dev: {
@@ -52221,9 +52279,14 @@ function buildMiniflareBindingOptions(config, remoteProxyConnectionString) {
52221
52279
  ])
52222
52280
  ),
52223
52281
  workflows: Object.fromEntries(
52224
- workflows.map(
52225
- (workflow) => workflowEntry(workflow, remoteProxyConnectionString)
52226
- )
52282
+ workflows.map((workflow) => {
52283
+ if (workflow.script_name !== void 0 && workflow.script_name !== config.name && workflow.limits) {
52284
+ throw new UserError(
52285
+ `Workflow "${workflow.name}" has "limits" configured but references external script "${workflow.script_name}". Configure limits on the worker that defines the workflow.`
52286
+ );
52287
+ }
52288
+ return workflowEntry(workflow, remoteProxyConnectionString);
52289
+ })
52227
52290
  ),
52228
52291
  secretsStoreSecrets: Object.fromEntries(
52229
52292
  secretsStoreSecrets.map((binding) => [binding.binding, binding])
@@ -52419,7 +52482,7 @@ async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticati
52419
52482
  return options;
52420
52483
  }
52421
52484
  function getImageNameFromDOClassName(options) {
52422
- assert50__default.default(
52485
+ assert51__default.default(
52423
52486
  options.containerBuildId,
52424
52487
  "Build ID should be set if containers are defined and enabled"
52425
52488
  );
@@ -52828,8 +52891,8 @@ function readConfig(args, options = {}) {
52828
52891
  redirected
52829
52892
  } = exports.experimental_readRawConfig(args, options);
52830
52893
  if (redirected) {
52831
- assert50__default.default(configPath, "Redirected config found without a configPath");
52832
- assert50__default.default(
52894
+ assert51__default.default(configPath, "Redirected config found without a configPath");
52895
+ assert51__default.default(
52833
52896
  deployConfigPath,
52834
52897
  "Redirected config found without a deployConfigPath"
52835
52898
  );
@@ -52864,8 +52927,8 @@ function readPagesConfig(args, options = {}) {
52864
52927
  try {
52865
52928
  ({ rawConfig, configPath, userConfigPath, deployConfigPath, redirected } = exports.experimental_readRawConfig(args, options));
52866
52929
  if (redirected) {
52867
- assert50__default.default(configPath, "Redirected config found without a configPath");
52868
- assert50__default.default(
52930
+ assert51__default.default(configPath, "Redirected config found without a configPath");
52931
+ assert51__default.default(
52869
52932
  deployConfigPath,
52870
52933
  "Redirected config found without a deployConfigPath"
52871
52934
  );
@@ -122092,7 +122155,7 @@ function createCloudflareClient(complianceConfig) {
122092
122155
  }
122093
122156
  async function performApiFetch(complianceConfig, resource, init4 = {}, queryParams, abortSignal, apiToken) {
122094
122157
  const method = init4.method ?? "GET";
122095
- assert50__default.default(
122158
+ assert51__default.default(
122096
122159
  resource.startsWith("/"),
122097
122160
  `CF API fetch - resource path must start with a "/" but got "${resource}"`
122098
122161
  );
@@ -122669,7 +122732,7 @@ function isReturningFromAuthServer(query) {
122669
122732
  );
122670
122733
  throw new ErrorInvalidReturnedStateParam();
122671
122734
  }
122672
- assert50__default.default(!Array.isArray(code));
122735
+ assert51__default.default(!Array.isArray(code));
122673
122736
  state2.authorizationCode = code;
122674
122737
  state2.hasAuthCodeBeenExchangedForAccessToken = false;
122675
122738
  return true;
@@ -122895,13 +122958,13 @@ async function getOauthToken(options) {
122895
122958
  if (error2 || closeErr) {
122896
122959
  reject(error2 || closeErr);
122897
122960
  } else {
122898
- assert50__default.default(token);
122961
+ assert51__default.default(token);
122899
122962
  resolve31(token);
122900
122963
  }
122901
122964
  });
122902
122965
  }
122903
122966
  __name(finish, "finish");
122904
- assert50__default.default(req.url, "This request doesn't have a URL");
122967
+ assert51__default.default(req.url, "This request doesn't have a URL");
122905
122968
  const { pathname, query } = Url__default.default.parse(req.url, true);
122906
122969
  if (req.method !== "GET") {
122907
122970
  return res.end("OK");
@@ -125146,7 +125209,7 @@ var init_esm6 = __esm({
125146
125209
  function dedent3(strings, ...values) {
125147
125210
  const raw = String.raw({ raw: strings }, ...values);
125148
125211
  let lines = raw.split("\n");
125149
- assert50__default.default(lines.length > 0);
125212
+ assert51__default.default(lines.length > 0);
125150
125213
  if (lines[lines.length - 1].trim() === "") {
125151
125214
  lines = lines.slice(0, lines.length - 1);
125152
125215
  }
@@ -125326,12 +125389,12 @@ function getEntryPointFromMetafile(entryFile, metafile) {
125326
125389
  );
125327
125390
  if (entryPoints.length !== 1) {
125328
125391
  const entryPointList = entryPoints.map(([_input, output]) => output.entryPoint).join("\n");
125329
- assert50__default.default(
125392
+ assert51__default.default(
125330
125393
  entryPoints.length > 0,
125331
125394
  `Cannot find entry-point "${entryFile}" in generated bundle.
125332
125395
  ${entryPointList}`
125333
125396
  );
125334
- assert50__default.default(
125397
+ assert51__default.default(
125335
125398
  entryPoints.length < 2,
125336
125399
  `More than one entry-point found for generated bundle.
125337
125400
  ${entryPointList}`
@@ -125595,9 +125658,9 @@ function handleNodeJSGlobals(build5, inject, polyfill2) {
125595
125658
  }));
125596
125659
  build5.onLoad({ filter: UNENV_VIRTUAL_MODULE_RE }, ({ path: path82 }) => {
125597
125660
  const module4 = virtualModulePathToSpecifier.get(path82);
125598
- assert50__default.default(module4, `Expected ${path82} to be mapped to a module specifier`);
125661
+ assert51__default.default(module4, `Expected ${path82} to be mapped to a module specifier`);
125599
125662
  const injects = injectsByModule.get(module4);
125600
- assert50__default.default(injects, `Expected ${module4} to inject values`);
125663
+ assert51__default.default(injects, `Expected ${module4} to inject values`);
125601
125664
  const imports = injects.map(
125602
125665
  ({ exportName, importName }) => importName === exportName ? exportName : `${exportName} as ${importName}`
125603
125666
  );
@@ -129673,10 +129736,10 @@ var init_CommandRegistry = __esm({
129673
129736
  * console.log(subtree); // Output: empty Map if 'wrangler hello' has no further subcommands
129674
129737
  */
129675
129738
  #resolveDefinitionNode(node2) {
129676
- assert50__default.default(node2.definition);
129739
+ assert51__default.default(node2.definition);
129677
129740
  const chain2 = this.#resolveDefinitionChain(node2.definition);
129678
129741
  const resolvedDef = chain2.find((def) => def.type !== "alias");
129679
- assert50__default.default(resolvedDef);
129742
+ assert51__default.default(resolvedDef);
129680
129743
  const { subtree } = node2.definition.type !== "alias" ? node2 : this.#findNodeFor(resolvedDef.command) ?? node2;
129681
129744
  const definition = {
129682
129745
  // take all properties from the resolved alias
@@ -143975,7 +144038,7 @@ async function deployContainers(config, normalisedContainerConfig, { versionId,
143975
144038
  "Could not deploy container application as durable object was not found in list of bindings"
143976
144039
  );
143977
144040
  }
143978
- assert50__default.default(
144041
+ assert51__default.default(
143979
144042
  targetDurableObject && targetDurableObject.namespace_id !== void 0
143980
144043
  );
143981
144044
  await apply(
@@ -143991,7 +144054,7 @@ async function deployContainers(config, normalisedContainerConfig, { versionId,
143991
144054
  const targetDurableObject = maybeAllDurableObjects.find(
143992
144055
  (durableObject) => durableObject.class === container.class_name && durableObject.script === scriptName
143993
144056
  );
143994
- assert50__default.default(targetDurableObject, "Durable Object not returned from list API");
144057
+ assert51__default.default(targetDurableObject, "Durable Object not returned from list API");
143995
144058
  await apply(
143996
144059
  {
143997
144060
  imageRef,
@@ -144401,8 +144464,6 @@ ${formatError(err)}`
144401
144464
  async function registryConfigureCommand(configureArgs, config) {
144402
144465
  startSection("Configure a container registry");
144403
144466
  const registryType = getAndValidateRegistryType(configureArgs.DOMAIN);
144404
- log(`Configuring ${registryType.name} registry: ${configureArgs.DOMAIN}
144405
- `);
144406
144467
  if (registryType.type === "cloudflare") {
144407
144468
  log(
144408
144469
  "You do not need to configure credentials for Cloudflare managed registries.\n"
@@ -144410,6 +144471,13 @@ async function registryConfigureCommand(configureArgs, config) {
144410
144471
  endSection("No configuration required");
144411
144472
  return;
144412
144473
  }
144474
+ const publicCredential = configureArgs.awsAccessKeyId ?? configureArgs.dockerhubUsername ?? configureArgs.publicCredential;
144475
+ if (!publicCredential) {
144476
+ const arg = registryType.type === "DockerHub" /* DOCKER_HUB */ ? "dockerhub-username" : registryType.type === "ECR" /* ECR */ ? "aws-access-key-id" : "public-credential";
144477
+ throw new UserError(`Missing required argument: ${arg}`);
144478
+ }
144479
+ log(`Configuring ${registryType.name} registry: ${configureArgs.DOMAIN}
144480
+ `);
144413
144481
  const isFedRAMPHigh = getCloudflareComplianceRegion(config) === "fedramp_high";
144414
144482
  if (isFedRAMPHigh) {
144415
144483
  if (!configureArgs.disableSecretsStore) {
@@ -144489,7 +144557,7 @@ async function registryConfigureCommand(configureArgs, config) {
144489
144557
  domain: configureArgs.DOMAIN,
144490
144558
  is_public: false,
144491
144559
  auth: {
144492
- public_credential: configureArgs.publicCredential,
144560
+ public_credential: publicCredential,
144493
144561
  private_credential
144494
144562
  },
144495
144563
  kind: registryType.type
@@ -144692,7 +144760,33 @@ async function registryDeleteCommand(deleteArgs, config) {
144692
144760
  endSection(`Deleted secret ${res.secrets_store_ref}`);
144693
144761
  }
144694
144762
  }
144695
- var containersRegistriesNamespace, containersRegistriesConfigureCommand, containersRegistriesListCommand, containersRegistriesDeleteCommand;
144763
+ async function registryCredentialsCommand(credentialsArgs) {
144764
+ const cloudflareRegistry = getCloudflareContainerRegistry();
144765
+ const domain2 = credentialsArgs.DOMAIN || cloudflareRegistry;
144766
+ if (domain2 !== cloudflareRegistry) {
144767
+ throw new UserError(
144768
+ `The credentials command only accepts the Cloudflare managed registry (${cloudflareRegistry}).`
144769
+ );
144770
+ }
144771
+ if (!credentialsArgs.pull && !credentialsArgs.push) {
144772
+ throw new UserError(
144773
+ "You have to specify either --push or --pull in the command."
144774
+ );
144775
+ }
144776
+ const credentials = await ImageRegistriesService.generateImageRegistryCredentials(domain2, {
144777
+ expiration_minutes: credentialsArgs.expirationMinutes,
144778
+ permissions: [
144779
+ ...credentialsArgs.push ? ["push"] : [],
144780
+ ...credentialsArgs.pull ? ["pull"] : []
144781
+ ]
144782
+ });
144783
+ if (credentialsArgs.json) {
144784
+ logger.json(credentials);
144785
+ } else {
144786
+ logger.log(credentials.password);
144787
+ }
144788
+ }
144789
+ var registryConfigureArgs, registryListArgs, registryDeleteArgs, containersRegistriesNamespace, containersRegistriesConfigureCommand, containersRegistriesListCommand, containersRegistriesDeleteCommand, containersRegistriesCredentialsCommand;
144696
144790
  var init_registries = __esm({
144697
144791
  "src/containers/registries.ts"() {
144698
144792
  init_import_meta_url();
@@ -144710,12 +144804,83 @@ var init_registries = __esm({
144710
144804
  init_std();
144711
144805
  init_deploy();
144712
144806
  init_containers2();
144807
+ registryConfigureArgs = {
144808
+ DOMAIN: {
144809
+ describe: "Domain to configure for the registry",
144810
+ type: "string",
144811
+ demandOption: true
144812
+ },
144813
+ "public-credential": {
144814
+ type: "string",
144815
+ demandOption: false,
144816
+ hidden: true,
144817
+ deprecated: true,
144818
+ conflicts: ["dockerhub-username", "aws-access-key-id"]
144819
+ },
144820
+ "aws-access-key-id": {
144821
+ type: "string",
144822
+ description: "When configuring Amazon ECR, `AWS_ACCESS_KEY_ID`",
144823
+ demandOption: false,
144824
+ conflicts: ["public-credential", "dockerhub-username"]
144825
+ },
144826
+ "dockerhub-username": {
144827
+ type: "string",
144828
+ description: "When configuring DockerHub, the DockerHub username",
144829
+ demandOption: false,
144830
+ conflicts: ["public-credential", "aws-access-key-id"]
144831
+ },
144832
+ "secret-store-id": {
144833
+ type: "string",
144834
+ description: "The ID of the secret store to use to store the registry credentials.",
144835
+ demandOption: false,
144836
+ conflicts: "disable-secrets-store"
144837
+ },
144838
+ "secret-name": {
144839
+ type: "string",
144840
+ description: "The name for the secret the private registry credentials should be stored under.",
144841
+ demandOption: false,
144842
+ conflicts: "disable-secrets-store"
144843
+ },
144844
+ "disable-secrets-store": {
144845
+ type: "boolean",
144846
+ description: "Whether to disable secrets store integration. This should be set iff the compliance region is FedRAMP High.",
144847
+ demandOption: false,
144848
+ conflicts: ["secret-store-id", "secret-name"]
144849
+ },
144850
+ "skip-confirmation": {
144851
+ type: "boolean",
144852
+ description: "Skip confirmation prompts",
144853
+ alias: "y",
144854
+ default: false
144855
+ }
144856
+ };
144713
144857
  __name(registryConfigureCommand, "registryConfigureCommand");
144714
144858
  __name(promptForSecretName, "promptForSecretName");
144715
144859
  __name(getOrCreateSecret, "getOrCreateSecret");
144716
144860
  __name(promptForRegistryPrivateCredential, "promptForRegistryPrivateCredential");
144861
+ registryListArgs = {
144862
+ json: {
144863
+ type: "boolean",
144864
+ description: "Format output as JSON",
144865
+ default: false
144866
+ }
144867
+ };
144717
144868
  __name(registryListCommand, "registryListCommand");
144869
+ registryDeleteArgs = {
144870
+ DOMAIN: {
144871
+ describe: "Domain of the registry to delete",
144872
+ type: "string",
144873
+ demandOption: true
144874
+ },
144875
+ "skip-confirmation": {
144876
+ type: "boolean",
144877
+ description: "Skip confirmation prompts for registry and secret deletion",
144878
+ alias: "y",
144879
+ default: false
144880
+ }
144881
+ };
144718
144882
  __name(registryDeleteCommand, "registryDeleteCommand");
144883
+ __name(registryCredentialsCommand, "registryCredentialsCommand");
144719
144884
  containersRegistriesNamespace = createNamespace({
144720
144885
  metadata: {
144721
144886
  description: "Configure and manage non-Cloudflare registries",
@@ -144729,43 +144894,7 @@ var init_registries = __esm({
144729
144894
  status: "open beta",
144730
144895
  owner: "Product: Cloudchamber"
144731
144896
  },
144732
- args: {
144733
- DOMAIN: {
144734
- describe: "Domain to configure for the registry",
144735
- type: "string",
144736
- demandOption: true
144737
- },
144738
- "public-credential": {
144739
- type: "string",
144740
- description: "The public part of the registry credentials, e.g. `AWS_ACCESS_KEY_ID` for ECR",
144741
- demandOption: true,
144742
- alias: "aws-access-key-id"
144743
- },
144744
- "secret-store-id": {
144745
- type: "string",
144746
- description: "The ID of the secret store to use to store the registry credentials.",
144747
- demandOption: false,
144748
- conflicts: "disable-secrets-store"
144749
- },
144750
- "secret-name": {
144751
- type: "string",
144752
- description: "The name for the secret the private registry credentials should be stored under.",
144753
- demandOption: false,
144754
- conflicts: "disable-secrets-store"
144755
- },
144756
- "disable-secrets-store": {
144757
- type: "boolean",
144758
- description: "Whether to disable secrets store integration. This should be set iff the compliance region is FedRAMP High.",
144759
- demandOption: false,
144760
- conflicts: ["secret-store-id", "secret-name"]
144761
- },
144762
- "skip-confirmation": {
144763
- type: "boolean",
144764
- description: "Skip confirmation prompts",
144765
- alias: "y",
144766
- default: false
144767
- }
144768
- },
144897
+ args: registryConfigureArgs,
144769
144898
  positionalArgs: ["DOMAIN"],
144770
144899
  validateArgs(args) {
144771
144900
  if (args.skipConfirmation && !args.secretName && !args.disableSecretsStore) {
@@ -144783,19 +144912,12 @@ var init_registries = __esm({
144783
144912
  metadata: {
144784
144913
  description: "List all configured container registries",
144785
144914
  status: "open beta",
144786
- owner: "Product: Cloudchamber",
144787
- hidden: true
144915
+ owner: "Product: Cloudchamber"
144788
144916
  },
144789
144917
  behaviour: {
144790
144918
  printBanner: /* @__PURE__ */ __name((args) => !args.json && !isNonInteractiveOrCI(), "printBanner")
144791
144919
  },
144792
- args: {
144793
- json: {
144794
- type: "boolean",
144795
- description: "Format output as JSON",
144796
- default: false
144797
- }
144798
- },
144920
+ args: registryListArgs,
144799
144921
  async handler(args, { config }) {
144800
144922
  await fillOpenAPIConfiguration(config, containersScope);
144801
144923
  await registryListCommand(args);
@@ -144805,26 +144927,52 @@ var init_registries = __esm({
144805
144927
  metadata: {
144806
144928
  description: "Delete a configured container registry",
144807
144929
  status: "open beta",
144808
- owner: "Product: Cloudchamber",
144809
- hidden: true
144930
+ owner: "Product: Cloudchamber"
144931
+ },
144932
+ args: registryDeleteArgs,
144933
+ positionalArgs: ["DOMAIN"],
144934
+ async handler(args, { config }) {
144935
+ await fillOpenAPIConfiguration(config, containersScope);
144936
+ await registryDeleteCommand(args, config);
144937
+ }
144938
+ });
144939
+ containersRegistriesCredentialsCommand = createCommand({
144940
+ metadata: {
144941
+ description: "Get a temporary password for a specific domain",
144942
+ status: "open beta",
144943
+ owner: "Product: Cloudchamber"
144944
+ },
144945
+ behaviour: {
144946
+ printBanner: /* @__PURE__ */ __name((args) => !args.json && !isNonInteractiveOrCI(), "printBanner")
144810
144947
  },
144811
144948
  args: {
144812
144949
  DOMAIN: {
144813
- describe: "Domain of the registry to delete",
144814
144950
  type: "string",
144815
- demandOption: true
144951
+ describe: "Domain to get credentials for"
144816
144952
  },
144817
- "skip-confirmation": {
144953
+ "expiration-minutes": {
144954
+ type: "number",
144955
+ default: 15,
144956
+ description: "How long the credentials should be valid for (in minutes)"
144957
+ },
144958
+ push: {
144818
144959
  type: "boolean",
144819
- description: "Skip confirmation prompts for registry and secret deletion",
144820
- alias: "y",
144960
+ description: "If you want these credentials to be able to push"
144961
+ },
144962
+ pull: {
144963
+ type: "boolean",
144964
+ description: "If you want these credentials to be able to pull"
144965
+ },
144966
+ json: {
144967
+ type: "boolean",
144968
+ description: "Format output as JSON",
144821
144969
  default: false
144822
144970
  }
144823
144971
  },
144824
144972
  positionalArgs: ["DOMAIN"],
144825
144973
  async handler(args, { config }) {
144826
144974
  await fillOpenAPIConfiguration(config, containersScope);
144827
- await registryDeleteCommand(args, config);
144975
+ await registryCredentialsCommand(args);
144828
144976
  }
144829
144977
  });
144830
144978
  }
@@ -145191,7 +145339,7 @@ var init_config5 = __esm({
145191
145339
  }
145192
145340
  const normalizedContainers = [];
145193
145341
  for (const container of config.containers) {
145194
- assert50__default.default(container.name, "container name should have been set by validation");
145342
+ assert51__default.default(container.name, "container name should have been set by validation");
145195
145343
  const allDOs = getDurableObjectClassNameToUseSQLiteMap(config.migrations);
145196
145344
  if (!allDOs.has(container.class_name) && config.durable_objects.bindings.find(
145197
145345
  (doBinding) => doBinding.class_name === container.class_name
@@ -145270,12 +145418,12 @@ var init_config5 = __esm({
145270
145418
  }
145271
145419
  const maybeDockerfile = isDockerfile(container.image, config.configPath);
145272
145420
  if (maybeDockerfile) {
145273
- assert50__default.default(
145421
+ assert51__default.default(
145274
145422
  path3__namespace.default.isAbsolute(container.image),
145275
145423
  "Dockerfile path should be absolute"
145276
145424
  );
145277
145425
  const imageBuildContext = container.image_build_context ?? path3.dirname(container.image);
145278
- assert50__default.default(
145426
+ assert51__default.default(
145279
145427
  path3__namespace.default.isAbsolute(imageBuildContext),
145280
145428
  "resolved image_build_context should be defined"
145281
145429
  );
@@ -149960,7 +150108,7 @@ function createWorkerUploadForm(worker, bindings, options) {
149960
150108
  const manifestModuleName = "__STATIC_CONTENT_MANIFEST";
149961
150109
  const hasManifest = modules?.some(({ name: name2 }) => name2 === manifestModuleName);
149962
150110
  if (hasManifest && main2.type === "esm") {
149963
- assert50__default.default(modules !== void 0);
150111
+ assert51__default.default(modules !== void 0);
149964
150112
  const subDirs = new Set(
149965
150113
  modules.map((module4) => path3__namespace.default.posix.dirname(module4.name))
149966
150114
  );
@@ -154314,7 +154462,7 @@ var init_t_DYl0qC9V = __esm({
154314
154462
  this.complete(n8);
154315
154463
  }
154316
154464
  setup(a7, o7, s7) {
154317
- switch (assert50__default.default(s7 === `zsh` || s7 === `bash` || s7 === `fish` || s7 === `powershell`, `Unsupported shell`), s7) {
154465
+ switch (assert51__default.default(s7 === `zsh` || s7 === `bash` || s7 === `fish` || s7 === `powershell`, `Unsupported shell`), s7) {
154318
154466
  case `zsh`: {
154319
154467
  let e9 = t2(a7, o7);
154320
154468
  console.log(e9);
@@ -154948,14 +155096,14 @@ function loadDotEnv(envPaths, { includeProcessEnv, silent }) {
154948
155096
  }
154949
155097
  } else if (parsed && !silent) {
154950
155098
  const relativePath = path3__namespace.default.relative(process.cwd(), envPath);
154951
- logger.log(`Using vars defined in ${relativePath}`);
155099
+ logger.log(`Using secrets defined in ${relativePath}`);
154952
155100
  }
154953
155101
  }
154954
155102
  const expandedEnv = isWindows3 ? caseInsensitiveEnv() : {};
154955
155103
  if (includeProcessEnv) {
154956
155104
  Object.assign(expandedEnv, process.env);
154957
155105
  if (!silent) {
154958
- logger.log("Using vars defined in process.env");
155106
+ logger.log("Using secrets defined in process.env");
154959
155107
  }
154960
155108
  }
154961
155109
  const { error: error2 } = import_dotenv_expand.default.expand({
@@ -169886,7 +170034,7 @@ async function executeLocally({
169886
170034
  } finally {
169887
170035
  await mf.dispose();
169888
170036
  }
169889
- assert50__default.default(Array.isArray(results));
170037
+ assert51__default.default(Array.isArray(results));
169890
170038
  const allResults = results.map((result) => ({
169891
170039
  results: (result.results ?? []).map(
169892
170040
  (row) => Object.fromEntries(
@@ -172161,7 +172309,7 @@ async function provisionBindings(bindings, accountId, scriptName, autoCreate, co
172161
172309
  requireRemote
172162
172310
  );
172163
172311
  if (pendingResources.length > 0) {
172164
- assert50__default.default(
172312
+ assert51__default.default(
172165
172313
  configPath,
172166
172314
  "Provisioning resources is not possible without a config file"
172167
172315
  );
@@ -172451,7 +172599,7 @@ var init_bindings2 = __esm({
172451
172599
  );
172452
172600
  }
172453
172601
  async isConnectedToExistingResource() {
172454
- assert50__default.default(typeof this.binding.bucket_name !== "symbol");
172602
+ assert51__default.default(typeof this.binding.bucket_name !== "symbol");
172455
172603
  if (!this.binding.bucket_name) {
172456
172604
  return false;
172457
172605
  }
@@ -172545,7 +172693,7 @@ var init_bindings2 = __esm({
172545
172693
  return false;
172546
172694
  }
172547
172695
  async isConnectedToExistingResource() {
172548
- assert50__default.default(typeof this.binding.database_name !== "symbol");
172696
+ assert51__default.default(typeof this.binding.database_name !== "symbol");
172549
172697
  if (!this.binding.database_name) {
172550
172698
  return false;
172551
172699
  }
@@ -172908,7 +173056,7 @@ async function getKVNamespaceId({ namespace, preview, binding, "namespace-id": n
172908
173056
  return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
172909
173057
  } else if (previewIsDefined) {
172910
173058
  if (getFlag("RESOURCES_PROVISION")) {
172911
- assert50__default.default(binding);
173059
+ assert51__default.default(binding);
172912
173060
  const nsId = await getIdFromSettings(config, binding, isLocal2);
172913
173061
  return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
172914
173062
  }
@@ -172919,10 +173067,10 @@ async function getKVNamespaceId({ namespace, preview, binding, "namespace-id": n
172919
173067
  const bindingHasOnlyOneId = configNamespace.id && !configNamespace.preview_id || !configNamespace.id && configNamespace.preview_id;
172920
173068
  if (bindingHasOnlyOneId) {
172921
173069
  const nsId = configNamespace.id || configNamespace.preview_id;
172922
- assert50__default.default(nsId);
173070
+ assert51__default.default(nsId);
172923
173071
  return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
172924
173072
  } else if (getFlag("RESOURCES_PROVISION") && !configNamespace.id && !configNamespace.preview_id) {
172925
- assert50__default.default(binding);
173073
+ assert51__default.default(binding);
172926
173074
  const nsId = await getIdFromSettings(config, binding, isLocal2);
172927
173075
  return { namespaceId: nsId, displayName: formatDisplayName(nsId) };
172928
173076
  } else {
@@ -173173,7 +173321,7 @@ var init_delete3 = __esm({
173173
173321
  logger.log(`--dry-run: exiting now.`);
173174
173322
  return;
173175
173323
  }
173176
- assert50__default.default(accountId, "Missing accountId");
173324
+ assert51__default.default(accountId, "Missing accountId");
173177
173325
  const confirmed = args.force || await confirm(
173178
173326
  `Are you sure you want to delete ${scriptName}? This action cannot be undone.`
173179
173327
  );
@@ -195565,13 +195713,13 @@ var require_esprima2 = __commonJS({
195565
195713
  /***/
195566
195714
  function(module5, exports2) {
195567
195715
  Object.defineProperty(exports2, "__esModule", { value: true });
195568
- function assert58(condition, message) {
195716
+ function assert59(condition, message) {
195569
195717
  if (!condition) {
195570
195718
  throw new Error("ASSERT: " + message);
195571
195719
  }
195572
195720
  }
195573
- __name(assert58, "assert");
195574
- exports2.assert = assert58;
195721
+ __name(assert59, "assert");
195722
+ exports2.assert = assert59;
195575
195723
  },
195576
195724
  /* 10 */
195577
195725
  /***/
@@ -209292,12 +209440,12 @@ var require_lib4 = __commonJS({
209292
209440
  return x7;
209293
209441
  }
209294
209442
  __name(nonNull, "nonNull");
209295
- function assert58(x7) {
209443
+ function assert59(x7) {
209296
209444
  if (!x7) {
209297
209445
  throw new Error("Assert fail");
209298
209446
  }
209299
209447
  }
209300
- __name(assert58, "assert");
209448
+ __name(assert59, "assert");
209301
209449
  var TSErrors = ParseErrorEnum`typescript`({
209302
209450
  AbstractMethodHasImplementation: /* @__PURE__ */ __name(({
209303
209451
  methodName
@@ -210325,7 +210473,7 @@ var require_lib4 = __commonJS({
210325
210473
  return this.finishNode(t12, "TSTypeAnnotation");
210326
210474
  }
210327
210475
  tsParseType() {
210328
- assert58(this.state.inType);
210476
+ assert59(this.state.inType);
210329
210477
  const type = this.tsParseNonConditionalType();
210330
210478
  if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(81)) {
210331
210479
  return type;
@@ -211373,7 +211521,7 @@ var require_lib4 = __commonJS({
211373
211521
  return arrow.node;
211374
211522
  }
211375
211523
  if (!jsx2) {
211376
- assert58(!this.hasPlugin("jsx"));
211524
+ assert59(!this.hasPlugin("jsx"));
211377
211525
  typeCast = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, afterLeftParse), state2);
211378
211526
  if (!typeCast.error) return typeCast.node;
211379
211527
  }
@@ -216178,7 +216326,7 @@ function checkMinimumAnalogVersion(projectPath) {
216178
216326
  "@analogjs/platform",
216179
216327
  projectPath
216180
216328
  );
216181
- assert50__default.default(
216329
+ assert51__default.default(
216182
216330
  analogJsVersion,
216183
216331
  "Unable to discern the version of the `@analogjs/platform` package"
216184
216332
  );
@@ -216407,7 +216555,7 @@ var init_packages3 = __esm({
216407
216555
  const pkgJsonPath = path3__namespace.default.join(process.cwd(), "package.json");
216408
216556
  const pkgJson = parsePackageJSON(readFileSync(pkgJsonPath), pkgJsonPath);
216409
216557
  const deps = config.dev ? pkgJson.devDependencies : pkgJson.dependencies;
216410
- assert50__default.default(deps, "dependencies should be defined");
216558
+ assert51__default.default(deps, "dependencies should be defined");
216411
216559
  for (const pkg of packages) {
216412
216560
  const versionMarker = pkg.lastIndexOf("@");
216413
216561
  if (versionMarker > 0) {
@@ -217131,13 +217279,13 @@ function transformReactRouterConfig(projectPath, viteEnvironmentKey) {
217131
217279
  }`
217132
217280
  );
217133
217281
  }
217134
- assert50__default.default(node2.type === "ObjectExpression");
217282
+ assert51__default.default(node2.type === "ObjectExpression");
217135
217283
  const futureKey = node2.properties.findIndex(
217136
217284
  (p7) => p7.type === "ObjectProperty" && p7.key.type === "Identifier" && p7.key.name === "future" && p7.value.type === "ObjectExpression"
217137
217285
  );
217138
217286
  if (futureKey !== -1) {
217139
217287
  const future = node2.properties[futureKey];
217140
- assert50__default.default(
217288
+ assert51__default.default(
217141
217289
  future.type === "ObjectProperty" && future.value.type === "ObjectExpression"
217142
217290
  );
217143
217291
  const viteEnvironment = future.value.properties.findIndex(
@@ -217145,7 +217293,7 @@ function transformReactRouterConfig(projectPath, viteEnvironmentKey) {
217145
217293
  );
217146
217294
  if (viteEnvironment !== -1) {
217147
217295
  const prop = future.value.properties[viteEnvironment];
217148
- assert50__default.default(
217296
+ assert51__default.default(
217149
217297
  prop.type === "ObjectProperty" && prop.value.type === "BooleanLiteral"
217150
217298
  );
217151
217299
  prop.value.value = true;
@@ -217324,8 +217472,79 @@ var init_react_router2 = __esm({
217324
217472
  };
217325
217473
  }
217326
217474
  });
217327
-
217328
- // src/autoconfig/frameworks/solid-start.ts
217475
+ function updateViteConfigFile(projectPath) {
217476
+ const filePath = `vite.config.${usesTypescript(projectPath) ? "ts" : "js"}`;
217477
+ transformFile(filePath, {
217478
+ visitCallExpression: /* @__PURE__ */ __name(function(n8) {
217479
+ const callee = n8.node.callee;
217480
+ if (callee.name !== "nitro") {
217481
+ return this.traverse(n8);
217482
+ }
217483
+ const b11 = recast7.types.builders;
217484
+ const presetProp = b11.objectProperty(
217485
+ b11.identifier("preset"),
217486
+ b11.stringLiteral("cloudflare-module")
217487
+ );
217488
+ if (n8.node.arguments.length === 0) {
217489
+ n8.node.arguments.push(b11.objectExpression([presetProp]));
217490
+ } else {
217491
+ mergeObjectProperties(
217492
+ n8.node.arguments[0],
217493
+ [presetProp]
217494
+ );
217495
+ }
217496
+ return false;
217497
+ }, "visitCallExpression")
217498
+ });
217499
+ }
217500
+ function updateAppConfigFile(projectPath) {
217501
+ const filePath = `app.config.${usesTypescript(projectPath) ? "ts" : "js"}`;
217502
+ const { date: compatDate } = getLocalWorkerdCompatibilityDate({
217503
+ projectPath
217504
+ });
217505
+ updateStatus(`Updating configuration in ${blue(filePath)}`);
217506
+ transformFile(filePath, {
217507
+ visitCallExpression: /* @__PURE__ */ __name(function(n8) {
217508
+ const callee = n8.node.callee;
217509
+ if (callee.name !== "defineConfig") {
217510
+ return this.traverse(n8);
217511
+ }
217512
+ const b11 = recast7.types.builders;
217513
+ mergeObjectProperties(
217514
+ n8.node.arguments[0],
217515
+ [
217516
+ b11.objectProperty(
217517
+ b11.identifier("server"),
217518
+ b11.objectExpression([
217519
+ // preset: "cloudflare_module"
217520
+ b11.objectProperty(
217521
+ b11.identifier("preset"),
217522
+ b11.stringLiteral("cloudflare_module")
217523
+ ),
217524
+ b11.objectProperty(
217525
+ b11.identifier("compatibilityDate"),
217526
+ b11.stringLiteral(compatDate)
217527
+ )
217528
+ ])
217529
+ )
217530
+ ]
217531
+ );
217532
+ return false;
217533
+ }, "visitCallExpression")
217534
+ });
217535
+ }
217536
+ function getSolidStartVersion(projectPath) {
217537
+ const packageName = "@solidjs/start";
217538
+ const solidStartVersion = getInstalledPackageVersion(
217539
+ packageName,
217540
+ projectPath
217541
+ );
217542
+ assert51__default.default(
217543
+ solidStartVersion,
217544
+ `Unable to discern the version of the \`${packageName}\` package`
217545
+ );
217546
+ return solidStartVersion;
217547
+ }
217329
217548
  var recast7, SolidStart2;
217330
217549
  var init_solid_start2 = __esm({
217331
217550
  "src/autoconfig/frameworks/solid-start.ts"() {
@@ -217334,8 +217553,10 @@ var init_solid_start2 = __esm({
217334
217553
  init_colors();
217335
217554
  init_dist();
217336
217555
  recast7 = __toESM(require_main4());
217556
+ init_semiver();
217337
217557
  init_codemod();
217338
217558
  init_uses_typescript();
217559
+ init_packages2();
217339
217560
  init_frameworks2();
217340
217561
  SolidStart2 = class extends exports.experimental_AutoConfigFramework {
217341
217562
  static {
@@ -217346,40 +217567,12 @@ var init_solid_start2 = __esm({
217346
217567
  dryRun
217347
217568
  }) {
217348
217569
  if (!dryRun) {
217349
- const filePath = `app.config.${usesTypescript(projectPath) ? "ts" : "js"}`;
217350
- const { date: compatDate } = getLocalWorkerdCompatibilityDate({
217351
- projectPath
217352
- });
217353
- updateStatus(`Updating configuration in ${blue(filePath)}`);
217354
- transformFile(filePath, {
217355
- visitCallExpression: /* @__PURE__ */ __name(function(n8) {
217356
- const callee = n8.node.callee;
217357
- if (callee.name !== "defineConfig") {
217358
- return this.traverse(n8);
217359
- }
217360
- const b11 = recast7.types.builders;
217361
- mergeObjectProperties(
217362
- n8.node.arguments[0],
217363
- [
217364
- b11.objectProperty(
217365
- b11.identifier("server"),
217366
- b11.objectExpression([
217367
- // preset: "cloudflare_module"
217368
- b11.objectProperty(
217369
- b11.identifier("preset"),
217370
- b11.stringLiteral("cloudflare_module")
217371
- ),
217372
- b11.objectProperty(
217373
- b11.identifier("compatibilityDate"),
217374
- b11.stringLiteral(compatDate)
217375
- )
217376
- ])
217377
- )
217378
- ]
217379
- );
217380
- return false;
217381
- }, "visitCallExpression")
217382
- });
217570
+ const solidStartVersion = getSolidStartVersion(projectPath);
217571
+ if (semiver_default(solidStartVersion, "2.0.0-alpha") < 0) {
217572
+ updateAppConfigFile(projectPath);
217573
+ } else {
217574
+ updateViteConfigFile(projectPath);
217575
+ }
217383
217576
  }
217384
217577
  return {
217385
217578
  wranglerConfig: {
@@ -217392,6 +217585,9 @@ var init_solid_start2 = __esm({
217392
217585
  };
217393
217586
  }
217394
217587
  };
217588
+ __name(updateViteConfigFile, "updateViteConfigFile");
217589
+ __name(updateAppConfigFile, "updateAppConfigFile");
217590
+ __name(getSolidStartVersion, "getSolidStartVersion");
217395
217591
  }
217396
217592
  });
217397
217593
 
@@ -217534,7 +217730,7 @@ function addVikePhotonToVikeConfigExportObject(n8) {
217534
217730
  );
217535
217731
  configObject.properties.push(configTargetProp);
217536
217732
  }
217537
- assert50__default.default(configTargetProp && t4.ArrayExpression.check(configTargetProp.value));
217733
+ assert51__default.default(configTargetProp && t4.ArrayExpression.check(configTargetProp.value));
217538
217734
  if (!configTargetProp.value.elements.some(
217539
217735
  (el) => el?.type === "CallExpression" && el.callee.type === "Identifier" && el.callee.name === vikeConfigExtendsPropName
217540
217736
  )) {
@@ -217752,15 +217948,15 @@ async function updateWakuConfig(projectPath) {
217752
217948
  return this.traverse(n8);
217753
217949
  }
217754
217950
  const config = n8.node.arguments[0];
217755
- assert50__default.default(t5.ObjectExpression.check(config));
217951
+ assert51__default.default(t5.ObjectExpression.check(config));
217756
217952
  const viteConfig = config.properties.find(
217757
217953
  (prop) => isViteProp(prop)
217758
217954
  )?.value;
217759
- assert50__default.default(t5.ObjectExpression.check(viteConfig));
217955
+ assert51__default.default(t5.ObjectExpression.check(viteConfig));
217760
217956
  const pluginsProp = viteConfig.properties.find(
217761
217957
  (prop) => isPluginsProp2(prop)
217762
217958
  );
217763
- assert50__default.default(pluginsProp && t5.ArrayExpression.check(pluginsProp.value));
217959
+ assert51__default.default(pluginsProp && t5.ArrayExpression.check(pluginsProp.value));
217764
217960
  if (!pluginsProp.value.elements.some(
217765
217961
  (el) => el?.type === "CallExpression" && el.callee.type === "Identifier" && el.callee.name === "cloudflare"
217766
217962
  )) {
@@ -217986,7 +218182,7 @@ function convertDetectedPackageManager(pkgManager) {
217986
218182
  }
217987
218183
  }
217988
218184
  function assertNonConfigured(details) {
217989
- assert50__default.default(
218185
+ assert51__default.default(
217990
218186
  details.configured === false,
217991
218187
  "Error: expected the current project not to be already configured"
217992
218188
  );
@@ -218624,7 +218820,7 @@ async function runAutoConfig(autoConfigDetails, autoConfigOptions = {}) {
218624
218820
  autoConfigDetails.framework.id === "cloudflare-pages" ? `The target project seems to be using Cloudflare Pages. Automatically migrating from a Pages project to a Workers one is not yet supported.` : `The detected framework ("${autoConfigDetails.framework.name}") cannot be automatically configured.`
218625
218821
  );
218626
218822
  }
218627
- assert50__default.default(
218823
+ assert51__default.default(
218628
218824
  autoConfigDetails.outputDir,
218629
218825
  "The Output Directory is unexpectedly missing"
218630
218826
  );
@@ -219295,7 +219491,7 @@ async function syncWorkersSite(complianceConfig, accountId, scriptName, siteAsse
219295
219491
  logger.log("(Note: doing a dry run, not uploading or deleting anything.)");
219296
219492
  return { manifest: void 0, namespace: void 0 };
219297
219493
  }
219298
- assert50__default.default(accountId, "Missing accountId");
219494
+ assert51__default.default(accountId, "Missing accountId");
219299
219495
  const title = `__${scriptName}-workers_sites_assets${preview ? "_preview" : ""}`;
219300
219496
  const { id: namespace } = await createKVNamespaceIfNotAlreadyExisting(
219301
219497
  complianceConfig,
@@ -219593,7 +219789,7 @@ async function maybeDelegateToOpenNextDeployCommand(projectRoot) {
219593
219789
  "OpenNext project detected, calling `opennextjs-cloudflare deploy`"
219594
219790
  );
219595
219791
  const deployArgIdx = process.argv.findIndex((arg) => arg === "deploy");
219596
- assert50__default.default(deployArgIdx !== -1, "Could not find `deploy` argument");
219792
+ assert51__default.default(deployArgIdx !== -1, "Could not find `deploy` argument");
219597
219793
  const deployArguments = process.argv.slice(deployArgIdx + 1);
219598
219794
  const { npx } = await getPackageManager();
219599
219795
  await runCommand2(
@@ -220107,7 +220303,7 @@ var init_deploy2 = __esm({
220107
220303
  );
220108
220304
  }
220109
220305
  if (!args.dryRun) {
220110
- assert50__default.default(accountId, "Missing account ID");
220306
+ assert51__default.default(accountId, "Missing account ID");
220111
220307
  await verifyWorkerMatchesCITag(
220112
220308
  config,
220113
220309
  accountId,
@@ -220388,8 +220584,8 @@ async function runSearch(searchTerm) {
220388
220584
  hitsPerPage: "1",
220389
220585
  getRankingInfo: "0"
220390
220586
  });
220391
- assert50__default.default(id, "Missing Algolia App ID");
220392
- assert50__default.default(key, "Missing Algolia Key");
220587
+ assert51__default.default(id, "Missing Algolia App ID");
220588
+ assert51__default.default(key, "Missing Algolia Key");
220393
220589
  const searchResp = await (0, import_undici15.fetch)(
220394
220590
  `https://${id}-dsn.algolia.net/1/indexes/${index}/query`,
220395
220591
  {
@@ -220655,11 +220851,14 @@ async function patchConfig(config, id, body) {
220655
220851
  }
220656
220852
  );
220657
220853
  }
220854
+ var PostgresSslmode, MySqlSslmode;
220658
220855
  var init_client4 = __esm({
220659
220856
  "src/hyperdrive/client.ts"() {
220660
220857
  init_import_meta_url();
220661
220858
  init_cfetch();
220662
220859
  init_user3();
220860
+ PostgresSslmode = ["require", "verify-ca", "verify-full"];
220861
+ MySqlSslmode = ["REQUIRED", "VERIFY_CA", "VERIFY_IDENTITY"];
220663
220862
  __name(createConfig, "createConfig");
220664
220863
  __name(deleteConfig, "deleteConfig");
220665
220864
  __name(getConfig, "getConfig");
@@ -220708,13 +220907,19 @@ var init_shared2 = __esm({
220708
220907
  });
220709
220908
 
220710
220909
  // src/hyperdrive/index.ts
220910
+ function normalizeMysqlSslmode(sslmode) {
220911
+ const mysqlSslmode = MySqlSslmode.find(
220912
+ (mode) => mode.toLowerCase() === sslmode.toLowerCase()
220913
+ );
220914
+ return mysqlSslmode ?? sslmode;
220915
+ }
220711
220916
  function getOriginFromArgs(allowPartialOrigin, args) {
220712
220917
  if (args.connectionString) {
220713
220918
  const url4 = new URL(args.connectionString);
220714
220919
  url4.protocol = url4.protocol.toLowerCase();
220715
- if (url4.port === "" && (url4.protocol == "postgresql:" || url4.protocol == "postgres:")) {
220920
+ if (url4.port === "" && (url4.protocol == "postgresql:" || url4.protocol === "postgres:")) {
220716
220921
  url4.port = "5432";
220717
- } else if (url4.port === "" && url4.protocol == "mysql:") {
220922
+ } else if (url4.port === "" && url4.protocol === "mysql:") {
220718
220923
  url4.port = "3306";
220719
220924
  }
220720
220925
  if (url4.protocol === "") {
@@ -220785,7 +220990,7 @@ function getOriginFromArgs(allowPartialOrigin, args) {
220785
220990
  "You must provide both an Access Client ID and Access Client Secret when configuring Hyperdrive-over-Access"
220786
220991
  );
220787
220992
  }
220788
- if (!args.originHost || args.originHost == "") {
220993
+ if (!args.originHost || args.originHost === "") {
220789
220994
  throw new UserError(
220790
220995
  "You must provide an origin hostname for the database"
220791
220996
  );
@@ -220837,17 +221042,16 @@ function getMtlsFromArgs(args) {
220837
221042
  const mtls = {
220838
221043
  ca_certificate_id: args.caCertificateId,
220839
221044
  mtls_certificate_id: args.mtlsCertificateId,
220840
- sslmode: args.sslmode
221045
+ sslmode: args.sslmode ? normalizeMysqlSslmode(args.sslmode) : void 0
220841
221046
  };
220842
221047
  if (JSON.stringify(mtls) === "{}") {
220843
221048
  return void 0;
220844
221049
  } else {
220845
- if (mtls.sslmode == "require" && mtls.ca_certificate_id?.trim()) {
220846
- throw new UserError("CA not allowed when sslmode = 'require' is set");
220847
- }
220848
- if ((mtls.sslmode == "verify-ca" || mtls.sslmode == "verify-full") && !mtls.ca_certificate_id?.trim()) {
221050
+ if (mtls.sslmode && !PostgresSslmode.includes(mtls.sslmode) && !MySqlSslmode.includes(mtls.sslmode)) {
220849
221051
  throw new UserError(
220850
- "CA required when sslmode = 'verify-ca' or 'verify-full' is set"
221052
+ `Invalid sslmode '${mtls.sslmode}'. Valid options are:
221053
+ - PostgreSQL: ${PostgresSslmode.join(", ")}
221054
+ - MySQL: ${MySqlSslmode.join(", ")}`
220851
221055
  );
220852
221056
  }
220853
221057
  return mtls;
@@ -220862,6 +221066,7 @@ var init_hyperdrive2 = __esm({
220862
221066
  init_import_meta_url();
220863
221067
  init_dist();
220864
221068
  init_create_command();
221069
+ init_client4();
220865
221070
  hyperdriveNamespace = createNamespace({
220866
221071
  metadata: {
220867
221072
  description: "\u{1F680} Manage Hyperdrive databases",
@@ -220870,6 +221075,7 @@ var init_hyperdrive2 = __esm({
220870
221075
  category: "Storage & databases"
220871
221076
  }
220872
221077
  });
221078
+ __name(normalizeMysqlSslmode, "normalizeMysqlSslmode");
220873
221079
  upsertOptions = /* @__PURE__ */ __name((defaultOriginScheme = void 0) => ({
220874
221080
  "connection-string": {
220875
221081
  type: "string",
@@ -220962,8 +221168,9 @@ var init_hyperdrive2 = __esm({
220962
221168
  },
220963
221169
  sslmode: {
220964
221170
  type: "string",
220965
- choices: ["require", "verify-ca", "verify-full"],
220966
- description: "Sets CA sslmode for connecting to database."
221171
+ coerce: normalizeMysqlSslmode,
221172
+ choices: [...PostgresSslmode, ...MySqlSslmode],
221173
+ description: `Sets sslmode for connecting to database. For PostgreSQL: '${PostgresSslmode.join(", ")}'. For MySQL: '${MySqlSslmode.join(", ")}'.`
220967
221174
  },
220968
221175
  "origin-connection-limit": {
220969
221176
  type: "number",
@@ -222012,7 +222219,7 @@ This action is irreversible and will permanently delete all data in the KV names
222012
222219
  }
222013
222220
  namespaceId = namespace.id;
222014
222221
  }
222015
- assert50.strict(namespaceId, "namespaceId should be defined");
222222
+ assert51.strict(namespaceId, "namespaceId should be defined");
222016
222223
  logger.log(`Renaming KV namespace ${namespaceId} to "${args.newName}".`);
222017
222224
  const updatedNamespace = await updateKVNamespace(
222018
222225
  config,
@@ -263264,7 +263471,7 @@ async function generateR2ServiceToken(accountId, bucketName, pipelineName) {
263264
263471
  const timeoutPromise = promises.setTimeout(12e4, "timeout", { signal });
263265
263472
  const serverPromise = new Promise((resolve31, reject) => {
263266
263473
  const server = http__namespace.default.createServer(async (request4, response) => {
263267
- assert50__default.default(request4.url, "This request doesn't have a URL");
263474
+ assert51__default.default(request4.url, "This request doesn't have a URL");
263268
263475
  if (request4.method !== "GET") {
263269
263476
  response.writeHead(405);
263270
263477
  response.end("Method not allowed.");
@@ -264751,7 +264958,7 @@ async function ensureCatalogEnabled(config, accountId, bucketName) {
264751
264958
  const catalog = await getR2Catalog(config, accountId, bucketName);
264752
264959
  catalogEnabled = catalog.status === "active";
264753
264960
  } catch (err) {
264754
- if (err instanceof APIError && err.code === 10006) ; else {
264961
+ if (err instanceof APIError && err.code === 40401) ; else {
264755
264962
  throw err;
264756
264963
  }
264757
264964
  }
@@ -273132,6 +273339,11 @@ ${dashLink}`);
273132
273339
  if (config.workflows?.length) {
273133
273340
  for (const workflow of config.workflows) {
273134
273341
  if (workflow.script_name !== void 0 && workflow.script_name !== scriptName) {
273342
+ if (workflow.limits) {
273343
+ throw new UserError(
273344
+ `Workflow "${workflow.name}" has "limits" configured but references external script "${workflow.script_name}". Configure limits on the worker that defines the workflow.`
273345
+ );
273346
+ }
273135
273347
  continue;
273136
273348
  }
273137
273349
  deployments.push(
@@ -273142,7 +273354,8 @@ ${dashLink}`);
273142
273354
  method: "PUT",
273143
273355
  body: JSON.stringify({
273144
273356
  script_name: scriptName,
273145
- class_name: workflow.class_name
273357
+ class_name: workflow.class_name,
273358
+ ...workflow.limits && { limits: workflow.limits }
273146
273359
  }),
273147
273360
  headers: {
273148
273361
  "Content-Type": "application/json"
@@ -273414,38 +273627,56 @@ var init_triggers = __esm({
273414
273627
  });
273415
273628
  }
273416
273629
  });
273417
- function getVarsForDev(configPath, envFiles, vars, env6, silent = false) {
273630
+ function getVarsForDev(configPath, envFiles, vars, env6, silent = false, secrets) {
273418
273631
  const result = {};
273419
273632
  for (const [key, value] of Object.entries(vars)) {
273420
273633
  result[key] = toVarBinding(value);
273421
273634
  }
273422
273635
  const configDir = path3__namespace.resolve(configPath ? path3__namespace.dirname(configPath) : ".");
273636
+ let loadedSecrets;
273423
273637
  if (!envFiles?.length) {
273424
273638
  const devVarsPath = path3__namespace.resolve(configDir, ".dev.vars");
273425
273639
  const loaded = loadDotDevDotVars(devVarsPath, env6);
273426
273640
  if (loaded !== void 0) {
273427
273641
  const devVarsRelativePath = path3__namespace.relative(process.cwd(), loaded.path);
273428
273642
  if (!silent) {
273429
- logger.log(`Using vars defined in ${devVarsRelativePath}`);
273643
+ logger.log(`Using secrets defined in ${devVarsRelativePath}`);
273430
273644
  }
273431
- for (const [key, value] of Object.entries(loaded.parsed)) {
273432
- result[key] = { type: "secret_text", value };
273433
- }
273434
- return result;
273645
+ loadedSecrets = loaded.parsed;
273435
273646
  }
273436
273647
  }
273437
- if (getCloudflareLoadDevVarsFromDotEnv()) {
273648
+ if (loadedSecrets === void 0 && getCloudflareLoadDevVarsFromDotEnv()) {
273438
273649
  const resolvedEnvFilePaths = (envFiles ?? getDefaultEnvFiles(env6)).map(
273439
273650
  (p7) => path3__namespace.resolve(configDir, p7)
273440
273651
  );
273441
- const dotEnvVars = loadDotEnv(resolvedEnvFilePaths, {
273442
- includeProcessEnv: getCloudflareIncludeProcessEnvFromEnv(),
273652
+ loadedSecrets = loadDotEnv(resolvedEnvFilePaths, {
273653
+ // When secrets is defined, always include `process.env`.
273654
+ // Otherwise, respect the CLOUDFLARE_INCLUDE_PROCESS_ENV env var.
273655
+ includeProcessEnv: !!secrets || getCloudflareIncludeProcessEnvFromEnv(),
273443
273656
  silent
273444
273657
  });
273445
- for (const [key, value] of Object.entries(dotEnvVars)) {
273446
- result[key] = { type: "secret_text", value: String(value) };
273658
+ }
273659
+ if (secrets) {
273660
+ const requiredSecrets = secrets.required ?? [];
273661
+ for (const key of requiredSecrets) {
273662
+ if (loadedSecrets !== void 0 && key in loadedSecrets) {
273663
+ result[key] = { type: "secret_text", value: loadedSecrets[key] };
273664
+ }
273665
+ }
273666
+ if (!silent) {
273667
+ const missing = requiredSecrets.filter(
273668
+ (key) => loadedSecrets === void 0 || !(key in loadedSecrets)
273669
+ );
273670
+ if (missing.length > 0) {
273671
+ logger.warn(
273672
+ `Missing required secrets: ${missing.join(", ")}. Add them to .dev.vars, .env, or set as environment variables.`
273673
+ );
273674
+ }
273675
+ }
273676
+ } else if (loadedSecrets !== void 0) {
273677
+ for (const [key, value] of Object.entries(loadedSecrets)) {
273678
+ result[key] = { type: "secret_text", value };
273447
273679
  }
273448
- return result;
273449
273680
  }
273450
273681
  return result;
273451
273682
  }
@@ -274092,22 +274323,50 @@ function generateImportSpecifier(from, to) {
274092
274323
  return `./${relativePath}/${filename}`;
274093
274324
  }
274094
274325
  }
274095
- async function generateEnvTypes(config, args, envInterface, outputPath, entrypoint, serviceEntries, log2 = true) {
274096
- const secretBindings = getVarsForDev(
274097
- config.userConfigPath,
274098
- args.envFile,
274099
- {},
274100
- args.env,
274101
- true
274102
- );
274103
- const secrets = {};
274104
- for (const key of Object.keys(secretBindings)) {
274105
- secrets[key] = "";
274326
+ function hasConfigSecrets(rawConfig) {
274327
+ if (rawConfig.secrets !== void 0) {
274328
+ return true;
274106
274329
  }
274330
+ return Object.values(rawConfig.env ?? {}).some(
274331
+ (env6) => env6.secrets !== void 0
274332
+ );
274333
+ }
274334
+ async function generateEnvTypes(config, args, envInterface, outputPath, entrypoint, serviceEntries, log2 = true) {
274107
274335
  const collectionArgs = {
274108
274336
  ...args,
274109
274337
  config: config.configPath
274110
274338
  };
274339
+ const { rawConfig } = exports.experimental_readRawConfig(collectionArgs);
274340
+ let secrets = {};
274341
+ let perEnvSecrets;
274342
+ const useConfigSecrets = hasConfigSecrets(rawConfig);
274343
+ if (useConfigSecrets) {
274344
+ perEnvSecrets = /* @__PURE__ */ new Map();
274345
+ const topLevelKeys = {};
274346
+ for (const key of rawConfig.secrets?.required ?? []) {
274347
+ topLevelKeys[key] = "";
274348
+ }
274349
+ perEnvSecrets.set(TOP_LEVEL_ENV_NAME, topLevelKeys);
274350
+ for (const [envName, envConfig] of Object.entries(rawConfig.env ?? {})) {
274351
+ const envKeys = {};
274352
+ for (const key of envConfig.secrets?.required ?? []) {
274353
+ envKeys[key] = "";
274354
+ }
274355
+ perEnvSecrets.set(envName, envKeys);
274356
+ }
274357
+ secrets = perEnvSecrets.get(args.env ?? TOP_LEVEL_ENV_NAME) ?? {};
274358
+ } else {
274359
+ const secretBindings = getVarsForDev(
274360
+ config.userConfigPath,
274361
+ args.envFile,
274362
+ {},
274363
+ args.env,
274364
+ true
274365
+ );
274366
+ for (const key of Object.keys(secretBindings)) {
274367
+ secrets[key] = "";
274368
+ }
274369
+ }
274111
274370
  const entrypointFormat = entrypoint?.format ?? "modules";
274112
274371
  const userProvidedEnvInterface = envInterface !== "Env";
274113
274372
  if (userProvidedEnvInterface && entrypointFormat === "service-worker") {
@@ -274115,7 +274374,6 @@ async function generateEnvTypes(config, args, envInterface, outputPath, entrypoi
274115
274374
  "An env-interface value has been provided but the worker uses the incompatible Service Worker syntax"
274116
274375
  );
274117
274376
  }
274118
- const { rawConfig } = exports.experimental_readRawConfig(collectionArgs);
274119
274377
  const hasEnvironments = !!rawConfig.env && Object.keys(rawConfig.env).length > 0;
274120
274378
  const shouldGeneratePerEnvTypes = hasEnvironments && !args.env;
274121
274379
  if (shouldGeneratePerEnvTypes) {
@@ -274127,6 +274385,7 @@ async function generateEnvTypes(config, args, envInterface, outputPath, entrypoi
274127
274385
  entrypoint,
274128
274386
  serviceEntries,
274129
274387
  secrets,
274388
+ perEnvSecrets,
274130
274389
  log2
274131
274390
  );
274132
274391
  }
@@ -274351,7 +274610,7 @@ async function generateSimpleEnvTypes(config, collectionArgs, envInterface, outp
274351
274610
  };
274352
274611
  }
274353
274612
  }
274354
- async function generatePerEnvironmentTypes(config, collectionArgs, envInterface, outputPath, entrypoint, serviceEntries, secrets = {}, log2 = true) {
274613
+ async function generatePerEnvironmentTypes(config, collectionArgs, envInterface, outputPath, entrypoint, serviceEntries, secrets = {}, perEnvSecrets, log2 = true) {
274355
274614
  const { rawConfig } = exports.experimental_readRawConfig(collectionArgs);
274356
274615
  const envNames = Object.keys(rawConfig.env ?? {});
274357
274616
  validateEnvInterfaceNames(envNames);
@@ -274433,6 +274692,7 @@ async function generatePerEnvironmentTypes(config, collectionArgs, envInterface,
274433
274692
  for (const envName of envNames) {
274434
274693
  const interfaceName = toEnvInterfaceName(envName);
274435
274694
  const envBindings = new Array();
274695
+ const envSecrets = perEnvSecrets?.get(envName) ?? secrets;
274436
274696
  const bindings = bindingsPerEnv.get(envName) ?? [];
274437
274697
  for (const binding of bindings) {
274438
274698
  envBindings.push({
@@ -274443,7 +274703,7 @@ async function generatePerEnvironmentTypes(config, collectionArgs, envInterface,
274443
274703
  }
274444
274704
  const vars = varsPerEnv.get(envName) ?? {};
274445
274705
  for (const [varName, varValues] of Object.entries(vars)) {
274446
- if (varName in secrets) {
274706
+ if (varName in envSecrets) {
274447
274707
  continue;
274448
274708
  }
274449
274709
  const varType = varValues.length === 1 ? varValues[0] : varValues.join(" | ");
@@ -274453,8 +274713,9 @@ async function generatePerEnvironmentTypes(config, collectionArgs, envInterface,
274453
274713
  stringKeys.push(varName);
274454
274714
  }
274455
274715
  }
274456
- for (const secretName in secrets) {
274716
+ for (const secretName in envSecrets) {
274457
274717
  envBindings.push({ key: constructTypeKey(secretName), value: "string" });
274718
+ trackBinding(secretName, "string", envName);
274458
274719
  if (!stringKeys.includes(secretName)) {
274459
274720
  stringKeys.push(secretName);
274460
274721
  }
@@ -274519,9 +274780,10 @@ ${bindingLines}
274519
274780
  for (const binding of topLevelBindings) {
274520
274781
  trackBinding(binding.name, binding.type, TOP_LEVEL_ENV_NAME);
274521
274782
  }
274783
+ const topLevelSecrets = perEnvSecrets?.get(TOP_LEVEL_ENV_NAME) ?? secrets;
274522
274784
  const topLevelVars = varsPerEnv.get(TOP_LEVEL_ENV_NAME) ?? {};
274523
274785
  for (const [varName, varValues] of Object.entries(topLevelVars)) {
274524
- if (varName in secrets) {
274786
+ if (varName in topLevelSecrets) {
274525
274787
  continue;
274526
274788
  }
274527
274789
  const varType = varValues.length === 1 ? varValues[0] : varValues.join(" | ");
@@ -274530,6 +274792,12 @@ ${bindingLines}
274530
274792
  stringKeys.push(varName);
274531
274793
  }
274532
274794
  }
274795
+ for (const secretName in topLevelSecrets) {
274796
+ trackBinding(secretName, "string", TOP_LEVEL_ENV_NAME);
274797
+ if (!stringKeys.includes(secretName)) {
274798
+ stringKeys.push(secretName);
274799
+ }
274800
+ }
274533
274801
  const topLevelDOs = durableObjectsPerEnv.get(TOP_LEVEL_ENV_NAME) ?? [];
274534
274802
  for (const durableObject of topLevelDOs) {
274535
274803
  const type = getDurableObjectType(durableObject);
@@ -274562,17 +274830,7 @@ ${bindingLines}
274562
274830
  }
274563
274831
  }
274564
274832
  const aggregatedEnvBindings = new Array();
274565
- for (const secretName in secrets) {
274566
- aggregatedEnvBindings.push({
274567
- key: constructTypeKey(secretName),
274568
- required: true,
274569
- type: "string"
274570
- });
274571
- }
274572
274833
  for (const [name2, types12] of aggregatedBindings.entries()) {
274573
- if (name2 in secrets) {
274574
- continue;
274575
- }
274576
274834
  const typeArray = Array.from(types12);
274577
274835
  const unionType2 = typeArray.length === 1 ? typeArray[0] : typeArray.join(" | ");
274578
274836
  const presence = bindingPresence.get(name2);
@@ -276197,6 +276455,7 @@ ${content.join("\n")}`,
276197
276455
  __name(constructTypeKey, "constructTypeKey");
276198
276456
  __name(constructTSModuleGlob, "constructTSModuleGlob");
276199
276457
  __name(generateImportSpecifier, "generateImportSpecifier");
276458
+ __name(hasConfigSecrets, "hasConfigSecrets");
276200
276459
  __name(generateEnvTypes, "generateEnvTypes");
276201
276460
  __name(generateSimpleEnvTypes, "generateSimpleEnvTypes");
276202
276461
  __name(generatePerEnvironmentTypes, "generatePerEnvironmentTypes");
@@ -278220,13 +278479,13 @@ ${ZERO_WIDTH_SPACE} Message: ${version5.annotations?.["workers/message"]
278220
278479
  },
278221
278480
  renderers: {
278222
278481
  submit({ value: versionIds }) {
278223
- assert50__default.default(Array.isArray(versionIds));
278482
+ assert51__default.default(Array.isArray(versionIds));
278224
278483
  const label = brandColor(
278225
278484
  `${versionIds.length} Worker Version(s) selected`
278226
278485
  );
278227
278486
  const versions2 = versionIds?.map((versionId, i7) => {
278228
278487
  const version5 = versionCache.get(versionId);
278229
- assert50__default.default(version5);
278488
+ assert51__default.default(version5);
278230
278489
  return `${grayBar}
278231
278490
  ${leftT} ${white(` Worker Version ${i7 + 1}: `, version5.id)}
278232
278491
  ${grayBar} ${gray(" Created: ", version5.metadata.created_on)}
@@ -278852,7 +279111,7 @@ var init_list12 = __esm({
278852
279111
  const formattedDeployments = deployments.map((deployment) => {
278853
279112
  const formattedVersions = deployment.versions.map((traffic) => {
278854
279113
  const version5 = versionCache.get(traffic.version_id);
278855
- assert50__default.default(version5);
279114
+ assert51__default.default(version5);
278856
279115
  const percentage = brandColor(`(${traffic.percentage}%)`);
278857
279116
  const details = formatLabelledValues(
278858
279117
  {
@@ -278957,7 +279216,7 @@ var init_status3 = __esm({
278957
279216
  );
278958
279217
  const formattedVersions = latestDeployment.versions.map((traffic) => {
278959
279218
  const version5 = versionCache.get(traffic.version_id);
278960
- assert50__default.default(version5);
279219
+ assert51__default.default(version5);
278961
279220
  const percentage = brandColor(`(${traffic.percentage}%)`);
278962
279221
  const details = formatLabelledValues(
278963
279222
  {
@@ -279865,7 +280124,7 @@ var init_log_build_output = __esm({
279865
280124
  });
279866
280125
  async function getMigrationsToUpload(scriptName, props) {
279867
280126
  const { config, accountId } = props;
279868
- assert50__default.default(accountId, "Missing accountId");
280127
+ assert51__default.default(accountId, "Missing accountId");
279869
280128
  let migrations;
279870
280129
  if (config.migrations.length > 0) {
279871
280130
  let script;
@@ -280273,7 +280532,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
280273
280532
  { unsafeMetadata: config.unsafe?.metadata }
280274
280533
  );
280275
280534
  } else {
280276
- assert50__default.default(accountId, "Missing accountId");
280535
+ assert51__default.default(accountId, "Missing accountId");
280277
280536
  if (getFlag("RESOURCES_PROVISION")) {
280278
280537
  await provisionBindings(
280279
280538
  bindings,
@@ -280735,7 +280994,7 @@ var init_upload5 = __esm({
280735
280994
  }
280736
280995
  const previewAlias = args.previewAlias ?? (getCIGeneratePreviewAlias() === "true" ? generatePreviewAlias(name2) : void 0);
280737
280996
  if (!args.dryRun) {
280738
- assert50__default.default(accountId, "Missing account ID");
280997
+ assert51__default.default(accountId, "Missing account ID");
280739
280998
  await verifyWorkerMatchesCITag(
280740
280999
  config,
280741
281000
  accountId,
@@ -286180,6 +286439,10 @@ function createCLIParser(argv) {
286180
286439
  command: "wrangler containers registries delete",
286181
286440
  definition: containersRegistriesDeleteCommand
286182
286441
  },
286442
+ {
286443
+ command: "wrangler containers registries credentials",
286444
+ definition: containersRegistriesCredentialsCommand
286445
+ },
286183
286446
  {
286184
286447
  command: "wrangler containers images",
286185
286448
  definition: containersImagesNamespace
@@ -287091,7 +287354,7 @@ Error: ${errorMessage}
287091
287354
  if (e9.cause instanceof ApiError) {
287092
287355
  logger.error(e9.cause);
287093
287356
  } else {
287094
- assert50__default.default(isAuthenticationError(e9));
287357
+ assert51__default.default(isAuthenticationError(e9));
287095
287358
  logger.error(e9);
287096
287359
  }
287097
287360
  const envAuth = getAuthFromEnv();
@@ -287675,10 +287938,10 @@ var require_difflib = __commonJS({
287675
287938
  "../../node_modules/.pnpm/@ewoudenberg+difflib@0.1.0/node_modules/@ewoudenberg/difflib/lib/difflib.js"(exports) {
287676
287939
  init_import_meta_url();
287677
287940
  (function() {
287678
- var Differ, Heap, IS_CHARACTER_JUNK, IS_LINE_JUNK, SequenceMatcher, _any, _arrayCmp, _calculateRatio, _countLeading, _formatRangeContext, _formatRangeUnified, _has, assert58, contextDiff, floor, getCloseMatches, max, min, ndiff, restore, unifiedDiff, indexOf = [].indexOf;
287941
+ var Differ, Heap, IS_CHARACTER_JUNK, IS_LINE_JUNK, SequenceMatcher, _any, _arrayCmp, _calculateRatio, _countLeading, _formatRangeContext, _formatRangeUnified, _has, assert59, contextDiff, floor, getCloseMatches, max, min, ndiff, restore, unifiedDiff, indexOf = [].indexOf;
287679
287942
  ({ floor, max, min } = Math);
287680
287943
  Heap = require_heap2();
287681
- assert58 = __require("assert");
287944
+ assert59 = __require("assert");
287682
287945
  _calculateRatio = /* @__PURE__ */ __name(function(matches, length) {
287683
287946
  if (length) {
287684
287947
  return 2 * matches / length;
@@ -288249,7 +288512,7 @@ var require_difflib = __commonJS({
288249
288512
  }
288250
288513
  _plainReplace(a7, alo, ahi, b11, blo, bhi) {
288251
288514
  var first, g7, l8, len, len1, line, lines, m7, ref, second;
288252
- assert58(alo < ahi && blo < bhi);
288515
+ assert59(alo < ahi && blo < bhi);
288253
288516
  if (bhi - blo < ahi - alo) {
288254
288517
  first = this._dump("+", b11, blo, bhi);
288255
288518
  second = this._dump("-", a7, alo, ahi);
@@ -290068,10 +290331,10 @@ function populateConfigPatch(diff, patchObj, targetEnvironment) {
290068
290331
  return;
290069
290332
  }
290070
290333
  if (Array.isArray(diff)) {
290071
- assert50__default.default(Array.isArray(patchObj));
290334
+ assert51__default.default(Array.isArray(patchObj));
290072
290335
  return populateConfigPatchArray(diff, patchObj);
290073
290336
  }
290074
- assert50__default.default(!Array.isArray(patchObj));
290337
+ assert51__default.default(!Array.isArray(patchObj));
290075
290338
  return populateConfigPatchObject(diff, patchObj, targetEnvironment);
290076
290339
  }
290077
290340
  function populateConfigPatchArray(diff, patchArray) {
@@ -290451,7 +290714,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
290451
290714
  );
290452
290715
  }
290453
290716
  const scriptName = props.name;
290454
- assert50__default.default(
290717
+ assert51__default.default(
290455
290718
  !config.site || config.site.bucket,
290456
290719
  "A [site] definition requires a `bucket` field with a path to the site's assets directory."
290457
290720
  );
@@ -290732,7 +290995,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
290732
290995
  { warnIfNoBindings: true, unsafeMetadata: config.unsafe?.metadata }
290733
290996
  );
290734
290997
  } else {
290735
- assert50__default.default(accountId, "Missing accountId");
290998
+ assert51__default.default(accountId, "Missing accountId");
290736
290999
  if (getFlag("RESOURCES_PROVISION")) {
290737
291000
  await provisionBindings(
290738
291001
  bindings ?? {},
@@ -290942,7 +291205,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
290942
291205
  return { versionId, workerTag };
290943
291206
  }
290944
291207
  if (normalisedContainerConfig.length) {
290945
- assert50__default.default(versionId && accountId);
291208
+ assert51__default.default(versionId && accountId);
290946
291209
  await deployContainers(config, normalisedContainerConfig, {
290947
291210
  versionId,
290948
291211
  accountId,
@@ -291462,7 +291725,7 @@ var init_assets5 = __esm({
291462
291725
  MAX_UPLOAD_GATEWAY_ERRORS2 = 5;
291463
291726
  MAX_DIFF_LINES2 = 100;
291464
291727
  syncAssets = /* @__PURE__ */ __name(async (complianceConfig, accountId, assetDirectory, scriptName, dispatchNamespace) => {
291465
- assert50__default.default(accountId, "Missing accountId");
291728
+ assert51__default.default(accountId, "Missing accountId");
291466
291729
  logger.info("\u{1F300} Building list of assets...");
291467
291730
  const manifest = await buildAssetManifest(assetDirectory);
291468
291731
  const url4 = dispatchNamespace ? `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/assets-upload-session` : `/accounts/${accountId}/workers/scripts/${scriptName}/assets-upload-session`;
@@ -291770,7 +292033,9 @@ function getBindings2(configParam, env6, envFiles, local, inputBindings, default
291770
292033
  configParam.userConfigPath,
291771
292034
  envFiles,
291772
292035
  configParam.vars,
291773
- env6
292036
+ env6,
292037
+ false,
292038
+ configParam.secrets
291774
292039
  );
291775
292040
  for (const [name2, binding] of Object.entries(vars)) {
291776
292041
  const existingBinding = bindings[name2];
@@ -292068,7 +292333,7 @@ var init_dev2 = __esm({
292068
292333
  },
292069
292334
  async handler(args) {
292070
292335
  const devInstance = await startDev(args);
292071
- assert50__default.default(devInstance.devEnv !== void 0);
292336
+ assert51__default.default(devInstance.devEnv !== void 0);
292072
292337
  await events__default.default.once(devInstance.devEnv, "teardown");
292073
292338
  await Promise.all(devInstance.secondary.map((d8) => d8.teardown()));
292074
292339
  if (devInstance.teardownRegistryPromise) {
@@ -292140,7 +292405,7 @@ function runBuild({
292140
292405
  async function updateBundle() {
292141
292406
  const newAdditionalModules = await getAdditionalModules();
292142
292407
  setBundle((previousBundle) => {
292143
- assert50__default.default(
292408
+ assert51__default.default(
292144
292409
  previousBundle,
292145
292410
  "Rebuild triggered with no previous build available"
292146
292411
  );
@@ -292291,7 +292556,7 @@ var init_BundlerController = __esm({
292291
292556
  if (buildAborter.signal.aborted) {
292292
292557
  return;
292293
292558
  }
292294
- assert50__default.default(this.#tmpDir);
292559
+ assert51__default.default(this.#tmpDir);
292295
292560
  if (!config.build?.bundle) {
292296
292561
  const destinationDir = this.#tmpDir.path;
292297
292562
  fs23.writeFileSync(
@@ -292409,7 +292674,7 @@ var init_BundlerController = __esm({
292409
292674
  return;
292410
292675
  }
292411
292676
  const pathsToWatch = config.build.custom.watch;
292412
- assert50__default.default(pathsToWatch, "config.build.custom.watch");
292677
+ assert51__default.default(pathsToWatch, "config.build.custom.watch");
292413
292678
  this.#customBuildWatcher = watch(pathsToWatch, {
292414
292679
  persistent: true,
292415
292680
  // The initial custom build is always done in getEntry()
@@ -292433,7 +292698,7 @@ var init_BundlerController = __esm({
292433
292698
  if (config.build?.custom?.command) {
292434
292699
  return;
292435
292700
  }
292436
- assert50__default.default(this.#tmpDir);
292701
+ assert51__default.default(this.#tmpDir);
292437
292702
  const entry = {
292438
292703
  file: config.entrypoint,
292439
292704
  projectRoot: config.projectRoot,
@@ -292830,7 +293095,7 @@ async function resolveDevConfig(config, input) {
292830
293095
  );
292831
293096
  if (input.dev?.remote) {
292832
293097
  const { accountId } = await auth();
292833
- assert50__default.default(accountId, "Account ID must be provided for remote dev");
293098
+ assert51__default.default(accountId, "Account ID must be provided for remote dev");
292834
293099
  await getZoneIdForPreview(config, { host, routes, accountId });
292835
293100
  }
292836
293101
  const initialIp = input.dev?.server?.hostname ?? config.dev.ip;
@@ -293146,7 +293411,7 @@ var init_ConfigController = __esm({
293146
293411
  return;
293147
293412
  }
293148
293413
  logger.debug(`${path3__namespace.default.basename(configPath)} changed...`);
293149
- assert50__default.default(
293414
+ assert51__default.default(
293150
293415
  this.latestInput,
293151
293416
  "Cannot be watching config without having first set an input"
293152
293417
  );
@@ -293172,7 +293437,7 @@ var init_ConfigController = __esm({
293172
293437
  }
293173
293438
  patch(input) {
293174
293439
  logger.debug("patching config");
293175
- assert50__default.default(
293440
+ assert51__default.default(
293176
293441
  this.latestInput,
293177
293442
  "Cannot call updateConfig without previously calling setConfig"
293178
293443
  );
@@ -293336,7 +293601,7 @@ function maybeGetSourceMappingURL(sourcePath) {
293336
293601
  return;
293337
293602
  }
293338
293603
  const sourceMappingURLMatch = source.substring(sourceMappingURLIndex).match(/^\/\/# sourceMappingURL=(.+)/);
293339
- assert50__default.default(sourceMappingURLMatch !== null);
293604
+ assert51__default.default(sourceMappingURLMatch !== null);
293340
293605
  const sourceMappingURLSpecifier = sourceMappingURLMatch[1];
293341
293606
  const sourceURL = Url.pathToFileURL(sourcePath);
293342
293607
  try {
@@ -293654,7 +293919,7 @@ var init_ProxyController = __esm({
293654
293919
  if (this._torndown) {
293655
293920
  return;
293656
293921
  }
293657
- assert50__default.default(this.latestConfig !== void 0);
293922
+ assert51__default.default(this.latestConfig !== void 0);
293658
293923
  const cert = this.latestConfig.dev?.server?.secure || this.inspectorEnabled && this.latestConfig.dev?.inspector && this.latestConfig.dev?.inspector?.secure ? validateHttpsOptions(
293659
293924
  this.latestConfig.dev.server?.httpsKeyPath,
293660
293925
  this.latestConfig.dev.server?.httpsCertPath
@@ -293714,7 +293979,7 @@ var init_ProxyController = __esm({
293714
293979
  liveReload: false
293715
293980
  };
293716
293981
  if (this.inspectorEnabled) {
293717
- assert50__default.default(this.latestConfig.dev?.inspector);
293982
+ assert51__default.default(this.latestConfig.dev?.inspector);
293718
293983
  proxyWorkerOptions.workers.push({
293719
293984
  name: "InspectorProxyWorker",
293720
293985
  compatibilityDate: "2023-12-18",
@@ -293779,7 +294044,7 @@ var init_ProxyController = __esm({
293779
294044
  inspectorUrl
293780
294045
  ]);
293781
294046
  }).then(([url4, inspectorUrl]) => {
293782
- assert50__default.default(url4);
294047
+ assert51__default.default(url4);
293783
294048
  this.emitReadyEvent(proxyWorker, url4, inspectorUrl);
293784
294049
  }).catch((error2) => {
293785
294050
  if (this._torndown) {
@@ -293796,7 +294061,7 @@ var init_ProxyController = __esm({
293796
294061
  if (this._torndown) {
293797
294062
  return;
293798
294063
  }
293799
- assert50__default.default(
294064
+ assert51__default.default(
293800
294065
  this.latestConfig?.dev.inspector !== false,
293801
294066
  "Trying to reconnect with inspector proxy worker when inspector is disabled"
293802
294067
  );
@@ -293807,7 +294072,7 @@ var init_ProxyController = __esm({
293807
294072
  this.inspectorProxyWorkerWebSocket = createDeferred();
293808
294073
  let webSocket = null;
293809
294074
  try {
293810
- assert50__default.default(this.proxyWorker);
294075
+ assert51__default.default(this.proxyWorker);
293811
294076
  const inspectorProxyWorkerUrl = await this.proxyWorker.unsafeGetDirectURL(
293812
294077
  "InspectorProxyWorker"
293813
294078
  );
@@ -293827,12 +294092,12 @@ var init_ProxyController = __esm({
293827
294092
  this.emitErrorEvent("Could not connect to InspectorProxyWorker", error2);
293828
294093
  return;
293829
294094
  }
293830
- assert50__default.default(
294095
+ assert51__default.default(
293831
294096
  webSocket,
293832
294097
  "Expected webSocket on response from inspectorProxyWorker"
293833
294098
  );
293834
294099
  webSocket.addEventListener("message", (event) => {
293835
- assert50__default.default(typeof event.data === "string");
294100
+ assert51__default.default(typeof event.data === "string");
293836
294101
  this.onInspectorProxyWorkerMessage(JSON.parse(event.data));
293837
294102
  });
293838
294103
  webSocket.addEventListener("close", () => {
@@ -293887,13 +294152,13 @@ var init_ProxyController = __esm({
293887
294152
  if (this._torndown) {
293888
294153
  return;
293889
294154
  }
293890
- assert50__default.default(
294155
+ assert51__default.default(
293891
294156
  this.latestConfig?.dev.inspector !== false,
293892
294157
  "Trying to send message to inspector proxy worker when inspector is disabled"
293893
294158
  );
293894
294159
  try {
293895
294160
  const websocket = await this.reconnectInspectorProxyWorker();
293896
- assert50__default.default(websocket);
294161
+ assert51__default.default(websocket);
293897
294162
  websocket.send(JSON.stringify(message));
293898
294163
  } catch (cause) {
293899
294164
  if (this._torndown) {
@@ -293967,7 +294232,7 @@ var init_ProxyController = __esm({
293967
294232
  }
293968
294233
  }
293969
294234
  onInspectorProxyWorkerMessage(message) {
293970
- assert50__default.default(
294235
+ assert51__default.default(
293971
294236
  this.latestConfig?.dev.inspector !== false,
293972
294237
  "Trying to handle inspector message when inspector is disabled"
293973
294238
  );
@@ -293990,7 +294255,7 @@ var init_ProxyController = __esm({
293990
294255
  }
293991
294256
  }
293992
294257
  async onInspectorProxyWorkerRequest(message) {
293993
- assert50__default.default(
294258
+ assert51__default.default(
293994
294259
  this.latestConfig?.dev.inspector !== false,
293995
294260
  "Trying to handle inspector request when inspector is disabled"
293996
294261
  );
@@ -294011,8 +294276,8 @@ var init_ProxyController = __esm({
294011
294276
  logger.debug("[InspectorProxyWorker]", ...message.args);
294012
294277
  break;
294013
294278
  case "load-network-resource": {
294014
- assert50__default.default(this.latestConfig !== void 0);
294015
- assert50__default.default(this.latestBundle !== void 0);
294279
+ assert51__default.default(this.latestConfig !== void 0);
294280
+ assert51__default.default(this.latestBundle !== void 0);
294016
294281
  let maybeContents;
294017
294282
  if (message.url.startsWith("wrangler-file:")) {
294018
294283
  maybeContents = maybeHandleNetworkLoadResource(
@@ -294275,7 +294540,7 @@ var init_create_worker_preview = __esm({
294275
294540
  }
294276
294541
  });
294277
294542
  function handlePreviewSessionUploadError(err, accountId) {
294278
- assert50__default.default(err && typeof err === "object");
294543
+ assert51__default.default(err && typeof err === "object");
294279
294544
  if (!isAbortError(err)) {
294280
294545
  if ("code" in err && err.code === 10049) {
294281
294546
  logger.log("Preview token expired, fetching a new one");
@@ -294287,7 +294552,7 @@ function handlePreviewSessionUploadError(err, accountId) {
294287
294552
  return false;
294288
294553
  }
294289
294554
  function handlePreviewSessionCreationError(err, accountId) {
294290
- assert50__default.default(err && typeof err === "object");
294555
+ assert51__default.default(err && typeof err === "object");
294291
294556
  if ("code" in err && err.code === 10063) {
294292
294557
  logger.error(
294293
294558
  `You need to register a workers.dev subdomain before running the dev command in remote mode. You can either enable local mode by pressing l, or register a workers.dev subdomain here: https://dash.cloudflare.com/${accountId}/workers/onboarding`
@@ -294830,7 +295095,7 @@ function createWorkerObject(devEnv) {
294830
295095
  return devEnv.proxy.ready.promise.then((ev) => ev.inspectorUrl);
294831
295096
  },
294832
295097
  get config() {
294833
- assert50__default.default(devEnv.config.latestConfig);
295098
+ assert51__default.default(devEnv.config.latestConfig);
294834
295099
  return devEnv.config.latestConfig;
294835
295100
  },
294836
295101
  async setConfig(config, throwErrors) {
@@ -294845,7 +295110,7 @@ function createWorkerObject(devEnv) {
294845
295110
  return proxyWorker.dispatchFetch(...args);
294846
295111
  },
294847
295112
  async queue(...args) {
294848
- assert50__default.default(
295113
+ assert51__default.default(
294849
295114
  this.config.name,
294850
295115
  "Worker name must be defined to use `Worker.queue()`"
294851
295116
  );
@@ -294854,7 +295119,7 @@ function createWorkerObject(devEnv) {
294854
295119
  return w7.queue(...args);
294855
295120
  },
294856
295121
  async scheduled(...args) {
294857
- assert50__default.default(
295122
+ assert51__default.default(
294858
295123
  this.config.name,
294859
295124
  "Worker name must be defined to use `Worker.scheduled()`"
294860
295125
  );
@@ -295240,7 +295505,7 @@ function getAuthHook(auth, config) {
295240
295505
  }
295241
295506
  function deepStrictEqual(source, target) {
295242
295507
  try {
295243
- assert50__default.default.deepStrictEqual(source, target);
295508
+ assert51__default.default.deepStrictEqual(source, target);
295244
295509
  return true;
295245
295510
  } catch {
295246
295511
  return false;
@@ -295468,7 +295733,7 @@ var init_LocalRuntimeController = __esm({
295468
295733
  }
295469
295734
  if (data.config.containers?.length && data.config.dev.enableContainers && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
295470
295735
  this.dockerPath = data.config.dev?.dockerPath ?? getDockerPath();
295471
- assert50__default.default(
295736
+ assert51__default.default(
295472
295737
  data.config.dev.containerBuildId,
295473
295738
  "Build ID should be set if containers are enabled and defined"
295474
295739
  );
@@ -295502,7 +295767,8 @@ var init_LocalRuntimeController = __esm({
295502
295767
  this.containerBeingBuilt = void 0;
295503
295768
  }, "onContainerImagePreparationEnd"),
295504
295769
  logger,
295505
- isVite: false
295770
+ isVite: false,
295771
+ compatibilityFlags: data.config.compatibilityFlags
295506
295772
  });
295507
295773
  if (this.containerBeingBuilt) {
295508
295774
  this.containerBeingBuilt.abortRequested = false;
@@ -295600,7 +295866,7 @@ var init_LocalRuntimeController = __esm({
295600
295866
  if (!this.containerImageTagsSeen.size) {
295601
295867
  return;
295602
295868
  }
295603
- assert50__default.default(
295869
+ assert51__default.default(
295604
295870
  this.dockerPath,
295605
295871
  "Docker path should have been set if containers are enabled"
295606
295872
  );
@@ -295708,7 +295974,7 @@ var init_MultiworkerRuntimeController = __esm({
295708
295974
  }
295709
295975
  #mergedMfOptions() {
295710
295976
  const primary = [...this.#options.values()].find((o7) => o7.primary);
295711
- assert50__default.default(primary !== void 0);
295977
+ assert51__default.default(primary !== void 0);
295712
295978
  const secondary = [...this.#options.values()].filter((o7) => !o7.primary);
295713
295979
  return {
295714
295980
  ...primary.options,
@@ -295743,7 +296009,7 @@ var init_MultiworkerRuntimeController = __esm({
295743
296009
  }
295744
296010
  if (data.config.containers?.length && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
295745
296011
  logger.log(source_default.dim("\u2394 Preparing container image(s)..."));
295746
- assert50__default.default(
296012
+ assert51__default.default(
295747
296013
  data.config.dev.containerBuildId,
295748
296014
  "Build ID should be set if containers are enabled and defined"
295749
296015
  );
@@ -295768,7 +296034,8 @@ var init_MultiworkerRuntimeController = __esm({
295768
296034
  this.containerBeingBuilt = void 0;
295769
296035
  }, "onContainerImagePreparationEnd"),
295770
296036
  logger,
295771
- isVite: false
296037
+ isVite: false,
296038
+ compatibilityFlags: data.config.compatibilityFlags
295772
296039
  });
295773
296040
  if (this.containerBeingBuilt) {
295774
296041
  this.containerBeingBuilt.abortRequested = false;
@@ -298394,12 +298661,12 @@ var init_assets6 = __esm({
298394
298661
  * by the `fetch()` function before calling `dispatcher.dispatch()`.
298395
298662
  */
298396
298663
  static reinstateHostHeader(headers, host) {
298397
- assert50__default.default(headers, "Expected all proxy requests to contain headers.");
298398
- assert50__default.default(
298664
+ assert51__default.default(headers, "Expected all proxy requests to contain headers.");
298665
+ assert51__default.default(
298399
298666
  !Array.isArray(headers),
298400
298667
  "Expected proxy request headers to be a hash object"
298401
298668
  );
298402
- assert50__default.default(
298669
+ assert51__default.default(
298403
298670
  Object.keys(headers).every((h7) => h7.toLowerCase() !== "host"),
298404
298671
  "Expected Host header to have been deleted."
298405
298672
  );
@@ -298431,7 +298698,7 @@ async function startDev(args) {
298431
298698
  unregisterHotKeys?.();
298432
298699
  accountId = await requireAuth(config);
298433
298700
  if (hotkeysDisplayed) {
298434
- assert50__default.default(devEnv !== void 0);
298701
+ assert51__default.default(devEnv !== void 0);
298435
298702
  unregisterHotKeys = registerDevHotKeys(
298436
298703
  Array.isArray(devEnv) ? devEnv : [devEnv],
298437
298704
  args,