@fern-api/generator-cli 0.9.24 → 0.9.26

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 (3) hide show
  1. package/dist/api.js +296 -198
  2. package/dist/cli.js +2242 -2021
  3. package/package.json +2 -2
package/dist/api.js CHANGED
@@ -36,9 +36,9 @@ var require_ms = __commonJS({
36
36
  "use strict";
37
37
  var s = 1e3;
38
38
  var m = s * 60;
39
- var h = m * 60;
40
- var d = h * 24;
41
- var w2 = d * 7;
39
+ var h2 = m * 60;
40
+ var d = h2 * 24;
41
+ var w = d * 7;
42
42
  var y2 = d * 365.25;
43
43
  module2.exports = function(val, options) {
44
44
  options = options || {};
@@ -75,7 +75,7 @@ var require_ms = __commonJS({
75
75
  case "weeks":
76
76
  case "week":
77
77
  case "w":
78
- return n * w2;
78
+ return n * w;
79
79
  case "days":
80
80
  case "day":
81
81
  case "d":
@@ -85,7 +85,7 @@ var require_ms = __commonJS({
85
85
  case "hrs":
86
86
  case "hr":
87
87
  case "h":
88
- return n * h;
88
+ return n * h2;
89
89
  case "minutes":
90
90
  case "minute":
91
91
  case "mins":
@@ -113,8 +113,8 @@ var require_ms = __commonJS({
113
113
  if (msAbs >= d) {
114
114
  return Math.round(ms / d) + "d";
115
115
  }
116
- if (msAbs >= h) {
117
- return Math.round(ms / h) + "h";
116
+ if (msAbs >= h2) {
117
+ return Math.round(ms / h2) + "h";
118
118
  }
119
119
  if (msAbs >= m) {
120
120
  return Math.round(ms / m) + "m";
@@ -129,8 +129,8 @@ var require_ms = __commonJS({
129
129
  if (msAbs >= d) {
130
130
  return plural(ms, msAbs, d, "day");
131
131
  }
132
- if (msAbs >= h) {
133
- return plural(ms, msAbs, h, "hour");
132
+ if (msAbs >= h2) {
133
+ return plural(ms, msAbs, h2, "hour");
134
134
  }
135
135
  if (msAbs >= m) {
136
136
  return plural(ms, msAbs, m, "minute");
@@ -168,8 +168,8 @@ var require_common = __commonJS({
168
168
  createDebug.formatters = {};
169
169
  function selectColor(namespace) {
170
170
  let hash = 0;
171
- for (let i = 0; i < namespace.length; i++) {
172
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
171
+ for (let i2 = 0; i2 < namespace.length; i2++) {
172
+ hash = (hash << 5) - hash + namespace.charCodeAt(i2);
173
173
  hash |= 0;
174
174
  }
175
175
  return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
@@ -232,8 +232,8 @@ var require_common = __commonJS({
232
232
  }
233
233
  return enabledCache;
234
234
  },
235
- set: (v2) => {
236
- enableOverride = v2;
235
+ set: (v) => {
236
+ enableOverride = v;
237
237
  }
238
238
  });
239
239
  if (typeof createDebug.init === "function") {
@@ -440,8 +440,8 @@ var require_browser = __commonJS({
440
440
  if (!this.useColors) {
441
441
  return;
442
442
  }
443
- const c2 = "color: " + this.color;
444
- args.splice(1, 0, c2, "color: inherit");
443
+ const c3 = "color: " + this.color;
444
+ args.splice(1, 0, c3, "color: inherit");
445
445
  let index = 0;
446
446
  let lastC = 0;
447
447
  args[0].replace(/%[a-zA-Z%]/g, (match) => {
@@ -453,7 +453,7 @@ var require_browser = __commonJS({
453
453
  lastC = index;
454
454
  }
455
455
  });
456
- args.splice(lastC, 0, c2);
456
+ args.splice(lastC, 0, c3);
457
457
  }
458
458
  exports2.log = console.debug || console.log || (() => {
459
459
  });
@@ -486,9 +486,9 @@ var require_browser = __commonJS({
486
486
  }
487
487
  module2.exports = require_common()(exports2);
488
488
  var { formatters } = module2.exports;
489
- formatters.j = function(v2) {
489
+ formatters.j = function(v) {
490
490
  try {
491
- return JSON.stringify(v2);
491
+ return JSON.stringify(v);
492
492
  } catch (error) {
493
493
  return "[UnexpectedJSONParseError]: " + error.message;
494
494
  }
@@ -719,8 +719,8 @@ var require_node = __commonJS({
719
719
  function formatArgs(args) {
720
720
  const { namespace: name, useColors: useColors2 } = this;
721
721
  if (useColors2) {
722
- const c2 = this.color;
723
- const colorCode = "\x1B[3" + (c2 < 8 ? c2 : "8;5;" + c2);
722
+ const c3 = this.color;
723
+ const colorCode = "\x1B[3" + (c3 < 8 ? c3 : "8;5;" + c3);
724
724
  const prefix = ` ${colorCode};1m${name} \x1B[0m`;
725
725
  args[0] = prefix + args[0].split("\n").join("\n" + prefix);
726
726
  args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
@@ -750,19 +750,19 @@ var require_node = __commonJS({
750
750
  function init(debug2) {
751
751
  debug2.inspectOpts = {};
752
752
  const keys2 = Object.keys(exports2.inspectOpts);
753
- for (let i = 0; i < keys2.length; i++) {
754
- debug2.inspectOpts[keys2[i]] = exports2.inspectOpts[keys2[i]];
753
+ for (let i2 = 0; i2 < keys2.length; i2++) {
754
+ debug2.inspectOpts[keys2[i2]] = exports2.inspectOpts[keys2[i2]];
755
755
  }
756
756
  }
757
757
  module2.exports = require_common()(exports2);
758
758
  var { formatters } = module2.exports;
759
- formatters.o = function(v2) {
759
+ formatters.o = function(v) {
760
760
  this.inspectOpts.colors = this.useColors;
761
- return util.inspect(v2, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
761
+ return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
762
762
  };
763
- formatters.O = function(v2) {
763
+ formatters.O = function(v) {
764
764
  this.inspectOpts.colors = this.useColors;
765
- return util.inspect(v2, this.inspectOpts);
765
+ return util.inspect(v, this.inspectOpts);
766
766
  };
767
767
  }
768
768
  });
@@ -828,7 +828,7 @@ var require_dist = __commonJS({
828
828
  "../../node_modules/.pnpm/@kwsites+file-exists@1.1.1/node_modules/@kwsites/file-exists/dist/index.js"(exports2) {
829
829
  "use strict";
830
830
  function __export3(m) {
831
- for (var p in m) if (!exports2.hasOwnProperty(p)) exports2[p] = m[p];
831
+ for (var p2 in m) if (!exports2.hasOwnProperty(p2)) exports2[p2] = m[p2];
832
832
  }
833
833
  Object.defineProperty(exports2, "__esModule", { value: true });
834
834
  __export3(require_src2());
@@ -903,11 +903,10 @@ module.exports = __toCommonJS(api_exports2);
903
903
  var import_promises = require("fs/promises");
904
904
  var import_path = __toESM(require("path"), 1);
905
905
 
906
- // ../../node_modules/.pnpm/simple-git@3.35.2/node_modules/simple-git/dist/esm/index.js
907
- var import_node_buffer = require("buffer");
906
+ // ../../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
908
907
  var import_file_exists = __toESM(require_dist(), 1);
909
908
 
910
- // ../../node_modules/.pnpm/@simple-git+args-pathspec@1.0.2/node_modules/@simple-git/args-pathspec/dist/index.mjs
909
+ // ../../node_modules/.pnpm/@simple-git+args-pathspec@1.0.3/node_modules/@simple-git/args-pathspec/dist/index.mjs
911
910
  var t = /* @__PURE__ */ new WeakMap();
912
911
  function c(...n) {
913
912
  const e = new String(n);
@@ -920,19 +919,19 @@ function o(n) {
920
919
  return t.get(n) ?? [];
921
920
  }
922
921
 
923
- // ../../node_modules/.pnpm/simple-git@3.35.2/node_modules/simple-git/dist/esm/index.js
922
+ // ../../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
924
923
  var import_debug = __toESM(require_src(), 1);
925
924
  var import_child_process = require("child_process");
926
925
  var import_promise_deferred = __toESM(require_dist2(), 1);
927
926
  var import_node_path = require("path");
928
927
 
929
- // ../../node_modules/.pnpm/@simple-git+argv-parser@1.0.3/node_modules/@simple-git/argv-parser/dist/index.mjs
930
- function* w(e, t2) {
928
+ // ../../node_modules/.pnpm/@simple-git+argv-parser@1.1.1/node_modules/@simple-git/argv-parser/dist/index.mjs
929
+ function* U(e, t2) {
931
930
  const n = t2 === "global";
932
931
  for (const o2 of e)
933
932
  o2.isGlobal === n && (yield o2);
934
933
  }
935
- var x = /* @__PURE__ */ new Set([
934
+ var k = /* @__PURE__ */ new Set([
936
935
  "--add",
937
936
  "--edit",
938
937
  "--remove-section",
@@ -952,25 +951,25 @@ var S = /* @__PURE__ */ new Set([
952
951
  "--list",
953
952
  "-l"
954
953
  ]);
955
- var k = /* @__PURE__ */ new Set([
954
+ var P = /* @__PURE__ */ new Set([
956
955
  "edit",
957
956
  "remove-section",
958
957
  "rename-section",
959
958
  "set",
960
959
  "unset"
961
960
  ]);
962
- var y = /* @__PURE__ */ new Set(["get", "get-color", "get-colorbool", "list"]);
963
- function C(e, t2) {
964
- for (const { name: o2 } of w(e, "task")) {
965
- if (x.has(o2))
966
- return f(true, t2);
961
+ var E = /* @__PURE__ */ new Set(["get", "get-color", "get-colorbool", "list"]);
962
+ function F(e, t2) {
963
+ for (const { name: o2 } of U(e, "task")) {
964
+ if (k.has(o2))
965
+ return p(true, t2);
967
966
  if (S.has(o2))
968
- return f(false, t2);
967
+ return p(false, t2);
969
968
  }
970
969
  const n = t2.at(0)?.toLowerCase();
971
- return n === void 0 ? null : k.has(n) ? f(true, t2.slice(1)) : y.has(n) ? f(false, t2.slice(1)) : t2.length === 1 ? f(false, t2) : f(true, t2);
970
+ return n === void 0 ? null : P.has(n) ? p(true, t2.slice(1)) : E.has(n) ? p(false, t2.slice(1)) : t2.length === 1 ? p(false, t2) : p(true, t2);
972
971
  }
973
- function f(e = false, t2 = []) {
972
+ function p(e = false, t2 = []) {
974
973
  const n = t2.at(0)?.toLowerCase();
975
974
  return n === void 0 ? null : {
976
975
  isWrite: e,
@@ -979,18 +978,18 @@ function f(e = false, t2 = []) {
979
978
  value: t2.at(1)
980
979
  };
981
980
  }
982
- function N(e, t2) {
981
+ function A(e, t2) {
983
982
  return t2.isWrite && t2.value !== void 0 ? { key: t2.key, value: t2.value, scope: e } : { key: t2.key, scope: e };
984
983
  }
985
- function P(e) {
984
+ function M(e) {
986
985
  const t2 = e?.indexOf("=") || -1;
987
986
  return !e || t2 < 0 ? null : {
988
987
  key: e.slice(0, t2).trim().toLowerCase(),
989
988
  value: e.slice(t2 + 1)
990
989
  };
991
990
  }
992
- function U(e) {
993
- for (const { name: t2 } of w(e, "task"))
991
+ function N(e) {
992
+ for (const { name: t2 } of U(e, "task"))
994
993
  switch (t2) {
995
994
  case "--global":
996
995
  return "global";
@@ -1006,45 +1005,45 @@ function U(e) {
1006
1005
  }
1007
1006
  return "local";
1008
1007
  }
1009
- function A({ name: e }) {
1008
+ function G({ name: e }) {
1010
1009
  if (e === "-c" || e === "--config")
1011
1010
  return "inline";
1012
1011
  if (e === "--config-env")
1013
1012
  return "env";
1014
1013
  }
1015
- function* F(e) {
1014
+ function* O(e) {
1016
1015
  for (const t2 of e) {
1017
- const n = A(t2), o2 = n && P(t2.value);
1016
+ const n = G(t2), o2 = n && M(t2.value);
1018
1017
  o2 && (yield {
1019
1018
  ...o2,
1020
1019
  scope: n
1021
1020
  });
1022
1021
  }
1023
1022
  }
1024
- function M(e, t2, n) {
1023
+ function L(e, t2, n) {
1025
1024
  const o2 = {
1026
1025
  read: [],
1027
- write: [...F(t2)]
1026
+ write: [...O(t2)]
1028
1027
  };
1029
- return e === "config" && G(
1028
+ return e === "config" && $(
1030
1029
  o2,
1031
- U(t2),
1032
- C(t2, n)
1030
+ N(t2),
1031
+ F(t2, n)
1033
1032
  ), o2;
1034
1033
  }
1035
- function G(e, t2, n) {
1034
+ function $(e, t2, n) {
1036
1035
  if (n === null)
1037
1036
  return;
1038
- const o2 = N(t2, n);
1037
+ const o2 = A(t2, n);
1039
1038
  n.isWrite ? e.write.push(o2) : e.read.push(o2);
1040
1039
  }
1041
- var v = {
1040
+ var x = {
1042
1041
  short: /* @__PURE__ */ new Map([
1043
1042
  ["c", true]
1044
1043
  // -c <k=v> set config key for this invocation
1045
1044
  ])
1046
1045
  };
1047
- var O = {
1046
+ var D = {
1048
1047
  short: new Map([
1049
1048
  ["C", true],
1050
1049
  // -C <path> change working directory
@@ -1056,7 +1055,7 @@ var O = {
1056
1055
  // -p paginate
1057
1056
  ["v", false],
1058
1057
  // -v version
1059
- ...v.short.entries()
1058
+ ...x.short.entries()
1060
1059
  ]),
1061
1060
  long: /* @__PURE__ */ new Set([
1062
1061
  "attr-source",
@@ -1069,7 +1068,7 @@ var O = {
1069
1068
  "work-tree"
1070
1069
  ])
1071
1070
  };
1072
- var E = {
1071
+ var R = {
1073
1072
  clone: {
1074
1073
  short: /* @__PURE__ */ new Map([
1075
1074
  ["b", true],
@@ -1089,7 +1088,7 @@ var E = {
1089
1088
  ["u", true]
1090
1089
  // -u <upload-pack>
1091
1090
  ]),
1092
- long: /* @__PURE__ */ new Set(["branch", "config", "jobs", "origin", "upload-pack", "u"])
1091
+ long: /* @__PURE__ */ new Set(["branch", "config", "jobs", "origin", "upload-pack", "u", "template"])
1093
1092
  },
1094
1093
  commit: {
1095
1094
  short: /* @__PURE__ */ new Map([
@@ -1121,6 +1120,10 @@ var E = {
1121
1120
  short: /* @__PURE__ */ new Map(),
1122
1121
  long: /* @__PURE__ */ new Set(["upload-pack"])
1123
1122
  },
1123
+ init: {
1124
+ short: /* @__PURE__ */ new Map(),
1125
+ long: /* @__PURE__ */ new Set(["template"])
1126
+ },
1124
1127
  pull: {
1125
1128
  short: /* @__PURE__ */ new Map(),
1126
1129
  long: /* @__PURE__ */ new Set(["upload-pack"])
@@ -1130,15 +1133,15 @@ var E = {
1130
1133
  long: /* @__PURE__ */ new Set(["exec", "receive-pack"])
1131
1134
  }
1132
1135
  };
1133
- var I = { short: /* @__PURE__ */ new Map(), long: /* @__PURE__ */ new Set() };
1134
- function L(e) {
1135
- const t2 = E[e ?? ""] ?? I;
1136
+ var T = { short: /* @__PURE__ */ new Map(), long: /* @__PURE__ */ new Set() };
1137
+ function I(e) {
1138
+ const t2 = R[e ?? ""] ?? T;
1136
1139
  return {
1137
- short: new Map([...v.short.entries(), ...t2.short.entries()]),
1140
+ short: new Map([...x.short.entries(), ...t2.short.entries()]),
1138
1141
  long: t2.long
1139
1142
  };
1140
1143
  }
1141
- function b(e, t2 = O) {
1144
+ function b(e, t2 = D) {
1142
1145
  if (e.startsWith("--")) {
1143
1146
  const n = e.indexOf("=");
1144
1147
  if (n > 2)
@@ -1150,146 +1153,243 @@ function b(e, t2 = O) {
1150
1153
  const n = e.charAt(1), o2 = t2.short.get(n);
1151
1154
  return [{ name: e, needsNext: o2 === true }];
1152
1155
  }
1153
- return R(e, t2.short);
1156
+ return W(e, t2.short);
1154
1157
  }
1155
- function R(e, t2) {
1158
+ function W(e, t2) {
1156
1159
  const n = e.slice(1).split(""), o2 = [];
1157
- for (let a = 0; a < n.length; a++) {
1158
- const s = n[a], r2 = t2.get(s);
1159
- if (r2 === void 0)
1160
+ for (let s = 0; s < n.length; s++) {
1161
+ const r2 = n[s], l = t2.get(r2);
1162
+ if (l === void 0)
1160
1163
  return [{ name: e, needsNext: false }];
1161
- if (r2) {
1162
- const l = n.slice(a + 1).join("");
1163
- if (l && ![...l].every((h) => t2.has(h)))
1164
- return o2.push({ name: `-${s}`, value: l, needsNext: false }), o2;
1164
+ if (l) {
1165
+ const a = n.slice(s + 1).join("");
1166
+ if (a && ![...a].every((w) => t2.has(w)))
1167
+ return o2.push({ name: `-${r2}`, value: a, needsNext: false }), o2;
1165
1168
  }
1166
- o2.push({ name: `-${s}`, needsNext: r2 });
1169
+ o2.push({ name: `-${r2}`, needsNext: l });
1167
1170
  }
1168
1171
  return o2;
1169
1172
  }
1170
- function W(e, t2 = []) {
1173
+ function j(e, t2 = []) {
1171
1174
  let n = 0;
1172
1175
  for (; n < e.length; ) {
1173
1176
  const o2 = String(e[n]);
1174
1177
  if (!o2.startsWith("-") || o2.length < 2) break;
1175
- const a = b(o2);
1176
- let s = n + 1;
1177
- for (const r2 of a) {
1178
- const l = {
1179
- name: r2.name,
1180
- value: r2.value,
1178
+ const s = b(o2);
1179
+ let r2 = n + 1;
1180
+ for (const l of s) {
1181
+ const a = {
1182
+ name: l.name,
1183
+ value: l.value,
1181
1184
  absorbedNext: false,
1182
1185
  isGlobal: true
1183
1186
  };
1184
- r2.needsNext && l.value === void 0 && s < e.length && (l.value = String(e[s]), l.absorbedNext = true, s++), t2.push(l);
1187
+ l.needsNext && a.value === void 0 && r2 < e.length && (a.value = String(e[r2]), a.absorbedNext = true, r2++), t2.push(a);
1185
1188
  }
1186
- n = s;
1189
+ n = r2;
1187
1190
  }
1188
1191
  return { flags: t2, taskIndex: n };
1189
1192
  }
1190
- function _(e, t2, n = []) {
1191
- const o2 = L(t2), a = [], s = [];
1192
- let r2 = 0;
1193
- for (; r2 < e.length; ) {
1194
- const l = e[r2];
1195
- if (r(l)) {
1196
- s.push(...o(l)), r2++;
1193
+ function B(e, t2, n = []) {
1194
+ const o2 = I(t2), s = [], r2 = [];
1195
+ let l = 0;
1196
+ for (; l < e.length; ) {
1197
+ const a = e[l];
1198
+ if (r(a)) {
1199
+ r2.push(...o(a)), l++;
1197
1200
  continue;
1198
1201
  }
1199
- const u = String(l);
1200
- if (u === "--") {
1201
- for (let c2 = r2 + 1; c2 < e.length; c2++) {
1202
- const i = e[c2];
1203
- r(i) ? s.push(...o(i)) : s.push(String(i));
1202
+ const f = String(a);
1203
+ if (f === "--") {
1204
+ for (let g = l + 1; g < e.length; g++) {
1205
+ const u = e[g];
1206
+ r(u) ? r2.push(...o(u)) : r2.push(String(u));
1204
1207
  }
1205
1208
  break;
1206
1209
  }
1207
- if (!u.startsWith("-") || u.length < 2) {
1208
- a.push(u), r2++;
1210
+ if (!f.startsWith("-") || f.length < 2) {
1211
+ s.push(f), l++;
1209
1212
  continue;
1210
1213
  }
1211
- const h = b(u, o2);
1212
- let d = r2 + 1;
1213
- for (const c2 of h) {
1214
- const i = {
1215
- name: c2.name,
1216
- value: c2.value,
1214
+ const w = b(f, o2);
1215
+ let d = l + 1;
1216
+ for (const g of w) {
1217
+ const u = {
1218
+ name: g.name,
1219
+ value: g.value,
1217
1220
  absorbedNext: false,
1218
1221
  isGlobal: false
1219
1222
  };
1220
- c2.needsNext && i.value === void 0 && d < e.length && !r(e[d]) && (i.value = String(e[d]), i.absorbedNext = true, d++), n.push(i);
1223
+ g.needsNext && u.value === void 0 && d < e.length && !r(e[d]) && (u.value = String(e[d]), u.absorbedNext = true, d++), n.push(u);
1221
1224
  }
1222
- r2 = d;
1225
+ l = d;
1223
1226
  }
1224
- return { flags: n, positionals: a, pathspecs: s };
1227
+ return { flags: n, positionals: s, pathspecs: r2 };
1225
1228
  }
1226
- function* T({ write: e }) {
1229
+ function* V({
1230
+ write: e
1231
+ }) {
1227
1232
  for (const t2 of e)
1228
- for (const n of $) {
1233
+ for (const n of q) {
1229
1234
  const o2 = n(t2.key);
1230
1235
  o2 && (yield o2);
1231
1236
  }
1232
1237
  }
1233
- function g(e, t2, n = String(e)) {
1234
- const o2 = typeof e == "string" ? new RegExp(`\\s*${e}`, "i") : e;
1235
- return function(s) {
1236
- if (o2.test(s))
1238
+ function c2(e, t2, n = String(e)) {
1239
+ const o2 = typeof e == "string" ? new RegExp(`\\s*${e.toLowerCase()}`) : e;
1240
+ return function(r2) {
1241
+ if (o2.test(r2))
1237
1242
  return {
1238
1243
  category: t2,
1239
1244
  message: `Configuring ${n} is not permitted without enabling ${t2}`
1240
1245
  };
1241
1246
  };
1242
1247
  }
1243
- var $ = [
1244
- g(
1245
- /^\s*protocol(.[a-z]+)?.allow/i,
1246
- "allowUnsafeProtocolOverride",
1247
- "protocol.allow"
1248
- ),
1249
- g("core.sshCommand", "allowUnsafeSshCommand"),
1250
- g("core.fsmonitor", "allowUnsafeFsMonitor"),
1251
- g("core.gitProxy", "allowUnsafeGitProxy"),
1252
- g("core.hooksPath", "allowUnsafeHooksPath"),
1253
- g("diff.external", "allowUnsafeDiffExternal")
1248
+ function i(e, t2) {
1249
+ const n = new RegExp(`\\s*${e.toLowerCase().replace(/\./g, "(..+)?.")}`);
1250
+ return c2(n, t2, e);
1251
+ }
1252
+ var q = [
1253
+ c2("alias", "allowUnsafeAlias"),
1254
+ c2("core.askPass", "allowUnsafeAskPass"),
1255
+ c2("core.editor", "allowUnsafeEditor"),
1256
+ c2("core.fsmonitor", "allowUnsafeFsMonitor"),
1257
+ c2("core.gitProxy", "allowUnsafeGitProxy"),
1258
+ c2("core.hooksPath", "allowUnsafeHooksPath"),
1259
+ c2("core.pager", "allowUnsafePager"),
1260
+ c2("core.sshCommand", "allowUnsafeSshCommand"),
1261
+ i("credential.helper", "allowUnsafeCredentialHelper"),
1262
+ i("diff.command", "allowUnsafeDiffExternal"),
1263
+ c2("diff.external", "allowUnsafeDiffExternal"),
1264
+ i("diff.textconv", "allowUnsafeDiffTextConv"),
1265
+ i("filter.clean", "allowUnsafeFilter"),
1266
+ i("filter.smudge", "allowUnsafeFilter"),
1267
+ i("gpg.program", "allowUnsafeGpgProgram"),
1268
+ c2("init.templateDir", "allowUnsafeTemplateDir"),
1269
+ i("merge.driver", "allowUnsafeMergeDriver"),
1270
+ i("mergetool.path", "allowUnsafeMergeDriver"),
1271
+ i("mergetool.cmd", "allowUnsafeMergeDriver"),
1272
+ i("protocol.allow", "allowUnsafeProtocolOverride"),
1273
+ i("remote.receivepack", "allowUnsafePack"),
1274
+ i("remote.uploadpack", "allowUnsafePack"),
1275
+ c2("sequence.editor", "allowUnsafeEditor")
1254
1276
  ];
1255
- function* j(e, t2) {
1277
+ function* K(e, t2) {
1256
1278
  for (const n of t2)
1257
- /^--(upload|receive)-pack/.test(n.name) && (yield {
1258
- category: "allowUnsafePack",
1259
- message: "Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack"
1260
- }), e === "clone" && (/^-\w*u/.test(n.name) || n.name === "--u") && (yield {
1261
- category: "allowUnsafePack",
1262
- message: "Use of clone with option -u is not permitted without enabling allowUnsafePack"
1263
- }), e === "push" && /^--exec/.test(n.name) && (yield {
1264
- category: "allowUnsafePack",
1265
- message: "Use of push with option --exec is not permitted without enabling allowUnsafePack"
1266
- });
1279
+ for (const o2 of H) {
1280
+ const s = o2(e, n.name);
1281
+ s && (yield s);
1282
+ }
1267
1283
  }
1268
- function B(e, t2, n) {
1269
- const o2 = [
1270
- ...j(e, t2),
1271
- ...T(n)
1272
- ];
1273
- return {
1274
- categories: o2.reduce((s, r2) => s.add(r2.category), /* @__PURE__ */ new Set()),
1275
- vulnerabilities: o2
1284
+ function h(e, t2, n, o2 = String(t2)) {
1285
+ const s = typeof t2 == "string" ? new RegExp(`\\s*${t2.toLowerCase()}`) : t2, r2 = `Use of ${e ? `${e} with option ` : ""}${o2} is not permitted without enabling ${n}`;
1286
+ return function(a, f) {
1287
+ if ((!e || a === e) && s.test(f))
1288
+ return {
1289
+ category: n,
1290
+ message: r2
1291
+ };
1276
1292
  };
1277
1293
  }
1278
- function V(...e) {
1279
- const { flags: t2, taskIndex: n } = W(e), o2 = n < e.length ? String(e[n]).toLowerCase() : null, a = o2 !== null ? e.slice(n + 1) : [], { positionals: s, pathspecs: r2 } = _(a, o2, t2), l = M(o2, t2, s);
1294
+ var H = [
1295
+ h(
1296
+ null,
1297
+ /--(upload|receive)-pack/,
1298
+ "allowUnsafePack",
1299
+ "--upload-pack or --receive-pack"
1300
+ ),
1301
+ h("clone", /^-\w*u/, "allowUnsafePack"),
1302
+ h("clone", "--u", "allowUnsafePack"),
1303
+ h("push", "--exec", "allowUnsafePack"),
1304
+ h(null, "--template", "allowUnsafeTemplateDir")
1305
+ ];
1306
+ function C(e, t2, n) {
1307
+ return [...K(e, t2), ...V(n)];
1308
+ }
1309
+ function Y(...e) {
1310
+ const { flags: t2, taskIndex: n } = j(e), o2 = n < e.length ? String(e[n]).toLowerCase() : null, s = o2 !== null ? e.slice(n + 1) : [], { positionals: r2, pathspecs: l } = B(s, o2, t2), a = L(o2, t2, r2);
1280
1311
  return {
1281
1312
  task: o2,
1282
- flags: t2.map(D),
1283
- paths: r2,
1284
- config: l,
1285
- vulnerabilities: B(o2, t2, l)
1313
+ flags: t2.map(J),
1314
+ paths: l,
1315
+ config: a,
1316
+ vulnerabilities: z(C(o2, t2, a))
1286
1317
  };
1287
1318
  }
1288
- function D({ value: e, name: t2 }) {
1319
+ function z(e) {
1320
+ return Object.defineProperty(e, "vulnerabilities", {
1321
+ value: e
1322
+ });
1323
+ }
1324
+ function J({ value: e, name: t2 }) {
1289
1325
  return e !== void 0 ? { name: t2, value: e } : { name: t2 };
1290
1326
  }
1327
+ var y = {
1328
+ editor: "allowUnsafeEditor",
1329
+ git_askpass: "allowUnsafeAskPass",
1330
+ git_config_global: "allowUnsafeConfigPaths",
1331
+ git_config_system: "allowUnsafeConfigPaths",
1332
+ git_config_count: "allowUnsafeConfigEnvCount",
1333
+ git_config: "allowUnsafeConfigPaths",
1334
+ git_editor: "allowUnsafeEditor",
1335
+ git_exec_path: "allowUnsafeConfigPaths",
1336
+ git_external_diff: "allowUnsafeDiffExternal",
1337
+ git_pager: "allowUnsafePager",
1338
+ git_proxy_command: "allowUnsafeGitProxy",
1339
+ git_template_dir: "allowUnsafeTemplateDir",
1340
+ git_sequence_editor: "allowUnsafeEditor",
1341
+ git_ssh: "allowUnsafeSshCommand",
1342
+ git_ssh_command: "allowUnsafeSshCommand",
1343
+ pager: "allowUnsafePager",
1344
+ prefix: "allowUnsafeConfigPaths",
1345
+ ssh_askpass: "allowUnsafeAskPass"
1346
+ };
1347
+ function* Q(e) {
1348
+ const t2 = parseInt(e.git_config_count ?? "0", 10);
1349
+ for (let n = 0; n < t2; n++) {
1350
+ const o2 = e[`git_config_key_${n}`], s = e[`git_config_value_${n}`];
1351
+ o2 !== void 0 && (yield { key: o2.toLowerCase().trim(), value: s, scope: "env" });
1352
+ }
1353
+ }
1354
+ function* X(e) {
1355
+ for (const t2 of Object.keys(e))
1356
+ if (_(t2)) {
1357
+ const n = y[t2];
1358
+ yield {
1359
+ category: n,
1360
+ message: `Use of "${t2.toUpperCase()}" is not permitted without enabling ${n}`
1361
+ };
1362
+ }
1363
+ }
1364
+ function _(e) {
1365
+ return Object.hasOwn(y, e);
1366
+ }
1367
+ function Z(e) {
1368
+ const t2 = {};
1369
+ for (const [n, o2] of Object.entries(e)) {
1370
+ const s = n.toLowerCase().trim();
1371
+ (_(s) || s.startsWith("git")) && (t2[s] = String(o2));
1372
+ }
1373
+ return t2;
1374
+ }
1375
+ function ee(e) {
1376
+ const t2 = Z(e), n = {
1377
+ read: [],
1378
+ write: [...Q(t2)]
1379
+ }, o2 = [
1380
+ ...X(t2),
1381
+ ...C(null, [], n)
1382
+ ];
1383
+ return {
1384
+ config: n,
1385
+ vulnerabilities: o2
1386
+ };
1387
+ }
1388
+ function ne(e, t2) {
1389
+ return [...Y(...e).vulnerabilities, ...ee(t2).vulnerabilities];
1390
+ }
1291
1391
 
1292
- // ../../node_modules/.pnpm/simple-git@3.35.2/node_modules/simple-git/dist/esm/index.js
1392
+ // ../../node_modules/.pnpm/simple-git@3.36.0/node_modules/simple-git/dist/esm/index.js
1293
1393
  var import_promise_deferred2 = __toESM(require_dist2(), 1);
1294
1394
  var import_node_events = require("events");
1295
1395
  var __defProp2 = Object.defineProperty;
@@ -1444,13 +1544,13 @@ function asNumber(source, onNaN = 0) {
1444
1544
  }
1445
1545
  function prefixedArray(input, prefix) {
1446
1546
  const output = [];
1447
- for (let i = 0, max = input.length; i < max; i++) {
1448
- output.push(prefix, input[i]);
1547
+ for (let i2 = 0, max = input.length; i2 < max; i2++) {
1548
+ output.push(prefix, input[i2]);
1449
1549
  }
1450
1550
  return output;
1451
1551
  }
1452
1552
  function bufferToString(input) {
1453
- return (Array.isArray(input) ? import_node_buffer.Buffer.concat(input) : input).toString("utf-8");
1553
+ return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8");
1454
1554
  }
1455
1555
  function pick(source, properties) {
1456
1556
  const out = {};
@@ -1642,9 +1742,9 @@ function appendTaskOptions(options, commands = []) {
1642
1742
  } else if (filterPrimitives(value, ["boolean"])) {
1643
1743
  commands2.push(key + "=" + value);
1644
1744
  } else if (Array.isArray(value)) {
1645
- for (const v2 of value) {
1646
- if (!filterPrimitives(v2, ["string", "number"])) {
1647
- commands2.push(key + "=" + v2);
1745
+ for (const v of value) {
1746
+ if (!filterPrimitives(v, ["string", "number"])) {
1747
+ commands2.push(key + "=" + v);
1648
1748
  }
1649
1749
  }
1650
1750
  } else {
@@ -1655,9 +1755,9 @@ function appendTaskOptions(options, commands = []) {
1655
1755
  }
1656
1756
  function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
1657
1757
  const command = [];
1658
- for (let i = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i < max; i++) {
1659
- if ("string|number".includes(typeof args[i])) {
1660
- command.push(String(args[i]));
1758
+ for (let i2 = 0, max = initialPrimitive < 0 ? args.length : initialPrimitive; i2 < max; i2++) {
1759
+ if ("string|number".includes(typeof args[i2])) {
1760
+ command.push(String(args[i2]));
1661
1761
  }
1662
1762
  }
1663
1763
  appendTaskOptions(trailingOptionsArgument(args), command);
@@ -1690,12 +1790,12 @@ function callTaskParser(parser4, streams) {
1690
1790
  }
1691
1791
  function parseStringResponse(result, parsers12, texts, trim = true) {
1692
1792
  asArray(texts).forEach((text) => {
1693
- for (let lines = toLinesWithContent(text, trim), i = 0, max = lines.length; i < max; i++) {
1793
+ for (let lines = toLinesWithContent(text, trim), i2 = 0, max = lines.length; i2 < max; i2++) {
1694
1794
  const line = (offset = 0) => {
1695
- if (i + offset >= max) {
1795
+ if (i2 + offset >= max) {
1696
1796
  return;
1697
1797
  }
1698
- return lines[i + offset];
1798
+ return lines[i2 + offset];
1699
1799
  };
1700
1800
  parsers12.some(({ parse }) => parse(line, result));
1701
1801
  }
@@ -2056,9 +2156,9 @@ function configFilePath(filePath) {
2056
2156
  }
2057
2157
  function* configParser(text, requestedKey = null) {
2058
2158
  const lines = text.split("\0");
2059
- for (let i = 0, max = lines.length - 1; i < max; ) {
2060
- const file = configFilePath(lines[i++]);
2061
- let value = lines[i++];
2159
+ for (let i2 = 0, max = lines.length - 1; i2 < max; ) {
2160
+ const file = configFilePath(lines[i2++]);
2161
+ let value = lines[i2++];
2062
2162
  let key = requestedKey;
2063
2163
  if (value.includes("\n")) {
2064
2164
  const line = splitOn(value, "\n");
@@ -2560,11 +2660,10 @@ var init_git_executor_chain = __esm({
2560
2660
  }
2561
2661
  async attemptRemoteTask(task, logger) {
2562
2662
  const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
2563
- const args = this._plugins.exec(
2564
- "spawn.args",
2565
- [...task.commands],
2566
- pluginContext(task, task.commands)
2567
- );
2663
+ const args = this._plugins.exec("spawn.args", [...task.commands], {
2664
+ ...pluginContext(task, task.commands),
2665
+ env: { ...this.env }
2666
+ });
2568
2667
  const raw = await this.gitResponse(
2569
2668
  task,
2570
2669
  binary,
@@ -3062,8 +3161,8 @@ var init_init = __esm({
3062
3161
  }
3063
3162
  });
3064
3163
  function logFormatFromCommand(customArgs) {
3065
- for (let i = 0; i < customArgs.length; i++) {
3066
- const format = logFormatRegex.exec(customArgs[i]);
3164
+ for (let i2 = 0; i2 < customArgs.length; i2++) {
3165
+ const format = logFormatRegex.exec(customArgs[i2]);
3067
3166
  if (format) {
3068
3167
  return `--${format[1]}`;
3069
3168
  }
@@ -4039,13 +4138,13 @@ var init_StatusSummary = __esm({
4039
4138
  parseStatusSummary = function(text) {
4040
4139
  const lines = text.split(NULL);
4041
4140
  const status2 = new StatusSummary();
4042
- for (let i = 0, l = lines.length; i < l; ) {
4043
- let line = lines[i++].trim();
4141
+ for (let i2 = 0, l = lines.length; i2 < l; ) {
4142
+ let line = lines[i2++].trim();
4044
4143
  if (!line) {
4045
4144
  continue;
4046
4145
  }
4047
4146
  if (line.charAt(0) === "R") {
4048
- line += NULL + (lines[i++] || "");
4147
+ line += NULL + (lines[i2++] || "");
4049
4148
  }
4050
4149
  splitLine(status2, line);
4051
4150
  }
@@ -4962,8 +5061,8 @@ var init_TagList = __esm({
4962
5061
  if (partsA.length === 1 || partsB.length === 1) {
4963
5062
  return singleSorted(toNumber(partsA[0]), toNumber(partsB[0]));
4964
5063
  }
4965
- for (let i = 0, l = Math.max(partsA.length, partsB.length); i < l; i++) {
4966
- const diff = sorted(toNumber(partsA[i]), toNumber(partsB[i]));
5064
+ for (let i2 = 0, l = Math.max(partsA.length, partsB.length); i2 < l; i2++) {
5065
+ const diff = sorted(toNumber(partsA[i2]), toNumber(partsB[i2]));
4967
5066
  if (diff) {
4968
5067
  return diff;
4969
5068
  }
@@ -5199,9 +5298,9 @@ var require_git = __commonJS2({
5199
5298
  Git2.prototype.raw = function(commands) {
5200
5299
  const createRestCommands = !Array.isArray(commands);
5201
5300
  const command = [].slice.call(createRestCommands ? arguments : commands, 0);
5202
- for (let i = 0; i < command.length && createRestCommands; i++) {
5203
- if (!filterPrimitives2(command[i])) {
5204
- command.splice(i, command.length - i);
5301
+ for (let i2 = 0; i2 < command.length && createRestCommands; i2++) {
5302
+ if (!filterPrimitives2(command[i2])) {
5303
+ command.splice(i2, command.length - i2);
5205
5304
  break;
5206
5305
  }
5207
5306
  }
@@ -5436,9 +5535,8 @@ function abortPlugin(signal) {
5436
5535
  function blockUnsafeOperationsPlugin(options = {}) {
5437
5536
  return {
5438
5537
  type: "spawn.args",
5439
- action(args) {
5440
- const parsed = V(...args);
5441
- for (const vulnerability of parsed.vulnerabilities.vulnerabilities) {
5538
+ action(args, { env }) {
5539
+ for (const vulnerability of ne(args, env)) {
5442
5540
  if (options[vulnerability.category] !== true) {
5443
5541
  throw new GitPluginError(void 0, "unsafe", vulnerability.message);
5444
5542
  }
@@ -5716,15 +5814,15 @@ function suffixPathsPlugin() {
5716
5814
  function append2(args) {
5717
5815
  (suffix = suffix || []).push(...args);
5718
5816
  }
5719
- for (let i = 0; i < data.length; i++) {
5720
- const param = data[i];
5817
+ for (let i2 = 0; i2 < data.length; i2++) {
5818
+ const param = data[i2];
5721
5819
  if (r(param)) {
5722
5820
  append2(o(param));
5723
5821
  continue;
5724
5822
  }
5725
5823
  if (param === "--") {
5726
5824
  append2(
5727
- data.slice(i + 1).flatMap((item) => r(item) && o(item) || item)
5825
+ data.slice(i2 + 1).flatMap((item) => r(item) && o(item) || item)
5728
5826
  );
5729
5827
  break;
5730
5828
  }
@@ -7847,8 +7945,8 @@ function validateAndTransformArray(value, transformItem) {
7847
7945
  }
7848
7946
  const result = [];
7849
7947
  const errors = [];
7850
- for (let i = 0; i < value.length; i++) {
7851
- const item = transformItem(value[i], i);
7948
+ for (let i2 = 0; i2 < value.length; i2++) {
7949
+ const item = transformItem(value[i2], i2);
7852
7950
  if (item.ok) {
7853
7951
  result.push(item.value);
7854
7952
  } else {
@@ -10132,7 +10230,7 @@ function formatBootstrapSummary(result) {
10132
10230
  const entries2 = [];
10133
10231
  const bs = result.bootstrap;
10134
10232
  if (!bs.generationCommit) {
10135
- const lockfileExists = bs.warnings.some((w2) => w2.includes("lockfile already exists"));
10233
+ const lockfileExists = bs.warnings.some((w) => w.includes("lockfile already exists"));
10136
10234
  if (lockfileExists) {
10137
10235
  entries2.push({
10138
10236
  level: "warn",
@@ -10180,8 +10278,8 @@ function formatBootstrapSummary(result) {
10180
10278
  }
10181
10279
  if (bs.warnings.length > 0) {
10182
10280
  entries2.push({ level: "info", message: "\nWarnings:" });
10183
- for (const w2 of bs.warnings) {
10184
- entries2.push({ level: "warn", message: ` ${w2}` });
10281
+ for (const w of bs.warnings) {
10282
+ entries2.push({ level: "warn", message: ` ${w}` });
10185
10283
  }
10186
10284
  }
10187
10285
  return entries2;
@@ -10224,8 +10322,8 @@ function buildPrBody(result) {
10224
10322
  if (result.warnings.length > 0) {
10225
10323
  lines.push("### Warnings");
10226
10324
  lines.push("");
10227
- for (const w2 of result.warnings) {
10228
- lines.push(`- ${w2}`);
10325
+ for (const w of result.warnings) {
10326
+ lines.push(`- ${w}`);
10229
10327
  }
10230
10328
  lines.push("");
10231
10329
  }
@@ -10297,7 +10395,7 @@ async function replayPrepare(params, state) {
10297
10395
  if (lockManager.exists()) {
10298
10396
  const lock = lockManager.read();
10299
10397
  previousGenerationSha = lock.current_generation;
10300
- const latestGen = lock.generations.find((g2) => g2.commit_sha === lock.current_generation);
10398
+ const latestGen = lock.generations.find((g) => g.commit_sha === lock.current_generation);
10301
10399
  prevBaseBranchHead = latestGen?.base_branch_head ?? null;
10302
10400
  }
10303
10401
  } catch {
@@ -10395,7 +10493,7 @@ async function replayApply(prepared, params = {}) {
10395
10493
  const freshLockManager = new import_replay4.LockfileManager(prepared.outputDir);
10396
10494
  if (freshLockManager.exists()) {
10397
10495
  const freshLock = freshLockManager.read();
10398
- const latestGen = freshLock.generations.find((g2) => g2.commit_sha === freshLock.current_generation);
10496
+ const latestGen = freshLock.generations.find((g) => g.commit_sha === freshLock.current_generation);
10399
10497
  if (latestGen?.base_branch_head) {
10400
10498
  resolvedBaseBranchHead = latestGen.base_branch_head;
10401
10499
  }