wrangler 4.138.0 → 4.139.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -207,12 +207,13 @@ var init_environment = __esm({
207
207
  // ../workers-utils/src/config/exports.ts
208
208
  function hasKnownExportType(entry) {
209
209
  const type = entry?.type;
210
- return type === "durable-object" || type === "worker";
210
+ return type === "durable-object" || type === "worker" || type === "workflow";
211
211
  }
212
212
  function partitionExports(exports$1) {
213
213
  const partitioned = {
214
214
  "durable-object": {},
215
- worker: {}
215
+ worker: {},
216
+ workflow: {}
216
217
  };
217
218
  if (exports$1 === void 0) {
218
219
  return partitioned;
@@ -600,114 +601,13 @@ var init_config = __esm({
600
601
  }
601
602
  });
602
603
 
603
- // ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/date.js
604
- var DATE_TIME_RE, TomlDate;
605
- var init_date = __esm({
606
- "../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/date.js"() {
607
- init_import_meta_url();
608
- DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
609
- TomlDate = class _TomlDate2 extends Date {
610
- static {
611
- __name(this, "TomlDate");
612
- }
613
- #hasDate = false;
614
- #hasTime = false;
615
- #offset = null;
616
- constructor(date5) {
617
- let hasDate = true;
618
- let hasTime = true;
619
- let offset = "Z";
620
- if (typeof date5 === "string") {
621
- let match4 = date5.match(DATE_TIME_RE);
622
- if (match4) {
623
- if (!match4[1]) {
624
- hasDate = false;
625
- date5 = `0000-01-01T${date5}`;
626
- }
627
- hasTime = !!match4[2];
628
- hasTime && date5[10] === " " && (date5 = date5.replace(" ", "T"));
629
- if (match4[2] && +match4[2] > 23) {
630
- date5 = "";
631
- } else {
632
- offset = match4[3] || null;
633
- date5 = date5.toUpperCase();
634
- if (!offset && hasTime)
635
- date5 += "Z";
636
- }
637
- } else {
638
- date5 = "";
639
- }
640
- }
641
- super(date5);
642
- if (!isNaN(this.getTime())) {
643
- this.#hasDate = hasDate;
644
- this.#hasTime = hasTime;
645
- this.#offset = offset;
646
- }
647
- }
648
- isDateTime() {
649
- return this.#hasDate && this.#hasTime;
650
- }
651
- isLocal() {
652
- return !this.#hasDate || !this.#hasTime || !this.#offset;
653
- }
654
- isDate() {
655
- return this.#hasDate && !this.#hasTime;
656
- }
657
- isTime() {
658
- return this.#hasTime && !this.#hasDate;
659
- }
660
- isValid() {
661
- return this.#hasDate || this.#hasTime;
662
- }
663
- toISOString() {
664
- let iso = super.toISOString();
665
- if (this.isDate())
666
- return iso.slice(0, 10);
667
- if (this.isTime())
668
- return iso.slice(11, 23);
669
- if (this.#offset === null)
670
- return iso.slice(0, -1);
671
- if (this.#offset === "Z")
672
- return iso;
673
- let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);
674
- offset = this.#offset[0] === "-" ? offset : -offset;
675
- let offsetDate = new Date(this.getTime() - offset * 6e4);
676
- return offsetDate.toISOString().slice(0, -1) + this.#offset;
677
- }
678
- static wrapAsOffsetDateTime(jsDate, offset = "Z") {
679
- let date5 = new _TomlDate2(jsDate);
680
- date5.#offset = offset;
681
- return date5;
682
- }
683
- static wrapAsLocalDateTime(jsDate) {
684
- let date5 = new _TomlDate2(jsDate);
685
- date5.#offset = null;
686
- return date5;
687
- }
688
- static wrapAsLocalDate(jsDate) {
689
- let date5 = new _TomlDate2(jsDate);
690
- date5.#hasTime = false;
691
- date5.#offset = null;
692
- return date5;
693
- }
694
- static wrapAsLocalTime(jsDate) {
695
- let date5 = new _TomlDate2(jsDate);
696
- date5.#hasDate = false;
697
- date5.#offset = null;
698
- return date5;
699
- }
700
- };
701
- }
702
- });
703
-
704
- // ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/error.js
604
+ // ../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/error.js
705
605
  function getLineColFromPtr(string4, ptr) {
706
- let lines = string4.slice(0, ptr).split(/\r\n|\n|\r/g);
606
+ let lines = string4.slice(0, ptr).split(/\r?\n/);
707
607
  return [lines.length, lines.pop().length + 1];
708
608
  }
709
609
  function makeCodeBlock(string4, line, column) {
710
- let lines = string4.split(/\r\n|\n|\r/g);
610
+ let lines = string4.split(/\r?\n/);
711
611
  let codeblock = "";
712
612
  let numberLen = (Math.log10(line + 1) | 0) + 1;
713
613
  for (let i8 = line - 1; i8 <= line + 1; i8++) {
@@ -727,11 +627,11 @@ function makeCodeBlock(string4, line, column) {
727
627
  }
728
628
  var TomlError;
729
629
  var init_error = __esm({
730
- "../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/error.js"() {
630
+ "../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/error.js"() {
731
631
  init_import_meta_url();
732
632
  __name(getLineColFromPtr, "getLineColFromPtr");
733
633
  __name(makeCodeBlock, "makeCodeBlock");
734
- TomlError = class extends Error {
634
+ TomlError = class _TomlError extends Error {
735
635
  static {
736
636
  __name(this, "TomlError");
737
637
  }
@@ -748,78 +648,17 @@ ${codeblock}`, options);
748
648
  this.column = column;
749
649
  this.codeblock = codeblock;
750
650
  }
651
+ /** @internal */
652
+ static x(message, ctx, ptr) {
653
+ throw new _TomlError(message, { toml: ctx.s, ptr: ptr ?? ctx.p });
654
+ }
751
655
  };
752
656
  }
753
657
  });
754
658
 
755
- // ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/util.js
756
- function indexOfNewline(str, start = 0) {
757
- let idx = str.indexOf("\n", start);
758
- if (str.charCodeAt(idx - 1) === 13)
759
- idx--;
760
- return idx;
761
- }
762
- function skipComment(ctx) {
763
- for (; ctx.p < ctx.s.length; ctx.p++) {
764
- let c9 = ctx.s.charCodeAt(ctx.p);
765
- if (c9 === 10)
766
- break;
767
- if (c9 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
768
- ctx.p++;
769
- break;
770
- }
771
- if (c9 < 32 && c9 !== 9 || c9 === 127) {
772
- throw new TomlError("control characters are not allowed in comments", {
773
- toml: ctx.s,
774
- ptr: ctx.p
775
- });
776
- }
777
- }
778
- }
779
- function skipVoid(ctx, banNewLines, banComments) {
780
- let c9;
781
- while (1) {
782
- while ((c9 = ctx.s.charCodeAt(ctx.p)) === 32 || c9 === 9 || !banNewLines && (c9 === 10 || c9 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10))
783
- ctx.p++;
784
- if (banComments || c9 !== 35)
785
- break;
786
- skipComment(ctx);
787
- }
788
- }
789
- function skipUntil(ctx, sep8, end) {
790
- let ptr = ctx.p;
791
- if (!end) {
792
- ptr = indexOfNewline(ctx.s, ptr);
793
- ctx.p = ptr < 0 ? ctx.s.length : ptr;
794
- return;
795
- }
796
- for (; ctx.p < ctx.s.length; ctx.p++) {
797
- let c9 = ctx.s.charCodeAt(ctx.p);
798
- if (c9 === 35) {
799
- skipComment(ctx);
800
- } else if (c9 === end || c9 === sep8) {
801
- return;
802
- }
803
- }
804
- throw new TomlError("cannot find end of structure", {
805
- toml: ctx.s,
806
- ptr
807
- });
808
- }
809
- var init_util = __esm({
810
- "../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/util.js"() {
811
- init_import_meta_url();
812
- init_error();
813
- __name(indexOfNewline, "indexOfNewline");
814
- __name(skipComment, "skipComment");
815
- __name(skipVoid, "skipVoid");
816
- __name(skipUntil, "skipUntil");
817
- }
818
- });
819
-
820
- // ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/primitive.js
659
+ // ../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/primitive.js
821
660
  function parseString(ctx) {
822
- let start = ctx.p;
661
+ let startPtr = ctx.p;
823
662
  let c9 = ctx.s.charCodeAt(ctx.p++);
824
663
  let first = c9;
825
664
  let isLiteral = c9 === 39;
@@ -838,10 +677,7 @@ function parseString(ctx) {
838
677
  if (isMultiline && (c9 === 10 || c9 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) {
839
678
  state3 = state3 && 3;
840
679
  } else if (c9 < 32 && c9 !== 9 || c9 === 127) {
841
- throw new TomlError("control characters are not allowed in strings", {
842
- toml: ctx.s,
843
- ptr: ctx.p
844
- });
680
+ TomlError.x("control characters are not allowed in strings", ctx);
845
681
  } else if ((!state3 || state3 === 3) && c9 === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) {
846
682
  if (isMultiline) {
847
683
  if (ctx.s.charCodeAt(ctx.p + 3) === first)
@@ -849,8 +685,10 @@ function parseString(ctx) {
849
685
  if (ctx.s.charCodeAt(ctx.p + 3) === first)
850
686
  ctx.p++;
851
687
  }
852
- if (!state3)
853
- parsed += ctx.s.slice(sliceStart, ctx.p);
688
+ if (!state3) {
689
+ let s8 = ctx.s.slice(sliceStart, ctx.p);
690
+ parsed = parsed ? parsed + s8 : s8;
691
+ }
854
692
  ctx.p += isMultiline ? 3 : 1;
855
693
  return parsed;
856
694
  } else if (!state3) {
@@ -860,10 +698,11 @@ function parseString(ctx) {
860
698
  }
861
699
  } else if (state3 === 1) {
862
700
  if (c9 === 120 || c9 === 117 || c9 === 85) {
701
+ let errPtr = ctx.p++ - 1;
863
702
  let value = 0;
864
703
  let len = c9 === 120 ? 2 : c9 === 117 ? 4 : 8;
865
704
  for (let j8 = 0; j8 < len; j8++, ctx.p++) {
866
- let hex3 = ctx.s.charCodeAt(ctx.p + 1);
705
+ let hex3 = ctx.s.charCodeAt(ctx.p);
867
706
  let digit = (
868
707
  /* 0-9 */
869
708
  hex3 >= 48 && hex3 <= 57 ? hex3 - 48 : (
@@ -875,16 +714,16 @@ function parseString(ctx) {
875
714
  )
876
715
  );
877
716
  if (digit < 0)
878
- throw new TomlError("invalid non-hex character in unicode escape", { toml: ctx.s, ptr: ctx.p + 1 });
717
+ TomlError.x("invalid non-hex character in unicode escape", ctx);
879
718
  value = value << 4 | digit;
880
719
  }
881
720
  if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) {
882
- throw new TomlError("invalid unicode escape", { toml: ctx.s, ptr: ctx.p });
721
+ TomlError.x("invalid unicode escape", ctx, errPtr);
883
722
  }
884
723
  parsed += String.fromCodePoint(value);
885
- sliceStart = ctx.p + 1;
724
+ sliceStart = ctx.p--;
886
725
  state3 = 0;
887
- } else if (c9 === 32 || c9 === 9) {
726
+ } else if (isMultiline && (c9 === 32 || c9 === 9)) {
888
727
  state3 = 2;
889
728
  } else {
890
729
  if (c9 === 98)
@@ -904,99 +743,166 @@ function parseString(ctx) {
904
743
  else if (c9 === 92)
905
744
  parsed += "\\";
906
745
  else
907
- throw new TomlError("unrecognized escape sequence", { toml: ctx.s, ptr: ctx.p });
746
+ TomlError.x("unrecognised escape sequence", ctx);
908
747
  sliceStart = ctx.p + 1;
909
748
  state3 = 0;
910
749
  }
911
750
  } else if (c9 !== 32 && c9 !== 9) {
912
- if (state3 === 2) {
913
- throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
914
- toml: ctx.s,
915
- ptr: sliceStart
916
- });
917
- }
751
+ if (state3 === 2)
752
+ TomlError.x("invalid escape: only line-ending whitespace may be escaped", ctx, sliceStart);
918
753
  state3 = !isLiteral && c9 === 92 ? 1 : 0;
919
754
  sliceStart = ctx.p;
920
755
  }
921
756
  }
922
- throw new TomlError("unfinished string", { toml: ctx.s, ptr: start });
923
- }
924
- function sliceAndTrimEndOf(ctx, start, end) {
925
- let value = ctx.s.slice(start, end);
926
- let commentIdx = value.indexOf("#");
927
- if (commentIdx > 0) {
928
- skipComment({ s: value, p: commentIdx});
929
- value = value.slice(0, commentIdx);
930
- }
931
- return value.trimEnd();
932
- }
933
- function parseValue(ctx, integersAsBigInt, end) {
934
- let ptr = ctx.p;
935
- let err = { toml: ctx.s, ptr };
936
- skipUntil(ctx, 44, end);
937
- let value = sliceAndTrimEndOf(ctx, ptr, ctx.p);
938
- if (!value)
939
- throw new TomlError("incomplete declaration: value expected", err);
940
- if (value === "-inf")
941
- return -Infinity;
942
- if (value === "inf" || value === "+inf")
943
- return Infinity;
944
- if (value === "nan" || value === "+nan" || value === "-nan")
945
- return NaN;
946
- if (value === "-0")
947
- return integersAsBigInt ? 0n : 0;
948
- let isInt = INT_REGEX.test(value);
949
- if (isInt || FLOAT_REGEX.test(value)) {
950
- if (LEADING_ZERO.test(value)) {
951
- throw new TomlError("leading zeroes are not allowed", err);
952
- }
953
- value = value.replace(/_/g, "");
954
- let numeric2 = +value;
955
- if (isNaN(numeric2)) {
956
- throw new TomlError("invalid number", err);
957
- }
958
- if (isInt) {
959
- if ((isInt = !Number.isSafeInteger(numeric2)) && !integersAsBigInt) {
960
- throw new TomlError("integer value cannot be represented losslessly", err);
961
- }
962
- if (isInt || integersAsBigInt === true)
963
- numeric2 = BigInt(value);
964
- }
965
- return numeric2;
966
- }
967
- const date5 = new TomlDate(value);
968
- if (!date5.isValid())
969
- throw new TomlError("invalid value", err);
970
- return date5;
757
+ TomlError.x("unfinished string", ctx, startPtr);
971
758
  }
972
- var INT_REGEX, FLOAT_REGEX, LEADING_ZERO;
973
759
  var init_primitive = __esm({
974
- "../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/primitive.js"() {
760
+ "../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/primitive.js"() {
975
761
  init_import_meta_url();
976
- init_date();
977
762
  init_error();
978
- init_util();
979
- INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
980
- FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
981
- LEADING_ZERO = /^[+-]?0[0-9_]/;
982
763
  __name(parseString, "parseString");
983
- __name(sliceAndTrimEndOf, "sliceAndTrimEndOf");
984
- __name(parseValue, "parseValue");
985
764
  }
986
765
  });
987
766
 
988
- // ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/extract.js
989
- function extractValue(ctx, end, integersAsBigInt) {
990
- let ptr = ctx.p;
991
- let c9 = ctx.s.charCodeAt(ptr);
767
+ // ../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/date.js
768
+ var DATE_TIME_RE, TomlDate;
769
+ var init_date = __esm({
770
+ "../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/date.js"() {
771
+ init_import_meta_url();
772
+ DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[Tt ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|z|[-+]\d{2}:\d{2})?$/i;
773
+ TomlDate = class _TomlDate extends Date {
774
+ static {
775
+ __name(this, "TomlDate");
776
+ }
777
+ #hasDate = false;
778
+ #hasTime = false;
779
+ #offset = null;
780
+ constructor(date5, fasttype, unsafeDelim) {
781
+ let hasDate = true;
782
+ let hasTime = true;
783
+ let offset = "Z";
784
+ let c9;
785
+ if (typeof date5 === "string") {
786
+ if (fasttype)
787
+ prep: {
788
+ if (fasttype < 3) {
789
+ if (+date5.slice(11, 13) > 23) {
790
+ date5 = "";
791
+ break prep;
792
+ }
793
+ if (fasttype === 2) {
794
+ offset = null;
795
+ date5 += "Z";
796
+ } else if ((c9 = date5.charCodeAt(date5.length - 1)) !== 90 && c9 !== 122) {
797
+ offset = date5.slice(date5.length - 6);
798
+ }
799
+ if (unsafeDelim)
800
+ date5 = date5.slice(0, 10) + "T" + date5.slice(11);
801
+ } else if (fasttype === 4) {
802
+ date5 = +date5.slice(0, 2) > 23 ? "" : `0000-01-01T${date5}Z`;
803
+ }
804
+ hasDate = fasttype !== 4;
805
+ hasTime = fasttype !== 3;
806
+ }
807
+ else {
808
+ let match4 = date5.match(DATE_TIME_RE);
809
+ if (match4) {
810
+ if (!match4[1]) {
811
+ hasDate = false;
812
+ date5 = `0000-01-01T${date5}`;
813
+ }
814
+ hasTime = !!match4[2];
815
+ hasTime && date5[10] === " " && (date5 = date5.replace(" ", "T"));
816
+ if (match4[2] && +match4[2] > 23) {
817
+ date5 = "";
818
+ } else {
819
+ offset = match4[3] || null;
820
+ if (!offset && hasTime)
821
+ date5 += "Z";
822
+ }
823
+ } else {
824
+ date5 = "";
825
+ }
826
+ }
827
+ }
828
+ super(date5);
829
+ if (!isNaN(this.getTime())) {
830
+ this.#hasDate = hasDate;
831
+ this.#hasTime = hasTime;
832
+ this.#offset = offset;
833
+ }
834
+ }
835
+ isDateTime() {
836
+ return this.#hasDate && this.#hasTime;
837
+ }
838
+ isLocal() {
839
+ return !this.#hasDate || !this.#hasTime || !this.#offset;
840
+ }
841
+ isDate() {
842
+ return this.#hasDate && !this.#hasTime;
843
+ }
844
+ isTime() {
845
+ return this.#hasTime && !this.#hasDate;
846
+ }
847
+ isValid() {
848
+ return this.#hasDate || this.#hasTime;
849
+ }
850
+ toISOString() {
851
+ let iso = super.toISOString();
852
+ if (this.isDate())
853
+ return iso.slice(0, 10);
854
+ if (this.isTime())
855
+ return iso.slice(11, 23);
856
+ if (this.#offset === null)
857
+ return iso.slice(0, -1);
858
+ if (this.#offset === "Z" || this.#offset === "z")
859
+ return iso;
860
+ let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);
861
+ offset = this.#offset[0] === "-" ? offset : -offset;
862
+ let offsetDate = new Date(this.getTime() - offset * 6e4);
863
+ return offsetDate.toISOString().slice(0, -1) + this.#offset;
864
+ }
865
+ static wrapAsOffsetDateTime(jsDate, offset = "Z") {
866
+ let date5 = new _TomlDate(jsDate);
867
+ date5.#offset = offset;
868
+ return date5;
869
+ }
870
+ static wrapAsLocalDateTime(jsDate) {
871
+ let date5 = new _TomlDate(jsDate);
872
+ date5.#offset = null;
873
+ return date5;
874
+ }
875
+ static wrapAsLocalDate(jsDate) {
876
+ let date5 = new _TomlDate(jsDate);
877
+ date5.#hasTime = false;
878
+ date5.#offset = null;
879
+ return date5;
880
+ }
881
+ static wrapAsLocalTime(jsDate) {
882
+ let date5 = new _TomlDate(jsDate);
883
+ date5.#hasDate = false;
884
+ date5.#offset = null;
885
+ return date5;
886
+ }
887
+ };
888
+ }
889
+ });
890
+
891
+ // ../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/extract.js
892
+ function isDigit(char, base = 10) {
893
+ return base === 16 ? char > 47 && char < 58 || char > 64 && char < 71 || char > 96 && char < 103 : char > 47 && char < 48 + base;
894
+ }
895
+ function isEndOfValue(char, delim) {
896
+ return char === 32 || char === 9 || char === 10 || char === 13 || // Structure end or next value delimiter
897
+ delim && (char === delim || char === 44) || // Comment
898
+ char === 35;
899
+ }
900
+ function extractValue(ctx, end) {
901
+ let errPtr = ctx.p;
902
+ let c9 = ctx.s.charCodeAt(ctx.p);
992
903
  if (c9 === 91 || c9 === 123) {
993
- if (!ctx.d--) {
994
- throw new TomlError("document contains excessively nested structures. aborting.", {
995
- toml: ctx.s,
996
- ptr
997
- });
998
- }
999
- let value = c9 === 91 ? parseArray(ctx, integersAsBigInt) : parseInlineTable(ctx, integersAsBigInt);
904
+ ctx.d-- || TomlError.x("document contains excessively nested structures. aborting.", ctx);
905
+ let value = c9 === 91 ? parseArray(ctx) : parseInlineTable(ctx);
1000
906
  ctx.d++;
1001
907
  return value;
1002
908
  }
@@ -1005,98 +911,287 @@ function extractValue(ctx, end, integersAsBigInt) {
1005
911
  }
1006
912
  if (c9 === 116) {
1007
913
  if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101)
1008
- throw new TomlError("invalid value", { toml: ctx.s, ptr });
1009
- ctx.p++;
1010
- return true;
914
+ TomlError.x("invalid value", ctx, errPtr);
915
+ return ctx.p++, true;
1011
916
  }
1012
917
  if (c9 === 102) {
1013
918
  if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101)
1014
- throw new TomlError("invalid value", { toml: ctx.s, ptr });
1015
- ctx.p++;
1016
- return false;
919
+ TomlError.x("invalid value", ctx, errPtr);
920
+ return ctx.p++, false;
921
+ }
922
+ if (c9 === 43 || c9 === 45) {
923
+ return parseNumber(ctx, ctx.p, ctx.s.charCodeAt(++ctx.p), 44 - c9, end);
924
+ }
925
+ if (ctx.s.charCodeAt(ctx.p + 4) === 45 && ctx.s.charCodeAt(ctx.p + 7) === 45) {
926
+ return parseDate(ctx, c9, end);
927
+ }
928
+ if (ctx.s.charCodeAt(ctx.p + 2) === 58) {
929
+ return parseTime(ctx, c9, end);
930
+ }
931
+ return parseNumber(ctx, ctx.p, c9, 0, end);
932
+ }
933
+ function parseNumber(ctx, startPtr, startChr, sign, endChr) {
934
+ let c9 = startChr;
935
+ let state3 = 0;
936
+ let hasUnderscores = false;
937
+ if (c9 === 105) {
938
+ if (ctx.s.charCodeAt(++ctx.p) !== 110 || ctx.s.charCodeAt(++ctx.p) !== 102)
939
+ TomlError.x("invalid value", ctx, startPtr);
940
+ return ctx.p++, (sign || 1) / 0;
941
+ }
942
+ if (c9 === 110) {
943
+ if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 110)
944
+ TomlError.x("invalid value", ctx, startPtr);
945
+ return ctx.p++, NaN;
946
+ }
947
+ if (c9 === 48) {
948
+ if (++ctx.p >= ctx.s.length || isEndOfValue(c9 = ctx.s.charCodeAt(ctx.p), endChr))
949
+ return ctx.bi === true ? 0n : 0;
950
+ if (!sign) {
951
+ if (c9 === 120)
952
+ return parseIntegerBaseN(ctx, startPtr, 16, endChr);
953
+ else if (c9 === 98)
954
+ return parseIntegerBaseN(ctx, startPtr, 2, endChr);
955
+ else if (c9 === 111)
956
+ return parseIntegerBaseN(ctx, startPtr, 8, endChr);
957
+ }
958
+ if (c9 === 46)
959
+ state3 = 2;
960
+ else if (c9 === 101 || c9 === 69)
961
+ state3 = 4;
962
+ else
963
+ TomlError.x("illegal leading zero", ctx, startPtr);
964
+ } else if (!isDigit(c9))
965
+ TomlError.x("invalid value", ctx, startPtr);
966
+ while (++ctx.p < ctx.s.length && (c9 = ctx.s.charCodeAt(ctx.p), !isEndOfValue(c9, endChr))) {
967
+ if (!state3)
968
+ state3 = 1;
969
+ if (c9 === 95) {
970
+ if (!(state3 & 1))
971
+ TomlError.x("illegal underscore", ctx);
972
+ state3 += 11;
973
+ hasUnderscores = true;
974
+ } else if (state3 === 1 && c9 === 46)
975
+ state3 = 2;
976
+ else if ((state3 === 1 || state3 === 3) && (c9 === 101 || c9 === 69))
977
+ state3 = 4;
978
+ else if (state3 === 4 && (c9 === 43 || c9 === 45)) ; else if (!isDigit(c9))
979
+ TomlError.x(`illegal character in numeric literal`, ctx);
980
+ else if (state3 > 9)
981
+ state3 -= 11;
982
+ else if (!(state3 & 1))
983
+ state3++;
984
+ }
985
+ if (!state3) {
986
+ let val2 = (startChr - 48) * (sign || 1);
987
+ return ctx.bi === true ? BigInt(val2) : val2;
988
+ }
989
+ if (!(state3 & 1))
990
+ TomlError.x("unfinished numeric value", ctx, startPtr);
991
+ let str = ctx.s.slice(startPtr, ctx.p);
992
+ if (hasUnderscores)
993
+ str = str.replaceAll("_", "");
994
+ return state3 > 1 ? parseFloat(str) : parseInteger(ctx, str, 10, startPtr);
995
+ }
996
+ function parseIntegerBaseN(ctx, startPtr, base, endChr) {
997
+ let c9, underscore = 1;
998
+ while (++ctx.p < ctx.s.length && (c9 = ctx.s.charCodeAt(ctx.p), !isEndOfValue(c9, endChr))) {
999
+ if (c9 === 95) {
1000
+ if (underscore & 1)
1001
+ TomlError.x("illegal underscore", ctx);
1002
+ underscore = 3;
1003
+ } else if (!isDigit(c9, base))
1004
+ TomlError.x(`illegal character in numeric literal`, ctx);
1005
+ else if (underscore & 1)
1006
+ underscore--;
1007
+ }
1008
+ if (underscore & 1)
1009
+ TomlError.x("unfinished numeric value", ctx);
1010
+ let str = ctx.s.slice(startPtr + 2, ctx.p);
1011
+ if (underscore)
1012
+ str = str.replaceAll("_", "");
1013
+ return parseInteger(ctx, str, base, startPtr);
1014
+ }
1015
+ function parseInteger(ctx, str, base, startPtr) {
1016
+ if (ctx.bi !== true)
1017
+ int: {
1018
+ let val2 = parseInt(str, base);
1019
+ if (!Number.isSafeInteger(val2)) {
1020
+ if (ctx.bi)
1021
+ break int;
1022
+ TomlError.x("integer value cannot be represented losslessly", ctx, startPtr);
1023
+ }
1024
+ return val2;
1025
+ }
1026
+ return base === 10 ? BigInt(str) : BigInt((base === 2 ? "0b" : base === 8 ? "0o" : "0x") + str);
1027
+ }
1028
+ function parseDate(ctx, c9, endChr) {
1029
+ let startPtr = ctx.p++, unsafeSeparator;
1030
+ if (!isDigit(c9) || !isDigit(ctx.s.charCodeAt(ctx.p++)) || !isDigit(ctx.s.charCodeAt(ctx.p++)) || !isDigit(ctx.s.charCodeAt(ctx.p++))) {
1031
+ return parseNumber(ctx, ctx.p = startPtr, c9, 0, endChr);
1032
+ }
1033
+ ctx.p += 5;
1034
+ if (!isDigit(ctx.s.charCodeAt(ctx.p++)))
1035
+ TomlError.x("invalid date-time: date part is malformed", ctx, startPtr);
1036
+ if (ctx.p >= ctx.s.length || ((c9 = ctx.s.charCodeAt(ctx.p)) !== 32 || (unsafeSeparator = true, !isDigit(ctx.s.charCodeAt(ctx.p + 1)))) && c9 !== 84 && c9 !== 116) {
1037
+ let t15 = ctx.s.slice(startPtr, ctx.p);
1038
+ return readDate(ctx, t15, 3, false, startPtr);
1039
+ }
1040
+ if (ctx.s.charCodeAt(ctx.p += 3) !== 58)
1041
+ TomlError.x("invalid date-time: time part is malformed", ctx, startPtr);
1042
+ if (ctx.s.charCodeAt(ctx.p += 3) === 58)
1043
+ ctx.p += 3;
1044
+ if (ctx.s.charCodeAt(ctx.p) === 46)
1045
+ while (isDigit(ctx.s.charCodeAt(++ctx.p)))
1046
+ ;
1047
+ if (c9 = ctx.s.charCodeAt(ctx.p)) {
1048
+ if (c9 === 90 || c9 === 122) {
1049
+ let t15 = ctx.s.slice(startPtr, ++ctx.p);
1050
+ return readDate(ctx, t15, 1, unsafeSeparator, startPtr, "[+00:00]");
1051
+ }
1052
+ if (c9 === 43 || c9 === 45) {
1053
+ let t15 = ctx.s.slice(startPtr, ctx.p += 6);
1054
+ return readDate(ctx, t15, 1, unsafeSeparator, startPtr, !ctx.ld && "[" + ctx.s.slice(ctx.p - 6, ctx.p) + "]");
1055
+ }
1056
+ }
1057
+ let t14 = ctx.s.slice(startPtr, ctx.p);
1058
+ return readDate(ctx, t14, 2, unsafeSeparator, startPtr);
1059
+ }
1060
+ function parseTime(ctx, c9, endChr) {
1061
+ let start = ctx.p;
1062
+ if (!isDigit(c9) || !isDigit(ctx.s.charCodeAt(++ctx.p))) {
1063
+ return parseNumber(ctx, --ctx.p, c9, 0, endChr);
1064
+ }
1065
+ if (ctx.s.charCodeAt(ctx.p += 4) === 58)
1066
+ ctx.p += 3;
1067
+ if (ctx.s.charCodeAt(ctx.p) === 46)
1068
+ while (isDigit(ctx.s.charCodeAt(++ctx.p)))
1069
+ ;
1070
+ let t14 = ctx.s.slice(start, ctx.p);
1071
+ return readDate(ctx, t14, 4, false, start);
1072
+ }
1073
+ function readDate(ctx, str, type, unsafeDelim, errPtr, temporalSuffix) {
1074
+ if (ctx.ld) {
1075
+ let date5 = new TomlDate(str, type, unsafeDelim);
1076
+ if (!date5.isValid())
1077
+ TomlError.x("invalid date", ctx, errPtr);
1078
+ return date5;
1079
+ }
1080
+ try {
1081
+ if (temporalSuffix)
1082
+ str += temporalSuffix;
1083
+ switch (type) {
1084
+ case 1:
1085
+ return Temporal.ZonedDateTime.from(str);
1086
+ case 2:
1087
+ return Temporal.PlainDateTime.from(str);
1088
+ case 3:
1089
+ return Temporal.PlainDate.from(str);
1090
+ case 4:
1091
+ return Temporal.PlainTime.from(str);
1092
+ }
1093
+ } catch (e11) {
1094
+ TomlError.x(e11 instanceof Error ? e11.message : "" + e11, ctx, errPtr);
1017
1095
  }
1018
- return parseValue(ctx, integersAsBigInt, end);
1019
1096
  }
1020
1097
  var init_extract = __esm({
1021
- "../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/extract.js"() {
1098
+ "../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/extract.js"() {
1022
1099
  init_import_meta_url();
1023
1100
  init_primitive();
1024
1101
  init_struct();
1025
1102
  init_error();
1103
+ init_date();
1104
+ __name(isDigit, "isDigit");
1105
+ __name(isEndOfValue, "isEndOfValue");
1026
1106
  __name(extractValue, "extractValue");
1107
+ __name(parseNumber, "parseNumber");
1108
+ __name(parseIntegerBaseN, "parseIntegerBaseN");
1109
+ __name(parseInteger, "parseInteger");
1110
+ __name(parseDate, "parseDate");
1111
+ __name(parseTime, "parseTime");
1112
+ __name(readDate, "readDate");
1027
1113
  }
1028
1114
  });
1029
1115
 
1030
- // ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/struct.js
1031
- function parseKey(ctx, end = "=") {
1032
- let start = ctx.p;
1033
- let dot = start - 1;
1034
- let parsed = [];
1035
- let endPtr = ctx.s.indexOf(end, start);
1036
- if (endPtr < 0) {
1037
- throw new TomlError("incomplete key-value: cannot find end of key", {
1038
- toml: ctx.s,
1039
- ptr: start
1040
- });
1116
+ // ../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/util.js
1117
+ function skipComment(ctx) {
1118
+ for (; ctx.p < ctx.s.length; ctx.p++) {
1119
+ let c9 = ctx.s.charCodeAt(ctx.p);
1120
+ if (c9 === 10)
1121
+ break;
1122
+ if (c9 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
1123
+ ctx.p++;
1124
+ break;
1125
+ }
1126
+ if (c9 < 32 && c9 !== 9 || c9 === 127) {
1127
+ TomlError.x("control characters are not allowed in comments", ctx);
1128
+ }
1129
+ }
1130
+ }
1131
+ function skipVoid(ctx, banNewLines, banComments) {
1132
+ let c9;
1133
+ while (ctx.p < ctx.s.length) {
1134
+ while (ctx.p < ctx.s.length && ((c9 = ctx.s.charCodeAt(ctx.p)) === 32 || c9 === 9 || !banNewLines && (c9 === 10 || c9 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)))
1135
+ ctx.p++;
1136
+ if (banComments || c9 !== 35)
1137
+ break;
1138
+ skipComment(ctx);
1139
+ }
1140
+ }
1141
+ var init_util = __esm({
1142
+ "../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/util.js"() {
1143
+ init_import_meta_url();
1144
+ init_error();
1145
+ __name(skipComment, "skipComment");
1146
+ __name(skipVoid, "skipVoid");
1041
1147
  }
1148
+ });
1149
+
1150
+ // ../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/struct.js
1151
+ function parseKey(ctx, end = 61) {
1152
+ let startPtr;
1153
+ let state3 = 0;
1154
+ let parsed = [];
1155
+ let sliceStart;
1156
+ let c9 = ctx.s.charCodeAt(startPtr = ctx.p);
1042
1157
  do {
1043
- let c9 = ctx.s.charCodeAt(ctx.p = ++dot);
1044
- if (c9 !== 32 && c9 !== 9) {
1045
- if (c9 === 34 || c9 === 39) {
1046
- if (c9 === ctx.s.charCodeAt(ctx.p + 1) && c9 === ctx.s.charCodeAt(ctx.p + 2)) {
1047
- throw new TomlError("multiline strings are not allowed in keys", {
1048
- toml: ctx.s,
1049
- ptr: ctx.p
1050
- });
1051
- }
1052
- let part = parseString(ctx);
1053
- dot = ctx.s.indexOf(".", ctx.p);
1054
- let strEnd = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
1055
- let newLine = indexOfNewline(strEnd);
1056
- if (newLine > -1) {
1057
- throw new TomlError("newlines are not allowed in keys", {
1058
- toml: ctx.s,
1059
- ptr: newLine
1060
- });
1061
- }
1062
- if (strEnd.trimStart()) {
1063
- throw new TomlError("found extra tokens after the string part", {
1064
- toml: ctx.s,
1065
- ptr: ctx.p
1066
- });
1067
- }
1068
- if (endPtr < ctx.p) {
1069
- endPtr = ctx.s.indexOf(end, ctx.p);
1070
- if (endPtr < 0) {
1071
- throw new TomlError("incomplete key-value: cannot find end of key", {
1072
- toml: ctx.s,
1073
- ptr: start
1074
- });
1075
- }
1076
- }
1077
- parsed.push(part);
1078
- } else {
1079
- dot = ctx.s.indexOf(".", ctx.p);
1080
- let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
1081
- if (!KEY_PART_RE.test(part)) {
1082
- throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
1083
- toml: ctx.s,
1084
- ptr: ctx.p
1085
- });
1086
- }
1087
- parsed.push(part.trimEnd());
1158
+ if (c9 === end) {
1159
+ if (!state3)
1160
+ TomlError.x("unexpected end of key", ctx);
1161
+ if (state3 === 1)
1162
+ parsed.push(ctx.s.slice(sliceStart, ctx.p));
1163
+ return ctx.p++, parsed;
1164
+ } else if (c9 === 46) {
1165
+ if (!state3)
1166
+ TomlError.x("illegal empty bare key", ctx);
1167
+ if (state3 === 1)
1168
+ parsed.push(ctx.s.slice(sliceStart, ctx.p));
1169
+ state3 = 0;
1170
+ } else if (!state3 && (c9 === 34 || c9 === 39)) {
1171
+ if (c9 === ctx.s.charCodeAt(ctx.p + 1) && c9 === ctx.s.charCodeAt(ctx.p + 2))
1172
+ TomlError.x("illegal quoted key: multiline strings are not allowed", ctx);
1173
+ parsed.push(parseString(ctx));
1174
+ state3 = 2;
1175
+ ctx.p--;
1176
+ } else if (c9 === 32 || c9 === 9) {
1177
+ if (state3 === 1) {
1178
+ parsed.push(ctx.s.slice(sliceStart, ctx.p));
1179
+ state3 = 2;
1088
1180
  }
1181
+ } else if (state3 === 2 || c9 < 48 && c9 !== 45 || c9 > 57 && c9 < 65 || c9 > 90 && c9 < 97 && c9 !== 95 || c9 > 122) {
1182
+ TomlError.x("illegal character in key", ctx);
1183
+ } else if (!state3) {
1184
+ state3 = 1;
1185
+ sliceStart = ctx.p;
1089
1186
  }
1090
- } while (dot + 1 && dot < endPtr);
1091
- ctx.p = endPtr + 1;
1092
- skipVoid(ctx, true, true);
1093
- return parsed;
1187
+ } while (c9 = ctx.s.charCodeAt(++ctx.p));
1188
+ TomlError.x("incomplete key-value: cannot find end of key", ctx, startPtr);
1094
1189
  }
1095
- function parseInlineTable(ctx, integersAsBigInt) {
1096
- let res = {};
1190
+ function parseInlineTable(ctx) {
1191
+ let startPtr = ctx.p++;
1192
+ let res = /* @__PURE__ */ Object.create(null);
1097
1193
  let seen = /* @__PURE__ */ new Set();
1098
1194
  let c9;
1099
- ctx.p++;
1100
1195
  while (ctx.p < ctx.s.length) {
1101
1196
  skipVoid(ctx);
1102
1197
  if ((c9 = ctx.s.charCodeAt(ctx.p)) === 125) {
@@ -1106,84 +1201,83 @@ function parseInlineTable(ctx, integersAsBigInt) {
1106
1201
  let k7;
1107
1202
  let t14 = res;
1108
1203
  let hasOwn2 = false;
1109
- let p8 = ctx.p;
1204
+ let errPtr = ctx.p;
1110
1205
  let key = parseKey(ctx);
1111
1206
  for (let i8 = 0; i8 < key.length; i8++) {
1112
1207
  if (i8)
1113
- t14 = hasOwn2 ? t14[k7] : t14[k7] = {};
1208
+ t14 = hasOwn2 ? t14[k7] : t14[k7] = /* @__PURE__ */ Object.create(null);
1114
1209
  k7 = key[i8];
1115
1210
  if ((hasOwn2 = Object.hasOwn(t14, k7)) && (typeof t14[k7] !== "object" || seen.has(t14[k7]))) {
1116
- throw new TomlError("trying to redefine an already defined value", {
1117
- toml: ctx.s,
1118
- ptr: p8
1119
- });
1211
+ TomlError.x("trying to redefine an already defined value", ctx, errPtr);
1120
1212
  }
1121
- if (!hasOwn2 && k7 === "__proto__") {
1213
+ let unsafe = k7 === "__proto__";
1214
+ if (ctx.uk && (unsafe || k7 === "constructor")) {
1215
+ t14 = ctx.uk !== 1 && TomlError.x("document contains an unsafe property", ctx, errPtr);
1216
+ break;
1217
+ }
1218
+ if (!hasOwn2 && unsafe) {
1122
1219
  Object.defineProperty(t14, k7, { enumerable: true, configurable: true, writable: true });
1123
1220
  }
1124
1221
  }
1125
1222
  if (hasOwn2) {
1126
- throw new TomlError("trying to redefine an already defined value", {
1127
- toml: ctx.s,
1128
- ptr: ctx.p
1129
- });
1223
+ TomlError.x("trying to redefine an already defined value", ctx, errPtr);
1130
1224
  }
1131
- let value = extractValue(ctx, 125, integersAsBigInt);
1132
- seen.add(t14[k7] = value);
1225
+ skipVoid(ctx, true, true);
1226
+ let value = extractValue(
1227
+ ctx,
1228
+ 125
1229
+ /* } */
1230
+ );
1231
+ if (t14 && typeof (t14[k7] = value) === "object")
1232
+ seen.add(value);
1133
1233
  skipVoid(ctx);
1134
1234
  if ((c9 = ctx.s.charCodeAt(ctx.p++)) === 125) {
1135
1235
  return res;
1136
1236
  }
1137
- if (c9 !== 44) {
1138
- throw new TomlError("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
1139
- }
1237
+ if (c9 !== 44)
1238
+ TomlError.x("expected comma or end of structure", ctx, ctx.p - 1);
1140
1239
  }
1141
- throw new TomlError("unfinished table encountered", {
1142
- toml: ctx.s,
1143
- ptr: ctx.p
1144
- });
1240
+ TomlError.x("unfinished table", ctx, startPtr);
1145
1241
  }
1146
- function parseArray(ctx, integersAsBigInt) {
1242
+ function parseArray(ctx) {
1243
+ let startPtr = ctx.p++;
1147
1244
  let res = [];
1148
1245
  let c9;
1149
- ctx.p++;
1150
1246
  while (ctx.p < ctx.s.length) {
1151
1247
  skipVoid(ctx);
1152
1248
  if ((c9 = ctx.s.charCodeAt(ctx.p)) === 93) {
1153
1249
  ctx.p++;
1154
1250
  return res;
1155
1251
  }
1156
- res.push(extractValue(ctx, 93, integersAsBigInt));
1252
+ res.push(extractValue(
1253
+ ctx,
1254
+ 93
1255
+ /* ] */
1256
+ ));
1157
1257
  skipVoid(ctx);
1158
1258
  if ((c9 = ctx.s.charCodeAt(ctx.p++)) === 93) {
1159
1259
  return res;
1160
1260
  }
1161
- if (c9 !== 44) {
1162
- throw new TomlError("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
1163
- }
1261
+ if (c9 !== 44)
1262
+ TomlError.x("expected comma or end of structure", ctx, ctx.p - 1);
1164
1263
  }
1165
- throw new TomlError("unfinished array encountered", {
1166
- toml: ctx.s,
1167
- ptr: ctx.p
1168
- });
1264
+ TomlError.x("unfinished array", ctx, startPtr);
1169
1265
  }
1170
- var KEY_PART_RE;
1171
1266
  var init_struct = __esm({
1172
- "../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/struct.js"() {
1267
+ "../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/struct.js"() {
1173
1268
  init_import_meta_url();
1174
1269
  init_primitive();
1175
1270
  init_extract();
1176
1271
  init_util();
1177
1272
  init_error();
1178
- KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
1179
1273
  __name(parseKey, "parseKey");
1180
1274
  __name(parseInlineTable, "parseInlineTable");
1181
1275
  __name(parseArray, "parseArray");
1182
1276
  }
1183
1277
  });
1184
1278
 
1185
- // ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/parse.js
1186
- function peekTable(key, table, meta3, type) {
1279
+ // ../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/parse.js
1280
+ function peekTable(ctx, key, table, meta3, type) {
1187
1281
  let t14 = table;
1188
1282
  let m7 = meta3;
1189
1283
  let k7;
@@ -1191,7 +1285,7 @@ function peekTable(key, table, meta3, type) {
1191
1285
  let state3;
1192
1286
  for (let i8 = 0; i8 < key.length; i8++) {
1193
1287
  if (i8) {
1194
- t14 = hasOwn2 ? t14[k7] : t14[k7] = {};
1288
+ t14 = hasOwn2 ? t14[k7] : t14[k7] = /* @__PURE__ */ Object.create(null);
1195
1289
  m7 = (state3 = m7[k7]).c;
1196
1290
  if (type === 0 && (state3.t === 1 || state3.t === 2)) {
1197
1291
  return null;
@@ -1207,7 +1301,10 @@ function peekTable(key, table, meta3, type) {
1207
1301
  return null;
1208
1302
  }
1209
1303
  if (!hasOwn2) {
1210
- if (k7 === "__proto__") {
1304
+ let unsafe = k7 === "__proto__";
1305
+ if (ctx.uk && (unsafe || k7 === "constructor"))
1306
+ return false;
1307
+ if (unsafe) {
1211
1308
  Object.defineProperty(t14, k7, { enumerable: true, configurable: true, writable: true });
1212
1309
  Object.defineProperty(m7, k7, { enumerable: true, configurable: true, writable: true });
1213
1310
  }
@@ -1215,7 +1312,7 @@ function peekTable(key, table, meta3, type) {
1215
1312
  t: i8 < key.length - 1 && type === 2 ? 3 : type,
1216
1313
  d: false,
1217
1314
  i: 0,
1218
- c: {}
1315
+ c: /* @__PURE__ */ Object.create(null)
1219
1316
  };
1220
1317
  }
1221
1318
  }
@@ -1228,43 +1325,60 @@ function peekTable(key, table, meta3, type) {
1228
1325
  state3.d = true;
1229
1326
  t14[k7] = [];
1230
1327
  }
1231
- t14[k7].push(t14 = {});
1232
- state3.c[state3.i++] = state3 = { t: 1, d: false, i: 0, c: {} };
1328
+ t14[k7].push(t14 = /* @__PURE__ */ Object.create(null));
1329
+ state3.c[state3.i++] = state3 = { t: 1, d: false, i: 0, c: /* @__PURE__ */ Object.create(null) };
1233
1330
  }
1234
1331
  if (state3.d) {
1235
1332
  return null;
1236
1333
  }
1237
1334
  state3.d = true;
1238
1335
  if (type === 1) {
1239
- t14 = hasOwn2 ? t14[k7] : t14[k7] = {};
1336
+ t14 = hasOwn2 ? t14[k7] : t14[k7] = /* @__PURE__ */ Object.create(null);
1240
1337
  } else if (type === 0 && hasOwn2) {
1241
1338
  return null;
1242
1339
  }
1243
1340
  return [k7, t14, state3.c];
1244
1341
  }
1245
- function parse(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
1246
- let ctx = { s: toml, p: 0, d: maxDepth };
1247
- let res = {};
1248
- let meta3 = {};
1342
+ function validateTablePeek(ctx, peek, ptr) {
1343
+ if (peek === null || ctx.uk === 2)
1344
+ TomlError.x(peek === null ? "trying to redefine an already defined table or value" : "document contains an unsafe property", ctx, ptr);
1345
+ }
1346
+ function parse(toml, options = {}) {
1347
+ let ctx = {
1348
+ s: toml,
1349
+ p: 0,
1350
+ d: options.maxDepth ?? 1e3,
1351
+ bi: options.integersAsBigInt ?? false,
1352
+ ld: options.useLegacyDate ?? true,
1353
+ uk: options.unsafeKeyBehaviour === "throw" ? 2 : options.unsafeKeyBehaviour === "drop" ? 1 : 0
1354
+ };
1355
+ let res = /* @__PURE__ */ Object.create(null);
1356
+ let meta3 = /* @__PURE__ */ Object.create(null);
1249
1357
  let tmp;
1358
+ let skipping = false;
1250
1359
  let tbl = res;
1251
1360
  let m7 = meta3;
1361
+ if (toml.charCodeAt(0) === 65279)
1362
+ ctx.p++;
1252
1363
  skipVoid(ctx);
1253
1364
  while (ctx.p < toml.length) {
1254
1365
  if (toml.charCodeAt(ctx.p) === 91) {
1255
1366
  let isTableArray = toml.charCodeAt(++ctx.p) === 91;
1256
1367
  tmp = ctx.p += +isTableArray;
1257
- let k7 = parseKey(ctx, "]");
1368
+ skipping = false;
1369
+ let k7 = parseKey(
1370
+ ctx,
1371
+ 93
1372
+ /* ] */
1373
+ );
1258
1374
  if (isTableArray) {
1259
- if (toml.charCodeAt(ctx.p - 1) !== 93) {
1260
- throw new TomlError("expected end of table declaration", {
1261
- toml,
1262
- ptr: ctx.p - 1
1263
- });
1375
+ if (toml.charCodeAt(ctx.p) !== 93) {
1376
+ TomlError.x("expected end of table array declaration", ctx);
1264
1377
  }
1265
1378
  ctx.p++;
1266
1379
  }
1267
1380
  let p8 = peekTable(
1381
+ ctx,
1268
1382
  k7,
1269
1383
  res,
1270
1384
  meta3,
@@ -1272,65 +1386,72 @@ function parse(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
1272
1386
  /* Type.EXPLICIT */
1273
1387
  );
1274
1388
  if (!p8) {
1275
- throw new TomlError("trying to redefine an already defined table or value", {
1276
- toml,
1277
- ptr: tmp
1278
- });
1389
+ validateTablePeek(ctx, p8, tmp);
1390
+ skipping = true;
1391
+ } else {
1392
+ m7 = p8[2];
1393
+ tbl = p8[1];
1279
1394
  }
1280
- m7 = p8[2];
1281
- tbl = p8[1];
1282
1395
  } else {
1283
1396
  tmp = ctx.p;
1284
1397
  let k7 = parseKey(ctx);
1285
1398
  let p8 = peekTable(
1399
+ ctx,
1286
1400
  k7,
1287
1401
  tbl,
1288
1402
  m7,
1289
1403
  0
1290
1404
  /* Type.DOTTED */
1291
1405
  );
1292
- if (!p8) {
1293
- throw new TomlError("trying to redefine an already defined table or value", {
1294
- toml,
1295
- ptr: tmp
1296
- });
1297
- }
1298
- p8[1][p8[0]] = extractValue(ctx, void 0, integersAsBigInt);
1406
+ if (!p8 && !skipping)
1407
+ validateTablePeek(ctx, p8, tmp);
1408
+ skipVoid(ctx, true, true);
1409
+ let v8 = extractValue(ctx, void 0);
1410
+ if (p8 && !skipping)
1411
+ p8[1][p8[0]] = v8;
1299
1412
  }
1300
1413
  skipVoid(ctx, true);
1301
- if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && tmp !== 13) {
1302
- throw new TomlError("each key-value declaration must be followed by an end-of-line", {
1303
- toml,
1304
- ptr: ctx.p
1305
- });
1414
+ if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && (tmp !== 13 || toml.charCodeAt(ctx.p + 1) !== 10)) {
1415
+ TomlError.x("each key-value declaration must be followed by an end-of-line", ctx);
1306
1416
  }
1307
1417
  skipVoid(ctx);
1308
1418
  }
1309
1419
  return res;
1310
1420
  }
1311
1421
  var init_parse = __esm({
1312
- "../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/parse.js"() {
1422
+ "../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/parse.js"() {
1313
1423
  init_import_meta_url();
1314
1424
  init_struct();
1315
1425
  init_extract();
1316
1426
  init_util();
1317
1427
  init_error();
1318
1428
  __name(peekTable, "peekTable");
1429
+ __name(validateTablePeek, "validateTablePeek");
1319
1430
  __name(parse, "parse");
1320
1431
  }
1321
1432
  });
1322
1433
 
1323
- // ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/stringify.js
1434
+ // ../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/stringify.js
1324
1435
  function extendedTypeOf(obj) {
1325
1436
  let type = typeof obj;
1326
1437
  if (type === "object") {
1327
1438
  if (Array.isArray(obj))
1328
1439
  return "array";
1329
- if (typeof obj?.getUTCDate === "function" && obj instanceof Date)
1440
+ if (typeof obj.getUTCDate === "function" && obj instanceof Date)
1330
1441
  return "date";
1331
- if (globalThis.Temporal && // check for the 'since' property as an early bailout that avoids running all 5 instanceof checks
1332
- typeof obj?.since === "function" && (obj instanceof Temporal.Instant || obj instanceof Temporal.PlainDate || obj instanceof Temporal.PlainDateTime || obj instanceof Temporal.PlainTime || obj instanceof Temporal.ZonedDateTime)) {
1333
- return "temporal";
1442
+ if (globalThis.Temporal) {
1443
+ if (obj.until) {
1444
+ if (obj instanceof Temporal.ZonedDateTime)
1445
+ return "temporal/tz+uc";
1446
+ if (obj instanceof Temporal.PlainDateTime || obj instanceof Temporal.PlainDate)
1447
+ return "temporal/uc";
1448
+ if (obj instanceof Temporal.PlainTime || obj instanceof Temporal.Instant)
1449
+ return "temporal";
1450
+ if (obj instanceof Temporal.PlainYearMonth)
1451
+ return "temporal/x";
1452
+ } else if (obj.toPlainDate && obj instanceof Temporal.PlainMonthDay || obj.negated && obj instanceof Temporal.Duration) {
1453
+ return "temporal/x";
1454
+ }
1334
1455
  }
1335
1456
  }
1336
1457
  return type;
@@ -1342,16 +1463,20 @@ function isArrayOfTables(obj) {
1342
1463
  }
1343
1464
  return obj.length != 0;
1344
1465
  }
1466
+ function formatWellFormedStringUnchecked(s8) {
1467
+ return JSON.stringify(s8).replaceAll("\x7F", "\\u007f");
1468
+ }
1345
1469
  function formatString(s8) {
1346
- return JSON.stringify(s8).replace(/\x7f/g, "\\u007f");
1470
+ return formatWellFormedStringUnchecked(HAS_WELLFORMED ? s8.toWellFormed() : s8);
1347
1471
  }
1348
- function stringifyTemporal(temporal) {
1349
- return temporal.toString({
1350
- calendarName: "never",
1351
- timeZoneName: "never"
1352
- });
1472
+ function formatKey(s8) {
1473
+ if (BARE_KEY.test(s8))
1474
+ return s8;
1475
+ if (HAS_WELLFORMED && !s8.isWellFormed())
1476
+ throw new RangeError("key contains illegal lone surrogates");
1477
+ return formatWellFormedStringUnchecked(s8);
1353
1478
  }
1354
- function stringifyValue(val2, type, depth, numberAsFloat) {
1479
+ function stringifyValue(val2, type, depth, numberAsFloat, strictTemporal) {
1355
1480
  if (depth === 0) {
1356
1481
  throw new Error("Could not stringify the object: maximum object depth exceeded");
1357
1482
  }
@@ -1368,6 +1493,7 @@ function stringifyValue(val2, type, depth, numberAsFloat) {
1368
1493
  return val2.toFixed(1);
1369
1494
  case "bigint":
1370
1495
  case "boolean":
1496
+ case "temporal":
1371
1497
  return val2.toString();
1372
1498
  case "string":
1373
1499
  return formatString(val2);
@@ -1376,14 +1502,37 @@ function stringifyValue(val2, type, depth, numberAsFloat) {
1376
1502
  throw new TypeError("cannot serialize invalid date");
1377
1503
  return val2.toISOString();
1378
1504
  case "object":
1379
- return stringifyInlineTable(val2, depth, numberAsFloat);
1505
+ return stringifyInlineTable(val2, depth, numberAsFloat, strictTemporal);
1380
1506
  case "array":
1381
- return stringifyArray(val2, depth, numberAsFloat);
1382
- case "temporal":
1383
- return stringifyTemporal(val2);
1507
+ return stringifyArray(val2, depth, numberAsFloat, strictTemporal);
1508
+ // @ts-expect-error -- intentional fallthrough case
1509
+ case "temporal/tz+uc":
1510
+ if (strictTemporal) {
1511
+ let tz = val2.timeZoneId;
1512
+ let tzc = tz.charCodeAt(0);
1513
+ if (
1514
+ // Classic offset
1515
+ tzc !== 43 && tzc !== 45 && // Fast pre-check pass; see below for the actually accepted values
1516
+ (tzc !== 85 && tzc !== 71 && tzc !== 90 && tzc !== 69 || // UTC and its aliases; Temporal implementations don't all canonicalise unfortunately
1517
+ tz !== "UTC" && tz !== "UCT" && tz !== "Universal" && tz !== "Zulu" && // GMT is a TZ but it's for all intents and purposes equivalent to UTC. Safe to downgrade.
1518
+ !tz.startsWith("GMT") && tz !== "Greenwich" && // Etc/* are all safe to downgrade to offset (either UTC, GMT, or offset)
1519
+ !tz.startsWith("Etc/"))
1520
+ ) {
1521
+ throw new TypeError("Temporal objects with an IANA timezone are not allowed in Temporal strict mode");
1522
+ }
1523
+ }
1524
+ case "temporal/uc":
1525
+ if (strictTemporal && val2.calendarId !== "iso8601")
1526
+ throw new TypeError("Temporal objects with a non-default calendar are not allowed in Temporal strict mode");
1527
+ return val2.toString({
1528
+ calendarName: "never",
1529
+ timeZoneName: "never"
1530
+ });
1531
+ case "temporal/x":
1532
+ throw new TypeError("Unsupported " + val2[Symbol.toStringTag]);
1384
1533
  }
1385
1534
  }
1386
- function stringifyInlineTable(obj, depth, numberAsFloat) {
1535
+ function stringifyInlineTable(obj, depth, numberAsFloat, strictTemporal) {
1387
1536
  let keys = Object.keys(obj);
1388
1537
  if (keys.length === 0)
1389
1538
  return "{}";
@@ -1392,13 +1541,11 @@ function stringifyInlineTable(obj, depth, numberAsFloat) {
1392
1541
  let k7 = keys[i8];
1393
1542
  if (i8)
1394
1543
  res += ", ";
1395
- res += BARE_KEY.test(k7) ? k7 : formatString(k7);
1396
- res += " = ";
1397
- res += stringifyValue(obj[k7], extendedTypeOf(obj[k7]), depth - 1, numberAsFloat);
1544
+ res += formatKey(k7) + " = " + stringifyValue(obj[k7], extendedTypeOf(obj[k7]), depth - 1, numberAsFloat, strictTemporal);
1398
1545
  }
1399
1546
  return res + " }";
1400
1547
  }
1401
- function stringifyArray(array2, depth, numberAsFloat) {
1548
+ function stringifyArray(array2, depth, numberAsFloat, strictTemporal) {
1402
1549
  if (array2.length === 0)
1403
1550
  return "[]";
1404
1551
  let res = "[ ";
@@ -1408,11 +1555,11 @@ function stringifyArray(array2, depth, numberAsFloat) {
1408
1555
  if (array2[i8] === null || array2[i8] === void 0) {
1409
1556
  throw new TypeError("arrays cannot contain null or undefined values");
1410
1557
  }
1411
- res += stringifyValue(array2[i8], extendedTypeOf(array2[i8]), depth - 1, numberAsFloat);
1558
+ res += stringifyValue(array2[i8], extendedTypeOf(array2[i8]), depth - 1, numberAsFloat, strictTemporal);
1412
1559
  }
1413
1560
  return res + " ]";
1414
1561
  }
1415
- function stringifyArrayTable(array2, key, depth, numberAsFloat) {
1562
+ function stringifyArrayTable(array2, key, depth, numberAsFloat, strictTemporal) {
1416
1563
  if (depth === 0) {
1417
1564
  throw new Error("Could not stringify the object: maximum object depth exceeded");
1418
1565
  }
@@ -1420,11 +1567,11 @@ function stringifyArrayTable(array2, key, depth, numberAsFloat) {
1420
1567
  for (let i8 = 0; i8 < array2.length; i8++) {
1421
1568
  res += `${res && "\n"}[[${key}]]
1422
1569
  `;
1423
- res += stringifyTable(0, array2[i8], key, depth, numberAsFloat);
1570
+ res += stringifyTable(0, array2[i8], key, depth, numberAsFloat, strictTemporal);
1424
1571
  }
1425
1572
  return res;
1426
1573
  }
1427
- function stringifyTable(tableKey, obj, prefix, depth, numberAsFloat) {
1574
+ function stringifyTable(tableKey, obj, prefix, depth, numberAsFloat, strictTemporal) {
1428
1575
  if (depth === 0) {
1429
1576
  throw new Error("Could not stringify the object: maximum object depth exceeded");
1430
1577
  }
@@ -1438,16 +1585,16 @@ function stringifyTable(tableKey, obj, prefix, depth, numberAsFloat) {
1438
1585
  if (type === "symbol" || type === "function") {
1439
1586
  throw new TypeError(`cannot serialize values of type '${type}'`);
1440
1587
  }
1441
- let key = BARE_KEY.test(k7) ? k7 : formatString(k7);
1588
+ let key = formatKey(k7);
1442
1589
  if (type === "array" && isArrayOfTables(obj[k7])) {
1443
- tables += (tables && "\n") + stringifyArrayTable(obj[k7], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat);
1590
+ tables += (tables && "\n") + stringifyArrayTable(obj[k7], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat, strictTemporal);
1444
1591
  } else if (type === "object") {
1445
1592
  let tblKey = prefix ? `${prefix}.${key}` : key;
1446
- tables += (tables && "\n") + stringifyTable(tblKey, obj[k7], tblKey, depth - 1, numberAsFloat);
1593
+ tables += (tables && "\n") + stringifyTable(tblKey, obj[k7], tblKey, depth - 1, numberAsFloat, strictTemporal);
1447
1594
  } else {
1448
1595
  preamble += key;
1449
1596
  preamble += " = ";
1450
- preamble += stringifyValue(obj[k7], type, depth, numberAsFloat);
1597
+ preamble += stringifyValue(obj[k7], type, depth, numberAsFloat, strictTemporal);
1451
1598
  preamble += "\n";
1452
1599
  }
1453
1600
  }
@@ -1458,24 +1605,26 @@ ${preamble}` : `[${tableKey}]`;
1458
1605
  return preamble && tables ? `${preamble}
1459
1606
  ${tables}` : preamble || tables;
1460
1607
  }
1461
- function stringify(obj, { maxDepth = 1e3, numbersAsFloat = false } = {}) {
1608
+ function stringify(obj, { maxDepth = 1e3, numbersAsFloat = false, strictTemporal = false } = {}) {
1462
1609
  if (extendedTypeOf(obj) !== "object") {
1463
1610
  throw new TypeError("stringify can only be called with an object");
1464
1611
  }
1465
- let str = stringifyTable(0, obj, "", maxDepth, numbersAsFloat);
1612
+ let str = stringifyTable(0, obj, "", maxDepth, numbersAsFloat, strictTemporal);
1466
1613
  if (str[str.length - 1] !== "\n")
1467
1614
  return str + "\n";
1468
1615
  return str;
1469
1616
  }
1470
- var BARE_KEY;
1617
+ var BARE_KEY, HAS_WELLFORMED;
1471
1618
  var init_stringify = __esm({
1472
- "../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/stringify.js"() {
1619
+ "../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/stringify.js"() {
1473
1620
  init_import_meta_url();
1474
1621
  BARE_KEY = /^[a-z0-9-_]+$/i;
1622
+ HAS_WELLFORMED = !!"".isWellFormed;
1475
1623
  __name(extendedTypeOf, "extendedTypeOf");
1476
1624
  __name(isArrayOfTables, "isArrayOfTables");
1625
+ __name(formatWellFormedStringUnchecked, "formatWellFormedStringUnchecked");
1477
1626
  __name(formatString, "formatString");
1478
- __name(stringifyTemporal, "stringifyTemporal");
1627
+ __name(formatKey, "formatKey");
1479
1628
  __name(stringifyValue, "stringifyValue");
1480
1629
  __name(stringifyInlineTable, "stringifyInlineTable");
1481
1630
  __name(stringifyArray, "stringifyArray");
@@ -1485,16 +1634,14 @@ var init_stringify = __esm({
1485
1634
  }
1486
1635
  });
1487
1636
 
1488
- // ../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/index.js
1489
- var dist_default;
1637
+ // ../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/index.js
1490
1638
  var init_dist = __esm({
1491
- "../../node_modules/.pnpm/smol-toml@1.8.0/node_modules/smol-toml/dist/index.js"() {
1639
+ "../../node_modules/.pnpm/smol-toml@1.9.0/node_modules/smol-toml/dist/index.js"() {
1492
1640
  init_import_meta_url();
1493
1641
  init_parse();
1494
1642
  init_stringify();
1495
1643
  init_date();
1496
1644
  init_error();
1497
- dist_default = { parse, stringify, TomlDate, TomlError };
1498
1645
  }
1499
1646
  });
1500
1647
 
@@ -1539,15 +1686,15 @@ function createScanner(text, ignoreTrivia = false) {
1539
1686
  pos++;
1540
1687
  } else {
1541
1688
  pos++;
1542
- while (pos < text.length && isDigit(text.charCodeAt(pos))) {
1689
+ while (pos < text.length && isDigit2(text.charCodeAt(pos))) {
1543
1690
  pos++;
1544
1691
  }
1545
1692
  }
1546
1693
  if (pos < text.length && text.charCodeAt(pos) === 46) {
1547
1694
  pos++;
1548
- if (pos < text.length && isDigit(text.charCodeAt(pos))) {
1695
+ if (pos < text.length && isDigit2(text.charCodeAt(pos))) {
1549
1696
  pos++;
1550
- while (pos < text.length && isDigit(text.charCodeAt(pos))) {
1697
+ while (pos < text.length && isDigit2(text.charCodeAt(pos))) {
1551
1698
  pos++;
1552
1699
  }
1553
1700
  } else {
@@ -1561,9 +1708,9 @@ function createScanner(text, ignoreTrivia = false) {
1561
1708
  if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
1562
1709
  pos++;
1563
1710
  }
1564
- if (pos < text.length && isDigit(text.charCodeAt(pos))) {
1711
+ if (pos < text.length && isDigit2(text.charCodeAt(pos))) {
1565
1712
  pos++;
1566
- while (pos < text.length && isDigit(text.charCodeAt(pos))) {
1713
+ while (pos < text.length && isDigit2(text.charCodeAt(pos))) {
1567
1714
  pos++;
1568
1715
  }
1569
1716
  end = pos;
@@ -1752,7 +1899,7 @@ function createScanner(text, ignoreTrivia = false) {
1752
1899
  case 45:
1753
1900
  value += String.fromCharCode(code);
1754
1901
  pos++;
1755
- if (pos === len || !isDigit(text.charCodeAt(pos))) {
1902
+ if (pos === len || !isDigit2(text.charCodeAt(pos))) {
1756
1903
  return token = 16;
1757
1904
  }
1758
1905
  // found a minus, followed by a number so
@@ -1839,7 +1986,7 @@ function isWhiteSpace(ch2) {
1839
1986
  function isLineBreak(ch2) {
1840
1987
  return ch2 === 10 || ch2 === 13;
1841
1988
  }
1842
- function isDigit(ch2) {
1989
+ function isDigit2(ch2) {
1843
1990
  return ch2 >= 48 && ch2 <= 57;
1844
1991
  }
1845
1992
  var CharacterCodes;
@@ -1849,7 +1996,7 @@ var init_scanner = __esm({
1849
1996
  __name(createScanner, "createScanner");
1850
1997
  __name(isWhiteSpace, "isWhiteSpace");
1851
1998
  __name(isLineBreak, "isLineBreak");
1852
- __name(isDigit, "isDigit");
1999
+ __name(isDigit2, "isDigit");
1853
2000
  (function(CharacterCodes2) {
1854
2001
  CharacterCodes2[CharacterCodes2["lineFeed"] = 10] = "lineFeed";
1855
2002
  CharacterCodes2[CharacterCodes2["carriageReturn"] = 13] = "carriageReturn";
@@ -2403,15 +2550,15 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
2403
2550
  }
2404
2551
  }
2405
2552
  __name(scanNext, "scanNext");
2406
- function handleError2(error53, skipUntilAfter = [], skipUntil3 = []) {
2553
+ function handleError2(error53, skipUntilAfter = [], skipUntil = []) {
2407
2554
  onError(error53);
2408
- if (skipUntilAfter.length + skipUntil3.length > 0) {
2555
+ if (skipUntilAfter.length + skipUntil.length > 0) {
2409
2556
  let token = _scanner.getToken();
2410
2557
  while (token !== 17) {
2411
2558
  if (skipUntilAfter.indexOf(token) !== -1) {
2412
2559
  scanNext();
2413
2560
  break;
2414
- } else if (skipUntil3.indexOf(token) !== -1) {
2561
+ } else if (skipUntil.indexOf(token) !== -1) {
2415
2562
  break;
2416
2563
  }
2417
2564
  token = scanNext();
@@ -2419,7 +2566,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
2419
2566
  }
2420
2567
  }
2421
2568
  __name(handleError2, "handleError");
2422
- function parseString3(isValue) {
2569
+ function parseString2(isValue) {
2423
2570
  const value = _scanner.getTokenValue();
2424
2571
  if (isValue) {
2425
2572
  onLiteralValue(value);
@@ -2430,7 +2577,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
2430
2577
  scanNext();
2431
2578
  return true;
2432
2579
  }
2433
- __name(parseString3, "parseString");
2580
+ __name(parseString2, "parseString");
2434
2581
  function parseLiteral() {
2435
2582
  switch (_scanner.getToken()) {
2436
2583
  case 11:
@@ -2470,11 +2617,11 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
2470
2617
  ]);
2471
2618
  return false;
2472
2619
  }
2473
- parseString3(false);
2620
+ parseString2(false);
2474
2621
  if (_scanner.getToken() === 6) {
2475
2622
  onSeparator(":");
2476
2623
  scanNext();
2477
- if (!parseValue3()) {
2624
+ if (!parseValue()) {
2478
2625
  handleError2(4, [], [
2479
2626
  2,
2480
2627
  5
@@ -2530,7 +2677,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
2530
2677
  return true;
2531
2678
  }
2532
2679
  __name(parseObject, "parseObject");
2533
- function parseArray3() {
2680
+ function parseArray2() {
2534
2681
  onArrayBegin();
2535
2682
  scanNext();
2536
2683
  let isFirstElement = true;
@@ -2554,7 +2701,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
2554
2701
  } else {
2555
2702
  _jsonPath[_jsonPath.length - 1]++;
2556
2703
  }
2557
- if (!parseValue3()) {
2704
+ if (!parseValue()) {
2558
2705
  handleError2(4, [], [
2559
2706
  4,
2560
2707
  5
@@ -2577,20 +2724,20 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
2577
2724
  }
2578
2725
  return true;
2579
2726
  }
2580
- __name(parseArray3, "parseArray");
2581
- function parseValue3() {
2727
+ __name(parseArray2, "parseArray");
2728
+ function parseValue() {
2582
2729
  switch (_scanner.getToken()) {
2583
2730
  case 3:
2584
- return parseArray3();
2731
+ return parseArray2();
2585
2732
  case 1:
2586
2733
  return parseObject();
2587
2734
  case 10:
2588
- return parseString3(true);
2735
+ return parseString2(true);
2589
2736
  default:
2590
2737
  return parseLiteral();
2591
2738
  }
2592
2739
  }
2593
- __name(parseValue3, "parseValue");
2740
+ __name(parseValue, "parseValue");
2594
2741
  scanNext();
2595
2742
  if (_scanner.getToken() === 17) {
2596
2743
  if (options.allowEmptyContent) {
@@ -2599,7 +2746,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
2599
2746
  handleError2(4, [], []);
2600
2747
  return false;
2601
2748
  }
2602
- if (!parseValue3()) {
2749
+ if (!parseValue()) {
2603
2750
  handleError2(4, [], []);
2604
2751
  return false;
2605
2752
  }
@@ -2927,7 +3074,7 @@ var init_main = __esm({
2927
3074
  });
2928
3075
  function parseTOML(tomlContent, filePath) {
2929
3076
  try {
2930
- return dist_default.parse(tomlContent);
3077
+ return parse(tomlContent);
2931
3078
  } catch (err) {
2932
3079
  if (!(err instanceof TomlError)) {
2933
3080
  throw err;
@@ -3452,7 +3599,7 @@ function configFileName(configPath) {
3452
3599
  function formatConfigSnippet(snippet, configPath, formatted = true) {
3453
3600
  const format9 = configFormat(configPath);
3454
3601
  if (format9 === "toml") {
3455
- return dist_default.stringify(snippet);
3602
+ return stringify(snippet);
3456
3603
  } else {
3457
3604
  return formatted ? JSON.stringify(snippet, null, 2) : JSON.stringify(snippet);
3458
3605
  }
@@ -3519,7 +3666,7 @@ var init_patch_config = __esm({
3519
3666
  const formatEdit = format2(configString, void 0, {});
3520
3667
  configString = applyEdits(configString, formatEdit);
3521
3668
  if (configPath.endsWith(".toml")) {
3522
- configString = dist_default.stringify(parseJSONC(configString));
3669
+ configString = stringify(parseJSONC(configString));
3523
3670
  }
3524
3671
  fs14.writeFileSync(configPath, configString);
3525
3672
  return configString;
@@ -21575,6 +21722,7 @@ function normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDisp
21575
21722
  environment.migrations,
21576
21723
  environment.exports
21577
21724
  );
21725
+ validateWorkflowExportConflicts(diagnostics, environment.exports);
21578
21726
  const containersDeclaredElsewhere = rawConfig !== void 0 ? rawConfig.containers !== void 0 : Object.values("env" in rawEnv ? rawEnv.env ?? {} : {}).some(
21579
21727
  (rawNamedEnv) => rawNamedEnv?.containers !== void 0
21580
21728
  );
@@ -21608,19 +21756,165 @@ function validateAndNormalizeTsconfig(diagnostics, topLevelEnv, rawEnv, configPa
21608
21756
  path28__namespace.default.join(path28__namespace.default.dirname(configPath), tsconfig)
21609
21757
  ) : tsconfig;
21610
21758
  }
21611
- function validateWorkflowRetentionValue(diagnostics, field, key, value) {
21759
+ function validateWorkflowRetentionValue(diagnostics, field, kind2, key, value) {
21612
21760
  const isValidNumber = typeof value === "number" && Number.isInteger(value) && value > 0;
21613
21761
  const isValidString = typeof value === "string" && value.length > 0;
21614
21762
  if (isValidNumber || isValidString) {
21615
21763
  return true;
21616
21764
  }
21617
21765
  diagnostics.errors.push(
21618
- `"${field}" bindings "default_retention.${key}" field must be a positive integer of milliseconds or a duration string such as "3 days", but got ${JSON.stringify(
21766
+ `"${field}" ${kind2} "default_retention.${key}" field must be a positive integer of milliseconds or a duration string such as "3 days", but got ${JSON.stringify(
21619
21767
  value
21620
21768
  )}.`
21621
21769
  );
21622
21770
  return false;
21623
21771
  }
21772
+ function validateWorkflowSchedules(diagnostics, field, kind2, value) {
21773
+ const { schedules } = value;
21774
+ if (schedules === void 0) {
21775
+ return true;
21776
+ }
21777
+ if (typeof schedules === "string") {
21778
+ if (schedules.length === 0) {
21779
+ diagnostics.errors.push(
21780
+ `"${field}" ${kind2} "schedules" field must not be an empty string.`
21781
+ );
21782
+ return false;
21783
+ }
21784
+ return true;
21785
+ }
21786
+ if (Array.isArray(schedules)) {
21787
+ if (schedules.length === 0) {
21788
+ diagnostics.errors.push(
21789
+ `"${field}" ${kind2} "schedules" field must not be an empty array.`
21790
+ );
21791
+ return false;
21792
+ }
21793
+ if (!schedules.every((s8) => typeof s8 === "string")) {
21794
+ diagnostics.errors.push(
21795
+ `"${field}" ${kind2} should, optionally, have a string or array of strings "schedules" field but got ${JSON.stringify(
21796
+ value
21797
+ )}.`
21798
+ );
21799
+ return false;
21800
+ }
21801
+ if (schedules.some((s8) => s8 === "")) {
21802
+ diagnostics.errors.push(
21803
+ `"${field}" ${kind2} "schedules" field must not contain empty strings.`
21804
+ );
21805
+ return false;
21806
+ }
21807
+ return true;
21808
+ }
21809
+ diagnostics.errors.push(
21810
+ `"${field}" ${kind2} should, optionally, have a string or array of strings "schedules" field but got ${JSON.stringify(
21811
+ value
21812
+ )}.`
21813
+ );
21814
+ return false;
21815
+ }
21816
+ function validateWorkflowLimits(diagnostics, field, kind2, value) {
21817
+ const { limits } = value;
21818
+ if (limits === void 0) {
21819
+ return true;
21820
+ }
21821
+ if (typeof limits !== "object" || limits === null || Array.isArray(limits)) {
21822
+ diagnostics.errors.push(
21823
+ `"${field}" ${kind2} should, optionally, have an object "limits" field but got ${JSON.stringify(
21824
+ value
21825
+ )}.`
21826
+ );
21827
+ return false;
21828
+ }
21829
+ let valid = true;
21830
+ const { steps } = limits;
21831
+ if (steps !== void 0) {
21832
+ if (typeof steps !== "number" || !Number.isInteger(steps) || steps < 1) {
21833
+ diagnostics.errors.push(
21834
+ `"${field}" ${kind2} "limits.steps" field must be a positive integer but got ${JSON.stringify(
21835
+ steps
21836
+ )}.`
21837
+ );
21838
+ valid = false;
21839
+ } else if (steps > 25e3) {
21840
+ diagnostics.warnings.push(
21841
+ `"${field}" has a step limit of ${steps}, which exceeds the production maximum of 25,000. This configuration may not work when deployed.`
21842
+ );
21843
+ }
21844
+ }
21845
+ validateAdditionalProperties(
21846
+ diagnostics,
21847
+ `${field}.limits`,
21848
+ Object.keys(limits),
21849
+ ["steps"]
21850
+ );
21851
+ return valid;
21852
+ }
21853
+ function validateWorkflowDefaultRetention(diagnostics, field, kind2, value) {
21854
+ const { default_retention: defaultRetention } = value;
21855
+ if (defaultRetention === void 0) {
21856
+ return true;
21857
+ }
21858
+ if (typeof defaultRetention !== "object" || defaultRetention === null || Array.isArray(defaultRetention)) {
21859
+ diagnostics.errors.push(
21860
+ `"${field}" ${kind2} should, optionally, have an object "default_retention" field but got ${JSON.stringify(
21861
+ value
21862
+ )}.`
21863
+ );
21864
+ return false;
21865
+ }
21866
+ let valid = true;
21867
+ const retention = defaultRetention;
21868
+ for (const key of ["success_retention", "error_retention"]) {
21869
+ if (retention[key] !== void 0 && !validateWorkflowRetentionValue(
21870
+ diagnostics,
21871
+ field,
21872
+ kind2,
21873
+ key,
21874
+ retention[key]
21875
+ )) {
21876
+ valid = false;
21877
+ }
21878
+ }
21879
+ validateAdditionalProperties(
21880
+ diagnostics,
21881
+ `${field}.default_retention`,
21882
+ Object.keys(retention),
21883
+ ["success_retention", "error_retention"]
21884
+ );
21885
+ return valid;
21886
+ }
21887
+ function validateWorkflowConcurrency(diagnostics, field, kind2, value) {
21888
+ const { concurrency } = value;
21889
+ if (concurrency === void 0) {
21890
+ return true;
21891
+ }
21892
+ if (typeof concurrency !== "object" || concurrency === null || Array.isArray(concurrency)) {
21893
+ diagnostics.errors.push(
21894
+ `"${field}" ${kind2} should, optionally, have an object "concurrency" field but got ${JSON.stringify(
21895
+ value
21896
+ )}.`
21897
+ );
21898
+ return false;
21899
+ }
21900
+ let valid = true;
21901
+ const { limit: limit2 } = concurrency;
21902
+ if (limit2 !== void 0 && (typeof limit2 !== "number" || !Number.isInteger(limit2) || limit2 < 1)) {
21903
+ diagnostics.errors.push(
21904
+ `"${field}" ${kind2} "concurrency.limit" field must be a positive integer but got ${JSON.stringify(
21905
+ limit2
21906
+ )}.`
21907
+ );
21908
+ valid = false;
21909
+ }
21910
+ validateAdditionalProperties(
21911
+ diagnostics,
21912
+ `${field}.concurrency`,
21913
+ Object.keys(concurrency),
21914
+ ["limit"]
21915
+ );
21916
+ return valid;
21917
+ }
21624
21918
  function validateSshPublicKeys(diagnostics, field, value, nameRequired) {
21625
21919
  if (!Array.isArray(value)) {
21626
21920
  diagnostics.errors.push(`${field} must be an array`);
@@ -21645,6 +21939,18 @@ function validateSshPublicKeys(diagnostics, field, value, nameRequired) {
21645
21939
  }
21646
21940
  }
21647
21941
  }
21942
+ function validateContainerSshConfig(diagnostics, field, value) {
21943
+ const sshConfig = typeof value === "object" && value !== null ? value : {};
21944
+ if (!isRequiredProperty(sshConfig, "enabled", "boolean")) {
21945
+ diagnostics.errors.push(`${field}.enabled must be a boolean`);
21946
+ }
21947
+ const port = "port" in sshConfig ? sshConfig.port : void 0;
21948
+ if (!isOptionalProperty(sshConfig, "port", "number") || typeof port === "number" && (!Number.isInteger(port) || port < 1 || port > 65535)) {
21949
+ diagnostics.errors.push(
21950
+ `${field}.port must be a number between 1 and 65535 inclusive`
21951
+ );
21952
+ }
21953
+ }
21648
21954
  function validatePreviewsContainers(envName, configPath) {
21649
21955
  const innerValidator = validateContainerApp(envName, void 0, configPath, {
21650
21956
  generateDefaultName: false
@@ -21892,12 +22198,29 @@ function validateContainerApp(envName, topLevelName, configPath, options = {}) {
21892
22198
  "scheduling_policy",
21893
22199
  "images",
21894
22200
  "observability",
22201
+ "ssh",
22202
+ "authorized_keys",
21895
22203
  "unsafe"
21896
22204
  ].includes(key)
21897
22205
  );
21898
22206
  if (unsupportedFields.length > 0) {
21899
22207
  diagnostics.errors.push(
21900
- `Unsupported fields for Durable Object-managed Containers in ${field}: ${unsupportedFields.map((key) => `"${key}"`).join(",")}. Only "name", "class_name", "scheduling_policy", "images", "observability", and restricted "unsafe" settings are supported.`
22208
+ `Unsupported fields for Durable Object-managed Containers in ${field}: ${unsupportedFields.map((key) => `"${key}"`).join(",")}. Only "name", "class_name", "scheduling_policy", "images", "observability", "ssh", "authorized_keys", and restricted "unsafe" settings are supported.`
22209
+ );
22210
+ }
22211
+ if ("ssh" in containerAppOptional) {
22212
+ validateContainerSshConfig(
22213
+ diagnostics,
22214
+ `${field}.ssh`,
22215
+ containerAppOptional.ssh
22216
+ );
22217
+ }
22218
+ if ("authorized_keys" in containerAppOptional) {
22219
+ validateSshPublicKeys(
22220
+ diagnostics,
22221
+ `${field}.authorized_keys`,
22222
+ containerAppOptional.authorized_keys,
22223
+ true
21901
22224
  );
21902
22225
  }
21903
22226
  continue;
@@ -22115,30 +22438,20 @@ function validateContainerApp(envName, topLevelName, configPath, options = {}) {
22115
22438
  ["image", "secrets", "labels", "disk", "vcpu", "memory_mib"]
22116
22439
  );
22117
22440
  }
22118
- let sshField;
22119
- let sshConfig;
22120
22441
  if ("ssh" in containerAppOptional) {
22121
- sshField = "ssh";
22122
- sshConfig = containerAppOptional.ssh;
22442
+ validateContainerSshConfig(
22443
+ diagnostics,
22444
+ `${field}.ssh`,
22445
+ containerAppOptional.ssh
22446
+ );
22123
22447
  containerAppOptional.wrangler_ssh = containerAppOptional.ssh;
22124
22448
  delete containerAppOptional.ssh;
22125
22449
  } else if ("wrangler_ssh" in containerAppOptional) {
22126
- sshField = "wrangler_ssh";
22127
- sshConfig = containerAppOptional.wrangler_ssh;
22128
- }
22129
- if (sshField !== void 0) {
22130
- const sshConfigObject = typeof sshConfig === "object" && sshConfig !== null ? sshConfig : {};
22131
- if (!isRequiredProperty(sshConfigObject, "enabled", "boolean")) {
22132
- diagnostics.errors.push(
22133
- `${field}.${sshField}.enabled must be a boolean`
22134
- );
22135
- }
22136
- const sshPort = "port" in sshConfigObject ? sshConfigObject.port : void 0;
22137
- if (!isOptionalProperty(sshConfigObject, "port", "number") || typeof sshPort === "number" && (sshPort < 1 || sshPort > 65535)) {
22138
- diagnostics.errors.push(
22139
- `${field}.${sshField}.port must be a number between 1 and 65535 inclusive`
22140
- );
22141
- }
22450
+ validateContainerSshConfig(
22451
+ diagnostics,
22452
+ `${field}.wrangler_ssh`,
22453
+ containerAppOptional.wrangler_ssh
22454
+ );
22142
22455
  }
22143
22456
  if ("authorized_keys" in containerAppOptional) {
22144
22457
  validateSshPublicKeys(
@@ -22617,6 +22930,46 @@ function validateWorkerExportCache(diagnostics, field, value) {
22617
22930
  ]) && valid;
22618
22931
  return valid;
22619
22932
  }
22933
+ function validateWorkflowExport(diagnostics, exportName, workflowExport) {
22934
+ const field = `exports.${exportName}`;
22935
+ let valid = true;
22936
+ valid = validateRequiredProperty(
22937
+ diagnostics,
22938
+ field,
22939
+ "name",
22940
+ workflowExport.name,
22941
+ "string"
22942
+ ) && valid;
22943
+ if (typeof workflowExport.name === "string" && !isValidWorkflowName(workflowExport.name)) {
22944
+ diagnostics.errors.push(
22945
+ `"${field}.name" is invalid. ${workflowNameFormatMessage}`
22946
+ );
22947
+ valid = false;
22948
+ }
22949
+ valid = validateWorkflowSchedules(diagnostics, field, "export", workflowExport) && valid;
22950
+ valid = validateWorkflowLimits(diagnostics, field, "export", workflowExport) && valid;
22951
+ valid = validateWorkflowDefaultRetention(
22952
+ diagnostics,
22953
+ field,
22954
+ "export",
22955
+ workflowExport
22956
+ ) && valid;
22957
+ valid = validateWorkflowConcurrency(diagnostics, field, "export", workflowExport) && valid;
22958
+ valid = validateAdditionalProperties(
22959
+ diagnostics,
22960
+ field,
22961
+ Object.keys(workflowExport),
22962
+ [
22963
+ "type",
22964
+ "name",
22965
+ "limits",
22966
+ "concurrency",
22967
+ "schedules",
22968
+ "default_retention"
22969
+ ]
22970
+ ) && valid;
22971
+ return valid;
22972
+ }
22620
22973
  function isContainerObservabilityEnabled(observability) {
22621
22974
  return observability?.logs?.enabled === true || observability?.enabled === true;
22622
22975
  }
@@ -22680,6 +23033,24 @@ function errorIfMigrationsAndExportsBothSet(diagnostics, migrations, exports$1)
22680
23033
  );
22681
23034
  }
22682
23035
  }
23036
+ function validateWorkflowExportConflicts(diagnostics, exports$1) {
23037
+ const classNamesByWorkflowName = /* @__PURE__ */ new Map();
23038
+ for (const [className, workflowExport] of Object.entries(
23039
+ partitionExports(exports$1).workflow
23040
+ )) {
23041
+ if (typeof workflowExport.name !== "string") {
23042
+ continue;
23043
+ }
23044
+ const existing = classNamesByWorkflowName.get(workflowExport.name);
23045
+ if (existing !== void 0) {
23046
+ diagnostics.errors.push(
23047
+ `"exports.${existing}" and "exports.${className}" both declare the Workflow "${workflowExport.name}". Workflow names must be unique.`
23048
+ );
23049
+ continue;
23050
+ }
23051
+ classNamesByWorkflowName.set(workflowExport.name, className);
23052
+ }
23053
+ }
22683
23054
  function validateContainerExportLinks(diagnostics, containers, exports$1, containersDeclaredElsewhere) {
22684
23055
  if (containers !== void 0 && !Array.isArray(containers)) {
22685
23056
  return;
@@ -22861,6 +23232,7 @@ var init_validation = __esm({
22861
23232
  init_diagnostics();
22862
23233
  init_durable_object_exports();
22863
23234
  init_environment();
23235
+ init_exports();
22864
23236
  init_validation_helpers();
22865
23237
  init_config2();
22866
23238
  __name(isValidR2BucketName, "isValidR2BucketName");
@@ -23513,6 +23885,10 @@ Please add a binding for each to "${fieldPath}.bindings":
23513
23885
  }, "validateDurableObjectBinding");
23514
23886
  workflowNameFormatMessage = `Workflow names must be 1-64 characters long, start with a letter, number, or underscore, and may only contain letters, numbers, underscores, or hyphens.`;
23515
23887
  __name(validateWorkflowRetentionValue, "validateWorkflowRetentionValue");
23888
+ __name(validateWorkflowSchedules, "validateWorkflowSchedules");
23889
+ __name(validateWorkflowLimits, "validateWorkflowLimits");
23890
+ __name(validateWorkflowDefaultRetention, "validateWorkflowDefaultRetention");
23891
+ __name(validateWorkflowConcurrency, "validateWorkflowConcurrency");
23516
23892
  validateWorkflowBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {
23517
23893
  if (typeof value !== "object" || value === null) {
23518
23894
  diagnostics.errors.push(
@@ -23558,128 +23934,16 @@ Please add a binding for each to "${fieldPath}.bindings":
23558
23934
  );
23559
23935
  isValid = false;
23560
23936
  }
23561
- if (hasProperty(value, "schedules") && value.schedules !== void 0) {
23562
- if (typeof value.schedules === "string") {
23563
- if (value.schedules.length === 0) {
23564
- diagnostics.errors.push(
23565
- `"${field}" bindings "schedules" field must not be an empty string.`
23566
- );
23567
- isValid = false;
23568
- }
23569
- } else if (Array.isArray(value.schedules)) {
23570
- if (value.schedules.length === 0) {
23571
- diagnostics.errors.push(
23572
- `"${field}" bindings "schedules" field must not be an empty array.`
23573
- );
23574
- isValid = false;
23575
- } else if (!value.schedules.every((s8) => typeof s8 === "string")) {
23576
- diagnostics.errors.push(
23577
- `"${field}" bindings should, optionally, have a string or array of strings "schedules" field but got ${JSON.stringify(
23578
- value
23579
- )}.`
23580
- );
23581
- isValid = false;
23582
- } else if (value.schedules.some((s8) => s8 === "")) {
23583
- diagnostics.errors.push(
23584
- `"${field}" bindings "schedules" field must not contain empty strings.`
23585
- );
23586
- isValid = false;
23587
- }
23588
- } else {
23589
- diagnostics.errors.push(
23590
- `"${field}" bindings should, optionally, have a string or array of strings "schedules" field but got ${JSON.stringify(
23591
- value
23592
- )}.`
23593
- );
23594
- isValid = false;
23595
- }
23596
- }
23597
- if (hasProperty(value, "limits") && value.limits !== void 0) {
23598
- if (typeof value.limits !== "object" || value.limits === null || Array.isArray(value.limits)) {
23599
- diagnostics.errors.push(
23600
- `"${field}" bindings should, optionally, have an object "limits" field but got ${JSON.stringify(
23601
- value
23602
- )}.`
23603
- );
23604
- isValid = false;
23605
- } else {
23606
- const limits = value.limits;
23607
- if (limits.steps !== void 0) {
23608
- if (typeof limits.steps !== "number" || !Number.isInteger(limits.steps) || limits.steps < 1) {
23609
- diagnostics.errors.push(
23610
- `"${field}" bindings "limits.steps" field must be a positive integer but got ${JSON.stringify(
23611
- limits.steps
23612
- )}.`
23613
- );
23614
- isValid = false;
23615
- } else if (limits.steps > 25e3) {
23616
- diagnostics.warnings.push(
23617
- `"${field}" has a step limit of ${limits.steps}, which exceeds the production maximum of 25,000. This configuration may not work when deployed.`
23618
- );
23619
- }
23620
- }
23621
- validateAdditionalProperties(
23622
- diagnostics,
23623
- `${field}.limits`,
23624
- Object.keys(limits),
23625
- ["steps"]
23626
- );
23627
- }
23628
- }
23629
- if (hasProperty(value, "default_retention") && value.default_retention !== void 0) {
23630
- if (typeof value.default_retention !== "object" || value.default_retention === null || Array.isArray(value.default_retention)) {
23631
- diagnostics.errors.push(
23632
- `"${field}" bindings should, optionally, have an object "default_retention" field but got ${JSON.stringify(
23633
- value
23634
- )}.`
23635
- );
23636
- isValid = false;
23637
- } else {
23638
- const defaultRetention = value.default_retention;
23639
- for (const key of ["success_retention", "error_retention"]) {
23640
- if (defaultRetention[key] !== void 0 && !validateWorkflowRetentionValue(
23641
- diagnostics,
23642
- field,
23643
- key,
23644
- defaultRetention[key]
23645
- )) {
23646
- isValid = false;
23647
- }
23648
- }
23649
- validateAdditionalProperties(
23650
- diagnostics,
23651
- `${field}.default_retention`,
23652
- Object.keys(defaultRetention),
23653
- ["success_retention", "error_retention"]
23654
- );
23655
- }
23656
- }
23657
- if (hasProperty(value, "concurrency") && value.concurrency !== void 0) {
23658
- if (typeof value.concurrency !== "object" || value.concurrency === null || Array.isArray(value.concurrency)) {
23659
- diagnostics.errors.push(
23660
- `"${field}" bindings should, optionally, have an object "concurrency" field but got ${JSON.stringify(
23661
- value
23662
- )}.`
23663
- );
23664
- isValid = false;
23665
- } else {
23666
- const concurrency = value.concurrency;
23667
- if (concurrency.limit !== void 0 && (typeof concurrency.limit !== "number" || !Number.isInteger(concurrency.limit) || concurrency.limit < 1)) {
23668
- diagnostics.errors.push(
23669
- `"${field}" bindings "concurrency.limit" field must be a positive integer but got ${JSON.stringify(
23670
- concurrency.limit
23671
- )}.`
23672
- );
23673
- isValid = false;
23674
- }
23675
- validateAdditionalProperties(
23676
- diagnostics,
23677
- `${field}.concurrency`,
23678
- Object.keys(concurrency),
23679
- ["limit"]
23680
- );
23681
- }
23682
- }
23937
+ const settings = value;
23938
+ isValid = validateWorkflowSchedules(diagnostics, field, "bindings", settings) && isValid;
23939
+ isValid = validateWorkflowLimits(diagnostics, field, "bindings", settings) && isValid;
23940
+ isValid = validateWorkflowDefaultRetention(
23941
+ diagnostics,
23942
+ field,
23943
+ "bindings",
23944
+ settings
23945
+ ) && isValid;
23946
+ isValid = validateWorkflowConcurrency(diagnostics, field, "bindings", settings) && isValid;
23683
23947
  validateAdditionalProperties(diagnostics, field, Object.keys(value), [
23684
23948
  "binding",
23685
23949
  "name",
@@ -23976,6 +24240,7 @@ Please add a binding for "${configBindingName}" to "env.${envName}.${field}.bind
23976
24240
  return isValid;
23977
24241
  }, "validateBindingArray");
23978
24242
  __name(validateSshPublicKeys, "validateSshPublicKeys");
24243
+ __name(validateContainerSshConfig, "validateContainerSshConfig");
23979
24244
  __name(validatePreviewsContainers, "validatePreviewsContainers");
23980
24245
  __name(validateDurableObjectContainerImages, "validateDurableObjectContainerImages");
23981
24246
  __name(validateDurableObjectContainerUnsafe, "validateDurableObjectContainerUnsafe");
@@ -24936,23 +25201,31 @@ ${resolution}`);
24936
25201
  return false;
24937
25202
  }
24938
25203
  let isValid = true;
24939
- if (!validateAdditionalProperties(diagnostics, field, Object.keys(value), [
24940
- "protocol",
24941
- "port",
24942
- "address"
24943
- ])) {
25204
+ const connectHandler = value;
25205
+ if (!validateAdditionalProperties(
25206
+ diagnostics,
25207
+ field,
25208
+ Object.keys(value),
25209
+ connectHandler.protocol === "udp" ? [
25210
+ "protocol",
25211
+ "port",
25212
+ "address",
25213
+ "idle_timeout_ms",
25214
+ "max_pending_bytes"
25215
+ ] : ["protocol", "port", "address"]
25216
+ )) {
24944
25217
  isValid = false;
24945
25218
  }
24946
- if ("protocol" in value && value.protocol !== "tcp") {
25219
+ if ("protocol" in value && value.protocol !== "tcp" && value.protocol !== "udp") {
24947
25220
  diagnostics.errors.push(
24948
- `"${field}" should have a "protocol" field of "tcp" but got ${JSON.stringify(
25221
+ `"${field}" should have a "protocol" field of "tcp" or "udp" but got ${JSON.stringify(
24949
25222
  value.protocol
24950
25223
  )}.`
24951
25224
  );
24952
25225
  isValid = false;
24953
25226
  } else if (!("protocol" in value)) {
24954
25227
  diagnostics.errors.push(
24955
- `"${field}" should have a "protocol" field of "tcp" but got ${JSON.stringify(
25228
+ `"${field}" should have a "protocol" field of "tcp" or "udp" but got ${JSON.stringify(
24956
25229
  value
24957
25230
  )}.`
24958
25231
  );
@@ -24981,6 +25254,20 @@ ${resolution}`);
24981
25254
  );
24982
25255
  isValid = false;
24983
25256
  }
25257
+ if (connectHandler.protocol === "udp") {
25258
+ for (const option of ["idle_timeout_ms", "max_pending_bytes"]) {
25259
+ if (!(option in connectHandler)) {
25260
+ continue;
25261
+ }
25262
+ const optionValue = connectHandler[option];
25263
+ if (typeof optionValue !== "number" || !Number.isInteger(optionValue) || optionValue < 0 || optionValue > 4294967295) {
25264
+ diagnostics.errors.push(
25265
+ `"${field}" should have an integer "${option}" field between 0 and 4294967295 but got ${JSON.stringify(value)}.`
25266
+ );
25267
+ isValid = false;
25268
+ }
25269
+ }
25270
+ }
24984
25271
  return isValid;
24985
25272
  }, "validateConnectHandler");
24986
25273
  validateCompatibilityDate = /* @__PURE__ */ __name((diagnostics, field, value) => {
@@ -25677,6 +25964,7 @@ ${resolution}`);
25677
25964
  __name(validateDurableObjectExport, "validateDurableObjectExport");
25678
25965
  __name(validateWorkerExport, "validateWorkerExport");
25679
25966
  __name(validateWorkerExportCache, "validateWorkerExportCache");
25967
+ __name(validateWorkflowExport, "validateWorkflowExport");
25680
25968
  validateExports = /* @__PURE__ */ __name((diagnostics, field, value) => {
25681
25969
  if (value === void 0 || value === null) {
25682
25970
  return true;
@@ -25704,10 +25992,12 @@ ${resolution}`);
25704
25992
  valid = validateDurableObjectExport(diagnostics, exportName, exportConfig) && valid;
25705
25993
  } else if (exportConfig.type === "worker") {
25706
25994
  valid = validateWorkerExport(diagnostics, exportName, exportConfig) && valid;
25995
+ } else if (exportConfig.type === "workflow") {
25996
+ valid = validateWorkflowExport(diagnostics, exportName, exportConfig) && valid;
25707
25997
  } else {
25708
25998
  valid = false;
25709
25999
  diagnostics.errors.push(
25710
- `"exports.${exportName}.type" must be "durable-object" or "worker", but got ${JSON.stringify(exportConfig.type)}.`
26000
+ `"exports.${exportName}.type" must be "durable-object", "worker", or "workflow", but got ${JSON.stringify(exportConfig.type)}.`
25711
26001
  );
25712
26002
  }
25713
26003
  }
@@ -26093,6 +26383,7 @@ ${resolution}`);
26093
26383
  }, "validateCache");
26094
26384
  __name(warnIfDurableObjectsHaveNoLifecycleConfig, "warnIfDurableObjectsHaveNoLifecycleConfig");
26095
26385
  __name(errorIfMigrationsAndExportsBothSet, "errorIfMigrationsAndExportsBothSet");
26386
+ __name(validateWorkflowExportConflicts, "validateWorkflowExportConflicts");
26096
26387
  __name(validateContainerExportLinks, "validateContainerExportLinks");
26097
26388
  validatePythonModules = /* @__PURE__ */ __name((diagnostics, field, value, topLevelEnv) => {
26098
26389
  if (value === void 0) {
@@ -26888,7 +27179,7 @@ var DEFAULT_COMPAT_DATE;
26888
27179
  var init_default_compat_date = __esm({
26889
27180
  "../workers-utils/src/default-compat-date.ts"() {
26890
27181
  init_import_meta_url();
26891
- DEFAULT_COMPAT_DATE = "2026-09-21";
27182
+ DEFAULT_COMPAT_DATE = "2026-09-23";
26892
27183
  }
26893
27184
  });
26894
27185
 
@@ -33907,7 +34198,7 @@ var require_data_url = __commonJS({
33907
34198
  return mimeType;
33908
34199
  }
33909
34200
  __name(parseMIMEType, "parseMIMEType");
33910
- function collectAnHTTPQuotedString(input, position, extractValue3 = false) {
34201
+ function collectAnHTTPQuotedString(input, position, extractValue2 = false) {
33911
34202
  const positionStart = position.position;
33912
34203
  let value = "";
33913
34204
  assert71(input[position.position] === '"');
@@ -33935,7 +34226,7 @@ var require_data_url = __commonJS({
33935
34226
  break;
33936
34227
  }
33937
34228
  }
33938
- if (extractValue3) {
34229
+ if (extractValue2) {
33939
34230
  return value;
33940
34231
  }
33941
34232
  return input.slice(positionStart, position.position);
@@ -56693,9 +56984,9 @@ function getInstalledVersion(binPath) {
56693
56984
  }
56694
56985
  }
56695
56986
  function isVersionOutdated(installed, latest) {
56696
- const parse18 = /* @__PURE__ */ __name((v8) => v8.split(".").map(Number), "parse");
56697
- const [iYear, iMonth, iPatch] = parse18(installed);
56698
- const [lYear, lMonth, lPatch] = parse18(latest);
56987
+ const parse17 = /* @__PURE__ */ __name((v8) => v8.split(".").map(Number), "parse");
56988
+ const [iYear, iMonth, iPatch] = parse17(installed);
56989
+ const [lYear, lMonth, lPatch] = parse17(latest);
56699
56990
  if (iYear !== lYear) {
56700
56991
  return iYear < lYear;
56701
56992
  }
@@ -57623,7 +57914,7 @@ var require_utils2 = __commonJS({
57623
57914
  var ini = require_ini();
57624
57915
  var path107 = __require("path");
57625
57916
  var stripJsonComments = require_strip_json_comments();
57626
- var parse18 = exports$1.parse = function(content) {
57917
+ var parse17 = exports$1.parse = function(content) {
57627
57918
  if (/^\s*{/.test(content))
57628
57919
  return JSON.parse(stripJsonComments(content));
57629
57920
  return ini.parse(content);
@@ -57644,7 +57935,7 @@ var require_utils2 = __commonJS({
57644
57935
  };
57645
57936
  exports$1.json = function() {
57646
57937
  var content = file3.apply(null, arguments);
57647
- return content ? parse18(content) : null;
57938
+ return content ? parse17(content) : null;
57648
57939
  };
57649
57940
  exports$1.env = function(prefix, env7) {
57650
57941
  env7 = env7 || process.env;
@@ -57989,13 +58280,13 @@ var require_rc = __commonJS({
57989
58280
  var etc = "/etc";
57990
58281
  var win = process.platform === "win32";
57991
58282
  var home = win ? process.env.USERPROFILE : process.env.HOME;
57992
- module2.exports = function(name2, defaults3, argv, parse18) {
58283
+ module2.exports = function(name2, defaults3, argv, parse17) {
57993
58284
  if ("string" !== typeof name2)
57994
58285
  throw new Error("rc(name): name *must* be string");
57995
58286
  if (!argv)
57996
58287
  argv = require_minimist()(process.argv.slice(2));
57997
58288
  defaults3 = ("string" === typeof defaults3 ? cc2.json(defaults3) : defaults3) || {};
57998
- parse18 = parse18 || cc2.parse;
58289
+ parse17 = parse17 || cc2.parse;
57999
58290
  var env6 = cc2.env(name2 + "_");
58000
58291
  var configs = [defaults3];
58001
58292
  var configFiles = [];
@@ -58003,7 +58294,7 @@ var require_rc = __commonJS({
58003
58294
  if (configFiles.indexOf(file3) >= 0) return;
58004
58295
  var fileConfig = cc2.file(file3);
58005
58296
  if (fileConfig) {
58006
- configs.push(parse18(fileConfig));
58297
+ configs.push(parse17(fileConfig));
58007
58298
  configFiles.push(file3);
58008
58299
  }
58009
58300
  }
@@ -62191,7 +62482,7 @@ var name, version2;
62191
62482
  var init_package = __esm({
62192
62483
  "package.json"() {
62193
62484
  name = "wrangler";
62194
- version2 = "4.138.0";
62485
+ version2 = "4.139.0";
62195
62486
  }
62196
62487
  });
62197
62488
 
@@ -74240,7 +74531,7 @@ var require_ms = __commonJS({
74240
74531
  options = options || {};
74241
74532
  var type = typeof val2;
74242
74533
  if (type === "string" && val2.length > 0) {
74243
- return parse18(val2);
74534
+ return parse17(val2);
74244
74535
  } else if (type === "number" && isFinite(val2)) {
74245
74536
  return options.long ? fmtLong(val2) : fmtShort(val2);
74246
74537
  }
@@ -74248,7 +74539,7 @@ var require_ms = __commonJS({
74248
74539
  "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2)
74249
74540
  );
74250
74541
  };
74251
- function parse18(str) {
74542
+ function parse17(str) {
74252
74543
  str = String(str);
74253
74544
  if (str.length > 100) {
74254
74545
  return;
@@ -74304,7 +74595,7 @@ var require_ms = __commonJS({
74304
74595
  return void 0;
74305
74596
  }
74306
74597
  }
74307
- __name(parse18, "parse");
74598
+ __name(parse17, "parse");
74308
74599
  function fmtShort(ms) {
74309
74600
  var msAbs = Math.abs(ms);
74310
74601
  if (msAbs >= d9) {
@@ -125790,538 +126081,26 @@ function getProfileForDirectoryFromBindings(startDir, bindings) {
125790
126081
  }
125791
126082
  return void 0;
125792
126083
  }
125793
- function getLineColFromPtr2(string4, ptr) {
125794
- let lines = string4.slice(0, ptr).split(/\r\n|\n|\r/g);
125795
- return [lines.length, lines.pop().length + 1];
125796
- }
125797
- function makeCodeBlock2(string4, line, column) {
125798
- let lines = string4.split(/\r\n|\n|\r/g);
125799
- let codeblock = "";
125800
- let numberLen = (Math.log10(line + 1) | 0) + 1;
125801
- for (let i8 = line - 1; i8 <= line + 1; i8++) {
125802
- let l8 = lines[i8 - 1];
125803
- if (!l8)
125804
- continue;
125805
- codeblock += i8.toString().padEnd(numberLen, " ");
125806
- codeblock += ": ";
125807
- codeblock += l8;
125808
- codeblock += "\n";
125809
- if (i8 === line) {
125810
- codeblock += " ".repeat(numberLen + column + 2);
125811
- codeblock += "^\n";
125812
- }
125813
- }
125814
- return codeblock;
125815
- }
125816
- function indexOfNewline2(str, start = 0) {
125817
- let idx = str.indexOf("\n", start);
125818
- if (str.charCodeAt(idx - 1) === 13)
125819
- idx--;
125820
- return idx;
125821
- }
125822
- function skipComment2(ctx) {
125823
- for (; ctx.p < ctx.s.length; ctx.p++) {
125824
- let c9 = ctx.s.charCodeAt(ctx.p);
125825
- if (c9 === 10)
125826
- break;
125827
- if (c9 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
125828
- ctx.p++;
125829
- break;
125830
- }
125831
- if (c9 < 32 && c9 !== 9 || c9 === 127) {
125832
- throw new TomlError2("control characters are not allowed in comments", {
125833
- toml: ctx.s,
125834
- ptr: ctx.p
125835
- });
125836
- }
125837
- }
125838
- }
125839
- function skipVoid2(ctx, banNewLines, banComments) {
125840
- let c9;
125841
- while (1) {
125842
- while ((c9 = ctx.s.charCodeAt(ctx.p)) === 32 || c9 === 9 || !banNewLines && (c9 === 10 || c9 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10))
125843
- ctx.p++;
125844
- if (banComments || c9 !== 35)
125845
- break;
125846
- skipComment2(ctx);
125847
- }
125848
- }
125849
- function skipUntil2(ctx, sep8, end) {
125850
- let ptr = ctx.p;
125851
- if (!end) {
125852
- ptr = indexOfNewline2(ctx.s, ptr);
125853
- ctx.p = ptr < 0 ? ctx.s.length : ptr;
125854
- return;
125855
- }
125856
- for (; ctx.p < ctx.s.length; ctx.p++) {
125857
- let c9 = ctx.s.charCodeAt(ctx.p);
125858
- if (c9 === 35) {
125859
- skipComment2(ctx);
125860
- } else if (c9 === end || c9 === sep8) {
125861
- return;
125862
- }
125863
- }
125864
- throw new TomlError2("cannot find end of structure", {
125865
- toml: ctx.s,
125866
- ptr
125867
- });
125868
- }
125869
- function parseString2(ctx) {
125870
- let start = ctx.p;
125871
- let c9 = ctx.s.charCodeAt(ctx.p++);
125872
- let first = c9;
125873
- let isLiteral = c9 === 39;
125874
- let isMultiline = c9 === ctx.s.charCodeAt(ctx.p) && c9 === ctx.s.charCodeAt(ctx.p + 1);
125875
- if (isMultiline) {
125876
- if ((c9 = ctx.s.charCodeAt(ctx.p += 2)) === 10)
125877
- ctx.p++;
125878
- else if (c9 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)
125879
- ctx.p += 2;
125880
- }
125881
- let parsed = "";
125882
- let sliceStart = ctx.p;
125883
- let state3 = 0;
125884
- for (; ctx.p < ctx.s.length; ctx.p++) {
125885
- c9 = ctx.s.charCodeAt(ctx.p);
125886
- if (isMultiline && (c9 === 10 || c9 === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) {
125887
- state3 = state3 && 3;
125888
- } else if (c9 < 32 && c9 !== 9 || c9 === 127) {
125889
- throw new TomlError2("control characters are not allowed in strings", {
125890
- toml: ctx.s,
125891
- ptr: ctx.p
125892
- });
125893
- } else if ((!state3 || state3 === 3) && c9 === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) {
125894
- if (isMultiline) {
125895
- if (ctx.s.charCodeAt(ctx.p + 3) === first)
125896
- ctx.p++;
125897
- if (ctx.s.charCodeAt(ctx.p + 3) === first)
125898
- ctx.p++;
125899
- }
125900
- if (!state3)
125901
- parsed += ctx.s.slice(sliceStart, ctx.p);
125902
- ctx.p += isMultiline ? 3 : 1;
125903
- return parsed;
125904
- } else if (!state3) {
125905
- if (!isLiteral && c9 === 92) {
125906
- parsed += ctx.s.slice(sliceStart, sliceStart = ctx.p);
125907
- state3 = 1;
125908
- }
125909
- } else if (state3 === 1) {
125910
- if (c9 === 120 || c9 === 117 || c9 === 85) {
125911
- let value = 0;
125912
- let len = c9 === 120 ? 2 : c9 === 117 ? 4 : 8;
125913
- for (let j8 = 0; j8 < len; j8++, ctx.p++) {
125914
- let hex3 = ctx.s.charCodeAt(ctx.p + 1);
125915
- let digit = (
125916
- /* 0-9 */
125917
- hex3 >= 48 && hex3 <= 57 ? hex3 - 48 : (
125918
- /* A-F */
125919
- hex3 >= 65 && hex3 <= 70 ? hex3 - 65 + 10 : (
125920
- /* a-f */
125921
- hex3 >= 97 && hex3 <= 102 ? hex3 - 97 + 10 : -1
125922
- )
125923
- )
125924
- );
125925
- if (digit < 0)
125926
- throw new TomlError2("invalid non-hex character in unicode escape", { toml: ctx.s, ptr: ctx.p + 1 });
125927
- value = value << 4 | digit;
125928
- }
125929
- if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) {
125930
- throw new TomlError2("invalid unicode escape", { toml: ctx.s, ptr: ctx.p });
125931
- }
125932
- parsed += String.fromCodePoint(value);
125933
- sliceStart = ctx.p + 1;
125934
- state3 = 0;
125935
- } else if (c9 === 32 || c9 === 9) {
125936
- state3 = 2;
125937
- } else {
125938
- if (c9 === 98)
125939
- parsed += "\b";
125940
- else if (c9 === 116)
125941
- parsed += " ";
125942
- else if (c9 === 110)
125943
- parsed += "\n";
125944
- else if (c9 === 102)
125945
- parsed += "\f";
125946
- else if (c9 === 114)
125947
- parsed += "\r";
125948
- else if (c9 === 101)
125949
- parsed += "\x1B";
125950
- else if (c9 === 34)
125951
- parsed += '"';
125952
- else if (c9 === 92)
125953
- parsed += "\\";
125954
- else
125955
- throw new TomlError2("unrecognized escape sequence", { toml: ctx.s, ptr: ctx.p });
125956
- sliceStart = ctx.p + 1;
125957
- state3 = 0;
125958
- }
125959
- } else if (c9 !== 32 && c9 !== 9) {
125960
- if (state3 === 2) {
125961
- throw new TomlError2("invalid escape: only line-ending whitespace may be escaped", {
125962
- toml: ctx.s,
125963
- ptr: sliceStart
125964
- });
125965
- }
125966
- state3 = !isLiteral && c9 === 92 ? 1 : 0;
125967
- sliceStart = ctx.p;
125968
- }
125969
- }
125970
- throw new TomlError2("unfinished string", { toml: ctx.s, ptr: start });
125971
- }
125972
- function sliceAndTrimEndOf2(ctx, start, end) {
125973
- let value = ctx.s.slice(start, end);
125974
- let commentIdx = value.indexOf("#");
125975
- if (commentIdx > 0) {
125976
- skipComment2({ s: value, p: commentIdx });
125977
- value = value.slice(0, commentIdx);
125978
- }
125979
- return value.trimEnd();
125980
- }
125981
- function parseValue2(ctx, integersAsBigInt, end) {
125982
- let ptr = ctx.p;
125983
- let err = { toml: ctx.s, ptr };
125984
- skipUntil2(ctx, 44, end);
125985
- let value = sliceAndTrimEndOf2(ctx, ptr, ctx.p);
125986
- if (!value)
125987
- throw new TomlError2("incomplete declaration: value expected", err);
125988
- if (value === "-inf")
125989
- return -Infinity;
125990
- if (value === "inf" || value === "+inf")
125991
- return Infinity;
125992
- if (value === "nan" || value === "+nan" || value === "-nan")
125993
- return NaN;
125994
- if (value === "-0")
125995
- return integersAsBigInt ? 0n : 0;
125996
- let isInt = INT_REGEX2.test(value);
125997
- if (isInt || FLOAT_REGEX2.test(value)) {
125998
- if (LEADING_ZERO2.test(value)) {
125999
- throw new TomlError2("leading zeroes are not allowed", err);
126000
- }
126001
- value = value.replace(/_/g, "");
126002
- let numeric2 = +value;
126003
- if (isNaN(numeric2)) {
126004
- throw new TomlError2("invalid number", err);
126005
- }
126006
- if (isInt) {
126007
- if ((isInt = !Number.isSafeInteger(numeric2)) && !integersAsBigInt) {
126008
- throw new TomlError2("integer value cannot be represented losslessly", err);
126009
- }
126010
- if (isInt || integersAsBigInt === true)
126011
- numeric2 = BigInt(value);
126012
- }
126013
- return numeric2;
126014
- }
126015
- const date5 = new TomlDate2(value);
126016
- if (!date5.isValid())
126017
- throw new TomlError2("invalid value", err);
126018
- return date5;
126019
- }
126020
- function extractValue2(ctx, end, integersAsBigInt) {
126021
- let ptr = ctx.p;
126022
- let c9 = ctx.s.charCodeAt(ptr);
126023
- if (c9 === 91 || c9 === 123) {
126024
- if (!ctx.d--) {
126025
- throw new TomlError2("document contains excessively nested structures. aborting.", {
126026
- toml: ctx.s,
126027
- ptr
126028
- });
126029
- }
126030
- let value = c9 === 91 ? parseArray2(ctx, integersAsBigInt) : parseInlineTable2(ctx, integersAsBigInt);
126031
- ctx.d++;
126032
- return value;
126033
- }
126034
- if (c9 === 34 || c9 === 39) {
126035
- return parseString2(ctx);
126036
- }
126037
- if (c9 === 116) {
126038
- if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101)
126039
- throw new TomlError2("invalid value", { toml: ctx.s, ptr });
126040
- ctx.p++;
126041
- return true;
126042
- }
126043
- if (c9 === 102) {
126044
- if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101)
126045
- throw new TomlError2("invalid value", { toml: ctx.s, ptr });
126046
- ctx.p++;
126047
- return false;
126048
- }
126049
- return parseValue2(ctx, integersAsBigInt, end);
126050
- }
126051
- function parseKey2(ctx, end = "=") {
126052
- let start = ctx.p;
126053
- let dot = start - 1;
126054
- let parsed = [];
126055
- let endPtr = ctx.s.indexOf(end, start);
126056
- if (endPtr < 0) {
126057
- throw new TomlError2("incomplete key-value: cannot find end of key", {
126058
- toml: ctx.s,
126059
- ptr: start
126060
- });
126061
- }
126062
- do {
126063
- let c9 = ctx.s.charCodeAt(ctx.p = ++dot);
126064
- if (c9 !== 32 && c9 !== 9) {
126065
- if (c9 === 34 || c9 === 39) {
126066
- if (c9 === ctx.s.charCodeAt(ctx.p + 1) && c9 === ctx.s.charCodeAt(ctx.p + 2)) {
126067
- throw new TomlError2("multiline strings are not allowed in keys", {
126068
- toml: ctx.s,
126069
- ptr: ctx.p
126070
- });
126071
- }
126072
- let part = parseString2(ctx);
126073
- dot = ctx.s.indexOf(".", ctx.p);
126074
- let strEnd = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
126075
- let newLine = indexOfNewline2(strEnd);
126076
- if (newLine > -1) {
126077
- throw new TomlError2("newlines are not allowed in keys", {
126078
- toml: ctx.s,
126079
- ptr: newLine
126080
- });
126081
- }
126082
- if (strEnd.trimStart()) {
126083
- throw new TomlError2("found extra tokens after the string part", {
126084
- toml: ctx.s,
126085
- ptr: ctx.p
126086
- });
126087
- }
126088
- if (endPtr < ctx.p) {
126089
- endPtr = ctx.s.indexOf(end, ctx.p);
126090
- if (endPtr < 0) {
126091
- throw new TomlError2("incomplete key-value: cannot find end of key", {
126092
- toml: ctx.s,
126093
- ptr: start
126094
- });
126095
- }
126096
- }
126097
- parsed.push(part);
126098
- } else {
126099
- dot = ctx.s.indexOf(".", ctx.p);
126100
- let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
126101
- if (!KEY_PART_RE2.test(part)) {
126102
- throw new TomlError2("only letter, numbers, dashes and underscores are allowed in keys", {
126103
- toml: ctx.s,
126104
- ptr: ctx.p
126105
- });
126106
- }
126107
- parsed.push(part.trimEnd());
126108
- }
126109
- }
126110
- } while (dot + 1 && dot < endPtr);
126111
- ctx.p = endPtr + 1;
126112
- skipVoid2(ctx, true, true);
126113
- return parsed;
126114
- }
126115
- function parseInlineTable2(ctx, integersAsBigInt) {
126116
- let res = {};
126117
- let seen = /* @__PURE__ */ new Set();
126118
- let c9;
126119
- ctx.p++;
126120
- while (ctx.p < ctx.s.length) {
126121
- skipVoid2(ctx);
126122
- if ((c9 = ctx.s.charCodeAt(ctx.p)) === 125) {
126123
- ctx.p++;
126124
- return res;
126125
- }
126126
- let k7;
126127
- let t14 = res;
126128
- let hasOwn2 = false;
126129
- let p8 = ctx.p;
126130
- let key = parseKey2(ctx);
126131
- for (let i8 = 0; i8 < key.length; i8++) {
126132
- if (i8)
126133
- t14 = hasOwn2 ? t14[k7] : t14[k7] = {};
126134
- k7 = key[i8];
126135
- if ((hasOwn2 = Object.hasOwn(t14, k7)) && (typeof t14[k7] !== "object" || seen.has(t14[k7]))) {
126136
- throw new TomlError2("trying to redefine an already defined value", {
126137
- toml: ctx.s,
126138
- ptr: p8
126139
- });
126140
- }
126141
- if (!hasOwn2 && k7 === "__proto__") {
126142
- Object.defineProperty(t14, k7, { enumerable: true, configurable: true, writable: true });
126143
- }
126144
- }
126145
- if (hasOwn2) {
126146
- throw new TomlError2("trying to redefine an already defined value", {
126147
- toml: ctx.s,
126148
- ptr: ctx.p
126149
- });
126150
- }
126151
- let value = extractValue2(ctx, 125, integersAsBigInt);
126152
- seen.add(t14[k7] = value);
126153
- skipVoid2(ctx);
126154
- if ((c9 = ctx.s.charCodeAt(ctx.p++)) === 125) {
126155
- return res;
126156
- }
126157
- if (c9 !== 44) {
126158
- throw new TomlError2("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
126159
- }
126160
- }
126161
- throw new TomlError2("unfinished table encountered", {
126162
- toml: ctx.s,
126163
- ptr: ctx.p
126164
- });
126165
- }
126166
- function parseArray2(ctx, integersAsBigInt) {
126167
- let res = [];
126168
- let c9;
126169
- ctx.p++;
126170
- while (ctx.p < ctx.s.length) {
126171
- skipVoid2(ctx);
126172
- if ((c9 = ctx.s.charCodeAt(ctx.p)) === 93) {
126173
- ctx.p++;
126174
- return res;
126175
- }
126176
- res.push(extractValue2(ctx, 93, integersAsBigInt));
126177
- skipVoid2(ctx);
126178
- if ((c9 = ctx.s.charCodeAt(ctx.p++)) === 93) {
126179
- return res;
126180
- }
126181
- if (c9 !== 44) {
126182
- throw new TomlError2("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
126183
- }
126184
- }
126185
- throw new TomlError2("unfinished array encountered", {
126186
- toml: ctx.s,
126187
- ptr: ctx.p
126188
- });
126189
- }
126190
- function peekTable2(key, table, meta3, type) {
126191
- let t14 = table;
126192
- let m7 = meta3;
126193
- let k7;
126194
- let hasOwn2 = false;
126195
- let state3;
126196
- for (let i8 = 0; i8 < key.length; i8++) {
126197
- if (i8) {
126198
- t14 = hasOwn2 ? t14[k7] : t14[k7] = {};
126199
- m7 = (state3 = m7[k7]).c;
126200
- if (type === 0 && (state3.t === 1 || state3.t === 2)) {
126201
- return null;
126202
- }
126203
- if (state3.t === 2) {
126204
- let l8 = t14.length - 1;
126205
- t14 = t14[l8];
126206
- m7 = m7[l8].c;
126207
- }
126208
- }
126209
- k7 = key[i8];
126210
- if ((hasOwn2 = Object.hasOwn(t14, k7)) && m7[k7]?.t === 0 && m7[k7]?.d) {
126211
- return null;
126212
- }
126213
- if (!hasOwn2) {
126214
- if (k7 === "__proto__") {
126215
- Object.defineProperty(t14, k7, { enumerable: true, configurable: true, writable: true });
126216
- Object.defineProperty(m7, k7, { enumerable: true, configurable: true, writable: true });
126217
- }
126218
- m7[k7] = {
126219
- t: i8 < key.length - 1 && type === 2 ? 3 : type,
126220
- d: false,
126221
- i: 0,
126222
- c: {}
126223
- };
126224
- }
126225
- }
126226
- state3 = m7[k7];
126227
- if (state3.t !== type && !(type === 1 && state3.t === 3)) {
126228
- return null;
126229
- }
126230
- if (type === 2) {
126231
- if (!state3.d) {
126232
- state3.d = true;
126233
- t14[k7] = [];
126234
- }
126235
- t14[k7].push(t14 = {});
126236
- state3.c[state3.i++] = state3 = { t: 1, d: false, i: 0, c: {} };
126237
- }
126238
- if (state3.d) {
126239
- return null;
126240
- }
126241
- state3.d = true;
126242
- if (type === 1) {
126243
- t14 = hasOwn2 ? t14[k7] : t14[k7] = {};
126244
- } else if (type === 0 && hasOwn2) {
126245
- return null;
126246
- }
126247
- return [k7, t14, state3.c];
126248
- }
126249
- function parse6(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
126250
- let ctx = { s: toml, p: 0, d: maxDepth };
126251
- let res = {};
126252
- let meta3 = {};
126253
- let tmp;
126254
- let tbl = res;
126255
- let m7 = meta3;
126256
- skipVoid2(ctx);
126257
- while (ctx.p < toml.length) {
126258
- if (toml.charCodeAt(ctx.p) === 91) {
126259
- let isTableArray = toml.charCodeAt(++ctx.p) === 91;
126260
- tmp = ctx.p += +isTableArray;
126261
- let k7 = parseKey2(ctx, "]");
126262
- if (isTableArray) {
126263
- if (toml.charCodeAt(ctx.p - 1) !== 93) {
126264
- throw new TomlError2("expected end of table declaration", {
126265
- toml,
126266
- ptr: ctx.p - 1
126267
- });
126268
- }
126269
- ctx.p++;
126270
- }
126271
- let p8 = peekTable2(
126272
- k7,
126273
- res,
126274
- meta3,
126275
- isTableArray ? 2 : 1
126276
- /* Type.EXPLICIT */
126277
- );
126278
- if (!p8) {
126279
- throw new TomlError2("trying to redefine an already defined table or value", {
126280
- toml,
126281
- ptr: tmp
126282
- });
126283
- }
126284
- m7 = p8[2];
126285
- tbl = p8[1];
126286
- } else {
126287
- tmp = ctx.p;
126288
- let k7 = parseKey2(ctx);
126289
- let p8 = peekTable2(
126290
- k7,
126291
- tbl,
126292
- m7,
126293
- 0
126294
- /* Type.DOTTED */
126295
- );
126296
- if (!p8) {
126297
- throw new TomlError2("trying to redefine an already defined table or value", {
126298
- toml,
126299
- ptr: tmp
126300
- });
126301
- }
126302
- p8[1][p8[0]] = extractValue2(ctx, void 0, integersAsBigInt);
126303
- }
126304
- skipVoid2(ctx, true);
126305
- if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && tmp !== 13) {
126306
- throw new TomlError2("each key-value declaration must be followed by an end-of-line", {
126307
- toml,
126308
- ptr: ctx.p
126309
- });
126310
- }
126311
- skipVoid2(ctx);
126312
- }
126313
- return res;
126314
- }
126315
126084
  function extendedTypeOf2(obj) {
126316
126085
  let type = typeof obj;
126317
126086
  if (type === "object") {
126318
126087
  if (Array.isArray(obj))
126319
126088
  return "array";
126320
- if (typeof obj?.getUTCDate === "function" && obj instanceof Date)
126089
+ if (typeof obj.getUTCDate === "function" && obj instanceof Date)
126321
126090
  return "date";
126322
- if (globalThis.Temporal && // check for the 'since' property as an early bailout that avoids running all 5 instanceof checks
126323
- typeof obj?.since === "function" && (obj instanceof Temporal.Instant || obj instanceof Temporal.PlainDate || obj instanceof Temporal.PlainDateTime || obj instanceof Temporal.PlainTime || obj instanceof Temporal.ZonedDateTime)) {
126324
- return "temporal";
126091
+ if (globalThis.Temporal) {
126092
+ if (obj.until) {
126093
+ if (obj instanceof Temporal.ZonedDateTime)
126094
+ return "temporal/tz+uc";
126095
+ if (obj instanceof Temporal.PlainDateTime || obj instanceof Temporal.PlainDate)
126096
+ return "temporal/uc";
126097
+ if (obj instanceof Temporal.PlainTime || obj instanceof Temporal.Instant)
126098
+ return "temporal";
126099
+ if (obj instanceof Temporal.PlainYearMonth)
126100
+ return "temporal/x";
126101
+ } else if (obj.toPlainDate && obj instanceof Temporal.PlainMonthDay || obj.negated && obj instanceof Temporal.Duration) {
126102
+ return "temporal/x";
126103
+ }
126325
126104
  }
126326
126105
  }
126327
126106
  return type;
@@ -126333,16 +126112,20 @@ function isArrayOfTables2(obj) {
126333
126112
  }
126334
126113
  return obj.length != 0;
126335
126114
  }
126115
+ function formatWellFormedStringUnchecked2(s8) {
126116
+ return JSON.stringify(s8).replaceAll("\x7F", "\\u007f");
126117
+ }
126336
126118
  function formatString2(s8) {
126337
- return JSON.stringify(s8).replace(/\x7f/g, "\\u007f");
126119
+ return formatWellFormedStringUnchecked2(HAS_WELLFORMED2 ? s8.toWellFormed() : s8);
126338
126120
  }
126339
- function stringifyTemporal2(temporal) {
126340
- return temporal.toString({
126341
- calendarName: "never",
126342
- timeZoneName: "never"
126343
- });
126121
+ function formatKey2(s8) {
126122
+ if (BARE_KEY2.test(s8))
126123
+ return s8;
126124
+ if (HAS_WELLFORMED2 && !s8.isWellFormed())
126125
+ throw new RangeError("key contains illegal lone surrogates");
126126
+ return formatWellFormedStringUnchecked2(s8);
126344
126127
  }
126345
- function stringifyValue2(val2, type, depth, numberAsFloat) {
126128
+ function stringifyValue2(val2, type, depth, numberAsFloat, strictTemporal) {
126346
126129
  if (depth === 0) {
126347
126130
  throw new Error("Could not stringify the object: maximum object depth exceeded");
126348
126131
  }
@@ -126359,6 +126142,7 @@ function stringifyValue2(val2, type, depth, numberAsFloat) {
126359
126142
  return val2.toFixed(1);
126360
126143
  case "bigint":
126361
126144
  case "boolean":
126145
+ case "temporal":
126362
126146
  return val2.toString();
126363
126147
  case "string":
126364
126148
  return formatString2(val2);
@@ -126367,14 +126151,37 @@ function stringifyValue2(val2, type, depth, numberAsFloat) {
126367
126151
  throw new TypeError("cannot serialize invalid date");
126368
126152
  return val2.toISOString();
126369
126153
  case "object":
126370
- return stringifyInlineTable2(val2, depth, numberAsFloat);
126154
+ return stringifyInlineTable2(val2, depth, numberAsFloat, strictTemporal);
126371
126155
  case "array":
126372
- return stringifyArray2(val2, depth, numberAsFloat);
126373
- case "temporal":
126374
- return stringifyTemporal2(val2);
126156
+ return stringifyArray2(val2, depth, numberAsFloat, strictTemporal);
126157
+ // @ts-expect-error -- intentional fallthrough case
126158
+ case "temporal/tz+uc":
126159
+ if (strictTemporal) {
126160
+ let tz = val2.timeZoneId;
126161
+ let tzc = tz.charCodeAt(0);
126162
+ if (
126163
+ // Classic offset
126164
+ tzc !== 43 && tzc !== 45 && // Fast pre-check pass; see below for the actually accepted values
126165
+ (tzc !== 85 && tzc !== 71 && tzc !== 90 && tzc !== 69 || // UTC and its aliases; Temporal implementations don't all canonicalise unfortunately
126166
+ tz !== "UTC" && tz !== "UCT" && tz !== "Universal" && tz !== "Zulu" && // GMT is a TZ but it's for all intents and purposes equivalent to UTC. Safe to downgrade.
126167
+ !tz.startsWith("GMT") && tz !== "Greenwich" && // Etc/* are all safe to downgrade to offset (either UTC, GMT, or offset)
126168
+ !tz.startsWith("Etc/"))
126169
+ ) {
126170
+ throw new TypeError("Temporal objects with an IANA timezone are not allowed in Temporal strict mode");
126171
+ }
126172
+ }
126173
+ case "temporal/uc":
126174
+ if (strictTemporal && val2.calendarId !== "iso8601")
126175
+ throw new TypeError("Temporal objects with a non-default calendar are not allowed in Temporal strict mode");
126176
+ return val2.toString({
126177
+ calendarName: "never",
126178
+ timeZoneName: "never"
126179
+ });
126180
+ case "temporal/x":
126181
+ throw new TypeError("Unsupported " + val2[Symbol.toStringTag]);
126375
126182
  }
126376
126183
  }
126377
- function stringifyInlineTable2(obj, depth, numberAsFloat) {
126184
+ function stringifyInlineTable2(obj, depth, numberAsFloat, strictTemporal) {
126378
126185
  let keys = Object.keys(obj);
126379
126186
  if (keys.length === 0)
126380
126187
  return "{}";
@@ -126383,13 +126190,11 @@ function stringifyInlineTable2(obj, depth, numberAsFloat) {
126383
126190
  let k7 = keys[i8];
126384
126191
  if (i8)
126385
126192
  res += ", ";
126386
- res += BARE_KEY2.test(k7) ? k7 : formatString2(k7);
126387
- res += " = ";
126388
- res += stringifyValue2(obj[k7], extendedTypeOf2(obj[k7]), depth - 1, numberAsFloat);
126193
+ res += formatKey2(k7) + " = " + stringifyValue2(obj[k7], extendedTypeOf2(obj[k7]), depth - 1, numberAsFloat, strictTemporal);
126389
126194
  }
126390
126195
  return res + " }";
126391
126196
  }
126392
- function stringifyArray2(array2, depth, numberAsFloat) {
126197
+ function stringifyArray2(array2, depth, numberAsFloat, strictTemporal) {
126393
126198
  if (array2.length === 0)
126394
126199
  return "[]";
126395
126200
  let res = "[ ";
@@ -126399,11 +126204,11 @@ function stringifyArray2(array2, depth, numberAsFloat) {
126399
126204
  if (array2[i8] === null || array2[i8] === void 0) {
126400
126205
  throw new TypeError("arrays cannot contain null or undefined values");
126401
126206
  }
126402
- res += stringifyValue2(array2[i8], extendedTypeOf2(array2[i8]), depth - 1, numberAsFloat);
126207
+ res += stringifyValue2(array2[i8], extendedTypeOf2(array2[i8]), depth - 1, numberAsFloat, strictTemporal);
126403
126208
  }
126404
126209
  return res + " ]";
126405
126210
  }
126406
- function stringifyArrayTable2(array2, key, depth, numberAsFloat) {
126211
+ function stringifyArrayTable2(array2, key, depth, numberAsFloat, strictTemporal) {
126407
126212
  if (depth === 0) {
126408
126213
  throw new Error("Could not stringify the object: maximum object depth exceeded");
126409
126214
  }
@@ -126411,11 +126216,11 @@ function stringifyArrayTable2(array2, key, depth, numberAsFloat) {
126411
126216
  for (let i8 = 0; i8 < array2.length; i8++) {
126412
126217
  res += `${res && "\n"}[[${key}]]
126413
126218
  `;
126414
- res += stringifyTable2(0, array2[i8], key, depth, numberAsFloat);
126219
+ res += stringifyTable2(0, array2[i8], key, depth, numberAsFloat, strictTemporal);
126415
126220
  }
126416
126221
  return res;
126417
126222
  }
126418
- function stringifyTable2(tableKey, obj, prefix, depth, numberAsFloat) {
126223
+ function stringifyTable2(tableKey, obj, prefix, depth, numberAsFloat, strictTemporal) {
126419
126224
  if (depth === 0) {
126420
126225
  throw new Error("Could not stringify the object: maximum object depth exceeded");
126421
126226
  }
@@ -126429,16 +126234,16 @@ function stringifyTable2(tableKey, obj, prefix, depth, numberAsFloat) {
126429
126234
  if (type === "symbol" || type === "function") {
126430
126235
  throw new TypeError(`cannot serialize values of type '${type}'`);
126431
126236
  }
126432
- let key = BARE_KEY2.test(k7) ? k7 : formatString2(k7);
126237
+ let key = formatKey2(k7);
126433
126238
  if (type === "array" && isArrayOfTables2(obj[k7])) {
126434
- tables += (tables && "\n") + stringifyArrayTable2(obj[k7], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat);
126239
+ tables += (tables && "\n") + stringifyArrayTable2(obj[k7], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat, strictTemporal);
126435
126240
  } else if (type === "object") {
126436
126241
  let tblKey = prefix ? `${prefix}.${key}` : key;
126437
- tables += (tables && "\n") + stringifyTable2(tblKey, obj[k7], tblKey, depth - 1, numberAsFloat);
126242
+ tables += (tables && "\n") + stringifyTable2(tblKey, obj[k7], tblKey, depth - 1, numberAsFloat, strictTemporal);
126438
126243
  } else {
126439
126244
  preamble += key;
126440
126245
  preamble += " = ";
126441
- preamble += stringifyValue2(obj[k7], type, depth, numberAsFloat);
126246
+ preamble += stringifyValue2(obj[k7], type, depth, numberAsFloat, strictTemporal);
126442
126247
  preamble += "\n";
126443
126248
  }
126444
126249
  }
@@ -126449,11 +126254,11 @@ ${preamble}` : `[${tableKey}]`;
126449
126254
  return preamble && tables ? `${preamble}
126450
126255
  ${tables}` : preamble || tables;
126451
126256
  }
126452
- function stringify3(obj, { maxDepth = 1e3, numbersAsFloat = false } = {}) {
126257
+ function stringify3(obj, { maxDepth = 1e3, numbersAsFloat = false, strictTemporal = false } = {}) {
126453
126258
  if (extendedTypeOf2(obj) !== "object") {
126454
126259
  throw new TypeError("stringify can only be called with an object");
126455
126260
  }
126456
- let str = stringifyTable2(0, obj, "", maxDepth, numbersAsFloat);
126261
+ let str = stringifyTable2(0, obj, "", maxDepth, numbersAsFloat, strictTemporal);
126457
126262
  if (str[str.length - 1] !== "\n")
126458
126263
  return str + "\n";
126459
126264
  return str;
@@ -127004,9 +126809,9 @@ function scrubEncryptedCredentials(options) {
127004
126809
  }
127005
126810
  return { backendAvailable: false, encryptedFileExisted };
127006
126811
  }
127007
- var import_undici3, hasWarnedAboutDeprecatedV1ApiToken, getCloudflareAPITokenFromEnv, getCloudflareGlobalAuthKeyFromEnv, getCloudflareGlobalAuthEmailFromEnv, ACCOUNT_ID_PATTERN, getAuthDomainFromEnv, getAuthUrlFromEnv, getTokenUrlFromEnv, getRevokeUrlFromEnv, readCloudflareAccountIdFromEnv, DEVICE_AUTH_PATH, getAccessClientIdFromEnv, getAccessClientSecretFromEnv, getCfAuthorizationTokenFromEnv, getCloudflareAuthUseKeyringFromEnv, headersCache, usesAccessCache, RECOMMENDED_CODE_VERIFIER_LENGTH, RECOMMENDED_STATE_LENGTH, PKCE_CHARSET, generateVerificationUrl, generateAuthUrl, POW_MAX_ITERATIONS, TEMPORARY_TERMS_URLS, TEMPORARY_TERMS_PROMPT, TEMPORARY_TERMS_NOTICE, TEMPORARY_TERMS_ERROR, EVENT_ACCOUNT_ERRORS, esm_default3, ErrorOAuth2, ErrorUnknown, ErrorNoAuthCode, ErrorInvalidReturnedStateParam, ErrorInvalidJson, ErrorInvalidScope, ErrorInvalidRequest, ErrorInvalidToken, ErrorAuthenticationGrant, ErrorUnauthorizedClient, ErrorAccessDenied, ErrorUnsupportedResponseType, ErrorServerError, ErrorTemporarilyUnavailable, ErrorAccessTokenResponse, ErrorInvalidClient, ErrorInvalidGrant, ErrorUnsupportedGrantType, DEVICE_FLOW_MAX_DURATION_SECONDS, DEVICE_FLOW_MIN_POLL_INTERVAL_SECONDS, RESERVED_PROFILE_NAMES, DATE_TIME_RE2, TomlDate2, TomlError2, INT_REGEX2, FLOAT_REGEX2, LEADING_ZERO2, KEY_PART_RE2, BARE_KEY2, dist_default2, FILE_FORMATS, USER_AUTH_CONFIG_PATH, FileCredentialStore, KEY_LENGTH_BYTES, IV_LENGTH_BYTES, TAG_LENGTH_BYTES, ALGORITHM_LABEL, CIPHER_NAME, EncryptedFileCredentialStore, PINNED_KEYRING_VERSION, npmRunner, cachedBindingPathByDir, entryFactoryOverride, runner, cachedProbeResult, LinuxSecretToolKeyProvider, SECURITY_EXIT_ITEM_NOT_FOUND, runner2, MacSecurityKeyProvider, NapiKeyringKeyProvider, testProviderFactory, sessionFlags;
127008
- var init_chunk_XLADBZ7F = __esm({
127009
- "../workers-auth/dist/chunk-XLADBZ7F.mjs"() {
126812
+ var import_undici3, hasWarnedAboutDeprecatedV1ApiToken, getCloudflareAPITokenFromEnv, getCloudflareGlobalAuthKeyFromEnv, getCloudflareGlobalAuthEmailFromEnv, ACCOUNT_ID_PATTERN, getAuthDomainFromEnv, getAuthUrlFromEnv, getTokenUrlFromEnv, getRevokeUrlFromEnv, readCloudflareAccountIdFromEnv, DEVICE_AUTH_PATH, getAccessClientIdFromEnv, getAccessClientSecretFromEnv, getCfAuthorizationTokenFromEnv, getCloudflareAuthUseKeyringFromEnv, headersCache, usesAccessCache, RECOMMENDED_CODE_VERIFIER_LENGTH, RECOMMENDED_STATE_LENGTH, PKCE_CHARSET, generateVerificationUrl, generateAuthUrl, POW_MAX_ITERATIONS, TEMPORARY_TERMS_URLS, TEMPORARY_TERMS_PROMPT, TEMPORARY_TERMS_NOTICE, TEMPORARY_TERMS_ERROR, EVENT_ACCOUNT_ERRORS, esm_default3, ErrorOAuth2, ErrorUnknown, ErrorNoAuthCode, ErrorInvalidReturnedStateParam, ErrorInvalidJson, ErrorInvalidScope, ErrorInvalidRequest, ErrorInvalidToken, ErrorAuthenticationGrant, ErrorUnauthorizedClient, ErrorAccessDenied, ErrorUnsupportedResponseType, ErrorServerError, ErrorTemporarilyUnavailable, ErrorAccessTokenResponse, ErrorInvalidClient, ErrorInvalidGrant, ErrorUnsupportedGrantType, DEVICE_FLOW_MAX_DURATION_SECONDS, DEVICE_FLOW_MIN_POLL_INTERVAL_SECONDS, RESERVED_PROFILE_NAMES, BARE_KEY2, HAS_WELLFORMED2, FILE_FORMATS, USER_AUTH_CONFIG_PATH, FileCredentialStore, KEY_LENGTH_BYTES, IV_LENGTH_BYTES, TAG_LENGTH_BYTES, ALGORITHM_LABEL, CIPHER_NAME, EncryptedFileCredentialStore, PINNED_KEYRING_VERSION, npmRunner, cachedBindingPathByDir, entryFactoryOverride, runner, cachedProbeResult, LinuxSecretToolKeyProvider, SECURITY_EXIT_ITEM_NOT_FOUND, runner2, MacSecurityKeyProvider, NapiKeyringKeyProvider, testProviderFactory, sessionFlags;
126813
+ var init_chunk_WMSASLDV = __esm({
126814
+ "../workers-auth/dist/chunk-WMSASLDV.mjs"() {
127010
126815
  init_import_meta_url();
127011
126816
  init_chunk_O6YSETKJ();
127012
126817
  init_src();
@@ -127461,166 +127266,18 @@ var init_chunk_XLADBZ7F = __esm({
127461
127266
  __name2(formatDirectoryForUserError, "formatDirectoryForUserError");
127462
127267
  __name(getProfileForDirectoryFromBindings, "getProfileForDirectoryFromBindings");
127463
127268
  __name2(getProfileForDirectoryFromBindings, "getProfileForDirectoryFromBindings");
127464
- DATE_TIME_RE2 = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
127465
- TomlDate2 = class _TomlDate extends Date {
127466
- static {
127467
- __name(this, "_TomlDate");
127468
- }
127469
- static {
127470
- __name2(this, "TomlDate");
127471
- }
127472
- #hasDate = false;
127473
- #hasTime = false;
127474
- #offset = null;
127475
- constructor(date5) {
127476
- let hasDate = true;
127477
- let hasTime = true;
127478
- let offset = "Z";
127479
- if (typeof date5 === "string") {
127480
- let match4 = date5.match(DATE_TIME_RE2);
127481
- if (match4) {
127482
- if (!match4[1]) {
127483
- hasDate = false;
127484
- date5 = `0000-01-01T${date5}`;
127485
- }
127486
- hasTime = !!match4[2];
127487
- hasTime && date5[10] === " " && (date5 = date5.replace(" ", "T"));
127488
- if (match4[2] && +match4[2] > 23) {
127489
- date5 = "";
127490
- } else {
127491
- offset = match4[3] || null;
127492
- date5 = date5.toUpperCase();
127493
- if (!offset && hasTime)
127494
- date5 += "Z";
127495
- }
127496
- } else {
127497
- date5 = "";
127498
- }
127499
- }
127500
- super(date5);
127501
- if (!isNaN(this.getTime())) {
127502
- this.#hasDate = hasDate;
127503
- this.#hasTime = hasTime;
127504
- this.#offset = offset;
127505
- }
127506
- }
127507
- isDateTime() {
127508
- return this.#hasDate && this.#hasTime;
127509
- }
127510
- isLocal() {
127511
- return !this.#hasDate || !this.#hasTime || !this.#offset;
127512
- }
127513
- isDate() {
127514
- return this.#hasDate && !this.#hasTime;
127515
- }
127516
- isTime() {
127517
- return this.#hasTime && !this.#hasDate;
127518
- }
127519
- isValid() {
127520
- return this.#hasDate || this.#hasTime;
127521
- }
127522
- toISOString() {
127523
- let iso = super.toISOString();
127524
- if (this.isDate())
127525
- return iso.slice(0, 10);
127526
- if (this.isTime())
127527
- return iso.slice(11, 23);
127528
- if (this.#offset === null)
127529
- return iso.slice(0, -1);
127530
- if (this.#offset === "Z")
127531
- return iso;
127532
- let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);
127533
- offset = this.#offset[0] === "-" ? offset : -offset;
127534
- let offsetDate = new Date(this.getTime() - offset * 6e4);
127535
- return offsetDate.toISOString().slice(0, -1) + this.#offset;
127536
- }
127537
- static wrapAsOffsetDateTime(jsDate, offset = "Z") {
127538
- let date5 = new _TomlDate(jsDate);
127539
- date5.#offset = offset;
127540
- return date5;
127541
- }
127542
- static wrapAsLocalDateTime(jsDate) {
127543
- let date5 = new _TomlDate(jsDate);
127544
- date5.#offset = null;
127545
- return date5;
127546
- }
127547
- static wrapAsLocalDate(jsDate) {
127548
- let date5 = new _TomlDate(jsDate);
127549
- date5.#hasTime = false;
127550
- date5.#offset = null;
127551
- return date5;
127552
- }
127553
- static wrapAsLocalTime(jsDate) {
127554
- let date5 = new _TomlDate(jsDate);
127555
- date5.#hasDate = false;
127556
- date5.#offset = null;
127557
- return date5;
127558
- }
127559
- };
127560
- __name(getLineColFromPtr2, "getLineColFromPtr");
127561
- __name2(getLineColFromPtr2, "getLineColFromPtr");
127562
- __name(makeCodeBlock2, "makeCodeBlock");
127563
- __name2(makeCodeBlock2, "makeCodeBlock");
127564
- TomlError2 = class extends Error {
127565
- static {
127566
- __name(this, "TomlError");
127567
- }
127568
- static {
127569
- __name2(this, "TomlError");
127570
- }
127571
- line;
127572
- column;
127573
- codeblock;
127574
- constructor(message, options) {
127575
- const [line, column] = getLineColFromPtr2(options.toml, options.ptr);
127576
- const codeblock = makeCodeBlock2(options.toml, line, column);
127577
- super(`Invalid TOML document: ${message}
127578
-
127579
- ${codeblock}`, options);
127580
- this.line = line;
127581
- this.column = column;
127582
- this.codeblock = codeblock;
127583
- }
127584
- };
127585
- __name(indexOfNewline2, "indexOfNewline");
127586
- __name2(indexOfNewline2, "indexOfNewline");
127587
- __name(skipComment2, "skipComment");
127588
- __name2(skipComment2, "skipComment");
127589
- __name(skipVoid2, "skipVoid");
127590
- __name2(skipVoid2, "skipVoid");
127591
- __name(skipUntil2, "skipUntil");
127592
- __name2(skipUntil2, "skipUntil");
127593
- INT_REGEX2 = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
127594
- FLOAT_REGEX2 = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
127595
- LEADING_ZERO2 = /^[+-]?0[0-9_]/;
127596
- __name(parseString2, "parseString");
127597
- __name2(parseString2, "parseString");
127598
- __name(sliceAndTrimEndOf2, "sliceAndTrimEndOf");
127599
- __name2(sliceAndTrimEndOf2, "sliceAndTrimEndOf");
127600
- __name(parseValue2, "parseValue");
127601
- __name2(parseValue2, "parseValue");
127602
- __name(extractValue2, "extractValue");
127603
- __name2(extractValue2, "extractValue");
127604
- KEY_PART_RE2 = /^[a-zA-Z0-9-_]+[ \t]*$/;
127605
- __name(parseKey2, "parseKey");
127606
- __name2(parseKey2, "parseKey");
127607
- __name(parseInlineTable2, "parseInlineTable");
127608
- __name2(parseInlineTable2, "parseInlineTable");
127609
- __name(parseArray2, "parseArray");
127610
- __name2(parseArray2, "parseArray");
127611
- __name(peekTable2, "peekTable");
127612
- __name2(peekTable2, "peekTable");
127613
- __name(parse6, "parse");
127614
- __name2(parse6, "parse");
127615
127269
  BARE_KEY2 = /^[a-z0-9-_]+$/i;
127270
+ HAS_WELLFORMED2 = !!"".isWellFormed;
127616
127271
  __name(extendedTypeOf2, "extendedTypeOf");
127617
127272
  __name2(extendedTypeOf2, "extendedTypeOf");
127618
127273
  __name(isArrayOfTables2, "isArrayOfTables");
127619
127274
  __name2(isArrayOfTables2, "isArrayOfTables");
127275
+ __name(formatWellFormedStringUnchecked2, "formatWellFormedStringUnchecked");
127276
+ __name2(formatWellFormedStringUnchecked2, "formatWellFormedStringUnchecked");
127620
127277
  __name(formatString2, "formatString");
127621
127278
  __name2(formatString2, "formatString");
127622
- __name(stringifyTemporal2, "stringifyTemporal");
127623
- __name2(stringifyTemporal2, "stringifyTemporal");
127279
+ __name(formatKey2, "formatKey");
127280
+ __name2(formatKey2, "formatKey");
127624
127281
  __name(stringifyValue2, "stringifyValue");
127625
127282
  __name2(stringifyValue2, "stringifyValue");
127626
127283
  __name(stringifyInlineTable2, "stringifyInlineTable");
@@ -127633,11 +127290,10 @@ ${codeblock}`, options);
127633
127290
  __name2(stringifyTable2, "stringifyTable");
127634
127291
  __name(stringify3, "stringify");
127635
127292
  __name2(stringify3, "stringify");
127636
- dist_default2 = { parse: parse6, stringify: stringify3, TomlDate: TomlDate2, TomlError: TomlError2 };
127637
127293
  FILE_FORMATS = {
127638
127294
  toml: {
127639
127295
  parse: /* @__PURE__ */ __name2((raw) => parseTOML(raw), "parse"),
127640
- stringify: /* @__PURE__ */ __name2((value) => dist_default2.stringify(value), "stringify")
127296
+ stringify: /* @__PURE__ */ __name2((value) => stringify3(value), "stringify")
127641
127297
  },
127642
127298
  json: {
127643
127299
  parse: /* @__PURE__ */ __name2((raw) => JSON.parse(raw), "parse"),
@@ -128135,7 +127791,7 @@ ${codeblock}`, options);
128135
127791
  var init_dist2 = __esm({
128136
127792
  "../workers-auth/dist/index.mjs"() {
128137
127793
  init_import_meta_url();
128138
- init_chunk_XLADBZ7F();
127794
+ init_chunk_WMSASLDV();
128139
127795
  }
128140
127796
  });
128141
127797
  function createPreferences(getConfigPath2) {
@@ -129043,10 +128699,10 @@ function createAuthConfigFileHelpers(deps) {
129043
128699
  };
129044
128700
  }
129045
128701
  var millisecondsInMinute, minutesInYear, minutesInMonth, minutesInDay, constructFromSymbol, defaultOptions2, formatDistanceLocale, formatDistance, dateFormats, timeFormats, dateTimeFormats, formatLong, formatRelativeLocale, formatRelative, eraValues, quarterValues, monthValues, dayValues, dayPeriodValues, formattingDayPeriodValues, ordinalNumber, localize, matchOrdinalNumberPattern, parseOrdinalNumberPattern, matchEraPatterns, parseEraPatterns, matchQuarterPatterns, parseQuarterPatterns, matchMonthPatterns, parseMonthPatterns, matchDayPatterns, parseDayPatterns, matchDayPeriodPatterns, parseDayPeriodPatterns, match, enUS, MEMBERSHIPS_INACCESSIBLE_CODES, DIRECTORY_BINDINGS_FILE, ENCRYPTED_PROFILE_CONFIG_EXTENSION;
129046
- var init_chunk_3U6VZT7T = __esm({
129047
- "../workers-auth/dist/chunk-3U6VZT7T.mjs"() {
128702
+ var init_chunk_V6MEAFHI = __esm({
128703
+ "../workers-auth/dist/chunk-V6MEAFHI.mjs"() {
129048
128704
  init_import_meta_url();
129049
- init_chunk_XLADBZ7F();
128705
+ init_chunk_WMSASLDV();
129050
128706
  init_chunk_O6YSETKJ();
129051
128707
  init_src();
129052
128708
  __name(createPreferences, "createPreferences");
@@ -129560,7 +129216,7 @@ var DefaultScopes, DefaultScopeKeys, WRANGLER_KEYRING_SERVICE_NAME, WRANGLER_CLI
129560
129216
  var init_wrangler = __esm({
129561
129217
  "../workers-auth/dist/wrangler/index.mjs"() {
129562
129218
  init_import_meta_url();
129563
- init_chunk_3U6VZT7T();
129219
+ init_chunk_V6MEAFHI();
129564
129220
  init_chunk_O6YSETKJ();
129565
129221
  init_src();
129566
129222
  DefaultScopes = {
@@ -135849,7 +135505,7 @@ function convertExports(config2, result) {
135849
135505
  const converted = {};
135850
135506
  const unknownExports = {};
135851
135507
  for (const [exportName, value] of Object.entries(exports$2)) {
135852
- if (value.type === "worker") {
135508
+ if (value.type === "worker" || value.type === "workflow") {
135853
135509
  converted[exportName] = value;
135854
135510
  continue;
135855
135511
  }
@@ -135943,7 +135599,11 @@ function convertTriggers(config2, result) {
135943
135599
  connectHandlers.push(omitUndefined({
135944
135600
  protocol: trigger.protocol,
135945
135601
  port: trigger.port,
135946
- address: trigger.address
135602
+ address: trigger.address,
135603
+ ...trigger.protocol === "udp" ? {
135604
+ idle_timeout_ms: trigger.idleTimeoutMs,
135605
+ max_pending_bytes: trigger.maxPendingBytes
135606
+ } : {}
135947
135607
  }));
135948
135608
  break;
135949
135609
  }
@@ -136238,7 +135898,7 @@ async function loadAndParseConfig(configPath, ctx) {
136238
135898
  dependencies
136239
135899
  };
136240
135900
  }
136241
- var __getOwnPropNames2, __commonJS2, RemoteBindingDevSchema, AssetsSchema, BrowserBindingSchema, WorkerBindingSchema, D1BindingSchema, KVBindingSchema, QueueBindingSchema, R2BindingSchema, AnalyticsEngineDatasetBindingSchema, FlagshipBindingSchema, HyperdriveBindingSchema, KnownBindingSchema, UnsafeBindingSchema, BindingSchema, CacheSchema, SINGLETON_BINDING_TYPES, listFormatter, EnvSchema, ContainerImageDockerfileSchema, ContainerImageReferenceSchema, ContainerImageLocalReferenceSchema, InputContainerImageSchema, OutputContainerImageSchema, VALID_ROLLOUT_STEP_PERCENTAGES, ContainerRolloutStepPercentageSchema, ContainerObservabilityBaseSchema, StandardContainerObservabilitySchema, BaseContainerSchema, StandardContainerBaseSchema, DurableObjectContainerBaseSchema, InputContainerSchema, DurableObjectCreatedExportSchema, DurableObjectDeletedExportSchema, DurableObjectRenamedExportSchema, DurableObjectTransferredExportSchema, DurableObjectExpectingTransferExportSchema, WorkerEntrypointExportSchema, DurableObjectCreatedSqliteExportSchema, DurableObjectCreatedLegacyKvExportSchema, DurableObjectExpectingTransferSqliteExportSchema, DurableObjectExpectingTransferLegacyKvExportSchema, ExportSchema, LimitsSchema, ObservabilitySchema, PlacementSchema, TailConsumerSchema, TriggerSchema, UnsafeSchema, BaseWorkerSchema, InputWorkerSchema, InputSettingsSchema, InputConfigSchema, BuildContextSchema, ModuleTypeSchema, ManifestModulesSchema, ManifestSchema, require_dist2, import_dist, __defProp3, __name3, UserError2, FatalError2, JsonFriendlyFatalError2, ROLLOUT_KIND_MAP, CF_WORKER_SCHEME, CF_WORKER_TYPE, CF_ATTR, CF_NO_CACHE_VALUE, CF_NO_CACHE_QUERY_KEY, RE_NODE_MODULES, depsStore, deregister, CROSS_WORKER_BINDING_TYPES;
135901
+ var __getOwnPropNames2, __commonJS2, RemoteBindingDevSchema, AssetsSchema, BrowserBindingSchema, WorkerBindingSchema, D1BindingSchema, KVBindingSchema, QueueBindingSchema, R2BindingSchema, AnalyticsEngineDatasetBindingSchema, FlagshipBindingSchema, HyperdriveBindingSchema, KnownBindingSchema, UnsafeBindingSchema, BindingSchema, CacheSchema, SINGLETON_BINDING_TYPES, listFormatter, EnvSchema, ContainerImageDockerfileSchema, ContainerImageReferenceSchema, ContainerImageLocalReferenceSchema, InputContainerImageSchema, OutputContainerImageSchema, VALID_ROLLOUT_STEP_PERCENTAGES, ContainerRolloutStepPercentageSchema, ContainerObservabilityBaseSchema, StandardContainerObservabilitySchema, BaseContainerSchema, StandardContainerBaseSchema, DurableObjectContainerBaseSchema, InputContainerSchema, DurableObjectCreatedExportSchema, DurableObjectDeletedExportSchema, DurableObjectRenamedExportSchema, DurableObjectTransferredExportSchema, DurableObjectExpectingTransferExportSchema, WorkerEntrypointExportSchema, WorkflowRetentionSchema, WorkflowExportSchema, DurableObjectCreatedSqliteExportSchema, DurableObjectCreatedLegacyKvExportSchema, DurableObjectExpectingTransferSqliteExportSchema, DurableObjectExpectingTransferLegacyKvExportSchema, ExportSchema, LimitsSchema, ObservabilitySchema, PlacementSchema, TailConsumerSchema, TriggerSchema, UnsafeSchema, BaseWorkerSchema, InputWorkerSchema, InputSettingsSchema, InputConfigSchema, BuildContextSchema, ModuleTypeSchema, ManifestModulesSchema, ManifestSchema, require_dist2, import_dist, __defProp3, __name3, UserError2, FatalError2, JsonFriendlyFatalError2, ROLLOUT_KIND_MAP, CF_WORKER_SCHEME, CF_WORKER_TYPE, CF_ATTR, CF_NO_CACHE_VALUE, CF_NO_CACHE_QUERY_KEY, RE_NODE_MODULES, depsStore, deregister, CROSS_WORKER_BINDING_TYPES;
136242
135902
  var init_dist3 = __esm({
136243
135903
  "../config/dist/index.mjs"() {
136244
135904
  init_import_meta_url();
@@ -136621,6 +136281,18 @@ var init_dist3 = __esm({
136621
136281
  type: literal("worker"),
136622
136282
  cache: strictObject({ enabled: boolean2() }).optional()
136623
136283
  });
136284
+ WorkflowRetentionSchema = union([number2().int().min(1), string2().min(1)]);
136285
+ WorkflowExportSchema = strictObject({
136286
+ type: literal("workflow"),
136287
+ name: string2(),
136288
+ limits: strictObject({ steps: number2().int().min(1).optional() }).optional(),
136289
+ concurrency: strictObject({ limit: number2().int().min(1).optional() }).optional(),
136290
+ schedules: union([string2().min(1), array(string2().min(1)).min(1)]).optional(),
136291
+ default_retention: strictObject({
136292
+ success_retention: WorkflowRetentionSchema.optional(),
136293
+ error_retention: WorkflowRetentionSchema.optional()
136294
+ }).optional()
136295
+ });
136624
136296
  DurableObjectCreatedSqliteExportSchema = DurableObjectCreatedExportSchema.extend({ storage: literal("sqlite") });
136625
136297
  DurableObjectCreatedLegacyKvExportSchema = DurableObjectCreatedExportSchema.omit({ container: true }).extend({ storage: literal("legacy-kv") });
136626
136298
  DurableObjectExpectingTransferSqliteExportSchema = DurableObjectExpectingTransferExportSchema.extend({ storage: literal("sqlite") });
@@ -136633,7 +136305,8 @@ var init_dist3 = __esm({
136633
136305
  DurableObjectTransferredExportSchema,
136634
136306
  DurableObjectExpectingTransferSqliteExportSchema,
136635
136307
  DurableObjectExpectingTransferLegacyKvExportSchema,
136636
- WorkerEntrypointExportSchema
136308
+ WorkerEntrypointExportSchema,
136309
+ WorkflowExportSchema
136637
136310
  ]);
136638
136311
  LimitsSchema = strictObject({
136639
136312
  cpuMs: number2().optional(),
@@ -136705,12 +136378,19 @@ var init_dist3 = __esm({
136705
136378
  type: literal("scheduled"),
136706
136379
  schedule: string2()
136707
136380
  }),
136708
- strictObject({
136381
+ discriminatedUnion("protocol", [strictObject({
136709
136382
  type: literal("connect"),
136710
- protocol: _enum2(["tcp"]),
136383
+ protocol: literal("tcp"),
136711
136384
  port: number2(),
136712
136385
  address: string2().optional()
136713
- })
136386
+ }), strictObject({
136387
+ type: literal("connect"),
136388
+ protocol: literal("udp"),
136389
+ port: number2(),
136390
+ address: string2().optional(),
136391
+ idleTimeoutMs: number2().int().min(0).max(4294967295).optional(),
136392
+ maxPendingBytes: number2().int().min(0).max(4294967295).optional()
136393
+ })])
136714
136394
  ]);
136715
136395
  UnsafeSchema = strictObject({
136716
136396
  metadata: record(string2(), unknown()).optional(),
@@ -137347,7 +137027,7 @@ var init_utils2 = __esm({
137347
137027
  });
137348
137028
 
137349
137029
  // ../../node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js
137350
- var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default3;
137030
+ var ANSI_RE, CONTROL_RE, TAB_RE, EMOJI_RE, LATIN_RE, MODIFIER_RE, NO_TRUNCATION, getStringTruncatedWidth, dist_default;
137351
137031
  var init_dist6 = __esm({
137352
137032
  "../../node_modules/.pnpm/fast-string-truncated-width@1.2.1/node_modules/fast-string-truncated-width/dist/index.js"() {
137353
137033
  init_import_meta_url();
@@ -137501,12 +137181,12 @@ var init_dist6 = __esm({
137501
137181
  ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
137502
137182
  };
137503
137183
  }, "getStringTruncatedWidth");
137504
- dist_default3 = getStringTruncatedWidth;
137184
+ dist_default = getStringTruncatedWidth;
137505
137185
  }
137506
137186
  });
137507
137187
 
137508
137188
  // ../../node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js
137509
- var NO_TRUNCATION2, fastStringWidth, dist_default4;
137189
+ var NO_TRUNCATION2, fastStringWidth, dist_default2;
137510
137190
  var init_dist7 = __esm({
137511
137191
  "../../node_modules/.pnpm/fast-string-width@1.1.0/node_modules/fast-string-width/dist/index.js"() {
137512
137192
  init_import_meta_url();
@@ -137517,9 +137197,9 @@ var init_dist7 = __esm({
137517
137197
  ellipsisWidth: 0
137518
137198
  };
137519
137199
  fastStringWidth = /* @__PURE__ */ __name((input, options = {}) => {
137520
- return dist_default3(input, NO_TRUNCATION2, options).width;
137200
+ return dist_default(input, NO_TRUNCATION2, options).width;
137521
137201
  }, "fastStringWidth");
137522
- dist_default4 = fastStringWidth;
137202
+ dist_default2 = fastStringWidth;
137523
137203
  }
137524
137204
  });
137525
137205
 
@@ -137573,13 +137253,13 @@ var init_main2 = __esm({
137573
137253
  let isInsideEscape = false;
137574
137254
  let isInsideLinkEscape = false;
137575
137255
  let lastRow = rows.at(-1);
137576
- let visible = lastRow === void 0 ? 0 : dist_default4(lastRow);
137256
+ let visible = lastRow === void 0 ? 0 : dist_default2(lastRow);
137577
137257
  let currentCharacter = characters.next();
137578
137258
  let nextCharacter = characters.next();
137579
137259
  let rawCharacterIndex = 0;
137580
137260
  while (!currentCharacter.done) {
137581
137261
  const character = currentCharacter.value;
137582
- const characterLength = dist_default4(character);
137262
+ const characterLength = dist_default2(character);
137583
137263
  if (visible + characterLength <= columns) {
137584
137264
  rows[rows.length - 1] += character;
137585
137265
  } else {
@@ -137619,7 +137299,7 @@ var init_main2 = __esm({
137619
137299
  const words = string4.split(" ");
137620
137300
  let last = words.length;
137621
137301
  while (last) {
137622
- if (dist_default4(words[last - 1])) {
137302
+ if (dist_default2(words[last - 1])) {
137623
137303
  break;
137624
137304
  }
137625
137305
  last--;
@@ -137646,7 +137326,7 @@ var init_main2 = __esm({
137646
137326
  const trimmed = row.trimStart();
137647
137327
  if (row.length !== trimmed.length) {
137648
137328
  rows[rows.length - 1] = trimmed;
137649
- rowLength = dist_default4(trimmed);
137329
+ rowLength = dist_default2(trimmed);
137650
137330
  }
137651
137331
  }
137652
137332
  if (index !== 0) {
@@ -137659,7 +137339,7 @@ var init_main2 = __esm({
137659
137339
  rowLength++;
137660
137340
  }
137661
137341
  }
137662
- const wordLength = dist_default4(word);
137342
+ const wordLength = dist_default2(word);
137663
137343
  if (options.hard && wordLength > columns) {
137664
137344
  const remainingColumns = columns - rowLength;
137665
137345
  const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
@@ -137668,13 +137348,13 @@ var init_main2 = __esm({
137668
137348
  rows.push("");
137669
137349
  }
137670
137350
  wrapWord(rows, word, columns);
137671
- rowLength = dist_default4(rows.at(-1) ?? "");
137351
+ rowLength = dist_default2(rows.at(-1) ?? "");
137672
137352
  continue;
137673
137353
  }
137674
137354
  if (rowLength + wordLength > columns && rowLength && wordLength) {
137675
137355
  if (options.wordWrap === false && rowLength < columns) {
137676
137356
  wrapWord(rows, word, columns);
137677
- rowLength = dist_default4(rows.at(-1) ?? "");
137357
+ rowLength = dist_default2(rows.at(-1) ?? "");
137678
137358
  continue;
137679
137359
  }
137680
137360
  rows.push("");
@@ -137682,7 +137362,7 @@ var init_main2 = __esm({
137682
137362
  }
137683
137363
  if (rowLength + wordLength > columns && options.wordWrap === false) {
137684
137364
  wrapWord(rows, word, columns);
137685
- rowLength = dist_default4(rows.at(-1) ?? "");
137365
+ rowLength = dist_default2(rows.at(-1) ?? "");
137686
137366
  continue;
137687
137367
  }
137688
137368
  rows[rows.length - 1] += word;
@@ -144358,7 +144038,7 @@ var init_dist9 = __esm({
144358
144038
  }
144359
144039
  __name(push3, "push");
144360
144040
  __name5(push3, "push");
144361
- function parse18(header) {
144041
+ function parse17(header) {
144362
144042
  const offers = /* @__PURE__ */ Object.create(null);
144363
144043
  let params = /* @__PURE__ */ Object.create(null);
144364
144044
  let mustUnescape = false;
@@ -144483,8 +144163,8 @@ var init_dist9 = __esm({
144483
144163
  }
144484
144164
  return offers;
144485
144165
  }
144486
- __name(parse18, "parse");
144487
- __name5(parse18, "parse");
144166
+ __name(parse17, "parse");
144167
+ __name5(parse17, "parse");
144488
144168
  function format9(extensions) {
144489
144169
  return Object.keys(extensions).map((extension2) => {
144490
144170
  let configurations = extensions[extension2];
@@ -144502,7 +144182,7 @@ var init_dist9 = __esm({
144502
144182
  }
144503
144183
  __name(format9, "format");
144504
144184
  __name5(format9, "format");
144505
- module2.exports = { format: format9, parse: parse18 };
144185
+ module2.exports = { format: format9, parse: parse17 };
144506
144186
  }
144507
144187
  });
144508
144188
  require_websocket2 = __commonJS3({
@@ -144533,7 +144213,7 @@ var init_dist9 = __esm({
144533
144213
  var {
144534
144214
  EventTarget: { addEventListener, removeEventListener }
144535
144215
  } = require_event_target();
144536
- var { format: format9, parse: parse18 } = require_extension();
144216
+ var { format: format9, parse: parse17 } = require_extension();
144537
144217
  var { toBuffer } = require_buffer_util();
144538
144218
  var kAborted = Symbol("kAborted");
144539
144219
  var protocolVersions = [8, 13];
@@ -145216,7 +144896,7 @@ var init_dist9 = __esm({
145216
144896
  }
145217
144897
  let extensions;
145218
144898
  try {
145219
- extensions = parse18(secWebSocketExtensions);
144899
+ extensions = parse17(secWebSocketExtensions);
145220
144900
  } catch (err) {
145221
144901
  const message = "Invalid Sec-WebSocket-Extensions header";
145222
144902
  abortHandshake(websocket, socket, message);
@@ -145550,7 +145230,7 @@ var init_dist9 = __esm({
145550
145230
  require_subprotocol = __commonJS3({
145551
145231
  "../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/subprotocol.js"(exports$1, module2) {
145552
145232
  var { tokenChars } = require_validation();
145553
- function parse18(header) {
145233
+ function parse17(header) {
145554
145234
  const protocols = /* @__PURE__ */ new Set();
145555
145235
  let start = -1;
145556
145236
  let end = -1;
@@ -145586,9 +145266,9 @@ var init_dist9 = __esm({
145586
145266
  protocols.add(protocol);
145587
145267
  return protocols;
145588
145268
  }
145589
- __name(parse18, "parse");
145590
- __name5(parse18, "parse");
145591
- module2.exports = { parse: parse18 };
145269
+ __name(parse17, "parse");
145270
+ __name5(parse17, "parse");
145271
+ module2.exports = { parse: parse17 };
145592
145272
  }
145593
145273
  });
145594
145274
  require_websocket_server = __commonJS3({
@@ -149414,7 +149094,7 @@ var require_node_modules_paths = __commonJS({
149414
149094
  "../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/node-modules-paths.js"(exports$1, module2) {
149415
149095
  init_import_meta_url();
149416
149096
  var path107 = __require("path");
149417
- var parse18 = path107.parse || require_path_parse();
149097
+ var parse17 = path107.parse || require_path_parse();
149418
149098
  var getNodeModulesDirs = /* @__PURE__ */ __name(function getNodeModulesDirs2(absoluteStart, modules) {
149419
149099
  var prefix = "/";
149420
149100
  if (/^([A-Za-z]:)/.test(absoluteStart)) {
@@ -149423,10 +149103,10 @@ var require_node_modules_paths = __commonJS({
149423
149103
  prefix = "\\\\";
149424
149104
  }
149425
149105
  var paths = [absoluteStart];
149426
- var parsed = parse18(absoluteStart);
149106
+ var parsed = parse17(absoluteStart);
149427
149107
  while (parsed.dir !== paths[paths.length - 1]) {
149428
149108
  paths.push(parsed.dir);
149429
- parsed = parse18(parsed.dir);
149109
+ parsed = parse17(parsed.dir);
149430
149110
  }
149431
149111
  return paths.reduce(function(dirs, aPath) {
149432
149112
  return dirs.concat(modules.map(function(moduleDir) {
@@ -153411,7 +153091,7 @@ function canonicalizeLocalPath(userPath, global3) {
153411
153091
  return ".";
153412
153092
  return `./${rel}`;
153413
153093
  }
153414
- function parse7(spec, global3) {
153094
+ function parse6(spec, global3) {
153415
153095
  let localInput = null;
153416
153096
  if (sourceIsLocal(spec))
153417
153097
  localInput = sourceLocalPath(spec);
@@ -153519,7 +153199,7 @@ var init_download2 = __esm({
153519
153199
  __name(sourceNpmSplit, "sourceNpmSplit");
153520
153200
  __name(looksLikeLocalPath, "looksLikeLocalPath");
153521
153201
  __name(canonicalizeLocalPath, "canonicalizeLocalPath");
153522
- __name(parse7, "parse");
153202
+ __name(parse6, "parse");
153523
153203
  __name(buildTarballUrl, "buildTarballUrl");
153524
153204
  __name(downloadPackageTarball, "downloadPackageTarball");
153525
153205
  }
@@ -154877,7 +154557,7 @@ async function installPackage(opts) {
154877
154557
  if (opts.isNpm) {
154878
154558
  return installNpmReferences(opts);
154879
154559
  }
154880
- const spec = parse7(specStr, opts.global);
154560
+ const spec = parse6(specStr, opts.global);
154881
154561
  if (spec === null)
154882
154562
  return -1;
154883
154563
  if (spec.isLocal) {
@@ -158400,6 +158080,88 @@ var init_error_codes = __esm({
158400
158080
  WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE = 10208;
158401
158081
  }
158402
158082
  });
158083
+ function isWorkflowDefinedInThisScript(workflow, scriptName) {
158084
+ return workflow.script_name === void 0 || workflow.script_name === scriptName;
158085
+ }
158086
+ function getWorkflowsOwnedByScript(config2, scriptName) {
158087
+ const owned = /* @__PURE__ */ new Map();
158088
+ for (const workflow of config2.workflows ?? []) {
158089
+ if (isWorkflowDefinedInThisScript(workflow, scriptName)) {
158090
+ owned.set(workflow.name, workflow);
158091
+ }
158092
+ }
158093
+ for (const [className, workflowExport] of Object.entries(
158094
+ partitionExports(config2.exports).workflow
158095
+ )) {
158096
+ const binding = owned.get(workflowExport.name);
158097
+ owned.set(workflowExport.name, {
158098
+ name: workflowExport.name,
158099
+ class_name: className,
158100
+ limits: binding?.limits ?? workflowExport.limits,
158101
+ concurrency: binding?.concurrency ?? workflowExport.concurrency,
158102
+ schedules: binding?.schedules ?? workflowExport.schedules,
158103
+ default_retention: binding?.default_retention ?? workflowExport.default_retention
158104
+ });
158105
+ }
158106
+ return [...owned.values()];
158107
+ }
158108
+ function validateOwnedWorkflowDeclarations(config2, scriptName) {
158109
+ const exportsByWorkflowName = new Map(
158110
+ Object.entries(partitionExports(config2.exports).workflow).map(
158111
+ ([className, workflowExport]) => [
158112
+ workflowExport.name,
158113
+ { className, workflowExport }
158114
+ ]
158115
+ )
158116
+ );
158117
+ const errors = [];
158118
+ for (const [index, workflow] of (config2.workflows ?? []).entries()) {
158119
+ const match4 = exportsByWorkflowName.get(workflow.name);
158120
+ if (match4 === void 0) {
158121
+ continue;
158122
+ }
158123
+ const { className, workflowExport } = match4;
158124
+ if (!isWorkflowDefinedInThisScript(workflow, scriptName)) {
158125
+ errors.push(
158126
+ `"workflows[${index}]" binds the Workflow "${workflow.name}" of the Worker "${workflow.script_name}", but "exports.${className}" declares it in this Worker. Workflow names are unique per account, so remove "script_name" from the binding or give the export a different name.`
158127
+ );
158128
+ continue;
158129
+ }
158130
+ if (workflow.class_name !== className) {
158131
+ errors.push(
158132
+ `"workflows[${index}]" and "exports.${className}" both declare the Workflow "${workflow.name}", but with different classes ("${workflow.class_name}" and "${className}").`
158133
+ );
158134
+ }
158135
+ for (const key of [
158136
+ "limits",
158137
+ "concurrency",
158138
+ "schedules",
158139
+ "default_retention"
158140
+ ]) {
158141
+ const bindingValue = workflow[key];
158142
+ const exportValue = workflowExport[key];
158143
+ if (bindingValue !== void 0 && exportValue !== void 0 && !util.isDeepStrictEqual([bindingValue].flat(), [exportValue].flat())) {
158144
+ errors.push(
158145
+ `"workflows[${index}].${key}" and "exports.${className}.${key}" both configure the Workflow "${workflow.name}", but with different values. Set "${key}" in only one of them.`
158146
+ );
158147
+ }
158148
+ }
158149
+ }
158150
+ if (errors.length > 0) {
158151
+ throw new UserError(errors.join("\n"), {
158152
+ telemetryMessage: "workflow binding and export declarations conflict"
158153
+ });
158154
+ }
158155
+ }
158156
+ var init_owned_workflows = __esm({
158157
+ "../deploy-helpers/src/deploy/helpers/owned-workflows.ts"() {
158158
+ init_import_meta_url();
158159
+ init_src();
158160
+ __name(isWorkflowDefinedInThisScript, "isWorkflowDefinedInThisScript");
158161
+ __name(getWorkflowsOwnedByScript, "getWorkflowsOwnedByScript");
158162
+ __name(validateOwnedWorkflowDeclarations, "validateOwnedWorkflowDeclarations");
158163
+ }
158164
+ });
158403
158165
 
158404
158166
  // ../deploy-helpers/src/deploy/helpers/worker-not-found-error.ts
158405
158167
  function isWorkerNotFoundError(error53) {
@@ -159715,6 +159477,7 @@ async function triggersDeploy(props) {
159715
159477
  const { config: config2, scriptName, routes, crons } = props;
159716
159478
  if (props.validated !== true) {
159717
159479
  validateEventTriggerTargets(config2, scriptName);
159480
+ validateOwnedWorkflowDeclarations(config2, scriptName);
159718
159481
  }
159719
159482
  if (props.dryRun) {
159720
159483
  logger.log(`--dry-run: exiting now.`);
@@ -159739,9 +159502,7 @@ async function triggersDeploy(props) {
159739
159502
  const uploadMs = Date.now() - start;
159740
159503
  const deployments = [];
159741
159504
  const workflowDeployments = [];
159742
- const hasWorkflowsDefinedInThisScript = config2.workflows.some(
159743
- (workflow) => isWorkflowDefinedInThisScript(workflow, scriptName)
159744
- );
159505
+ const ownedWorkflows = getWorkflowsOwnedByScript(config2, scriptName);
159745
159506
  const { wantWorkersDev, workersDevInSync } = await subdomainDeploy(
159746
159507
  props,
159747
159508
  accountId,
@@ -159809,7 +159570,7 @@ ${dashLink}`, {
159809
159570
  });
159810
159571
  }
159811
159572
  }
159812
- if (!wantWorkersDev && hasWorkflowsDefinedInThisScript) {
159573
+ if (!wantWorkersDev && ownedWorkflows.length > 0) {
159813
159574
  await getWorkersDevSubdomain(config2, accountId, {
159814
159575
  configPath: config2.configPath,
159815
159576
  registrationContext: "workflows"
@@ -159890,98 +159651,97 @@ ${dashLink}`, {
159890
159651
  )
159891
159652
  );
159892
159653
  }
159893
- if (config2.workflows?.length) {
159894
- for (const workflow of config2.workflows) {
159895
- if (!isWorkflowDefinedInThisScript(workflow, scriptName)) {
159896
- if (workflow.limits) {
159897
- throw new UserError(
159898
- `Workflow "${workflow.name}" has "limits" configured but references external script "${workflow.script_name}". Configure limits on the worker that defines the workflow.`,
159899
- {
159900
- telemetryMessage: "triggers deploy workflow limits external script"
159901
- }
159902
- );
159903
- }
159904
- if (workflow.concurrency) {
159905
- throw new UserError(
159906
- `Workflow "${workflow.name}" has "concurrency" configured but references external script "${workflow.script_name}". Configure concurrency on the worker that defines the workflow.`,
159907
- {
159908
- telemetryMessage: "triggers deploy workflow concurrency external script"
159909
- }
159910
- );
159911
- }
159912
- if (workflow.schedules) {
159913
- throw new UserError(
159914
- `Workflow "${workflow.name}" has "schedules" configured but references external script "${workflow.script_name}". Configure schedules on the worker that defines the workflow.`,
159915
- {
159916
- telemetryMessage: "triggers deploy workflow schedules external script"
159917
- }
159918
- );
159919
- }
159920
- if (workflow.default_retention) {
159921
- throw new UserError(
159922
- `Workflow "${workflow.name}" has "default_retention" configured but references external script "${workflow.script_name}". Configure default_retention on the worker that defines the workflow.`,
159923
- {
159924
- telemetryMessage: "triggers deploy workflow default_retention external script"
159925
- }
159926
- );
159927
- }
159928
- continue;
159654
+ for (const workflow of config2.workflows) {
159655
+ if (!isWorkflowDefinedInThisScript(workflow, scriptName)) {
159656
+ if (workflow.limits) {
159657
+ throw new UserError(
159658
+ `Workflow "${workflow.name}" has "limits" configured but references external script "${workflow.script_name}". Configure limits on the worker that defines the workflow.`,
159659
+ {
159660
+ telemetryMessage: "triggers deploy workflow limits external script"
159661
+ }
159662
+ );
159929
159663
  }
159930
- workflowDeployments.push({
159931
- name: workflow.name,
159932
- deployment: fetchResult(
159933
- config2,
159934
- `/accounts/${accountId}/workflows/${workflow.name}`,
159664
+ if (workflow.concurrency) {
159665
+ throw new UserError(
159666
+ `Workflow "${workflow.name}" has "concurrency" configured but references external script "${workflow.script_name}". Configure concurrency on the worker that defines the workflow.`,
159935
159667
  {
159936
- method: "PUT",
159937
- body: JSON.stringify({
159938
- script_name: scriptName,
159939
- class_name: workflow.class_name,
159940
- ...workflow.limits && { limits: workflow.limits },
159941
- ...workflow.concurrency && {
159942
- concurrency: workflow.concurrency
159943
- },
159944
- ...workflow.schedules && {
159945
- schedules: (Array.isArray(workflow.schedules) ? workflow.schedules : [workflow.schedules]).map((cron) => ({ cron }))
159946
- },
159947
- ...workflow.default_retention && {
159948
- default_retention: workflow.default_retention
159949
- }
159950
- }),
159951
- headers: {
159952
- "Content-Type": "application/json"
159953
- }
159668
+ telemetryMessage: "triggers deploy workflow concurrency external script"
159954
159669
  }
159955
- ).then(
159956
- () => ({
159957
- category: "Workflows",
159958
- targets: [`workflow: ${workflow.name}`]
159959
- }),
159960
- (error53) => {
159961
- if (error53 instanceof APIError && error53.code === WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE && workflow.schedules) {
159962
- error53.preventReport();
159963
- return {
159964
- category: "Workflows",
159965
- targets: [],
159966
- error: new UserError(
159967
- `Workflow "${workflow.name}" has "schedules" configured, but scheduled Workflows require a paid Workers plan.`,
159968
- {
159969
- cause: error53,
159970
- telemetryMessage: "triggers deploy workflow cron requires paid plan"
159971
- }
159972
- )
159973
- };
159670
+ );
159671
+ }
159672
+ if (workflow.schedules) {
159673
+ throw new UserError(
159674
+ `Workflow "${workflow.name}" has "schedules" configured but references external script "${workflow.script_name}". Configure schedules on the worker that defines the workflow.`,
159675
+ {
159676
+ telemetryMessage: "triggers deploy workflow schedules external script"
159677
+ }
159678
+ );
159679
+ }
159680
+ if (workflow.default_retention) {
159681
+ throw new UserError(
159682
+ `Workflow "${workflow.name}" has "default_retention" configured but references external script "${workflow.script_name}". Configure default_retention on the worker that defines the workflow.`,
159683
+ {
159684
+ telemetryMessage: "triggers deploy workflow default_retention external script"
159685
+ }
159686
+ );
159687
+ }
159688
+ }
159689
+ }
159690
+ for (const workflow of ownedWorkflows) {
159691
+ workflowDeployments.push({
159692
+ name: workflow.name,
159693
+ deployment: fetchResult(
159694
+ config2,
159695
+ `/accounts/${accountId}/workflows/${workflow.name}`,
159696
+ {
159697
+ method: "PUT",
159698
+ body: JSON.stringify({
159699
+ script_name: scriptName,
159700
+ class_name: workflow.class_name,
159701
+ ...workflow.limits && { limits: workflow.limits },
159702
+ ...workflow.concurrency && {
159703
+ concurrency: workflow.concurrency
159704
+ },
159705
+ ...workflow.schedules && {
159706
+ schedules: (Array.isArray(workflow.schedules) ? workflow.schedules : [workflow.schedules]).map((cron) => ({ cron }))
159707
+ },
159708
+ ...workflow.default_retention && {
159709
+ default_retention: workflow.default_retention
159974
159710
  }
159711
+ }),
159712
+ headers: {
159713
+ "Content-Type": "application/json"
159714
+ }
159715
+ }
159716
+ ).then(
159717
+ () => ({
159718
+ category: "Workflows",
159719
+ targets: [`workflow: ${workflow.name}`]
159720
+ }),
159721
+ (error53) => {
159722
+ if (error53 instanceof APIError && error53.code === WORKFLOW_CRON_REQUIRES_PAID_PLAN_CODE && workflow.schedules) {
159723
+ error53.preventReport();
159975
159724
  return {
159976
159725
  category: "Workflows",
159977
- resource: `Workflow "${workflow.name}"`,
159978
159726
  targets: [],
159979
- error: error53
159727
+ error: new UserError(
159728
+ `Workflow "${workflow.name}" has "schedules" configured, but scheduled Workflows require a paid Workers plan.`,
159729
+ {
159730
+ cause: error53,
159731
+ telemetryMessage: "triggers deploy workflow cron requires paid plan"
159732
+ }
159733
+ )
159980
159734
  };
159981
159735
  }
159982
- )
159983
- });
159984
- }
159736
+ return {
159737
+ category: "Workflows",
159738
+ resource: `Workflow "${workflow.name}"`,
159739
+ targets: [],
159740
+ error: error53
159741
+ };
159742
+ }
159743
+ )
159744
+ });
159985
159745
  }
159986
159746
  const completedWorkflowDeployments = await Promise.all(
159987
159747
  workflowDeployments.map(async ({ name: name2, deployment }) => ({
@@ -160272,12 +160032,12 @@ async function subdomainDeploy(props, accountId, scriptName, workerUrl, routes,
160272
160032
  };
160273
160033
  }
160274
160034
  function validateEventTriggerTargets(config2, scriptName) {
160035
+ const ownedWorkflowNames = new Set(
160036
+ getWorkflowsOwnedByScript(config2, scriptName).map(({ name: name2 }) => name2)
160037
+ );
160275
160038
  for (const event of config2.triggers?.events ?? []) {
160276
160039
  for (const target of event.targets) {
160277
- const isDefinedByThisWorker = config2.workflows.some(
160278
- (workflow) => workflow.name === target.workflow_name && isWorkflowDefinedInThisScript(workflow, scriptName)
160279
- );
160280
- if (!isDefinedByThisWorker) {
160040
+ if (!ownedWorkflowNames.has(target.workflow_name)) {
160281
160041
  throw new UserError(
160282
160042
  `Event trigger "${event.type}" targets Workflow "${target.workflow_name}", but that Workflow is not defined by this Worker.
160283
160043
 
@@ -160290,9 +160050,6 @@ Add it to the "workflows" configuration or remove the event trigger target.`,
160290
160050
  }
160291
160051
  }
160292
160052
  }
160293
- function isWorkflowDefinedInThisScript(workflow, scriptName) {
160294
- return workflow.script_name === void 0 || workflow.script_name === scriptName;
160295
- }
160296
160053
  var PREVIEW_DOMAIN_PROVISIONING_NOTE;
160297
160054
  var init_deploy = __esm({
160298
160055
  "../deploy-helpers/src/triggers/deploy.ts"() {
@@ -160301,6 +160058,7 @@ var init_deploy = __esm({
160301
160058
  init_source();
160302
160059
  init_dist13();
160303
160060
  init_error_codes();
160061
+ init_owned_workflows();
160304
160062
  init_context();
160305
160063
  init_email_routing2();
160306
160064
  init_publish_routes();
@@ -160315,7 +160073,6 @@ var init_deploy = __esm({
160315
160073
  __name(validateSubdomainMixedState, "validateSubdomainMixedState");
160316
160074
  __name(subdomainDeploy, "subdomainDeploy");
160317
160075
  __name(validateEventTriggerTargets, "validateEventTriggerTargets");
160318
- __name(isWorkflowDefinedInThisScript, "isWorkflowDefinedInThisScript");
160319
160076
  }
160320
160077
  });
160321
160078
 
@@ -163828,10 +163585,16 @@ var init_deploy_wfp = __esm({
163828
163585
  });
163829
163586
  function getApplicationSettings(container) {
163830
163587
  const flags2 = container.unsafe?.configuration?.experimental_flags;
163588
+ const configuration = {
163589
+ ...flags2 !== void 0 && { experimental_flags: flags2 },
163590
+ // The Containers API calls `ssh` `wrangler_ssh`.
163591
+ ...container.ssh !== void 0 && { wrangler_ssh: container.ssh },
163592
+ ...container.authorized_keys !== void 0 && {
163593
+ authorized_keys: container.authorized_keys
163594
+ }
163595
+ };
163831
163596
  return {
163832
- ...flags2 !== void 0 && {
163833
- configuration: { experimental_flags: flags2 }
163834
- },
163597
+ ...Object.keys(configuration).length > 0 && { configuration },
163835
163598
  ...container.observability !== void 0 && {
163836
163599
  observability: {
163837
163600
  logs: {
@@ -163844,6 +163607,12 @@ function getApplicationSettings(container) {
163844
163607
  function normalizeFlags(flags2 = []) {
163845
163608
  return [...new Set(flags2)].sort();
163846
163609
  }
163610
+ function hasConfigurationChanged(configured, existing = {}) {
163611
+ return configured.experimental_flags !== void 0 && !util.isDeepStrictEqual(
163612
+ normalizeFlags(configured.experimental_flags),
163613
+ normalizeFlags(existing.experimental_flags)
163614
+ ) || configured.wrangler_ssh !== void 0 && !util.isDeepStrictEqual(configured.wrangler_ssh, existing.wrangler_ssh) || configured.authorized_keys !== void 0 && !util.isDeepStrictEqual(configured.authorized_keys, existing.authorized_keys);
163615
+ }
163847
163616
  function isRegistryImage(image) {
163848
163617
  return typeof image.image === "string";
163849
163618
  }
@@ -163997,10 +163766,7 @@ async function applyApplication(application, namespaceId, settings = {}, updateE
163997
163766
  return;
163998
163767
  }
163999
163768
  const patch = {};
164000
- if (settings.configuration !== void 0 && !util.isDeepStrictEqual(
164001
- normalizeFlags(settings.configuration.experimental_flags),
164002
- normalizeFlags(existing.configuration?.experimental_flags)
164003
- )) {
163769
+ if (settings.configuration !== void 0 && hasConfigurationChanged(settings.configuration, existing.configuration)) {
164004
163770
  patch.configuration = settings.configuration;
164005
163771
  }
164006
163772
  if (settings.observability !== void 0 && !util.isDeepStrictEqual(settings.observability, existing.observability)) {
@@ -164275,6 +164041,7 @@ var init_durable_object_container_applications = __esm({
164275
164041
  IMAGE_PREPARATION_TIMEOUT_MS = 15 * 6e4;
164276
164042
  __name(getApplicationSettings, "getApplicationSettings");
164277
164043
  __name(normalizeFlags, "normalizeFlags");
164044
+ __name(hasConfigurationChanged, "hasConfigurationChanged");
164278
164045
  __name(isRegistryImage, "isRegistryImage");
164279
164046
  __name(toCreateApplicationRequest, "toCreateApplicationRequest");
164280
164047
  __name(getNamespaceId, "getNamespaceId");
@@ -164439,7 +164206,14 @@ async function resolveExportsUploadPayload(props) {
164439
164206
  const { migrations, exports: durableObjectExports } = await resolveDoLifecyclePayload(props);
164440
164207
  const exports$1 = {
164441
164208
  ...partitionedExports.worker,
164442
- ...durableObjectExports ?? {}
164209
+ ...durableObjectExports ?? {},
164210
+ // Workflow settings are applied when `triggers deploy` provisions the
164211
+ // Workflow; the upload API only accepts the type and name.
164212
+ ...Object.fromEntries(
164213
+ Object.entries(partitionedExports.workflow).map(
164214
+ ([className, { name: name2 }]) => [className, { type: "workflow", name: name2 }]
164215
+ )
164216
+ )
164443
164217
  };
164444
164218
  return {
164445
164219
  migrations,
@@ -166683,7 +166457,7 @@ var require_extension2 = __commonJS({
166683
166457
  else dest[name2].push(elem);
166684
166458
  }
166685
166459
  __name(push3, "push");
166686
- function parse18(header) {
166460
+ function parse17(header) {
166687
166461
  const offers = /* @__PURE__ */ Object.create(null);
166688
166462
  let params = /* @__PURE__ */ Object.create(null);
166689
166463
  let mustUnescape = false;
@@ -166808,7 +166582,7 @@ var require_extension2 = __commonJS({
166808
166582
  }
166809
166583
  return offers;
166810
166584
  }
166811
- __name(parse18, "parse");
166585
+ __name(parse17, "parse");
166812
166586
  function format9(extensions) {
166813
166587
  return Object.keys(extensions).map((extension2) => {
166814
166588
  let configurations = extensions[extension2];
@@ -166825,7 +166599,7 @@ var require_extension2 = __commonJS({
166825
166599
  }).join(", ");
166826
166600
  }
166827
166601
  __name(format9, "format");
166828
- module2.exports = { format: format9, parse: parse18 };
166602
+ module2.exports = { format: format9, parse: parse17 };
166829
166603
  }
166830
166604
  });
166831
166605
 
@@ -166859,7 +166633,7 @@ var require_websocket3 = __commonJS({
166859
166633
  var {
166860
166634
  EventTarget: { addEventListener, removeEventListener }
166861
166635
  } = require_event_target2();
166862
- var { format: format9, parse: parse18 } = require_extension2();
166636
+ var { format: format9, parse: parse17 } = require_extension2();
166863
166637
  var { toBuffer } = require_buffer_util2();
166864
166638
  var kAborted = Symbol("kAborted");
166865
166639
  var protocolVersions = [8, 13];
@@ -167539,7 +167313,7 @@ var require_websocket3 = __commonJS({
167539
167313
  }
167540
167314
  let extensions;
167541
167315
  try {
167542
- extensions = parse18(secWebSocketExtensions);
167316
+ extensions = parse17(secWebSocketExtensions);
167543
167317
  } catch (err) {
167544
167318
  const message = "Invalid Sec-WebSocket-Extensions header";
167545
167319
  abortHandshake(websocket, socket, message);
@@ -167855,7 +167629,7 @@ var require_subprotocol2 = __commonJS({
167855
167629
  "../../node_modules/.pnpm/ws@8.21.0/node_modules/ws/lib/subprotocol.js"(exports$1, module2) {
167856
167630
  init_import_meta_url();
167857
167631
  var { tokenChars } = require_validation2();
167858
- function parse18(header) {
167632
+ function parse17(header) {
167859
167633
  const protocols = /* @__PURE__ */ new Set();
167860
167634
  let start = -1;
167861
167635
  let end = -1;
@@ -167891,8 +167665,8 @@ var require_subprotocol2 = __commonJS({
167891
167665
  protocols.add(protocol);
167892
167666
  return protocols;
167893
167667
  }
167894
- __name(parse18, "parse");
167895
- module2.exports = { parse: parse18 };
167668
+ __name(parse17, "parse");
167669
+ module2.exports = { parse: parse17 };
167896
167670
  }
167897
167671
  });
167898
167672
 
@@ -169244,7 +169018,7 @@ var require_main = __commonJS({
169244
169018
  var packageJson = require_package();
169245
169019
  var version7 = packageJson.version;
169246
169020
  var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
169247
- function parse18(src) {
169021
+ function parse17(src) {
169248
169022
  const obj = {};
169249
169023
  let lines = src.toString();
169250
169024
  lines = lines.replace(/\r\n?/mg, "\n");
@@ -169263,7 +169037,7 @@ var require_main = __commonJS({
169263
169037
  }
169264
169038
  return obj;
169265
169039
  }
169266
- __name(parse18, "parse");
169040
+ __name(parse17, "parse");
169267
169041
  function _parseVault(options) {
169268
169042
  const vaultPath = _vaultPath(options);
169269
169043
  const result = DotenvModule.configDotenv({ path: vaultPath });
@@ -169457,7 +169231,7 @@ var require_main = __commonJS({
169457
169231
  _parseVault,
169458
169232
  config: config2,
169459
169233
  decrypt,
169460
- parse: parse18,
169234
+ parse: parse17,
169461
169235
  populate
169462
169236
  };
169463
169237
  module2.exports.configDotenv = DotenvModule.configDotenv;
@@ -171749,10 +171523,8 @@ async function getWorkflow(config2, accountId, workflowName) {
171749
171523
  }
171750
171524
  }
171751
171525
  async function checkWorkflowConflicts(config2, accountId, scriptName) {
171752
- const workflowsToDeploy = config2.workflows?.filter(
171753
- (w8) => w8.script_name === void 0 || w8.script_name === scriptName
171754
- );
171755
- if (!workflowsToDeploy?.length) {
171526
+ const workflowsToDeploy = getWorkflowsOwnedByScript(config2, scriptName);
171527
+ if (!workflowsToDeploy.length) {
171756
171528
  return { hasConflicts: false };
171757
171529
  }
171758
171530
  const workflowChecks = await Promise.all(
@@ -171783,6 +171555,7 @@ var init_check_workflow_conflicts = __esm({
171783
171555
  init_import_meta_url();
171784
171556
  init_src();
171785
171557
  init_context();
171558
+ init_owned_workflows();
171786
171559
  WORKFLOW_NOT_FOUND_CODE = 10200;
171787
171560
  __name(getWorkflow, "getWorkflow");
171788
171561
  __name(checkWorkflowConflicts, "checkWorkflowConflicts");
@@ -174932,6 +174705,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
174932
174705
  { telemetryMessage: "data_blobs with es module worker" }
174933
174706
  );
174934
174707
  }
174708
+ validateOwnedWorkflowDeclarations(config2, name2);
174935
174709
  if (props.command === "deploy") {
174936
174710
  validateEventTriggerTargets(config2, name2);
174937
174711
  validateRoutes2(props.routes, props.assetsOptions);
@@ -175078,13 +174852,11 @@ Edits that have been made via the script API will be overridden by your local co
175078
174852
  return { workerTag, tags, workerExists, aborted: true };
175079
174853
  }
175080
174854
  }
175081
- if (config2.workflows?.length) {
175082
- const workflowCheck = await checkWorkflowConflicts(config2, accountId, name2);
175083
- if (workflowCheck.hasConflicts) {
175084
- logger.warn(workflowCheck.message);
175085
- if (!await deployConfirm("Do you want to continue?")) {
175086
- return { workerTag, tags, workerExists, aborted: true };
175087
- }
174855
+ const workflowCheck = await checkWorkflowConflicts(config2, accountId, name2);
174856
+ if (workflowCheck.hasConflicts) {
174857
+ logger.warn(workflowCheck.message);
174858
+ if (!await deployConfirm("Do you want to continue?")) {
174859
+ return { workerTag, tags, workerExists, aborted: true };
175088
174860
  }
175089
174861
  }
175090
174862
  await ensureQueuesExistByConfig(
@@ -175116,6 +174888,7 @@ var init_validate_worker_props = __esm({
175116
174888
  init_deploy_confirm();
175117
174889
  init_download_worker_config();
175118
174890
  init_match_tag();
174891
+ init_owned_workflows();
175119
174892
  init_validate_routes();
175120
174893
  init_worker_not_found_error();
175121
174894
  __name(validateWorkerProps, "validateWorkerProps");
@@ -178219,6 +177992,19 @@ function buildMiniflareBindingOptions(config2, remoteProxyConnectionString) {
178219
177992
  for (const binding of jsonBindings) {
178220
177993
  vars[binding.binding] = binding.value;
178221
177994
  }
177995
+ const workflowExports = Object.fromEntries(
177996
+ Object.entries(partitionExports(config2.exports).workflow).map(
177997
+ ([className, workflow]) => [
177998
+ className,
177999
+ {
178000
+ name: workflow.name,
178001
+ ...workflow.limits?.steps !== void 0 && {
178002
+ stepLimit: workflow.limits.steps
178003
+ }
178004
+ }
178005
+ ]
178006
+ )
178007
+ );
178222
178008
  const bindingOptions = {
178223
178009
  bindings: vars,
178224
178010
  versionMetadata: versionMetadataBindings[0]?.binding,
@@ -178313,6 +178099,7 @@ function buildMiniflareBindingOptions(config2, remoteProxyConnectionString) {
178313
178099
  return workflowEntry(workflow);
178314
178100
  })
178315
178101
  ),
178102
+ workflowExports,
178316
178103
  secretsStoreSecrets: Object.fromEntries(
178317
178104
  secretsStoreSecrets.map((binding) => [binding.binding, binding])
178318
178105
  ),
@@ -178541,6 +178328,7 @@ async function buildMiniflareOptions(log2, config2, proxyToUserWorkerAuthenticat
178541
178328
  ...sitesOptions,
178542
178329
  ...assetOptions,
178543
178330
  routes: config2.routes,
178331
+ cronTriggers: config2.crons,
178544
178332
  outboundService: config2.outboundService,
178545
178333
  zone: config2.zone,
178546
178334
  access: config2.access?.dev,
@@ -179019,7 +178807,7 @@ var CF_KEYRING_SERVICE_NAME, CF_CLI_NAME, CF_DISPLAY_NAME, CF_OAUTH_CALLBACK_URL
179019
178807
  var init_cf = __esm({
179020
178808
  "../workers-auth/dist/cf/index.mjs"() {
179021
178809
  init_import_meta_url();
179022
- init_chunk_3U6VZT7T();
178810
+ init_chunk_V6MEAFHI();
179023
178811
  init_chunk_O6YSETKJ();
179024
178812
  init_src();
179025
178813
  CF_KEYRING_SERVICE_NAME = "cloudflare";
@@ -180024,7 +179812,7 @@ var init_dist14 = __esm({
180024
179812
  init_wrapper();
180025
179813
  init_create_worker_upload_form();
180026
179814
  import_undici13 = __toESM(require_undici(), 1);
180027
- version3 = "0.0.33";
179815
+ version3 = "0.0.34";
180028
179816
  NoDefaultValueProvided2 = class extends UserError {
180029
179817
  static {
180030
179818
  __name(this, "NoDefaultValueProvided");
@@ -195709,7 +195497,7 @@ var require_public_api2 = __commonJS({
195709
195497
  return doc;
195710
195498
  }
195711
195499
  __name(parseDocument, "parseDocument");
195712
- function parse18(src, reviver, options) {
195500
+ function parse17(src, reviver, options) {
195713
195501
  let _reviver = void 0;
195714
195502
  if (typeof reviver === "function") {
195715
195503
  _reviver = reviver;
@@ -195728,7 +195516,7 @@ var require_public_api2 = __commonJS({
195728
195516
  }
195729
195517
  return doc.toJS(Object.assign({ reviver: _reviver }, options));
195730
195518
  }
195731
- __name(parse18, "parse");
195519
+ __name(parse17, "parse");
195732
195520
  function stringify4(value, replacer2, options) {
195733
195521
  let _replacer = null;
195734
195522
  if (typeof replacer2 === "function" || Array.isArray(replacer2)) {
@@ -195752,7 +195540,7 @@ var require_public_api2 = __commonJS({
195752
195540
  return new Document.Document(value, _replacer, options).toString(options);
195753
195541
  }
195754
195542
  __name(stringify4, "stringify");
195755
- exports$1.parse = parse18;
195543
+ exports$1.parse = parse17;
195756
195544
  exports$1.parseAllDocuments = parseAllDocuments;
195757
195545
  exports$1.parseDocument = parseDocument;
195758
195546
  exports$1.stringify = stringify4;
@@ -201091,9 +200879,9 @@ var init_yargs_factory = __esm({
201091
200879
  __classPrivateFieldSet6(this, _YargsInstance_hasOutput, true, "f");
201092
200880
  if (!__classPrivateFieldGet8(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
201093
200881
  if (!this.parsed) {
201094
- const parse18 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet8(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
201095
- if (isPromise(parse18)) {
201096
- return parse18.then(() => {
200882
+ const parse17 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet8(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
200883
+ if (isPromise(parse17)) {
200884
+ return parse17.then(() => {
201097
200885
  return __classPrivateFieldGet8(this, _YargsInstance_usage, "f").help();
201098
200886
  });
201099
200887
  }
@@ -201437,9 +201225,9 @@ var init_yargs_factory = __esm({
201437
201225
  __classPrivateFieldSet6(this, _YargsInstance_hasOutput, true, "f");
201438
201226
  if (!__classPrivateFieldGet8(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
201439
201227
  if (!this.parsed) {
201440
- const parse18 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet8(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
201441
- if (isPromise(parse18)) {
201442
- parse18.then(() => {
201228
+ const parse17 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet8(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
201229
+ if (isPromise(parse17)) {
201230
+ parse17.then(() => {
201443
201231
  __classPrivateFieldGet8(this, _YargsInstance_usage, "f").showHelp(level);
201444
201232
  });
201445
201233
  return this;
@@ -206267,8 +206055,14 @@ async function resolveTriggers(config2, input) {
206267
206055
  type: "cron"
206268
206056
  })) ?? [];
206269
206057
  const connectHandlers = config2.connect?.map((c9) => ({
206270
- ...c9,
206271
- type: "connect"
206058
+ type: "connect",
206059
+ protocol: c9.protocol,
206060
+ port: c9.port,
206061
+ address: c9.address,
206062
+ ...c9.protocol === "udp" ? {
206063
+ idleTimeoutMs: c9.idle_timeout_ms,
206064
+ maxPendingBytes: c9.max_pending_bytes
206065
+ } : {}
206272
206066
  })) ?? [];
206273
206067
  return [...devRoutes, ...queueConsumers, ...crons, ...connectHandlers];
206274
206068
  }
@@ -239550,7 +239344,7 @@ var require_esprima2 = __commonJS({
239550
239344
  var jsx_parser_1 = __webpack_require__(3);
239551
239345
  var parser_1 = __webpack_require__(8);
239552
239346
  var tokenizer_1 = __webpack_require__(15);
239553
- function parse18(code, options, delegate) {
239347
+ function parse17(code, options, delegate) {
239554
239348
  var commentHandler = null;
239555
239349
  var proxyDelegate = /* @__PURE__ */ __name(function(node2, metadata2) {
239556
239350
  if (delegate) {
@@ -239595,19 +239389,19 @@ var require_esprima2 = __commonJS({
239595
239389
  }
239596
239390
  return ast;
239597
239391
  }
239598
- __name(parse18, "parse");
239599
- exports2.parse = parse18;
239392
+ __name(parse17, "parse");
239393
+ exports2.parse = parse17;
239600
239394
  function parseModule(code, options, delegate) {
239601
239395
  var parsingOptions = options || {};
239602
239396
  parsingOptions.sourceType = "module";
239603
- return parse18(code, parsingOptions, delegate);
239397
+ return parse17(code, parsingOptions, delegate);
239604
239398
  }
239605
239399
  __name(parseModule, "parseModule");
239606
239400
  exports2.parseModule = parseModule;
239607
239401
  function parseScript(code, options, delegate) {
239608
239402
  var parsingOptions = options || {};
239609
239403
  parsingOptions.sourceType = "script";
239610
- return parse18(code, parsingOptions, delegate);
239404
+ return parse17(code, parsingOptions, delegate);
239611
239405
  }
239612
239406
  __name(parseScript, "parseScript");
239613
239407
  exports2.parseScript = parseScript;
@@ -245808,7 +245602,7 @@ var require_esprima3 = __commonJS({
245808
245602
  Object.defineProperty(exports$1, "__esModule", { value: true });
245809
245603
  exports$1.parse = void 0;
245810
245604
  var util_1 = require_util11();
245811
- function parse18(source, options) {
245605
+ function parse17(source, options) {
245812
245606
  var comments = [];
245813
245607
  var ast = require_esprima2().parse(source, {
245814
245608
  loc: true,
@@ -245826,8 +245620,8 @@ var require_esprima3 = __commonJS({
245826
245620
  }
245827
245621
  return ast;
245828
245622
  }
245829
- __name(parse18, "parse");
245830
- exports$1.parse = parse18;
245623
+ __name(parse17, "parse");
245624
+ exports$1.parse = parse17;
245831
245625
  }
245832
245626
  });
245833
245627
 
@@ -246998,7 +246792,7 @@ var require_parser2 = __commonJS({
246998
246792
  var lines_1 = require_lines3();
246999
246793
  var comments_1 = require_comments();
247000
246794
  var util2 = tslib_1.__importStar(require_util11());
247001
- function parse18(source, options) {
246795
+ function parse17(source, options) {
247002
246796
  options = (0, options_1.normalize)(options);
247003
246797
  var lines = (0, lines_1.fromString)(source, options);
247004
246798
  var sourceWithoutTabs = lines.toString({
@@ -247070,8 +246864,8 @@ var require_parser2 = __commonJS({
247070
246864
  (0, comments_1.attach)(comments, program.body.length ? file3.program : file3, lines);
247071
246865
  return new TreeCopier(lines, tokens).copy(file3);
247072
246866
  }
247073
- __name(parse18, "parse");
247074
- exports$1.parse = parse18;
246867
+ __name(parse17, "parse");
246868
+ exports$1.parse = parse17;
247075
246869
  var TreeCopier = /* @__PURE__ */ __name(function TreeCopier2(lines, tokens) {
247076
246870
  (0, tiny_invariant_1.default)(this instanceof TreeCopier2);
247077
246871
  this.lines = lines;
@@ -252435,7 +252229,7 @@ var require_lib5 = __commonJS({
252435
252229
  return state3;
252436
252230
  }
252437
252231
  };
252438
- var _isDigit = /* @__PURE__ */ __name(function isDigit2(code2) {
252232
+ var _isDigit = /* @__PURE__ */ __name(function isDigit3(code2) {
252439
252233
  return code2 >= 48 && code2 <= 57;
252440
252234
  }, "isDigit");
252441
252235
  var forbiddenNumericSeparatorSiblings = {
@@ -255674,14 +255468,14 @@ var require_lib5 = __commonJS({
255674
255468
  super.checkParams(node2, false, true);
255675
255469
  this.scope.exit();
255676
255470
  }
255677
- forwardNoArrowParamsConversionAt(node2, parse19) {
255471
+ forwardNoArrowParamsConversionAt(node2, parse18) {
255678
255472
  let result;
255679
255473
  if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node2.start))) {
255680
255474
  this.state.noArrowParamsConversionAt.push(this.state.start);
255681
- result = parse19();
255475
+ result = parse18();
255682
255476
  this.state.noArrowParamsConversionAt.pop();
255683
255477
  } else {
255684
- result = parse19();
255478
+ result = parse18();
255685
255479
  }
255686
255480
  return result;
255687
255481
  }
@@ -264426,7 +264220,7 @@ var require_lib5 = __commonJS({
264426
264220
  return file3;
264427
264221
  }
264428
264222
  };
264429
- function parse18(input, options) {
264223
+ function parse17(input, options) {
264430
264224
  var _options;
264431
264225
  if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
264432
264226
  options = Object.assign({}, options);
@@ -264459,7 +264253,7 @@ var require_lib5 = __commonJS({
264459
264253
  return getParser(options, input).parse();
264460
264254
  }
264461
264255
  }
264462
- __name(parse18, "parse");
264256
+ __name(parse17, "parse");
264463
264257
  function parseExpression(input, options) {
264464
264258
  const parser2 = getParser(options, input);
264465
264259
  if (parser2.options.strictMode) {
@@ -264518,7 +264312,7 @@ var require_lib5 = __commonJS({
264518
264312
  return cls;
264519
264313
  }
264520
264314
  __name(getParserClass, "getParserClass");
264521
- exports$1.parse = parse18;
264315
+ exports$1.parse = parse17;
264522
264316
  exports$1.parseExpression = parseExpression;
264523
264317
  exports$1.tokTypes = tokTypes;
264524
264318
  }
@@ -264543,13 +264337,13 @@ var require_babel2 = __commonJS({
264543
264337
  }
264544
264338
  }
264545
264339
  }();
264546
- function parse18(source, options) {
264340
+ function parse17(source, options) {
264547
264341
  var babelOptions = (0, _babel_options_1.default)(options);
264548
264342
  babelOptions.plugins.push("jsx", "flow", "decoratorAutoAccessors");
264549
264343
  return exports$1.parser.parse(source, babelOptions);
264550
264344
  }
264551
- __name(parse18, "parse");
264552
- exports$1.parse = parse18;
264345
+ __name(parse17, "parse");
264346
+ exports$1.parse = parse17;
264553
264347
  }
264554
264348
  });
264555
264349
 
@@ -264562,13 +264356,13 @@ var require_typescript2 = __commonJS({
264562
264356
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
264563
264357
  var babel_1 = require_babel2();
264564
264358
  var _babel_options_1 = tslib_1.__importDefault(require_babel_options());
264565
- function parse18(source, options) {
264359
+ function parse17(source, options) {
264566
264360
  var babelOptions = (0, _babel_options_1.default)(options);
264567
264361
  babelOptions.plugins.push("typescript");
264568
264362
  return babel_1.parser.parse(source, babelOptions);
264569
264363
  }
264570
- __name(parse18, "parse");
264571
- exports$1.parse = parse18;
264364
+ __name(parse17, "parse");
264365
+ exports$1.parse = parse17;
264572
264366
  }
264573
264367
  });
264574
264368
  function parseJs(src) {
@@ -265262,7 +265056,7 @@ var require_parse2 = __commonJS({
265262
265056
  return parsed;
265263
265057
  }
265264
265058
  __name(parseNonShell, "parseNonShell");
265265
- function parse18(command2, args, options) {
265059
+ function parse17(command2, args, options) {
265266
265060
  if (args && !Array.isArray(args)) {
265267
265061
  options = args;
265268
265062
  args = null;
@@ -265281,8 +265075,8 @@ var require_parse2 = __commonJS({
265281
265075
  };
265282
265076
  return options.shell ? parsed : parseNonShell(parsed);
265283
265077
  }
265284
- __name(parse18, "parse");
265285
- module2.exports = parse18;
265078
+ __name(parse17, "parse");
265079
+ module2.exports = parse17;
265286
265080
  }
265287
265081
  });
265288
265082
 
@@ -265345,17 +265139,17 @@ var require_cross_spawn = __commonJS({
265345
265139
  "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports$1, module2) {
265346
265140
  init_import_meta_url();
265347
265141
  var cp5 = __require("child_process");
265348
- var parse18 = require_parse2();
265142
+ var parse17 = require_parse2();
265349
265143
  var enoent = require_enoent();
265350
265144
  function spawn6(command2, args, options) {
265351
- const parsed = parse18(command2, args, options);
265145
+ const parsed = parse17(command2, args, options);
265352
265146
  const spawned = cp5.spawn(parsed.command, parsed.args, parsed.options);
265353
265147
  enoent.hookChildProcess(spawned, parsed);
265354
265148
  return spawned;
265355
265149
  }
265356
265150
  __name(spawn6, "spawn");
265357
265151
  function spawnSync3(command2, args, options) {
265358
- const parsed = parse18(command2, args, options);
265152
+ const parsed = parse17(command2, args, options);
265359
265153
  const result = cp5.spawnSync(parsed.command, parsed.args, parsed.options);
265360
265154
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
265361
265155
  return result;
@@ -265364,7 +265158,7 @@ var require_cross_spawn = __commonJS({
265364
265158
  module2.exports = spawn6;
265365
265159
  module2.exports.spawn = spawn6;
265366
265160
  module2.exports.sync = spawnSync3;
265367
- module2.exports._parse = parse18;
265161
+ module2.exports._parse = parse17;
265368
265162
  module2.exports._enoent = enoent;
265369
265163
  }
265370
265164
  });
@@ -268464,7 +268258,7 @@ var require_parse3 = __commonJS({
268464
268258
  "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports$1, module2) {
268465
268259
  init_import_meta_url();
268466
268260
  var SemVer = require_semver();
268467
- var parse18 = /* @__PURE__ */ __name((version7, options, throwErrors = false) => {
268261
+ var parse17 = /* @__PURE__ */ __name((version7, options, throwErrors = false) => {
268468
268262
  if (version7 instanceof SemVer) {
268469
268263
  return version7;
268470
268264
  }
@@ -268477,7 +268271,7 @@ var require_parse3 = __commonJS({
268477
268271
  throw er2;
268478
268272
  }
268479
268273
  }, "parse");
268480
- module2.exports = parse18;
268274
+ module2.exports = parse17;
268481
268275
  }
268482
268276
  });
268483
268277
 
@@ -268485,9 +268279,9 @@ var require_parse3 = __commonJS({
268485
268279
  var require_valid = __commonJS({
268486
268280
  "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports$1, module2) {
268487
268281
  init_import_meta_url();
268488
- var parse18 = require_parse3();
268282
+ var parse17 = require_parse3();
268489
268283
  var valid = /* @__PURE__ */ __name((version7, options) => {
268490
- const v8 = parse18(version7, options);
268284
+ const v8 = parse17(version7, options);
268491
268285
  return v8 ? v8.version : null;
268492
268286
  }, "valid");
268493
268287
  module2.exports = valid;
@@ -268498,9 +268292,9 @@ var require_valid = __commonJS({
268498
268292
  var require_clean = __commonJS({
268499
268293
  "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports$1, module2) {
268500
268294
  init_import_meta_url();
268501
- var parse18 = require_parse3();
268295
+ var parse17 = require_parse3();
268502
268296
  var clean = /* @__PURE__ */ __name((version7, options) => {
268503
- const s8 = parse18(version7.trim().replace(/^[=v]+/, ""), options);
268297
+ const s8 = parse17(version7.trim().replace(/^[=v]+/, ""), options);
268504
268298
  return s8 ? s8.version : null;
268505
268299
  }, "clean");
268506
268300
  module2.exports = clean;
@@ -268535,10 +268329,10 @@ var require_inc = __commonJS({
268535
268329
  var require_diff = __commonJS({
268536
268330
  "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports$1, module2) {
268537
268331
  init_import_meta_url();
268538
- var parse18 = require_parse3();
268332
+ var parse17 = require_parse3();
268539
268333
  var diff = /* @__PURE__ */ __name((version1, version22) => {
268540
- const v1 = parse18(version1, null, true);
268541
- const v22 = parse18(version22, null, true);
268334
+ const v1 = parse17(version1, null, true);
268335
+ const v22 = parse17(version22, null, true);
268542
268336
  const comparison = v1.compare(v22);
268543
268337
  if (comparison === 0) {
268544
268338
  return null;
@@ -268609,9 +268403,9 @@ var require_patch = __commonJS({
268609
268403
  var require_prerelease = __commonJS({
268610
268404
  "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports$1, module2) {
268611
268405
  init_import_meta_url();
268612
- var parse18 = require_parse3();
268406
+ var parse17 = require_parse3();
268613
268407
  var prerelease = /* @__PURE__ */ __name((version7, options) => {
268614
- const parsed = parse18(version7, options);
268408
+ const parsed = parse17(version7, options);
268615
268409
  return parsed && parsed.prerelease.length ? parsed.prerelease : null;
268616
268410
  }, "prerelease");
268617
268411
  module2.exports = prerelease;
@@ -268797,7 +268591,7 @@ var require_coerce = __commonJS({
268797
268591
  "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports$1, module2) {
268798
268592
  init_import_meta_url();
268799
268593
  var SemVer = require_semver();
268800
- var parse18 = require_parse3();
268594
+ var parse17 = require_parse3();
268801
268595
  var { safeRe: re2, t: t14 } = require_re();
268802
268596
  var coerce3 = /* @__PURE__ */ __name((version7, options) => {
268803
268597
  if (version7 instanceof SemVer) {
@@ -268832,7 +268626,7 @@ var require_coerce = __commonJS({
268832
268626
  const patch = match4[4] || "0";
268833
268627
  const prerelease = options.includePrerelease && match4[5] ? `-${match4[5]}` : "";
268834
268628
  const build5 = options.includePrerelease && match4[6] ? `+${match4[6]}` : "";
268835
- return parse18(`${major}.${minor}.${patch}${prerelease}${build5}`, options);
268629
+ return parse17(`${major}.${minor}.${patch}${prerelease}${build5}`, options);
268836
268630
  }, "coerce");
268837
268631
  module2.exports = coerce3;
268838
268632
  }
@@ -268842,7 +268636,7 @@ var require_coerce = __commonJS({
268842
268636
  var require_truncate = __commonJS({
268843
268637
  "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports$1, module2) {
268844
268638
  init_import_meta_url();
268845
- var parse18 = require_parse3();
268639
+ var parse17 = require_parse3();
268846
268640
  var constants4 = require_constants9();
268847
268641
  var SemVer = require_semver();
268848
268642
  var truncate4 = /* @__PURE__ */ __name((version7, truncation, options) => {
@@ -268854,7 +268648,7 @@ var require_truncate = __commonJS({
268854
268648
  }, "truncate");
268855
268649
  var cloneInputVersion = /* @__PURE__ */ __name((version7, options) => {
268856
268650
  const versionStringToParse = version7 instanceof SemVer ? version7.version : version7;
268857
- return parse18(versionStringToParse, options);
268651
+ return parse17(versionStringToParse, options);
268858
268652
  }, "cloneInputVersion");
268859
268653
  var doTruncation = /* @__PURE__ */ __name((version7, truncation) => {
268860
268654
  if (isPrerelease(truncation)) {
@@ -269907,7 +269701,7 @@ var require_semver2 = __commonJS({
269907
269701
  var constants4 = require_constants9();
269908
269702
  var SemVer = require_semver();
269909
269703
  var identifiers = require_identifiers();
269910
- var parse18 = require_parse3();
269704
+ var parse17 = require_parse3();
269911
269705
  var valid = require_valid();
269912
269706
  var clean = require_clean();
269913
269707
  var inc = require_inc();
@@ -269946,7 +269740,7 @@ var require_semver2 = __commonJS({
269946
269740
  var simplifyRange = require_simplify();
269947
269741
  var subset = require_subset();
269948
269742
  module2.exports = {
269949
- parse: parse18,
269743
+ parse: parse17,
269950
269744
  valid,
269951
269745
  clean,
269952
269746
  inc,
@@ -280086,7 +279880,7 @@ var require_public_api3 = __commonJS({
280086
279880
  return doc;
280087
279881
  }
280088
279882
  __name(parseDocument, "parseDocument");
280089
- function parse18(src, reviver, options) {
279883
+ function parse17(src, reviver, options) {
280090
279884
  let _reviver = void 0;
280091
279885
  if (typeof reviver === "function") {
280092
279886
  _reviver = reviver;
@@ -280105,7 +279899,7 @@ var require_public_api3 = __commonJS({
280105
279899
  }
280106
279900
  return doc.toJS(Object.assign({ reviver: _reviver }, options));
280107
279901
  }
280108
- __name(parse18, "parse");
279902
+ __name(parse17, "parse");
280109
279903
  function stringify4(value, replacer2, options) {
280110
279904
  let _replacer = null;
280111
279905
  if (typeof replacer2 === "function" || Array.isArray(replacer2)) {
@@ -280129,7 +279923,7 @@ var require_public_api3 = __commonJS({
280129
279923
  return new Document.Document(value, _replacer, options).toString(options);
280130
279924
  }
280131
279925
  __name(stringify4, "stringify");
280132
- exports$1.parse = parse18;
279926
+ exports$1.parse = parse17;
280133
279927
  exports$1.parseAllDocuments = parseAllDocuments;
280134
279928
  exports$1.parseDocument = parseDocument;
280135
279929
  exports$1.stringify = stringify4;
@@ -285098,7 +284892,7 @@ var require_bugsnag = __commonJS({
285098
284892
  };
285099
284893
  var http6 = __require("http");
285100
284894
  var https3 = __require("https");
285101
- var ___require_36 = __require("url"), parse18 = ___require_36.parse;
284895
+ var ___require_36 = __require("url"), parse17 = ___require_36.parse;
285102
284896
  var _$request_36 = /* @__PURE__ */ __name(function(_ref, cb2) {
285103
284897
  var url5 = _ref.url, headers = _ref.headers, body = _ref.body, agent = _ref.agent;
285104
284898
  var didError = false;
@@ -285107,7 +284901,7 @@ var require_bugsnag = __commonJS({
285107
284901
  didError = true;
285108
284902
  cb2(err);
285109
284903
  }, "onError");
285110
- var parsedUrl = parse18(url5);
284904
+ var parsedUrl = parse17(url5);
285111
284905
  var secure = parsedUrl.protocol === "https:";
285112
284906
  var transport = secure ? https3 : http6;
285113
284907
  var req = transport.request({
@@ -295392,7 +295186,7 @@ var require_parse4 = __commonJS({
295392
295186
  );
295393
295187
  }
295394
295188
  __name(parseInternal, "parseInternal");
295395
- module2.exports = /* @__PURE__ */ __name(function parse18(s8, env6, opts) {
295189
+ module2.exports = /* @__PURE__ */ __name(function parse17(s8, env6, opts) {
295396
295190
  var mapped = parseInternal(s8, env6, opts);
295397
295191
  if (typeof env6 !== "function") {
295398
295192
  return mapped;
@@ -295430,7 +295224,7 @@ var require_shell_quote = __commonJS({
295430
295224
  });
295431
295225
 
295432
295226
  // src/utils/shell-quote.ts
295433
- function parse15(cmd, env6) {
295227
+ function parse14(cmd, env6) {
295434
295228
  if (process.platform === "win32") {
295435
295229
  cmd = cmd.replaceAll("\\", "\\\\");
295436
295230
  }
@@ -295463,7 +295257,7 @@ var init_shell_quote = __esm({
295463
295257
  const stringArgs = args.map((arg) => String(arg));
295464
295258
  return import_shell_quote.default.quote(stringArgs);
295465
295259
  }, "quote");
295466
- __name(parse15, "parse");
295260
+ __name(parse14, "parse");
295467
295261
  }
295468
295262
  });
295469
295263
 
@@ -295560,7 +295354,7 @@ var init_init = __esm({
295560
295354
  const yesFlag = args.yes ?? false;
295561
295355
  const packageManager = await getPackageManager();
295562
295356
  const name2 = args.fromDash ?? args.name;
295563
- const c3CommandParts = parse15(getC3CommandFromEnv());
295357
+ const c3CommandParts = parse14(getC3CommandFromEnv());
295564
295358
  const c3Arguments = [
295565
295359
  ...c3CommandParts,
295566
295360
  ...name2 ? [name2] : [],
@@ -295726,8 +295520,7 @@ var init_kv2 = __esm({
295726
295520
  jurisdiction: {
295727
295521
  type: "string",
295728
295522
  describe: 'The jurisdiction where the new namespace will be created (e.g. "us", "eu", "fedramp")',
295729
- requiresArg: true,
295730
- hidden: true
295523
+ requiresArg: true
295731
295524
  },
295732
295525
  ...sharedResourceCreationArgs
295733
295526
  },
@@ -302906,7 +302699,7 @@ async function toEnvironment(deploymentConfig, accountId) {
302906
302699
  return configObj;
302907
302700
  }
302908
302701
  async function writeWranglerToml(toml) {
302909
- let tomlString = dist_default.stringify(toml);
302702
+ let tomlString = stringify(toml);
302910
302703
  tomlString = tomlString.split("\n").map((line) => line.trimStart()).join("\n");
302911
302704
  await fs$1.writeFile(
302912
302705
  "wrangler.toml",
@@ -308400,7 +308193,7 @@ var init_create_aggregated_client = __esm({
308400
308193
  });
308401
308194
 
308402
308195
  // ../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/parse-utils.js
308403
- var parseBoolean, expectNumber, MAX_FLOAT, expectFloat32, expectLong, expectInt32, expectShort, expectByte, expectSizedInt, castInt, expectNonNull, expectObject, expectString, expectUnion, strictParseFloat32, NUMBER_REGEX, parseNumber, strictParseLong, strictParseInt32, strictParseShort, strictParseByte, stackTraceWarning, logger6;
308196
+ var parseBoolean, expectNumber, MAX_FLOAT, expectFloat32, expectLong, expectInt32, expectShort, expectByte, expectSizedInt, castInt, expectNonNull, expectObject, expectString, expectUnion, strictParseFloat32, NUMBER_REGEX, parseNumber2, strictParseLong, strictParseInt32, strictParseShort, strictParseByte, stackTraceWarning, logger6;
308404
308197
  var init_parse_utils = __esm({
308405
308198
  "../../node_modules/.pnpm/@smithy+smithy-client@3.7.0/node_modules/@smithy/smithy-client/dist-es/parse-utils.js"() {
308406
308199
  init_import_meta_url();
@@ -308519,12 +308312,12 @@ var init_parse_utils = __esm({
308519
308312
  }, "expectUnion");
308520
308313
  strictParseFloat32 = /* @__PURE__ */ __name((value) => {
308521
308314
  if (typeof value == "string") {
308522
- return expectFloat32(parseNumber(value));
308315
+ return expectFloat32(parseNumber2(value));
308523
308316
  }
308524
308317
  return expectFloat32(value);
308525
308318
  }, "strictParseFloat32");
308526
308319
  NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g;
308527
- parseNumber = /* @__PURE__ */ __name((value) => {
308320
+ parseNumber2 = /* @__PURE__ */ __name((value) => {
308528
308321
  const matches = value.match(NUMBER_REGEX);
308529
308322
  if (matches === null || matches[0].length !== value.length) {
308530
308323
  throw new TypeError(`Expected real number, got implicit NaN`);
@@ -308533,25 +308326,25 @@ var init_parse_utils = __esm({
308533
308326
  }, "parseNumber");
308534
308327
  strictParseLong = /* @__PURE__ */ __name((value) => {
308535
308328
  if (typeof value === "string") {
308536
- return expectLong(parseNumber(value));
308329
+ return expectLong(parseNumber2(value));
308537
308330
  }
308538
308331
  return expectLong(value);
308539
308332
  }, "strictParseLong");
308540
308333
  strictParseInt32 = /* @__PURE__ */ __name((value) => {
308541
308334
  if (typeof value === "string") {
308542
- return expectInt32(parseNumber(value));
308335
+ return expectInt32(parseNumber2(value));
308543
308336
  }
308544
308337
  return expectInt32(value);
308545
308338
  }, "strictParseInt32");
308546
308339
  strictParseShort = /* @__PURE__ */ __name((value) => {
308547
308340
  if (typeof value === "string") {
308548
- return expectShort(parseNumber(value));
308341
+ return expectShort(parseNumber2(value));
308549
308342
  }
308550
308343
  return expectShort(value);
308551
308344
  }, "strictParseShort");
308552
308345
  strictParseByte = /* @__PURE__ */ __name((value) => {
308553
308346
  if (typeof value === "string") {
308554
- return expectByte(parseNumber(value));
308347
+ return expectByte(parseNumber2(value));
308555
308348
  }
308556
308349
  return expectByte(value);
308557
308350
  }, "strictParseByte");
@@ -310046,11 +309839,11 @@ var require_OrderedObjParser = __commonJS({
310046
309839
  } else if (typeof newval !== typeof val2 || newval !== val2) {
310047
309840
  return newval;
310048
309841
  } else if (this.options.trimValues) {
310049
- return parseValue3(val2, this.options.parseTagValue, this.options.numberParseOptions);
309842
+ return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions);
310050
309843
  } else {
310051
309844
  const trimmedVal = val2.trim();
310052
309845
  if (trimmedVal === val2) {
310053
- return parseValue3(val2, this.options.parseTagValue, this.options.numberParseOptions);
309846
+ return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions);
310054
309847
  } else {
310055
309848
  return val2;
310056
309849
  }
@@ -310099,7 +309892,7 @@ var require_OrderedObjParser = __commonJS({
310099
309892
  } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) {
310100
309893
  attrs[aName] = newVal;
310101
309894
  } else {
310102
- attrs[aName] = parseValue3(
309895
+ attrs[aName] = parseValue(
310103
309896
  oldVal,
310104
309897
  this.options.parseAttributeValue,
310105
309898
  this.options.numberParseOptions
@@ -310453,7 +310246,7 @@ var require_OrderedObjParser = __commonJS({
310453
310246
  }
310454
310247
  }
310455
310248
  __name(readStopNodeData, "readStopNodeData");
310456
- function parseValue3(val2, shouldParse, options) {
310249
+ function parseValue(val2, shouldParse, options) {
310457
310250
  if (shouldParse && typeof val2 === "string") {
310458
310251
  const newval = val2.trim();
310459
310252
  if (newval === "true") return true;
@@ -310467,7 +310260,7 @@ var require_OrderedObjParser = __commonJS({
310467
310260
  }
310468
310261
  }
310469
310262
  }
310470
- __name(parseValue3, "parseValue");
310263
+ __name(parseValue, "parseValue");
310471
310264
  module2.exports = OrderedObjParser;
310472
310265
  }
310473
310266
  });
@@ -368217,6 +368010,7 @@ function printLocalExplorerAgentHint(url4) {
368217
368010
  The Local Explorer API is available at ${explorerApiUrl}
368218
368011
  Useful routes:
368219
368012
  GET ${explorerApiUrl}/local/workers - local Workers and bindings
368013
+ POST ${explorerApiUrl}/local/scheduled?worker=<name> - invoke a Worker's scheduled handler; cron is required (see the OpenAPI schema for the full request)
368220
368014
  GET ${explorerApiUrl}/storage/kv/namespaces - KV namespaces
368221
368015
  GET ${explorerApiUrl}/d1/database - D1 databases
368222
368016
  GET ${explorerApiUrl}/r2/buckets - R2 buckets
@@ -369805,6 +369599,16 @@ function unstable_getMiniflareWorkerOptions(configOrConfigPath, env6, options) {
369805
369599
  modulesRules,
369806
369600
  zone: getZoneFromConfig(config2),
369807
369601
  access: config2.access?.dev,
369602
+ connectHandlers: config2.connect.map((handler) => ({
369603
+ protocol: handler.protocol,
369604
+ port: handler.port,
369605
+ address: handler.address,
369606
+ ...handler.protocol === "udp" ? {
369607
+ idleTimeoutMs: handler.idle_timeout_ms,
369608
+ maxPendingBytes: handler.max_pending_bytes
369609
+ } : {}
369610
+ })),
369611
+ cronTriggers: config2.triggers.crons,
369808
369612
  ...bindingOptions,
369809
369613
  ...sitesOptions,
369810
369614
  ...assetOptions
@@ -370129,7 +369933,7 @@ var unstable_generateASSETSBinding = (
370129
369933
  );
370130
369934
  /*! Bundled license information:
370131
369935
 
370132
- smol-toml/dist/date.js:
369936
+ smol-toml/dist/error.js:
370133
369937
  (*!
370134
369938
  * Copyright (c) Squirrel Chat et al., All rights reserved.
370135
369939
  * SPDX-License-Identifier: BSD-3-Clause
@@ -370158,7 +369962,7 @@ smol-toml/dist/date.js:
370158
369962
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
370159
369963
  *)
370160
369964
 
370161
- smol-toml/dist/error.js:
369965
+ smol-toml/dist/primitive.js:
370162
369966
  (*!
370163
369967
  * Copyright (c) Squirrel Chat et al., All rights reserved.
370164
369968
  * SPDX-License-Identifier: BSD-3-Clause
@@ -370187,7 +369991,7 @@ smol-toml/dist/error.js:
370187
369991
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
370188
369992
  *)
370189
369993
 
370190
- smol-toml/dist/util.js:
369994
+ smol-toml/dist/date.js:
370191
369995
  (*!
370192
369996
  * Copyright (c) Squirrel Chat et al., All rights reserved.
370193
369997
  * SPDX-License-Identifier: BSD-3-Clause
@@ -370216,7 +370020,7 @@ smol-toml/dist/util.js:
370216
370020
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
370217
370021
  *)
370218
370022
 
370219
- smol-toml/dist/primitive.js:
370023
+ smol-toml/dist/extract.js:
370220
370024
  (*!
370221
370025
  * Copyright (c) Squirrel Chat et al., All rights reserved.
370222
370026
  * SPDX-License-Identifier: BSD-3-Clause
@@ -370245,7 +370049,7 @@ smol-toml/dist/primitive.js:
370245
370049
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
370246
370050
  *)
370247
370051
 
370248
- smol-toml/dist/extract.js:
370052
+ smol-toml/dist/util.js:
370249
370053
  (*!
370250
370054
  * Copyright (c) Squirrel Chat et al., All rights reserved.
370251
370055
  * SPDX-License-Identifier: BSD-3-Clause
@@ -370413,7 +370217,7 @@ smol-toml/dist/index.js:
370413
370217
  */
370414
370218
  /*! Bundled license information:
370415
370219
 
370416
- smol-toml/dist/date.js:
370220
+ smol-toml/dist/error.js:
370417
370221
  (*!
370418
370222
  * Copyright (c) Squirrel Chat et al., All rights reserved.
370419
370223
  * SPDX-License-Identifier: BSD-3-Clause
@@ -370442,7 +370246,7 @@ smol-toml/dist/date.js:
370442
370246
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
370443
370247
  *)
370444
370248
 
370445
- smol-toml/dist/error.js:
370249
+ smol-toml/dist/primitive.js:
370446
370250
  (*!
370447
370251
  * Copyright (c) Squirrel Chat et al., All rights reserved.
370448
370252
  * SPDX-License-Identifier: BSD-3-Clause
@@ -370471,7 +370275,7 @@ smol-toml/dist/error.js:
370471
370275
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
370472
370276
  *)
370473
370277
 
370474
- smol-toml/dist/util.js:
370278
+ smol-toml/dist/date.js:
370475
370279
  (*!
370476
370280
  * Copyright (c) Squirrel Chat et al., All rights reserved.
370477
370281
  * SPDX-License-Identifier: BSD-3-Clause
@@ -370500,7 +370304,7 @@ smol-toml/dist/util.js:
370500
370304
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
370501
370305
  *)
370502
370306
 
370503
- smol-toml/dist/primitive.js:
370307
+ smol-toml/dist/extract.js:
370504
370308
  (*!
370505
370309
  * Copyright (c) Squirrel Chat et al., All rights reserved.
370506
370310
  * SPDX-License-Identifier: BSD-3-Clause
@@ -370529,7 +370333,7 @@ smol-toml/dist/primitive.js:
370529
370333
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
370530
370334
  *)
370531
370335
 
370532
- smol-toml/dist/extract.js:
370336
+ smol-toml/dist/util.js:
370533
370337
  (*!
370534
370338
  * Copyright (c) Squirrel Chat et al., All rights reserved.
370535
370339
  * SPDX-License-Identifier: BSD-3-Clause