wrangler 4.24.4 → 4.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2723,7 +2723,7 @@ var require_util = __commonJS({
2723
2723
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/core/util.js"(exports2, module3) {
2724
2724
  "use strict";
2725
2725
  init_import_meta_url();
2726
- var assert41 = require("assert");
2726
+ var assert42 = require("assert");
2727
2727
  var { kDestroyed, kBodyUsed, kListeners, kBody } = require_symbols();
2728
2728
  var { IncomingMessage } = require("http");
2729
2729
  var stream2 = require("stream");
@@ -2745,7 +2745,7 @@ var require_util = __commonJS({
2745
2745
  this[kBodyUsed] = false;
2746
2746
  }
2747
2747
  async *[Symbol.asyncIterator]() {
2748
- assert41(!this[kBodyUsed], "disturbed");
2748
+ assert42(!this[kBodyUsed], "disturbed");
2749
2749
  this[kBodyUsed] = true;
2750
2750
  yield* this[kBody];
2751
2751
  }
@@ -2757,7 +2757,7 @@ var require_util = __commonJS({
2757
2757
  if (isStream2(body)) {
2758
2758
  if (bodyLength(body) === 0) {
2759
2759
  body.on("data", function() {
2760
- assert41(false);
2760
+ assert42(false);
2761
2761
  });
2762
2762
  }
2763
2763
  if (typeof body.readableDidRead !== "boolean") {
@@ -2871,7 +2871,7 @@ var require_util = __commonJS({
2871
2871
  function getHostname(host) {
2872
2872
  if (host[0] === "[") {
2873
2873
  const idx2 = host.indexOf("]");
2874
- assert41(idx2 !== -1);
2874
+ assert42(idx2 !== -1);
2875
2875
  return host.substring(1, idx2);
2876
2876
  }
2877
2877
  const idx = host.indexOf(":");
@@ -2883,7 +2883,7 @@ var require_util = __commonJS({
2883
2883
  if (!host) {
2884
2884
  return null;
2885
2885
  }
2886
- assert41(typeof host === "string");
2886
+ assert42(typeof host === "string");
2887
2887
  const servername = getHostname(host);
2888
2888
  if (net2.isIP(servername)) {
2889
2889
  return "";
@@ -3190,7 +3190,7 @@ var require_util = __commonJS({
3190
3190
  function errorRequest(client, request4, err) {
3191
3191
  try {
3192
3192
  request4.onError(err);
3193
- assert41(request4.aborted);
3193
+ assert42(request4.aborted);
3194
3194
  } catch (err2) {
3195
3195
  client.emit("error", err2);
3196
3196
  }
@@ -3566,7 +3566,7 @@ var require_request = __commonJS({
3566
3566
  InvalidArgumentError,
3567
3567
  NotSupportedError
3568
3568
  } = require_errors();
3569
- var assert41 = require("assert");
3569
+ var assert42 = require("assert");
3570
3570
  var {
3571
3571
  isValidHTTPToken,
3572
3572
  isValidHeaderValue,
@@ -3740,8 +3740,8 @@ var require_request = __commonJS({
3740
3740
  }
3741
3741
  }
3742
3742
  onConnect(abort) {
3743
- assert41(!this.aborted);
3744
- assert41(!this.completed);
3743
+ assert42(!this.aborted);
3744
+ assert42(!this.completed);
3745
3745
  if (this.error) {
3746
3746
  abort(this.error);
3747
3747
  } else {
@@ -3753,8 +3753,8 @@ var require_request = __commonJS({
3753
3753
  return this[kHandler].onResponseStarted?.();
3754
3754
  }
3755
3755
  onHeaders(statusCode, headers, resume, statusText) {
3756
- assert41(!this.aborted);
3757
- assert41(!this.completed);
3756
+ assert42(!this.aborted);
3757
+ assert42(!this.completed);
3758
3758
  if (channels.headers.hasSubscribers) {
3759
3759
  channels.headers.publish({ request: this, response: { statusCode, headers, statusText } });
3760
3760
  }
@@ -3765,8 +3765,8 @@ var require_request = __commonJS({
3765
3765
  }
3766
3766
  }
3767
3767
  onData(chunk) {
3768
- assert41(!this.aborted);
3769
- assert41(!this.completed);
3768
+ assert42(!this.aborted);
3769
+ assert42(!this.completed);
3770
3770
  if (channels.bodyChunkReceived.hasSubscribers) {
3771
3771
  channels.bodyChunkReceived.publish({ request: this, chunk });
3772
3772
  }
@@ -3778,14 +3778,14 @@ var require_request = __commonJS({
3778
3778
  }
3779
3779
  }
3780
3780
  onUpgrade(statusCode, headers, socket) {
3781
- assert41(!this.aborted);
3782
- assert41(!this.completed);
3781
+ assert42(!this.aborted);
3782
+ assert42(!this.completed);
3783
3783
  return this[kHandler].onUpgrade(statusCode, headers, socket);
3784
3784
  }
3785
3785
  onComplete(trailers) {
3786
3786
  this.onFinally();
3787
- assert41(!this.aborted);
3788
- assert41(!this.completed);
3787
+ assert42(!this.aborted);
3788
+ assert42(!this.completed);
3789
3789
  this.completed = true;
3790
3790
  if (channels.trailers.hasSubscribers) {
3791
3791
  channels.trailers.publish({ request: this, trailers });
@@ -4255,7 +4255,7 @@ var require_connect = __commonJS({
4255
4255
  "use strict";
4256
4256
  init_import_meta_url();
4257
4257
  var net2 = require("net");
4258
- var assert41 = require("assert");
4258
+ var assert42 = require("assert");
4259
4259
  var util5 = require_util();
4260
4260
  var { InvalidArgumentError } = require_errors();
4261
4261
  var tls;
@@ -4304,7 +4304,7 @@ var require_connect = __commonJS({
4304
4304
  }
4305
4305
  servername = servername || options.servername || util5.getServerName(host) || null;
4306
4306
  const sessionKey = servername || hostname2;
4307
- assert41(sessionKey);
4307
+ assert42(sessionKey);
4308
4308
  const session = customSession || sessionCache.get(sessionKey) || null;
4309
4309
  port = port || 443;
4310
4310
  socket = tls.connect({
@@ -4324,7 +4324,7 @@ var require_connect = __commonJS({
4324
4324
  sessionCache.set(sessionKey, session2);
4325
4325
  });
4326
4326
  } else {
4327
- assert41(!httpSocket, "httpSocket can only be sent on TLS update");
4327
+ assert42(!httpSocket, "httpSocket can only be sent on TLS update");
4328
4328
  port = port || 80;
4329
4329
  socket = net2.connect({
4330
4330
  highWaterMark: 64 * 1024,
@@ -5274,14 +5274,14 @@ var require_data_url = __commonJS({
5274
5274
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/web/fetch/data-url.js"(exports2, module3) {
5275
5275
  "use strict";
5276
5276
  init_import_meta_url();
5277
- var assert41 = require("assert");
5277
+ var assert42 = require("assert");
5278
5278
  var encoder = new TextEncoder();
5279
5279
  var HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+\-.^_|~A-Za-z0-9]+$/;
5280
5280
  var HTTP_WHITESPACE_REGEX = /[\u000A\u000D\u0009\u0020]/;
5281
5281
  var ASCII_WHITESPACE_REPLACE_REGEX = /[\u0009\u000A\u000C\u000D\u0020]/g;
5282
5282
  var HTTP_QUOTED_STRING_TOKENS = /^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;
5283
5283
  function dataURLProcessor(dataURL) {
5284
- assert41(dataURL.protocol === "data:");
5284
+ assert42(dataURL.protocol === "data:");
5285
5285
  let input = URLSerializer(dataURL, true);
5286
5286
  input = input.slice(5);
5287
5287
  const position = { position: 0 };
@@ -5492,7 +5492,7 @@ var require_data_url = __commonJS({
5492
5492
  function collectAnHTTPQuotedString(input, position, extractValue = false) {
5493
5493
  const positionStart = position.position;
5494
5494
  let value = "";
5495
- assert41(input[position.position] === '"');
5495
+ assert42(input[position.position] === '"');
5496
5496
  position.position++;
5497
5497
  while (true) {
5498
5498
  value += collectASequenceOfCodePoints(
@@ -5513,7 +5513,7 @@ var require_data_url = __commonJS({
5513
5513
  value += input[position.position];
5514
5514
  position.position++;
5515
5515
  } else {
5516
- assert41(quoteOrBackslash === '"');
5516
+ assert42(quoteOrBackslash === '"');
5517
5517
  break;
5518
5518
  }
5519
5519
  }
@@ -5524,7 +5524,7 @@ var require_data_url = __commonJS({
5524
5524
  }
5525
5525
  __name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");
5526
5526
  function serializeAMimeType(mimeType) {
5527
- assert41(mimeType !== "failure");
5527
+ assert42(mimeType !== "failure");
5528
5528
  const { parameters, essence } = mimeType;
5529
5529
  let serialization = essence;
5530
5530
  for (let [name2, value] of parameters.entries()) {
@@ -6128,7 +6128,7 @@ var require_util2 = __commonJS({
6128
6128
  var { collectASequenceOfCodePoints, collectAnHTTPQuotedString, removeChars, parseMIMEType } = require_data_url();
6129
6129
  var { performance: performance2 } = require("perf_hooks");
6130
6130
  var { ReadableStreamFrom, isValidHTTPToken, normalizedMethodRecordsBase } = require_util();
6131
- var assert41 = require("assert");
6131
+ var assert42 = require("assert");
6132
6132
  var { isUint8Array } = require("util/types");
6133
6133
  var { webidl } = require_webidl();
6134
6134
  var supportedHashes = [];
@@ -6339,7 +6339,7 @@ var require_util2 = __commonJS({
6339
6339
  __name(clonePolicyContainer, "clonePolicyContainer");
6340
6340
  function determineRequestsReferrer(request4) {
6341
6341
  const policy = request4.referrerPolicy;
6342
- assert41(policy);
6342
+ assert42(policy);
6343
6343
  let referrerSource = null;
6344
6344
  if (request4.referrer === "client") {
6345
6345
  const globalOrigin = getGlobalOrigin();
@@ -6403,7 +6403,7 @@ var require_util2 = __commonJS({
6403
6403
  }
6404
6404
  __name(determineRequestsReferrer, "determineRequestsReferrer");
6405
6405
  function stripURLForReferrer(url4, originOnly = false) {
6406
- assert41(webidl.is.URL(url4));
6406
+ assert42(webidl.is.URL(url4));
6407
6407
  url4 = new URL(url4);
6408
6408
  if (urlIsLocal(url4)) {
6409
6409
  return "no-referrer";
@@ -6605,7 +6605,7 @@ var require_util2 = __commonJS({
6605
6605
  if (result === void 0) {
6606
6606
  throw new TypeError("Value is not JSON serializable");
6607
6607
  }
6608
- assert41(typeof result === "string");
6608
+ assert42(typeof result === "string");
6609
6609
  return result;
6610
6610
  }
6611
6611
  __name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");
@@ -6767,7 +6767,7 @@ var require_util2 = __commonJS({
6767
6767
  __name(readableStreamClose, "readableStreamClose");
6768
6768
  var invalidIsomorphicEncodeValueRegex = /[^\x00-\xFF]/;
6769
6769
  function isomorphicEncode(input) {
6770
- assert41(!invalidIsomorphicEncodeValueRegex.test(input));
6770
+ assert42(!invalidIsomorphicEncodeValueRegex.test(input));
6771
6771
  return input;
6772
6772
  }
6773
6773
  __name(isomorphicEncode, "isomorphicEncode");
@@ -6794,7 +6794,7 @@ var require_util2 = __commonJS({
6794
6794
  }
6795
6795
  __name(readAllBytes, "readAllBytes");
6796
6796
  function urlIsLocal(url4) {
6797
- assert41("protocol" in url4);
6797
+ assert42("protocol" in url4);
6798
6798
  const protocol = url4.protocol;
6799
6799
  return protocol === "about:" || protocol === "blob:" || protocol === "data:";
6800
6800
  }
@@ -6804,7 +6804,7 @@ var require_util2 = __commonJS({
6804
6804
  }
6805
6805
  __name(urlHasHttpsScheme, "urlHasHttpsScheme");
6806
6806
  function urlIsHttpHttpsScheme(url4) {
6807
- assert41("protocol" in url4);
6807
+ assert42("protocol" in url4);
6808
6808
  const protocol = url4.protocol;
6809
6809
  return protocol === "http:" || protocol === "https:";
6810
6810
  }
@@ -6977,7 +6977,7 @@ var require_util2 = __commonJS({
6977
6977
  continue;
6978
6978
  }
6979
6979
  } else {
6980
- assert41(input.charCodeAt(position.position) === 44);
6980
+ assert42(input.charCodeAt(position.position) === 44);
6981
6981
  position.position++;
6982
6982
  }
6983
6983
  }
@@ -7261,7 +7261,7 @@ var require_formdata_parser = __commonJS({
7261
7261
  var { HTTP_TOKEN_CODEPOINTS, isomorphicDecode } = require_data_url();
7262
7262
  var { makeEntry } = require_formdata();
7263
7263
  var { webidl } = require_webidl();
7264
- var assert41 = require("assert");
7264
+ var assert42 = require("assert");
7265
7265
  var { File: NodeFile } = require("buffer");
7266
7266
  var File2 = globalThis.File ?? NodeFile;
7267
7267
  var formDataNameBuffer = Buffer.from('form-data; name="');
@@ -7292,7 +7292,7 @@ var require_formdata_parser = __commonJS({
7292
7292
  }
7293
7293
  __name(validateBoundary, "validateBoundary");
7294
7294
  function multipartFormDataParser(input, mimeType) {
7295
- assert41(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
7295
+ assert42(mimeType !== "failure" && mimeType.essence === "multipart/form-data");
7296
7296
  const boundaryString = mimeType.parameters.get("boundary");
7297
7297
  if (boundaryString === void 0) {
7298
7298
  throw parsingError("missing boundary in content-type header");
@@ -7353,8 +7353,8 @@ var require_formdata_parser = __commonJS({
7353
7353
  } else {
7354
7354
  value = utf8DecodeBytes(Buffer.from(body));
7355
7355
  }
7356
- assert41(webidl.is.USVString(name2));
7357
- assert41(typeof value === "string" && webidl.is.USVString(value) || webidl.is.File(value));
7356
+ assert42(webidl.is.USVString(name2));
7357
+ assert42(typeof value === "string" && webidl.is.USVString(value) || webidl.is.File(value));
7358
7358
  entryList.push(makeEntry(name2, value, filename));
7359
7359
  }
7360
7360
  }
@@ -7473,7 +7473,7 @@ var require_formdata_parser = __commonJS({
7473
7473
  }
7474
7474
  __name(parseMultipartFormDataHeaders, "parseMultipartFormDataHeaders");
7475
7475
  function parseMultipartFormDataName(input, position) {
7476
- assert41(input[position.position - 1] === 34);
7476
+ assert42(input[position.position - 1] === 34);
7477
7477
  let name2 = collectASequenceOfBytes(
7478
7478
  (char) => char !== 10 && char !== 13 && char !== 34,
7479
7479
  input,
@@ -7548,7 +7548,7 @@ var require_body = __commonJS({
7548
7548
  var { FormData: FormData11, setFormDataState } = require_formdata();
7549
7549
  var { webidl } = require_webidl();
7550
7550
  var { Blob: Blob6 } = require("buffer");
7551
- var assert41 = require("assert");
7551
+ var assert42 = require("assert");
7552
7552
  var { isErrored, isDisturbed } = require("stream");
7553
7553
  var { isArrayBuffer: isArrayBuffer3 } = require("util/types");
7554
7554
  var { serializeAMimeType } = require_data_url();
@@ -7594,7 +7594,7 @@ var require_body = __commonJS({
7594
7594
  type: "bytes"
7595
7595
  });
7596
7596
  }
7597
- assert41(webidl.is.ReadableStream(stream2));
7597
+ assert42(webidl.is.ReadableStream(stream2));
7598
7598
  let action = null;
7599
7599
  let source = null;
7600
7600
  let length = null;
@@ -7713,8 +7713,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
7713
7713
  __name(extractBody, "extractBody");
7714
7714
  function safelyExtractBody(object, keepalive = false) {
7715
7715
  if (webidl.is.ReadableStream(object)) {
7716
- assert41(!util5.isDisturbed(object), "The body has already been consumed.");
7717
- assert41(!object.locked, "The stream is locked.");
7716
+ assert42(!util5.isDisturbed(object), "The body has already been consumed.");
7717
+ assert42(!object.locked, "The stream is locked.");
7718
7718
  }
7719
7719
  return extractBody(object, keepalive);
7720
7720
  }
@@ -7860,7 +7860,7 @@ var require_client_h1 = __commonJS({
7860
7860
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/dispatcher/client-h1.js"(exports2, module3) {
7861
7861
  "use strict";
7862
7862
  init_import_meta_url();
7863
- var assert41 = require("assert");
7863
+ var assert42 = require("assert");
7864
7864
  var util5 = require_util();
7865
7865
  var { channels } = require_diagnostics();
7866
7866
  var timers = require_timers();
@@ -7941,7 +7941,7 @@ var require_client_h1 = __commonJS({
7941
7941
  * @returns {number}
7942
7942
  */
7943
7943
  wasm_on_status: /* @__PURE__ */ __name((p6, at2, len) => {
7944
- assert41(currentParser.ptr === p6);
7944
+ assert42(currentParser.ptr === p6);
7945
7945
  const start = at2 - currentBufferPtr + currentBufferRef.byteOffset;
7946
7946
  return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len));
7947
7947
  }, "wasm_on_status"),
@@ -7950,7 +7950,7 @@ var require_client_h1 = __commonJS({
7950
7950
  * @returns {number}
7951
7951
  */
7952
7952
  wasm_on_message_begin: /* @__PURE__ */ __name((p6) => {
7953
- assert41(currentParser.ptr === p6);
7953
+ assert42(currentParser.ptr === p6);
7954
7954
  return currentParser.onMessageBegin();
7955
7955
  }, "wasm_on_message_begin"),
7956
7956
  /**
@@ -7960,7 +7960,7 @@ var require_client_h1 = __commonJS({
7960
7960
  * @returns {number}
7961
7961
  */
7962
7962
  wasm_on_header_field: /* @__PURE__ */ __name((p6, at2, len) => {
7963
- assert41(currentParser.ptr === p6);
7963
+ assert42(currentParser.ptr === p6);
7964
7964
  const start = at2 - currentBufferPtr + currentBufferRef.byteOffset;
7965
7965
  return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len));
7966
7966
  }, "wasm_on_header_field"),
@@ -7971,7 +7971,7 @@ var require_client_h1 = __commonJS({
7971
7971
  * @returns {number}
7972
7972
  */
7973
7973
  wasm_on_header_value: /* @__PURE__ */ __name((p6, at2, len) => {
7974
- assert41(currentParser.ptr === p6);
7974
+ assert42(currentParser.ptr === p6);
7975
7975
  const start = at2 - currentBufferPtr + currentBufferRef.byteOffset;
7976
7976
  return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len));
7977
7977
  }, "wasm_on_header_value"),
@@ -7983,7 +7983,7 @@ var require_client_h1 = __commonJS({
7983
7983
  * @returns {number}
7984
7984
  */
7985
7985
  wasm_on_headers_complete: /* @__PURE__ */ __name((p6, statusCode, upgrade, shouldKeepAlive) => {
7986
- assert41(currentParser.ptr === p6);
7986
+ assert42(currentParser.ptr === p6);
7987
7987
  return currentParser.onHeadersComplete(statusCode, upgrade === 1, shouldKeepAlive === 1);
7988
7988
  }, "wasm_on_headers_complete"),
7989
7989
  /**
@@ -7993,7 +7993,7 @@ var require_client_h1 = __commonJS({
7993
7993
  * @returns {number}
7994
7994
  */
7995
7995
  wasm_on_body: /* @__PURE__ */ __name((p6, at2, len) => {
7996
- assert41(currentParser.ptr === p6);
7996
+ assert42(currentParser.ptr === p6);
7997
7997
  const start = at2 - currentBufferPtr + currentBufferRef.byteOffset;
7998
7998
  return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len));
7999
7999
  }, "wasm_on_body"),
@@ -8002,7 +8002,7 @@ var require_client_h1 = __commonJS({
8002
8002
  * @returns {number}
8003
8003
  */
8004
8004
  wasm_on_message_complete: /* @__PURE__ */ __name((p6) => {
8005
- assert41(currentParser.ptr === p6);
8005
+ assert42(currentParser.ptr === p6);
8006
8006
  return currentParser.onMessageComplete();
8007
8007
  }, "wasm_on_message_complete")
8008
8008
  }
@@ -8079,10 +8079,10 @@ var require_client_h1 = __commonJS({
8079
8079
  if (this.socket.destroyed || !this.paused) {
8080
8080
  return;
8081
8081
  }
8082
- assert41(this.ptr != null);
8083
- assert41(currentParser === null);
8082
+ assert42(this.ptr != null);
8083
+ assert42(currentParser === null);
8084
8084
  this.llhttp.llhttp_resume(this.ptr);
8085
- assert41(this.timeoutType === TIMEOUT_BODY);
8085
+ assert42(this.timeoutType === TIMEOUT_BODY);
8086
8086
  if (this.timeout) {
8087
8087
  if (this.timeout.refresh) {
8088
8088
  this.timeout.refresh();
@@ -8105,9 +8105,9 @@ var require_client_h1 = __commonJS({
8105
8105
  * @param {Buffer} chunk
8106
8106
  */
8107
8107
  execute(chunk) {
8108
- assert41(currentParser === null);
8109
- assert41(this.ptr != null);
8110
- assert41(!this.paused);
8108
+ assert42(currentParser === null);
8109
+ assert42(this.ptr != null);
8110
+ assert42(!this.paused);
8111
8111
  const { socket, llhttp } = this;
8112
8112
  if (chunk.length > currentBufferSize) {
8113
8113
  if (currentBufferPtr) {
@@ -8151,8 +8151,8 @@ var require_client_h1 = __commonJS({
8151
8151
  }
8152
8152
  }
8153
8153
  destroy() {
8154
- assert41(currentParser === null);
8155
- assert41(this.ptr != null);
8154
+ assert42(currentParser === null);
8155
+ assert42(this.ptr != null);
8156
8156
  this.llhttp.llhttp_free(this.ptr);
8157
8157
  this.ptr = null;
8158
8158
  this.timeout && timers.clearTimeout(this.timeout);
@@ -8238,14 +8238,14 @@ var require_client_h1 = __commonJS({
8238
8238
  */
8239
8239
  onUpgrade(head) {
8240
8240
  const { upgrade, client, socket, headers, statusCode } = this;
8241
- assert41(upgrade);
8242
- assert41(client[kSocket] === socket);
8243
- assert41(!socket.destroyed);
8244
- assert41(!this.paused);
8245
- assert41((headers.length & 1) === 0);
8241
+ assert42(upgrade);
8242
+ assert42(client[kSocket] === socket);
8243
+ assert42(!socket.destroyed);
8244
+ assert42(!this.paused);
8245
+ assert42((headers.length & 1) === 0);
8246
8246
  const request4 = client[kQueue][client[kRunningIdx]];
8247
- assert41(request4);
8248
- assert41(request4.upgrade || request4.method === "CONNECT");
8247
+ assert42(request4);
8248
+ assert42(request4.upgrade || request4.method === "CONNECT");
8249
8249
  this.statusCode = 0;
8250
8250
  this.statusText = "";
8251
8251
  this.shouldKeepAlive = false;
@@ -8283,8 +8283,8 @@ var require_client_h1 = __commonJS({
8283
8283
  if (!request4) {
8284
8284
  return -1;
8285
8285
  }
8286
- assert41(!this.upgrade);
8287
- assert41(this.statusCode < 200);
8286
+ assert42(!this.upgrade);
8287
+ assert42(this.statusCode < 200);
8288
8288
  if (statusCode === 100) {
8289
8289
  util5.destroy(socket, new SocketError("bad response", util5.getSocketInfo(socket)));
8290
8290
  return -1;
@@ -8293,7 +8293,7 @@ var require_client_h1 = __commonJS({
8293
8293
  util5.destroy(socket, new SocketError("bad upgrade", util5.getSocketInfo(socket)));
8294
8294
  return -1;
8295
8295
  }
8296
- assert41(this.timeoutType === TIMEOUT_HEADERS);
8296
+ assert42(this.timeoutType === TIMEOUT_HEADERS);
8297
8297
  this.statusCode = statusCode;
8298
8298
  this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.
8299
8299
  request4.method === "HEAD" && !socket[kReset2] && this.connection.toLowerCase() === "keep-alive";
@@ -8306,16 +8306,16 @@ var require_client_h1 = __commonJS({
8306
8306
  }
8307
8307
  }
8308
8308
  if (request4.method === "CONNECT") {
8309
- assert41(client[kRunning] === 1);
8309
+ assert42(client[kRunning] === 1);
8310
8310
  this.upgrade = true;
8311
8311
  return 2;
8312
8312
  }
8313
8313
  if (upgrade) {
8314
- assert41(client[kRunning] === 1);
8314
+ assert42(client[kRunning] === 1);
8315
8315
  this.upgrade = true;
8316
8316
  return 2;
8317
8317
  }
8318
- assert41((this.headers.length & 1) === 0);
8318
+ assert42((this.headers.length & 1) === 0);
8319
8319
  this.headers = [];
8320
8320
  this.headersSize = 0;
8321
8321
  if (this.shouldKeepAlive && client[kPipelining]) {
@@ -8362,14 +8362,14 @@ var require_client_h1 = __commonJS({
8362
8362
  return -1;
8363
8363
  }
8364
8364
  const request4 = client[kQueue][client[kRunningIdx]];
8365
- assert41(request4);
8366
- assert41(this.timeoutType === TIMEOUT_BODY);
8365
+ assert42(request4);
8366
+ assert42(this.timeoutType === TIMEOUT_BODY);
8367
8367
  if (this.timeout) {
8368
8368
  if (this.timeout.refresh) {
8369
8369
  this.timeout.refresh();
8370
8370
  }
8371
8371
  }
8372
- assert41(statusCode >= 200);
8372
+ assert42(statusCode >= 200);
8373
8373
  if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
8374
8374
  util5.destroy(socket, new ResponseExceededMaxSizeError());
8375
8375
  return -1;
@@ -8391,10 +8391,10 @@ var require_client_h1 = __commonJS({
8391
8391
  if (upgrade) {
8392
8392
  return 0;
8393
8393
  }
8394
- assert41(statusCode >= 100);
8395
- assert41((this.headers.length & 1) === 0);
8394
+ assert42(statusCode >= 100);
8395
+ assert42((this.headers.length & 1) === 0);
8396
8396
  const request4 = client[kQueue][client[kRunningIdx]];
8397
- assert41(request4);
8397
+ assert42(request4);
8398
8398
  this.statusCode = 0;
8399
8399
  this.statusText = "";
8400
8400
  this.bytesRead = 0;
@@ -8413,7 +8413,7 @@ var require_client_h1 = __commonJS({
8413
8413
  request4.onComplete(headers);
8414
8414
  client[kQueue][client[kRunningIdx]++] = null;
8415
8415
  if (socket[kWriting]) {
8416
- assert41(client[kRunning] === 0);
8416
+ assert42(client[kRunning] === 0);
8417
8417
  util5.destroy(socket, new InformationalError("reset"));
8418
8418
  return constants4.ERROR.PAUSED;
8419
8419
  } else if (!shouldKeepAlive) {
@@ -8434,7 +8434,7 @@ var require_client_h1 = __commonJS({
8434
8434
  const { socket, timeoutType, client, paused } = parser2.deref();
8435
8435
  if (timeoutType === TIMEOUT_HEADERS) {
8436
8436
  if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
8437
- assert41(!paused, "cannot be paused while waiting for headers");
8437
+ assert42(!paused, "cannot be paused while waiting for headers");
8438
8438
  util5.destroy(socket, new HeadersTimeoutError());
8439
8439
  }
8440
8440
  } else if (timeoutType === TIMEOUT_BODY) {
@@ -8442,7 +8442,7 @@ var require_client_h1 = __commonJS({
8442
8442
  util5.destroy(socket, new BodyTimeoutError());
8443
8443
  }
8444
8444
  } else if (timeoutType === TIMEOUT_KEEP_ALIVE) {
8445
- assert41(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
8445
+ assert42(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
8446
8446
  util5.destroy(socket, new InformationalError("socket idle timeout"));
8447
8447
  }
8448
8448
  }
@@ -8526,7 +8526,7 @@ var require_client_h1 = __commonJS({
8526
8526
  }
8527
8527
  __name(connectH1, "connectH1");
8528
8528
  function onHttpSocketError(err) {
8529
- assert41(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
8529
+ assert42(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
8530
8530
  const parser2 = this[kParser];
8531
8531
  if (err.code === "ECONNRESET" && parser2.statusCode && !parser2.shouldKeepAlive) {
8532
8532
  parser2.onMessageComplete();
@@ -8563,7 +8563,7 @@ var require_client_h1 = __commonJS({
8563
8563
  client[kSocket] = null;
8564
8564
  client[kHTTPContext] = null;
8565
8565
  if (client.destroyed) {
8566
- assert41(client[kPending] === 0);
8566
+ assert42(client[kPending] === 0);
8567
8567
  const requests = client[kQueue].splice(client[kRunningIdx]);
8568
8568
  for (let i5 = 0; i5 < requests.length; i5++) {
8569
8569
  const request4 = requests[i5];
@@ -8575,7 +8575,7 @@ var require_client_h1 = __commonJS({
8575
8575
  util5.errorRequest(client, request4, err);
8576
8576
  }
8577
8577
  client[kPendingIdx] = client[kRunningIdx];
8578
- assert41(client[kRunning] === 0);
8578
+ assert42(client[kRunning] === 0);
8579
8579
  client.emit("disconnect", client[kUrl], [client], err);
8580
8580
  client[kResume]();
8581
8581
  }
@@ -8731,13 +8731,13 @@ upgrade: ${upgrade}\r
8731
8731
  } else if (util5.isIterable(body)) {
8732
8732
  writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload);
8733
8733
  } else {
8734
- assert41(false);
8734
+ assert42(false);
8735
8735
  }
8736
8736
  return true;
8737
8737
  }
8738
8738
  __name(writeH1, "writeH1");
8739
8739
  function writeStream(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
8740
- assert41(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
8740
+ assert42(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
8741
8741
  let finished = false;
8742
8742
  const writer = new AsyncWriter({ abort, socket, request: request4, contentLength, client, expectsPayload, header });
8743
8743
  const onData = /* @__PURE__ */ __name(function(chunk) {
@@ -8774,7 +8774,7 @@ upgrade: ${upgrade}\r
8774
8774
  return;
8775
8775
  }
8776
8776
  finished = true;
8777
- assert41(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
8777
+ assert42(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);
8778
8778
  socket.off("drain", onDrain).off("error", onFinished);
8779
8779
  body.removeListener("data", onData).removeListener("end", onFinished).removeListener("close", onClose);
8780
8780
  if (!err) {
@@ -8814,12 +8814,12 @@ upgrade: ${upgrade}\r
8814
8814
  \r
8815
8815
  `, "latin1");
8816
8816
  } else {
8817
- assert41(contentLength === null, "no body must not have content length");
8817
+ assert42(contentLength === null, "no body must not have content length");
8818
8818
  socket.write(`${header}\r
8819
8819
  `, "latin1");
8820
8820
  }
8821
8821
  } else if (util5.isBuffer(body)) {
8822
- assert41(contentLength === body.byteLength, "buffer body must have content length");
8822
+ assert42(contentLength === body.byteLength, "buffer body must have content length");
8823
8823
  socket.cork();
8824
8824
  socket.write(`${header}content-length: ${contentLength}\r
8825
8825
  \r
@@ -8839,7 +8839,7 @@ upgrade: ${upgrade}\r
8839
8839
  }
8840
8840
  __name(writeBuffer, "writeBuffer");
8841
8841
  async function writeBlob(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
8842
- assert41(contentLength === body.size, "blob body must have content length");
8842
+ assert42(contentLength === body.size, "blob body must have content length");
8843
8843
  try {
8844
8844
  if (contentLength != null && contentLength !== body.size) {
8845
8845
  throw new RequestContentLengthMismatchError();
@@ -8863,7 +8863,7 @@ upgrade: ${upgrade}\r
8863
8863
  }
8864
8864
  __name(writeBlob, "writeBlob");
8865
8865
  async function writeIterable(abort, body, client, request4, socket, contentLength, header, expectsPayload) {
8866
- assert41(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
8866
+ assert42(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
8867
8867
  let callback = null;
8868
8868
  function onDrain() {
8869
8869
  if (callback) {
@@ -8874,7 +8874,7 @@ upgrade: ${upgrade}\r
8874
8874
  }
8875
8875
  __name(onDrain, "onDrain");
8876
8876
  const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve24, reject) => {
8877
- assert41(callback === null);
8877
+ assert42(callback === null);
8878
8878
  if (socket[kError]) {
8879
8879
  reject(socket[kError]);
8880
8880
  } else {
@@ -9027,7 +9027,7 @@ ${len.toString(16)}\r
9027
9027
  const { socket, client, abort } = this;
9028
9028
  socket[kWriting] = false;
9029
9029
  if (err) {
9030
- assert41(client[kRunning] <= 1, "pipeline should only contain this request");
9030
+ assert42(client[kRunning] <= 1, "pipeline should only contain this request");
9031
9031
  abort(err);
9032
9032
  }
9033
9033
  }
@@ -9041,7 +9041,7 @@ var require_client_h2 = __commonJS({
9041
9041
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/dispatcher/client-h2.js"(exports2, module3) {
9042
9042
  "use strict";
9043
9043
  init_import_meta_url();
9044
- var assert41 = require("assert");
9044
+ var assert42 = require("assert");
9045
9045
  var { pipeline } = require("stream");
9046
9046
  var util5 = require_util();
9047
9047
  var {
@@ -9171,7 +9171,7 @@ var require_client_h2 = __commonJS({
9171
9171
  }
9172
9172
  __name(resumeH2, "resumeH2");
9173
9173
  function onHttp2SessionError(err) {
9174
- assert41(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
9174
+ assert42(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
9175
9175
  this[kSocket][kError] = err;
9176
9176
  this[kClient][kOnError](err);
9177
9177
  }
@@ -9204,7 +9204,7 @@ var require_client_h2 = __commonJS({
9204
9204
  util5.errorRequest(client, request4, err);
9205
9205
  client[kPendingIdx] = client[kRunningIdx];
9206
9206
  }
9207
- assert41(client[kRunning] === 0);
9207
+ assert42(client[kRunning] === 0);
9208
9208
  client.emit("disconnect", client[kUrl], [client], err);
9209
9209
  client.emit("connectionError", client[kUrl], [client], err);
9210
9210
  client[kResume]();
@@ -9217,7 +9217,7 @@ var require_client_h2 = __commonJS({
9217
9217
  client[kSocket] = null;
9218
9218
  client[kHTTPContext] = null;
9219
9219
  if (client.destroyed) {
9220
- assert41(client[kPending] === 0);
9220
+ assert42(client[kPending] === 0);
9221
9221
  const requests = client[kQueue].splice(client[kRunningIdx]);
9222
9222
  for (let i5 = 0; i5 < requests.length; i5++) {
9223
9223
  const request4 = requests[i5];
@@ -9235,13 +9235,13 @@ var require_client_h2 = __commonJS({
9235
9235
  this[kHTTP2Session].destroy(err);
9236
9236
  }
9237
9237
  client[kPendingIdx] = client[kRunningIdx];
9238
- assert41(client[kRunning] === 0);
9238
+ assert42(client[kRunning] === 0);
9239
9239
  client.emit("disconnect", client[kUrl], [client], err);
9240
9240
  client[kResume]();
9241
9241
  }
9242
9242
  __name(onHttp2SocketClose, "onHttp2SocketClose");
9243
9243
  function onHttp2SocketError(err) {
9244
- assert41(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
9244
+ assert42(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");
9245
9245
  this[kError] = err;
9246
9246
  this[kClient][kOnError](err);
9247
9247
  }
@@ -9360,7 +9360,7 @@ var require_client_h2 = __commonJS({
9360
9360
  process.emitWarning(new RequestContentLengthMismatchError());
9361
9361
  }
9362
9362
  if (contentLength != null) {
9363
- assert41(body, "no body must not have content length");
9363
+ assert42(body, "no body must not have content length");
9364
9364
  headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`;
9365
9365
  }
9366
9366
  session.ref();
@@ -9525,7 +9525,7 @@ var require_client_h2 = __commonJS({
9525
9525
  expectsPayload
9526
9526
  );
9527
9527
  } else {
9528
- assert41(false);
9528
+ assert42(false);
9529
9529
  }
9530
9530
  }
9531
9531
  __name(writeBodyH2, "writeBodyH2");
@@ -9534,7 +9534,7 @@ var require_client_h2 = __commonJS({
9534
9534
  function writeBuffer(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
9535
9535
  try {
9536
9536
  if (body != null && util5.isBuffer(body)) {
9537
- assert41(contentLength === body.byteLength, "buffer body must have content length");
9537
+ assert42(contentLength === body.byteLength, "buffer body must have content length");
9538
9538
  h2stream.cork();
9539
9539
  h2stream.write(body);
9540
9540
  h2stream.uncork();
@@ -9552,7 +9552,7 @@ var require_client_h2 = __commonJS({
9552
9552
  }
9553
9553
  __name(writeBuffer, "writeBuffer");
9554
9554
  function writeStream(abort, socket, expectsPayload, h2stream, body, client, request4, contentLength) {
9555
- assert41(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
9555
+ assert42(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");
9556
9556
  const pipe = pipeline(
9557
9557
  body,
9558
9558
  h2stream,
@@ -9578,7 +9578,7 @@ var require_client_h2 = __commonJS({
9578
9578
  }
9579
9579
  __name(writeStream, "writeStream");
9580
9580
  async function writeBlob(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
9581
- assert41(contentLength === body.size, "blob body must have content length");
9581
+ assert42(contentLength === body.size, "blob body must have content length");
9582
9582
  try {
9583
9583
  if (contentLength != null && contentLength !== body.size) {
9584
9584
  throw new RequestContentLengthMismatchError();
@@ -9600,7 +9600,7 @@ var require_client_h2 = __commonJS({
9600
9600
  }
9601
9601
  __name(writeBlob, "writeBlob");
9602
9602
  async function writeIterable(abort, h2stream, body, client, request4, socket, contentLength, expectsPayload) {
9603
- assert41(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
9603
+ assert42(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");
9604
9604
  let callback = null;
9605
9605
  function onDrain() {
9606
9606
  if (callback) {
@@ -9611,7 +9611,7 @@ var require_client_h2 = __commonJS({
9611
9611
  }
9612
9612
  __name(onDrain, "onDrain");
9613
9613
  const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve24, reject) => {
9614
- assert41(callback === null);
9614
+ assert42(callback === null);
9615
9615
  if (socket[kError]) {
9616
9616
  reject(socket[kError]);
9617
9617
  } else {
@@ -9652,7 +9652,7 @@ var require_client = __commonJS({
9652
9652
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/dispatcher/client.js"(exports2, module3) {
9653
9653
  "use strict";
9654
9654
  init_import_meta_url();
9655
- var assert41 = require("assert");
9655
+ var assert42 = require("assert");
9656
9656
  var net2 = require("net");
9657
9657
  var http5 = require("http");
9658
9658
  var util5 = require_util();
@@ -9942,25 +9942,25 @@ var require_client = __commonJS({
9942
9942
  };
9943
9943
  function onError(client, err) {
9944
9944
  if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
9945
- assert41(client[kPendingIdx] === client[kRunningIdx]);
9945
+ assert42(client[kPendingIdx] === client[kRunningIdx]);
9946
9946
  const requests = client[kQueue].splice(client[kRunningIdx]);
9947
9947
  for (let i5 = 0; i5 < requests.length; i5++) {
9948
9948
  const request4 = requests[i5];
9949
9949
  util5.errorRequest(client, request4, err);
9950
9950
  }
9951
- assert41(client[kSize] === 0);
9951
+ assert42(client[kSize] === 0);
9952
9952
  }
9953
9953
  }
9954
9954
  __name(onError, "onError");
9955
9955
  async function connect(client) {
9956
- assert41(!client[kConnecting]);
9957
- assert41(!client[kHTTPContext]);
9956
+ assert42(!client[kConnecting]);
9957
+ assert42(!client[kHTTPContext]);
9958
9958
  let { host, hostname: hostname2, protocol, port } = client[kUrl];
9959
9959
  if (hostname2[0] === "[") {
9960
9960
  const idx = hostname2.indexOf("]");
9961
- assert41(idx !== -1);
9961
+ assert42(idx !== -1);
9962
9962
  const ip = hostname2.substring(1, idx);
9963
- assert41(net2.isIPv6(ip));
9963
+ assert42(net2.isIPv6(ip));
9964
9964
  hostname2 = ip;
9965
9965
  }
9966
9966
  client[kConnecting] = true;
@@ -9999,7 +9999,7 @@ var require_client = __commonJS({
9999
9999
  util5.destroy(socket.on("error", noop), new ClientDestroyedError());
10000
10000
  return;
10001
10001
  }
10002
- assert41(socket);
10002
+ assert42(socket);
10003
10003
  try {
10004
10004
  client[kHTTPContext] = socket.alpnProtocol === "h2" ? await connectH2(client, socket) : await connectH1(client, socket);
10005
10005
  } catch (err) {
@@ -10048,7 +10048,7 @@ var require_client = __commonJS({
10048
10048
  });
10049
10049
  }
10050
10050
  if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
10051
- assert41(client[kRunning] === 0);
10051
+ assert42(client[kRunning] === 0);
10052
10052
  while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {
10053
10053
  const request4 = client[kQueue][client[kPendingIdx]++];
10054
10054
  util5.errorRequest(client, request4, err);
@@ -10083,7 +10083,7 @@ var require_client = __commonJS({
10083
10083
  function _resume(client, sync) {
10084
10084
  while (true) {
10085
10085
  if (client.destroyed) {
10086
- assert41(client[kPending] === 0);
10086
+ assert42(client[kPending] === 0);
10087
10087
  return;
10088
10088
  }
10089
10089
  if (client[kClosedResolve] && !client[kSize]) {
@@ -11142,7 +11142,7 @@ var require_retry_handler = __commonJS({
11142
11142
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/handler/retry-handler.js"(exports2, module3) {
11143
11143
  "use strict";
11144
11144
  init_import_meta_url();
11145
- var assert41 = require("assert");
11145
+ var assert42 = require("assert");
11146
11146
  var { kRetryHandlerDefaultRetry } = require_symbols();
11147
11147
  var { RequestRetryError } = require_errors();
11148
11148
  var WrapHandler = require_wrap_handler();
@@ -11330,8 +11330,8 @@ var require_retry_handler = __commonJS({
11330
11330
  });
11331
11331
  }
11332
11332
  const { start, size, end = size ? size - 1 : null } = contentRange;
11333
- assert41(this.start === start, "content-range mismatch");
11334
- assert41(this.end == null || this.end === end, "content-range mismatch");
11333
+ assert42(this.start === start, "content-range mismatch");
11334
+ assert42(this.end == null || this.end === end, "content-range mismatch");
11335
11335
  return;
11336
11336
  }
11337
11337
  if (this.end == null) {
@@ -11348,11 +11348,11 @@ var require_retry_handler = __commonJS({
11348
11348
  return;
11349
11349
  }
11350
11350
  const { start, size, end = size ? size - 1 : null } = range;
11351
- assert41(
11351
+ assert42(
11352
11352
  start != null && Number.isFinite(start),
11353
11353
  "content-range mismatch"
11354
11354
  );
11355
- assert41(end != null && Number.isFinite(end), "invalid content-length");
11355
+ assert42(end != null && Number.isFinite(end), "invalid content-length");
11356
11356
  this.start = start;
11357
11357
  this.end = end;
11358
11358
  }
@@ -11360,8 +11360,8 @@ var require_retry_handler = __commonJS({
11360
11360
  const contentLength = headers["content-length"];
11361
11361
  this.end = contentLength != null ? Number(contentLength) - 1 : null;
11362
11362
  }
11363
- assert41(Number.isFinite(this.start));
11364
- assert41(
11363
+ assert42(Number.isFinite(this.start));
11364
+ assert42(
11365
11365
  this.end == null || Number.isFinite(this.end),
11366
11366
  "invalid content-length"
11367
11367
  );
@@ -11597,7 +11597,7 @@ var require_readable = __commonJS({
11597
11597
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/api/readable.js"(exports2, module3) {
11598
11598
  "use strict";
11599
11599
  init_import_meta_url();
11600
- var assert41 = require("assert");
11600
+ var assert42 = require("assert");
11601
11601
  var { Readable: Readable8 } = require("stream");
11602
11602
  var { RequestAbortedError, NotSupportedError, InvalidArgumentError, AbortError: AbortError2 } = require_errors();
11603
11603
  var util5 = require_util();
@@ -11794,7 +11794,7 @@ var require_readable = __commonJS({
11794
11794
  this[kBody] = ReadableStreamFrom(this);
11795
11795
  if (this[kConsume]) {
11796
11796
  this[kBody].getReader();
11797
- assert41(this[kBody].locked);
11797
+ assert42(this[kBody].locked);
11798
11798
  }
11799
11799
  }
11800
11800
  return this[kBody];
@@ -11863,7 +11863,7 @@ var require_readable = __commonJS({
11863
11863
  }
11864
11864
  __name(isUnusable, "isUnusable");
11865
11865
  function consume(stream2, type) {
11866
- assert41(!stream2[kConsume]);
11866
+ assert42(!stream2[kConsume]);
11867
11867
  return new Promise((resolve24, reject) => {
11868
11868
  if (isUnusable(stream2)) {
11869
11869
  const rState = stream2._readableState;
@@ -12012,7 +12012,7 @@ var require_api_request = __commonJS({
12012
12012
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/api/api-request.js"(exports2, module3) {
12013
12013
  "use strict";
12014
12014
  init_import_meta_url();
12015
- var assert41 = require("assert");
12015
+ var assert42 = require("assert");
12016
12016
  var { AsyncResource } = require("async_hooks");
12017
12017
  var { Readable: Readable8 } = require_readable();
12018
12018
  var { InvalidArgumentError, RequestAbortedError } = require_errors();
@@ -12083,7 +12083,7 @@ var require_api_request = __commonJS({
12083
12083
  abort(this.reason);
12084
12084
  return;
12085
12085
  }
12086
- assert41(this.callback);
12086
+ assert42(this.callback);
12087
12087
  this.abort = abort;
12088
12088
  this.context = context2;
12089
12089
  }
@@ -12243,7 +12243,7 @@ var require_api_stream = __commonJS({
12243
12243
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/api/api-stream.js"(exports2, module3) {
12244
12244
  "use strict";
12245
12245
  init_import_meta_url();
12246
- var assert41 = require("assert");
12246
+ var assert42 = require("assert");
12247
12247
  var { finished } = require("stream");
12248
12248
  var { AsyncResource } = require("async_hooks");
12249
12249
  var { InvalidArgumentError, InvalidReturnValueError } = require_errors();
@@ -12306,7 +12306,7 @@ var require_api_stream = __commonJS({
12306
12306
  abort(this.reason);
12307
12307
  return;
12308
12308
  }
12309
- assert41(this.callback);
12309
+ assert42(this.callback);
12310
12310
  this.abort = abort;
12311
12311
  this.context = context2;
12312
12312
  }
@@ -12415,7 +12415,7 @@ var require_api_pipeline = __commonJS({
12415
12415
  Duplex: Duplex2,
12416
12416
  PassThrough: PassThrough3
12417
12417
  } = require("stream");
12418
- var assert41 = require("assert");
12418
+ var assert42 = require("assert");
12419
12419
  var { AsyncResource } = require("async_hooks");
12420
12420
  var {
12421
12421
  InvalidArgumentError,
@@ -12539,7 +12539,7 @@ var require_api_pipeline = __commonJS({
12539
12539
  abort(this.reason);
12540
12540
  return;
12541
12541
  }
12542
- assert41(!res, "pipeline cannot be retried");
12542
+ assert42(!res, "pipeline cannot be retried");
12543
12543
  this.abort = abort;
12544
12544
  this.context = context2;
12545
12545
  }
@@ -12625,7 +12625,7 @@ var require_api_upgrade = __commonJS({
12625
12625
  init_import_meta_url();
12626
12626
  var { InvalidArgumentError, SocketError } = require_errors();
12627
12627
  var { AsyncResource } = require("async_hooks");
12628
- var assert41 = require("assert");
12628
+ var assert42 = require("assert");
12629
12629
  var util5 = require_util();
12630
12630
  var { addSignal, removeSignal } = require_abort_signal();
12631
12631
  var UpgradeHandler = class extends AsyncResource {
@@ -12656,7 +12656,7 @@ var require_api_upgrade = __commonJS({
12656
12656
  abort(this.reason);
12657
12657
  return;
12658
12658
  }
12659
- assert41(this.callback);
12659
+ assert42(this.callback);
12660
12660
  this.abort = abort;
12661
12661
  this.context = null;
12662
12662
  }
@@ -12664,7 +12664,7 @@ var require_api_upgrade = __commonJS({
12664
12664
  throw new SocketError("bad upgrade", null);
12665
12665
  }
12666
12666
  onUpgrade(statusCode, rawHeaders, socket) {
12667
- assert41(statusCode === 101);
12667
+ assert42(statusCode === 101);
12668
12668
  const { callback, opaque, context: context2 } = this;
12669
12669
  removeSignal(this);
12670
12670
  this.callback = null;
@@ -12721,7 +12721,7 @@ var require_api_connect = __commonJS({
12721
12721
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/api/api-connect.js"(exports2, module3) {
12722
12722
  "use strict";
12723
12723
  init_import_meta_url();
12724
- var assert41 = require("assert");
12724
+ var assert42 = require("assert");
12725
12725
  var { AsyncResource } = require("async_hooks");
12726
12726
  var { InvalidArgumentError, SocketError } = require_errors();
12727
12727
  var util5 = require_util();
@@ -12753,7 +12753,7 @@ var require_api_connect = __commonJS({
12753
12753
  abort(this.reason);
12754
12754
  return;
12755
12755
  }
12756
- assert41(this.callback);
12756
+ assert42(this.callback);
12757
12757
  this.abort = abort;
12758
12758
  this.context = context2;
12759
12759
  }
@@ -14030,7 +14030,7 @@ var require_decorator_handler = __commonJS({
14030
14030
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/handler/decorator-handler.js"(exports2, module3) {
14031
14031
  "use strict";
14032
14032
  init_import_meta_url();
14033
- var assert41 = require("assert");
14033
+ var assert42 = require("assert");
14034
14034
  var WrapHandler = require_wrap_handler();
14035
14035
  module3.exports = class DecoratorHandler {
14036
14036
  static {
@@ -14050,25 +14050,25 @@ var require_decorator_handler = __commonJS({
14050
14050
  this.#handler.onRequestStart?.(...args);
14051
14051
  }
14052
14052
  onRequestUpgrade(...args) {
14053
- assert41(!this.#onCompleteCalled);
14054
- assert41(!this.#onErrorCalled);
14053
+ assert42(!this.#onCompleteCalled);
14054
+ assert42(!this.#onErrorCalled);
14055
14055
  return this.#handler.onRequestUpgrade?.(...args);
14056
14056
  }
14057
14057
  onResponseStart(...args) {
14058
- assert41(!this.#onCompleteCalled);
14059
- assert41(!this.#onErrorCalled);
14060
- assert41(!this.#onResponseStartCalled);
14058
+ assert42(!this.#onCompleteCalled);
14059
+ assert42(!this.#onErrorCalled);
14060
+ assert42(!this.#onResponseStartCalled);
14061
14061
  this.#onResponseStartCalled = true;
14062
14062
  return this.#handler.onResponseStart?.(...args);
14063
14063
  }
14064
14064
  onResponseData(...args) {
14065
- assert41(!this.#onCompleteCalled);
14066
- assert41(!this.#onErrorCalled);
14065
+ assert42(!this.#onCompleteCalled);
14066
+ assert42(!this.#onErrorCalled);
14067
14067
  return this.#handler.onResponseData?.(...args);
14068
14068
  }
14069
14069
  onResponseEnd(...args) {
14070
- assert41(!this.#onCompleteCalled);
14071
- assert41(!this.#onErrorCalled);
14070
+ assert42(!this.#onCompleteCalled);
14071
+ assert42(!this.#onErrorCalled);
14072
14072
  this.#onCompleteCalled = true;
14073
14073
  return this.#handler.onResponseEnd?.(...args);
14074
14074
  }
@@ -14092,7 +14092,7 @@ var require_redirect_handler = __commonJS({
14092
14092
  init_import_meta_url();
14093
14093
  var util5 = require_util();
14094
14094
  var { kBodyUsed } = require_symbols();
14095
- var assert41 = require("assert");
14095
+ var assert42 = require("assert");
14096
14096
  var { InvalidArgumentError } = require_errors();
14097
14097
  var EE = require("events");
14098
14098
  var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];
@@ -14108,7 +14108,7 @@ var require_redirect_handler = __commonJS({
14108
14108
  this[kBodyUsed] = false;
14109
14109
  }
14110
14110
  async *[Symbol.asyncIterator]() {
14111
- assert41(!this[kBodyUsed], "disturbed");
14111
+ assert42(!this[kBodyUsed], "disturbed");
14112
14112
  this[kBodyUsed] = true;
14113
14113
  yield* this[kBody];
14114
14114
  }
@@ -14137,7 +14137,7 @@ var require_redirect_handler = __commonJS({
14137
14137
  if (util5.isStream(this.opts.body)) {
14138
14138
  if (util5.bodyLength(this.opts.body) === 0) {
14139
14139
  this.opts.body.on("data", function() {
14140
- assert41(false);
14140
+ assert42(false);
14141
14141
  });
14142
14142
  }
14143
14143
  if (typeof this.opts.body.readableDidRead !== "boolean") {
@@ -14239,7 +14239,7 @@ var require_redirect_handler = __commonJS({
14239
14239
  }
14240
14240
  }
14241
14241
  } else {
14242
- assert41(headers == null, "headers must be an object or an array");
14242
+ assert42(headers == null, "headers must be an object or an array");
14243
14243
  }
14244
14244
  return ret;
14245
14245
  }
@@ -15764,7 +15764,7 @@ var require_cache_revalidation_handler = __commonJS({
15764
15764
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/handler/cache-revalidation-handler.js"(exports2, module3) {
15765
15765
  "use strict";
15766
15766
  init_import_meta_url();
15767
- var assert41 = require("assert");
15767
+ var assert42 = require("assert");
15768
15768
  var CacheRevalidationHandler = class {
15769
15769
  static {
15770
15770
  __name(this, "CacheRevalidationHandler");
@@ -15804,7 +15804,7 @@ var require_cache_revalidation_handler = __commonJS({
15804
15804
  this.#handler.onRequestUpgrade?.(controller, statusCode, headers, socket);
15805
15805
  }
15806
15806
  onResponseStart(controller, statusCode, headers, statusMessage) {
15807
- assert41(this.#callback != null);
15807
+ assert42(this.#callback != null);
15808
15808
  this.#successful = statusCode === 304 || this.#allowErrorStatusCodes && statusCode >= 500 && statusCode <= 504;
15809
15809
  this.#callback(this.#successful, this.#context);
15810
15810
  this.#callback = null;
@@ -15855,7 +15855,7 @@ var require_cache2 = __commonJS({
15855
15855
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/interceptor/cache.js"(exports2, module3) {
15856
15856
  "use strict";
15857
15857
  init_import_meta_url();
15858
- var assert41 = require("assert");
15858
+ var assert42 = require("assert");
15859
15859
  var { Readable: Readable8 } = require("stream");
15860
15860
  var util5 = require_util();
15861
15861
  var CacheHandler = require_cache_handler();
@@ -15920,8 +15920,8 @@ var require_cache2 = __commonJS({
15920
15920
  __name(handleUncachedResponse, "handleUncachedResponse");
15921
15921
  function sendCachedValue(handler, opts, result, age, context2, isStale) {
15922
15922
  const stream2 = util5.isStream(result.body) ? result.body : Readable8.from(result.body ?? []);
15923
- assert41(!stream2.destroyed, "stream should not be destroyed");
15924
- assert41(!stream2.readableDidRead, "stream should not be readableDidRead");
15923
+ assert42(!stream2.destroyed, "stream should not be destroyed");
15924
+ assert42(!stream2.readableDidRead, "stream should not be readableDidRead");
15925
15925
  const controller = {
15926
15926
  resume() {
15927
15927
  stream2.resume();
@@ -16480,7 +16480,7 @@ var require_headers = __commonJS({
16480
16480
  isValidHeaderValue
16481
16481
  } = require_util2();
16482
16482
  var { webidl } = require_webidl();
16483
- var assert41 = require("assert");
16483
+ var assert42 = require("assert");
16484
16484
  var util5 = require("util");
16485
16485
  function isHTTPWhiteSpaceCharCode(code) {
16486
16486
  return code === 10 || code === 13 || code === 9 || code === 32;
@@ -16705,11 +16705,11 @@ var require_headers = __commonJS({
16705
16705
  const iterator = this.headersMap[Symbol.iterator]();
16706
16706
  const firstValue = iterator.next().value;
16707
16707
  array[0] = [firstValue[0], firstValue[1].value];
16708
- assert41(firstValue[1].value !== null);
16708
+ assert42(firstValue[1].value !== null);
16709
16709
  for (let i5 = 1, j6 = 0, right2 = 0, left2 = 0, pivot = 0, x6, value; i5 < size; ++i5) {
16710
16710
  value = iterator.next().value;
16711
16711
  x6 = array[i5] = [value[0], value[1].value];
16712
- assert41(x6[1] !== null);
16712
+ assert42(x6[1] !== null);
16713
16713
  left2 = 0;
16714
16714
  right2 = i5;
16715
16715
  while (left2 < right2) {
@@ -16736,7 +16736,7 @@ var require_headers = __commonJS({
16736
16736
  let i5 = 0;
16737
16737
  for (const { 0: name2, 1: { value } } of this.headersMap) {
16738
16738
  array[i5++] = [name2, value];
16739
- assert41(value !== null);
16739
+ assert42(value !== null);
16740
16740
  }
16741
16741
  return array.sort(compareHeaderName);
16742
16742
  }
@@ -16967,7 +16967,7 @@ var require_response = __commonJS({
16967
16967
  var { webidl } = require_webidl();
16968
16968
  var { URLSerializer } = require_data_url();
16969
16969
  var { kConstruct } = require_symbols();
16970
- var assert41 = require("assert");
16970
+ var assert42 = require("assert");
16971
16971
  var { types } = require("util");
16972
16972
  var textEncoder = new TextEncoder("utf-8");
16973
16973
  var Response13 = class _Response {
@@ -17228,7 +17228,7 @@ var require_response = __commonJS({
17228
17228
  return p6 in state2 ? state2[p6] : target[p6];
17229
17229
  },
17230
17230
  set(target, p6, value) {
17231
- assert41(!(p6 in state2));
17231
+ assert42(!(p6 in state2));
17232
17232
  target[p6] = value;
17233
17233
  return true;
17234
17234
  }
@@ -17263,12 +17263,12 @@ var require_response = __commonJS({
17263
17263
  body: null
17264
17264
  });
17265
17265
  } else {
17266
- assert41(false);
17266
+ assert42(false);
17267
17267
  }
17268
17268
  }
17269
17269
  __name(filterResponse, "filterResponse");
17270
17270
  function makeAppropriateNetworkError(fetchParams, err = null) {
17271
- assert41(isCancelled(fetchParams));
17271
+ assert42(isCancelled(fetchParams));
17272
17272
  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 }));
17273
17273
  }
17274
17274
  __name(makeAppropriateNetworkError, "makeAppropriateNetworkError");
@@ -17415,7 +17415,7 @@ var require_request2 = __commonJS({
17415
17415
  var { webidl } = require_webidl();
17416
17416
  var { URLSerializer } = require_data_url();
17417
17417
  var { kConstruct } = require_symbols();
17418
- var assert41 = require("assert");
17418
+ var assert42 = require("assert");
17419
17419
  var { getMaxListeners, setMaxListeners, defaultMaxListeners } = require("events");
17420
17420
  var kAbortController = Symbol("abortController");
17421
17421
  var requestFinalizer = new FinalizationRegistry2(({ signal, abort }) => {
@@ -17496,7 +17496,7 @@ var require_request2 = __commonJS({
17496
17496
  request4 = makeRequest({ urlList: [parsedURL] });
17497
17497
  fallbackMode = "cors";
17498
17498
  } else {
17499
- assert41(webidl.is.Request(input));
17499
+ assert42(webidl.is.Request(input));
17500
17500
  request4 = input.#state;
17501
17501
  signal = input.#signal;
17502
17502
  this.#dispatcher = init3.dispatcher || input.#dispatcher;
@@ -18194,7 +18194,7 @@ var require_fetch = __commonJS({
18194
18194
  createInflate,
18195
18195
  extractMimeType
18196
18196
  } = require_util2();
18197
- var assert41 = require("assert");
18197
+ var assert42 = require("assert");
18198
18198
  var { safelyExtractBody, extractBody } = require_body();
18199
18199
  var {
18200
18200
  redirectStatusSet,
@@ -18276,7 +18276,7 @@ var require_fetch = __commonJS({
18276
18276
  requestObject.signal,
18277
18277
  () => {
18278
18278
  locallyAborted = true;
18279
- assert41(controller != null);
18279
+ assert42(controller != null);
18280
18280
  controller.abort(requestObject.signal.reason);
18281
18281
  const realResponse = responseObject?.deref();
18282
18282
  abortFetch(p6, request4, realResponse, requestObject.signal.reason);
@@ -18382,7 +18382,7 @@ var require_fetch = __commonJS({
18382
18382
  dispatcher = getGlobalDispatcher2()
18383
18383
  // undici
18384
18384
  }) {
18385
- assert41(dispatcher);
18385
+ assert42(dispatcher);
18386
18386
  let taskDestination = null;
18387
18387
  let crossOriginIsolatedCapability = false;
18388
18388
  if (request4.client != null) {
@@ -18405,7 +18405,7 @@ var require_fetch = __commonJS({
18405
18405
  taskDestination,
18406
18406
  crossOriginIsolatedCapability
18407
18407
  };
18408
- assert41(!request4.body || request4.body.stream);
18408
+ assert42(!request4.body || request4.body.stream);
18409
18409
  if (request4.window === "client") {
18410
18410
  request4.window = request4.client?.globalObject?.constructor?.name === "Window" ? request4.client : "no-window";
18411
18411
  }
@@ -18496,7 +18496,7 @@ var require_fetch = __commonJS({
18496
18496
  } else if (request4.responseTainting === "opaque") {
18497
18497
  response = filterResponse(response, "opaque");
18498
18498
  } else {
18499
- assert41(false);
18499
+ assert42(false);
18500
18500
  }
18501
18501
  }
18502
18502
  let internalResponse = response.status === 0 ? response : response.internalResponse;
@@ -18727,7 +18727,7 @@ var require_fetch = __commonJS({
18727
18727
  } else if (request4.redirect === "follow") {
18728
18728
  response = await httpRedirectFetch(fetchParams, response);
18729
18729
  } else {
18730
- assert41(false);
18730
+ assert42(false);
18731
18731
  }
18732
18732
  }
18733
18733
  response.timingInfo = timingInfo;
@@ -18781,7 +18781,7 @@ var require_fetch = __commonJS({
18781
18781
  request4.headersList.delete("host", true);
18782
18782
  }
18783
18783
  if (request4.body != null) {
18784
- assert41(request4.body.source != null);
18784
+ assert42(request4.body.source != null);
18785
18785
  request4.body = safelyExtractBody(request4.body.source)[0];
18786
18786
  }
18787
18787
  const timingInfo = fetchParams.timingInfo;
@@ -18916,7 +18916,7 @@ var require_fetch = __commonJS({
18916
18916
  }
18917
18917
  __name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");
18918
18918
  async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {
18919
- assert41(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
18919
+ assert42(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);
18920
18920
  fetchParams.controller.connection = {
18921
18921
  abort: null,
18922
18922
  destroyed: false,
@@ -19235,7 +19235,7 @@ var require_util3 = __commonJS({
19235
19235
  "../../node_modules/.pnpm/undici@7.11.0/node_modules/undici/lib/web/cache/util.js"(exports2, module3) {
19236
19236
  "use strict";
19237
19237
  init_import_meta_url();
19238
- var assert41 = require("assert");
19238
+ var assert42 = require("assert");
19239
19239
  var { URLSerializer } = require_data_url();
19240
19240
  var { isValidHeaderName } = require_util2();
19241
19241
  function urlEquals(A3, B3, excludeFragment = false) {
@@ -19245,7 +19245,7 @@ var require_util3 = __commonJS({
19245
19245
  }
19246
19246
  __name(urlEquals, "urlEquals");
19247
19247
  function getFieldValues(header) {
19248
- assert41(header !== null);
19248
+ assert42(header !== null);
19249
19249
  const values = [];
19250
19250
  for (let value of header.split(",")) {
19251
19251
  value = value.trim();
@@ -19276,7 +19276,7 @@ var require_cache3 = __commonJS({
19276
19276
  var { Request: Request4, fromInnerRequest, getRequestState } = require_request2();
19277
19277
  var { fetching } = require_fetch();
19278
19278
  var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util2();
19279
- var assert41 = require("assert");
19279
+ var assert42 = require("assert");
19280
19280
  var Cache2 = class _Cache {
19281
19281
  static {
19282
19282
  __name(this, "Cache");
@@ -19520,7 +19520,7 @@ var require_cache3 = __commonJS({
19520
19520
  return false;
19521
19521
  }
19522
19522
  } else {
19523
- assert41(typeof request4 === "string");
19523
+ assert42(typeof request4 === "string");
19524
19524
  r7 = getRequestState(new Request4(request4));
19525
19525
  }
19526
19526
  const operations = [];
@@ -19631,7 +19631,7 @@ var require_cache3 = __commonJS({
19631
19631
  }
19632
19632
  for (const requestResponse of requestResponses) {
19633
19633
  const idx = cache6.indexOf(requestResponse);
19634
- assert41(idx !== -1);
19634
+ assert42(idx !== -1);
19635
19635
  cache6.splice(idx, 1);
19636
19636
  }
19637
19637
  } else if (operation.type === "put") {
@@ -19663,7 +19663,7 @@ var require_cache3 = __commonJS({
19663
19663
  requestResponses = this.#queryCache(operation.request);
19664
19664
  for (const requestResponse of requestResponses) {
19665
19665
  const idx = cache6.indexOf(requestResponse);
19666
- assert41(idx !== -1);
19666
+ assert42(idx !== -1);
19667
19667
  cache6.splice(idx, 1);
19668
19668
  }
19669
19669
  cache6.push([operation.request, operation.response]);
@@ -20130,7 +20130,7 @@ var require_parse = __commonJS({
20130
20130
  var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4();
20131
20131
  var { isCTLExcludingHtab } = require_util4();
20132
20132
  var { collectASequenceOfCodePointsFast } = require_data_url();
20133
- var assert41 = require("assert");
20133
+ var assert42 = require("assert");
20134
20134
  var { unescape: unescape2 } = require("querystring");
20135
20135
  function parseSetCookie(header) {
20136
20136
  if (isCTLExcludingHtab(header)) {
@@ -20174,7 +20174,7 @@ var require_parse = __commonJS({
20174
20174
  if (unparsedAttributes.length === 0) {
20175
20175
  return cookieAttributeList;
20176
20176
  }
20177
- assert41(unparsedAttributes[0] === ";");
20177
+ assert42(unparsedAttributes[0] === ";");
20178
20178
  unparsedAttributes = unparsedAttributes.slice(1);
20179
20179
  let cookieAv = "";
20180
20180
  if (unparsedAttributes.includes(";")) {
@@ -21062,7 +21062,7 @@ var require_connection = __commonJS({
21062
21062
  var { Headers: Headers5, getHeadersList } = require_headers();
21063
21063
  var { getDecodeSplit } = require_util2();
21064
21064
  var { WebsocketFrameSend } = require_frame();
21065
- var assert41 = require("assert");
21065
+ var assert42 = require("assert");
21066
21066
  var crypto8;
21067
21067
  try {
21068
21068
  crypto8 = require("crypto");
@@ -21170,7 +21170,7 @@ var require_connection = __commonJS({
21170
21170
  if (reason.length !== 0 && code === null) {
21171
21171
  code = 1e3;
21172
21172
  }
21173
- assert41(code === null || Number.isInteger(code));
21173
+ assert42(code === null || Number.isInteger(code));
21174
21174
  if (code === null && reason.length === 0) {
21175
21175
  frame.frameData = emptyBuffer;
21176
21176
  } else if (code !== null && reason === null) {
@@ -21275,7 +21275,7 @@ var require_receiver = __commonJS({
21275
21275
  "use strict";
21276
21276
  init_import_meta_url();
21277
21277
  var { Writable: Writable5 } = require("stream");
21278
- var assert41 = require("assert");
21278
+ var assert42 = require("assert");
21279
21279
  var { parserStates, opcodes, states, emptyBuffer, sentCloseFrameState } = require_constants5();
21280
21280
  var { channels } = require_diagnostics();
21281
21281
  var {
@@ -21516,7 +21516,7 @@ var require_receiver = __commonJS({
21516
21516
  return output;
21517
21517
  }
21518
21518
  parseCloseBody(data) {
21519
- assert41(data.length !== 1);
21519
+ assert42(data.length !== 1);
21520
21520
  let code;
21521
21521
  if (data.length >= 2) {
21522
21522
  code = data.readUInt16BE(0);
@@ -23777,193 +23777,6 @@ var init_colors = __esm({
23777
23777
  }
23778
23778
  });
23779
23779
 
23780
- // ../../node_modules/.pnpm/@webcontainer+env@1.1.0/node_modules/@webcontainer/env/dist/index.js
23781
- var require_dist = __commonJS({
23782
- "../../node_modules/.pnpm/@webcontainer+env@1.1.0/node_modules/@webcontainer/env/dist/index.js"(exports2, module3) {
23783
- init_import_meta_url();
23784
- var c6 = Object.defineProperty;
23785
- var g6 = Object.getOwnPropertyDescriptor;
23786
- var y4 = Object.getOwnPropertyNames;
23787
- var d6 = Object.prototype.hasOwnProperty;
23788
- var a5 = /* @__PURE__ */ __name((e7, t7) => c6(e7, "name", { value: t7, configurable: true }), "a");
23789
- var b6 = /* @__PURE__ */ __name((e7, t7) => {
23790
- for (var o5 in t7) c6(e7, o5, { get: t7[o5], enumerable: true });
23791
- }, "b");
23792
- var P3 = /* @__PURE__ */ __name((e7, t7, o5, u5) => {
23793
- if (t7 && typeof t7 == "object" || typeof t7 == "function") for (let s5 of y4(t7)) !d6.call(e7, s5) && s5 !== o5 && c6(e7, s5, { get: /* @__PURE__ */ __name(() => t7[s5], "get"), enumerable: !(u5 = g6(t7, s5)) || u5.enumerable });
23794
- return e7;
23795
- }, "P");
23796
- var U3 = /* @__PURE__ */ __name((e7) => P3(c6({}, "__esModule", { value: true }), e7), "U");
23797
- var x6 = {};
23798
- b6(x6, { HostURL: /* @__PURE__ */ __name(() => n6, "HostURL"), isWebContainer: /* @__PURE__ */ __name(() => h6, "isWebContainer") });
23799
- module3.exports = U3(x6);
23800
- var r7;
23801
- try {
23802
- r7 = require("@blitz/internal/env");
23803
- } catch (e7) {
23804
- }
23805
- function h6() {
23806
- return r7 != null && process.versions.webcontainer != null;
23807
- }
23808
- __name(h6, "h");
23809
- a5(h6, "isWebContainer");
23810
- function p6(e7) {
23811
- let t7 = r7 == null ? void 0 : r7.createServiceHostname(e7);
23812
- if (!t7) throw new Error("Failed to construct service hostname");
23813
- return t7;
23814
- }
23815
- __name(p6, "p");
23816
- a5(p6, "_createServiceHostname");
23817
- function f6(e7) {
23818
- return r7 == null ? void 0 : r7.isServiceUrl(e7);
23819
- }
23820
- __name(f6, "f");
23821
- a5(f6, "_isServiceUrl");
23822
- function l6(e7) {
23823
- return r7 == null ? void 0 : r7.isLocalhost(e7);
23824
- }
23825
- __name(l6, "l");
23826
- a5(l6, "_isLocalhost");
23827
- var n6 = class {
23828
- static {
23829
- __name(this, "n");
23830
- }
23831
- constructor(t7) {
23832
- this._url = t7;
23833
- if (this._port = this._url.port, h6() && l6(this._url.hostname)) {
23834
- let o5 = p6(this._port);
23835
- this._url.host = o5, this._port === this._url.port && (this._url.port = "");
23836
- }
23837
- }
23838
- static parse(t7) {
23839
- return t7 = typeof t7 == "string" ? new URL(t7) : t7, new n6(t7);
23840
- }
23841
- get port() {
23842
- return h6() ? this._port : this._url.port;
23843
- }
23844
- get hash() {
23845
- return this._url.hash;
23846
- }
23847
- get host() {
23848
- return this._url.host;
23849
- }
23850
- get hostname() {
23851
- return this._url.hostname;
23852
- }
23853
- get href() {
23854
- return this._url.href;
23855
- }
23856
- get origin() {
23857
- return this._url.origin;
23858
- }
23859
- get username() {
23860
- return this._url.username;
23861
- }
23862
- get password() {
23863
- return this._url.password;
23864
- }
23865
- get pathname() {
23866
- return this._url.pathname;
23867
- }
23868
- get protocol() {
23869
- return this._url.protocol;
23870
- }
23871
- get search() {
23872
- return this._url.search;
23873
- }
23874
- get searchParams() {
23875
- return this._url.searchParams;
23876
- }
23877
- update(t7) {
23878
- var u5;
23879
- let o5 = h6();
23880
- for (let s5 in t7) {
23881
- let i5 = (u5 = t7[s5]) != null ? u5 : "";
23882
- if (o5) switch (s5) {
23883
- case "port": {
23884
- if (this._port = i5, (l6(this._url.hostname) || f6(this._url.hostname)) && (this._url.host = p6(i5), this._port !== this._url.port)) continue;
23885
- break;
23886
- }
23887
- case "host": {
23888
- let [m6, _4 = this._port] = i5.split(":");
23889
- this._port = _4, l6(m6) && (i5 = p6(_4));
23890
- break;
23891
- }
23892
- case "hostname": {
23893
- if (l6(i5)) {
23894
- if (/\/|:/.test(i5)) continue;
23895
- i5 = p6(this._port);
23896
- } else this._url.port = this._port;
23897
- break;
23898
- }
23899
- case "href": {
23900
- this._url = n6.parse(i5);
23901
- continue;
23902
- }
23903
- }
23904
- this._url[s5] = i5;
23905
- }
23906
- return this;
23907
- }
23908
- toString() {
23909
- return this._url.toString();
23910
- }
23911
- toJSON() {
23912
- return this._url.toJSON();
23913
- }
23914
- };
23915
- a5(n6, "HostURL");
23916
- }
23917
- });
23918
-
23919
- // ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js
23920
- function dedent(templ) {
23921
- var values = [];
23922
- for (var _i2 = 1; _i2 < arguments.length; _i2++) {
23923
- values[_i2 - 1] = arguments[_i2];
23924
- }
23925
- var strings = Array.from(typeof templ === "string" ? [templ] : templ);
23926
- strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
23927
- var indentLengths = strings.reduce(function(arr, str) {
23928
- var matches = str.match(/\n([\t ]+|(?!\s).)/g);
23929
- if (matches) {
23930
- return arr.concat(matches.map(function(match2) {
23931
- var _a4, _b2;
23932
- return (_b2 = (_a4 = match2.match(/[\t ]/g)) === null || _a4 === void 0 ? void 0 : _a4.length) !== null && _b2 !== void 0 ? _b2 : 0;
23933
- }));
23934
- }
23935
- return arr;
23936
- }, []);
23937
- if (indentLengths.length) {
23938
- var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g");
23939
- strings = strings.map(function(str) {
23940
- return str.replace(pattern_1, "\n");
23941
- });
23942
- }
23943
- strings[0] = strings[0].replace(/^\r?\n/, "");
23944
- var string = strings[0];
23945
- values.forEach(function(value, i5) {
23946
- var endentations = string.match(/(?:^|\n)( *)$/);
23947
- var endentation = endentations ? endentations[1] : "";
23948
- var indentedValue = value;
23949
- if (typeof value === "string" && value.includes("\n")) {
23950
- indentedValue = String(value).split("\n").map(function(str, i6) {
23951
- return i6 === 0 ? str : "" + endentation + str;
23952
- }).join("\n");
23953
- }
23954
- string += indentedValue + strings[i5 + 1];
23955
- });
23956
- return string;
23957
- }
23958
- var esm_default2;
23959
- var init_esm2 = __esm({
23960
- "../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js"() {
23961
- init_import_meta_url();
23962
- __name(dedent, "dedent");
23963
- esm_default2 = dedent;
23964
- }
23965
- });
23966
-
23967
23780
  // ../containers-shared/src/client/core/ApiError.ts
23968
23781
  var ApiError;
23969
23782
  var init_ApiError = __esm({
@@ -24644,8 +24457,8 @@ var init_request = __esm({
24644
24457
  getFormData = /* @__PURE__ */ __name((options) => {
24645
24458
  if (options.formData) {
24646
24459
  const formData = new FormData();
24647
- const process11 = /* @__PURE__ */ __name((key, value) => {
24648
- if (isString(value) || isBlob(value)) {
24460
+ const process11 = /* @__PURE__ */ __name(async (key, value) => {
24461
+ if (isString(value)) {
24649
24462
  formData.append(key, value);
24650
24463
  } else {
24651
24464
  formData.append(key, JSON.stringify(value));
@@ -24730,7 +24543,7 @@ var init_request = __esm({
24730
24543
  result = {};
24731
24544
  }
24732
24545
  } else {
24733
- result = { error: fetchResult2.errors?.[0].message };
24546
+ result = { error: fetchResult2.errors?.[0]?.message };
24734
24547
  }
24735
24548
  return {
24736
24549
  url: url4,
@@ -26162,8 +25975,9 @@ async function constructBuildCommand(options, configPath, logger4) {
26162
25975
  const baseDir = configPath ? import_path5.default.dirname(configPath) : process.cwd();
26163
25976
  const absDockerfilePath = import_path5.default.resolve(baseDir, options.pathToDockerfile);
26164
25977
  const dockerfile = (0, import_fs5.readFileSync)(absDockerfilePath, "utf-8");
25978
+ const absBuildContext = options.buildContext ? import_path5.default.resolve(baseDir, options.buildContext) : import_path5.default.dirname(absDockerfilePath);
26165
25979
  buildCmd.push("-f", "-");
26166
- buildCmd.push(options.buildContext ?? import_path5.default.dirname(absDockerfilePath));
25980
+ buildCmd.push(absBuildContext);
26167
25981
  logger4?.debug(`Building image with command: ${buildCmd.join(" ")}`);
26168
25982
  return { buildCmd, dockerfile };
26169
25983
  }
@@ -26357,6 +26171,17 @@ function isDir(path72) {
26357
26171
  const stats = (0, import_fs6.statSync)(path72);
26358
26172
  return stats.isDirectory();
26359
26173
  }
26174
+ async function getContainerIdsByImageTags(dockerPath, imageTags) {
26175
+ const ids = /* @__PURE__ */ new Set();
26176
+ for (const imageTag of imageTags) {
26177
+ const containerIdsFromImage = await getContainerIdsFromImage(
26178
+ dockerPath,
26179
+ imageTag
26180
+ );
26181
+ containerIdsFromImage.forEach((id) => ids.add(id));
26182
+ }
26183
+ return Array.from(ids);
26184
+ }
26360
26185
  async function checkExposedPorts(dockerPath, options) {
26361
26186
  const output = await dockerImageInspect(dockerPath, {
26362
26187
  imageTag: options.imageTag,
@@ -26370,11 +26195,15 @@ For additional information please see: https://developers.cloudflare.com/contain
26370
26195
  );
26371
26196
  }
26372
26197
  }
26373
- var import_child_process3, import_fs6, import_path6, runDockerCmd, runDockerCmdWithOutput, verifyDockerInstalled, isDockerfile, cleanupContainers, getContainerIdsFromImage;
26198
+ function generateContainerBuildId() {
26199
+ return (0, import_crypto.randomUUID)().slice(0, 8);
26200
+ }
26201
+ var import_child_process3, import_crypto, import_fs6, import_path6, runDockerCmd, runDockerCmdWithOutput, verifyDockerInstalled, isDockerfile, cleanupContainers, getContainerIdsFromImage;
26374
26202
  var init_utils = __esm({
26375
26203
  "../containers-shared/src/utils.ts"() {
26376
26204
  init_import_meta_url();
26377
26205
  import_child_process3 = require("child_process");
26206
+ import_crypto = require("crypto");
26378
26207
  import_fs6 = require("fs");
26379
26208
  import_path6 = __toESM(require("path"));
26380
26209
  init_inspect();
@@ -26467,7 +26296,7 @@ Other container tooling that is compatible with the Docker CLI and engine may wo
26467
26296
  throw e7;
26468
26297
  }
26469
26298
  const imageParts = image.split("/");
26470
- if (!imageParts[imageParts.length - 1].includes(":")) {
26299
+ if (!imageParts[imageParts.length - 1]?.includes(":")) {
26471
26300
  throw new Error(
26472
26301
  errorPrefix + `If this is an image registry path, it needs to include at least a tag ':' (e.g: docker.io/httpd:1)`
26473
26302
  );
@@ -26481,12 +26310,10 @@ Other container tooling that is compatible with the Docker CLI and engine may wo
26481
26310
  }, "isDockerfile");
26482
26311
  cleanupContainers = /* @__PURE__ */ __name(async (dockerPath, imageTags) => {
26483
26312
  try {
26484
- const containerIds = [];
26485
- for (const imageTag of imageTags) {
26486
- containerIds.push(
26487
- ...await getContainerIdsFromImage(dockerPath, imageTag)
26488
- );
26489
- }
26313
+ const containerIds = await getContainerIdsByImageTags(
26314
+ dockerPath,
26315
+ imageTags
26316
+ );
26490
26317
  if (containerIds.length === 0) {
26491
26318
  return true;
26492
26319
  }
@@ -26500,6 +26327,7 @@ Other container tooling that is compatible with the Docker CLI and engine may wo
26500
26327
  return false;
26501
26328
  }
26502
26329
  }, "cleanupContainers");
26330
+ __name(getContainerIdsByImageTags, "getContainerIdsByImageTags");
26503
26331
  getContainerIdsFromImage = /* @__PURE__ */ __name(async (dockerPath, ancestorImage) => {
26504
26332
  const output = await runDockerCmdWithOutput(dockerPath, [
26505
26333
  "ps",
@@ -26512,6 +26340,7 @@ Other container tooling that is compatible with the Docker CLI and engine may wo
26512
26340
  return output.split("\n").filter((line) => line.trim());
26513
26341
  }, "getContainerIdsFromImage");
26514
26342
  __name(checkExposedPorts, "checkExposedPorts");
26343
+ __name(generateContainerBuildId, "generateContainerBuildId");
26515
26344
  }
26516
26345
  });
26517
26346
 
@@ -26544,7 +26373,14 @@ async function pullImage(dockerPath, options) {
26544
26373
  ready
26545
26374
  };
26546
26375
  }
26547
- async function prepareContainerImagesForDev(dockerPath, containerOptions, configPath, onContainerImagePreparationStart, onContainerImagePreparationEnd) {
26376
+ async function prepareContainerImagesForDev(options) {
26377
+ const {
26378
+ dockerPath,
26379
+ configPath,
26380
+ containerOptions,
26381
+ onContainerImagePreparationStart,
26382
+ onContainerImagePreparationEnd
26383
+ } = options;
26548
26384
  let aborted = false;
26549
26385
  if (process.platform === "win32") {
26550
26386
  throw new Error(
@@ -26552,11 +26388,11 @@ async function prepareContainerImagesForDev(dockerPath, containerOptions, config
26552
26388
  );
26553
26389
  }
26554
26390
  await verifyDockerInstalled(dockerPath);
26555
- for (const options of containerOptions) {
26556
- if (isDockerfile(options.image, configPath)) {
26557
- const build5 = await buildImage(dockerPath, options, configPath);
26391
+ for (const options2 of containerOptions) {
26392
+ if (isDockerfile(options2.image, configPath)) {
26393
+ const build5 = await buildImage(dockerPath, options2, configPath);
26558
26394
  onContainerImagePreparationStart({
26559
- containerOptions: options,
26395
+ containerOptions: options2,
26560
26396
  abort: /* @__PURE__ */ __name(() => {
26561
26397
  aborted = true;
26562
26398
  build5.abort();
@@ -26564,18 +26400,18 @@ async function prepareContainerImagesForDev(dockerPath, containerOptions, config
26564
26400
  });
26565
26401
  await build5.ready;
26566
26402
  onContainerImagePreparationEnd({
26567
- containerOptions: options
26403
+ containerOptions: options2
26568
26404
  });
26569
26405
  } else {
26570
- if (!isCloudflareRegistryLink(options.image)) {
26406
+ if (!isCloudflareRegistryLink(options2.image)) {
26571
26407
  throw new Error(
26572
- `Image "${options.image}" is a registry link but does not point to the Cloudflare container registry.
26408
+ `Image "${options2.image}" is a registry link but does not point to the Cloudflare container registry.
26573
26409
  To use an existing image from another repository, see https://developers.cloudflare.com/containers/image-management/#using-existing-images`
26574
26410
  );
26575
26411
  }
26576
- const pull = await pullImage(dockerPath, options);
26412
+ const pull = await pullImage(dockerPath, options2);
26577
26413
  onContainerImagePreparationStart({
26578
- containerOptions: options,
26414
+ containerOptions: options2,
26579
26415
  abort: /* @__PURE__ */ __name(() => {
26580
26416
  aborted = true;
26581
26417
  pull.abort();
@@ -26583,11 +26419,11 @@ To use an existing image from another repository, see https://developers.cloudfl
26583
26419
  });
26584
26420
  await pull.ready;
26585
26421
  onContainerImagePreparationEnd({
26586
- containerOptions: options
26422
+ containerOptions: options2
26587
26423
  });
26588
26424
  }
26589
26425
  if (!aborted) {
26590
- await checkExposedPorts(dockerPath, options);
26426
+ await checkExposedPorts(dockerPath, options2);
26591
26427
  }
26592
26428
  }
26593
26429
  }
@@ -26635,6 +26471,193 @@ var init_containers_shared = __esm({
26635
26471
  }
26636
26472
  });
26637
26473
 
26474
+ // ../../node_modules/.pnpm/@webcontainer+env@1.1.0/node_modules/@webcontainer/env/dist/index.js
26475
+ var require_dist = __commonJS({
26476
+ "../../node_modules/.pnpm/@webcontainer+env@1.1.0/node_modules/@webcontainer/env/dist/index.js"(exports2, module3) {
26477
+ init_import_meta_url();
26478
+ var c6 = Object.defineProperty;
26479
+ var g6 = Object.getOwnPropertyDescriptor;
26480
+ var y4 = Object.getOwnPropertyNames;
26481
+ var d6 = Object.prototype.hasOwnProperty;
26482
+ var a5 = /* @__PURE__ */ __name((e7, t7) => c6(e7, "name", { value: t7, configurable: true }), "a");
26483
+ var b6 = /* @__PURE__ */ __name((e7, t7) => {
26484
+ for (var o5 in t7) c6(e7, o5, { get: t7[o5], enumerable: true });
26485
+ }, "b");
26486
+ var P3 = /* @__PURE__ */ __name((e7, t7, o5, u5) => {
26487
+ if (t7 && typeof t7 == "object" || typeof t7 == "function") for (let s5 of y4(t7)) !d6.call(e7, s5) && s5 !== o5 && c6(e7, s5, { get: /* @__PURE__ */ __name(() => t7[s5], "get"), enumerable: !(u5 = g6(t7, s5)) || u5.enumerable });
26488
+ return e7;
26489
+ }, "P");
26490
+ var U3 = /* @__PURE__ */ __name((e7) => P3(c6({}, "__esModule", { value: true }), e7), "U");
26491
+ var x6 = {};
26492
+ b6(x6, { HostURL: /* @__PURE__ */ __name(() => n6, "HostURL"), isWebContainer: /* @__PURE__ */ __name(() => h6, "isWebContainer") });
26493
+ module3.exports = U3(x6);
26494
+ var r7;
26495
+ try {
26496
+ r7 = require("@blitz/internal/env");
26497
+ } catch (e7) {
26498
+ }
26499
+ function h6() {
26500
+ return r7 != null && process.versions.webcontainer != null;
26501
+ }
26502
+ __name(h6, "h");
26503
+ a5(h6, "isWebContainer");
26504
+ function p6(e7) {
26505
+ let t7 = r7 == null ? void 0 : r7.createServiceHostname(e7);
26506
+ if (!t7) throw new Error("Failed to construct service hostname");
26507
+ return t7;
26508
+ }
26509
+ __name(p6, "p");
26510
+ a5(p6, "_createServiceHostname");
26511
+ function f6(e7) {
26512
+ return r7 == null ? void 0 : r7.isServiceUrl(e7);
26513
+ }
26514
+ __name(f6, "f");
26515
+ a5(f6, "_isServiceUrl");
26516
+ function l6(e7) {
26517
+ return r7 == null ? void 0 : r7.isLocalhost(e7);
26518
+ }
26519
+ __name(l6, "l");
26520
+ a5(l6, "_isLocalhost");
26521
+ var n6 = class {
26522
+ static {
26523
+ __name(this, "n");
26524
+ }
26525
+ constructor(t7) {
26526
+ this._url = t7;
26527
+ if (this._port = this._url.port, h6() && l6(this._url.hostname)) {
26528
+ let o5 = p6(this._port);
26529
+ this._url.host = o5, this._port === this._url.port && (this._url.port = "");
26530
+ }
26531
+ }
26532
+ static parse(t7) {
26533
+ return t7 = typeof t7 == "string" ? new URL(t7) : t7, new n6(t7);
26534
+ }
26535
+ get port() {
26536
+ return h6() ? this._port : this._url.port;
26537
+ }
26538
+ get hash() {
26539
+ return this._url.hash;
26540
+ }
26541
+ get host() {
26542
+ return this._url.host;
26543
+ }
26544
+ get hostname() {
26545
+ return this._url.hostname;
26546
+ }
26547
+ get href() {
26548
+ return this._url.href;
26549
+ }
26550
+ get origin() {
26551
+ return this._url.origin;
26552
+ }
26553
+ get username() {
26554
+ return this._url.username;
26555
+ }
26556
+ get password() {
26557
+ return this._url.password;
26558
+ }
26559
+ get pathname() {
26560
+ return this._url.pathname;
26561
+ }
26562
+ get protocol() {
26563
+ return this._url.protocol;
26564
+ }
26565
+ get search() {
26566
+ return this._url.search;
26567
+ }
26568
+ get searchParams() {
26569
+ return this._url.searchParams;
26570
+ }
26571
+ update(t7) {
26572
+ var u5;
26573
+ let o5 = h6();
26574
+ for (let s5 in t7) {
26575
+ let i5 = (u5 = t7[s5]) != null ? u5 : "";
26576
+ if (o5) switch (s5) {
26577
+ case "port": {
26578
+ if (this._port = i5, (l6(this._url.hostname) || f6(this._url.hostname)) && (this._url.host = p6(i5), this._port !== this._url.port)) continue;
26579
+ break;
26580
+ }
26581
+ case "host": {
26582
+ let [m6, _4 = this._port] = i5.split(":");
26583
+ this._port = _4, l6(m6) && (i5 = p6(_4));
26584
+ break;
26585
+ }
26586
+ case "hostname": {
26587
+ if (l6(i5)) {
26588
+ if (/\/|:/.test(i5)) continue;
26589
+ i5 = p6(this._port);
26590
+ } else this._url.port = this._port;
26591
+ break;
26592
+ }
26593
+ case "href": {
26594
+ this._url = n6.parse(i5);
26595
+ continue;
26596
+ }
26597
+ }
26598
+ this._url[s5] = i5;
26599
+ }
26600
+ return this;
26601
+ }
26602
+ toString() {
26603
+ return this._url.toString();
26604
+ }
26605
+ toJSON() {
26606
+ return this._url.toJSON();
26607
+ }
26608
+ };
26609
+ a5(n6, "HostURL");
26610
+ }
26611
+ });
26612
+
26613
+ // ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js
26614
+ function dedent(templ) {
26615
+ var values = [];
26616
+ for (var _i2 = 1; _i2 < arguments.length; _i2++) {
26617
+ values[_i2 - 1] = arguments[_i2];
26618
+ }
26619
+ var strings = Array.from(typeof templ === "string" ? [templ] : templ);
26620
+ strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
26621
+ var indentLengths = strings.reduce(function(arr, str) {
26622
+ var matches = str.match(/\n([\t ]+|(?!\s).)/g);
26623
+ if (matches) {
26624
+ return arr.concat(matches.map(function(match2) {
26625
+ var _a4, _b2;
26626
+ return (_b2 = (_a4 = match2.match(/[\t ]/g)) === null || _a4 === void 0 ? void 0 : _a4.length) !== null && _b2 !== void 0 ? _b2 : 0;
26627
+ }));
26628
+ }
26629
+ return arr;
26630
+ }, []);
26631
+ if (indentLengths.length) {
26632
+ var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g");
26633
+ strings = strings.map(function(str) {
26634
+ return str.replace(pattern_1, "\n");
26635
+ });
26636
+ }
26637
+ strings[0] = strings[0].replace(/^\r?\n/, "");
26638
+ var string = strings[0];
26639
+ values.forEach(function(value, i5) {
26640
+ var endentations = string.match(/(?:^|\n)( *)$/);
26641
+ var endentation = endentations ? endentations[1] : "";
26642
+ var indentedValue = value;
26643
+ if (typeof value === "string" && value.includes("\n")) {
26644
+ indentedValue = String(value).split("\n").map(function(str, i6) {
26645
+ return i6 === 0 ? str : "" + endentation + str;
26646
+ }).join("\n");
26647
+ }
26648
+ string += indentedValue + strings[i5 + 1];
26649
+ });
26650
+ return string;
26651
+ }
26652
+ var esm_default2;
26653
+ var init_esm2 = __esm({
26654
+ "../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js"() {
26655
+ init_import_meta_url();
26656
+ __name(dedent, "dedent");
26657
+ esm_default2 = dedent;
26658
+ }
26659
+ });
26660
+
26638
26661
  // ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/parser.js
26639
26662
  var require_parser = __commonJS({
26640
26663
  "../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/parser.js"(exports2, module3) {
@@ -32128,6 +32151,25 @@ var require_cli_table3 = __commonJS({
32128
32151
  });
32129
32152
 
32130
32153
  // src/environment-variables/factory.ts
32154
+ function getBooleanEnvironmentVariableFactory(options) {
32155
+ return () => {
32156
+ if (!(options.variableName in process.env) || process.env[options.variableName] === void 0) {
32157
+ return typeof options.defaultValue === "function" ? options.defaultValue() : options.defaultValue;
32158
+ }
32159
+ switch (process.env[options.variableName]?.toLowerCase()) {
32160
+ case "true":
32161
+ return true;
32162
+ case "false":
32163
+ return false;
32164
+ default:
32165
+ throw new UserError(
32166
+ `Expected ${options.variableName} to be "true" or "false", but got ${JSON.stringify(
32167
+ process.env[options.variableName]
32168
+ )}`
32169
+ );
32170
+ }
32171
+ };
32172
+ }
32131
32173
  function getEnvironmentVariableFactory({
32132
32174
  variableName,
32133
32175
  deprecatedName,
@@ -32166,6 +32208,7 @@ var init_factory = __esm({
32166
32208
  "src/environment-variables/factory.ts"() {
32167
32209
  init_import_meta_url();
32168
32210
  init_errors();
32211
+ __name(getBooleanEnvironmentVariableFactory, "getBooleanEnvironmentVariableFactory");
32169
32212
  __name(getEnvironmentVariableFactory, "getEnvironmentVariableFactory");
32170
32213
  __name(getProcessEnv, "getProcessEnv");
32171
32214
  __name(assertOneOf, "assertOneOf");
@@ -32761,7 +32804,7 @@ var init_misc_variables = __esm({
32761
32804
  variableName: "WRANGLER_C3_COMMAND",
32762
32805
  defaultValue: /* @__PURE__ */ __name(() => "create cloudflare@^2.5.0", "defaultValue")
32763
32806
  });
32764
- getWranglerSendMetricsFromEnv = getEnvironmentVariableFactory({
32807
+ getWranglerSendMetricsFromEnv = getBooleanEnvironmentVariableFactory({
32765
32808
  variableName: "WRANGLER_SEND_METRICS"
32766
32809
  });
32767
32810
  getCloudflareApiEnvironmentFromEnv = getEnvironmentVariableFactory(
@@ -32799,10 +32842,10 @@ var init_misc_variables = __esm({
32799
32842
  getCloudflareApiBaseUrl = /* @__PURE__ */ __name((complianceConfig) => getCloudflareApiBaseUrlFromEnv() ?? `https://api${getComplianceRegionSubdomain(complianceConfig)}${getStagingSubdomain()}.cloudflare.com/client/v4`, "getCloudflareApiBaseUrl");
32800
32843
  __name(getComplianceRegionSubdomain, "getComplianceRegionSubdomain");
32801
32844
  __name(getStagingSubdomain, "getStagingSubdomain");
32802
- getSanitizeLogs = getEnvironmentVariableFactory({
32845
+ getSanitizeLogs = getBooleanEnvironmentVariableFactory({
32803
32846
  variableName: "WRANGLER_LOG_SANITIZE",
32804
32847
  defaultValue() {
32805
- return "true";
32848
+ return true;
32806
32849
  }
32807
32850
  });
32808
32851
  getOutputFileDirectoryFromEnv = getEnvironmentVariableFactory({
@@ -32910,7 +32953,7 @@ var require_signal_exit = __commonJS({
32910
32953
  };
32911
32954
  };
32912
32955
  } else {
32913
- assert41 = require("assert");
32956
+ assert42 = require("assert");
32914
32957
  signals = require_signals();
32915
32958
  isWin = /^win/i.test(process11.platform);
32916
32959
  EE = require("events");
@@ -32933,7 +32976,7 @@ var require_signal_exit = __commonJS({
32933
32976
  return function() {
32934
32977
  };
32935
32978
  }
32936
- assert41.equal(typeof cb2, "function", "a callback must be provided for exit handler");
32979
+ assert42.equal(typeof cb2, "function", "a callback must be provided for exit handler");
32937
32980
  if (loaded === false) {
32938
32981
  load();
32939
32982
  }
@@ -33039,7 +33082,7 @@ var require_signal_exit = __commonJS({
33039
33082
  }
33040
33083
  }, "processEmit");
33041
33084
  }
33042
- var assert41;
33085
+ var assert42;
33043
33086
  var signals;
33044
33087
  var isWin;
33045
33088
  var EE;
@@ -33243,13 +33286,13 @@ var init_logger = __esm({
33243
33286
  }, "json");
33244
33287
  debug = /* @__PURE__ */ __name((...args) => this.doLog("debug", args), "debug");
33245
33288
  debugWithSanitization = /* @__PURE__ */ __name((label, ...args) => {
33246
- if (getSanitizeLogs() === "false") {
33247
- this.doLog("debug", [label, ...args]);
33248
- } else {
33289
+ if (getSanitizeLogs()) {
33249
33290
  this.doLog("debug", [
33250
33291
  label,
33251
33292
  "omitted; set WRANGLER_LOG_SANITIZE=false to include sanitized data"
33252
33293
  ]);
33294
+ } else {
33295
+ this.doLog("debug", [label, ...args]);
33253
33296
  }
33254
33297
  }, "debugWithSanitization");
33255
33298
  info = /* @__PURE__ */ __name((...args) => this.doLog("info", args), "info");
@@ -33647,7 +33690,7 @@ var name, version;
33647
33690
  var init_package = __esm({
33648
33691
  "package.json"() {
33649
33692
  name = "wrangler";
33650
- version = "4.24.4";
33693
+ version = "4.25.1";
33651
33694
  }
33652
33695
  });
33653
33696
 
@@ -41162,12 +41205,18 @@ function createGetMode({
41162
41205
  function warnOrError(type, remote, supports2) {
41163
41206
  if (remote === true && supports2 === "local") {
41164
41207
  throw new UserError(
41165
- `${friendlyBindingNames[type]} bindings do not support accessing remote resources.`
41208
+ `${friendlyBindingNames[type]} bindings do not support accessing remote resources.`,
41209
+ {
41210
+ telemetryMessage: true
41211
+ }
41166
41212
  );
41167
41213
  }
41168
41214
  if (remote === false && supports2 === "remote") {
41169
41215
  throw new UserError(
41170
- `${friendlyBindingNames[type]} bindings do not support local development. You may be able to set \`experimental_remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`
41216
+ `${friendlyBindingNames[type]} bindings do not support local development. You may be able to set \`experimental_remote: true\` for the binding definition in your configuration file to access a remote version of the resource.`,
41217
+ {
41218
+ telemetryMessage: true
41219
+ }
41171
41220
  );
41172
41221
  }
41173
41222
  if (remote === void 0 && supports2 === "remote") {
@@ -42774,6 +42823,11 @@ function validateContainerApp(envName, topLevelName) {
42774
42823
  `"containers.image" field must be defined for each container app. This should be the path to your Dockerfile or a image URI pointing to the Cloudflare registry.`
42775
42824
  );
42776
42825
  }
42826
+ if ("configuration" in containerAppOptional) {
42827
+ diagnostics.warnings.push(
42828
+ `"containers.configuration" is deprecated. Use top level "containers" fields instead. "configuration.image" should be "image", "configuration.disk" should be set via "instance_type".`
42829
+ );
42830
+ }
42777
42831
  if ("image" in containerAppOptional && containerAppOptional.image !== void 0) {
42778
42832
  if (containerAppOptional.configuration?.image !== void 0) {
42779
42833
  diagnostics.errors.push(
@@ -42794,26 +42848,98 @@ function validateContainerApp(envName, topLevelName) {
42794
42848
  `"containers.rollout_step_percentage" field should be a number between 25 and 100, but got ${containerAppOptional.rollout_step_percentage}`
42795
42849
  );
42796
42850
  }
42797
- if (!isOptionalProperty(containerAppOptional, "rollout_kind", "string") && "rollout_kind" in containerAppOptional && !["full_auto", "full_manual", "none"].includes(
42798
- containerAppOptional.rollout_kind
42799
- )) {
42851
+ if (Array.isArray(containerAppOptional.configuration)) {
42800
42852
  diagnostics.errors.push(
42801
- `"containers.rollout_kind" field should be either 'full_auto', 'full_manual' or 'none', but got ${containerAppOptional.rollout_kind}`
42853
+ `"containers.configuration" is defined as an array, it should be an object`
42802
42854
  );
42803
42855
  }
42804
- if (Array.isArray(containerAppOptional.configuration)) {
42856
+ validateOptionalProperty(
42857
+ diagnostics,
42858
+ field,
42859
+ "rollout_kind",
42860
+ containerAppOptional.rollout_kind,
42861
+ "string",
42862
+ ["full_auto", "full_manual", "none"]
42863
+ );
42864
+ validateOptionalProperty(
42865
+ diagnostics,
42866
+ field,
42867
+ "instance_type",
42868
+ containerAppOptional.instance_type,
42869
+ "string",
42870
+ ["dev", "basic", "standard"]
42871
+ );
42872
+ validateOptionalProperty(
42873
+ diagnostics,
42874
+ field,
42875
+ "max_instances",
42876
+ containerAppOptional.max_instances,
42877
+ "number"
42878
+ );
42879
+ if (containerAppOptional.max_instances !== void 0 && containerAppOptional.max_instances < 0) {
42805
42880
  diagnostics.errors.push(
42806
- `"containers.configuration" is defined as an array, it should be an object`
42881
+ `"containers.max_instances" field should be a positive number, but got ${containerAppOptional.max_instances}`
42807
42882
  );
42808
42883
  }
42809
- if ("instance_type" in containerAppOptional) {
42810
- validateOptionalProperty(
42811
- diagnostics,
42812
- field,
42884
+ validateOptionalProperty(
42885
+ diagnostics,
42886
+ field,
42887
+ "image_build_context",
42888
+ containerAppOptional.image_build_context,
42889
+ "string"
42890
+ );
42891
+ validateOptionalProperty(
42892
+ diagnostics,
42893
+ field,
42894
+ "image_vars",
42895
+ containerAppOptional.image_vars,
42896
+ "object"
42897
+ );
42898
+ validateOptionalProperty(
42899
+ diagnostics,
42900
+ field,
42901
+ "scheduling_policy",
42902
+ containerAppOptional.scheduling_policy,
42903
+ "string",
42904
+ ["regional", "moon", "default"]
42905
+ );
42906
+ if ("instances" in containerAppOptional) {
42907
+ diagnostics.warnings.push(
42908
+ `"containers.instances" is deprecated. Use "containers.max_instances" instead.`
42909
+ );
42910
+ }
42911
+ if ("durable_objects" in containerAppOptional) {
42912
+ diagnostics.warnings.push(
42913
+ `"containers.durable_objects" is deprecated. Use the "class_name" field instead.`
42914
+ );
42915
+ }
42916
+ validateAdditionalProperties(
42917
+ diagnostics,
42918
+ field,
42919
+ Object.keys(containerAppOptional),
42920
+ [
42921
+ "name",
42922
+ "instances",
42923
+ "max_instances",
42924
+ "image",
42925
+ "image_build_context",
42926
+ "image_vars",
42927
+ "class_name",
42928
+ "scheduling_policy",
42813
42929
  "instance_type",
42814
- containerAppOptional.instance_type,
42815
- "string",
42816
- ["dev", "basic", "standard"]
42930
+ "configuration",
42931
+ "constraints",
42932
+ "rollout_step_percentage",
42933
+ "rollout_kind",
42934
+ "durable_objects"
42935
+ ]
42936
+ );
42937
+ if ("configuration" in containerAppOptional) {
42938
+ validateAdditionalProperties(
42939
+ diagnostics,
42940
+ `${field}.configuration`,
42941
+ Object.keys(containerAppOptional.configuration),
42942
+ ["image", "secrets", "labels", "disk", "vcpu", "memory_mib"]
42817
42943
  );
42818
42944
  }
42819
42945
  }
@@ -49255,7 +49381,7 @@ var require_number = __commonJS({
49255
49381
  var figures = _require2.figures;
49256
49382
  var clear = _require2.clear;
49257
49383
  var lines = _require2.lines;
49258
- var isNumber2 = /[0-9]/;
49384
+ var isNumber = /[0-9]/;
49259
49385
  var isDef = /* @__PURE__ */ __name((any) => any !== void 0, "isDef");
49260
49386
  var round = /* @__PURE__ */ __name((number, precision) => {
49261
49387
  let factor = Math.pow(10, precision);
@@ -49302,7 +49428,7 @@ var require_number = __commonJS({
49302
49428
  return this.float ? parseFloat(x6) : parseInt(x6);
49303
49429
  }
49304
49430
  valid(c6) {
49305
- return c6 === `-` || c6 === `.` && this.float || isNumber2.test(c6);
49431
+ return c6 === `-` || c6 === `.` && this.float || isNumber.test(c6);
49306
49432
  }
49307
49433
  reset() {
49308
49434
  this.typed = ``;
@@ -51698,7 +51824,7 @@ var require_number2 = __commonJS({
51698
51824
  var Prompt = require_prompt2();
51699
51825
  var { cursor, erase } = require_src();
51700
51826
  var { style, figures, clear, lines } = require_util8();
51701
- var isNumber2 = /[0-9]/;
51827
+ var isNumber = /[0-9]/;
51702
51828
  var isDef = /* @__PURE__ */ __name((any) => any !== void 0, "isDef");
51703
51829
  var round = /* @__PURE__ */ __name((number, precision) => {
51704
51830
  let factor = Math.pow(10, precision);
@@ -51745,7 +51871,7 @@ var require_number2 = __commonJS({
51745
51871
  return this.float ? parseFloat(x6) : parseInt(x6);
51746
51872
  }
51747
51873
  valid(c6) {
51748
- return c6 === `-` || c6 === `.` && this.float || isNumber2.test(c6);
51874
+ return c6 === `-` || c6 === `.` && this.float || isNumber.test(c6);
51749
51875
  }
51750
51876
  reset() {
51751
51877
  this.typed = ``;
@@ -57541,7 +57667,7 @@ var require_minimist = __commonJS({
57541
57667
  if (arg2 && flags2.unknownFn && !argDefined(key2, arg2)) {
57542
57668
  if (flags2.unknownFn(arg2) === false) return;
57543
57669
  }
57544
- var value2 = !flags2.strings[key2] && isNumber2(val2) ? Number(val2) : val2;
57670
+ var value2 = !flags2.strings[key2] && isNumber(val2) ? Number(val2) : val2;
57545
57671
  setKey(argv, key2.split("."), value2);
57546
57672
  (aliases2[key2] || []).forEach(function(x6) {
57547
57673
  setKey(argv, x6.split("."), value2);
@@ -57644,7 +57770,7 @@ var require_minimist = __commonJS({
57644
57770
  } else {
57645
57771
  if (!flags2.unknownFn || flags2.unknownFn(arg) !== false) {
57646
57772
  argv._.push(
57647
- flags2.strings["_"] || !isNumber2(arg) ? arg : Number(arg)
57773
+ flags2.strings["_"] || !isNumber(arg) ? arg : Number(arg)
57648
57774
  );
57649
57775
  }
57650
57776
  if (opts.stopEarly) {
@@ -57682,12 +57808,12 @@ var require_minimist = __commonJS({
57682
57808
  return key in o5;
57683
57809
  }
57684
57810
  __name(hasKey2, "hasKey");
57685
- function isNumber2(x6) {
57811
+ function isNumber(x6) {
57686
57812
  if (typeof x6 === "number") return true;
57687
57813
  if (/^0x[0-9a-f]+$/i.test(x6)) return true;
57688
57814
  return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x6);
57689
57815
  }
57690
- __name(isNumber2, "isNumber");
57816
+ __name(isNumber, "isNumber");
57691
57817
  function isConstructorOrProto(obj, key) {
57692
57818
  return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
57693
57819
  }
@@ -58758,7 +58884,11 @@ function buildMiniflareBindingOptions(config, remoteProxyConnectionString, remot
58758
58884
  {
58759
58885
  className,
58760
58886
  useSQLite: classNameToUseSQLite.get(className),
58761
- container: getImageNameFromDOClassName(className, config)
58887
+ container: getImageNameFromDOClassName({
58888
+ doClassName: className,
58889
+ containers: config.containers,
58890
+ containerBuildId: config.containerBuildId
58891
+ })
58762
58892
  }
58763
58893
  ];
58764
58894
  }),
@@ -58999,22 +59129,24 @@ async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticati
58999
59129
  };
59000
59130
  return { options, internalObjects, entrypointNames };
59001
59131
  }
59002
- function getImageNameFromDOClassName(DOClassName, config) {
59003
- if (!config.containers || !config.containers.length) {
59132
+ function getImageNameFromDOClassName(options) {
59133
+ if (!options.containers || !options.containers.length) {
59004
59134
  return void 0;
59005
59135
  }
59006
59136
  (0, import_node_assert5.default)(
59007
- config.containerBuildId,
59137
+ options.containerBuildId,
59008
59138
  "Build ID should be set if containers are defined and enabled"
59009
59139
  );
59010
- const container = config.containers.find((c6) => c6.class_name === DOClassName);
59140
+ const container = options.containers.find(
59141
+ (c6) => c6.class_name === options.doClassName
59142
+ );
59011
59143
  if (!container) {
59012
59144
  return void 0;
59013
59145
  }
59014
59146
  return {
59015
59147
  imageName: getDevContainerImageName(
59016
59148
  container.class_name,
59017
- config.containerBuildId
59149
+ options.containerBuildId
59018
59150
  )
59019
59151
  };
59020
59152
  }
@@ -66816,7 +66948,9 @@ function buildYargs(yargs) {
66816
66948
  type: "string",
66817
66949
  default: "linux/amd64",
66818
66950
  describe: "Platform to build for. Defaults to the architecture support by Workers (linux/amd64)",
66819
- demandOption: false
66951
+ demandOption: false,
66952
+ hidden: true,
66953
+ deprecated: true
66820
66954
  });
66821
66955
  }
66822
66956
  function pushYargs(yargs) {
@@ -66930,6 +67064,11 @@ async function buildCommand(args, config) {
66930
67064
  `${args.PATH} is not a directory. Please specify a valid directory path.`
66931
67065
  );
66932
67066
  }
67067
+ if (args.platform !== "linux/amd64") {
67068
+ throw new UserError(
67069
+ `Unsupported platform: Platform "${args.platform}" is unsupported. Please use "linux/amd64" instead.`
67070
+ );
67071
+ }
66933
67072
  const containers2 = config.containers ?? [void 0];
66934
67073
  const pathToDockerfile = (0, import_path11.join)(args.PATH, "Dockerfile");
66935
67074
  for (const container of containers2) {
@@ -66957,6 +67096,7 @@ async function pushCommand(args, config) {
66957
67096
  args.TAG
66958
67097
  );
66959
67098
  const dockerPath = args.pathToDocker ?? getDockerPath();
67099
+ await checkImagePlatform(dockerPath, args.TAG);
66960
67100
  await runDockerCmd(dockerPath, ["tag", args.TAG, newTag]);
66961
67101
  await runDockerCmd(dockerPath, ["push", newTag]);
66962
67102
  logger.log(`Pushed image: ${newTag}`);
@@ -66967,6 +67107,17 @@ async function pushCommand(args, config) {
66967
67107
  throw new UserError("An unknown error occurred");
66968
67108
  }
66969
67109
  }
67110
+ async function checkImagePlatform(pathToDocker, imageTag, expectedPlatform = "linux/amd64") {
67111
+ const platform3 = await dockerImageInspect(pathToDocker, {
67112
+ imageTag,
67113
+ formatString: "{{ .Os }}/{{ .Architecture }}"
67114
+ });
67115
+ if (platform3 !== expectedPlatform) {
67116
+ throw new Error(
67117
+ `Unsupported platform: Image platform (${platform3}) does not match the expected platform (${expectedPlatform})`
67118
+ );
67119
+ }
67120
+ }
66970
67121
  async function ensureDiskLimits(options) {
66971
67122
  const MB = 1e3 * 1e3;
66972
67123
  const MiB = 1024 * 1024;
@@ -67005,6 +67156,7 @@ var init_build2 = __esm({
67005
67156
  __name(buildAndMaybePush, "buildAndMaybePush");
67006
67157
  __name(buildCommand, "buildCommand");
67007
67158
  __name(pushCommand, "pushCommand");
67159
+ __name(checkImagePlatform, "checkImagePlatform");
67008
67160
  __name(ensureDiskLimits, "ensureDiskLimits");
67009
67161
  }
67010
67162
  });
@@ -67535,48 +67687,9 @@ var init_containers2 = __esm({
67535
67687
  });
67536
67688
 
67537
67689
  // src/cloudchamber/helpers/diff.ts
67538
- function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
67539
- const components = [];
67540
- let nextComponent;
67541
- while (lastComponent) {
67542
- components.push(lastComponent);
67543
- nextComponent = lastComponent.previousComponent;
67544
- delete lastComponent.previousComponent;
67545
- lastComponent = nextComponent;
67546
- }
67547
- components.reverse();
67548
- const componentLen = components.length;
67549
- let componentPos = 0, newPos = 0, oldPos = 0;
67550
- for (; componentPos < componentLen; componentPos++) {
67551
- const component = components[componentPos];
67552
- if (!component.removed) {
67553
- if (!component.added && useLongestToken) {
67554
- let value = newString.slice(newPos, newPos + component.count);
67555
- value = value.map((el, i5) => {
67556
- const oldValue = oldString[oldPos + i5];
67557
- return oldValue.length > el.length ? oldValue : el;
67558
- });
67559
- component.value = diff.join(value);
67560
- } else {
67561
- component.value = diff.join(
67562
- newString.slice(newPos, newPos + component.count)
67563
- );
67564
- }
67565
- newPos += component.count;
67566
- if (!component.added) {
67567
- oldPos += component.count;
67568
- }
67569
- } else {
67570
- component.value = diff.join(
67571
- oldString.slice(oldPos, oldPos + component.count)
67572
- );
67573
- oldPos += component.count;
67574
- }
67575
- }
67576
- return components;
67577
- }
67578
67690
  function tokenize(value) {
67579
- const retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/);
67691
+ const retLines = [];
67692
+ const linesAndNewlines = value.split(/(\n|\r\n)/);
67580
67693
  if (!linesAndNewlines[linesAndNewlines.length - 1]) {
67581
67694
  linesAndNewlines.pop();
67582
67695
  }
@@ -67586,139 +67699,7 @@ function tokenize(value) {
67586
67699
  }
67587
67700
  return retLines.filter((s5) => s5 !== "");
67588
67701
  }
67589
- function diffLines(oldStr, newStr) {
67590
- let res = [];
67591
- lineDiff.diff(tokenize(oldStr), tokenize(newStr), (r7) => {
67592
- res = r7;
67593
- });
67594
- return res;
67595
- }
67596
- function isNumber(c6) {
67597
- if (typeof c6 === "number") {
67598
- return true;
67599
- }
67600
- const code = c6.charCodeAt(0);
67601
- const zero = "0".charCodeAt(0);
67602
- const nine = "9".charCodeAt(0);
67603
- return code >= zero && code <= nine;
67604
- }
67605
- function createLine(el, startWith = "") {
67606
- let line = startWith;
67607
- let lastAdded = 0;
67608
- const addToLine = /* @__PURE__ */ __name((i5, color = (s5) => s5) => {
67609
- line += color(el.slice(lastAdded, i5));
67610
- lastAdded = i5;
67611
- }, "addToLine");
67612
- const state2 = {
67613
- render: "left"
67614
- };
67615
- for (let i5 = 0; i5 < el.length; i5++) {
67616
- const current = el[i5];
67617
- const peek = i5 + 1 < el.length ? el[i5 + 1] : null;
67618
- const prev = i5 === 0 ? null : el[i5 - 1];
67619
- switch (state2.render) {
67620
- case "left":
67621
- if (current === "=") {
67622
- state2.render = "right";
67623
- }
67624
- break;
67625
- case "right":
67626
- if (current === '"') {
67627
- addToLine(i5);
67628
- state2.render = "quotes";
67629
- break;
67630
- }
67631
- if (isNumber(current)) {
67632
- addToLine(i5);
67633
- state2.render = "number";
67634
- break;
67635
- }
67636
- if (current === "[" && peek === "[") {
67637
- state2.render = "section";
67638
- }
67639
- break;
67640
- case "quotes":
67641
- if (current === '"') {
67642
- addToLine(i5 + 1, brandColor);
67643
- state2.render = "right";
67644
- }
67645
- break;
67646
- case "number":
67647
- if (!isNumber(el)) {
67648
- addToLine(i5, red);
67649
- state2.render = "right";
67650
- }
67651
- break;
67652
- case "section":
67653
- if (current === "]" && prev === "]") {
67654
- addToLine(i5 + 1);
67655
- state2.render = "right";
67656
- }
67657
- }
67658
- }
67659
- switch (state2.render) {
67660
- case "left":
67661
- addToLine(el.length);
67662
- break;
67663
- case "right":
67664
- addToLine(el.length);
67665
- break;
67666
- case "quotes":
67667
- addToLine(el.length, brandColor);
67668
- break;
67669
- case "number":
67670
- addToLine(el.length, red);
67671
- break;
67672
- case "section":
67673
- addToLine(el.length, bold);
67674
- break;
67675
- }
67676
- return line;
67677
- }
67678
- function printLine(el, startWith = "", printFunc = log) {
67679
- printFunc(createLine(el, startWith));
67680
- }
67681
- function stripUndefined(r7) {
67682
- for (const k6 in r7) {
67683
- if (r7[k6] === void 0) {
67684
- delete r7[k6];
67685
- }
67686
- }
67687
- return r7;
67688
- }
67689
- function sortObjectKeys(unordered) {
67690
- if (Array.isArray(unordered)) {
67691
- return unordered;
67692
- }
67693
- return Object.keys(unordered).sort().reduce(
67694
- (obj, key) => {
67695
- obj[key] = unordered[key];
67696
- return obj;
67697
- },
67698
- {}
67699
- );
67700
- }
67701
- function sortObjectRecursive(object) {
67702
- if (typeof object !== "object") {
67703
- return object;
67704
- }
67705
- if (Array.isArray(object)) {
67706
- return object.map((obj) => sortObjectRecursive(obj));
67707
- }
67708
- const objectCopy = { ...object };
67709
- for (const [key, value] of Object.entries(object)) {
67710
- if (typeof value === "object") {
67711
- if (value === null) {
67712
- continue;
67713
- }
67714
- objectCopy[key] = sortObjectRecursive(
67715
- value
67716
- );
67717
- }
67718
- }
67719
- return sortObjectKeys(objectCopy);
67720
- }
67721
- var Diff, lineDiff;
67702
+ var Diff;
67722
67703
  var init_diff = __esm({
67723
67704
  "src/cloudchamber/helpers/diff.ts"() {
67724
67705
  init_import_meta_url();
@@ -67728,13 +67709,15 @@ var init_diff = __esm({
67728
67709
  static {
67729
67710
  __name(this, "Diff");
67730
67711
  }
67731
- diff(oldString, newString, callback) {
67732
- function done(value) {
67733
- callback(value);
67734
- return true;
67735
- }
67736
- __name(done, "done");
67737
- const newLen = newString.length, oldLen = oldString.length;
67712
+ #results = [];
67713
+ get changes() {
67714
+ return this.#results.filter((r7) => r7.added || r7.removed).length;
67715
+ }
67716
+ constructor(a5, b6) {
67717
+ const oldString = tokenize(a5);
67718
+ const newString = tokenize(b6);
67719
+ const newLen = newString.length;
67720
+ const oldLen = oldString.length;
67738
67721
  let editLength = 1;
67739
67722
  const bestPath = [
67740
67723
  { oldPos: -1, lastComponent: void 0 }
@@ -67742,23 +67725,24 @@ var init_diff = __esm({
67742
67725
  if (bestPath[0] === void 0) {
67743
67726
  throw new Error("unreachable");
67744
67727
  }
67745
- let newPos = this.extractCommon(bestPath[0], newString, oldString, 0);
67728
+ let newPos = this.#extractCommon(bestPath[0], newString, oldString, 0);
67746
67729
  if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
67747
- return done(
67748
- buildValues(
67749
- this,
67750
- bestPath[0].lastComponent,
67751
- newString,
67752
- oldString,
67753
- false
67754
- )
67730
+ this.#results = this.#buildValues(
67731
+ bestPath[0].lastComponent,
67732
+ newString,
67733
+ oldString,
67734
+ false
67755
67735
  );
67736
+ return;
67756
67737
  }
67757
- let minDiagonalToConsider = -Infinity, maxDiagonalToConsider = Infinity;
67758
- const execEditLength = /* @__PURE__ */ __name(() => {
67738
+ let minDiagonalToConsider = -Infinity;
67739
+ let maxDiagonalToConsider = Infinity;
67740
+ let done = false;
67741
+ while (!done) {
67759
67742
  for (let diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
67760
67743
  let basePath;
67761
- const removePath = bestPath[diagonalPath - 1], addPath = bestPath[diagonalPath + 1];
67744
+ const removePath = bestPath[diagonalPath - 1];
67745
+ const addPath = bestPath[diagonalPath + 1];
67762
67746
  if (removePath) {
67763
67747
  bestPath[diagonalPath - 1] = void 0;
67764
67748
  }
@@ -67773,50 +67757,88 @@ var init_diff = __esm({
67773
67757
  continue;
67774
67758
  }
67775
67759
  if (addPath && (!canRemove || canAdd && (removePath?.oldPos ?? 0) < (addPath?.oldPos ?? 0))) {
67776
- basePath = this.addToPath(addPath, true, false, 0);
67760
+ basePath = this.#addToPath(addPath, true, false, 0);
67777
67761
  } else if (removePath) {
67778
- basePath = this.addToPath(removePath, false, true, 1);
67762
+ basePath = this.#addToPath(removePath, false, true, 1);
67779
67763
  } else {
67780
67764
  throw new Error("unreachable");
67781
67765
  }
67782
- newPos = this.extractCommon(
67766
+ newPos = this.#extractCommon(
67783
67767
  basePath,
67784
67768
  newString,
67785
67769
  oldString,
67786
67770
  diagonalPath
67787
67771
  );
67788
67772
  if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
67789
- return done(
67790
- buildValues(
67791
- this,
67792
- basePath.lastComponent,
67793
- newString,
67794
- oldString,
67795
- false
67796
- )
67773
+ this.#results = this.#buildValues(
67774
+ basePath.lastComponent,
67775
+ newString,
67776
+ oldString,
67777
+ false
67797
67778
  );
67798
- } else {
67799
- bestPath[diagonalPath] = basePath;
67800
- if (basePath.oldPos + 1 >= oldLen) {
67801
- maxDiagonalToConsider = Math.min(
67802
- maxDiagonalToConsider,
67803
- diagonalPath - 1
67804
- );
67779
+ done = true;
67780
+ break;
67781
+ }
67782
+ bestPath[diagonalPath] = basePath;
67783
+ if (basePath.oldPos + 1 >= oldLen) {
67784
+ maxDiagonalToConsider = Math.min(
67785
+ maxDiagonalToConsider,
67786
+ diagonalPath - 1
67787
+ );
67788
+ }
67789
+ if (newPos + 1 >= newLen) {
67790
+ minDiagonalToConsider = Math.max(
67791
+ minDiagonalToConsider,
67792
+ diagonalPath + 1
67793
+ );
67794
+ }
67795
+ }
67796
+ editLength++;
67797
+ }
67798
+ }
67799
+ print(options = {
67800
+ contextLines: 3
67801
+ }) {
67802
+ let state2 = "init";
67803
+ const context2 = [];
67804
+ for (const result of this.#results) {
67805
+ if (result.value === void 0) {
67806
+ continue;
67807
+ }
67808
+ if (result.added || result.removed) {
67809
+ if (state2 === "diff") {
67810
+ context2.splice(0, options.contextLines).forEach((c6) => log(` ${c6}`));
67811
+ if (context2.length > options.contextLines) {
67812
+ log(" ...");
67813
+ newline();
67805
67814
  }
67806
- if (newPos + 1 >= newLen) {
67807
- minDiagonalToConsider = Math.max(
67808
- minDiagonalToConsider,
67809
- diagonalPath + 1
67810
- );
67815
+ }
67816
+ context2.splice(0, context2.length - options.contextLines);
67817
+ if (state2 === "init") {
67818
+ while (context2.length > 0 && context2[0].trim() === "") {
67819
+ context2.shift();
67811
67820
  }
67812
67821
  }
67822
+ context2.forEach((c6) => log(` ${c6}`));
67823
+ context2.length = 0;
67824
+ for (const l6 of result.value.split("\n")) {
67825
+ log(`${result.added ? green("+") : red("-")} ${l6}`);
67826
+ }
67827
+ state2 = "diff";
67828
+ } else {
67829
+ const lines = result.value.replace(/^\n|\n$/g, "").split("\n");
67830
+ context2.push(...lines);
67813
67831
  }
67814
- editLength++;
67815
- }, "execEditLength");
67816
- while (!execEditLength()) {
67832
+ }
67833
+ if (state2 === "diff") {
67834
+ context2.splice(options.contextLines);
67835
+ while (context2.length > 0 && context2[context2.length - 1].trim() === "") {
67836
+ context2.pop();
67837
+ }
67838
+ context2.forEach((c6) => log(` ${c6}`));
67817
67839
  }
67818
67840
  }
67819
- addToPath(path72, added, removed, oldPosInc) {
67841
+ #addToPath(path72, added, removed, oldPosInc) {
67820
67842
  const last = path72.lastComponent;
67821
67843
  if (last && last.added === added && last.removed === removed) {
67822
67844
  return {
@@ -67839,7 +67861,7 @@ var init_diff = __esm({
67839
67861
  }
67840
67862
  };
67841
67863
  }
67842
- extractCommon(basePath, newString, oldString, diagonalPath) {
67864
+ #extractCommon(basePath, newString, oldString, diagonalPath) {
67843
67865
  const newLen = newString.length;
67844
67866
  const oldLen = oldString.length;
67845
67867
  let oldPos = basePath.oldPos, newPos = oldPos - diagonalPath, commonCount = 0;
@@ -67859,20 +67881,91 @@ var init_diff = __esm({
67859
67881
  basePath.oldPos = oldPos;
67860
67882
  return newPos;
67861
67883
  }
67862
- equals(left2, right2) {
67863
- return left2 === right2;
67864
- }
67865
- join(chars) {
67866
- return chars.join("");
67884
+ #buildValues(lastComponent, newString, oldString, useLongestToken) {
67885
+ const components = [];
67886
+ let nextComponent;
67887
+ while (lastComponent) {
67888
+ components.push(lastComponent);
67889
+ nextComponent = lastComponent.previousComponent;
67890
+ delete lastComponent.previousComponent;
67891
+ lastComponent = nextComponent;
67892
+ }
67893
+ components.reverse();
67894
+ const componentLen = components.length;
67895
+ let componentPos = 0, newPos = 0, oldPos = 0;
67896
+ for (; componentPos < componentLen; componentPos++) {
67897
+ const component = components[componentPos];
67898
+ if (!component.removed) {
67899
+ if (!component.added && useLongestToken) {
67900
+ let value = newString.slice(newPos, newPos + component.count);
67901
+ value = value.map((el, i5) => {
67902
+ const oldValue = oldString[oldPos + i5];
67903
+ return oldValue.length > el.length ? oldValue : el;
67904
+ });
67905
+ component.value = value.join("");
67906
+ } else {
67907
+ component.value = newString.slice(newPos, newPos + component.count).join("");
67908
+ }
67909
+ newPos += component.count;
67910
+ if (!component.added) {
67911
+ oldPos += component.count;
67912
+ }
67913
+ } else {
67914
+ component.value = oldString.slice(oldPos, oldPos + component.count).join("");
67915
+ oldPos += component.count;
67916
+ }
67917
+ }
67918
+ return components;
67867
67919
  }
67868
67920
  };
67869
- __name(buildValues, "buildValues");
67870
- lineDiff = new Diff();
67871
67921
  __name(tokenize, "tokenize");
67872
- __name(diffLines, "diffLines");
67873
- __name(isNumber, "isNumber");
67874
- __name(createLine, "createLine");
67875
- __name(printLine, "printLine");
67922
+ }
67923
+ });
67924
+
67925
+ // src/utils/sortObjectRecursive.ts
67926
+ function stripUndefined(r7) {
67927
+ for (const k6 in r7) {
67928
+ if (r7[k6] === void 0) {
67929
+ delete r7[k6];
67930
+ }
67931
+ }
67932
+ return r7;
67933
+ }
67934
+ function sortObjectKeys(unordered) {
67935
+ if (Array.isArray(unordered)) {
67936
+ return unordered;
67937
+ }
67938
+ return Object.keys(unordered).sort().reduce(
67939
+ (obj, key) => {
67940
+ obj[key] = unordered[key];
67941
+ return obj;
67942
+ },
67943
+ {}
67944
+ );
67945
+ }
67946
+ function sortObjectRecursive(object) {
67947
+ if (typeof object !== "object") {
67948
+ return object;
67949
+ }
67950
+ if (Array.isArray(object)) {
67951
+ return object.map((obj) => sortObjectRecursive(obj));
67952
+ }
67953
+ const objectCopy = { ...object };
67954
+ for (const [key, value] of Object.entries(object)) {
67955
+ if (typeof value === "object") {
67956
+ if (value === null) {
67957
+ continue;
67958
+ }
67959
+ objectCopy[key] = sortObjectRecursive(
67960
+ value
67961
+ );
67962
+ }
67963
+ }
67964
+ return sortObjectKeys(objectCopy);
67965
+ }
67966
+ var init_sortObjectRecursive = __esm({
67967
+ "src/utils/sortObjectRecursive.ts"() {
67968
+ init_import_meta_url();
67876
67969
  __name(stripUndefined, "stripUndefined");
67877
67970
  __name(sortObjectKeys, "sortObjectKeys");
67878
67971
  __name(sortObjectRecursive, "sortObjectRecursive");
@@ -68069,9 +68162,8 @@ async function apply(args, config) {
68069
68162
  { containers: [nowContainer] },
68070
68163
  config.configPath
68071
68164
  );
68072
- const results = diffLines(prev, now);
68073
- const changes = results.find((l6) => l6.added || l6.removed) !== void 0;
68074
- if (!changes) {
68165
+ const diff = new Diff(prev, now);
68166
+ if (diff.changes === 0) {
68075
68167
  updateStatus(`no changes ${brandColor(application.name)}`);
68076
68168
  continue;
68077
68169
  }
@@ -68079,61 +68171,9 @@ async function apply(args, config) {
68079
68171
  `${brandColor.underline("EDIT")} ${application.name}`,
68080
68172
  false
68081
68173
  );
68082
- let printedLines = [];
68083
- let printedDiff = false;
68084
- const printContext = /* @__PURE__ */ __name(() => {
68085
- let index = 0;
68086
- for (let i5 = printedLines.length - 1; i5 >= 0; i5--) {
68087
- if (printedLines[i5].trim().startsWith("[")) {
68088
- log("");
68089
- index = i5;
68090
- break;
68091
- }
68092
- }
68093
- for (let i5 = index; i5 < printedLines.length; i5++) {
68094
- log(printedLines[i5]);
68095
- if (printedLines.length - i5 > 2) {
68096
- i5 = printedLines.length - 2;
68097
- printLine(dim("..."), " ");
68098
- }
68099
- }
68100
- printedLines = [];
68101
- }, "printContext");
68102
- for (const lines of results) {
68103
- const trimmedLines = (lines.value ?? "").split("\n").map((e7) => e7.trim()).filter((e7) => e7 !== "");
68104
- for (const l6 of trimmedLines) {
68105
- if (lines.added) {
68106
- printContext();
68107
- if (l6.startsWith("[")) {
68108
- printLine("");
68109
- }
68110
- printedDiff = true;
68111
- printLine(l6, green("+ "));
68112
- } else if (lines.removed) {
68113
- printContext();
68114
- if (l6.startsWith("[")) {
68115
- printLine("");
68116
- }
68117
- printedDiff = true;
68118
- printLine(l6, red("- "));
68119
- } else {
68120
- if (printedDiff) {
68121
- let printDots = false;
68122
- if (l6.startsWith("[")) {
68123
- printLine("");
68124
- printDots = true;
68125
- }
68126
- printedDiff = false;
68127
- printLine(l6, " ");
68128
- if (printDots) {
68129
- printLine(dim("..."), " ");
68130
- }
68131
- continue;
68132
- }
68133
- printedLines.push(createLine(l6, " "));
68134
- }
68135
- }
68136
- }
68174
+ newline();
68175
+ diff.print();
68176
+ newline();
68137
68177
  if (appConfigNoDefaults.rollout_kind !== "none") {
68138
68178
  actions.push({
68139
68179
  action: "modify",
@@ -68145,8 +68185,8 @@ async function apply(args, config) {
68145
68185
  });
68146
68186
  } else {
68147
68187
  log("Skipping application rollout");
68188
+ newline();
68148
68189
  }
68149
- printLine("");
68150
68190
  continue;
68151
68191
  }
68152
68192
  updateStatus(bold.underline(green.underline("NEW")) + ` ${appConfig.name}`);
@@ -68164,9 +68204,8 @@ async function apply(args, config) {
68164
68204
  },
68165
68205
  config.configPath
68166
68206
  );
68167
- s5.split("\n").map((line) => line.trim()).forEach((el) => {
68168
- printLine(el, " ");
68169
- });
68207
+ s5.trimEnd().split("\n").forEach((el) => log(` ${el}`));
68208
+ newline();
68170
68209
  const configToPush = { ...appConfig };
68171
68210
  actions.push({
68172
68211
  action: "create",
@@ -68226,7 +68265,6 @@ ${formatError(err)}`
68226
68265
  shape: shapes.bar
68227
68266
  }
68228
68267
  );
68229
- printLine("");
68230
68268
  continue;
68231
68269
  }
68232
68270
  if (action.action === "modify") {
@@ -68298,10 +68336,10 @@ ${err.message}`
68298
68336
  success(`Modified application ${brandColor(action.name)}`, {
68299
68337
  shape: shapes.bar
68300
68338
  });
68301
- printLine("");
68302
68339
  continue;
68303
68340
  }
68304
68341
  }
68342
+ newline();
68305
68343
  endSection("Applied changes");
68306
68344
  }
68307
68345
  var init_deploy = __esm({
@@ -68315,6 +68353,7 @@ var init_deploy = __esm({
68315
68353
  init_config2();
68316
68354
  init_errors();
68317
68355
  init_user2();
68356
+ init_sortObjectRecursive();
68318
68357
  __name(mergeDeep2, "mergeDeep");
68319
68358
  __name(isObject, "isObject");
68320
68359
  __name(createApplicationToModifyApplication, "createApplicationToModifyApplication");
@@ -68854,6 +68893,21 @@ async function listKVNamespaceKeys(complianceConfig, accountId, namespaceId, pre
68854
68893
  new import_node_url8.URLSearchParams({ prefix })
68855
68894
  );
68856
68895
  }
68896
+ async function updateKVNamespace(complianceConfig, accountId, namespaceId, title) {
68897
+ return await fetchResult(
68898
+ complianceConfig,
68899
+ `/accounts/${accountId}/storage/kv/namespaces/${namespaceId}`,
68900
+ {
68901
+ method: "PUT",
68902
+ headers: {
68903
+ "Content-Type": "application/json"
68904
+ },
68905
+ body: JSON.stringify({
68906
+ title
68907
+ })
68908
+ }
68909
+ );
68910
+ }
68857
68911
  async function deleteKVNamespace(complianceConfig, accountId, namespaceId) {
68858
68912
  return await fetchResult(
68859
68913
  complianceConfig,
@@ -69079,6 +69133,7 @@ var init_helpers4 = __esm({
69079
69133
  __name(createKVNamespace, "createKVNamespace");
69080
69134
  __name(listKVNamespaces, "listKVNamespaces");
69081
69135
  __name(listKVNamespaceKeys, "listKVNamespaceKeys");
69136
+ __name(updateKVNamespace, "updateKVNamespace");
69082
69137
  __name(deleteKVNamespace, "deleteKVNamespace");
69083
69138
  KeyValueKeys = /* @__PURE__ */ new Set([
69084
69139
  "key",
@@ -69138,7 +69193,10 @@ async function getPackageManager() {
69138
69193
  return { ...PnpmPackageManager };
69139
69194
  } else {
69140
69195
  throw new UserError(
69141
- "Unable to find a package manager. Supported managers are: npm, yarn, and pnpm."
69196
+ "Unable to find a package manager. Supported managers are: npm, yarn, and pnpm.",
69197
+ {
69198
+ telemetryMessage: true
69199
+ }
69142
69200
  );
69143
69201
  }
69144
69202
  }
@@ -69250,7 +69308,7 @@ function getMetricsConfig({
69250
69308
  const sendMetricsEnv = getWranglerSendMetricsFromEnv();
69251
69309
  if (sendMetricsEnv !== void 0) {
69252
69310
  return {
69253
- enabled: sendMetricsEnv.toLowerCase() === "true",
69311
+ enabled: sendMetricsEnv,
69254
69312
  deviceId
69255
69313
  };
69256
69314
  }
@@ -79796,9 +79854,7 @@ async function apply2(args, config) {
79796
79854
  const endConfig = args.env !== void 0 ? {
79797
79855
  env: { [args.env]: { containers: [configuration] } }
79798
79856
  } : { containers: [configuration] };
79799
- formatConfigSnippet(endConfig, config.configPath).split("\n").forEach((el) => {
79800
- printLine(el, " ", logRaw);
79801
- });
79857
+ formatConfigSnippet(endConfig, config.configPath).split("\n").forEach((el) => logRaw(` ${el}`));
79802
79858
  return;
79803
79859
  }
79804
79860
  const applications = await promiseSpinner(
@@ -79858,9 +79914,8 @@ async function apply2(args, config) {
79858
79914
  { containers: [nowContainer] },
79859
79915
  config.configPath
79860
79916
  );
79861
- const results = diffLines(prev, now);
79862
- const changes = results.find((l6) => l6.added || l6.removed) !== void 0;
79863
- if (!changes) {
79917
+ const diff = new Diff(prev, now);
79918
+ if (diff.changes === 0) {
79864
79919
  updateStatus(`no changes ${brandColor(application.name)}`);
79865
79920
  continue;
79866
79921
  }
@@ -79868,61 +79923,9 @@ async function apply2(args, config) {
79868
79923
  `${brandColor.underline("EDIT")} ${application.name}`,
79869
79924
  false
79870
79925
  );
79871
- let printedLines = [];
79872
- let printedDiff = false;
79873
- const printContext = /* @__PURE__ */ __name(() => {
79874
- let index = 0;
79875
- for (let i5 = printedLines.length - 1; i5 >= 0; i5--) {
79876
- if (printedLines[i5].trim().startsWith("[")) {
79877
- log("");
79878
- index = i5;
79879
- break;
79880
- }
79881
- }
79882
- for (let i5 = index; i5 < printedLines.length; i5++) {
79883
- log(printedLines[i5]);
79884
- if (printedLines.length - i5 > 2) {
79885
- i5 = printedLines.length - 2;
79886
- printLine(dim("..."), " ");
79887
- }
79888
- }
79889
- printedLines = [];
79890
- }, "printContext");
79891
- for (const lines of results) {
79892
- const trimmedLines = (lines.value ?? "").split("\n").map((e7) => e7.trim()).filter((e7) => e7 !== "");
79893
- for (const l6 of trimmedLines) {
79894
- if (lines.added) {
79895
- printContext();
79896
- if (l6.startsWith("[")) {
79897
- printLine("");
79898
- }
79899
- printedDiff = true;
79900
- printLine(l6, green("+ "));
79901
- } else if (lines.removed) {
79902
- printContext();
79903
- if (l6.startsWith("[")) {
79904
- printLine("");
79905
- }
79906
- printedDiff = true;
79907
- printLine(l6, red("- "));
79908
- } else {
79909
- if (printedDiff) {
79910
- let printDots = false;
79911
- if (l6.startsWith("[")) {
79912
- printLine("");
79913
- printDots = true;
79914
- }
79915
- printedDiff = false;
79916
- printLine(l6, " ");
79917
- if (printDots) {
79918
- printLine(dim("..."), " ");
79919
- }
79920
- continue;
79921
- }
79922
- printedLines.push(createLine(l6, " "));
79923
- }
79924
- }
79925
- }
79926
+ newline();
79927
+ diff.print();
79928
+ newline();
79926
79929
  if (appConfigNoDefaults.rollout_kind !== "none") {
79927
79930
  actions.push({
79928
79931
  action: "modify",
@@ -79934,8 +79937,8 @@ async function apply2(args, config) {
79934
79937
  });
79935
79938
  } else {
79936
79939
  log("Skipping application rollout");
79940
+ newline();
79937
79941
  }
79938
- printLine("");
79939
79942
  continue;
79940
79943
  }
79941
79944
  updateStatus(bold.underline(green.underline("NEW")) + ` ${appConfig.name}`);
@@ -79953,9 +79956,8 @@ async function apply2(args, config) {
79953
79956
  },
79954
79957
  config.configPath
79955
79958
  );
79956
- s5.split("\n").map((line) => line.trim()).forEach((el) => {
79957
- printLine(el, " ");
79958
- });
79959
+ s5.trimEnd().split("\n").forEach((el) => log(` ${el}`));
79960
+ newline();
79959
79961
  const configToPush = { ...appConfig };
79960
79962
  actions.push({
79961
79963
  action: "create",
@@ -80015,7 +80017,6 @@ ${formatError(err)}`
80015
80017
  shape: shapes.bar
80016
80018
  }
80017
80019
  );
80018
- printLine("");
80019
80020
  continue;
80020
80021
  }
80021
80022
  if (action.action === "modify") {
@@ -80087,10 +80088,10 @@ ${err.message}`
80087
80088
  success(`Modified application ${brandColor(action.name)}`, {
80088
80089
  shape: shapes.bar
80089
80090
  });
80090
- printLine("");
80091
80091
  continue;
80092
80092
  }
80093
80093
  }
80094
+ newline();
80094
80095
  endSection("Applied changes");
80095
80096
  }
80096
80097
  async function applyCommand(args, config) {
@@ -80114,6 +80115,7 @@ var init_apply = __esm({
80114
80115
  init_config2();
80115
80116
  init_errors();
80116
80117
  init_user2();
80118
+ init_sortObjectRecursive();
80117
80119
  init_common();
80118
80120
  init_diff();
80119
80121
  __name(mergeDeep3, "mergeDeep");
@@ -81304,7 +81306,7 @@ async function read(stream2) {
81304
81306
  return Buffer.concat(chunks).toString("utf8");
81305
81307
  }
81306
81308
  async function requestFromCmd(args, _config) {
81307
- const requestId = `wrangler-${(0, import_crypto.randomUUID)()}`;
81309
+ const requestId = `wrangler-${(0, import_crypto2.randomUUID)()}`;
81308
81310
  if (args.verbose && !args.silent) {
81309
81311
  logRaw(bold(brandColor("Request ID: " + requestId)));
81310
81312
  }
@@ -81372,11 +81374,11 @@ async function requestFromCmd(args, _config) {
81372
81374
  }
81373
81375
  }
81374
81376
  }
81375
- var import_crypto;
81377
+ var import_crypto2;
81376
81378
  var init_curl = __esm({
81377
81379
  "src/cloudchamber/curl.ts"() {
81378
81380
  init_import_meta_url();
81379
- import_crypto = require("crypto");
81381
+ import_crypto2 = require("crypto");
81380
81382
  init_cli();
81381
81383
  init_colors();
81382
81384
  init_containers_shared();
@@ -84965,7 +84967,8 @@ async function getEntry(args, config, command2) {
84965
84967
  } else {
84966
84968
  if (config.pages_build_output_dir && command2 === "dev") {
84967
84969
  throw new UserError(
84968
- "It looks like you've run a Workers-specific command in a Pages project.\nFor Pages, please run `wrangler pages dev` instead."
84970
+ "It looks like you've run a Workers-specific command in a Pages project.\nFor Pages, please run `wrangler pages dev` instead.",
84971
+ { telemetryMessage: true }
84969
84972
  );
84970
84973
  }
84971
84974
  const compatibilityDateStr = [
@@ -85027,7 +85030,8 @@ async function getEntry(args, config, command2) {
85027
85030
  ${addScriptName}
85028
85031
  ${addScriptNameExamples}
85029
85032
  ${migrateText}
85030
- ${migrateUrl}`
85033
+ ${migrateUrl}`,
85034
+ { telemetryMessage: "tried to use DO with service worker" }
85031
85035
  );
85032
85036
  }
85033
85037
  return {
@@ -85463,7 +85467,8 @@ var init_deploy4 = __esm({
85463
85467
  validateArgs(args) {
85464
85468
  if (args.nodeCompat) {
85465
85469
  throw new UserError(
85466
- `The --node-compat flag is no longer supported as of Wrangler v4. Instead, use the \`nodejs_compat\` compatibility flag. This includes the functionality from legacy \`node_compat\` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.`
85470
+ `The --node-compat flag is no longer supported as of Wrangler v4. Instead, use the \`nodejs_compat\` compatibility flag. This includes the functionality from legacy \`node_compat\` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.`,
85471
+ { telemetryMessage: true }
85467
85472
  );
85468
85473
  }
85469
85474
  },
@@ -87712,7 +87717,10 @@ var init_init = __esm({
87712
87717
  } catch (err) {
87713
87718
  if (err.code === 10090) {
87714
87719
  throw new UserError(
87715
- "wrangler couldn't find a Worker with that name in your account.\nRun `wrangler whoami` to confirm you're logged into the correct account."
87720
+ "wrangler couldn't find a Worker with that name in your account.\nRun `wrangler whoami` to confirm you're logged into the correct account.",
87721
+ {
87722
+ telemetryMessage: true
87723
+ }
87716
87724
  );
87717
87725
  }
87718
87726
  throw err;
@@ -87782,10 +87790,11 @@ var init_getValidBindingName = __esm({
87782
87790
  });
87783
87791
 
87784
87792
  // src/kv/index.ts
87785
- var import_node_buffer4, import_consumers, import_node_string_decoder, kvNamespace, kvNamespaceNamespace, kvKeyNamespace, kvBulkNamespace, kvNamespaceCreateCommand, kvNamespaceListCommand, kvNamespaceDeleteCommand, kvKeyPutCommand, kvKeyListCommand, kvKeyGetCommand, kvKeyDeleteCommand, kvBulkGetCommand, kvBulkPutCommand, kvBulkDeleteCommand;
87793
+ var import_node_assert20, import_node_buffer4, import_consumers, import_node_string_decoder, kvNamespace, kvNamespaceNamespace, kvKeyNamespace, kvBulkNamespace, kvNamespaceCreateCommand, kvNamespaceListCommand, kvNamespaceDeleteCommand, kvNamespaceRenameCommand, kvKeyPutCommand, kvKeyListCommand, kvKeyGetCommand, kvKeyDeleteCommand, kvBulkGetCommand, kvBulkPutCommand, kvBulkDeleteCommand;
87786
87794
  var init_kv = __esm({
87787
87795
  "src/kv/index.ts"() {
87788
87796
  init_import_meta_url();
87797
+ import_node_assert20 = require("assert");
87789
87798
  import_node_buffer4 = require("buffer");
87790
87799
  import_consumers = require("stream/consumers");
87791
87800
  import_node_string_decoder = require("string_decoder");
@@ -87944,6 +87953,73 @@ var init_kv = __esm({
87944
87953
  });
87945
87954
  }
87946
87955
  });
87956
+ kvNamespaceRenameCommand = createCommand({
87957
+ metadata: {
87958
+ description: "Rename a KV namespace",
87959
+ status: "stable",
87960
+ owner: "Product: KV"
87961
+ },
87962
+ positionalArgs: ["old-name"],
87963
+ args: {
87964
+ "old-name": {
87965
+ type: "string",
87966
+ describe: "The current name (title) of the namespace to rename"
87967
+ },
87968
+ "namespace-id": {
87969
+ type: "string",
87970
+ describe: "The id of the namespace to rename"
87971
+ },
87972
+ "new-name": {
87973
+ type: "string",
87974
+ describe: "The new name for the namespace",
87975
+ demandOption: true
87976
+ }
87977
+ },
87978
+ validateArgs(args) {
87979
+ if (args.oldName && args.namespaceId) {
87980
+ throw new CommandLineArgsError(
87981
+ "Cannot specify both old-name and --namespace-id. Use either old-name (as first argument) or --namespace-id flag, not both."
87982
+ );
87983
+ }
87984
+ if (!args.namespaceId && !args.oldName) {
87985
+ throw new CommandLineArgsError(
87986
+ "Either old-name (as first argument) or --namespace-id must be specified"
87987
+ );
87988
+ }
87989
+ if (args.newName && args.newName.length > 512) {
87990
+ throw new CommandLineArgsError(
87991
+ `new-name must be 512 characters or less (current: ${args.newName.length})`
87992
+ );
87993
+ }
87994
+ },
87995
+ async handler(args) {
87996
+ const config = readConfig(args);
87997
+ printResourceLocation("remote");
87998
+ const accountId = await requireAuth(config);
87999
+ let namespaceId = args.namespaceId;
88000
+ if (!namespaceId && args.oldName) {
88001
+ const namespaces = await listKVNamespaces(config, accountId);
88002
+ const namespace = namespaces.find((ns) => ns.title === args.oldName);
88003
+ if (!namespace) {
88004
+ throw new UserError(
88005
+ `No namespace found with the name "${args.oldName}". Use --namespace-id instead or check available namespaces with "wrangler kv namespace list".`
88006
+ );
88007
+ }
88008
+ namespaceId = namespace.id;
88009
+ }
88010
+ (0, import_node_assert20.strict)(namespaceId, "namespaceId should be defined");
88011
+ logger.log(`Renaming KV namespace ${namespaceId} to "${args.newName}".`);
88012
+ const updatedNamespace = await updateKVNamespace(
88013
+ config,
88014
+ accountId,
88015
+ namespaceId,
88016
+ args.newName
88017
+ );
88018
+ logger.log(
88019
+ `\u2728 Successfully renamed namespace to "${updatedNamespace.title}"`
88020
+ );
88021
+ }
88022
+ });
87947
88023
  kvKeyPutCommand = createCommand({
87948
88024
  metadata: {
87949
88025
  description: "Write a single key/value pair to the given namespace",
@@ -88751,7 +88827,7 @@ var init_commands = __esm({
88751
88827
  const savedConfig = readMetricsConfig();
88752
88828
  const sendMetricsEnv = getWranglerSendMetricsFromEnv();
88753
88829
  if (config.send_metrics !== void 0 || sendMetricsEnv !== void 0) {
88754
- const resolvedPermission = sendMetricsEnv !== void 0 ? sendMetricsEnv === "true" : config.send_metrics;
88830
+ const resolvedPermission = sendMetricsEnv ?? config.send_metrics;
88755
88831
  logger.log(
88756
88832
  `Status: ${resolvedPermission ? source_default.green("Enabled") : source_default.red("Disabled")} (set by ${sendMetricsEnv !== void 0 ? "environment variable" : "wrangler.toml"})
88757
88833
  `
@@ -93145,9 +93221,9 @@ var require_ms = __commonJS({
93145
93221
  }
93146
93222
  });
93147
93223
 
93148
- // ../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/common.js
93224
+ // ../../node_modules/.pnpm/debug@4.4.1_patch_hash=zevdllrsa2u6cp4b3ivya5dqsa_supports-color@9.2.2/node_modules/debug/src/common.js
93149
93225
  var require_common = __commonJS({
93150
- "../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/common.js"(exports2, module3) {
93226
+ "../../node_modules/.pnpm/debug@4.4.1_patch_hash=zevdllrsa2u6cp4b3ivya5dqsa_supports-color@9.2.2/node_modules/debug/src/common.js"(exports2, module3) {
93151
93227
  init_import_meta_url();
93152
93228
  function setup(env6) {
93153
93229
  createDebug.debug = createDebug;
@@ -93253,54 +93329,68 @@ var require_common = __commonJS({
93253
93329
  createDebug.namespaces = namespaces;
93254
93330
  createDebug.names = [];
93255
93331
  createDebug.skips = [];
93256
- let i5;
93257
- const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
93258
- const len = split.length;
93259
- for (i5 = 0; i5 < len; i5++) {
93260
- if (!split[i5]) {
93261
- continue;
93262
- }
93263
- namespaces = split[i5].replace(/\*/g, ".*?");
93264
- if (namespaces[0] === "-") {
93265
- createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
93332
+ const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
93333
+ for (const ns of split) {
93334
+ if (ns[0] === "-") {
93335
+ createDebug.skips.push(ns.slice(1));
93266
93336
  } else {
93267
- createDebug.names.push(new RegExp("^" + namespaces + "$"));
93337
+ createDebug.names.push(ns);
93268
93338
  }
93269
93339
  }
93270
93340
  }
93271
93341
  __name(enable, "enable");
93342
+ function matchesTemplate(search, template) {
93343
+ let searchIndex = 0;
93344
+ let templateIndex = 0;
93345
+ let starIndex = -1;
93346
+ let matchIndex = 0;
93347
+ while (searchIndex < search.length) {
93348
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
93349
+ if (template[templateIndex] === "*") {
93350
+ starIndex = templateIndex;
93351
+ matchIndex = searchIndex;
93352
+ templateIndex++;
93353
+ } else {
93354
+ searchIndex++;
93355
+ templateIndex++;
93356
+ }
93357
+ } else if (starIndex !== -1) {
93358
+ templateIndex = starIndex + 1;
93359
+ matchIndex++;
93360
+ searchIndex = matchIndex;
93361
+ } else {
93362
+ return false;
93363
+ }
93364
+ }
93365
+ while (templateIndex < template.length && template[templateIndex] === "*") {
93366
+ templateIndex++;
93367
+ }
93368
+ return templateIndex === template.length;
93369
+ }
93370
+ __name(matchesTemplate, "matchesTemplate");
93272
93371
  function disable() {
93273
93372
  const namespaces = [
93274
- ...createDebug.names.map(toNamespace),
93275
- ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
93373
+ ...createDebug.names,
93374
+ ...createDebug.skips.map((namespace) => "-" + namespace)
93276
93375
  ].join(",");
93277
93376
  createDebug.enable("");
93278
93377
  return namespaces;
93279
93378
  }
93280
93379
  __name(disable, "disable");
93281
93380
  function enabled(name2) {
93282
- if (name2[name2.length - 1] === "*") {
93283
- return true;
93284
- }
93285
- let i5;
93286
- let len;
93287
- for (i5 = 0, len = createDebug.skips.length; i5 < len; i5++) {
93288
- if (createDebug.skips[i5].test(name2)) {
93381
+ for (const skip of createDebug.skips) {
93382
+ if (matchesTemplate(name2, skip)) {
93289
93383
  return false;
93290
93384
  }
93291
93385
  }
93292
- for (i5 = 0, len = createDebug.names.length; i5 < len; i5++) {
93293
- if (createDebug.names[i5].test(name2)) {
93386
+ for (const ns of createDebug.names) {
93387
+ if (matchesTemplate(name2, ns)) {
93294
93388
  return true;
93295
93389
  }
93296
93390
  }
93297
93391
  return false;
93298
93392
  }
93299
93393
  __name(enabled, "enabled");
93300
- function toNamespace(regexp) {
93301
- return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
93302
- }
93303
- __name(toNamespace, "toNamespace");
93304
93394
  function coerce2(val2) {
93305
93395
  if (val2 instanceof Error) {
93306
93396
  return val2.stack || val2.message;
@@ -93320,9 +93410,9 @@ var require_common = __commonJS({
93320
93410
  }
93321
93411
  });
93322
93412
 
93323
- // ../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/browser.js
93413
+ // ../../node_modules/.pnpm/debug@4.4.1_patch_hash=zevdllrsa2u6cp4b3ivya5dqsa_supports-color@9.2.2/node_modules/debug/src/browser.js
93324
93414
  var require_browser = __commonJS({
93325
- "../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/browser.js"(exports2, module3) {
93415
+ "../../node_modules/.pnpm/debug@4.4.1_patch_hash=zevdllrsa2u6cp4b3ivya5dqsa_supports-color@9.2.2/node_modules/debug/src/browser.js"(exports2, module3) {
93326
93416
  init_import_meta_url();
93327
93417
  exports2.formatArgs = formatArgs;
93328
93418
  exports2.save = save;
@@ -93468,7 +93558,7 @@ var require_browser = __commonJS({
93468
93558
  function load() {
93469
93559
  let r7;
93470
93560
  try {
93471
- r7 = exports2.storage.getItem("debug");
93561
+ r7 = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
93472
93562
  } catch (error2) {
93473
93563
  }
93474
93564
  if (!r7 && typeof process !== "undefined" && "env" in process) {
@@ -93496,9 +93586,9 @@ var require_browser = __commonJS({
93496
93586
  }
93497
93587
  });
93498
93588
 
93499
- // ../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/node.js
93589
+ // ../../node_modules/.pnpm/debug@4.4.1_patch_hash=zevdllrsa2u6cp4b3ivya5dqsa_supports-color@9.2.2/node_modules/debug/src/node.js
93500
93590
  var require_node4 = __commonJS({
93501
- "../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/node.js"(exports2, module3) {
93591
+ "../../node_modules/.pnpm/debug@4.4.1_patch_hash=zevdllrsa2u6cp4b3ivya5dqsa_supports-color@9.2.2/node_modules/debug/src/node.js"(exports2, module3) {
93502
93592
  init_import_meta_url();
93503
93593
  var tty3 = require("tty");
93504
93594
  var util5 = require("util");
@@ -93678,9 +93768,9 @@ var require_node4 = __commonJS({
93678
93768
  }
93679
93769
  });
93680
93770
 
93681
- // ../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/index.js
93771
+ // ../../node_modules/.pnpm/debug@4.4.1_patch_hash=zevdllrsa2u6cp4b3ivya5dqsa_supports-color@9.2.2/node_modules/debug/src/index.js
93682
93772
  var require_src3 = __commonJS({
93683
- "../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/index.js"(exports2, module3) {
93773
+ "../../node_modules/.pnpm/debug@4.4.1_patch_hash=zevdllrsa2u6cp4b3ivya5dqsa_supports-color@9.2.2/node_modules/debug/src/index.js"(exports2, module3) {
93684
93774
  init_import_meta_url();
93685
93775
  if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
93686
93776
  module3.exports = require_browser();
@@ -108426,15 +108516,15 @@ var init_getProfileName = __esm({
108426
108516
  });
108427
108517
 
108428
108518
  // ../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js
108429
- var import_crypto2, import_path19, getSSOTokenFilepath;
108519
+ var import_crypto3, import_path19, getSSOTokenFilepath;
108430
108520
  var init_getSSOTokenFilepath = __esm({
108431
108521
  "../../node_modules/.pnpm/@smithy+shared-ini-file-loader@3.1.12/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js"() {
108432
108522
  init_import_meta_url();
108433
- import_crypto2 = require("crypto");
108523
+ import_crypto3 = require("crypto");
108434
108524
  import_path19 = require("path");
108435
108525
  init_getHomeDir();
108436
108526
  getSSOTokenFilepath = /* @__PURE__ */ __name((id) => {
108437
- const hasher = (0, import_crypto2.createHash)("sha1");
108527
+ const hasher = (0, import_crypto3.createHash)("sha1");
108438
108528
  const cacheName = hasher.update(id).digest("hex");
108439
108529
  return (0, import_path19.join)(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`);
108440
108530
  }, "getSSOTokenFilepath");
@@ -109448,16 +109538,16 @@ var init_dist_es44 = __esm({
109448
109538
  // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/rng.js
109449
109539
  function rng() {
109450
109540
  if (poolPtr > rnds8Pool.length - 16) {
109451
- import_crypto3.default.randomFillSync(rnds8Pool);
109541
+ import_crypto4.default.randomFillSync(rnds8Pool);
109452
109542
  poolPtr = 0;
109453
109543
  }
109454
109544
  return rnds8Pool.slice(poolPtr, poolPtr += 16);
109455
109545
  }
109456
- var import_crypto3, rnds8Pool, poolPtr;
109546
+ var import_crypto4, rnds8Pool, poolPtr;
109457
109547
  var init_rng = __esm({
109458
109548
  "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/rng.js"() {
109459
109549
  init_import_meta_url();
109460
- import_crypto3 = __toESM(require("crypto"));
109550
+ import_crypto4 = __toESM(require("crypto"));
109461
109551
  rnds8Pool = new Uint8Array(256);
109462
109552
  poolPtr = rnds8Pool.length;
109463
109553
  __name(rng, "rng");
@@ -109481,13 +109571,13 @@ var init_stringify = __esm({
109481
109571
  });
109482
109572
 
109483
109573
  // ../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/native.js
109484
- var import_crypto4, native_default;
109574
+ var import_crypto5, native_default;
109485
109575
  var init_native = __esm({
109486
109576
  "../../node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/native.js"() {
109487
109577
  init_import_meta_url();
109488
- import_crypto4 = __toESM(require("crypto"));
109578
+ import_crypto5 = __toESM(require("crypto"));
109489
109579
  native_default = {
109490
- randomUUID: import_crypto4.default.randomUUID
109580
+ randomUUID: import_crypto5.default.randomUUID
109491
109581
  };
109492
109582
  }
109493
109583
  });
@@ -119611,14 +119701,14 @@ function castSourceData(toCast, encoding) {
119611
119701
  }
119612
119702
  return fromArrayBuffer(toCast);
119613
119703
  }
119614
- var import_buffer4, import_crypto5, Hash;
119704
+ var import_buffer4, import_crypto6, Hash;
119615
119705
  var init_dist_es52 = __esm({
119616
119706
  "../../node_modules/.pnpm/@smithy+hash-node@3.0.11/node_modules/@smithy/hash-node/dist-es/index.js"() {
119617
119707
  init_import_meta_url();
119618
119708
  init_dist_es7();
119619
119709
  init_dist_es8();
119620
119710
  import_buffer4 = require("buffer");
119621
- import_crypto5 = require("crypto");
119711
+ import_crypto6 = require("crypto");
119622
119712
  Hash = class {
119623
119713
  static {
119624
119714
  __name(this, "Hash");
@@ -119635,7 +119725,7 @@ var init_dist_es52 = __esm({
119635
119725
  return Promise.resolve(this.hash.digest());
119636
119726
  }
119637
119727
  reset() {
119638
- this.hash = this.secret ? (0, import_crypto5.createHmac)(this.algorithmIdentifier, castSourceData(this.secret)) : (0, import_crypto5.createHash)(this.algorithmIdentifier);
119728
+ this.hash = this.secret ? (0, import_crypto6.createHmac)(this.algorithmIdentifier, castSourceData(this.secret)) : (0, import_crypto6.createHash)(this.algorithmIdentifier);
119639
119729
  }
119640
119730
  };
119641
119731
  __name(castSourceData, "castSourceData");
@@ -129754,7 +129844,7 @@ async function generateR2ServiceToken(accountId, bucketName, pipelineName) {
129754
129844
  const timeoutPromise = (0, import_promises26.setTimeout)(12e4, "timeout", { signal });
129755
129845
  const serverPromise = new Promise((resolve24, reject) => {
129756
129846
  const server = import_node_http2.default.createServer(async (request4, response) => {
129757
- (0, import_node_assert20.default)(request4.url, "This request doesn't have a URL");
129847
+ (0, import_node_assert21.default)(request4.url, "This request doesn't have a URL");
129758
129848
  if (request4.method !== "GET") {
129759
129849
  response.writeHead(405);
129760
129850
  response.end("Method not allowed.");
@@ -129856,11 +129946,11 @@ async function deletePipeline(complianceConfig, accountId, name2) {
129856
129946
  }
129857
129947
  );
129858
129948
  }
129859
- var import_node_assert20, import_node_crypto10, import_node_http2, import_promises26, API_HEADERS;
129949
+ var import_node_assert21, import_node_crypto10, import_node_http2, import_promises26, API_HEADERS;
129860
129950
  var init_client7 = __esm({
129861
129951
  "src/pipelines/client.ts"() {
129862
129952
  init_import_meta_url();
129863
- import_node_assert20 = __toESM(require("assert"));
129953
+ import_node_assert21 = __toESM(require("assert"));
129864
129954
  import_node_crypto10 = require("crypto");
129865
129955
  import_node_http2 = __toESM(require("http"));
129866
129956
  import_promises26 = require("timers/promises");
@@ -143108,565 +143198,6 @@ var init_client9 = __esm({
143108
143198
  }
143109
143199
  });
143110
143200
 
143111
- // ../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/common.js
143112
- var require_common2 = __commonJS({
143113
- "../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/common.js"(exports2, module3) {
143114
- init_import_meta_url();
143115
- function setup(env6) {
143116
- createDebug.debug = createDebug;
143117
- createDebug.default = createDebug;
143118
- createDebug.coerce = coerce2;
143119
- createDebug.disable = disable;
143120
- createDebug.enable = enable;
143121
- createDebug.enabled = enabled;
143122
- createDebug.humanize = require_ms();
143123
- createDebug.destroy = destroy;
143124
- Object.keys(env6).forEach((key) => {
143125
- createDebug[key] = env6[key];
143126
- });
143127
- createDebug.names = [];
143128
- createDebug.skips = [];
143129
- createDebug.formatters = {};
143130
- function selectColor(namespace) {
143131
- let hash = 0;
143132
- for (let i5 = 0; i5 < namespace.length; i5++) {
143133
- hash = (hash << 5) - hash + namespace.charCodeAt(i5);
143134
- hash |= 0;
143135
- }
143136
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
143137
- }
143138
- __name(selectColor, "selectColor");
143139
- createDebug.selectColor = selectColor;
143140
- function createDebug(namespace) {
143141
- let prevTime;
143142
- let enableOverride = null;
143143
- let namespacesCache;
143144
- let enabledCache;
143145
- function debug(...args) {
143146
- if (!debug.enabled) {
143147
- return;
143148
- }
143149
- const self2 = debug;
143150
- const curr = Number(/* @__PURE__ */ new Date());
143151
- const ms = curr - (prevTime || curr);
143152
- self2.diff = ms;
143153
- self2.prev = prevTime;
143154
- self2.curr = curr;
143155
- prevTime = curr;
143156
- args[0] = createDebug.coerce(args[0]);
143157
- if (typeof args[0] !== "string") {
143158
- args.unshift("%O");
143159
- }
143160
- let index = 0;
143161
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format9) => {
143162
- if (match2 === "%%") {
143163
- return "%";
143164
- }
143165
- index++;
143166
- const formatter = createDebug.formatters[format9];
143167
- if (typeof formatter === "function") {
143168
- const val2 = args[index];
143169
- match2 = formatter.call(self2, val2);
143170
- args.splice(index, 1);
143171
- index--;
143172
- }
143173
- return match2;
143174
- });
143175
- createDebug.formatArgs.call(self2, args);
143176
- const logFn = self2.log || createDebug.log;
143177
- logFn.apply(self2, args);
143178
- }
143179
- __name(debug, "debug");
143180
- debug.namespace = namespace;
143181
- debug.useColors = createDebug.useColors();
143182
- debug.color = createDebug.selectColor(namespace);
143183
- debug.extend = extend;
143184
- debug.destroy = createDebug.destroy;
143185
- Object.defineProperty(debug, "enabled", {
143186
- enumerable: true,
143187
- configurable: false,
143188
- get: /* @__PURE__ */ __name(() => {
143189
- if (enableOverride !== null) {
143190
- return enableOverride;
143191
- }
143192
- if (namespacesCache !== createDebug.namespaces) {
143193
- namespacesCache = createDebug.namespaces;
143194
- enabledCache = createDebug.enabled(namespace);
143195
- }
143196
- return enabledCache;
143197
- }, "get"),
143198
- set: /* @__PURE__ */ __name((v7) => {
143199
- enableOverride = v7;
143200
- }, "set")
143201
- });
143202
- if (typeof createDebug.init === "function") {
143203
- createDebug.init(debug);
143204
- }
143205
- return debug;
143206
- }
143207
- __name(createDebug, "createDebug");
143208
- function extend(namespace, delimiter) {
143209
- const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
143210
- newDebug.log = this.log;
143211
- return newDebug;
143212
- }
143213
- __name(extend, "extend");
143214
- function enable(namespaces) {
143215
- createDebug.save(namespaces);
143216
- createDebug.namespaces = namespaces;
143217
- createDebug.names = [];
143218
- createDebug.skips = [];
143219
- const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
143220
- for (const ns of split) {
143221
- if (ns[0] === "-") {
143222
- createDebug.skips.push(ns.slice(1));
143223
- } else {
143224
- createDebug.names.push(ns);
143225
- }
143226
- }
143227
- }
143228
- __name(enable, "enable");
143229
- function matchesTemplate(search, template) {
143230
- let searchIndex = 0;
143231
- let templateIndex = 0;
143232
- let starIndex = -1;
143233
- let matchIndex = 0;
143234
- while (searchIndex < search.length) {
143235
- if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
143236
- if (template[templateIndex] === "*") {
143237
- starIndex = templateIndex;
143238
- matchIndex = searchIndex;
143239
- templateIndex++;
143240
- } else {
143241
- searchIndex++;
143242
- templateIndex++;
143243
- }
143244
- } else if (starIndex !== -1) {
143245
- templateIndex = starIndex + 1;
143246
- matchIndex++;
143247
- searchIndex = matchIndex;
143248
- } else {
143249
- return false;
143250
- }
143251
- }
143252
- while (templateIndex < template.length && template[templateIndex] === "*") {
143253
- templateIndex++;
143254
- }
143255
- return templateIndex === template.length;
143256
- }
143257
- __name(matchesTemplate, "matchesTemplate");
143258
- function disable() {
143259
- const namespaces = [
143260
- ...createDebug.names,
143261
- ...createDebug.skips.map((namespace) => "-" + namespace)
143262
- ].join(",");
143263
- createDebug.enable("");
143264
- return namespaces;
143265
- }
143266
- __name(disable, "disable");
143267
- function enabled(name2) {
143268
- for (const skip of createDebug.skips) {
143269
- if (matchesTemplate(name2, skip)) {
143270
- return false;
143271
- }
143272
- }
143273
- for (const ns of createDebug.names) {
143274
- if (matchesTemplate(name2, ns)) {
143275
- return true;
143276
- }
143277
- }
143278
- return false;
143279
- }
143280
- __name(enabled, "enabled");
143281
- function coerce2(val2) {
143282
- if (val2 instanceof Error) {
143283
- return val2.stack || val2.message;
143284
- }
143285
- return val2;
143286
- }
143287
- __name(coerce2, "coerce");
143288
- function destroy() {
143289
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
143290
- }
143291
- __name(destroy, "destroy");
143292
- createDebug.enable(createDebug.load());
143293
- return createDebug;
143294
- }
143295
- __name(setup, "setup");
143296
- module3.exports = setup;
143297
- }
143298
- });
143299
-
143300
- // ../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/browser.js
143301
- var require_browser2 = __commonJS({
143302
- "../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/browser.js"(exports2, module3) {
143303
- init_import_meta_url();
143304
- exports2.formatArgs = formatArgs;
143305
- exports2.save = save;
143306
- exports2.load = load;
143307
- exports2.useColors = useColors;
143308
- exports2.storage = localstorage();
143309
- exports2.destroy = /* @__PURE__ */ (() => {
143310
- let warned = false;
143311
- return () => {
143312
- if (!warned) {
143313
- warned = true;
143314
- console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
143315
- }
143316
- };
143317
- })();
143318
- exports2.colors = [
143319
- "#0000CC",
143320
- "#0000FF",
143321
- "#0033CC",
143322
- "#0033FF",
143323
- "#0066CC",
143324
- "#0066FF",
143325
- "#0099CC",
143326
- "#0099FF",
143327
- "#00CC00",
143328
- "#00CC33",
143329
- "#00CC66",
143330
- "#00CC99",
143331
- "#00CCCC",
143332
- "#00CCFF",
143333
- "#3300CC",
143334
- "#3300FF",
143335
- "#3333CC",
143336
- "#3333FF",
143337
- "#3366CC",
143338
- "#3366FF",
143339
- "#3399CC",
143340
- "#3399FF",
143341
- "#33CC00",
143342
- "#33CC33",
143343
- "#33CC66",
143344
- "#33CC99",
143345
- "#33CCCC",
143346
- "#33CCFF",
143347
- "#6600CC",
143348
- "#6600FF",
143349
- "#6633CC",
143350
- "#6633FF",
143351
- "#66CC00",
143352
- "#66CC33",
143353
- "#9900CC",
143354
- "#9900FF",
143355
- "#9933CC",
143356
- "#9933FF",
143357
- "#99CC00",
143358
- "#99CC33",
143359
- "#CC0000",
143360
- "#CC0033",
143361
- "#CC0066",
143362
- "#CC0099",
143363
- "#CC00CC",
143364
- "#CC00FF",
143365
- "#CC3300",
143366
- "#CC3333",
143367
- "#CC3366",
143368
- "#CC3399",
143369
- "#CC33CC",
143370
- "#CC33FF",
143371
- "#CC6600",
143372
- "#CC6633",
143373
- "#CC9900",
143374
- "#CC9933",
143375
- "#CCCC00",
143376
- "#CCCC33",
143377
- "#FF0000",
143378
- "#FF0033",
143379
- "#FF0066",
143380
- "#FF0099",
143381
- "#FF00CC",
143382
- "#FF00FF",
143383
- "#FF3300",
143384
- "#FF3333",
143385
- "#FF3366",
143386
- "#FF3399",
143387
- "#FF33CC",
143388
- "#FF33FF",
143389
- "#FF6600",
143390
- "#FF6633",
143391
- "#FF9900",
143392
- "#FF9933",
143393
- "#FFCC00",
143394
- "#FFCC33"
143395
- ];
143396
- function useColors() {
143397
- if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
143398
- return true;
143399
- }
143400
- if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
143401
- return false;
143402
- }
143403
- let m6;
143404
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
143405
- typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
143406
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
143407
- typeof navigator !== "undefined" && navigator.userAgent && (m6 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m6[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
143408
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
143409
- }
143410
- __name(useColors, "useColors");
143411
- function formatArgs(args) {
143412
- args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module3.exports.humanize(this.diff);
143413
- if (!this.useColors) {
143414
- return;
143415
- }
143416
- const c6 = "color: " + this.color;
143417
- args.splice(1, 0, c6, "color: inherit");
143418
- let index = 0;
143419
- let lastC = 0;
143420
- args[0].replace(/%[a-zA-Z%]/g, (match2) => {
143421
- if (match2 === "%%") {
143422
- return;
143423
- }
143424
- index++;
143425
- if (match2 === "%c") {
143426
- lastC = index;
143427
- }
143428
- });
143429
- args.splice(lastC, 0, c6);
143430
- }
143431
- __name(formatArgs, "formatArgs");
143432
- exports2.log = console.debug || console.log || (() => {
143433
- });
143434
- function save(namespaces) {
143435
- try {
143436
- if (namespaces) {
143437
- exports2.storage.setItem("debug", namespaces);
143438
- } else {
143439
- exports2.storage.removeItem("debug");
143440
- }
143441
- } catch (error2) {
143442
- }
143443
- }
143444
- __name(save, "save");
143445
- function load() {
143446
- let r7;
143447
- try {
143448
- r7 = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
143449
- } catch (error2) {
143450
- }
143451
- if (!r7 && typeof process !== "undefined" && "env" in process) {
143452
- r7 = process.env.DEBUG;
143453
- }
143454
- return r7;
143455
- }
143456
- __name(load, "load");
143457
- function localstorage() {
143458
- try {
143459
- return localStorage;
143460
- } catch (error2) {
143461
- }
143462
- }
143463
- __name(localstorage, "localstorage");
143464
- module3.exports = require_common2()(exports2);
143465
- var { formatters } = module3.exports;
143466
- formatters.j = function(v7) {
143467
- try {
143468
- return JSON.stringify(v7);
143469
- } catch (error2) {
143470
- return "[UnexpectedJSONParseError]: " + error2.message;
143471
- }
143472
- };
143473
- }
143474
- });
143475
-
143476
- // ../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/node.js
143477
- var require_node5 = __commonJS({
143478
- "../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/node.js"(exports2, module3) {
143479
- init_import_meta_url();
143480
- var tty3 = require("tty");
143481
- var util5 = require("util");
143482
- exports2.init = init3;
143483
- exports2.log = log2;
143484
- exports2.formatArgs = formatArgs;
143485
- exports2.save = save;
143486
- exports2.load = load;
143487
- exports2.useColors = useColors;
143488
- exports2.destroy = util5.deprecate(
143489
- () => {
143490
- },
143491
- "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
143492
- );
143493
- exports2.colors = [6, 2, 3, 4, 5, 1];
143494
- try {
143495
- const supportsColor3 = (init_supports_color2(), __toCommonJS(supports_color_exports));
143496
- if (supportsColor3 && (supportsColor3.stderr || supportsColor3).level >= 2) {
143497
- exports2.colors = [
143498
- 20,
143499
- 21,
143500
- 26,
143501
- 27,
143502
- 32,
143503
- 33,
143504
- 38,
143505
- 39,
143506
- 40,
143507
- 41,
143508
- 42,
143509
- 43,
143510
- 44,
143511
- 45,
143512
- 56,
143513
- 57,
143514
- 62,
143515
- 63,
143516
- 68,
143517
- 69,
143518
- 74,
143519
- 75,
143520
- 76,
143521
- 77,
143522
- 78,
143523
- 79,
143524
- 80,
143525
- 81,
143526
- 92,
143527
- 93,
143528
- 98,
143529
- 99,
143530
- 112,
143531
- 113,
143532
- 128,
143533
- 129,
143534
- 134,
143535
- 135,
143536
- 148,
143537
- 149,
143538
- 160,
143539
- 161,
143540
- 162,
143541
- 163,
143542
- 164,
143543
- 165,
143544
- 166,
143545
- 167,
143546
- 168,
143547
- 169,
143548
- 170,
143549
- 171,
143550
- 172,
143551
- 173,
143552
- 178,
143553
- 179,
143554
- 184,
143555
- 185,
143556
- 196,
143557
- 197,
143558
- 198,
143559
- 199,
143560
- 200,
143561
- 201,
143562
- 202,
143563
- 203,
143564
- 204,
143565
- 205,
143566
- 206,
143567
- 207,
143568
- 208,
143569
- 209,
143570
- 214,
143571
- 215,
143572
- 220,
143573
- 221
143574
- ];
143575
- }
143576
- } catch (error2) {
143577
- }
143578
- exports2.inspectOpts = Object.keys(process.env).filter((key) => {
143579
- return /^debug_/i.test(key);
143580
- }).reduce((obj, key) => {
143581
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_4, k6) => {
143582
- return k6.toUpperCase();
143583
- });
143584
- let val2 = process.env[key];
143585
- if (/^(yes|on|true|enabled)$/i.test(val2)) {
143586
- val2 = true;
143587
- } else if (/^(no|off|false|disabled)$/i.test(val2)) {
143588
- val2 = false;
143589
- } else if (val2 === "null") {
143590
- val2 = null;
143591
- } else {
143592
- val2 = Number(val2);
143593
- }
143594
- obj[prop] = val2;
143595
- return obj;
143596
- }, {});
143597
- function useColors() {
143598
- return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty3.isatty(process.stderr.fd);
143599
- }
143600
- __name(useColors, "useColors");
143601
- function formatArgs(args) {
143602
- const { namespace: name2, useColors: useColors2 } = this;
143603
- if (useColors2) {
143604
- const c6 = this.color;
143605
- const colorCode = "\x1B[3" + (c6 < 8 ? c6 : "8;5;" + c6);
143606
- const prefix = ` ${colorCode};1m${name2} \x1B[0m`;
143607
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
143608
- args.push(colorCode + "m+" + module3.exports.humanize(this.diff) + "\x1B[0m");
143609
- } else {
143610
- args[0] = getDate() + name2 + " " + args[0];
143611
- }
143612
- }
143613
- __name(formatArgs, "formatArgs");
143614
- function getDate() {
143615
- if (exports2.inspectOpts.hideDate) {
143616
- return "";
143617
- }
143618
- return (/* @__PURE__ */ new Date()).toISOString() + " ";
143619
- }
143620
- __name(getDate, "getDate");
143621
- function log2(...args) {
143622
- return process.stderr.write(util5.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
143623
- }
143624
- __name(log2, "log");
143625
- function save(namespaces) {
143626
- if (namespaces) {
143627
- process.env.DEBUG = namespaces;
143628
- } else {
143629
- delete process.env.DEBUG;
143630
- }
143631
- }
143632
- __name(save, "save");
143633
- function load() {
143634
- return process.env.DEBUG;
143635
- }
143636
- __name(load, "load");
143637
- function init3(debug) {
143638
- debug.inspectOpts = {};
143639
- const keys = Object.keys(exports2.inspectOpts);
143640
- for (let i5 = 0; i5 < keys.length; i5++) {
143641
- debug.inspectOpts[keys[i5]] = exports2.inspectOpts[keys[i5]];
143642
- }
143643
- }
143644
- __name(init3, "init");
143645
- module3.exports = require_common2()(exports2);
143646
- var { formatters } = module3.exports;
143647
- formatters.o = function(v7) {
143648
- this.inspectOpts.colors = this.useColors;
143649
- return util5.inspect(v7, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
143650
- };
143651
- formatters.O = function(v7) {
143652
- this.inspectOpts.colors = this.useColors;
143653
- return util5.inspect(v7, this.inspectOpts);
143654
- };
143655
- }
143656
- });
143657
-
143658
- // ../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/index.js
143659
- var require_src4 = __commonJS({
143660
- "../../node_modules/.pnpm/debug@4.4.1_supports-color@9.2.2/node_modules/debug/src/index.js"(exports2, module3) {
143661
- init_import_meta_url();
143662
- if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
143663
- module3.exports = require_browser2();
143664
- } else {
143665
- module3.exports = require_node5();
143666
- }
143667
- }
143668
- });
143669
-
143670
143201
  // ../../node_modules/.pnpm/agent-base@6.0.2_supports-color@9.2.2/node_modules/agent-base/dist/src/promisify.js
143671
143202
  var require_promisify = __commonJS({
143672
143203
  "../../node_modules/.pnpm/agent-base@6.0.2_supports-color@9.2.2/node_modules/agent-base/dist/src/promisify.js"(exports2) {
@@ -143692,7 +143223,7 @@ var require_promisify = __commonJS({
143692
143223
  });
143693
143224
 
143694
143225
  // ../../node_modules/.pnpm/agent-base@6.0.2_supports-color@9.2.2/node_modules/agent-base/dist/src/index.js
143695
- var require_src5 = __commonJS({
143226
+ var require_src4 = __commonJS({
143696
143227
  "../../node_modules/.pnpm/agent-base@6.0.2_supports-color@9.2.2/node_modules/agent-base/dist/src/index.js"(exports2, module3) {
143697
143228
  "use strict";
143698
143229
  init_import_meta_url();
@@ -143700,7 +143231,7 @@ var require_src5 = __commonJS({
143700
143231
  return mod && mod.__esModule ? mod : { "default": mod };
143701
143232
  };
143702
143233
  var events_1 = require("events");
143703
- var debug_1 = __importDefault(require_src4());
143234
+ var debug_1 = __importDefault(require_src3());
143704
143235
  var promisify_1 = __importDefault(require_promisify());
143705
143236
  var debug = debug_1.default("agent-base");
143706
143237
  function isAgent(v7) {
@@ -143890,7 +143421,7 @@ var require_parse_proxy_response2 = __commonJS({
143890
143421
  return mod && mod.__esModule ? mod : { "default": mod };
143891
143422
  };
143892
143423
  Object.defineProperty(exports2, "__esModule", { value: true });
143893
- var debug_1 = __importDefault(require_src4());
143424
+ var debug_1 = __importDefault(require_src3());
143894
143425
  var debug = debug_1.default("https-proxy-agent:parse-proxy-response");
143895
143426
  function parseProxyResponse(socket) {
143896
143427
  return new Promise((resolve24, reject) => {
@@ -143999,8 +143530,8 @@ var require_agent2 = __commonJS({
143999
143530
  var tls_1 = __importDefault(require("tls"));
144000
143531
  var url_1 = __importDefault(require("url"));
144001
143532
  var assert_1 = __importDefault(require("assert"));
144002
- var debug_1 = __importDefault(require_src4());
144003
- var agent_base_1 = require_src5();
143533
+ var debug_1 = __importDefault(require_src3());
143534
+ var agent_base_1 = require_src4();
144004
143535
  var parse_proxy_response_1 = __importDefault(require_parse_proxy_response2());
144005
143536
  var debug = debug_1.default("https-proxy-agent:agent");
144006
143537
  var HttpsProxyAgent3 = class extends agent_base_1.Agent {
@@ -151392,7 +150923,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
151392
150923
  workerBundle = createWorkerUploadForm(worker);
151393
150924
  printBindings({ ...bindings, vars: maskedVars }, config.tail_consumers);
151394
150925
  } else {
151395
- (0, import_node_assert21.default)(accountId, "Missing accountId");
150926
+ (0, import_node_assert22.default)(accountId, "Missing accountId");
151396
150927
  if (getFlag("RESOURCES_PROVISION")) {
151397
150928
  await provisionBindings(
151398
150929
  bindings,
@@ -151542,11 +151073,11 @@ function generatePreviewAlias(scriptName) {
151542
151073
  }
151543
151074
  return sanitizedAlias;
151544
151075
  }
151545
- var import_node_assert21, import_node_child_process7, import_node_fs31, import_node_path54, import_undici19, versionsUploadCommand;
151076
+ var import_node_assert22, import_node_child_process7, import_node_fs31, import_node_path54, import_undici19, versionsUploadCommand;
151546
151077
  var init_upload2 = __esm({
151547
151078
  "src/versions/upload.ts"() {
151548
151079
  init_import_meta_url();
151549
- import_node_assert21 = __toESM(require("assert"));
151080
+ import_node_assert22 = __toESM(require("assert"));
151550
151081
  import_node_child_process7 = require("child_process");
151551
151082
  import_node_fs31 = require("fs");
151552
151083
  import_node_path54 = __toESM(require("path"));
@@ -151814,7 +151345,7 @@ var init_upload2 = __esm({
151814
151345
  }
151815
151346
  const previewAlias = args.previewAlias ?? (getCIGeneratePreviewAlias() === "true" ? generatePreviewAlias(name2) : void 0);
151816
151347
  if (!args.dryRun) {
151817
- (0, import_node_assert21.default)(accountId, "Missing account ID");
151348
+ (0, import_node_assert22.default)(accountId, "Missing account ID");
151818
151349
  await verifyWorkerMatchesCITag(
151819
151350
  config,
151820
151351
  accountId,
@@ -155978,6 +155509,10 @@ function createCLIParser(argv) {
155978
155509
  command: "wrangler kv namespace delete",
155979
155510
  definition: kvNamespaceDeleteCommand
155980
155511
  },
155512
+ {
155513
+ command: "wrangler kv namespace rename",
155514
+ definition: kvNamespaceRenameCommand
155515
+ },
155981
155516
  { command: "wrangler kv key put", definition: kvKeyPutCommand },
155982
155517
  { command: "wrangler kv key list", definition: kvKeyListCommand },
155983
155518
  { command: "wrangler kv key get", definition: kvKeyGetCommand },
@@ -156809,7 +156344,7 @@ async function main(argv) {
156809
156344
  if (e7.cause instanceof ApiError) {
156810
156345
  logger.error(e7.cause);
156811
156346
  } else {
156812
- (0, import_node_assert22.default)(isAuthenticationError(e7));
156347
+ (0, import_node_assert23.default)(isAuthenticationError(e7));
156813
156348
  logger.log(formatMessage(e7));
156814
156349
  }
156815
156350
  const envAuth = getAuthFromEnv();
@@ -156914,11 +156449,11 @@ ${tryRunningItIn}${oneOfThese}`
156914
156449
  }
156915
156450
  }
156916
156451
  }
156917
- var import_node_assert22, import_node_os7, import_promises31, import_undici20;
156452
+ var import_node_assert23, import_node_os7, import_promises31, import_undici20;
156918
156453
  var init_src = __esm({
156919
156454
  "src/index.ts"() {
156920
156455
  init_import_meta_url();
156921
- import_node_assert22 = __toESM(require("assert"));
156456
+ import_node_assert23 = __toESM(require("assert"));
156922
156457
  import_node_os7 = __toESM(require("os"));
156923
156458
  import_promises31 = require("timers/promises");
156924
156459
  init_containers_shared();
@@ -157195,7 +156730,7 @@ async function analyseBundle(workerBundle) {
157195
156730
  {
157196
156731
  type: "ESModule",
157197
156732
  // Make sure the entrypoint path doesn't conflict with a user worker module
157198
- path: (0, import_crypto6.randomUUID)(),
156733
+ path: (0, import_crypto7.randomUUID)(),
157199
156734
  contents: (
157200
156735
  /* javascript */
157201
156736
  `
@@ -157233,11 +156768,11 @@ async function analyseBundle(workerBundle) {
157233
156768
  ws.send(JSON.stringify({ id: 3, method: "Profiler.stop", params: {} }));
157234
156769
  return cpuProfileResult;
157235
156770
  }
157236
- var import_crypto6, import_promises32, import_node_events3, import_promises33, import_path26, import_miniflare21, mimeTypeModuleType, checkNamespace, checkStartupCommand;
156771
+ var import_crypto7, import_promises32, import_node_events3, import_promises33, import_path26, import_miniflare21, mimeTypeModuleType, checkNamespace, checkStartupCommand;
157237
156772
  var init_commands9 = __esm({
157238
156773
  "src/check/commands.ts"() {
157239
156774
  init_import_meta_url();
157240
- import_crypto6 = require("crypto");
156775
+ import_crypto7 = require("crypto");
157241
156776
  import_promises32 = require("fs/promises");
157242
156777
  import_node_events3 = __toESM(require("events"));
157243
156778
  import_promises33 = require("fs/promises");
@@ -157513,12 +157048,15 @@ Edits that have been made via the script API will be overridden by your local co
157513
157048
  }
157514
157049
  if (!(props.compatibilityDate || config.compatibility_date)) {
157515
157050
  const compatibilityDateStr = `${(/* @__PURE__ */ new Date()).getFullYear()}-${((/* @__PURE__ */ new Date()).getMonth() + 1 + "").padStart(2, "0")}-${((/* @__PURE__ */ new Date()).getDate() + "").padStart(2, "0")}`;
157516
- throw new UserError(`A compatibility_date is required when publishing. Add the following to your ${configFileName(config.configPath)} file:
157051
+ throw new UserError(
157052
+ `A compatibility_date is required when publishing. Add the following to your ${configFileName(config.configPath)} file:
157517
157053
  \`\`\`
157518
157054
  ${formatConfigSnippet({ compatibility_date: compatibilityDateStr }, config.configPath, false)}
157519
157055
  \`\`\`
157520
157056
  Or you could pass it in your terminal as \`--compatibility-date ${compatibilityDateStr}\`
157521
- See https://developers.cloudflare.com/workers/platform/compatibility-dates for more information.`);
157057
+ See https://developers.cloudflare.com/workers/platform/compatibility-dates for more information.`,
157058
+ { telemetryMessage: "missing compatibiltiy date when deploying" }
157059
+ );
157522
157060
  }
157523
157061
  const routes = props.routes ?? config.routes ?? (config.route ? [config.route] : []) ?? [];
157524
157062
  validateRoutes3(routes, props.assetsOptions);
@@ -157541,7 +157079,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
157541
157079
  );
157542
157080
  }
157543
157081
  const scriptName = props.name;
157544
- (0, import_node_assert23.default)(
157082
+ (0, import_node_assert24.default)(
157545
157083
  !config.site || config.site.bucket,
157546
157084
  "A [site] definition requires a `bucket` field with a path to the site's assets directory."
157547
157085
  );
@@ -157574,22 +157112,26 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
157574
157112
  }
157575
157113
  if (!props.isWorkersSite && Boolean(props.legacyAssetPaths) && format9 === "service-worker") {
157576
157114
  throw new UserError(
157577
- "You cannot use the service-worker format with an `assets` directory yet. For information on how to migrate to the module-worker format, see: https://developers.cloudflare.com/workers/learning/migrating-to-module-workers/"
157115
+ "You cannot use the service-worker format with an `assets` directory yet. For information on how to migrate to the module-worker format, see: https://developers.cloudflare.com/workers/learning/migrating-to-module-workers/",
157116
+ { telemetryMessage: true }
157578
157117
  );
157579
157118
  }
157580
157119
  if (config.wasm_modules && format9 === "modules") {
157581
157120
  throw new UserError(
157582
- "You cannot configure [wasm_modules] with an ES module worker. Instead, import the .wasm module directly in your code"
157121
+ "You cannot configure [wasm_modules] with an ES module worker. Instead, import the .wasm module directly in your code",
157122
+ { telemetryMessage: true }
157583
157123
  );
157584
157124
  }
157585
157125
  if (config.text_blobs && format9 === "modules") {
157586
157126
  throw new UserError(
157587
- `You cannot configure [text_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config.configPath)} file`
157127
+ `You cannot configure [text_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config.configPath)} file`,
157128
+ { telemetryMessage: "[text_blobs] with an ES module worker" }
157588
157129
  );
157589
157130
  }
157590
157131
  if (config.data_blobs && format9 === "modules") {
157591
157132
  throw new UserError(
157592
- `You cannot configure [data_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config.configPath)} file`
157133
+ `You cannot configure [data_blobs] with an ES module worker. Instead, import the file directly in your code, and optionally configure \`[rules]\` in your ${configFileName(config.configPath)} file`,
157134
+ { telemetryMessage: "[data_blobs] with an ES module worker" }
157593
157135
  );
157594
157136
  }
157595
157137
  let sourceMapSize;
@@ -157805,7 +157347,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
157805
157347
  { warnIfNoBindings: true }
157806
157348
  );
157807
157349
  } else {
157808
- (0, import_node_assert23.default)(accountId, "Missing accountId");
157350
+ (0, import_node_assert24.default)(accountId, "Missing accountId");
157809
157351
  if (getFlag("RESOURCES_PROVISION")) {
157810
157352
  await provisionBindings(
157811
157353
  bindings,
@@ -157927,7 +157469,8 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
157927
157469
  err.preventReport();
157928
157470
  if (err.notes[0].text === "binding DB of type d1 must have a valid `id` specified [code: 10021]") {
157929
157471
  throw new UserError(
157930
- "You must use a real database in the database_id configuration. You can find your databases using 'wrangler d1 list', or read how to develop locally with D1 here: https://developers.cloudflare.com/d1/configuration/local-development"
157472
+ "You must use a real database in the database_id configuration. You can find your databases using 'wrangler d1 list', or read how to develop locally with D1 here: https://developers.cloudflare.com/d1/configuration/local-development",
157473
+ { telemetryMessage: true }
157931
157474
  );
157932
157475
  }
157933
157476
  const maybeNameToFilePath = /* @__PURE__ */ __name((moduleName) => {
@@ -157973,7 +157516,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
157973
157516
  return { versionId, workerTag };
157974
157517
  }
157975
157518
  if (config.containers) {
157976
- (0, import_node_assert23.default)(versionId && accountId);
157519
+ (0, import_node_assert24.default)(versionId && accountId);
157977
157520
  await deployContainers(config, {
157978
157521
  versionId,
157979
157522
  accountId,
@@ -158035,7 +157578,8 @@ async function publishRoutesFallback(complianceConfig, routes, {
158035
157578
  }) {
158036
157579
  if (notProd) {
158037
157580
  throw new UserError(
158038
- "Service environments combined with an API token that doesn't have 'All Zones' permissions is not supported.\nEither turn off service environments by setting `legacy_env = true`, creating an API token with 'All Zones' permissions, or logging in via OAuth"
157581
+ "Service environments combined with an API token that doesn't have 'All Zones' permissions is not supported.\nEither turn off service environments by setting `legacy_env = true`, creating an API token with 'All Zones' permissions, or logging in via OAuth",
157582
+ { telemetryMessage: true }
158039
157583
  );
158040
157584
  }
158041
157585
  logger.warn(
@@ -158098,7 +157642,8 @@ async function publishRoutesFallback(complianceConfig, routes, {
158098
157642
  continue;
158099
157643
  } else {
158100
157644
  throw new UserError(
158101
- `The route with pattern "${routePattern}" is already associated with another worker called "${knownScript}".`
157645
+ `The route with pattern "${routePattern}" is already associated with another worker called "${knownScript}".`,
157646
+ { telemetryMessage: "route already associated with another worker" }
158102
157647
  );
158103
157648
  }
158104
157649
  }
@@ -158183,7 +157728,8 @@ async function updateQueueConsumers(scriptName, config) {
158183
157728
  } else {
158184
157729
  if (scriptName === void 0) {
158185
157730
  throw new UserError(
158186
- "Script name is required to update queue consumers"
157731
+ "Script name is required to update queue consumers",
157732
+ { telemetryMessage: true }
158187
157733
  );
158188
157734
  }
158189
157735
  const body = {
@@ -158219,11 +157765,11 @@ async function updateQueueConsumers(scriptName, config) {
158219
157765
  }
158220
157766
  return updateConsumers;
158221
157767
  }
158222
- var import_node_assert23, import_node_fs32, import_node_path56, import_node_url9, import_undici21, validateRoutes3;
157768
+ var import_node_assert24, import_node_fs32, import_node_path56, import_node_url9, import_undici21, validateRoutes3;
158223
157769
  var init_deploy8 = __esm({
158224
157770
  "src/deploy/deploy.ts"() {
158225
157771
  init_import_meta_url();
158226
- import_node_assert23 = __toESM(require("assert"));
157772
+ import_node_assert24 = __toESM(require("assert"));
158227
157773
  import_node_fs32 = require("fs");
158228
157774
  import_node_path56 = __toESM(require("path"));
158229
157775
  import_node_url9 = require("url");
@@ -158406,7 +157952,8 @@ ${directory}`,
158406
157952
  }
158407
157953
  if (!routerConfig.has_user_worker && (routerConfig.invoke_user_worker_ahead_of_assets === true || routerConfig.static_routing)) {
158408
157954
  throw new UserError(
158409
- "Cannot set run_worker_first without a Worker script.\nPlease remove run_worker_first from your configuration file, or provide a Worker script in your configuration file (`main`)."
157955
+ "Cannot set run_worker_first without a Worker script.\nPlease remove run_worker_first from your configuration file, or provide a Worker script in your configuration file (`main`).",
157956
+ { telemetryMessage: true }
158410
157957
  );
158411
157958
  }
158412
157959
  const _redirects = maybeGetFile(path60.join(directory, REDIRECTS_FILENAME));
@@ -158432,7 +157979,8 @@ ${directory}`,
158432
157979
  function validateAssetsArgsAndConfig(args, config) {
158433
157980
  if ("legacy" in args ? args.assets && args.legacy.site : (args.assets || config?.assets) && (args.site || config?.site)) {
158434
157981
  throw new UserError(
158435
- "Cannot use assets and Workers Sites in the same Worker.\nPlease remove either the `site` or `assets` field from your configuration file."
157982
+ "Cannot use assets and Workers Sites in the same Worker.\nPlease remove either the `site` or `assets` field from your configuration file.",
157983
+ { telemetryMessage: true }
158436
157984
  );
158437
157985
  }
158438
157986
  const noOpEntrypoint = path60.resolve(
@@ -158467,11 +158015,11 @@ function errorOnLegacyPagesWorkerJSAsset(file, hasAssetsIgnoreFile) {
158467
158015
  }
158468
158016
  }
158469
158017
  }
158470
- var import_node_assert24, import_node_fs33, import_promises35, path60, import_undici22, BULK_UPLOAD_CONCURRENCY2, MAX_UPLOAD_ATTEMPTS2, MAX_UPLOAD_GATEWAY_ERRORS2, MAX_DIFF_LINES2, syncAssets, buildAssetManifest, NonExistentAssetsDirError, WORKER_JS_FILENAME;
158018
+ var import_node_assert25, import_node_fs33, import_promises35, path60, import_undici22, BULK_UPLOAD_CONCURRENCY2, MAX_UPLOAD_ATTEMPTS2, MAX_UPLOAD_GATEWAY_ERRORS2, MAX_DIFF_LINES2, syncAssets, buildAssetManifest, NonExistentAssetsDirError, WORKER_JS_FILENAME;
158471
158019
  var init_assets = __esm({
158472
158020
  "src/assets.ts"() {
158473
158021
  init_import_meta_url();
158474
- import_node_assert24 = __toESM(require("assert"));
158022
+ import_node_assert25 = __toESM(require("assert"));
158475
158023
  import_node_fs33 = require("fs");
158476
158024
  import_promises35 = require("fs/promises");
158477
158025
  path60 = __toESM(require("path"));
@@ -158496,7 +158044,7 @@ var init_assets = __esm({
158496
158044
  MAX_UPLOAD_GATEWAY_ERRORS2 = 5;
158497
158045
  MAX_DIFF_LINES2 = 100;
158498
158046
  syncAssets = /* @__PURE__ */ __name(async (complianceConfig, accountId, assetDirectory, scriptName, dispatchNamespace) => {
158499
- (0, import_node_assert24.default)(accountId, "Missing accountId");
158047
+ (0, import_node_assert25.default)(accountId, "Missing accountId");
158500
158048
  logger.info("\u{1F300} Building list of assets...");
158501
158049
  const manifest = await buildAssetManifest(assetDirectory);
158502
158050
  const url4 = dispatchNamespace ? `/accounts/${accountId}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/assets-upload-session` : `/accounts/${accountId}/workers/scripts/${scriptName}/assets-upload-session`;
@@ -158876,7 +158424,7 @@ async function resolveDevConfig(config, input) {
158876
158424
  );
158877
158425
  if (input.dev?.remote) {
158878
158426
  const { accountId } = await auth();
158879
- (0, import_node_assert25.default)(accountId, "Account ID must be provided for remote dev");
158427
+ (0, import_node_assert26.default)(accountId, "Account ID must be provided for remote dev");
158880
158428
  await getZoneIdForPreview(config, { host, routes, accountId });
158881
158429
  }
158882
158430
  const initialIp = input.dev?.server?.hostname ?? config.dev.ip;
@@ -159100,11 +158648,18 @@ If you are trying to develop Pages and Workers together, please use \`wrangler p
159100
158648
  if (resolved.dev.remote && (queues?.length || resolved.triggers?.some((t7) => t7.type === "queue-consumer"))) {
159101
158649
  logger.warn("Queues are not yet supported in wrangler dev remote mode.");
159102
158650
  }
159103
- const classNamesWhichUseSQLite = getClassNamesWhichUseSQLite(
159104
- resolved.migrations
159105
- );
159106
- if (resolved.dev.remote && Array.from(classNamesWhichUseSQLite.values()).some((v7) => v7)) {
159107
- logger.warn("SQLite in Durable Objects is only supported in local mode.");
158651
+ if (resolved.dev.remote) {
158652
+ if (resolved.dev.enableContainers && resolved.containers && resolved.containers.length > 0) {
158653
+ logger.warn(
158654
+ "Containers are only supported in local mode, to suppress this warning set `dev.enable_containers` to `false` or pass `--enable-containers=false` to the `wrangler dev` command"
158655
+ );
158656
+ }
158657
+ const classNamesWhichUseSQLite = getClassNamesWhichUseSQLite(
158658
+ resolved.migrations
158659
+ );
158660
+ if (resolved.dev.remote && Array.from(classNamesWhichUseSQLite.values()).some((v7) => v7)) {
158661
+ logger.warn("SQLite in Durable Objects is only supported in local mode.");
158662
+ }
159108
158663
  }
159109
158664
  const typesChanged = await checkTypesDiff(config, entry);
159110
158665
  if (typesChanged) {
@@ -159114,11 +158669,11 @@ If you are trying to develop Pages and Workers together, please use \`wrangler p
159114
158669
  }
159115
158670
  return resolved;
159116
158671
  }
159117
- var import_node_assert25, import_node_path57, getInspectorPort, getLocalPort, ConfigController;
158672
+ var import_node_assert26, import_node_path57, getInspectorPort, getLocalPort, ConfigController;
159118
158673
  var init_ConfigController = __esm({
159119
158674
  "src/api/startDevWorker/ConfigController.ts"() {
159120
158675
  init_import_meta_url();
159121
- import_node_assert25 = __toESM(require("assert"));
158676
+ import_node_assert26 = __toESM(require("assert"));
159122
158677
  import_node_path57 = __toESM(require("path"));
159123
158678
  init_containers_shared();
159124
158679
  init_esm4();
@@ -159169,7 +158724,7 @@ var init_ConfigController = __esm({
159169
158724
  ignoreInitial: true
159170
158725
  }).on("change", async (_event) => {
159171
158726
  logger.debug(`${import_node_path57.default.basename(configPath)} changed...`);
159172
- (0, import_node_assert25.default)(
158727
+ (0, import_node_assert26.default)(
159173
158728
  this.latestInput,
159174
158729
  "Cannot be watching config without having first set an input"
159175
158730
  );
@@ -159184,7 +158739,7 @@ var init_ConfigController = __esm({
159184
158739
  );
159185
158740
  }
159186
158741
  patch(input) {
159187
- (0, import_node_assert25.default)(
158742
+ (0, import_node_assert26.default)(
159188
158743
  this.latestInput,
159189
158744
  "Cannot call updateConfig without previously calling setConfig"
159190
158745
  );
@@ -159335,7 +158890,7 @@ function maybeGetSourceMappingURL(sourcePath) {
159335
158890
  return;
159336
158891
  }
159337
158892
  const sourceMappingURLMatch = source.substring(sourceMappingURLIndex).match(/^\/\/# sourceMappingURL=(.+)/);
159338
- (0, import_node_assert26.default)(sourceMappingURLMatch !== null);
158893
+ (0, import_node_assert27.default)(sourceMappingURLMatch !== null);
159339
158894
  const sourceMappingURLSpecifier = sourceMappingURLMatch[1];
159340
158895
  const sourceURL = (0, import_node_url10.pathToFileURL)(sourcePath);
159341
158896
  try {
@@ -159347,11 +158902,11 @@ function maybeGetSourceMappingURL(sourcePath) {
159347
158902
  } catch {
159348
158903
  }
159349
158904
  }
159350
- var import_node_assert26, import_node_fs34, import_node_path60, import_node_url10, bundleReferencedPathsCache;
158905
+ var import_node_assert27, import_node_fs34, import_node_path60, import_node_url10, bundleReferencedPathsCache;
159351
158906
  var init_bundle_allowed_paths = __esm({
159352
158907
  "src/api/startDevWorker/bundle-allowed-paths.ts"() {
159353
158908
  init_import_meta_url();
159354
- import_node_assert26 = __toESM(require("assert"));
158909
+ import_node_assert27 = __toESM(require("assert"));
159355
158910
  import_node_fs34 = __toESM(require("fs"));
159356
158911
  import_node_path60 = __toESM(require("path"));
159357
158912
  import_node_url10 = require("url");
@@ -177905,11 +177460,11 @@ function didMiniflareOptionsChange(prev, next) {
177905
177460
  }
177906
177461
  return !deepEquality(prev, next);
177907
177462
  }
177908
- var import_node_assert27, import_node_crypto12, import_node_events4, import_node_path61, import_miniflare23, ProxyController, ProxyControllerLogger;
177463
+ var import_node_assert28, import_node_crypto12, import_node_events4, import_node_path61, import_miniflare23, ProxyController, ProxyControllerLogger;
177909
177464
  var init_ProxyController = __esm({
177910
177465
  "src/api/startDevWorker/ProxyController.ts"() {
177911
177466
  init_import_meta_url();
177912
- import_node_assert27 = __toESM(require("assert"));
177467
+ import_node_assert28 = __toESM(require("assert"));
177913
177468
  import_node_crypto12 = require("crypto");
177914
177469
  import_node_events4 = __toESM(require("events"));
177915
177470
  import_node_path61 = __toESM(require("path"));
@@ -177940,7 +177495,7 @@ var init_ProxyController = __esm({
177940
177495
  if (this._torndown) {
177941
177496
  return;
177942
177497
  }
177943
- (0, import_node_assert27.default)(this.latestConfig !== void 0);
177498
+ (0, import_node_assert28.default)(this.latestConfig !== void 0);
177944
177499
  const inVscodeJsDebugTerminal = !!process.env.VSCODE_INSPECTOR_OPTIONS;
177945
177500
  const cert = this.latestConfig.dev?.server?.secure || this.latestConfig.dev.inspector !== false && this.latestConfig.dev?.inspector?.secure ? getHttpsOptions(
177946
177501
  this.latestConfig.dev.server?.httpsKeyPath,
@@ -178058,7 +177613,7 @@ var init_ProxyController = __esm({
178058
177613
  inspectorUrl
178059
177614
  ]);
178060
177615
  }).then(([url4, inspectorUrl]) => {
178061
- (0, import_node_assert27.default)(url4);
177616
+ (0, import_node_assert28.default)(url4);
178062
177617
  this.emitReadyEvent(proxyWorker, url4, inspectorUrl);
178063
177618
  }).catch((error2) => {
178064
177619
  if (this._torndown) {
@@ -178075,7 +177630,7 @@ var init_ProxyController = __esm({
178075
177630
  if (this._torndown) {
178076
177631
  return;
178077
177632
  }
178078
- (0, import_node_assert27.default)(
177633
+ (0, import_node_assert28.default)(
178079
177634
  this.latestConfig?.dev.inspector !== false,
178080
177635
  "Trying to reconnect with inspector proxy worker when inspector is disabled"
178081
177636
  );
@@ -178086,7 +177641,7 @@ var init_ProxyController = __esm({
178086
177641
  this.inspectorProxyWorkerWebSocket = createDeferred();
178087
177642
  let webSocket = null;
178088
177643
  try {
178089
- (0, import_node_assert27.default)(this.proxyWorker);
177644
+ (0, import_node_assert28.default)(this.proxyWorker);
178090
177645
  const inspectorProxyWorkerUrl = await this.proxyWorker.unsafeGetDirectURL(
178091
177646
  "InspectorProxyWorker"
178092
177647
  );
@@ -178105,12 +177660,12 @@ var init_ProxyController = __esm({
178105
177660
  this.emitErrorEvent("Could not connect to InspectorProxyWorker", error2);
178106
177661
  return;
178107
177662
  }
178108
- (0, import_node_assert27.default)(
177663
+ (0, import_node_assert28.default)(
178109
177664
  webSocket,
178110
177665
  "Expected webSocket on response from inspectorProxyWorker"
178111
177666
  );
178112
177667
  webSocket.addEventListener("message", (event) => {
178113
- (0, import_node_assert27.default)(typeof event.data === "string");
177668
+ (0, import_node_assert28.default)(typeof event.data === "string");
178114
177669
  this.onInspectorProxyWorkerMessage(JSON.parse(event.data));
178115
177670
  });
178116
177671
  webSocket.addEventListener("close", () => {
@@ -178165,13 +177720,13 @@ var init_ProxyController = __esm({
178165
177720
  if (this._torndown) {
178166
177721
  return;
178167
177722
  }
178168
- (0, import_node_assert27.default)(
177723
+ (0, import_node_assert28.default)(
178169
177724
  this.latestConfig?.dev.inspector !== false,
178170
177725
  "Trying to send message to inspector proxy worker when inspector is disabled"
178171
177726
  );
178172
177727
  try {
178173
177728
  const websocket = await this.reconnectInspectorProxyWorker();
178174
- (0, import_node_assert27.default)(websocket);
177729
+ (0, import_node_assert28.default)(websocket);
178175
177730
  websocket.send(JSON.stringify(message));
178176
177731
  } catch (cause) {
178177
177732
  if (this._torndown) {
@@ -178238,7 +177793,7 @@ var init_ProxyController = __esm({
178238
177793
  }
178239
177794
  }
178240
177795
  onInspectorProxyWorkerMessage(message) {
178241
- (0, import_node_assert27.default)(
177796
+ (0, import_node_assert28.default)(
178242
177797
  this.latestConfig?.dev.inspector !== false,
178243
177798
  "Trying to handle inspector message when inspector is disabled"
178244
177799
  );
@@ -178264,7 +177819,7 @@ var init_ProxyController = __esm({
178264
177819
  }
178265
177820
  }
178266
177821
  async onInspectorProxyWorkerRequest(message) {
178267
- (0, import_node_assert27.default)(
177822
+ (0, import_node_assert28.default)(
178268
177823
  this.latestConfig?.dev.inspector !== false,
178269
177824
  "Trying to handle inspector request when inspector is disabled"
178270
177825
  );
@@ -178285,8 +177840,8 @@ var init_ProxyController = __esm({
178285
177840
  logger.debug("[InspectorProxyWorker]", ...message.args);
178286
177841
  break;
178287
177842
  case "load-network-resource": {
178288
- (0, import_node_assert27.default)(this.latestConfig !== void 0);
178289
- (0, import_node_assert27.default)(this.latestBundle !== void 0);
177843
+ (0, import_node_assert28.default)(this.latestConfig !== void 0);
177844
+ (0, import_node_assert28.default)(this.latestBundle !== void 0);
178290
177845
  let maybeContents;
178291
177846
  if (message.url.startsWith("wrangler-file:")) {
178292
177847
  maybeContents = maybeHandleNetworkLoadResource(
@@ -178542,7 +178097,7 @@ var init_create_worker_preview = __esm({
178542
178097
 
178543
178098
  // src/dev/remote.ts
178544
178099
  function handlePreviewSessionUploadError(err, accountId) {
178545
- (0, import_node_assert28.default)(err && typeof err === "object");
178100
+ (0, import_node_assert29.default)(err && typeof err === "object");
178546
178101
  if (isAbortError(err)) {
178547
178102
  if ("code" in err && err.code === 10049) {
178548
178103
  logger.log("Preview token expired, fetching a new one");
@@ -178554,7 +178109,7 @@ function handlePreviewSessionUploadError(err, accountId) {
178554
178109
  return false;
178555
178110
  }
178556
178111
  function handlePreviewSessionCreationError(err, accountId) {
178557
- (0, import_node_assert28.default)(err && typeof err === "object");
178112
+ (0, import_node_assert29.default)(err && typeof err === "object");
178558
178113
  if ("code" in err && err.code === 10063) {
178559
178114
  const errorMessage = "Error: You need to register a workers.dev subdomain before running the dev command in remote mode";
178560
178115
  const solutionMessage = "You can either enable local mode by pressing l, or register a workers.dev subdomain here:";
@@ -178713,11 +178268,11 @@ ${onboardingLink}`);
178713
178268
  }
178714
178269
  }
178715
178270
  }
178716
- var import_node_assert28, import_node_path62;
178271
+ var import_node_assert29, import_node_path62;
178717
178272
  var init_remote = __esm({
178718
178273
  "src/dev/remote.ts"() {
178719
178274
  init_import_meta_url();
178720
- import_node_assert28 = __toESM(require("assert"));
178275
+ import_node_assert29 = __toESM(require("assert"));
178721
178276
  import_node_path62 = __toESM(require("path"));
178722
178277
  init_assets();
178723
178278
  init_bundle_reporter();
@@ -179043,7 +178598,7 @@ function createWorkerObject(devEnv) {
179043
178598
  return devEnv.proxy.ready.promise.then((ev) => ev.inspectorUrl);
179044
178599
  },
179045
178600
  get config() {
179046
- (0, import_node_assert29.default)(devEnv.config.latestConfig);
178601
+ (0, import_node_assert30.default)(devEnv.config.latestConfig);
179047
178602
  return devEnv.config.latestConfig;
179048
178603
  },
179049
178604
  async setConfig(config, throwErrors) {
@@ -179058,7 +178613,7 @@ function createWorkerObject(devEnv) {
179058
178613
  return proxyWorker.dispatchFetch(...args);
179059
178614
  },
179060
178615
  async queue(...args) {
179061
- (0, import_node_assert29.default)(
178616
+ (0, import_node_assert30.default)(
179062
178617
  this.config.name,
179063
178618
  "Worker name must be defined to use `Worker.queue()`"
179064
178619
  );
@@ -179067,7 +178622,7 @@ function createWorkerObject(devEnv) {
179067
178622
  return w6.queue(...args);
179068
178623
  },
179069
178624
  async scheduled(...args) {
179070
- (0, import_node_assert29.default)(
178625
+ (0, import_node_assert30.default)(
179071
178626
  this.config.name,
179072
178627
  "Worker name must be defined to use `Worker.scheduled()`"
179073
178628
  );
@@ -179081,11 +178636,11 @@ function createWorkerObject(devEnv) {
179081
178636
  raw: devEnv
179082
178637
  };
179083
178638
  }
179084
- var import_node_assert29, import_node_events5, DevEnv;
178639
+ var import_node_assert30, import_node_events5, DevEnv;
179085
178640
  var init_DevEnv = __esm({
179086
178641
  "src/api/startDevWorker/DevEnv.ts"() {
179087
178642
  init_import_meta_url();
179088
- import_node_assert29 = __toESM(require("assert"));
178643
+ import_node_assert30 = __toESM(require("assert"));
179089
178644
  import_node_events5 = require("events");
179090
178645
  init_logger();
179091
178646
  init_parse();
@@ -179290,7 +178845,7 @@ async function maybeStartOrUpdateRemoteProxySession(configPathOrWorkerConfig, pr
179290
178845
  if (typeof configPathOrWorkerConfig === "string") {
179291
178846
  const configPath = configPathOrWorkerConfig;
179292
178847
  const config = readConfig({ config: configPath });
179293
- (0, import_node_assert30.default)(config.name);
178848
+ (0, import_node_assert31.default)(config.name);
179294
178849
  configPathOrWorkerConfig = {
179295
178850
  name: config.name,
179296
178851
  complianceRegion: getCloudflareComplianceRegion(config),
@@ -179327,17 +178882,17 @@ async function maybeStartOrUpdateRemoteProxySession(configPathOrWorkerConfig, pr
179327
178882
  }
179328
178883
  function deepStrictEqual(source, target) {
179329
178884
  try {
179330
- import_node_assert30.default.deepStrictEqual(source, target);
178885
+ import_node_assert31.default.deepStrictEqual(source, target);
179331
178886
  return true;
179332
178887
  } catch {
179333
178888
  return false;
179334
178889
  }
179335
178890
  }
179336
- var import_node_assert30, import_node_path63;
178891
+ var import_node_assert31, import_node_path63;
179337
178892
  var init_remoteBindings = __esm({
179338
178893
  "src/api/remoteBindings/index.ts"() {
179339
178894
  init_import_meta_url();
179340
- import_node_assert30 = __toESM(require("assert"));
178895
+ import_node_assert31 = __toESM(require("assert"));
179341
178896
  import_node_path63 = __toESM(require("path"));
179342
178897
  init_get_port();
179343
178898
  init_config2();
@@ -179462,7 +179017,7 @@ async function getContainerOptions(config) {
179462
179017
  if (!config.containers?.length || config.dev.enableContainers === false) {
179463
179018
  return void 0;
179464
179019
  }
179465
- (0, import_node_assert31.default)(
179020
+ (0, import_node_assert32.default)(
179466
179021
  config.dev.containerBuildId,
179467
179022
  "Build ID should be set if containers are enabled and defined"
179468
179023
  );
@@ -179481,11 +179036,11 @@ async function getContainerOptions(config) {
179481
179036
  }
179482
179037
  return containers2;
179483
179038
  }
179484
- var import_node_assert31, import_node_crypto14, import_promises36, import_miniflare26, LocalRuntimeController;
179039
+ var import_node_assert32, import_node_crypto14, import_promises36, import_miniflare26, LocalRuntimeController;
179485
179040
  var init_LocalRuntimeController = __esm({
179486
179041
  "src/api/startDevWorker/LocalRuntimeController.ts"() {
179487
179042
  init_import_meta_url();
179488
- import_node_assert31 = __toESM(require("assert"));
179043
+ import_node_assert32 = __toESM(require("assert"));
179489
179044
  import_node_crypto14 = require("crypto");
179490
179045
  import_promises36 = require("fs/promises");
179491
179046
  init_containers_shared();
@@ -179555,20 +179110,20 @@ var init_LocalRuntimeController = __esm({
179555
179110
  }
179556
179111
  if (containerOptions && this.#currentContainerBuildId !== data.config.dev.containerBuildId) {
179557
179112
  logger.log(source_default.dim("\u2394 Preparing container image(s)..."));
179558
- await prepareContainerImagesForDev(
179559
- this.#dockerPath,
179113
+ await prepareContainerImagesForDev({
179114
+ dockerPath: this.#dockerPath,
179115
+ configPath: data.config.config,
179560
179116
  containerOptions,
179561
- data.config.config,
179562
- (buildStartEvent) => {
179117
+ onContainerImagePreparationStart: /* @__PURE__ */ __name((buildStartEvent) => {
179563
179118
  this.containerBeingBuilt = {
179564
179119
  ...buildStartEvent,
179565
179120
  abortRequested: false
179566
179121
  };
179567
- },
179568
- () => {
179122
+ }, "onContainerImagePreparationStart"),
179123
+ onContainerImagePreparationEnd: /* @__PURE__ */ __name(() => {
179569
179124
  this.containerBeingBuilt = void 0;
179570
- }
179571
- );
179125
+ }, "onContainerImagePreparationEnd")
179126
+ });
179572
179127
  if (this.containerBeingBuilt) {
179573
179128
  this.containerBeingBuilt.abortRequested = false;
179574
179129
  }
@@ -179663,7 +179218,7 @@ var init_LocalRuntimeController = __esm({
179663
179218
  onPreviewTokenExpired(_4) {
179664
179219
  }
179665
179220
  cleanupContainers = /* @__PURE__ */ __name(async () => {
179666
- (0, import_node_assert31.default)(
179221
+ (0, import_node_assert32.default)(
179667
179222
  this.#dockerPath,
179668
179223
  "Docker path should have been set if containers are enabled"
179669
179224
  );
@@ -179732,11 +179287,11 @@ function ensureMatchingSql(options) {
179732
179287
  }
179733
179288
  return options;
179734
179289
  }
179735
- var import_node_assert32, import_node_crypto15, import_miniflare27, MultiworkerRuntimeController;
179290
+ var import_node_assert33, import_node_crypto15, import_miniflare27, MultiworkerRuntimeController;
179736
179291
  var init_MultiworkerRuntimeController = __esm({
179737
179292
  "src/api/startDevWorker/MultiworkerRuntimeController.ts"() {
179738
179293
  init_import_meta_url();
179739
- import_node_assert32 = __toESM(require("assert"));
179294
+ import_node_assert33 = __toESM(require("assert"));
179740
179295
  import_node_crypto15 = require("crypto");
179741
179296
  init_source();
179742
179297
  import_miniflare27 = require("miniflare");
@@ -179775,7 +179330,7 @@ var init_MultiworkerRuntimeController = __esm({
179775
179330
  }
179776
179331
  #mergedMfOptions() {
179777
179332
  const primary = [...this.#options.values()].find((o5) => o5.primary);
179778
- (0, import_node_assert32.default)(primary !== void 0);
179333
+ (0, import_node_assert33.default)(primary !== void 0);
179779
179334
  const secondary = [...this.#options.values()].filter((o5) => !o5.primary);
179780
179335
  return {
179781
179336
  ...primary.options,
@@ -180292,7 +179847,7 @@ function registerDevHotKeys(devEnv, args) {
180292
179847
  }
180293
179848
  }
180294
179849
  });
180295
- const newContainerBuildId = (0, import_crypto7.randomUUID)().slice(0, 8);
179850
+ const newContainerBuildId = (0, import_crypto8.randomUUID)().slice(0, 8);
180296
179851
  await Promise.all(
180297
179852
  devEnv.runtimes.map(async (runtime) => {
180298
179853
  if (runtime instanceof LocalRuntimeController) {
@@ -180350,11 +179905,11 @@ function registerDevHotKeys(devEnv, args) {
180350
179905
  ]);
180351
179906
  return unregisterHotKeys;
180352
179907
  }
180353
- var import_crypto7;
179908
+ var import_crypto8;
180354
179909
  var init_hotkeys = __esm({
180355
179910
  "src/dev/hotkeys.ts"() {
180356
179911
  init_import_meta_url();
180357
- import_crypto7 = require("crypto");
179912
+ import_crypto8 = require("crypto");
180358
179913
  init_LocalRuntimeController();
180359
179914
  init_cli_hotkeys();
180360
179915
  init_logger();
@@ -182621,11 +182176,11 @@ async function generateAssetsFetch(directory, log2) {
182621
182176
  return await generateResponse(request4);
182622
182177
  };
182623
182178
  }
182624
- var import_node_assert33, import_node_fs36, import_node_path66, import_mime3, import_miniflare29, import_undici24, ProxyDispatcher, invalidAssetsFetch;
182179
+ var import_node_assert34, import_node_fs36, import_node_path66, import_mime3, import_miniflare29, import_undici24, ProxyDispatcher, invalidAssetsFetch;
182625
182180
  var init_assets2 = __esm({
182626
182181
  "src/miniflare-cli/assets.ts"() {
182627
182182
  init_import_meta_url();
182628
- import_node_assert33 = __toESM(require("assert"));
182183
+ import_node_assert34 = __toESM(require("assert"));
182629
182184
  import_node_fs36 = require("fs");
182630
182185
  import_node_path66 = require("path");
182631
182186
  init_createMetadataObject();
@@ -182663,12 +182218,12 @@ var init_assets2 = __esm({
182663
182218
  * by the `fetch()` function before calling `dispatcher.dispatch()`.
182664
182219
  */
182665
182220
  static reinstateHostHeader(headers, host) {
182666
- (0, import_node_assert33.default)(headers, "Expected all proxy requests to contain headers.");
182667
- (0, import_node_assert33.default)(
182221
+ (0, import_node_assert34.default)(headers, "Expected all proxy requests to contain headers.");
182222
+ (0, import_node_assert34.default)(
182668
182223
  !Array.isArray(headers),
182669
182224
  "Expected proxy request headers to be a hash object"
182670
182225
  );
182671
- (0, import_node_assert33.default)(
182226
+ (0, import_node_assert34.default)(
182672
182227
  Object.keys(headers).every((h6) => h6.toLowerCase() !== "host"),
182673
182228
  "Expected Host header to have been deleted."
182674
182229
  );
@@ -182829,7 +182384,7 @@ async function setupDevEnv(devEnv, configPath, auth, args) {
182829
182384
  enableContainers: args.enableContainers,
182830
182385
  dockerPath: args.dockerPath,
182831
182386
  // initialise with a random id
182832
- containerBuildId: (0, import_node_crypto16.randomUUID)().slice(0, 8)
182387
+ containerBuildId: generateContainerBuildId()
182833
182388
  },
182834
182389
  legacy: {
182835
182390
  site: /* @__PURE__ */ __name((configParam) => {
@@ -182868,7 +182423,7 @@ async function startDev(args) {
182868
182423
  unregisterHotKeys?.();
182869
182424
  accountId = await requireAuth(config);
182870
182425
  if (hotkeysDisplayed) {
182871
- (0, import_node_assert34.default)(devEnv !== void 0);
182426
+ (0, import_node_assert35.default)(devEnv !== void 0);
182872
182427
  unregisterHotKeys = registerDevHotKeys(
182873
182428
  Array.isArray(devEnv) ? devEnv[0] : devEnv,
182874
182429
  args
@@ -182940,7 +182495,7 @@ async function startDev(args) {
182940
182495
  });
182941
182496
  if (!args.disableDevRegistry) {
182942
182497
  teardownRegistryPromise = devRegistry2((registry) => {
182943
- (0, import_node_assert34.default)(devEnv !== void 0 && !Array.isArray(devEnv));
182498
+ (0, import_node_assert35.default)(devEnv !== void 0 && !Array.isArray(devEnv));
182944
182499
  void updateDevEnvRegistry(devEnv, registry);
182945
182500
  });
182946
182501
  devEnv.runtimes.forEach((runtime) => {
@@ -182948,7 +182503,7 @@ async function startDev(args) {
182948
182503
  "reloadComplete",
182949
182504
  async (reloadEvent) => {
182950
182505
  if (!reloadEvent.config.dev?.remote) {
182951
- (0, import_node_assert34.default)(devEnv !== void 0 && !Array.isArray(devEnv));
182506
+ (0, import_node_assert35.default)(devEnv !== void 0 && !Array.isArray(devEnv));
182952
182507
  const { url: url4 } = await devEnv.proxy.ready.promise;
182953
182508
  await maybeRegisterLocalWorker(
182954
182509
  url4,
@@ -182979,7 +182534,7 @@ async function startDev(args) {
182979
182534
  ...Array.isArray(devEnv) ? devEnv.map((d6) => d6.teardown()) : [devEnv?.teardown()],
182980
182535
  (async () => {
182981
182536
  if (teardownRegistryPromise) {
182982
- (0, import_node_assert34.default)(devEnv === void 0 || !Array.isArray(devEnv));
182537
+ (0, import_node_assert35.default)(devEnv === void 0 || !Array.isArray(devEnv));
182983
182538
  const teardownRegistry = await teardownRegistryPromise;
182984
182539
  await teardownRegistry(devEnv?.config.latestConfig?.name);
182985
182540
  }
@@ -183056,7 +182611,10 @@ function getBindings2(configParam, env6, local, args, remoteBindingsEnabled = ge
183056
182611
  ({ binding, preview_id, id, experimental_remote }) => {
183057
182612
  if (!preview_id && !local) {
183058
182613
  throw new UserError(
183059
- `In development, you should use a separate kv namespace than the one you'd use in production. Please create a new kv namespace with "wrangler kv namespace create <name> --preview" and add its id as preview_id to the kv_namespace "${binding}" in your ${configFileName(configParam.configPath)} file`
182614
+ `In development, you should use a separate kv namespace than the one you'd use in production. Please create a new kv namespace with "wrangler kv namespace create <name> --preview" and add its id as preview_id to the kv_namespace "${binding}" in your ${configFileName(configParam.configPath)} file`,
182615
+ {
182616
+ telemetryMessage: "no preview kv namespace configured in remote dev"
182617
+ }
183060
182618
  );
183061
182619
  }
183062
182620
  return {
@@ -183103,7 +182661,10 @@ function getBindings2(configParam, env6, local, args, remoteBindingsEnabled = ge
183103
182661
  }) => {
183104
182662
  if (!preview_bucket_name && !local) {
183105
182663
  throw new UserError(
183106
- `In development, you should use a separate r2 bucket than the one you'd use in production. Please create a new r2 bucket with "wrangler r2 bucket create <name>" and add its name as preview_bucket_name to the r2_buckets "${binding}" in your ${configFileName(configParam.configPath)} file`
182664
+ `In development, you should use a separate r2 bucket than the one you'd use in production. Please create a new r2 bucket with "wrangler r2 bucket create <name>" and add its name as preview_bucket_name to the r2_buckets "${binding}" in your ${configFileName(configParam.configPath)} file`,
182665
+ {
182666
+ telemetryMessage: "no preview r2 bucket configured in remote dev"
182667
+ }
183107
182668
  );
183108
182669
  }
183109
182670
  return {
@@ -183132,7 +182693,8 @@ function getBindings2(configParam, env6, local, args, remoteBindingsEnabled = ge
183132
182693
  const connectionStringFromEnv = process.env[`WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_${hyperdrive.binding}`];
183133
182694
  if (local && connectionStringFromEnv === void 0 && hyperdrive.localConnectionString === void 0) {
183134
182695
  throw new UserError(
183135
- `When developing locally, you should use a local Postgres connection string to emulate Hyperdrive functionality. Please setup Postgres locally and set the value of the 'WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_${hyperdrive.binding}' variable or "${hyperdrive.binding}"'s "localConnectionString" to the Postgres connection string.`
182696
+ `When developing locally, you should use a local Postgres connection string to emulate Hyperdrive functionality. Please setup Postgres locally and set the value of the 'WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_${hyperdrive.binding}' variable or "${hyperdrive.binding}"'s "localConnectionString" to the Postgres connection string.`,
182697
+ { telemetryMessage: "no local hyperdrive connection string" }
183136
182698
  );
183137
182699
  }
183138
182700
  if (connectionStringFromEnv) {
@@ -183215,16 +182777,16 @@ function getAssetChangeMessage(eventName, assetPath) {
183215
182777
  }
183216
182778
  return message;
183217
182779
  }
183218
- var import_node_assert34, import_node_crypto16, import_node_events6, import_node_path67, import_node_util3, import_env2, dev;
182780
+ var import_node_assert35, import_node_events6, import_node_path67, import_node_util3, import_env2, dev;
183219
182781
  var init_dev2 = __esm({
183220
182782
  "src/dev.ts"() {
183221
182783
  init_import_meta_url();
183222
- import_node_assert34 = __toESM(require("assert"));
183223
- import_node_crypto16 = require("crypto");
182784
+ import_node_assert35 = __toESM(require("assert"));
183224
182785
  import_node_events6 = __toESM(require("events"));
183225
182786
  import_node_path67 = __toESM(require("path"));
183226
182787
  import_node_util3 = __toESM(require("util"));
183227
182788
  init_colors();
182789
+ init_containers_shared();
183228
182790
  import_env2 = __toESM(require_dist());
183229
182791
  init_esm2();
183230
182792
  init_api3();
@@ -183500,7 +183062,7 @@ var init_dev2 = __esm({
183500
183062
  },
183501
183063
  async handler(args) {
183502
183064
  const devInstance = await startDev(args);
183503
- (0, import_node_assert34.default)(devInstance.devEnv !== void 0);
183065
+ (0, import_node_assert35.default)(devInstance.devEnv !== void 0);
183504
183066
  await import_node_events6.default.once(devInstance.devEnv, "teardown");
183505
183067
  await Promise.all(devInstance.secondary.map((d6) => d6.teardown()));
183506
183068
  if (devInstance.teardownRegistryPromise) {
@@ -184020,8 +183582,8 @@ function unstable_getMiniflareWorkerOptions(configOrConfigPath, env6, options) {
184020
183582
  migrations: config.migrations,
184021
183583
  imagesLocalMode: !!options?.imagesLocalMode,
184022
183584
  tails: config.tail_consumers,
184023
- containers: void 0,
184024
- containerBuildId: void 0
183585
+ containers: config.containers,
183586
+ containerBuildId: options?.containerBuildId
184025
183587
  },
184026
183588
  options?.remoteProxyConnectionString,
184027
183589
  options?.remoteBindingsEnabled ?? false
@@ -184054,7 +183616,12 @@ function unstable_getMiniflareWorkerOptions(configOrConfigPath, env6, options) {
184054
183616
  {
184055
183617
  className: binding.class_name,
184056
183618
  scriptName: binding.script_name,
184057
- useSQLite
183619
+ useSQLite,
183620
+ container: getImageNameFromDOClassName({
183621
+ doClassName: binding.class_name,
183622
+ containers: config.containers,
183623
+ containerBuildId: options?.containerBuildId
183624
+ })
184058
183625
  }
184059
183626
  ];
184060
183627
  })
@@ -184072,6 +183639,7 @@ function unstable_getMiniflareWorkerOptions(configOrConfigPath, env6, options) {
184072
183639
  compatibilityDate: config.compatibility_date,
184073
183640
  compatibilityFlags: config.compatibility_flags,
184074
183641
  modulesRules,
183642
+ containerEngine: config.dev.container_engine ?? getDockerHost(),
184075
183643
  ...bindingOptions,
184076
183644
  ...sitesOptions,
184077
183645
  ...assetOptions
@@ -184096,6 +183664,7 @@ var init_platform = __esm({
184096
183664
  init_dev_registry();
184097
183665
  init_class_names_sqlite();
184098
183666
  init_miniflare();
183667
+ init_misc_variables();
184099
183668
  init_logger();
184100
183669
  init_sites();
184101
183670
  init_dedent();