canopycms-cdk 0.0.61 → 0.0.62

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.
Files changed (46) hide show
  1. package/dist/constructs/cms-service.d.ts +14 -1
  2. package/dist/constructs/cms-service.d.ts.map +1 -1
  3. package/dist/constructs/cms-service.js +130 -21
  4. package/dist/constructs/cms-service.js.map +1 -1
  5. package/lambda/asset-transform/dist/handler.js +34 -6
  6. package/lambda/asset-transform/dist/node_modules/.package-lock.json +33 -6
  7. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/LICENSE +21 -0
  8. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/README.md +1 -0
  9. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.cjs.js +1398 -0
  10. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.cjs.min.d.ts +671 -0
  11. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.cjs.min.js +1 -0
  12. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.d.mts +671 -0
  13. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.d.ts +673 -0
  14. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.esm-bundler.js +1457 -0
  15. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.iife.d.ts +426 -0
  16. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.iife.js +1528 -0
  17. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.js +1529 -0
  18. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.min.d.mts +671 -0
  19. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.min.js +1 -0
  20. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.min.mjs +1 -0
  21. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/dist/emnapi.mjs +1367 -0
  22. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/index.js +5 -0
  23. package/lambda/asset-transform/dist/node_modules/@emnapi/runtime/package.json +48 -0
  24. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/LICENSE +191 -0
  25. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/README.md +50 -0
  26. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/index.cjs +1 -0
  27. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/lib/sharp-wasm32-0.35.3.node.js +1 -0
  28. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/lib/sharp-wasm32-0.35.3.node.wasm +0 -0
  29. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/package.json +37 -0
  30. package/lambda/asset-transform/dist/node_modules/@img/sharp-wasm32/versions.json +21 -0
  31. package/lambda/asset-transform/dist/node_modules/tslib/CopyrightNotice.txt +15 -0
  32. package/lambda/asset-transform/dist/node_modules/tslib/LICENSE.txt +12 -0
  33. package/lambda/asset-transform/dist/node_modules/tslib/README.md +164 -0
  34. package/lambda/asset-transform/dist/node_modules/tslib/SECURITY.md +41 -0
  35. package/lambda/asset-transform/dist/node_modules/tslib/modules/index.d.ts +38 -0
  36. package/lambda/asset-transform/dist/node_modules/tslib/modules/index.js +70 -0
  37. package/lambda/asset-transform/dist/node_modules/tslib/modules/package.json +3 -0
  38. package/lambda/asset-transform/dist/node_modules/tslib/package.json +47 -0
  39. package/lambda/asset-transform/dist/node_modules/tslib/tslib.d.ts +460 -0
  40. package/lambda/asset-transform/dist/node_modules/tslib/tslib.es6.html +1 -0
  41. package/lambda/asset-transform/dist/node_modules/tslib/tslib.es6.js +402 -0
  42. package/lambda/asset-transform/dist/node_modules/tslib/tslib.es6.mjs +401 -0
  43. package/lambda/asset-transform/dist/node_modules/tslib/tslib.html +1 -0
  44. package/lambda/asset-transform/dist/node_modules/tslib/tslib.js +484 -0
  45. package/package.json +5 -5
  46. package/worker/dist/index.js +526 -459
@@ -814,10 +814,10 @@ var require_src2 = __commonJS({
814
814
  var fs_1 = __require("fs");
815
815
  var debug_1 = __importDefault2(require_src());
816
816
  var log7 = debug_1.default("@kwsites/file-exists");
817
- function check(path13, isFile, isDirectory) {
818
- log7(`checking %s`, path13);
817
+ function check(path15, isFile, isDirectory) {
818
+ log7(`checking %s`, path15);
819
819
  try {
820
- const stat = fs_1.statSync(path13);
820
+ const stat = fs_1.statSync(path15);
821
821
  if (stat.isFile() && isFile) {
822
822
  log7(`[OK] path represents a file`);
823
823
  return true;
@@ -837,8 +837,8 @@ var require_src2 = __commonJS({
837
837
  throw e5;
838
838
  }
839
839
  }
840
- function exists2(path13, type = exports.READABLE) {
841
- return check(path13, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
840
+ function exists2(path15, type = exports.READABLE) {
841
+ return check(path15, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0);
842
842
  }
843
843
  exports.exists = exists2;
844
844
  exports.FILE = 1;
@@ -927,54 +927,54 @@ var require_polyfills = __commonJS({
927
927
  }
928
928
  var chdir;
929
929
  module.exports = patch;
930
- function patch(fs9) {
930
+ function patch(fs10) {
931
931
  if (constants2.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
932
- patchLchmod(fs9);
933
- }
934
- if (!fs9.lutimes) {
935
- patchLutimes(fs9);
936
- }
937
- fs9.chown = chownFix(fs9.chown);
938
- fs9.fchown = chownFix(fs9.fchown);
939
- fs9.lchown = chownFix(fs9.lchown);
940
- fs9.chmod = chmodFix(fs9.chmod);
941
- fs9.fchmod = chmodFix(fs9.fchmod);
942
- fs9.lchmod = chmodFix(fs9.lchmod);
943
- fs9.chownSync = chownFixSync(fs9.chownSync);
944
- fs9.fchownSync = chownFixSync(fs9.fchownSync);
945
- fs9.lchownSync = chownFixSync(fs9.lchownSync);
946
- fs9.chmodSync = chmodFixSync(fs9.chmodSync);
947
- fs9.fchmodSync = chmodFixSync(fs9.fchmodSync);
948
- fs9.lchmodSync = chmodFixSync(fs9.lchmodSync);
949
- fs9.stat = statFix(fs9.stat);
950
- fs9.fstat = statFix(fs9.fstat);
951
- fs9.lstat = statFix(fs9.lstat);
952
- fs9.statSync = statFixSync(fs9.statSync);
953
- fs9.fstatSync = statFixSync(fs9.fstatSync);
954
- fs9.lstatSync = statFixSync(fs9.lstatSync);
955
- if (fs9.chmod && !fs9.lchmod) {
956
- fs9.lchmod = function(path13, mode, cb) {
932
+ patchLchmod(fs10);
933
+ }
934
+ if (!fs10.lutimes) {
935
+ patchLutimes(fs10);
936
+ }
937
+ fs10.chown = chownFix(fs10.chown);
938
+ fs10.fchown = chownFix(fs10.fchown);
939
+ fs10.lchown = chownFix(fs10.lchown);
940
+ fs10.chmod = chmodFix(fs10.chmod);
941
+ fs10.fchmod = chmodFix(fs10.fchmod);
942
+ fs10.lchmod = chmodFix(fs10.lchmod);
943
+ fs10.chownSync = chownFixSync(fs10.chownSync);
944
+ fs10.fchownSync = chownFixSync(fs10.fchownSync);
945
+ fs10.lchownSync = chownFixSync(fs10.lchownSync);
946
+ fs10.chmodSync = chmodFixSync(fs10.chmodSync);
947
+ fs10.fchmodSync = chmodFixSync(fs10.fchmodSync);
948
+ fs10.lchmodSync = chmodFixSync(fs10.lchmodSync);
949
+ fs10.stat = statFix(fs10.stat);
950
+ fs10.fstat = statFix(fs10.fstat);
951
+ fs10.lstat = statFix(fs10.lstat);
952
+ fs10.statSync = statFixSync(fs10.statSync);
953
+ fs10.fstatSync = statFixSync(fs10.fstatSync);
954
+ fs10.lstatSync = statFixSync(fs10.lstatSync);
955
+ if (fs10.chmod && !fs10.lchmod) {
956
+ fs10.lchmod = function(path15, mode, cb) {
957
957
  if (cb) process.nextTick(cb);
958
958
  };
959
- fs9.lchmodSync = function() {
959
+ fs10.lchmodSync = function() {
960
960
  };
961
961
  }
962
- if (fs9.chown && !fs9.lchown) {
963
- fs9.lchown = function(path13, uid, gid, cb) {
962
+ if (fs10.chown && !fs10.lchown) {
963
+ fs10.lchown = function(path15, uid, gid, cb) {
964
964
  if (cb) process.nextTick(cb);
965
965
  };
966
- fs9.lchownSync = function() {
966
+ fs10.lchownSync = function() {
967
967
  };
968
968
  }
969
969
  if (platform === "win32") {
970
- fs9.rename = typeof fs9.rename !== "function" ? fs9.rename : (function(fs$rename) {
970
+ fs10.rename = typeof fs10.rename !== "function" ? fs10.rename : (function(fs$rename) {
971
971
  function rename(from, to, cb) {
972
972
  var start = Date.now();
973
973
  var backoff = 0;
974
974
  fs$rename(from, to, function CB(er) {
975
975
  if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
976
976
  setTimeout(function() {
977
- fs9.stat(to, function(stater, st) {
977
+ fs10.stat(to, function(stater, st) {
978
978
  if (stater && stater.code === "ENOENT")
979
979
  fs$rename(from, to, CB);
980
980
  else
@@ -990,9 +990,9 @@ var require_polyfills = __commonJS({
990
990
  }
991
991
  if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
992
992
  return rename;
993
- })(fs9.rename);
993
+ })(fs10.rename);
994
994
  }
995
- fs9.read = typeof fs9.read !== "function" ? fs9.read : (function(fs$read) {
995
+ fs10.read = typeof fs10.read !== "function" ? fs10.read : (function(fs$read) {
996
996
  function read(fd, buffer, offset, length, position, callback_) {
997
997
  var callback;
998
998
  if (callback_ && typeof callback_ === "function") {
@@ -1000,22 +1000,22 @@ var require_polyfills = __commonJS({
1000
1000
  callback = function(er, _3, __) {
1001
1001
  if (er && er.code === "EAGAIN" && eagCounter < 10) {
1002
1002
  eagCounter++;
1003
- return fs$read.call(fs9, fd, buffer, offset, length, position, callback);
1003
+ return fs$read.call(fs10, fd, buffer, offset, length, position, callback);
1004
1004
  }
1005
1005
  callback_.apply(this, arguments);
1006
1006
  };
1007
1007
  }
1008
- return fs$read.call(fs9, fd, buffer, offset, length, position, callback);
1008
+ return fs$read.call(fs10, fd, buffer, offset, length, position, callback);
1009
1009
  }
1010
1010
  if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
1011
1011
  return read;
1012
- })(fs9.read);
1013
- fs9.readSync = typeof fs9.readSync !== "function" ? fs9.readSync : /* @__PURE__ */ (function(fs$readSync) {
1012
+ })(fs10.read);
1013
+ fs10.readSync = typeof fs10.readSync !== "function" ? fs10.readSync : /* @__PURE__ */ (function(fs$readSync) {
1014
1014
  return function(fd, buffer, offset, length, position) {
1015
1015
  var eagCounter = 0;
1016
1016
  while (true) {
1017
1017
  try {
1018
- return fs$readSync.call(fs9, fd, buffer, offset, length, position);
1018
+ return fs$readSync.call(fs10, fd, buffer, offset, length, position);
1019
1019
  } catch (er) {
1020
1020
  if (er.code === "EAGAIN" && eagCounter < 10) {
1021
1021
  eagCounter++;
@@ -1025,11 +1025,11 @@ var require_polyfills = __commonJS({
1025
1025
  }
1026
1026
  }
1027
1027
  };
1028
- })(fs9.readSync);
1029
- function patchLchmod(fs10) {
1030
- fs10.lchmod = function(path13, mode, callback) {
1031
- fs10.open(
1032
- path13,
1028
+ })(fs10.readSync);
1029
+ function patchLchmod(fs11) {
1030
+ fs11.lchmod = function(path15, mode, callback) {
1031
+ fs11.open(
1032
+ path15,
1033
1033
  constants2.O_WRONLY | constants2.O_SYMLINK,
1034
1034
  mode,
1035
1035
  function(err, fd) {
@@ -1037,80 +1037,80 @@ var require_polyfills = __commonJS({
1037
1037
  if (callback) callback(err);
1038
1038
  return;
1039
1039
  }
1040
- fs10.fchmod(fd, mode, function(err2) {
1041
- fs10.close(fd, function(err22) {
1040
+ fs11.fchmod(fd, mode, function(err2) {
1041
+ fs11.close(fd, function(err22) {
1042
1042
  if (callback) callback(err2 || err22);
1043
1043
  });
1044
1044
  });
1045
1045
  }
1046
1046
  );
1047
1047
  };
1048
- fs10.lchmodSync = function(path13, mode) {
1049
- var fd = fs10.openSync(path13, constants2.O_WRONLY | constants2.O_SYMLINK, mode);
1048
+ fs11.lchmodSync = function(path15, mode) {
1049
+ var fd = fs11.openSync(path15, constants2.O_WRONLY | constants2.O_SYMLINK, mode);
1050
1050
  var threw = true;
1051
1051
  var ret;
1052
1052
  try {
1053
- ret = fs10.fchmodSync(fd, mode);
1053
+ ret = fs11.fchmodSync(fd, mode);
1054
1054
  threw = false;
1055
1055
  } finally {
1056
1056
  if (threw) {
1057
1057
  try {
1058
- fs10.closeSync(fd);
1058
+ fs11.closeSync(fd);
1059
1059
  } catch (er) {
1060
1060
  }
1061
1061
  } else {
1062
- fs10.closeSync(fd);
1062
+ fs11.closeSync(fd);
1063
1063
  }
1064
1064
  }
1065
1065
  return ret;
1066
1066
  };
1067
1067
  }
1068
- function patchLutimes(fs10) {
1069
- if (constants2.hasOwnProperty("O_SYMLINK") && fs10.futimes) {
1070
- fs10.lutimes = function(path13, at, mt, cb) {
1071
- fs10.open(path13, constants2.O_SYMLINK, function(er, fd) {
1068
+ function patchLutimes(fs11) {
1069
+ if (constants2.hasOwnProperty("O_SYMLINK") && fs11.futimes) {
1070
+ fs11.lutimes = function(path15, at, mt, cb) {
1071
+ fs11.open(path15, constants2.O_SYMLINK, function(er, fd) {
1072
1072
  if (er) {
1073
1073
  if (cb) cb(er);
1074
1074
  return;
1075
1075
  }
1076
- fs10.futimes(fd, at, mt, function(er2) {
1077
- fs10.close(fd, function(er22) {
1076
+ fs11.futimes(fd, at, mt, function(er2) {
1077
+ fs11.close(fd, function(er22) {
1078
1078
  if (cb) cb(er2 || er22);
1079
1079
  });
1080
1080
  });
1081
1081
  });
1082
1082
  };
1083
- fs10.lutimesSync = function(path13, at, mt) {
1084
- var fd = fs10.openSync(path13, constants2.O_SYMLINK);
1083
+ fs11.lutimesSync = function(path15, at, mt) {
1084
+ var fd = fs11.openSync(path15, constants2.O_SYMLINK);
1085
1085
  var ret;
1086
1086
  var threw = true;
1087
1087
  try {
1088
- ret = fs10.futimesSync(fd, at, mt);
1088
+ ret = fs11.futimesSync(fd, at, mt);
1089
1089
  threw = false;
1090
1090
  } finally {
1091
1091
  if (threw) {
1092
1092
  try {
1093
- fs10.closeSync(fd);
1093
+ fs11.closeSync(fd);
1094
1094
  } catch (er) {
1095
1095
  }
1096
1096
  } else {
1097
- fs10.closeSync(fd);
1097
+ fs11.closeSync(fd);
1098
1098
  }
1099
1099
  }
1100
1100
  return ret;
1101
1101
  };
1102
- } else if (fs10.futimes) {
1103
- fs10.lutimes = function(_a3, _b, _c5, cb) {
1102
+ } else if (fs11.futimes) {
1103
+ fs11.lutimes = function(_a3, _b, _c5, cb) {
1104
1104
  if (cb) process.nextTick(cb);
1105
1105
  };
1106
- fs10.lutimesSync = function() {
1106
+ fs11.lutimesSync = function() {
1107
1107
  };
1108
1108
  }
1109
1109
  }
1110
1110
  function chmodFix(orig) {
1111
1111
  if (!orig) return orig;
1112
1112
  return function(target, mode, cb) {
1113
- return orig.call(fs9, target, mode, function(er) {
1113
+ return orig.call(fs10, target, mode, function(er) {
1114
1114
  if (chownErOk(er)) er = null;
1115
1115
  if (cb) cb.apply(this, arguments);
1116
1116
  });
@@ -1120,7 +1120,7 @@ var require_polyfills = __commonJS({
1120
1120
  if (!orig) return orig;
1121
1121
  return function(target, mode) {
1122
1122
  try {
1123
- return orig.call(fs9, target, mode);
1123
+ return orig.call(fs10, target, mode);
1124
1124
  } catch (er) {
1125
1125
  if (!chownErOk(er)) throw er;
1126
1126
  }
@@ -1129,7 +1129,7 @@ var require_polyfills = __commonJS({
1129
1129
  function chownFix(orig) {
1130
1130
  if (!orig) return orig;
1131
1131
  return function(target, uid, gid, cb) {
1132
- return orig.call(fs9, target, uid, gid, function(er) {
1132
+ return orig.call(fs10, target, uid, gid, function(er) {
1133
1133
  if (chownErOk(er)) er = null;
1134
1134
  if (cb) cb.apply(this, arguments);
1135
1135
  });
@@ -1139,7 +1139,7 @@ var require_polyfills = __commonJS({
1139
1139
  if (!orig) return orig;
1140
1140
  return function(target, uid, gid) {
1141
1141
  try {
1142
- return orig.call(fs9, target, uid, gid);
1142
+ return orig.call(fs10, target, uid, gid);
1143
1143
  } catch (er) {
1144
1144
  if (!chownErOk(er)) throw er;
1145
1145
  }
@@ -1159,13 +1159,13 @@ var require_polyfills = __commonJS({
1159
1159
  }
1160
1160
  if (cb) cb.apply(this, arguments);
1161
1161
  }
1162
- return options ? orig.call(fs9, target, options, callback) : orig.call(fs9, target, callback);
1162
+ return options ? orig.call(fs10, target, options, callback) : orig.call(fs10, target, callback);
1163
1163
  };
1164
1164
  }
1165
1165
  function statFixSync(orig) {
1166
1166
  if (!orig) return orig;
1167
1167
  return function(target, options) {
1168
- var stats = options ? orig.call(fs9, target, options) : orig.call(fs9, target);
1168
+ var stats = options ? orig.call(fs10, target, options) : orig.call(fs10, target);
1169
1169
  if (stats) {
1170
1170
  if (stats.uid < 0) stats.uid += 4294967296;
1171
1171
  if (stats.gid < 0) stats.gid += 4294967296;
@@ -1194,16 +1194,16 @@ var require_legacy_streams = __commonJS({
1194
1194
  "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js"(exports, module) {
1195
1195
  var Stream = __require("stream").Stream;
1196
1196
  module.exports = legacy;
1197
- function legacy(fs9) {
1197
+ function legacy(fs10) {
1198
1198
  return {
1199
1199
  ReadStream,
1200
1200
  WriteStream
1201
1201
  };
1202
- function ReadStream(path13, options) {
1203
- if (!(this instanceof ReadStream)) return new ReadStream(path13, options);
1202
+ function ReadStream(path15, options) {
1203
+ if (!(this instanceof ReadStream)) return new ReadStream(path15, options);
1204
1204
  Stream.call(this);
1205
1205
  var self2 = this;
1206
- this.path = path13;
1206
+ this.path = path15;
1207
1207
  this.fd = null;
1208
1208
  this.readable = true;
1209
1209
  this.paused = false;
@@ -1237,7 +1237,7 @@ var require_legacy_streams = __commonJS({
1237
1237
  });
1238
1238
  return;
1239
1239
  }
1240
- fs9.open(this.path, this.flags, this.mode, function(err, fd) {
1240
+ fs10.open(this.path, this.flags, this.mode, function(err, fd) {
1241
1241
  if (err) {
1242
1242
  self2.emit("error", err);
1243
1243
  self2.readable = false;
@@ -1248,10 +1248,10 @@ var require_legacy_streams = __commonJS({
1248
1248
  self2._read();
1249
1249
  });
1250
1250
  }
1251
- function WriteStream(path13, options) {
1252
- if (!(this instanceof WriteStream)) return new WriteStream(path13, options);
1251
+ function WriteStream(path15, options) {
1252
+ if (!(this instanceof WriteStream)) return new WriteStream(path15, options);
1253
1253
  Stream.call(this);
1254
- this.path = path13;
1254
+ this.path = path15;
1255
1255
  this.fd = null;
1256
1256
  this.writable = true;
1257
1257
  this.flags = "w";
@@ -1276,7 +1276,7 @@ var require_legacy_streams = __commonJS({
1276
1276
  this.busy = false;
1277
1277
  this._queue = [];
1278
1278
  if (this.fd === null) {
1279
- this._open = fs9.open;
1279
+ this._open = fs10.open;
1280
1280
  this._queue.push([this._open, this.path, this.flags, this.mode, void 0]);
1281
1281
  this.flush();
1282
1282
  }
@@ -1311,7 +1311,7 @@ var require_clone = __commonJS({
1311
1311
  // ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
1312
1312
  var require_graceful_fs = __commonJS({
1313
1313
  "../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js"(exports, module) {
1314
- var fs9 = __require("fs");
1314
+ var fs10 = __require("fs");
1315
1315
  var polyfills = require_polyfills();
1316
1316
  var legacy = require_legacy_streams();
1317
1317
  var clone = require_clone();
@@ -1343,12 +1343,12 @@ var require_graceful_fs = __commonJS({
1343
1343
  m5 = "GFS4: " + m5.split(/\n/).join("\nGFS4: ");
1344
1344
  console.error(m5);
1345
1345
  };
1346
- if (!fs9[gracefulQueue]) {
1346
+ if (!fs10[gracefulQueue]) {
1347
1347
  queue = global[gracefulQueue] || [];
1348
- publishQueue(fs9, queue);
1349
- fs9.close = (function(fs$close) {
1348
+ publishQueue(fs10, queue);
1349
+ fs10.close = (function(fs$close) {
1350
1350
  function close(fd, cb) {
1351
- return fs$close.call(fs9, fd, function(err) {
1351
+ return fs$close.call(fs10, fd, function(err) {
1352
1352
  if (!err) {
1353
1353
  resetQueue();
1354
1354
  }
@@ -1360,48 +1360,48 @@ var require_graceful_fs = __commonJS({
1360
1360
  value: fs$close
1361
1361
  });
1362
1362
  return close;
1363
- })(fs9.close);
1364
- fs9.closeSync = (function(fs$closeSync) {
1363
+ })(fs10.close);
1364
+ fs10.closeSync = (function(fs$closeSync) {
1365
1365
  function closeSync(fd) {
1366
- fs$closeSync.apply(fs9, arguments);
1366
+ fs$closeSync.apply(fs10, arguments);
1367
1367
  resetQueue();
1368
1368
  }
1369
1369
  Object.defineProperty(closeSync, previousSymbol, {
1370
1370
  value: fs$closeSync
1371
1371
  });
1372
1372
  return closeSync;
1373
- })(fs9.closeSync);
1373
+ })(fs10.closeSync);
1374
1374
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) {
1375
1375
  process.on("exit", function() {
1376
- debug2(fs9[gracefulQueue]);
1377
- __require("assert").equal(fs9[gracefulQueue].length, 0);
1376
+ debug2(fs10[gracefulQueue]);
1377
+ __require("assert").equal(fs10[gracefulQueue].length, 0);
1378
1378
  });
1379
1379
  }
1380
1380
  }
1381
1381
  var queue;
1382
1382
  if (!global[gracefulQueue]) {
1383
- publishQueue(global, fs9[gracefulQueue]);
1384
- }
1385
- module.exports = patch(clone(fs9));
1386
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs9.__patched) {
1387
- module.exports = patch(fs9);
1388
- fs9.__patched = true;
1389
- }
1390
- function patch(fs10) {
1391
- polyfills(fs10);
1392
- fs10.gracefulify = patch;
1393
- fs10.createReadStream = createReadStream;
1394
- fs10.createWriteStream = createWriteStream;
1395
- var fs$readFile = fs10.readFile;
1396
- fs10.readFile = readFile;
1397
- function readFile(path13, options, cb) {
1383
+ publishQueue(global, fs10[gracefulQueue]);
1384
+ }
1385
+ module.exports = patch(clone(fs10));
1386
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs10.__patched) {
1387
+ module.exports = patch(fs10);
1388
+ fs10.__patched = true;
1389
+ }
1390
+ function patch(fs11) {
1391
+ polyfills(fs11);
1392
+ fs11.gracefulify = patch;
1393
+ fs11.createReadStream = createReadStream;
1394
+ fs11.createWriteStream = createWriteStream;
1395
+ var fs$readFile = fs11.readFile;
1396
+ fs11.readFile = readFile;
1397
+ function readFile(path15, options, cb) {
1398
1398
  if (typeof options === "function")
1399
1399
  cb = options, options = null;
1400
- return go$readFile(path13, options, cb);
1401
- function go$readFile(path14, options2, cb2, startTime) {
1402
- return fs$readFile(path14, options2, function(err) {
1400
+ return go$readFile(path15, options, cb);
1401
+ function go$readFile(path16, options2, cb2, startTime) {
1402
+ return fs$readFile(path16, options2, function(err) {
1403
1403
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
1404
- enqueue([go$readFile, [path14, options2, cb2], err, startTime || Date.now(), Date.now()]);
1404
+ enqueue([go$readFile, [path16, options2, cb2], err, startTime || Date.now(), Date.now()]);
1405
1405
  else {
1406
1406
  if (typeof cb2 === "function")
1407
1407
  cb2.apply(this, arguments);
@@ -1409,16 +1409,16 @@ var require_graceful_fs = __commonJS({
1409
1409
  });
1410
1410
  }
1411
1411
  }
1412
- var fs$writeFile = fs10.writeFile;
1413
- fs10.writeFile = writeFile;
1414
- function writeFile(path13, data2, options, cb) {
1412
+ var fs$writeFile = fs11.writeFile;
1413
+ fs11.writeFile = writeFile;
1414
+ function writeFile(path15, data2, options, cb) {
1415
1415
  if (typeof options === "function")
1416
1416
  cb = options, options = null;
1417
- return go$writeFile(path13, data2, options, cb);
1418
- function go$writeFile(path14, data3, options2, cb2, startTime) {
1419
- return fs$writeFile(path14, data3, options2, function(err) {
1417
+ return go$writeFile(path15, data2, options, cb);
1418
+ function go$writeFile(path16, data3, options2, cb2, startTime) {
1419
+ return fs$writeFile(path16, data3, options2, function(err) {
1420
1420
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
1421
- enqueue([go$writeFile, [path14, data3, options2, cb2], err, startTime || Date.now(), Date.now()]);
1421
+ enqueue([go$writeFile, [path16, data3, options2, cb2], err, startTime || Date.now(), Date.now()]);
1422
1422
  else {
1423
1423
  if (typeof cb2 === "function")
1424
1424
  cb2.apply(this, arguments);
@@ -1426,17 +1426,17 @@ var require_graceful_fs = __commonJS({
1426
1426
  });
1427
1427
  }
1428
1428
  }
1429
- var fs$appendFile = fs10.appendFile;
1429
+ var fs$appendFile = fs11.appendFile;
1430
1430
  if (fs$appendFile)
1431
- fs10.appendFile = appendFile;
1432
- function appendFile(path13, data2, options, cb) {
1431
+ fs11.appendFile = appendFile;
1432
+ function appendFile(path15, data2, options, cb) {
1433
1433
  if (typeof options === "function")
1434
1434
  cb = options, options = null;
1435
- return go$appendFile(path13, data2, options, cb);
1436
- function go$appendFile(path14, data3, options2, cb2, startTime) {
1437
- return fs$appendFile(path14, data3, options2, function(err) {
1435
+ return go$appendFile(path15, data2, options, cb);
1436
+ function go$appendFile(path16, data3, options2, cb2, startTime) {
1437
+ return fs$appendFile(path16, data3, options2, function(err) {
1438
1438
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
1439
- enqueue([go$appendFile, [path14, data3, options2, cb2], err, startTime || Date.now(), Date.now()]);
1439
+ enqueue([go$appendFile, [path16, data3, options2, cb2], err, startTime || Date.now(), Date.now()]);
1440
1440
  else {
1441
1441
  if (typeof cb2 === "function")
1442
1442
  cb2.apply(this, arguments);
@@ -1444,9 +1444,9 @@ var require_graceful_fs = __commonJS({
1444
1444
  });
1445
1445
  }
1446
1446
  }
1447
- var fs$copyFile = fs10.copyFile;
1447
+ var fs$copyFile = fs11.copyFile;
1448
1448
  if (fs$copyFile)
1449
- fs10.copyFile = copyFile;
1449
+ fs11.copyFile = copyFile;
1450
1450
  function copyFile(src, dest, flags, cb) {
1451
1451
  if (typeof flags === "function") {
1452
1452
  cb = flags;
@@ -1464,34 +1464,34 @@ var require_graceful_fs = __commonJS({
1464
1464
  });
1465
1465
  }
1466
1466
  }
1467
- var fs$readdir = fs10.readdir;
1468
- fs10.readdir = readdir;
1467
+ var fs$readdir = fs11.readdir;
1468
+ fs11.readdir = readdir;
1469
1469
  var noReaddirOptionVersions = /^v[0-5]\./;
1470
- function readdir(path13, options, cb) {
1470
+ function readdir(path15, options, cb) {
1471
1471
  if (typeof options === "function")
1472
1472
  cb = options, options = null;
1473
- var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path14, options2, cb2, startTime) {
1474
- return fs$readdir(path14, fs$readdirCallback(
1475
- path14,
1473
+ var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path16, options2, cb2, startTime) {
1474
+ return fs$readdir(path16, fs$readdirCallback(
1475
+ path16,
1476
1476
  options2,
1477
1477
  cb2,
1478
1478
  startTime
1479
1479
  ));
1480
- } : function go$readdir2(path14, options2, cb2, startTime) {
1481
- return fs$readdir(path14, options2, fs$readdirCallback(
1482
- path14,
1480
+ } : function go$readdir2(path16, options2, cb2, startTime) {
1481
+ return fs$readdir(path16, options2, fs$readdirCallback(
1482
+ path16,
1483
1483
  options2,
1484
1484
  cb2,
1485
1485
  startTime
1486
1486
  ));
1487
1487
  };
1488
- return go$readdir(path13, options, cb);
1489
- function fs$readdirCallback(path14, options2, cb2, startTime) {
1488
+ return go$readdir(path15, options, cb);
1489
+ function fs$readdirCallback(path16, options2, cb2, startTime) {
1490
1490
  return function(err, files) {
1491
1491
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
1492
1492
  enqueue([
1493
1493
  go$readdir,
1494
- [path14, options2, cb2],
1494
+ [path16, options2, cb2],
1495
1495
  err,
1496
1496
  startTime || Date.now(),
1497
1497
  Date.now()
@@ -1506,21 +1506,21 @@ var require_graceful_fs = __commonJS({
1506
1506
  }
1507
1507
  }
1508
1508
  if (process.version.substr(0, 4) === "v0.8") {
1509
- var legStreams = legacy(fs10);
1509
+ var legStreams = legacy(fs11);
1510
1510
  ReadStream = legStreams.ReadStream;
1511
1511
  WriteStream = legStreams.WriteStream;
1512
1512
  }
1513
- var fs$ReadStream = fs10.ReadStream;
1513
+ var fs$ReadStream = fs11.ReadStream;
1514
1514
  if (fs$ReadStream) {
1515
1515
  ReadStream.prototype = Object.create(fs$ReadStream.prototype);
1516
1516
  ReadStream.prototype.open = ReadStream$open;
1517
1517
  }
1518
- var fs$WriteStream = fs10.WriteStream;
1518
+ var fs$WriteStream = fs11.WriteStream;
1519
1519
  if (fs$WriteStream) {
1520
1520
  WriteStream.prototype = Object.create(fs$WriteStream.prototype);
1521
1521
  WriteStream.prototype.open = WriteStream$open;
1522
1522
  }
1523
- Object.defineProperty(fs10, "ReadStream", {
1523
+ Object.defineProperty(fs11, "ReadStream", {
1524
1524
  get: function() {
1525
1525
  return ReadStream;
1526
1526
  },
@@ -1530,7 +1530,7 @@ var require_graceful_fs = __commonJS({
1530
1530
  enumerable: true,
1531
1531
  configurable: true
1532
1532
  });
1533
- Object.defineProperty(fs10, "WriteStream", {
1533
+ Object.defineProperty(fs11, "WriteStream", {
1534
1534
  get: function() {
1535
1535
  return WriteStream;
1536
1536
  },
@@ -1541,7 +1541,7 @@ var require_graceful_fs = __commonJS({
1541
1541
  configurable: true
1542
1542
  });
1543
1543
  var FileReadStream = ReadStream;
1544
- Object.defineProperty(fs10, "FileReadStream", {
1544
+ Object.defineProperty(fs11, "FileReadStream", {
1545
1545
  get: function() {
1546
1546
  return FileReadStream;
1547
1547
  },
@@ -1552,7 +1552,7 @@ var require_graceful_fs = __commonJS({
1552
1552
  configurable: true
1553
1553
  });
1554
1554
  var FileWriteStream = WriteStream;
1555
- Object.defineProperty(fs10, "FileWriteStream", {
1555
+ Object.defineProperty(fs11, "FileWriteStream", {
1556
1556
  get: function() {
1557
1557
  return FileWriteStream;
1558
1558
  },
@@ -1562,7 +1562,7 @@ var require_graceful_fs = __commonJS({
1562
1562
  enumerable: true,
1563
1563
  configurable: true
1564
1564
  });
1565
- function ReadStream(path13, options) {
1565
+ function ReadStream(path15, options) {
1566
1566
  if (this instanceof ReadStream)
1567
1567
  return fs$ReadStream.apply(this, arguments), this;
1568
1568
  else
@@ -1582,7 +1582,7 @@ var require_graceful_fs = __commonJS({
1582
1582
  }
1583
1583
  });
1584
1584
  }
1585
- function WriteStream(path13, options) {
1585
+ function WriteStream(path15, options) {
1586
1586
  if (this instanceof WriteStream)
1587
1587
  return fs$WriteStream.apply(this, arguments), this;
1588
1588
  else
@@ -1600,22 +1600,22 @@ var require_graceful_fs = __commonJS({
1600
1600
  }
1601
1601
  });
1602
1602
  }
1603
- function createReadStream(path13, options) {
1604
- return new fs10.ReadStream(path13, options);
1603
+ function createReadStream(path15, options) {
1604
+ return new fs11.ReadStream(path15, options);
1605
1605
  }
1606
- function createWriteStream(path13, options) {
1607
- return new fs10.WriteStream(path13, options);
1606
+ function createWriteStream(path15, options) {
1607
+ return new fs11.WriteStream(path15, options);
1608
1608
  }
1609
- var fs$open = fs10.open;
1610
- fs10.open = open;
1611
- function open(path13, flags, mode, cb) {
1609
+ var fs$open = fs11.open;
1610
+ fs11.open = open;
1611
+ function open(path15, flags, mode, cb) {
1612
1612
  if (typeof mode === "function")
1613
1613
  cb = mode, mode = null;
1614
- return go$open(path13, flags, mode, cb);
1615
- function go$open(path14, flags2, mode2, cb2, startTime) {
1616
- return fs$open(path14, flags2, mode2, function(err, fd) {
1614
+ return go$open(path15, flags, mode, cb);
1615
+ function go$open(path16, flags2, mode2, cb2, startTime) {
1616
+ return fs$open(path16, flags2, mode2, function(err, fd) {
1617
1617
  if (err && (err.code === "EMFILE" || err.code === "ENFILE"))
1618
- enqueue([go$open, [path14, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
1618
+ enqueue([go$open, [path16, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]);
1619
1619
  else {
1620
1620
  if (typeof cb2 === "function")
1621
1621
  cb2.apply(this, arguments);
@@ -1623,20 +1623,20 @@ var require_graceful_fs = __commonJS({
1623
1623
  });
1624
1624
  }
1625
1625
  }
1626
- return fs10;
1626
+ return fs11;
1627
1627
  }
1628
1628
  function enqueue(elem) {
1629
1629
  debug2("ENQUEUE", elem[0].name, elem[1]);
1630
- fs9[gracefulQueue].push(elem);
1630
+ fs10[gracefulQueue].push(elem);
1631
1631
  retry2();
1632
1632
  }
1633
1633
  var retryTimer;
1634
1634
  function resetQueue() {
1635
1635
  var now = Date.now();
1636
- for (var i6 = 0; i6 < fs9[gracefulQueue].length; ++i6) {
1637
- if (fs9[gracefulQueue][i6].length > 2) {
1638
- fs9[gracefulQueue][i6][3] = now;
1639
- fs9[gracefulQueue][i6][4] = now;
1636
+ for (var i6 = 0; i6 < fs10[gracefulQueue].length; ++i6) {
1637
+ if (fs10[gracefulQueue][i6].length > 2) {
1638
+ fs10[gracefulQueue][i6][3] = now;
1639
+ fs10[gracefulQueue][i6][4] = now;
1640
1640
  }
1641
1641
  }
1642
1642
  retry2();
@@ -1644,9 +1644,9 @@ var require_graceful_fs = __commonJS({
1644
1644
  function retry2() {
1645
1645
  clearTimeout(retryTimer);
1646
1646
  retryTimer = void 0;
1647
- if (fs9[gracefulQueue].length === 0)
1647
+ if (fs10[gracefulQueue].length === 0)
1648
1648
  return;
1649
- var elem = fs9[gracefulQueue].shift();
1649
+ var elem = fs10[gracefulQueue].shift();
1650
1650
  var fn = elem[0];
1651
1651
  var args = elem[1];
1652
1652
  var err = elem[2];
@@ -1668,7 +1668,7 @@ var require_graceful_fs = __commonJS({
1668
1668
  debug2("RETRY", fn.name, args);
1669
1669
  fn.apply(null, args.concat([startTime]));
1670
1670
  } else {
1671
- fs9[gracefulQueue].push(elem);
1671
+ fs10[gracefulQueue].push(elem);
1672
1672
  }
1673
1673
  }
1674
1674
  if (retryTimer === void 0) {
@@ -2103,10 +2103,10 @@ var require_mtime_precision = __commonJS({
2103
2103
  "../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/mtime-precision.js"(exports, module) {
2104
2104
  "use strict";
2105
2105
  var cacheSymbol = Symbol();
2106
- function probe(file, fs9, callback) {
2107
- const cachedPrecision = fs9[cacheSymbol];
2106
+ function probe(file, fs10, callback) {
2107
+ const cachedPrecision = fs10[cacheSymbol];
2108
2108
  if (cachedPrecision) {
2109
- return fs9.stat(file, (err, stat) => {
2109
+ return fs10.stat(file, (err, stat) => {
2110
2110
  if (err) {
2111
2111
  return callback(err);
2112
2112
  }
@@ -2114,16 +2114,16 @@ var require_mtime_precision = __commonJS({
2114
2114
  });
2115
2115
  }
2116
2116
  const mtime = new Date(Math.ceil(Date.now() / 1e3) * 1e3 + 5);
2117
- fs9.utimes(file, mtime, mtime, (err) => {
2117
+ fs10.utimes(file, mtime, mtime, (err) => {
2118
2118
  if (err) {
2119
2119
  return callback(err);
2120
2120
  }
2121
- fs9.stat(file, (err2, stat) => {
2121
+ fs10.stat(file, (err2, stat) => {
2122
2122
  if (err2) {
2123
2123
  return callback(err2);
2124
2124
  }
2125
2125
  const precision = stat.mtime.getTime() % 1e3 === 0 ? "s" : "ms";
2126
- Object.defineProperty(fs9, cacheSymbol, { value: precision });
2126
+ Object.defineProperty(fs10, cacheSymbol, { value: precision });
2127
2127
  callback(null, stat.mtime, precision);
2128
2128
  });
2129
2129
  });
@@ -2144,8 +2144,8 @@ var require_mtime_precision = __commonJS({
2144
2144
  var require_lockfile = __commonJS({
2145
2145
  "../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js"(exports, module) {
2146
2146
  "use strict";
2147
- var path13 = __require("path");
2148
- var fs9 = require_graceful_fs();
2147
+ var path15 = __require("path");
2148
+ var fs10 = require_graceful_fs();
2149
2149
  var retry2 = require_retry2();
2150
2150
  var onExit = require_signal_exit();
2151
2151
  var mtimePrecision = require_mtime_precision();
@@ -2155,7 +2155,7 @@ var require_lockfile = __commonJS({
2155
2155
  }
2156
2156
  function resolveCanonicalPath(file, options, callback) {
2157
2157
  if (!options.realpath) {
2158
- return callback(null, path13.resolve(file));
2158
+ return callback(null, path15.resolve(file));
2159
2159
  }
2160
2160
  options.fs.realpath(file, callback);
2161
2161
  }
@@ -2276,7 +2276,7 @@ var require_lockfile = __commonJS({
2276
2276
  update: null,
2277
2277
  realpath: true,
2278
2278
  retries: 0,
2279
- fs: fs9,
2279
+ fs: fs10,
2280
2280
  onCompromised: (err) => {
2281
2281
  throw err;
2282
2282
  },
@@ -2320,7 +2320,7 @@ var require_lockfile = __commonJS({
2320
2320
  }
2321
2321
  function unlock(file, options, callback) {
2322
2322
  options = {
2323
- fs: fs9,
2323
+ fs: fs10,
2324
2324
  realpath: true,
2325
2325
  ...options
2326
2326
  };
@@ -2342,7 +2342,7 @@ var require_lockfile = __commonJS({
2342
2342
  options = {
2343
2343
  stale: 1e4,
2344
2344
  realpath: true,
2345
- fs: fs9,
2345
+ fs: fs10,
2346
2346
  ...options
2347
2347
  };
2348
2348
  options.stale = Math.max(options.stale || 0, 2e3);
@@ -2381,16 +2381,16 @@ var require_lockfile = __commonJS({
2381
2381
  var require_adapter = __commonJS({
2382
2382
  "../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/adapter.js"(exports, module) {
2383
2383
  "use strict";
2384
- var fs9 = require_graceful_fs();
2385
- function createSyncFs(fs10) {
2384
+ var fs10 = require_graceful_fs();
2385
+ function createSyncFs(fs11) {
2386
2386
  const methods = ["mkdir", "realpath", "stat", "rmdir", "utimes"];
2387
- const newFs = { ...fs10 };
2387
+ const newFs = { ...fs11 };
2388
2388
  methods.forEach((method) => {
2389
2389
  newFs[method] = (...args) => {
2390
2390
  const callback = args.pop();
2391
2391
  let ret;
2392
2392
  try {
2393
- ret = fs10[`${method}Sync`](...args);
2393
+ ret = fs11[`${method}Sync`](...args);
2394
2394
  } catch (err) {
2395
2395
  return callback(err);
2396
2396
  }
@@ -2428,7 +2428,7 @@ var require_adapter = __commonJS({
2428
2428
  }
2429
2429
  function toSyncOptions(options) {
2430
2430
  options = { ...options };
2431
- options.fs = createSyncFs(options.fs || fs9);
2431
+ options.fs = createSyncFs(options.fs || fs10);
2432
2432
  if (typeof options.retries === "number" && options.retries > 0 || options.retries && typeof options.retries.retries === "number" && options.retries.retries > 0) {
2433
2433
  throw Object.assign(new Error("Cannot use retries with the sync api"), { code: "ESYNC" });
2434
2434
  }
@@ -3785,15 +3785,15 @@ var require_dist_node9 = __commonJS({
3785
3785
  octokit.log.debug("request", options);
3786
3786
  const start = Date.now();
3787
3787
  const requestOptions = octokit.request.endpoint.parse(options);
3788
- const path13 = requestOptions.url.replace(options.baseUrl, "");
3788
+ const path15 = requestOptions.url.replace(options.baseUrl, "");
3789
3789
  return request(options).then((response) => {
3790
3790
  octokit.log.info(
3791
- `${requestOptions.method} ${path13} - ${response.status} in ${Date.now() - start}ms`
3791
+ `${requestOptions.method} ${path15} - ${response.status} in ${Date.now() - start}ms`
3792
3792
  );
3793
3793
  return response;
3794
3794
  }).catch((error2) => {
3795
3795
  octokit.log.info(
3796
- `${requestOptions.method} ${path13} - ${error2.status} in ${Date.now() - start}ms`
3796
+ `${requestOptions.method} ${path15} - ${error2.status} in ${Date.now() - start}ms`
3797
3797
  );
3798
3798
  throw error2;
3799
3799
  });
@@ -7887,7 +7887,7 @@ var require_dist_node13 = __commonJS({
7887
7887
  ];
7888
7888
  function routeMatcher(paths) {
7889
7889
  const regexes = paths.map(
7890
- (path13) => path13.split("/").map((c7) => c7.startsWith("{") ? "(?:.+?)" : c7).join("/")
7890
+ (path15) => path15.split("/").map((c7) => c7.startsWith("{") ? "(?:.+?)" : c7).join("/")
7891
7891
  );
7892
7892
  const regex2 = `^(?:${regexes.map((r6) => `(?:${r6})`).join("|")})[^/]*$`;
7893
7893
  return new RegExp(regex2, "i");
@@ -8089,7 +8089,6 @@ var init_types = __esm({
8089
8089
  "number",
8090
8090
  "boolean",
8091
8091
  "datetime",
8092
- "rich-text",
8093
8092
  "markdown",
8094
8093
  "mdx",
8095
8094
  "code"
@@ -8518,8 +8517,8 @@ var init_parseUtil = __esm({
8518
8517
  init_errors();
8519
8518
  init_en();
8520
8519
  makeIssue = (params) => {
8521
- const { data: data2, path: path13, errorMaps, issueData } = params;
8522
- const fullPath = [...path13, ...issueData.path || []];
8520
+ const { data: data2, path: path15, errorMaps, issueData } = params;
8521
+ const fullPath = [...path15, ...issueData.path || []];
8523
8522
  const fullIssue = {
8524
8523
  ...issueData,
8525
8524
  path: fullPath
@@ -8827,11 +8826,11 @@ var init_types2 = __esm({
8827
8826
  init_parseUtil();
8828
8827
  init_util2();
8829
8828
  ParseInputLazyPath = class {
8830
- constructor(parent, value, path13, key) {
8829
+ constructor(parent, value, path15, key) {
8831
8830
  this._cachedPath = [];
8832
8831
  this.parent = parent;
8833
8832
  this.data = value;
8834
- this._path = path13;
8833
+ this._path = path15;
8835
8834
  this._key = key;
8836
8835
  }
8837
8836
  get path() {
@@ -12509,8 +12508,8 @@ var init_permissions = __esm({
12509
12508
  });
12510
12509
 
12511
12510
  // ../canopycms/src/paths/normalize.ts
12512
- function normalizeFilesystemPath(path13) {
12513
- return path13.split(/[\\/]+/).filter(Boolean).join("/");
12511
+ function normalizeFilesystemPath(path15) {
12512
+ return path15.split(/[\\/]+/).filter(Boolean).join("/");
12514
12513
  }
12515
12514
  var init_normalize = __esm({
12516
12515
  "../canopycms/src/paths/normalize.ts"() {
@@ -12536,12 +12535,21 @@ var init_flatten = __esm({
12536
12535
  }
12537
12536
  });
12538
12537
 
12538
+ // ../canopycms/src/operating-mode/mode-env.ts
12539
+ var init_mode_env = __esm({
12540
+ "../canopycms/src/operating-mode/mode-env.ts"() {
12541
+ "use strict";
12542
+ init_logger();
12543
+ }
12544
+ });
12545
+
12539
12546
  // ../canopycms/src/config/validation.ts
12540
12547
  var init_validation = __esm({
12541
12548
  "../canopycms/src/config/validation.ts"() {
12542
12549
  "use strict";
12543
12550
  init_config2();
12544
12551
  init_flatten();
12552
+ init_mode_env();
12545
12553
  }
12546
12554
  });
12547
12555
 
@@ -12594,6 +12602,7 @@ var init_operating_mode = __esm({
12594
12602
  init_client_safe_strategy();
12595
12603
  init_client_unsafe_strategy();
12596
12604
  init_deployment_name();
12605
+ init_mode_env();
12597
12606
  }
12598
12607
  });
12599
12608
 
@@ -13650,9 +13659,9 @@ var init_createPaginator = __esm({
13650
13659
  command = withCommand(command) ?? command;
13651
13660
  return await client.send(command, ...args);
13652
13661
  };
13653
- get = (fromObject, path13) => {
13662
+ get = (fromObject, path15) => {
13654
13663
  let cursor2 = fromObject;
13655
- const pathComponents = path13.split(".");
13664
+ const pathComponents = path15.split(".");
13656
13665
  for (const step of pathComponents) {
13657
13666
  if (!cursor2 || typeof cursor2 !== "object") {
13658
13667
  return void 0;
@@ -14670,12 +14679,12 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
14670
14679
  const password = request.password ?? "";
14671
14680
  auth = `${username}:${password}`;
14672
14681
  }
14673
- let path13 = request.path;
14682
+ let path15 = request.path;
14674
14683
  if (queryString) {
14675
- path13 += `?${queryString}`;
14684
+ path15 += `?${queryString}`;
14676
14685
  }
14677
14686
  if (request.fragment) {
14678
- path13 += `#${request.fragment}`;
14687
+ path15 += `#${request.fragment}`;
14679
14688
  }
14680
14689
  let hostname = request.hostname ?? "";
14681
14690
  if (hostname[0] === "[" && hostname.endsWith("]")) {
@@ -14687,7 +14696,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
14687
14696
  headers: request.headers,
14688
14697
  host: hostname,
14689
14698
  method: request.method,
14690
- path: path13,
14699
+ path: path15,
14691
14700
  port: request.port,
14692
14701
  agent,
14693
14702
  auth
@@ -14970,16 +14979,16 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
14970
14979
  reject(err);
14971
14980
  };
14972
14981
  const queryString = querystringBuilder.buildQueryString(query || {});
14973
- let path13 = request.path;
14982
+ let path15 = request.path;
14974
14983
  if (queryString) {
14975
- path13 += `?${queryString}`;
14984
+ path15 += `?${queryString}`;
14976
14985
  }
14977
14986
  if (request.fragment) {
14978
- path13 += `#${request.fragment}`;
14987
+ path15 += `#${request.fragment}`;
14979
14988
  }
14980
14989
  const req = session.request({
14981
14990
  ...request.headers,
14982
- [http2.constants.HTTP2_HEADER_PATH]: path13,
14991
+ [http2.constants.HTTP2_HEADER_PATH]: path15,
14983
14992
  [http2.constants.HTTP2_HEADER_METHOD]: method
14984
14993
  });
14985
14994
  session.ref();
@@ -15166,13 +15175,13 @@ var require_dist_cjs14 = __commonJS({
15166
15175
  const abortError = buildAbortError(abortSignal);
15167
15176
  return Promise.reject(abortError);
15168
15177
  }
15169
- let path13 = request.path;
15178
+ let path15 = request.path;
15170
15179
  const queryString = querystringBuilder.buildQueryString(request.query || {});
15171
15180
  if (queryString) {
15172
- path13 += `?${queryString}`;
15181
+ path15 += `?${queryString}`;
15173
15182
  }
15174
15183
  if (request.fragment) {
15175
- path13 += `#${request.fragment}`;
15184
+ path15 += `#${request.fragment}`;
15176
15185
  }
15177
15186
  let auth = "";
15178
15187
  if (request.username != null || request.password != null) {
@@ -15181,7 +15190,7 @@ var require_dist_cjs14 = __commonJS({
15181
15190
  auth = `${username}:${password}@`;
15182
15191
  }
15183
15192
  const { port, method } = request;
15184
- const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path13}`;
15193
+ const url = `${request.protocol}//${auth}${request.hostname}${port ? `:${port}` : ""}${path15}`;
15185
15194
  const body = method === "GET" || method === "HEAD" ? void 0 : request.body;
15186
15195
  const requestOptions = {
15187
15196
  body,
@@ -17413,13 +17422,13 @@ function __disposeResources(env) {
17413
17422
  }
17414
17423
  return next();
17415
17424
  }
17416
- function __rewriteRelativeImportExtension(path13, preserveJsx) {
17417
- if (typeof path13 === "string" && /^\.\.?\//.test(path13)) {
17418
- return path13.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m5, tsx, d5, ext, cm) {
17425
+ function __rewriteRelativeImportExtension(path15, preserveJsx) {
17426
+ if (typeof path15 === "string" && /^\.\.?\//.test(path15)) {
17427
+ return path15.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m5, tsx, d5, ext, cm) {
17419
17428
  return tsx ? preserveJsx ? ".jsx" : ".js" : d5 && (!ext || !cm) ? m5 : d5 + ext + "." + cm.toLowerCase() + "js";
17420
17429
  });
17421
17430
  }
17422
- return path13;
17431
+ return path15;
17423
17432
  }
17424
17433
  var extendStatics, __assign, __createBinding, __setModuleDefault, ownKeys, _SuppressedError, tslib_es6_default;
17425
17434
  var init_tslib_es6 = __esm({
@@ -18317,11 +18326,11 @@ var init_HttpBindingProtocol = __esm({
18317
18326
  const opTraits = translateTraits(operationSchema.traits);
18318
18327
  if (opTraits.http) {
18319
18328
  request.method = opTraits.http[0];
18320
- const [path13, search] = opTraits.http[1].split("?");
18329
+ const [path15, search] = opTraits.http[1].split("?");
18321
18330
  if (request.path == "/") {
18322
- request.path = path13;
18331
+ request.path = path15;
18323
18332
  } else {
18324
- request.path += path13;
18333
+ request.path += path15;
18325
18334
  }
18326
18335
  const traitSearchParams = new URLSearchParams(search ?? "");
18327
18336
  Object.assign(query, Object.fromEntries(traitSearchParams));
@@ -18724,8 +18733,8 @@ var init_requestBuilder = __esm({
18724
18733
  return this;
18725
18734
  }
18726
18735
  p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
18727
- this.resolvePathStack.push((path13) => {
18728
- this.path = resolvedPath(path13, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
18736
+ this.resolvePathStack.push((path15) => {
18737
+ this.path = resolvedPath(path15, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
18729
18738
  });
18730
18739
  return this;
18731
18740
  }
@@ -19375,18 +19384,18 @@ var require_dist_cjs20 = __commonJS({
19375
19384
  }
19376
19385
  };
19377
19386
  var booleanEquals = (value1, value2) => value1 === value2;
19378
- var getAttrPathList = (path13) => {
19379
- const parts = path13.split(".");
19387
+ var getAttrPathList = (path15) => {
19388
+ const parts = path15.split(".");
19380
19389
  const pathList = [];
19381
19390
  for (const part of parts) {
19382
19391
  const squareBracketIndex = part.indexOf("[");
19383
19392
  if (squareBracketIndex !== -1) {
19384
19393
  if (part.indexOf("]") !== part.length - 1) {
19385
- throw new EndpointError(`Path: '${path13}' does not end with ']'`);
19394
+ throw new EndpointError(`Path: '${path15}' does not end with ']'`);
19386
19395
  }
19387
19396
  const arrayIndex = part.slice(squareBracketIndex + 1, -1);
19388
19397
  if (Number.isNaN(parseInt(arrayIndex))) {
19389
- throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path13}'`);
19398
+ throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path15}'`);
19390
19399
  }
19391
19400
  if (squareBracketIndex !== 0) {
19392
19401
  pathList.push(part.slice(0, squareBracketIndex));
@@ -19398,9 +19407,9 @@ var require_dist_cjs20 = __commonJS({
19398
19407
  }
19399
19408
  return pathList;
19400
19409
  };
19401
- var getAttr = (value, path13) => getAttrPathList(path13).reduce((acc, index) => {
19410
+ var getAttr = (value, path15) => getAttrPathList(path15).reduce((acc, index) => {
19402
19411
  if (typeof acc !== "object") {
19403
- throw new EndpointError(`Index '${index}' in '${path13}' not found in '${JSON.stringify(value)}'`);
19412
+ throw new EndpointError(`Index '${index}' in '${path15}' not found in '${JSON.stringify(value)}'`);
19404
19413
  } else if (Array.isArray(acc)) {
19405
19414
  return acc[parseInt(index)];
19406
19415
  }
@@ -19419,8 +19428,8 @@ var require_dist_cjs20 = __commonJS({
19419
19428
  return value;
19420
19429
  }
19421
19430
  if (typeof value === "object" && "hostname" in value) {
19422
- const { hostname: hostname2, port, protocol: protocol2 = "", path: path13 = "", query = {} } = value;
19423
- const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path13}`);
19431
+ const { hostname: hostname2, port, protocol: protocol2 = "", path: path15 = "", query = {} } = value;
19432
+ const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path15}`);
19424
19433
  url.search = Object.entries(query).map(([k6, v5]) => `${k6}=${v5}`).join("&");
19425
19434
  return url;
19426
19435
  }
@@ -20865,10 +20874,10 @@ ${longDate}
20865
20874
  ${credentialScope}
20866
20875
  ${utilHexEncoding.toHex(hashedRequest)}`;
20867
20876
  }
20868
- getCanonicalPath({ path: path13 }) {
20877
+ getCanonicalPath({ path: path15 }) {
20869
20878
  if (this.uriEscapePath) {
20870
20879
  const normalizedPathSegments = [];
20871
- for (const pathSegment of path13.split("/")) {
20880
+ for (const pathSegment of path15.split("/")) {
20872
20881
  if (pathSegment?.length === 0)
20873
20882
  continue;
20874
20883
  if (pathSegment === ".")
@@ -20879,11 +20888,11 @@ ${utilHexEncoding.toHex(hashedRequest)}`;
20879
20888
  normalizedPathSegments.push(pathSegment);
20880
20889
  }
20881
20890
  }
20882
- const normalizedPath = `${path13?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path13?.endsWith("/") ? "/" : ""}`;
20891
+ const normalizedPath = `${path15?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path15?.endsWith("/") ? "/" : ""}`;
20883
20892
  const doubleEncoded = utilUriEscape.escapeUri(normalizedPath);
20884
20893
  return doubleEncoded.replace(/%2F/g, "/");
20885
20894
  }
20886
- return path13;
20895
+ return path15;
20887
20896
  }
20888
20897
  validateResolvedCredentials(credentials) {
20889
20898
  if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") {
@@ -22187,11 +22196,11 @@ var init_SmithyRpcV2CborProtocol = __esm({
22187
22196
  }
22188
22197
  }
22189
22198
  const { service, operation: operation2 } = (0, import_util_middleware5.getSmithyContext)(context);
22190
- const path13 = `/service/${service}/operation/${operation2}`;
22199
+ const path15 = `/service/${service}/operation/${operation2}`;
22191
22200
  if (request.path.endsWith("/")) {
22192
- request.path += path13.slice(1);
22201
+ request.path += path15.slice(1);
22193
22202
  } else {
22194
- request.path += path13;
22203
+ request.path += path15;
22195
22204
  }
22196
22205
  return request;
22197
22206
  }
@@ -27836,14 +27845,14 @@ var require_readFile = __commonJS({
27836
27845
  var promises_1 = __require("node:fs/promises");
27837
27846
  exports.filePromises = {};
27838
27847
  exports.fileIntercept = {};
27839
- var readFile = (path13, options) => {
27840
- if (exports.fileIntercept[path13] !== void 0) {
27841
- return exports.fileIntercept[path13];
27848
+ var readFile = (path15, options) => {
27849
+ if (exports.fileIntercept[path15] !== void 0) {
27850
+ return exports.fileIntercept[path15];
27842
27851
  }
27843
- if (!exports.filePromises[path13] || options?.ignoreCache) {
27844
- exports.filePromises[path13] = (0, promises_1.readFile)(path13, "utf8");
27852
+ if (!exports.filePromises[path15] || options?.ignoreCache) {
27853
+ exports.filePromises[path15] = (0, promises_1.readFile)(path15, "utf8");
27845
27854
  }
27846
- return exports.filePromises[path13];
27855
+ return exports.filePromises[path15];
27847
27856
  };
27848
27857
  exports.readFile = readFile;
27849
27858
  }
@@ -27856,7 +27865,7 @@ var require_dist_cjs33 = __commonJS({
27856
27865
  var getHomeDir = require_getHomeDir();
27857
27866
  var getSSOTokenFilepath = require_getSSOTokenFilepath();
27858
27867
  var getSSOTokenFromFile = require_getSSOTokenFromFile();
27859
- var path13 = __require("path");
27868
+ var path15 = __require("path");
27860
27869
  var types = require_dist_cjs();
27861
27870
  var readFile = require_readFile();
27862
27871
  var ENV_PROFILE = "AWS_PROFILE";
@@ -27878,9 +27887,9 @@ var require_dist_cjs33 = __commonJS({
27878
27887
  ...data2.default && { default: data2.default }
27879
27888
  });
27880
27889
  var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
27881
- var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path13.join(getHomeDir.getHomeDir(), ".aws", "config");
27890
+ var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path15.join(getHomeDir.getHomeDir(), ".aws", "config");
27882
27891
  var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
27883
- var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path13.join(getHomeDir.getHomeDir(), ".aws", "credentials");
27892
+ var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path15.join(getHomeDir.getHomeDir(), ".aws", "credentials");
27884
27893
  var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
27885
27894
  var profileNameBlockList = ["__proto__", "profile __proto__"];
27886
27895
  var parseIni = (iniData) => {
@@ -27935,11 +27944,11 @@ var require_dist_cjs33 = __commonJS({
27935
27944
  const relativeHomeDirPrefix = "~/";
27936
27945
  let resolvedFilepath = filepath;
27937
27946
  if (filepath.startsWith(relativeHomeDirPrefix)) {
27938
- resolvedFilepath = path13.join(homeDir, filepath.slice(2));
27947
+ resolvedFilepath = path15.join(homeDir, filepath.slice(2));
27939
27948
  }
27940
27949
  let resolvedConfigFilepath = configFilepath;
27941
27950
  if (configFilepath.startsWith(relativeHomeDirPrefix)) {
27942
- resolvedConfigFilepath = path13.join(homeDir, configFilepath.slice(2));
27951
+ resolvedConfigFilepath = path15.join(homeDir, configFilepath.slice(2));
27943
27952
  }
27944
27953
  const parsedFiles = await Promise.all([
27945
27954
  readFile.readFile(resolvedConfigFilepath, {
@@ -27978,8 +27987,8 @@ var require_dist_cjs33 = __commonJS({
27978
27987
  getFileRecord() {
27979
27988
  return readFile.fileIntercept;
27980
27989
  },
27981
- interceptFile(path14, contents) {
27982
- readFile.fileIntercept[path14] = Promise.resolve(contents);
27990
+ interceptFile(path16, contents) {
27991
+ readFile.fileIntercept[path16] = Promise.resolve(contents);
27983
27992
  },
27984
27993
  getTokenRecord() {
27985
27994
  return getSSOTokenFromFile.tokenIntercept;
@@ -28304,8 +28313,8 @@ var require_dist_cjs36 = __commonJS({
28304
28313
  return endpoint.url.href;
28305
28314
  }
28306
28315
  if ("hostname" in endpoint) {
28307
- const { protocol, hostname, port, path: path13 } = endpoint;
28308
- return `${protocol}//${hostname}${port ? ":" + port : ""}${path13}`;
28316
+ const { protocol, hostname, port, path: path15 } = endpoint;
28317
+ return `${protocol}//${hostname}${port ? ":" + port : ""}${path15}`;
28309
28318
  }
28310
28319
  }
28311
28320
  return endpoint;
@@ -36502,8 +36511,8 @@ var require_dist_cjs53 = __commonJS({
36502
36511
  });
36503
36512
 
36504
36513
  // ../canopycms/src/worker/cms-worker.ts
36505
- import fs7 from "node:fs/promises";
36506
- import path10 from "node:path";
36514
+ import fs8 from "node:fs/promises";
36515
+ import path12 from "node:path";
36507
36516
 
36508
36517
  // ../../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
36509
36518
  var import_file_exists = __toESM(require_dist(), 1);
@@ -37094,8 +37103,8 @@ function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
37094
37103
  function forEachLineWithContent(input, callback) {
37095
37104
  return toLinesWithContent(input, true).map((line) => callback(line));
37096
37105
  }
37097
- function folderExists(path13) {
37098
- return (0, import_file_exists.exists)(path13, import_file_exists.FOLDER);
37106
+ function folderExists(path15) {
37107
+ return (0, import_file_exists.exists)(path15, import_file_exists.FOLDER);
37099
37108
  }
37100
37109
  function append(target, item) {
37101
37110
  if (Array.isArray(target)) {
@@ -37497,8 +37506,8 @@ function checkIsRepoRootTask() {
37497
37506
  commands: commands5,
37498
37507
  format: "utf-8",
37499
37508
  onError,
37500
- parser(path13) {
37501
- return /^\.(git)?$/.test(path13.trim());
37509
+ parser(path15) {
37510
+ return /^\.(git)?$/.test(path15.trim());
37502
37511
  }
37503
37512
  };
37504
37513
  }
@@ -37932,11 +37941,11 @@ function parseGrep(grep) {
37932
37941
  const paths = /* @__PURE__ */ new Set();
37933
37942
  const results = {};
37934
37943
  forEachLineWithContent(grep, (input) => {
37935
- const [path13, line, preview] = input.split(NULL);
37936
- paths.add(path13);
37937
- (results[path13] = results[path13] || []).push({
37944
+ const [path15, line, preview] = input.split(NULL);
37945
+ paths.add(path15);
37946
+ (results[path15] = results[path15] || []).push({
37938
37947
  line: asNumber(line),
37939
- path: path13,
37948
+ path: path15,
37940
37949
  preview
37941
37950
  });
37942
37951
  });
@@ -38700,14 +38709,14 @@ var init_hash_object = __esm2({
38700
38709
  init_task();
38701
38710
  }
38702
38711
  });
38703
- function parseInit(bare, path13, text) {
38712
+ function parseInit(bare, path15, text) {
38704
38713
  const response = String(text).trim();
38705
38714
  let result;
38706
38715
  if (result = initResponseRegex.exec(response)) {
38707
- return new InitSummary(bare, path13, false, result[1]);
38716
+ return new InitSummary(bare, path15, false, result[1]);
38708
38717
  }
38709
38718
  if (result = reInitResponseRegex.exec(response)) {
38710
- return new InitSummary(bare, path13, true, result[1]);
38719
+ return new InitSummary(bare, path15, true, result[1]);
38711
38720
  }
38712
38721
  let gitDir = "";
38713
38722
  const tokens = response.split(" ");
@@ -38718,7 +38727,7 @@ function parseInit(bare, path13, text) {
38718
38727
  break;
38719
38728
  }
38720
38729
  }
38721
- return new InitSummary(bare, path13, /^re/i.test(response), gitDir);
38730
+ return new InitSummary(bare, path15, /^re/i.test(response), gitDir);
38722
38731
  }
38723
38732
  var InitSummary;
38724
38733
  var initResponseRegex;
@@ -38727,9 +38736,9 @@ var init_InitSummary = __esm2({
38727
38736
  "src/lib/responses/InitSummary.ts"() {
38728
38737
  "use strict";
38729
38738
  InitSummary = class {
38730
- constructor(bare, path13, existing, gitDir) {
38739
+ constructor(bare, path15, existing, gitDir) {
38731
38740
  this.bare = bare;
38732
- this.path = path13;
38741
+ this.path = path15;
38733
38742
  this.existing = existing;
38734
38743
  this.gitDir = gitDir;
38735
38744
  }
@@ -38741,7 +38750,7 @@ var init_InitSummary = __esm2({
38741
38750
  function hasBareCommand(command) {
38742
38751
  return command.includes(bareCommand);
38743
38752
  }
38744
- function initTask(bare = false, path13, customArgs) {
38753
+ function initTask(bare = false, path15, customArgs) {
38745
38754
  const commands5 = ["init", ...customArgs];
38746
38755
  if (bare && !hasBareCommand(commands5)) {
38747
38756
  commands5.splice(1, 0, bareCommand);
@@ -38750,7 +38759,7 @@ function initTask(bare = false, path13, customArgs) {
38750
38759
  commands: commands5,
38751
38760
  format: "utf-8",
38752
38761
  parser(text) {
38753
- return parseInit(commands5.includes("--bare"), path13, text);
38762
+ return parseInit(commands5.includes("--bare"), path15, text);
38754
38763
  }
38755
38764
  };
38756
38765
  }
@@ -39565,12 +39574,12 @@ var init_FileStatusSummary = __esm2({
39565
39574
  "use strict";
39566
39575
  fromPathRegex = /^(.+)\0(.+)$/;
39567
39576
  FileStatusSummary = class {
39568
- constructor(path13, index, working_dir) {
39569
- this.path = path13;
39577
+ constructor(path15, index, working_dir) {
39578
+ this.path = path15;
39570
39579
  this.index = index;
39571
39580
  this.working_dir = working_dir;
39572
39581
  if (index === "R" || working_dir === "R") {
39573
- const detail = fromPathRegex.exec(path13) || [null, path13, path13];
39582
+ const detail = fromPathRegex.exec(path15) || [null, path15, path15];
39574
39583
  this.from = detail[2] || "";
39575
39584
  this.path = detail[1] || "";
39576
39585
  }
@@ -39601,14 +39610,14 @@ function splitLine(result, lineStr) {
39601
39610
  default:
39602
39611
  return;
39603
39612
  }
39604
- function data2(index, workingDir, path13) {
39613
+ function data2(index, workingDir, path15) {
39605
39614
  const raw = `${index}${workingDir}`;
39606
39615
  const handler = parsers6.get(raw);
39607
39616
  if (handler) {
39608
- handler(result, path13);
39617
+ handler(result, path15);
39609
39618
  }
39610
39619
  if (raw !== "##" && raw !== "!!") {
39611
- result.files.push(new FileStatusSummary(path13, index, workingDir));
39620
+ result.files.push(new FileStatusSummary(path15, index, workingDir));
39612
39621
  }
39613
39622
  }
39614
39623
  }
@@ -39959,9 +39968,9 @@ var init_simple_git_api = __esm2({
39959
39968
  next
39960
39969
  );
39961
39970
  }
39962
- hashObject(path13, write) {
39971
+ hashObject(path15, write) {
39963
39972
  return this._runTask(
39964
- hashObjectTask(path13, write === true),
39973
+ hashObjectTask(path15, write === true),
39965
39974
  trailingFunctionArgument(arguments)
39966
39975
  );
39967
39976
  }
@@ -40315,8 +40324,8 @@ var init_branch = __esm2({
40315
40324
  }
40316
40325
  });
40317
40326
  function toPath(input) {
40318
- const path13 = input.trim().replace(/^["']|["']$/g, "");
40319
- return path13 && normalize(path13);
40327
+ const path15 = input.trim().replace(/^["']|["']$/g, "");
40328
+ return path15 && normalize(path15);
40320
40329
  }
40321
40330
  var parseCheckIgnore;
40322
40331
  var init_CheckIgnore = __esm2({
@@ -40601,8 +40610,8 @@ __export2(sub_module_exports, {
40601
40610
  subModuleTask: () => subModuleTask,
40602
40611
  updateSubModuleTask: () => updateSubModuleTask
40603
40612
  });
40604
- function addSubModuleTask(repo, path13) {
40605
- return subModuleTask(["add", repo, path13]);
40613
+ function addSubModuleTask(repo, path15) {
40614
+ return subModuleTask(["add", repo, path15]);
40606
40615
  }
40607
40616
  function initSubModuleTask(customArgs) {
40608
40617
  return subModuleTask(["init", ...customArgs]);
@@ -40916,8 +40925,8 @@ var require_git = __commonJS2({
40916
40925
  }
40917
40926
  return this._runTask(straightThroughStringTask2(command, this._trimmed), next);
40918
40927
  };
40919
- Git2.prototype.submoduleAdd = function(repo, path13, then) {
40920
- return this._runTask(addSubModuleTask2(repo, path13), trailingFunctionArgument2(arguments));
40928
+ Git2.prototype.submoduleAdd = function(repo, path15, then) {
40929
+ return this._runTask(addSubModuleTask2(repo, path15), trailingFunctionArgument2(arguments));
40921
40930
  };
40922
40931
  Git2.prototype.submoduleUpdate = function(args, then) {
40923
40932
  return this._runTask(
@@ -42613,6 +42622,7 @@ var import_short_uuid = __toESM(require_dist3(), 1);
42613
42622
  var isValidId = isValidContentId;
42614
42623
 
42615
42624
  // ../canopycms/src/content-id-index.ts
42625
+ init_logger();
42616
42626
  function extractIdFromFilename(filename) {
42617
42627
  if (filename.startsWith(".")) {
42618
42628
  return null;
@@ -42733,6 +42743,16 @@ function isStaleLeaseRejection(message) {
42733
42743
 
42734
42744
  // ../canopycms/src/utils/provisioning-lock.ts
42735
42745
  var import_proper_lockfile2 = __toESM(require_proper_lockfile(), 1);
42746
+ import fs7 from "node:fs/promises";
42747
+ import path9 from "node:path";
42748
+ async function tryAcquireProvisioningLock(lockTargetDir2, lockName) {
42749
+ await fs7.mkdir(lockTargetDir2, { recursive: true });
42750
+ return import_proper_lockfile2.default.lock(lockTargetDir2, {
42751
+ lockfilePath: path9.join(lockTargetDir2, lockName),
42752
+ retries: 0,
42753
+ stale: 3e4
42754
+ });
42755
+ }
42736
42756
 
42737
42757
  // ../canopycms/src/git-manager.ts
42738
42758
  var log4 = createDebugLogger({ prefix: "GitManager" });
@@ -42759,11 +42779,22 @@ var GITHUB_TRACKING_REF_PREFIX = "refs/remotes/github/";
42759
42779
  // ../canopycms/src/worker/cms-worker.ts
42760
42780
  init_deployment_name();
42761
42781
 
42782
+ // ../canopycms/src/utils/content-write-lock.ts
42783
+ import path10 from "node:path";
42784
+ var META_DIR2 = ".canopy-meta";
42785
+ var CONTENT_WRITE_LOCK_NAME = "content-write.lock";
42786
+ function lockTargetDir(branchRoot) {
42787
+ return path10.join(path10.resolve(branchRoot), META_DIR2);
42788
+ }
42789
+ function tryAcquireContentWriteLock(branchRoot) {
42790
+ return tryAcquireProvisioningLock(lockTargetDir(branchRoot), CONTENT_WRITE_LOCK_NAME);
42791
+ }
42792
+
42762
42793
  // ../canopycms/src/worker/worker-status.ts
42763
- import path9 from "node:path";
42794
+ import path11 from "node:path";
42764
42795
  var WORKER_STATUS_FILE = "worker-status.json";
42765
42796
  async function writeWorkerStatus(taskDir, report) {
42766
- const filePath = path9.join(taskDir, WORKER_STATUS_FILE);
42797
+ const filePath = path11.join(taskDir, WORKER_STATUS_FILE);
42767
42798
  const stamped = { ...report, updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
42768
42799
  await atomicWriteFile(filePath, JSON.stringify(stamped, null, 2));
42769
42800
  }
@@ -42858,15 +42889,15 @@ var CmsWorker = class {
42858
42889
  this.releaseLockFn = null;
42859
42890
  this.log = cmsTaskQueueLogger;
42860
42891
  this.octokit = createCanopyOctokit({ auth: config.githubToken });
42861
- this.taskDir = path10.join(config.workspacePath, ".tasks");
42862
- this.remoteGitPath = path10.join(config.workspacePath, "remote.git");
42863
- this.contentBranchesPath = path10.join(config.workspacePath, "content-branches");
42892
+ this.taskDir = path12.join(config.workspacePath, ".tasks");
42893
+ this.remoteGitPath = path12.join(config.workspacePath, "remote.git");
42894
+ this.contentBranchesPath = path12.join(config.workspacePath, "content-branches");
42864
42895
  this.baseBranch = config.baseBranch ?? "main";
42865
42896
  this.sanitizedBaseBranch = sanitizeBranchName(this.baseBranch);
42866
42897
  this.maxTasksPerCycle = config.maxTasksPerCycle ?? 10;
42867
42898
  this.taskTimeoutMs = config.taskTimeoutMs ?? DEFAULT_TASK_TIMEOUT;
42868
42899
  this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES2;
42869
- this.lockFilePath = path10.join(config.workspacePath, ".tasks", ".worker-lock");
42900
+ this.lockFilePath = path12.join(config.workspacePath, ".tasks", ".worker-lock");
42870
42901
  this.lockStaleMs = config.lockStaleMs ?? DEFAULT_LOCK_STALE_MS;
42871
42902
  this.contentRoot = config.contentRoot ?? "content";
42872
42903
  }
@@ -43017,7 +43048,7 @@ var CmsWorker = class {
43017
43048
  * negligible, but a host with a badly wrong clock could misjudge liveness.
43018
43049
  */
43019
43050
  async acquireLock() {
43020
- await fs7.mkdir(this.taskDir, { recursive: true });
43051
+ await fs8.mkdir(this.taskDir, { recursive: true });
43021
43052
  try {
43022
43053
  this.releaseLockFn = await import_proper_lockfile3.default.lock(this.taskDir, {
43023
43054
  lockfilePath: this.lockFilePath,
@@ -43111,7 +43142,7 @@ var CmsWorker = class {
43111
43142
  async ensureRemoteGit() {
43112
43143
  let exists2;
43113
43144
  try {
43114
- await fs7.stat(this.remoteGitPath);
43145
+ await fs8.stat(this.remoteGitPath);
43115
43146
  exists2 = true;
43116
43147
  } catch {
43117
43148
  exists2 = false;
@@ -43136,7 +43167,7 @@ var CmsWorker = class {
43136
43167
  workerLogError(
43137
43168
  `remote.git base branch verification failed after clone: ${getErrorMessage2(err)}`
43138
43169
  );
43139
- await fs7.rm(this.remoteGitPath, { recursive: true, force: true });
43170
+ await fs8.rm(this.remoteGitPath, { recursive: true, force: true });
43140
43171
  throw new Error(
43141
43172
  `remote.git clone of ${this.config.githubOwner}/${this.config.githubRepo} has no branch '${this.baseBranch}' - the GitHub repository is empty or the base branch does not exist. Push an initial commit to '${this.baseBranch}' and restart the worker (systemd will retry automatically).`
43142
43173
  );
@@ -43352,7 +43383,7 @@ var CmsWorker = class {
43352
43383
  if (!branch) return;
43353
43384
  const branchPath = this.branchWorkspacePath(branch);
43354
43385
  try {
43355
- await fs7.stat(branchPath);
43386
+ await fs8.stat(branchPath);
43356
43387
  } catch {
43357
43388
  return;
43358
43389
  }
@@ -43396,7 +43427,7 @@ var CmsWorker = class {
43396
43427
  if (!branch) return;
43397
43428
  const branchPath = this.branchWorkspacePath(branch);
43398
43429
  try {
43399
- await fs7.stat(branchPath);
43430
+ await fs8.stat(branchPath);
43400
43431
  } catch {
43401
43432
  return;
43402
43433
  }
@@ -43432,7 +43463,7 @@ var CmsWorker = class {
43432
43463
  * is sanitized.
43433
43464
  */
43434
43465
  branchWorkspacePath(branchRefName) {
43435
- return path10.join(this.contentBranchesPath, sanitizeBranchName(branchRefName));
43466
+ return path12.join(this.contentBranchesPath, sanitizeBranchName(branchRefName));
43436
43467
  }
43437
43468
  /**
43438
43469
  * What `remote.git` currently holds for `branchRef`, or null when this
@@ -43859,7 +43890,7 @@ var CmsWorker = class {
43859
43890
  */
43860
43891
  async hasPendingHistoryRewrite(branchName) {
43861
43892
  try {
43862
- const branchPath = path10.join(this.contentBranchesPath, sanitizeBranchName(branchName));
43893
+ const branchPath = path12.join(this.contentBranchesPath, sanitizeBranchName(branchName));
43863
43894
  const metaFile = await BranchMetadataFileManager.loadOnly(branchPath);
43864
43895
  return typeof metaFile?.branch.historyRewrittenFrom === "string";
43865
43896
  } catch {
@@ -43902,6 +43933,7 @@ var CmsWorker = class {
43902
43933
  durationMs: Date.now() - cycleStartedAt,
43903
43934
  rebased: rebaseSummary.rebased,
43904
43935
  skippedDirty: rebaseSummary.skippedDirty,
43936
+ skippedLocked: rebaseSummary.skippedLocked,
43905
43937
  failed: rebaseSummary.failed,
43906
43938
  tracked: trackedSummary
43907
43939
  };
@@ -43933,7 +43965,7 @@ var CmsWorker = class {
43933
43965
  async cleanupTrashedBranchDirs() {
43934
43966
  let entries;
43935
43967
  try {
43936
- entries = await fs7.readdir(this.contentBranchesPath);
43968
+ entries = await fs8.readdir(this.contentBranchesPath);
43937
43969
  } catch (err) {
43938
43970
  if (isNodeError(err) && err.code === "ENOENT") return 0;
43939
43971
  throw err;
@@ -43954,7 +43986,7 @@ var CmsWorker = class {
43954
43986
  }
43955
43987
  if (now - stampDate.getTime() < TRASH_RETENTION_MS) continue;
43956
43988
  try {
43957
- await fs7.rm(path10.join(this.contentBranchesPath, name), {
43989
+ await fs8.rm(path12.join(this.contentBranchesPath, name), {
43958
43990
  recursive: true,
43959
43991
  force: true,
43960
43992
  maxRetries: 3,
@@ -43992,12 +44024,12 @@ var CmsWorker = class {
43992
44024
  * untouched rather than force-resolved.
43993
44025
  */
43994
44026
  async refreshBaseBranchWorkspace() {
43995
- const basePath32 = path10.join(this.contentBranchesPath, this.sanitizedBaseBranch);
43996
- const gitDir = path10.join(basePath32, ".git");
44027
+ const basePath32 = path12.join(this.contentBranchesPath, this.sanitizedBaseBranch);
44028
+ const gitDir = path12.join(basePath32, ".git");
43997
44029
  try {
43998
44030
  let gitDirStat;
43999
44031
  try {
44000
- gitDirStat = await fs7.stat(gitDir);
44032
+ gitDirStat = await fs8.stat(gitDir);
44001
44033
  } catch {
44002
44034
  gitDirStat = null;
44003
44035
  }
@@ -44158,24 +44190,39 @@ var CmsWorker = class {
44158
44190
  workerLogWarn(` Failed to record rebase failure for ${branchDir}: ${getErrorMessage2(err)}`);
44159
44191
  }
44160
44192
  }
44193
+ /**
44194
+ * Test-only seam: awaited inside `rebaseActiveBranches()`'s conflict round,
44195
+ * after `git rebase` reported conflicted files and BEFORE the
44196
+ * `checkout --theirs` resolution loop overwrites them. No-op in production.
44197
+ *
44198
+ * A test subclass overrides this to land a real `ContentStore` write at
44199
+ * exactly the instant the rebase is mid-flight -- the window the old TOCTOU
44200
+ * comment above the dirty check wrongly called safe -- without any sleeps or
44201
+ * shell rendezvous. See the "Deterministic interleavings" testing pattern in
44202
+ * docs/concurrency.md, and `ContentStore.afterPrePassForTesting()` for the
44203
+ * same idiom on the write side.
44204
+ */
44205
+ async afterConflictDetectedForTesting() {
44206
+ }
44161
44207
  async rebaseActiveBranches() {
44162
44208
  const rebased = [];
44163
44209
  const skippedDirty = [];
44210
+ const skippedLocked = [];
44164
44211
  const failed = [];
44165
44212
  let branchDirs;
44166
44213
  try {
44167
- branchDirs = await fs7.readdir(this.contentBranchesPath);
44214
+ branchDirs = await fs8.readdir(this.contentBranchesPath);
44168
44215
  } catch {
44169
- return { rebased, skippedDirty, failed };
44216
+ return { rebased, skippedDirty, skippedLocked, failed };
44170
44217
  }
44171
44218
  for (const branchDir of branchDirs) {
44172
44219
  if (branchDir.startsWith(".") || branchDir === "branches.json") {
44173
44220
  continue;
44174
44221
  }
44175
- const branchPath = path10.join(this.contentBranchesPath, branchDir);
44176
- const gitDir = path10.join(branchPath, ".git");
44222
+ const branchPath = path12.join(this.contentBranchesPath, branchDir);
44223
+ const gitDir = path12.join(branchPath, ".git");
44177
44224
  try {
44178
- const stat = await fs7.stat(gitDir);
44225
+ const stat = await fs8.stat(gitDir);
44179
44226
  if (!stat.isDirectory()) {
44180
44227
  workerLog(` Skipping ${branchDir}: .git is not a directory`);
44181
44228
  continue;
@@ -44209,148 +44256,168 @@ var CmsWorker = class {
44209
44256
  config: ["core.editor=true"],
44210
44257
  unsafe: { allowUnsafeEditor: true }
44211
44258
  });
44212
- const dirtyCheck = await branchGit.status();
44213
- if (dirtyCheck.files.length > 0) {
44214
- workerLog(` Skipping ${branchDir}: has uncommitted changes`);
44215
- skippedDirty.push(branchDir);
44216
- continue;
44217
- }
44218
- const branchRef = (await branchGit.revparse(["--abbrev-ref", "HEAD"])).trim();
44219
- const canPublish = branchRef.length > 0 && branchRef !== "HEAD";
44220
- if (canPublish && metaFile?.branch.historyRewrittenFrom) {
44221
- await this.reconcilePendingRewrite({
44222
- branchPath,
44223
- branchDir,
44224
- branchRef,
44225
- headSha: (await branchGit.revparse(["HEAD"])).trim(),
44226
- marker: metaFile.branch.historyRewrittenFrom
44227
- });
44259
+ let releaseContentLock;
44260
+ try {
44261
+ releaseContentLock = await tryAcquireContentWriteLock(branchPath);
44262
+ } catch (lockErr) {
44263
+ if (isNodeError(lockErr) && lockErr.code === "ELOCKED") {
44264
+ workerLog(` Skipping ${branchDir}: content write in progress (retrying next cycle)`);
44265
+ skippedLocked.push(branchDir);
44266
+ continue;
44267
+ }
44268
+ throw lockErr;
44228
44269
  }
44229
- await branchGit.fetch("origin", this.baseBranch);
44230
- const fetchedBaseTip = (await branchGit.revparse(["FETCH_HEAD"])).trim();
44231
- const behindCount = parseInt(
44232
- (await branchGit.raw(["rev-list", "--count", `HEAD..${fetchedBaseTip}`])).trim(),
44233
- 10
44234
- );
44235
- const meta = getBranchMetadataFileManager(branchPath, this.contentBranchesPath);
44236
- if (behindCount === 0) {
44237
- const currentMeta = await BranchMetadataFileManager.loadOnly(branchPath);
44238
- const conflictStatus = currentMeta?.branch.conflictStatus;
44239
- const conflictFiles = currentMeta?.branch.conflictFiles;
44240
- const conflictAlreadyClean = (conflictStatus === void 0 || conflictStatus === "clean") && (conflictFiles === void 0 || conflictFiles.length === 0);
44241
- const alreadyClean = conflictAlreadyClean && currentMeta?.branch.rebaseFailure === void 0;
44242
- if (alreadyClean) {
44270
+ try {
44271
+ const dirtyCheck = await branchGit.status();
44272
+ if (dirtyCheck.files.length > 0) {
44273
+ workerLog(` Skipping ${branchDir}: has uncommitted changes`);
44274
+ skippedDirty.push(branchDir);
44243
44275
  continue;
44244
44276
  }
44277
+ const branchRef = (await branchGit.revparse(["--abbrev-ref", "HEAD"])).trim();
44278
+ const canPublish = branchRef.length > 0 && branchRef !== "HEAD";
44279
+ if (canPublish && metaFile?.branch.historyRewrittenFrom) {
44280
+ await this.reconcilePendingRewrite({
44281
+ branchPath,
44282
+ branchDir,
44283
+ branchRef,
44284
+ headSha: (await branchGit.revparse(["HEAD"])).trim(),
44285
+ marker: metaFile.branch.historyRewrittenFrom
44286
+ });
44287
+ }
44288
+ await branchGit.fetch("origin", this.baseBranch);
44289
+ const fetchedBaseTip = (await branchGit.revparse(["FETCH_HEAD"])).trim();
44290
+ const behindCount = parseInt(
44291
+ (await branchGit.raw(["rev-list", "--count", `HEAD..${fetchedBaseTip}`])).trim(),
44292
+ 10
44293
+ );
44294
+ const meta = getBranchMetadataFileManager(branchPath, this.contentBranchesPath);
44295
+ if (behindCount === 0) {
44296
+ const currentMeta = await BranchMetadataFileManager.loadOnly(branchPath);
44297
+ const conflictStatus = currentMeta?.branch.conflictStatus;
44298
+ const conflictFiles = currentMeta?.branch.conflictFiles;
44299
+ const conflictAlreadyClean = (conflictStatus === void 0 || conflictStatus === "clean") && (conflictFiles === void 0 || conflictFiles.length === 0);
44300
+ const alreadyClean = conflictAlreadyClean && currentMeta?.branch.rebaseFailure === void 0;
44301
+ if (alreadyClean) {
44302
+ continue;
44303
+ }
44304
+ await meta.save({
44305
+ branch: {
44306
+ name: branchDir,
44307
+ conflictStatus: "clean",
44308
+ conflictFiles: [],
44309
+ rebaseFailure: void 0
44310
+ }
44311
+ });
44312
+ continue;
44313
+ }
44314
+ workerLog(`Rebasing ${branchDir} (${behindCount} commits behind)...`);
44315
+ const preRebaseHead = (await branchGit.revparse(["HEAD"])).trim();
44316
+ const publishedSha = canPublish ? await this.readPublishedSha(branchRef) : null;
44317
+ const conflictedFiles = [];
44318
+ let nextAction = "start";
44319
+ let completed = false;
44320
+ let failureReason;
44321
+ const MAX_ROUNDS = 50;
44322
+ for (let round = 0; round < MAX_ROUNDS && !completed; round++) {
44323
+ try {
44324
+ if (nextAction === "start") {
44325
+ await branchGit.rebase([fetchedBaseTip]);
44326
+ } else if (nextAction === "continue") {
44327
+ await branchGit.rebase(["--continue"]);
44328
+ } else {
44329
+ await branchGit.rebase(["--skip"]);
44330
+ }
44331
+ completed = true;
44332
+ } catch (rebaseErr) {
44333
+ nextAction = "continue";
44334
+ const st = await branchGit.status();
44335
+ if (st.conflicted.length > 0) {
44336
+ await this.afterConflictDetectedForTesting();
44337
+ for (const file of st.conflicted) {
44338
+ await branchGit.raw(["checkout", "--theirs", file]);
44339
+ await branchGit.add(file);
44340
+ conflictedFiles.push(file);
44341
+ }
44342
+ } else {
44343
+ const msg = rebaseErr instanceof Error ? rebaseErr.message : "";
44344
+ if (msg.toLowerCase().includes("nothing to commit") || msg.toLowerCase().includes("apply --skip")) {
44345
+ nextAction = "skip";
44346
+ } else {
44347
+ workerLogWarn(
44348
+ ` Unexpected rebase error in ${branchDir}: ${msg || "Unknown error"}`
44349
+ );
44350
+ failureReason = msg || "Unknown error";
44351
+ await branchGit.rebase(["--abort"]).catch(() => {
44352
+ });
44353
+ break;
44354
+ }
44355
+ }
44356
+ }
44357
+ }
44358
+ if (!completed) {
44359
+ workerLogWarn(
44360
+ failureReason !== void 0 ? ` Rebase of ${branchDir} aborted due to unexpected error: ${failureReason}` : ` Rebase of ${branchDir} did not complete within ${MAX_ROUNDS} rounds, aborting`
44361
+ );
44362
+ await branchGit.rebase(["--abort"]).catch(() => {
44363
+ });
44364
+ const rebaseFailureMessage = failureReason ?? `did not complete within ${MAX_ROUNDS} rounds`;
44365
+ const redactedRebaseFailureMessage = redactCredentials(rebaseFailureMessage);
44366
+ failed.push({
44367
+ branch: branchDir,
44368
+ error: redactedRebaseFailureMessage
44369
+ });
44370
+ await this.recordRebaseFailure(branchPath, branchDir, redactedRebaseFailureMessage);
44371
+ continue;
44372
+ }
44373
+ await invalidateBranchContentCaches(branchPath);
44374
+ const normalizedContentRoot = normalizeFilesystemPath(this.contentRoot);
44375
+ const conflictIds = [...new Set(conflictedFiles)].map((f5) => {
44376
+ const fileId = extractIdFromFilename(path12.basename(f5));
44377
+ if (fileId) return fileId;
44378
+ const parentDir = path12.basename(path12.dirname(f5));
44379
+ const dirId = extractIdFromFilename(parentDir);
44380
+ if (dirId) return dirId;
44381
+ const parentPath = normalizeFilesystemPath(path12.dirname(f5));
44382
+ if (path12.basename(f5) === ".collection.json" && parentPath === normalizedContentRoot) {
44383
+ return ROOT_COLLECTION_ID;
44384
+ }
44385
+ return null;
44386
+ }).filter((id) => id !== null);
44387
+ const conflictIdsDeduped = [...new Set(conflictIds)];
44388
+ const hadConflicts = conflictIdsDeduped.length > 0;
44389
+ workerLog(
44390
+ hadConflicts ? ` Rebased ${branchDir} (kept branch version for ${conflictIdsDeduped.length} conflicting file(s))` : ` Rebased ${branchDir} successfully`
44391
+ );
44245
44392
  await meta.save({
44246
44393
  branch: {
44247
44394
  name: branchDir,
44248
- conflictStatus: "clean",
44249
- conflictFiles: [],
44395
+ conflictStatus: hadConflicts ? "conflicts-detected" : "clean",
44396
+ conflictFiles: conflictIdsDeduped,
44397
+ // PR-W2: the cycle completed successfully -- clear any prior
44398
+ // failure record regardless of conflict outcome.
44250
44399
  rebaseFailure: void 0
44251
44400
  }
44252
44401
  });
44253
- continue;
44254
- }
44255
- workerLog(`Rebasing ${branchDir} (${behindCount} commits behind)...`);
44256
- const preRebaseHead = (await branchGit.revparse(["HEAD"])).trim();
44257
- const publishedSha = canPublish ? await this.readPublishedSha(branchRef) : null;
44258
- const conflictedFiles = [];
44259
- let nextAction = "start";
44260
- let completed = false;
44261
- let failureReason;
44262
- const MAX_ROUNDS = 50;
44263
- for (let round = 0; round < MAX_ROUNDS && !completed; round++) {
44264
- try {
44265
- if (nextAction === "start") {
44266
- await branchGit.rebase([fetchedBaseTip]);
44267
- } else if (nextAction === "continue") {
44268
- await branchGit.rebase(["--continue"]);
44269
- } else {
44270
- await branchGit.rebase(["--skip"]);
44271
- }
44272
- completed = true;
44273
- } catch (rebaseErr) {
44274
- nextAction = "continue";
44275
- const st = await branchGit.status();
44276
- if (st.conflicted.length > 0) {
44277
- for (const file of st.conflicted) {
44278
- await branchGit.raw(["checkout", "--theirs", file]);
44279
- await branchGit.add(file);
44280
- conflictedFiles.push(file);
44402
+ rebased.push(branchDir);
44403
+ if (publishedSha !== null) {
44404
+ if (publishedSha === preRebaseHead) {
44405
+ await this.markHistoryRewritten(branchPath, branchDir, publishedSha);
44406
+ if (await this.forcePublishToLocalRemote(branchPath, branchRef, publishedSha)) {
44407
+ await this.enqueueGitHubPush(branchRef);
44281
44408
  }
44282
44409
  } else {
44283
- const msg = rebaseErr instanceof Error ? rebaseErr.message : "";
44284
- if (msg.toLowerCase().includes("nothing to commit") || msg.toLowerCase().includes("apply --skip")) {
44285
- nextAction = "skip";
44286
- } else {
44287
- workerLogWarn(
44288
- ` Unexpected rebase error in ${branchDir}: ${msg || "Unknown error"}`
44289
- );
44290
- failureReason = msg || "Unknown error";
44291
- await branchGit.rebase(["--abort"]).catch(() => {
44292
- });
44293
- break;
44294
- }
44410
+ const divergence = `rebased locally, but remote.git holds ${publishedSha} for ${branchRef}, which this clone never had (a direct push to the branch?). Left untouched -- reconcile it before submitting again.`;
44411
+ workerLogWarn(` ${branchDir}: ${divergence}`);
44412
+ await this.recordRebaseFailure(branchPath, branchDir, divergence);
44295
44413
  }
44296
44414
  }
44297
- }
44298
- if (!completed) {
44299
- workerLogWarn(
44300
- failureReason !== void 0 ? ` Rebase of ${branchDir} aborted due to unexpected error: ${failureReason}` : ` Rebase of ${branchDir} did not complete within ${MAX_ROUNDS} rounds, aborting`
44301
- );
44302
- await branchGit.rebase(["--abort"]).catch(() => {
44303
- });
44304
- const rebaseFailureMessage = failureReason ?? `did not complete within ${MAX_ROUNDS} rounds`;
44305
- const redactedRebaseFailureMessage = redactCredentials(rebaseFailureMessage);
44306
- failed.push({
44307
- branch: branchDir,
44308
- error: redactedRebaseFailureMessage
44415
+ } finally {
44416
+ await releaseContentLock?.().catch((releaseErr) => {
44417
+ workerLogWarn(
44418
+ ` Failed to release content-write lock for ${branchDir}: ${getErrorMessage2(releaseErr)}`
44419
+ );
44309
44420
  });
44310
- await this.recordRebaseFailure(branchPath, branchDir, redactedRebaseFailureMessage);
44311
- continue;
44312
- }
44313
- await invalidateBranchContentCaches(branchPath);
44314
- const normalizedContentRoot = normalizeFilesystemPath(this.contentRoot);
44315
- const conflictIds = [...new Set(conflictedFiles)].map((f5) => {
44316
- const fileId = extractIdFromFilename(path10.basename(f5));
44317
- if (fileId) return fileId;
44318
- const parentDir = path10.basename(path10.dirname(f5));
44319
- const dirId = extractIdFromFilename(parentDir);
44320
- if (dirId) return dirId;
44321
- const parentPath = normalizeFilesystemPath(path10.dirname(f5));
44322
- if (path10.basename(f5) === ".collection.json" && parentPath === normalizedContentRoot) {
44323
- return ROOT_COLLECTION_ID;
44324
- }
44325
- return null;
44326
- }).filter((id) => id !== null);
44327
- const conflictIdsDeduped = [...new Set(conflictIds)];
44328
- const hadConflicts = conflictIdsDeduped.length > 0;
44329
- workerLog(
44330
- hadConflicts ? ` Rebased ${branchDir} (kept branch version for ${conflictIdsDeduped.length} conflicting file(s))` : ` Rebased ${branchDir} successfully`
44331
- );
44332
- await meta.save({
44333
- branch: {
44334
- name: branchDir,
44335
- conflictStatus: hadConflicts ? "conflicts-detected" : "clean",
44336
- conflictFiles: conflictIdsDeduped,
44337
- // PR-W2: the cycle completed successfully -- clear any prior
44338
- // failure record regardless of conflict outcome.
44339
- rebaseFailure: void 0
44340
- }
44341
- });
44342
- rebased.push(branchDir);
44343
- if (publishedSha !== null) {
44344
- if (publishedSha === preRebaseHead) {
44345
- await this.markHistoryRewritten(branchPath, branchDir, publishedSha);
44346
- if (await this.forcePublishToLocalRemote(branchPath, branchRef, publishedSha)) {
44347
- await this.enqueueGitHubPush(branchRef);
44348
- }
44349
- } else {
44350
- const divergence = `rebased locally, but remote.git holds ${publishedSha} for ${branchRef}, which this clone never had (a direct push to the branch?). Left untouched -- reconcile it before submitting again.`;
44351
- workerLogWarn(` ${branchDir}: ${divergence}`);
44352
- await this.recordRebaseFailure(branchPath, branchDir, divergence);
44353
- }
44354
44421
  }
44355
44422
  } catch (err) {
44356
44423
  const message = err instanceof Error ? err.message : "Unknown error";
@@ -44360,7 +44427,7 @@ var CmsWorker = class {
44360
44427
  await this.recordRebaseFailure(branchPath, branchDir, redactedMessage);
44361
44428
  }
44362
44429
  }
44363
- return { rebased, skippedDirty, failed };
44430
+ return { rebased, skippedDirty, skippedLocked, failed };
44364
44431
  }
44365
44432
  async refreshAuthCache() {
44366
44433
  if (!this.running || !this.config.refreshAuthCache) return;
@@ -47555,10 +47622,10 @@ var SessionAPI = class extends AbstractAPI {
47555
47622
  */
47556
47623
  async getToken(sessionId, template, expiresInSeconds) {
47557
47624
  this.requireId(sessionId);
47558
- const path13 = template ? joinPaths(basePath24, sessionId, "tokens", template) : joinPaths(basePath24, sessionId, "tokens");
47625
+ const path15 = template ? joinPaths(basePath24, sessionId, "tokens", template) : joinPaths(basePath24, sessionId, "tokens");
47559
47626
  const requestOptions = {
47560
47627
  method: "POST",
47561
- path: path13
47628
+ path: path15
47562
47629
  };
47563
47630
  if (expiresInSeconds !== void 0) {
47564
47631
  requestOptions.bodyParams = { expires_in_seconds: expiresInSeconds };
@@ -49680,12 +49747,12 @@ function buildRequest(options) {
49680
49747
  userAgent = USER_AGENT,
49681
49748
  skipApiVersionInUrl = false
49682
49749
  } = options;
49683
- const { path: path13, method, queryParams, headerParams, bodyParams, formData, options: opts } = requestOptions;
49750
+ const { path: path15, method, queryParams, headerParams, bodyParams, formData, options: opts } = requestOptions;
49684
49751
  const { deepSnakecaseBodyParamKeys = false } = opts || {};
49685
49752
  if (requireSecretKey) {
49686
49753
  assertValidSecretKey(secretKey);
49687
49754
  }
49688
- const url = skipApiVersionInUrl ? joinPaths(apiUrl, path13) : joinPaths(apiUrl, apiVersion, path13);
49755
+ const url = skipApiVersionInUrl ? joinPaths(apiUrl, path15) : joinPaths(apiUrl, apiVersion, path15);
49689
49756
  const finalUrl = new URL(url);
49690
49757
  if (queryParams) {
49691
49758
  const snakecasedQueryParams = snakecase_keys_default({ ...queryParams });
@@ -51747,38 +51814,38 @@ function createClerkClient(options) {
51747
51814
  }
51748
51815
 
51749
51816
  // ../canopycms/src/auth/file-based-auth-cache.ts
51750
- import fs8 from "node:fs/promises";
51751
- import path11 from "node:path";
51817
+ import fs9 from "node:fs/promises";
51818
+ import path13 from "node:path";
51752
51819
  var log5 = createDebugLogger({ prefix: "FileBasedAuthCache" });
51753
51820
  async function writeAuthCacheSnapshot(cachePath, files) {
51754
- await fs8.mkdir(cachePath, { recursive: true });
51821
+ await fs9.mkdir(cachePath, { recursive: true });
51755
51822
  const timestamp2 = Date.now();
51756
- const snapshotDir = path11.join(cachePath, `snapshot-${timestamp2}`);
51757
- await fs8.mkdir(snapshotDir, { recursive: true });
51823
+ const snapshotDir = path13.join(cachePath, `snapshot-${timestamp2}`);
51824
+ await fs9.mkdir(snapshotDir, { recursive: true });
51758
51825
  for (const [fileName, data2] of Object.entries(files)) {
51759
- const tmpPath = path11.join(snapshotDir, `${fileName}.tmp`);
51760
- const finalPath = path11.join(snapshotDir, fileName);
51761
- await fs8.writeFile(tmpPath, JSON.stringify(data2, null, 2), "utf-8");
51762
- await fs8.rename(tmpPath, finalPath);
51763
- }
51764
- const currentLink = path11.join(cachePath, "current");
51765
- const tmpLink = path11.join(cachePath, `current-${timestamp2}`);
51766
- await fs8.symlink(snapshotDir, tmpLink);
51767
- await fs8.rename(tmpLink, currentLink);
51826
+ const tmpPath = path13.join(snapshotDir, `${fileName}.tmp`);
51827
+ const finalPath = path13.join(snapshotDir, fileName);
51828
+ await fs9.writeFile(tmpPath, JSON.stringify(data2, null, 2), "utf-8");
51829
+ await fs9.rename(tmpPath, finalPath);
51830
+ }
51831
+ const currentLink = path13.join(cachePath, "current");
51832
+ const tmpLink = path13.join(cachePath, `current-${timestamp2}`);
51833
+ await fs9.symlink(snapshotDir, tmpLink);
51834
+ await fs9.rename(tmpLink, currentLink);
51768
51835
  await cleanupOldSnapshots(cachePath, 2);
51769
51836
  return snapshotDir;
51770
51837
  }
51771
51838
  async function cleanupOldSnapshots(cachePath, keepCount) {
51772
51839
  let entries;
51773
51840
  try {
51774
- entries = await fs8.readdir(cachePath);
51841
+ entries = await fs9.readdir(cachePath);
51775
51842
  } catch {
51776
51843
  return;
51777
51844
  }
51778
51845
  const snapshots = entries.filter((e5) => e5.startsWith("snapshot-")).sort().reverse();
51779
51846
  for (const snapshot of snapshots.slice(keepCount)) {
51780
51847
  try {
51781
- await fs8.rm(path11.join(cachePath, snapshot), {
51848
+ await fs9.rm(path13.join(cachePath, snapshot), {
51782
51849
  recursive: true,
51783
51850
  force: true
51784
51851
  });
@@ -51872,7 +51939,7 @@ async function refreshClerkCache(options) {
51872
51939
  }
51873
51940
 
51874
51941
  // worker/index.ts
51875
- import path12 from "node:path";
51942
+ import path14 from "node:path";
51876
51943
  async function getSecret(secretArn, retries = 3) {
51877
51944
  const { SecretsManagerClient, GetSecretValueCommand } = await Promise.resolve().then(() => __toESM(require_dist_cjs53(), 1));
51878
51945
  const client = new SecretsManagerClient({});
@@ -51911,7 +51978,7 @@ async function main() {
51911
51978
  if (!clerkSecretKey && process.env.CLERK_SECRET_KEY_SECRET_ARN) {
51912
51979
  clerkSecretKey = await getSecret(process.env.CLERK_SECRET_KEY_SECRET_ARN);
51913
51980
  }
51914
- const cachePath = path12.join(workspacePath, ".cache");
51981
+ const cachePath = path14.join(workspacePath, ".cache");
51915
51982
  const refreshAuthCache = clerkSecretKey ? async () => {
51916
51983
  const result = await refreshClerkCache({
51917
51984
  secretKey: clerkSecretKey,