ai-hero-cli 0.2.3 → 0.2.5

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 (2) hide show
  1. package/bin.cjs +1488 -742
  2. package/package.json +1 -1
package/bin.cjs CHANGED
@@ -3886,8 +3886,8 @@ var require_compiler = __commonJS({
3886
3886
  valueAssignments.push(fullPath);
3887
3887
  }
3888
3888
  }
3889
- function pathAssigned(path14) {
3890
- return assignedPaths.indexOf(path14) !== -1;
3889
+ function pathAssigned(path15) {
3890
+ return assignedPaths.indexOf(path15) !== -1;
3891
3891
  }
3892
3892
  function reduceValueNode(node) {
3893
3893
  if (node.type === "Array") {
@@ -3911,20 +3911,20 @@ var require_compiler = __commonJS({
3911
3911
  return obj;
3912
3912
  }
3913
3913
  function setPath(node) {
3914
- var path14 = node.value;
3915
- var quotedPath = path14.map(quoteDottedString).join(".");
3914
+ var path15 = node.value;
3915
+ var quotedPath = path15.map(quoteDottedString).join(".");
3916
3916
  var line4 = node.line;
3917
3917
  var column3 = node.column;
3918
3918
  if (pathAssigned(quotedPath)) {
3919
- genError("Cannot redefine existing key '" + path14 + "'.", line4, column3);
3919
+ genError("Cannot redefine existing key '" + path15 + "'.", line4, column3);
3920
3920
  }
3921
3921
  assignedPaths.push(quotedPath);
3922
- context7 = deepRef(data, path14, /* @__PURE__ */ Object.create(null), line4, column3);
3923
- currentPath = path14;
3922
+ context7 = deepRef(data, path15, /* @__PURE__ */ Object.create(null), line4, column3);
3923
+ currentPath = path15;
3924
3924
  }
3925
3925
  function addTableArray(node) {
3926
- var path14 = node.value;
3927
- var quotedPath = path14.map(quoteDottedString).join(".");
3926
+ var path15 = node.value;
3927
+ var quotedPath = path15.map(quoteDottedString).join(".");
3928
3928
  var line4 = node.line;
3929
3929
  var column3 = node.column;
3930
3930
  if (!pathAssigned(quotedPath)) {
@@ -3934,14 +3934,14 @@ var require_compiler = __commonJS({
3934
3934
  return p3.indexOf(quotedPath) !== 0;
3935
3935
  });
3936
3936
  assignedPaths.push(quotedPath);
3937
- context7 = deepRef(data, path14, [], line4, column3);
3937
+ context7 = deepRef(data, path15, [], line4, column3);
3938
3938
  currentPath = quotedPath;
3939
3939
  if (context7 instanceof Array) {
3940
3940
  var newObj = /* @__PURE__ */ Object.create(null);
3941
3941
  context7.push(newObj);
3942
3942
  context7 = newObj;
3943
3943
  } else {
3944
- genError("Cannot redefine existing key '" + path14 + "'.", line4, column3);
3944
+ genError("Cannot redefine existing key '" + path15 + "'.", line4, column3);
3945
3945
  }
3946
3946
  }
3947
3947
  function deepRef(start5, keys6, value5, line4, column3) {
@@ -4086,17 +4086,17 @@ var require_visit = __commonJS({
4086
4086
  visit.BREAK = BREAK;
4087
4087
  visit.SKIP = SKIP;
4088
4088
  visit.REMOVE = REMOVE;
4089
- function visit_(key, node, visitor, path14) {
4090
- const ctrl = callVisitor(key, node, visitor, path14);
4089
+ function visit_(key, node, visitor, path15) {
4090
+ const ctrl = callVisitor(key, node, visitor, path15);
4091
4091
  if (identity3.isNode(ctrl) || identity3.isPair(ctrl)) {
4092
- replaceNode(key, path14, ctrl);
4093
- return visit_(key, ctrl, visitor, path14);
4092
+ replaceNode(key, path15, ctrl);
4093
+ return visit_(key, ctrl, visitor, path15);
4094
4094
  }
4095
4095
  if (typeof ctrl !== "symbol") {
4096
4096
  if (identity3.isCollection(node)) {
4097
- path14 = Object.freeze(path14.concat(node));
4097
+ path15 = Object.freeze(path15.concat(node));
4098
4098
  for (let i = 0; i < node.items.length; ++i) {
4099
- const ci = visit_(i, node.items[i], visitor, path14);
4099
+ const ci = visit_(i, node.items[i], visitor, path15);
4100
4100
  if (typeof ci === "number")
4101
4101
  i = ci - 1;
4102
4102
  else if (ci === BREAK)
@@ -4107,13 +4107,13 @@ var require_visit = __commonJS({
4107
4107
  }
4108
4108
  }
4109
4109
  } else if (identity3.isPair(node)) {
4110
- path14 = Object.freeze(path14.concat(node));
4111
- const ck = visit_("key", node.key, visitor, path14);
4110
+ path15 = Object.freeze(path15.concat(node));
4111
+ const ck = visit_("key", node.key, visitor, path15);
4112
4112
  if (ck === BREAK)
4113
4113
  return BREAK;
4114
4114
  else if (ck === REMOVE)
4115
4115
  node.key = null;
4116
- const cv = visit_("value", node.value, visitor, path14);
4116
+ const cv = visit_("value", node.value, visitor, path15);
4117
4117
  if (cv === BREAK)
4118
4118
  return BREAK;
4119
4119
  else if (cv === REMOVE)
@@ -4134,17 +4134,17 @@ var require_visit = __commonJS({
4134
4134
  visitAsync.BREAK = BREAK;
4135
4135
  visitAsync.SKIP = SKIP;
4136
4136
  visitAsync.REMOVE = REMOVE;
4137
- async function visitAsync_(key, node, visitor, path14) {
4138
- const ctrl = await callVisitor(key, node, visitor, path14);
4137
+ async function visitAsync_(key, node, visitor, path15) {
4138
+ const ctrl = await callVisitor(key, node, visitor, path15);
4139
4139
  if (identity3.isNode(ctrl) || identity3.isPair(ctrl)) {
4140
- replaceNode(key, path14, ctrl);
4141
- return visitAsync_(key, ctrl, visitor, path14);
4140
+ replaceNode(key, path15, ctrl);
4141
+ return visitAsync_(key, ctrl, visitor, path15);
4142
4142
  }
4143
4143
  if (typeof ctrl !== "symbol") {
4144
4144
  if (identity3.isCollection(node)) {
4145
- path14 = Object.freeze(path14.concat(node));
4145
+ path15 = Object.freeze(path15.concat(node));
4146
4146
  for (let i = 0; i < node.items.length; ++i) {
4147
- const ci = await visitAsync_(i, node.items[i], visitor, path14);
4147
+ const ci = await visitAsync_(i, node.items[i], visitor, path15);
4148
4148
  if (typeof ci === "number")
4149
4149
  i = ci - 1;
4150
4150
  else if (ci === BREAK)
@@ -4155,13 +4155,13 @@ var require_visit = __commonJS({
4155
4155
  }
4156
4156
  }
4157
4157
  } else if (identity3.isPair(node)) {
4158
- path14 = Object.freeze(path14.concat(node));
4159
- const ck = await visitAsync_("key", node.key, visitor, path14);
4158
+ path15 = Object.freeze(path15.concat(node));
4159
+ const ck = await visitAsync_("key", node.key, visitor, path15);
4160
4160
  if (ck === BREAK)
4161
4161
  return BREAK;
4162
4162
  else if (ck === REMOVE)
4163
4163
  node.key = null;
4164
- const cv = await visitAsync_("value", node.value, visitor, path14);
4164
+ const cv = await visitAsync_("value", node.value, visitor, path15);
4165
4165
  if (cv === BREAK)
4166
4166
  return BREAK;
4167
4167
  else if (cv === REMOVE)
@@ -4188,23 +4188,23 @@ var require_visit = __commonJS({
4188
4188
  }
4189
4189
  return visitor;
4190
4190
  }
4191
- function callVisitor(key, node, visitor, path14) {
4191
+ function callVisitor(key, node, visitor, path15) {
4192
4192
  if (typeof visitor === "function")
4193
- return visitor(key, node, path14);
4193
+ return visitor(key, node, path15);
4194
4194
  if (identity3.isMap(node))
4195
- return visitor.Map?.(key, node, path14);
4195
+ return visitor.Map?.(key, node, path15);
4196
4196
  if (identity3.isSeq(node))
4197
- return visitor.Seq?.(key, node, path14);
4197
+ return visitor.Seq?.(key, node, path15);
4198
4198
  if (identity3.isPair(node))
4199
- return visitor.Pair?.(key, node, path14);
4199
+ return visitor.Pair?.(key, node, path15);
4200
4200
  if (identity3.isScalar(node))
4201
- return visitor.Scalar?.(key, node, path14);
4201
+ return visitor.Scalar?.(key, node, path15);
4202
4202
  if (identity3.isAlias(node))
4203
- return visitor.Alias?.(key, node, path14);
4203
+ return visitor.Alias?.(key, node, path15);
4204
4204
  return void 0;
4205
4205
  }
4206
- function replaceNode(key, path14, node) {
4207
- const parent = path14[path14.length - 1];
4206
+ function replaceNode(key, path15, node) {
4207
+ const parent = path15[path15.length - 1];
4208
4208
  if (identity3.isCollection(parent)) {
4209
4209
  parent.items[key] = node;
4210
4210
  } else if (identity3.isPair(parent)) {
@@ -4803,10 +4803,10 @@ var require_Collection = __commonJS({
4803
4803
  var createNode = require_createNode();
4804
4804
  var identity3 = require_identity();
4805
4805
  var Node = require_Node();
4806
- function collectionFromPath(schema, path14, value5) {
4806
+ function collectionFromPath(schema, path15, value5) {
4807
4807
  let v = value5;
4808
- for (let i = path14.length - 1; i >= 0; --i) {
4809
- const k = path14[i];
4808
+ for (let i = path15.length - 1; i >= 0; --i) {
4809
+ const k = path15[i];
4810
4810
  if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
4811
4811
  const a = [];
4812
4812
  a[k] = v;
@@ -4825,7 +4825,7 @@ var require_Collection = __commonJS({
4825
4825
  sourceObjects: /* @__PURE__ */ new Map()
4826
4826
  });
4827
4827
  }
4828
- var isEmptyPath = (path14) => path14 == null || typeof path14 === "object" && !!path14[Symbol.iterator]().next().done;
4828
+ var isEmptyPath = (path15) => path15 == null || typeof path15 === "object" && !!path15[Symbol.iterator]().next().done;
4829
4829
  var Collection = class extends Node.NodeBase {
4830
4830
  constructor(type2, schema) {
4831
4831
  super(type2);
@@ -4855,11 +4855,11 @@ var require_Collection = __commonJS({
4855
4855
  * be a Pair instance or a `{ key, value }` object, which may not have a key
4856
4856
  * that already exists in the map.
4857
4857
  */
4858
- addIn(path14, value5) {
4859
- if (isEmptyPath(path14))
4858
+ addIn(path15, value5) {
4859
+ if (isEmptyPath(path15))
4860
4860
  this.add(value5);
4861
4861
  else {
4862
- const [key, ...rest] = path14;
4862
+ const [key, ...rest] = path15;
4863
4863
  const node = this.get(key, true);
4864
4864
  if (identity3.isCollection(node))
4865
4865
  node.addIn(rest, value5);
@@ -4873,8 +4873,8 @@ var require_Collection = __commonJS({
4873
4873
  * Removes a value from the collection.
4874
4874
  * @returns `true` if the item was found and removed.
4875
4875
  */
4876
- deleteIn(path14) {
4877
- const [key, ...rest] = path14;
4876
+ deleteIn(path15) {
4877
+ const [key, ...rest] = path15;
4878
4878
  if (rest.length === 0)
4879
4879
  return this.delete(key);
4880
4880
  const node = this.get(key, true);
@@ -4888,8 +4888,8 @@ var require_Collection = __commonJS({
4888
4888
  * scalar values from their surrounding node; to disable set `keepScalar` to
4889
4889
  * `true` (collections are always returned intact).
4890
4890
  */
4891
- getIn(path14, keepScalar) {
4892
- const [key, ...rest] = path14;
4891
+ getIn(path15, keepScalar) {
4892
+ const [key, ...rest] = path15;
4893
4893
  const node = this.get(key, true);
4894
4894
  if (rest.length === 0)
4895
4895
  return !keepScalar && identity3.isScalar(node) ? node.value : node;
@@ -4907,8 +4907,8 @@ var require_Collection = __commonJS({
4907
4907
  /**
4908
4908
  * Checks if the collection includes a value with the key `key`.
4909
4909
  */
4910
- hasIn(path14) {
4911
- const [key, ...rest] = path14;
4910
+ hasIn(path15) {
4911
+ const [key, ...rest] = path15;
4912
4912
  if (rest.length === 0)
4913
4913
  return this.has(key);
4914
4914
  const node = this.get(key, true);
@@ -4918,8 +4918,8 @@ var require_Collection = __commonJS({
4918
4918
  * Sets a value in this collection. For `!!set`, `value` needs to be a
4919
4919
  * boolean to add/remove the item from the set.
4920
4920
  */
4921
- setIn(path14, value5) {
4922
- const [key, ...rest] = path14;
4921
+ setIn(path15, value5) {
4922
+ const [key, ...rest] = path15;
4923
4923
  if (rest.length === 0) {
4924
4924
  this.set(key, value5);
4925
4925
  } else {
@@ -5593,8 +5593,8 @@ ${ctx.indent}`;
5593
5593
  const vs0 = valueStr[0];
5594
5594
  const nl0 = valueStr.indexOf("\n");
5595
5595
  const hasNewline = nl0 !== -1;
5596
- const flow3 = ctx.inFlow ?? value5.flow ?? value5.items.length === 0;
5597
- if (hasNewline || !flow3) {
5596
+ const flow2 = ctx.inFlow ?? value5.flow ?? value5.items.length === 0;
5597
+ if (hasNewline || !flow2) {
5598
5598
  let hasPropsLine = false;
5599
5599
  if (hasNewline && (vs0 === "&" || vs0 === "!")) {
5600
5600
  let sp0 = valueStr.indexOf(" ");
@@ -5812,8 +5812,8 @@ var require_stringifyCollection = __commonJS({
5812
5812
  var stringify2 = require_stringify();
5813
5813
  var stringifyComment = require_stringifyComment();
5814
5814
  function stringifyCollection(collection, ctx, options3) {
5815
- const flow3 = ctx.inFlow ?? collection.flow;
5816
- const stringify3 = flow3 ? stringifyFlowCollection : stringifyBlockCollection;
5815
+ const flow2 = ctx.inFlow ?? collection.flow;
5816
+ const stringify3 = flow2 ? stringifyFlowCollection : stringifyBlockCollection;
5817
5817
  return stringify3(collection, ctx, options3);
5818
5818
  }
5819
5819
  function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
@@ -7388,9 +7388,9 @@ var require_Document = __commonJS({
7388
7388
  this.contents.add(value5);
7389
7389
  }
7390
7390
  /** Adds a value to the document. */
7391
- addIn(path14, value5) {
7391
+ addIn(path15, value5) {
7392
7392
  if (assertCollection(this.contents))
7393
- this.contents.addIn(path14, value5);
7393
+ this.contents.addIn(path15, value5);
7394
7394
  }
7395
7395
  /**
7396
7396
  * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
@@ -7424,7 +7424,7 @@ var require_Document = __commonJS({
7424
7424
  options3 = replacer;
7425
7425
  replacer = void 0;
7426
7426
  }
7427
- const { aliasDuplicateObjects, anchorPrefix, flow: flow3, keepUndefined, onTagObj, tag: tag4 } = options3 ?? {};
7427
+ const { aliasDuplicateObjects, anchorPrefix, flow: flow2, keepUndefined, onTagObj, tag: tag4 } = options3 ?? {};
7428
7428
  const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors(
7429
7429
  this,
7430
7430
  // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
@@ -7440,7 +7440,7 @@ var require_Document = __commonJS({
7440
7440
  sourceObjects
7441
7441
  };
7442
7442
  const node = createNode.createNode(value5, tag4, ctx);
7443
- if (flow3 && identity3.isCollection(node))
7443
+ if (flow2 && identity3.isCollection(node))
7444
7444
  node.flow = true;
7445
7445
  setAnchors();
7446
7446
  return node;
@@ -7465,14 +7465,14 @@ var require_Document = __commonJS({
7465
7465
  * Removes a value from the document.
7466
7466
  * @returns `true` if the item was found and removed.
7467
7467
  */
7468
- deleteIn(path14) {
7469
- if (Collection.isEmptyPath(path14)) {
7468
+ deleteIn(path15) {
7469
+ if (Collection.isEmptyPath(path15)) {
7470
7470
  if (this.contents == null)
7471
7471
  return false;
7472
7472
  this.contents = null;
7473
7473
  return true;
7474
7474
  }
7475
- return assertCollection(this.contents) ? this.contents.deleteIn(path14) : false;
7475
+ return assertCollection(this.contents) ? this.contents.deleteIn(path15) : false;
7476
7476
  }
7477
7477
  /**
7478
7478
  * Returns item at `key`, or `undefined` if not found. By default unwraps
@@ -7487,10 +7487,10 @@ var require_Document = __commonJS({
7487
7487
  * scalar values from their surrounding node; to disable set `keepScalar` to
7488
7488
  * `true` (collections are always returned intact).
7489
7489
  */
7490
- getIn(path14, keepScalar) {
7491
- if (Collection.isEmptyPath(path14))
7490
+ getIn(path15, keepScalar) {
7491
+ if (Collection.isEmptyPath(path15))
7492
7492
  return !keepScalar && identity3.isScalar(this.contents) ? this.contents.value : this.contents;
7493
- return identity3.isCollection(this.contents) ? this.contents.getIn(path14, keepScalar) : void 0;
7493
+ return identity3.isCollection(this.contents) ? this.contents.getIn(path15, keepScalar) : void 0;
7494
7494
  }
7495
7495
  /**
7496
7496
  * Checks if the document includes a value with the key `key`.
@@ -7501,10 +7501,10 @@ var require_Document = __commonJS({
7501
7501
  /**
7502
7502
  * Checks if the document includes a value at `path`.
7503
7503
  */
7504
- hasIn(path14) {
7505
- if (Collection.isEmptyPath(path14))
7504
+ hasIn(path15) {
7505
+ if (Collection.isEmptyPath(path15))
7506
7506
  return this.contents !== void 0;
7507
- return identity3.isCollection(this.contents) ? this.contents.hasIn(path14) : false;
7507
+ return identity3.isCollection(this.contents) ? this.contents.hasIn(path15) : false;
7508
7508
  }
7509
7509
  /**
7510
7510
  * Sets a value in this document. For `!!set`, `value` needs to be a
@@ -7521,13 +7521,13 @@ var require_Document = __commonJS({
7521
7521
  * Sets a value in this document. For `!!set`, `value` needs to be a
7522
7522
  * boolean to add/remove the item from the set.
7523
7523
  */
7524
- setIn(path14, value5) {
7525
- if (Collection.isEmptyPath(path14)) {
7524
+ setIn(path15, value5) {
7525
+ if (Collection.isEmptyPath(path15)) {
7526
7526
  this.contents = value5;
7527
7527
  } else if (this.contents == null) {
7528
- this.contents = Collection.collectionFromPath(this.schema, Array.from(path14), value5);
7528
+ this.contents = Collection.collectionFromPath(this.schema, Array.from(path15), value5);
7529
7529
  } else if (assertCollection(this.contents)) {
7530
- this.contents.setIn(path14, value5);
7530
+ this.contents.setIn(path15, value5);
7531
7531
  }
7532
7532
  }
7533
7533
  /**
@@ -7686,7 +7686,7 @@ ${pointer}
7686
7686
  // node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-props.js
7687
7687
  var require_resolve_props = __commonJS({
7688
7688
  "node_modules/.pnpm/yaml@2.8.1/node_modules/yaml/dist/compose/resolve-props.js"(exports) {
7689
- function resolveProps(tokens, { flow: flow3, indicator, next, offset, onError: onError4, parentIndent, startOnNewline }) {
7689
+ function resolveProps(tokens, { flow: flow2, indicator, next, offset, onError: onError4, parentIndent, startOnNewline }) {
7690
7690
  let spaceBefore = false;
7691
7691
  let atNewline = startOnNewline;
7692
7692
  let hasSpace = startOnNewline;
@@ -7715,7 +7715,7 @@ var require_resolve_props = __commonJS({
7715
7715
  }
7716
7716
  switch (token.type) {
7717
7717
  case "space":
7718
- if (!flow3 && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes(" ")) {
7718
+ if (!flow2 && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes(" ")) {
7719
7719
  tab = token;
7720
7720
  }
7721
7721
  hasSpace = true;
@@ -7771,15 +7771,15 @@ var require_resolve_props = __commonJS({
7771
7771
  if (anchor || tag4)
7772
7772
  onError4(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`);
7773
7773
  if (found)
7774
- onError4(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow3 ?? "collection"}`);
7774
+ onError4(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow2 ?? "collection"}`);
7775
7775
  found = token;
7776
7776
  atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind";
7777
7777
  hasSpace = false;
7778
7778
  break;
7779
7779
  case "comma":
7780
- if (flow3) {
7780
+ if (flow2) {
7781
7781
  if (comma3)
7782
- onError4(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow3}`);
7782
+ onError4(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow2}`);
7783
7783
  comma3 = token;
7784
7784
  atNewline = false;
7785
7785
  hasSpace = false;
@@ -9459,9 +9459,9 @@ var require_cst_visit = __commonJS({
9459
9459
  visit.BREAK = BREAK;
9460
9460
  visit.SKIP = SKIP;
9461
9461
  visit.REMOVE = REMOVE;
9462
- visit.itemAtPath = (cst, path14) => {
9462
+ visit.itemAtPath = (cst, path15) => {
9463
9463
  let item = cst;
9464
- for (const [field, index] of path14) {
9464
+ for (const [field, index] of path15) {
9465
9465
  const tok = item?.[field];
9466
9466
  if (tok && "items" in tok) {
9467
9467
  item = tok.items[index];
@@ -9470,23 +9470,23 @@ var require_cst_visit = __commonJS({
9470
9470
  }
9471
9471
  return item;
9472
9472
  };
9473
- visit.parentCollection = (cst, path14) => {
9474
- const parent = visit.itemAtPath(cst, path14.slice(0, -1));
9475
- const field = path14[path14.length - 1][0];
9473
+ visit.parentCollection = (cst, path15) => {
9474
+ const parent = visit.itemAtPath(cst, path15.slice(0, -1));
9475
+ const field = path15[path15.length - 1][0];
9476
9476
  const coll = parent?.[field];
9477
9477
  if (coll && "items" in coll)
9478
9478
  return coll;
9479
9479
  throw new Error("Parent collection not found");
9480
9480
  };
9481
- function _visit(path14, item, visitor) {
9482
- let ctrl = visitor(item, path14);
9481
+ function _visit(path15, item, visitor) {
9482
+ let ctrl = visitor(item, path15);
9483
9483
  if (typeof ctrl === "symbol")
9484
9484
  return ctrl;
9485
9485
  for (const field of ["key", "value"]) {
9486
9486
  const token = item[field];
9487
9487
  if (token && "items" in token) {
9488
9488
  for (let i = 0; i < token.items.length; ++i) {
9489
- const ci = _visit(Object.freeze(path14.concat([[field, i]])), token.items[i], visitor);
9489
+ const ci = _visit(Object.freeze(path15.concat([[field, i]])), token.items[i], visitor);
9490
9490
  if (typeof ci === "number")
9491
9491
  i = ci - 1;
9492
9492
  else if (ci === BREAK)
@@ -9497,10 +9497,10 @@ var require_cst_visit = __commonJS({
9497
9497
  }
9498
9498
  }
9499
9499
  if (typeof ctrl === "function" && field === "key")
9500
- ctrl = ctrl(item, path14);
9500
+ ctrl = ctrl(item, path15);
9501
9501
  }
9502
9502
  }
9503
- return typeof ctrl === "function" ? ctrl(item, path14) : ctrl;
9503
+ return typeof ctrl === "function" ? ctrl(item, path15) : ctrl;
9504
9504
  }
9505
9505
  exports.visit = visit;
9506
9506
  }
@@ -11482,10 +11482,10 @@ var require_clear = __commonJS({
11482
11482
  var erase = _require.erase;
11483
11483
  var cursor = _require.cursor;
11484
11484
  var width3 = (str) => [...strip(str)].length;
11485
- module.exports = function(prompt6, perLine) {
11485
+ module.exports = function(prompt8, perLine) {
11486
11486
  if (!perLine) return erase.line + cursor.to(0);
11487
11487
  let rows = 0;
11488
- const lines4 = prompt6.split(/\r?\n/);
11488
+ const lines4 = prompt8.split(/\r?\n/);
11489
11489
  var _iterator = _createForOfIteratorHelper(lines4), _step;
11490
11490
  try {
11491
11491
  for (_iterator.s(); !(_step = _iterator.n()).done; ) {
@@ -13086,14 +13086,14 @@ Instructions:
13086
13086
  if (this.closed) return;
13087
13087
  if (this.firstRender) this.out.write(cursor.hide);
13088
13088
  super.render();
13089
- let prompt6 = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
13089
+ let prompt8 = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
13090
13090
  if (this.showMinError) {
13091
- prompt6 += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
13091
+ prompt8 += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
13092
13092
  this.showMinError = false;
13093
13093
  }
13094
- prompt6 += this.renderOptions(this.value);
13095
- this.out.write(this.clear + prompt6);
13096
- this.clear = clear3(prompt6, this.out.columns);
13094
+ prompt8 += this.renderOptions(this.value);
13095
+ this.out.write(this.clear + prompt8);
13096
+ this.clear = clear3(prompt8, this.out.columns);
13097
13097
  }
13098
13098
  };
13099
13099
  module.exports = MultiselectPrompt;
@@ -13498,14 +13498,14 @@ Filtered results for: ${this.inputValue ? this.inputValue : color3.gray("Enter s
13498
13498
  if (this.closed) return;
13499
13499
  if (this.firstRender) this.out.write(cursor.hide);
13500
13500
  super.render();
13501
- let prompt6 = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
13501
+ let prompt8 = [style.symbol(this.done, this.aborted), color3.bold(this.msg), style.delimiter(false), this.renderDoneOrInstructions()].join(" ");
13502
13502
  if (this.showMinError) {
13503
- prompt6 += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
13503
+ prompt8 += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
13504
13504
  this.showMinError = false;
13505
13505
  }
13506
- prompt6 += this.renderOptions(this.filteredOptions);
13507
- this.out.write(this.clear + prompt6);
13508
- this.clear = clear3(prompt6, this.out.columns);
13506
+ prompt8 += this.renderOptions(this.filteredOptions);
13507
+ this.out.write(this.clear + prompt8);
13508
+ this.clear = clear3(prompt8, this.out.columns);
13509
13509
  }
13510
13510
  };
13511
13511
  module.exports = AutocompleteMultiselectPrompt;
@@ -13785,7 +13785,7 @@ var require_dist2 = __commonJS({
13785
13785
  var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
13786
13786
  var noop = () => {
13787
13787
  };
13788
- function prompt6() {
13788
+ function prompt8() {
13789
13789
  return _prompt.apply(this, arguments);
13790
13790
  }
13791
13791
  function _prompt() {
@@ -13794,7 +13794,7 @@ var require_dist2 = __commonJS({
13794
13794
  onCancel = noop
13795
13795
  } = {}) {
13796
13796
  const answers = {};
13797
- const override2 = prompt6._override || {};
13797
+ const override2 = prompt8._override || {};
13798
13798
  questions = [].concat(questions);
13799
13799
  let answer, question, quit, name, type2, lastPrompt;
13800
13800
  const getFormattedAnswer = /* @__PURE__ */ (function() {
@@ -13843,7 +13843,7 @@ var require_dist2 = __commonJS({
13843
13843
  }
13844
13844
  }
13845
13845
  try {
13846
- answer = prompt6._injected ? getInjectedAnswer(prompt6._injected, question.initial) : yield prompts[type2](question);
13846
+ answer = prompt8._injected ? getInjectedAnswer(prompt8._injected, question.initial) : yield prompts[type2](question);
13847
13847
  answers[name] = answer = yield getFormattedAnswer(question, answer, true);
13848
13848
  quit = yield onSubmit(question, answer, answers);
13849
13849
  } catch (err) {
@@ -13868,13 +13868,13 @@ var require_dist2 = __commonJS({
13868
13868
  return answer === void 0 ? deafultValue : answer;
13869
13869
  }
13870
13870
  function inject(answers) {
13871
- prompt6._injected = (prompt6._injected || []).concat(answers);
13871
+ prompt8._injected = (prompt8._injected || []).concat(answers);
13872
13872
  }
13873
13873
  function override(answers) {
13874
- prompt6._override = Object.assign({}, answers);
13874
+ prompt8._override = Object.assign({}, answers);
13875
13875
  }
13876
- module.exports = Object.assign(prompt6, {
13877
- prompt: prompt6,
13876
+ module.exports = Object.assign(prompt8, {
13877
+ prompt: prompt8,
13878
13878
  prompts,
13879
13879
  inject,
13880
13880
  override
@@ -13938,10 +13938,10 @@ var require_clear2 = __commonJS({
13938
13938
  var strip = require_strip2();
13939
13939
  var { erase, cursor } = require_src();
13940
13940
  var width3 = (str) => [...strip(str)].length;
13941
- module.exports = function(prompt6, perLine) {
13941
+ module.exports = function(prompt8, perLine) {
13942
13942
  if (!perLine) return erase.line + cursor.to(0);
13943
13943
  let rows = 0;
13944
- const lines4 = prompt6.split(/\r?\n/);
13944
+ const lines4 = prompt8.split(/\r?\n/);
13945
13945
  for (let line4 of lines4) {
13946
13946
  rows += 1 + Math.floor(Math.max(width3(line4) - 1, 0) / perLine);
13947
13947
  }
@@ -15380,19 +15380,19 @@ Instructions:
15380
15380
  if (this.closed) return;
15381
15381
  if (this.firstRender) this.out.write(cursor.hide);
15382
15382
  super.render();
15383
- let prompt6 = [
15383
+ let prompt8 = [
15384
15384
  style.symbol(this.done, this.aborted),
15385
15385
  color3.bold(this.msg),
15386
15386
  style.delimiter(false),
15387
15387
  this.renderDoneOrInstructions()
15388
15388
  ].join(" ");
15389
15389
  if (this.showMinError) {
15390
- prompt6 += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
15390
+ prompt8 += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
15391
15391
  this.showMinError = false;
15392
15392
  }
15393
- prompt6 += this.renderOptions(this.value);
15394
- this.out.write(this.clear + prompt6);
15395
- this.clear = clear3(prompt6, this.out.columns);
15393
+ prompt8 += this.renderOptions(this.value);
15394
+ this.out.write(this.clear + prompt8);
15395
+ this.clear = clear3(prompt8, this.out.columns);
15396
15396
  }
15397
15397
  };
15398
15398
  module.exports = MultiselectPrompt;
@@ -15754,19 +15754,19 @@ Filtered results for: ${this.inputValue ? this.inputValue : color3.gray("Enter s
15754
15754
  if (this.closed) return;
15755
15755
  if (this.firstRender) this.out.write(cursor.hide);
15756
15756
  super.render();
15757
- let prompt6 = [
15757
+ let prompt8 = [
15758
15758
  style.symbol(this.done, this.aborted),
15759
15759
  color3.bold(this.msg),
15760
15760
  style.delimiter(false),
15761
15761
  this.renderDoneOrInstructions()
15762
15762
  ].join(" ");
15763
15763
  if (this.showMinError) {
15764
- prompt6 += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
15764
+ prompt8 += color3.red(`You must select a minimum of ${this.minSelected} choices.`);
15765
15765
  this.showMinError = false;
15766
15766
  }
15767
- prompt6 += this.renderOptions(this.filteredOptions);
15768
- this.out.write(this.clear + prompt6);
15769
- this.clear = clear3(prompt6, this.out.columns);
15767
+ prompt8 += this.renderOptions(this.filteredOptions);
15768
+ this.out.write(this.clear + prompt8);
15769
+ this.clear = clear3(prompt8, this.out.columns);
15770
15770
  }
15771
15771
  };
15772
15772
  module.exports = AutocompleteMultiselectPrompt;
@@ -15934,9 +15934,9 @@ var require_lib = __commonJS({
15934
15934
  var passOn = ["suggest", "format", "onState", "validate", "onRender", "type"];
15935
15935
  var noop = () => {
15936
15936
  };
15937
- async function prompt6(questions = [], { onSubmit = noop, onCancel = noop } = {}) {
15937
+ async function prompt8(questions = [], { onSubmit = noop, onCancel = noop } = {}) {
15938
15938
  const answers = {};
15939
- const override2 = prompt6._override || {};
15939
+ const override2 = prompt8._override || {};
15940
15940
  questions = [].concat(questions);
15941
15941
  let answer, question, quit, name, type2, lastPrompt;
15942
15942
  const getFormattedAnswer = async (question2, answer2, skipValidation = false) => {
@@ -15973,7 +15973,7 @@ var require_lib = __commonJS({
15973
15973
  }
15974
15974
  }
15975
15975
  try {
15976
- answer = prompt6._injected ? getInjectedAnswer(prompt6._injected, question.initial) : await prompts[type2](question);
15976
+ answer = prompt8._injected ? getInjectedAnswer(prompt8._injected, question.initial) : await prompts[type2](question);
15977
15977
  answers[name] = answer = await getFormattedAnswer(question, answer, true);
15978
15978
  quit = await onSubmit(question, answer, answers);
15979
15979
  } catch (err) {
@@ -15991,12 +15991,12 @@ var require_lib = __commonJS({
15991
15991
  return answer === void 0 ? deafultValue : answer;
15992
15992
  }
15993
15993
  function inject(answers) {
15994
- prompt6._injected = (prompt6._injected || []).concat(answers);
15994
+ prompt8._injected = (prompt8._injected || []).concat(answers);
15995
15995
  }
15996
15996
  function override(answers) {
15997
- prompt6._override = Object.assign({}, answers);
15997
+ prompt8._override = Object.assign({}, answers);
15998
15998
  }
15999
- module.exports = Object.assign(prompt6, { prompt: prompt6, prompts, inject, override });
15999
+ module.exports = Object.assign(prompt8, { prompt: prompt8, prompts, inject, override });
16000
16000
  }
16001
16001
  });
16002
16002
 
@@ -16923,14 +16923,14 @@ var require_util3 = __commonJS({
16923
16923
  }
16924
16924
  const port2 = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
16925
16925
  let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port2}`;
16926
- let path14 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
16926
+ let path15 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
16927
16927
  if (origin[origin.length - 1] === "/") {
16928
16928
  origin = origin.slice(0, origin.length - 1);
16929
16929
  }
16930
- if (path14 && path14[0] !== "/") {
16931
- path14 = `/${path14}`;
16930
+ if (path15 && path15[0] !== "/") {
16931
+ path15 = `/${path15}`;
16932
16932
  }
16933
- return new URL(`${origin}${path14}`);
16933
+ return new URL(`${origin}${path15}`);
16934
16934
  }
16935
16935
  if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
16936
16936
  throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
@@ -17476,9 +17476,9 @@ var require_diagnostics = __commonJS({
17476
17476
  "undici:client:sendHeaders",
17477
17477
  (evt) => {
17478
17478
  const {
17479
- request: { method, path: path14, origin }
17479
+ request: { method, path: path15, origin }
17480
17480
  } = evt;
17481
- debugLog("sending request to %s %s%s", method, origin, path14);
17481
+ debugLog("sending request to %s %s%s", method, origin, path15);
17482
17482
  }
17483
17483
  );
17484
17484
  }
@@ -17492,14 +17492,14 @@ var require_diagnostics = __commonJS({
17492
17492
  "undici:request:headers",
17493
17493
  (evt) => {
17494
17494
  const {
17495
- request: { method, path: path14, origin },
17495
+ request: { method, path: path15, origin },
17496
17496
  response: { statusCode }
17497
17497
  } = evt;
17498
17498
  debugLog(
17499
17499
  "received response to %s %s%s - HTTP %d",
17500
17500
  method,
17501
17501
  origin,
17502
- path14,
17502
+ path15,
17503
17503
  statusCode
17504
17504
  );
17505
17505
  }
@@ -17508,23 +17508,23 @@ var require_diagnostics = __commonJS({
17508
17508
  "undici:request:trailers",
17509
17509
  (evt) => {
17510
17510
  const {
17511
- request: { method, path: path14, origin }
17511
+ request: { method, path: path15, origin }
17512
17512
  } = evt;
17513
- debugLog("trailers received from %s %s%s", method, origin, path14);
17513
+ debugLog("trailers received from %s %s%s", method, origin, path15);
17514
17514
  }
17515
17515
  );
17516
17516
  diagnosticsChannel.subscribe(
17517
17517
  "undici:request:error",
17518
17518
  (evt) => {
17519
17519
  const {
17520
- request: { method, path: path14, origin },
17520
+ request: { method, path: path15, origin },
17521
17521
  error: error4
17522
17522
  } = evt;
17523
17523
  debugLog(
17524
17524
  "request to %s %s%s errored - %s",
17525
17525
  method,
17526
17526
  origin,
17527
- path14,
17527
+ path15,
17528
17528
  error4.message
17529
17529
  );
17530
17530
  }
@@ -17618,7 +17618,7 @@ var require_request = __commonJS({
17618
17618
  var kHandler = Symbol("handler");
17619
17619
  var Request = class {
17620
17620
  constructor(origin, {
17621
- path: path14,
17621
+ path: path15,
17622
17622
  method,
17623
17623
  body,
17624
17624
  headers,
@@ -17634,11 +17634,11 @@ var require_request = __commonJS({
17634
17634
  throwOnError,
17635
17635
  maxRedirections
17636
17636
  }, handler) {
17637
- if (typeof path14 !== "string") {
17637
+ if (typeof path15 !== "string") {
17638
17638
  throw new InvalidArgumentError("path must be a string");
17639
- } else if (path14[0] !== "/" && !(path14.startsWith("http://") || path14.startsWith("https://")) && method !== "CONNECT") {
17639
+ } else if (path15[0] !== "/" && !(path15.startsWith("http://") || path15.startsWith("https://")) && method !== "CONNECT") {
17640
17640
  throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
17641
- } else if (invalidPathRegex.test(path14)) {
17641
+ } else if (invalidPathRegex.test(path15)) {
17642
17642
  throw new InvalidArgumentError("invalid request path");
17643
17643
  }
17644
17644
  if (typeof method !== "string") {
@@ -17706,7 +17706,7 @@ var require_request = __commonJS({
17706
17706
  this.completed = false;
17707
17707
  this.aborted = false;
17708
17708
  this.upgrade = upgrade || null;
17709
- this.path = query ? serializePathWithQuery(path14, query) : path14;
17709
+ this.path = query ? serializePathWithQuery(path15, query) : path15;
17710
17710
  this.origin = origin;
17711
17711
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
17712
17712
  this.blocking = blocking ?? this.method !== "HEAD";
@@ -22449,7 +22449,7 @@ var require_client_h1 = __commonJS({
22449
22449
  return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
22450
22450
  }
22451
22451
  function writeH1(client, request2) {
22452
- const { method, path: path14, host, upgrade, blocking, reset: reset3 } = request2;
22452
+ const { method, path: path15, host, upgrade, blocking, reset: reset3 } = request2;
22453
22453
  let { body, headers, contentLength } = request2;
22454
22454
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
22455
22455
  if (util.isFormDataLike(body)) {
@@ -22515,7 +22515,7 @@ var require_client_h1 = __commonJS({
22515
22515
  if (blocking) {
22516
22516
  socket[kBlocking] = true;
22517
22517
  }
22518
- let header = `${method} ${path14} HTTP/1.1\r
22518
+ let header = `${method} ${path15} HTTP/1.1\r
22519
22519
  `;
22520
22520
  if (typeof host === "string") {
22521
22521
  header += `host: ${host}\r
@@ -23071,7 +23071,7 @@ var require_client_h2 = __commonJS({
23071
23071
  function writeH2(client, request2) {
23072
23072
  const requestTimeout = request2.bodyTimeout ?? client[kBodyTimeout];
23073
23073
  const session = client[kHTTP2Session];
23074
- const { method, path: path14, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2;
23074
+ const { method, path: path15, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2;
23075
23075
  let { body } = request2;
23076
23076
  if (upgrade) {
23077
23077
  util.errorRequest(client, request2, new Error("Upgrade not supported for H2"));
@@ -23142,7 +23142,7 @@ var require_client_h2 = __commonJS({
23142
23142
  stream4.setTimeout(requestTimeout);
23143
23143
  return true;
23144
23144
  }
23145
- headers[HTTP2_HEADER_PATH] = path14;
23145
+ headers[HTTP2_HEADER_PATH] = path15;
23146
23146
  headers[HTTP2_HEADER_SCHEME] = "https";
23147
23147
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
23148
23148
  if (body && typeof body.read === "function") {
@@ -24581,10 +24581,10 @@ var require_proxy_agent = __commonJS({
24581
24581
  };
24582
24582
  const {
24583
24583
  origin,
24584
- path: path14 = "/",
24584
+ path: path15 = "/",
24585
24585
  headers = {}
24586
24586
  } = opts;
24587
- opts.path = origin + path14;
24587
+ opts.path = origin + path15;
24588
24588
  if (!("host" in headers) && !("Host" in headers)) {
24589
24589
  const { host } = new URL2(origin);
24590
24590
  headers.host = host;
@@ -26638,20 +26638,20 @@ var require_mock_utils = __commonJS({
26638
26638
  }
26639
26639
  return normalizedQp;
26640
26640
  }
26641
- function safeUrl(path14) {
26642
- if (typeof path14 !== "string") {
26643
- return path14;
26641
+ function safeUrl(path15) {
26642
+ if (typeof path15 !== "string") {
26643
+ return path15;
26644
26644
  }
26645
- const pathSegments = path14.split("?", 3);
26645
+ const pathSegments = path15.split("?", 3);
26646
26646
  if (pathSegments.length !== 2) {
26647
- return path14;
26647
+ return path15;
26648
26648
  }
26649
26649
  const qp = new URLSearchParams(pathSegments.pop());
26650
26650
  qp.sort();
26651
26651
  return [...pathSegments, qp.toString()].join("?");
26652
26652
  }
26653
- function matchKey(mockDispatch2, { path: path14, method, body, headers }) {
26654
- const pathMatch = matchValue(mockDispatch2.path, path14);
26653
+ function matchKey(mockDispatch2, { path: path15, method, body, headers }) {
26654
+ const pathMatch = matchValue(mockDispatch2.path, path15);
26655
26655
  const methodMatch = matchValue(mockDispatch2.method, method);
26656
26656
  const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
26657
26657
  const headersMatch = matchHeaders(mockDispatch2, headers);
@@ -26676,8 +26676,8 @@ var require_mock_utils = __commonJS({
26676
26676
  const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
26677
26677
  const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
26678
26678
  const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
26679
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path14, ignoreTrailingSlash }) => {
26680
- return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path14)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path14), resolvedPath);
26679
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path15, ignoreTrailingSlash }) => {
26680
+ return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path15)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path15), resolvedPath);
26681
26681
  });
26682
26682
  if (matchedMockDispatches.length === 0) {
26683
26683
  throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
@@ -26715,19 +26715,19 @@ var require_mock_utils = __commonJS({
26715
26715
  mockDispatches.splice(index, 1);
26716
26716
  }
26717
26717
  }
26718
- function removeTrailingSlash(path14) {
26719
- while (path14.endsWith("/")) {
26720
- path14 = path14.slice(0, -1);
26718
+ function removeTrailingSlash(path15) {
26719
+ while (path15.endsWith("/")) {
26720
+ path15 = path15.slice(0, -1);
26721
26721
  }
26722
- if (path14.length === 0) {
26723
- path14 = "/";
26722
+ if (path15.length === 0) {
26723
+ path15 = "/";
26724
26724
  }
26725
- return path14;
26725
+ return path15;
26726
26726
  }
26727
26727
  function buildKey(opts) {
26728
- const { path: path14, method, body, headers, query } = opts;
26728
+ const { path: path15, method, body, headers, query } = opts;
26729
26729
  return {
26730
- path: path14,
26730
+ path: path15,
26731
26731
  method,
26732
26732
  body,
26733
26733
  headers,
@@ -27360,7 +27360,7 @@ var require_mock_pool = __commonJS({
27360
27360
  var require_pending_interceptors_formatter = __commonJS({
27361
27361
  "node_modules/.pnpm/undici@7.13.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js"(exports, module) {
27362
27362
  var { Transform } = __require("stream");
27363
- var { Console: Console3 } = __require("console");
27363
+ var { Console: Console2 } = __require("console");
27364
27364
  var PERSISTENT = process.versions.icu ? "\u2705" : "Y ";
27365
27365
  var NOT_PERSISTENT = process.versions.icu ? "\u274C" : "N ";
27366
27366
  module.exports = class PendingInterceptorsFormatter {
@@ -27370,7 +27370,7 @@ var require_pending_interceptors_formatter = __commonJS({
27370
27370
  cb(null, chunk4);
27371
27371
  }
27372
27372
  });
27373
- this.logger = new Console3({
27373
+ this.logger = new Console2({
27374
27374
  stdout: this.transform,
27375
27375
  inspectOptions: {
27376
27376
  colors: !disableColors && !process.env.CI
@@ -27379,10 +27379,10 @@ var require_pending_interceptors_formatter = __commonJS({
27379
27379
  }
27380
27380
  format(pendingInterceptors) {
27381
27381
  const withPrettyHeaders = pendingInterceptors.map(
27382
- ({ method, path: path14, data: { statusCode }, persist, times: times2, timesInvoked, origin }) => ({
27382
+ ({ method, path: path15, data: { statusCode }, persist, times: times2, timesInvoked, origin }) => ({
27383
27383
  Method: method,
27384
27384
  Origin: origin,
27385
- Path: path14,
27385
+ Path: path15,
27386
27386
  "Status code": statusCode,
27387
27387
  Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
27388
27388
  Invocations: timesInvoked,
@@ -27461,9 +27461,9 @@ var require_mock_agent = __commonJS({
27461
27461
  const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
27462
27462
  const dispatchOpts = { ...opts };
27463
27463
  if (acceptNonStandardSearchParameters && dispatchOpts.path) {
27464
- const [path14, searchParams] = dispatchOpts.path.split("?");
27464
+ const [path15, searchParams] = dispatchOpts.path.split("?");
27465
27465
  const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
27466
- dispatchOpts.path = `${path14}?${normalizedSearchParams}`;
27466
+ dispatchOpts.path = `${path15}?${normalizedSearchParams}`;
27467
27467
  }
27468
27468
  return this[kAgent].dispatch(dispatchOpts, handler);
27469
27469
  }
@@ -27801,12 +27801,12 @@ var require_snapshot_recorder = __commonJS({
27801
27801
  * Loads snapshots from file
27802
27802
  */
27803
27803
  async loadSnapshots(filePath) {
27804
- const path14 = filePath || this.snapshotPath;
27805
- if (!path14) {
27804
+ const path15 = filePath || this.snapshotPath;
27805
+ if (!path15) {
27806
27806
  throw new InvalidArgumentError("Snapshot path is required");
27807
27807
  }
27808
27808
  try {
27809
- const data = await readFile3(resolve7(path14), "utf8");
27809
+ const data = await readFile3(resolve7(path15), "utf8");
27810
27810
  const parsed = JSON.parse(data);
27811
27811
  if (Array.isArray(parsed)) {
27812
27812
  this.snapshots.clear();
@@ -27822,7 +27822,7 @@ var require_snapshot_recorder = __commonJS({
27822
27822
  this.snapshots.clear();
27823
27823
  this.loaded = true;
27824
27824
  } else {
27825
- throw new UndiciError(`Failed to load snapshots from ${path14}`, { cause: error4 });
27825
+ throw new UndiciError(`Failed to load snapshots from ${path15}`, { cause: error4 });
27826
27826
  }
27827
27827
  }
27828
27828
  }
@@ -27830,11 +27830,11 @@ var require_snapshot_recorder = __commonJS({
27830
27830
  * Saves snapshots to file
27831
27831
  */
27832
27832
  async saveSnapshots(filePath) {
27833
- const path14 = filePath || this.snapshotPath;
27834
- if (!path14) {
27833
+ const path15 = filePath || this.snapshotPath;
27834
+ if (!path15) {
27835
27835
  throw new InvalidArgumentError("Snapshot path is required");
27836
27836
  }
27837
- const resolvedPath = resolve7(path14);
27837
+ const resolvedPath = resolve7(path15);
27838
27838
  await mkdir2(dirname3(resolvedPath), { recursive: true });
27839
27839
  const data = Array.from(this.snapshots.entries()).map(([hash2, snapshot]) => ({
27840
27840
  hash: hash2,
@@ -28411,15 +28411,15 @@ var require_redirect_handler = __commonJS({
28411
28411
  return;
28412
28412
  }
28413
28413
  const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
28414
- const path14 = search ? `${pathname}${search}` : pathname;
28415
- const redirectUrlString = `${origin}${path14}`;
28414
+ const path15 = search ? `${pathname}${search}` : pathname;
28415
+ const redirectUrlString = `${origin}${path15}`;
28416
28416
  for (const historyUrl of this.history) {
28417
28417
  if (historyUrl.toString() === redirectUrlString) {
28418
28418
  throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
28419
28419
  }
28420
28420
  }
28421
28421
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
28422
- this.opts.path = path14;
28422
+ this.opts.path = path15;
28423
28423
  this.opts.origin = origin;
28424
28424
  this.opts.query = null;
28425
28425
  }
@@ -34043,9 +34043,9 @@ var require_util6 = __commonJS({
34043
34043
  }
34044
34044
  }
34045
34045
  }
34046
- function validateCookiePath(path14) {
34047
- for (let i = 0; i < path14.length; ++i) {
34048
- const code2 = path14.charCodeAt(i);
34046
+ function validateCookiePath(path15) {
34047
+ for (let i = 0; i < path15.length; ++i) {
34048
+ const code2 = path15.charCodeAt(i);
34049
34049
  if (code2 < 32 || // exclude CTLs (0-31)
34050
34050
  code2 === 127 || // DEL
34051
34051
  code2 === 59) {
@@ -37102,11 +37102,11 @@ var require_undici = __commonJS({
37102
37102
  if (typeof opts.path !== "string") {
37103
37103
  throw new InvalidArgumentError("invalid opts.path");
37104
37104
  }
37105
- let path14 = opts.path;
37105
+ let path15 = opts.path;
37106
37106
  if (!opts.path.startsWith("/")) {
37107
- path14 = `/${path14}`;
37107
+ path15 = `/${path15}`;
37108
37108
  }
37109
- url2 = new URL(util.parseOrigin(url2).origin + path14);
37109
+ url2 = new URL(util.parseOrigin(url2).origin + path15);
37110
37110
  } else {
37111
37111
  if (!opts) {
37112
37112
  opts = typeof url2 === "object" ? url2 : {};
@@ -38526,11 +38526,11 @@ var require_lodash = __commonJS({
38526
38526
  return isFunction3(object[key]);
38527
38527
  });
38528
38528
  }
38529
- function baseGet(object, path14) {
38530
- path14 = castPath(path14, object);
38531
- var index = 0, length4 = path14.length;
38529
+ function baseGet(object, path15) {
38530
+ path15 = castPath(path15, object);
38531
+ var index = 0, length4 = path15.length;
38532
38532
  while (object != null && index < length4) {
38533
- object = object[toKey(path14[index++])];
38533
+ object = object[toKey(path15[index++])];
38534
38534
  }
38535
38535
  return index && index == length4 ? object : undefined2;
38536
38536
  }
@@ -38594,10 +38594,10 @@ var require_lodash = __commonJS({
38594
38594
  });
38595
38595
  return accumulator;
38596
38596
  }
38597
- function baseInvoke(object, path14, args2) {
38598
- path14 = castPath(path14, object);
38599
- object = parent(object, path14);
38600
- var func = object == null ? object : object[toKey(last5(path14))];
38597
+ function baseInvoke(object, path15, args2) {
38598
+ path15 = castPath(path15, object);
38599
+ object = parent(object, path15);
38600
+ var func = object == null ? object : object[toKey(last5(path15))];
38601
38601
  return func == null ? undefined2 : apply(func, object, args2);
38602
38602
  }
38603
38603
  function baseIsArguments(value5) {
@@ -38753,13 +38753,13 @@ var require_lodash = __commonJS({
38753
38753
  return object === source || baseIsMatch(object, source, matchData);
38754
38754
  };
38755
38755
  }
38756
- function baseMatchesProperty(path14, srcValue) {
38757
- if (isKey(path14) && isStrictComparable(srcValue)) {
38758
- return matchesStrictComparable(toKey(path14), srcValue);
38756
+ function baseMatchesProperty(path15, srcValue) {
38757
+ if (isKey(path15) && isStrictComparable(srcValue)) {
38758
+ return matchesStrictComparable(toKey(path15), srcValue);
38759
38759
  }
38760
38760
  return function(object) {
38761
- var objValue = get16(object, path14);
38762
- return objValue === undefined2 && objValue === srcValue ? hasIn(object, path14) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
38761
+ var objValue = get16(object, path15);
38762
+ return objValue === undefined2 && objValue === srcValue ? hasIn(object, path15) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
38763
38763
  };
38764
38764
  }
38765
38765
  function baseMerge(object, source, srcIndex, customizer, stack) {
@@ -38856,23 +38856,23 @@ var require_lodash = __commonJS({
38856
38856
  });
38857
38857
  }
38858
38858
  function basePick(object, paths) {
38859
- return basePickBy(object, paths, function(value5, path14) {
38860
- return hasIn(object, path14);
38859
+ return basePickBy(object, paths, function(value5, path15) {
38860
+ return hasIn(object, path15);
38861
38861
  });
38862
38862
  }
38863
38863
  function basePickBy(object, paths, predicate) {
38864
38864
  var index = -1, length4 = paths.length, result2 = {};
38865
38865
  while (++index < length4) {
38866
- var path14 = paths[index], value5 = baseGet(object, path14);
38867
- if (predicate(value5, path14)) {
38868
- baseSet(result2, castPath(path14, object), value5);
38866
+ var path15 = paths[index], value5 = baseGet(object, path15);
38867
+ if (predicate(value5, path15)) {
38868
+ baseSet(result2, castPath(path15, object), value5);
38869
38869
  }
38870
38870
  }
38871
38871
  return result2;
38872
38872
  }
38873
- function basePropertyDeep(path14) {
38873
+ function basePropertyDeep(path15) {
38874
38874
  return function(object) {
38875
- return baseGet(object, path14);
38875
+ return baseGet(object, path15);
38876
38876
  };
38877
38877
  }
38878
38878
  function basePullAll(array8, values4, iteratee2, comparator) {
@@ -38946,14 +38946,14 @@ var require_lodash = __commonJS({
38946
38946
  var array8 = values3(collection);
38947
38947
  return shuffleSelf(array8, baseClamp(n, 0, array8.length));
38948
38948
  }
38949
- function baseSet(object, path14, value5, customizer) {
38949
+ function baseSet(object, path15, value5, customizer) {
38950
38950
  if (!isObject2(object)) {
38951
38951
  return object;
38952
38952
  }
38953
- path14 = castPath(path14, object);
38954
- var index = -1, length4 = path14.length, lastIndex = length4 - 1, nested3 = object;
38953
+ path15 = castPath(path15, object);
38954
+ var index = -1, length4 = path15.length, lastIndex = length4 - 1, nested3 = object;
38955
38955
  while (nested3 != null && ++index < length4) {
38956
- var key = toKey(path14[index]), newValue = value5;
38956
+ var key = toKey(path15[index]), newValue = value5;
38957
38957
  if (key === "__proto__" || key === "constructor" || key === "prototype") {
38958
38958
  return object;
38959
38959
  }
@@ -38961,7 +38961,7 @@ var require_lodash = __commonJS({
38961
38961
  var objValue = nested3[key];
38962
38962
  newValue = customizer ? customizer(objValue, key, nested3) : undefined2;
38963
38963
  if (newValue === undefined2) {
38964
- newValue = isObject2(objValue) ? objValue : isIndex(path14[index + 1]) ? [] : {};
38964
+ newValue = isObject2(objValue) ? objValue : isIndex(path15[index + 1]) ? [] : {};
38965
38965
  }
38966
38966
  }
38967
38967
  assignValue(nested3, key, newValue);
@@ -39127,13 +39127,13 @@ var require_lodash = __commonJS({
39127
39127
  }
39128
39128
  return result2;
39129
39129
  }
39130
- function baseUnset(object, path14) {
39131
- path14 = castPath(path14, object);
39132
- object = parent(object, path14);
39133
- return object == null || delete object[toKey(last5(path14))];
39130
+ function baseUnset(object, path15) {
39131
+ path15 = castPath(path15, object);
39132
+ object = parent(object, path15);
39133
+ return object == null || delete object[toKey(last5(path15))];
39134
39134
  }
39135
- function baseUpdate(object, path14, updater, customizer) {
39136
- return baseSet(object, path14, updater(baseGet(object, path14)), customizer);
39135
+ function baseUpdate(object, path15, updater, customizer) {
39136
+ return baseSet(object, path15, updater(baseGet(object, path15)), customizer);
39137
39137
  }
39138
39138
  function baseWhile(array8, predicate, isDrop, fromRight) {
39139
39139
  var length4 = array8.length, index = fromRight ? length4 : -1;
@@ -40016,11 +40016,11 @@ var require_lodash = __commonJS({
40016
40016
  var match17 = source.match(reWrapDetails);
40017
40017
  return match17 ? match17[1].split(reSplitDetails) : [];
40018
40018
  }
40019
- function hasPath(object, path14, hasFunc) {
40020
- path14 = castPath(path14, object);
40021
- var index = -1, length4 = path14.length, result2 = false;
40019
+ function hasPath(object, path15, hasFunc) {
40020
+ path15 = castPath(path15, object);
40021
+ var index = -1, length4 = path15.length, result2 = false;
40022
40022
  while (++index < length4) {
40023
- var key = toKey(path14[index]);
40023
+ var key = toKey(path15[index]);
40024
40024
  if (!(result2 = object != null && hasFunc(object, key))) {
40025
40025
  break;
40026
40026
  }
@@ -40222,8 +40222,8 @@ var require_lodash = __commonJS({
40222
40222
  return apply(func, this, otherArgs);
40223
40223
  };
40224
40224
  }
40225
- function parent(object, path14) {
40226
- return path14.length < 2 ? object : baseGet(object, baseSlice(path14, 0, -1));
40225
+ function parent(object, path15) {
40226
+ return path15.length < 2 ? object : baseGet(object, baseSlice(path15, 0, -1));
40227
40227
  }
40228
40228
  function reorder(array8, indexes) {
40229
40229
  var arrLength = array8.length, length4 = nativeMin(indexes.length, arrLength), oldArray = copyArray(array8);
@@ -40500,7 +40500,7 @@ var require_lodash = __commonJS({
40500
40500
  }
40501
40501
  return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
40502
40502
  });
40503
- function join15(array8, separator) {
40503
+ function join16(array8, separator) {
40504
40504
  return array8 == null ? "" : nativeJoin.call(array8, separator);
40505
40505
  }
40506
40506
  function last5(array8) {
@@ -40858,10 +40858,10 @@ var require_lodash = __commonJS({
40858
40858
  }
40859
40859
  return isString2(collection) ? fromIndex <= length4 && collection.indexOf(value5, fromIndex) > -1 : !!length4 && baseIndexOf(collection, value5, fromIndex) > -1;
40860
40860
  }
40861
- var invokeMap = baseRest(function(collection, path14, args2) {
40862
- var index = -1, isFunc = typeof path14 == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
40861
+ var invokeMap = baseRest(function(collection, path15, args2) {
40862
+ var index = -1, isFunc = typeof path15 == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
40863
40863
  baseEach(collection, function(value5) {
40864
- result2[++index] = isFunc ? apply(path14, value5, args2) : baseInvoke(value5, path14, args2);
40864
+ result2[++index] = isFunc ? apply(path15, value5, args2) : baseInvoke(value5, path15, args2);
40865
40865
  });
40866
40866
  return result2;
40867
40867
  });
@@ -41513,15 +41513,15 @@ var require_lodash = __commonJS({
41513
41513
  function functionsIn(object) {
41514
41514
  return object == null ? [] : baseFunctions(object, keysIn(object));
41515
41515
  }
41516
- function get16(object, path14, defaultValue) {
41517
- var result2 = object == null ? undefined2 : baseGet(object, path14);
41516
+ function get16(object, path15, defaultValue) {
41517
+ var result2 = object == null ? undefined2 : baseGet(object, path15);
41518
41518
  return result2 === undefined2 ? defaultValue : result2;
41519
41519
  }
41520
- function has8(object, path14) {
41521
- return object != null && hasPath(object, path14, baseHas);
41520
+ function has8(object, path15) {
41521
+ return object != null && hasPath(object, path15, baseHas);
41522
41522
  }
41523
- function hasIn(object, path14) {
41524
- return object != null && hasPath(object, path14, baseHasIn);
41523
+ function hasIn(object, path15) {
41524
+ return object != null && hasPath(object, path15, baseHasIn);
41525
41525
  }
41526
41526
  var invert2 = createInverter(function(result2, value5, key) {
41527
41527
  if (value5 != null && typeof value5.toString != "function") {
@@ -41574,10 +41574,10 @@ var require_lodash = __commonJS({
41574
41574
  return result2;
41575
41575
  }
41576
41576
  var isDeep = false;
41577
- paths = arrayMap(paths, function(path14) {
41578
- path14 = castPath(path14, object);
41579
- isDeep || (isDeep = path14.length > 1);
41580
- return path14;
41577
+ paths = arrayMap(paths, function(path15) {
41578
+ path15 = castPath(path15, object);
41579
+ isDeep || (isDeep = path15.length > 1);
41580
+ return path15;
41581
41581
  });
41582
41582
  copyObject(object, getAllKeysIn(object), result2);
41583
41583
  if (isDeep) {
@@ -41603,19 +41603,19 @@ var require_lodash = __commonJS({
41603
41603
  return [prop];
41604
41604
  });
41605
41605
  predicate = getIteratee(predicate);
41606
- return basePickBy(object, props, function(value5, path14) {
41607
- return predicate(value5, path14[0]);
41606
+ return basePickBy(object, props, function(value5, path15) {
41607
+ return predicate(value5, path15[0]);
41608
41608
  });
41609
41609
  }
41610
- function result(object, path14, defaultValue) {
41611
- path14 = castPath(path14, object);
41612
- var index = -1, length4 = path14.length;
41610
+ function result(object, path15, defaultValue) {
41611
+ path15 = castPath(path15, object);
41612
+ var index = -1, length4 = path15.length;
41613
41613
  if (!length4) {
41614
41614
  length4 = 1;
41615
41615
  object = undefined2;
41616
41616
  }
41617
41617
  while (++index < length4) {
41618
- var value5 = object == null ? undefined2 : object[toKey(path14[index])];
41618
+ var value5 = object == null ? undefined2 : object[toKey(path15[index])];
41619
41619
  if (value5 === undefined2) {
41620
41620
  index = length4;
41621
41621
  value5 = defaultValue;
@@ -41624,12 +41624,12 @@ var require_lodash = __commonJS({
41624
41624
  }
41625
41625
  return object;
41626
41626
  }
41627
- function set7(object, path14, value5) {
41628
- return object == null ? object : baseSet(object, path14, value5);
41627
+ function set7(object, path15, value5) {
41628
+ return object == null ? object : baseSet(object, path15, value5);
41629
41629
  }
41630
- function setWith(object, path14, value5, customizer) {
41630
+ function setWith(object, path15, value5, customizer) {
41631
41631
  customizer = typeof customizer == "function" ? customizer : undefined2;
41632
- return object == null ? object : baseSet(object, path14, value5, customizer);
41632
+ return object == null ? object : baseSet(object, path15, value5, customizer);
41633
41633
  }
41634
41634
  var toPairs = createToPairs(keys6);
41635
41635
  var toPairsIn = createToPairs(keysIn);
@@ -41651,15 +41651,15 @@ var require_lodash = __commonJS({
41651
41651
  });
41652
41652
  return accumulator;
41653
41653
  }
41654
- function unset(object, path14) {
41655
- return object == null ? true : baseUnset(object, path14);
41654
+ function unset(object, path15) {
41655
+ return object == null ? true : baseUnset(object, path15);
41656
41656
  }
41657
- function update5(object, path14, updater) {
41658
- return object == null ? object : baseUpdate(object, path14, castFunction(updater));
41657
+ function update5(object, path15, updater) {
41658
+ return object == null ? object : baseUpdate(object, path15, castFunction(updater));
41659
41659
  }
41660
- function updateWith2(object, path14, updater, customizer) {
41660
+ function updateWith2(object, path15, updater, customizer) {
41661
41661
  customizer = typeof customizer == "function" ? customizer : undefined2;
41662
- return object == null ? object : baseUpdate(object, path14, castFunction(updater), customizer);
41662
+ return object == null ? object : baseUpdate(object, path15, castFunction(updater), customizer);
41663
41663
  }
41664
41664
  function values3(object) {
41665
41665
  return object == null ? [] : baseValues(object, keys6(object));
@@ -42029,7 +42029,7 @@ var require_lodash = __commonJS({
42029
42029
  function defaultTo(value5, defaultValue) {
42030
42030
  return value5 == null || value5 !== value5 ? defaultValue : value5;
42031
42031
  }
42032
- var flow3 = createFlow();
42032
+ var flow2 = createFlow();
42033
42033
  var flowRight = createFlow(true);
42034
42034
  function identity3(value5) {
42035
42035
  return value5;
@@ -42040,17 +42040,17 @@ var require_lodash = __commonJS({
42040
42040
  function matches(source) {
42041
42041
  return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
42042
42042
  }
42043
- function matchesProperty(path14, srcValue) {
42044
- return baseMatchesProperty(path14, baseClone(srcValue, CLONE_DEEP_FLAG));
42043
+ function matchesProperty(path15, srcValue) {
42044
+ return baseMatchesProperty(path15, baseClone(srcValue, CLONE_DEEP_FLAG));
42045
42045
  }
42046
- var method = baseRest(function(path14, args2) {
42046
+ var method = baseRest(function(path15, args2) {
42047
42047
  return function(object) {
42048
- return baseInvoke(object, path14, args2);
42048
+ return baseInvoke(object, path15, args2);
42049
42049
  };
42050
42050
  });
42051
42051
  var methodOf = baseRest(function(object, args2) {
42052
- return function(path14) {
42053
- return baseInvoke(object, path14, args2);
42052
+ return function(path15) {
42053
+ return baseInvoke(object, path15, args2);
42054
42054
  };
42055
42055
  });
42056
42056
  function mixin(object, source, options3) {
@@ -42097,12 +42097,12 @@ var require_lodash = __commonJS({
42097
42097
  var over = createOver(arrayMap);
42098
42098
  var overEvery = createOver(arrayEvery);
42099
42099
  var overSome = createOver(arraySome);
42100
- function property(path14) {
42101
- return isKey(path14) ? baseProperty(toKey(path14)) : basePropertyDeep(path14);
42100
+ function property(path15) {
42101
+ return isKey(path15) ? baseProperty(toKey(path15)) : basePropertyDeep(path15);
42102
42102
  }
42103
42103
  function propertyOf(object) {
42104
- return function(path14) {
42105
- return object == null ? undefined2 : baseGet(object, path14);
42104
+ return function(path15) {
42105
+ return object == null ? undefined2 : baseGet(object, path15);
42106
42106
  };
42107
42107
  }
42108
42108
  var range4 = createRange();
@@ -42229,7 +42229,7 @@ var require_lodash = __commonJS({
42229
42229
  lodash.flattenDeep = flattenDeep;
42230
42230
  lodash.flattenDepth = flattenDepth;
42231
42231
  lodash.flip = flip3;
42232
- lodash.flow = flow3;
42232
+ lodash.flow = flow2;
42233
42233
  lodash.flowRight = flowRight;
42234
42234
  lodash.fromPairs = fromPairs;
42235
42235
  lodash.functions = functions;
@@ -42419,7 +42419,7 @@ var require_lodash = __commonJS({
42419
42419
  lodash.isUndefined = isUndefined2;
42420
42420
  lodash.isWeakMap = isWeakMap;
42421
42421
  lodash.isWeakSet = isWeakSet;
42422
- lodash.join = join15;
42422
+ lodash.join = join16;
42423
42423
  lodash.kebabCase = kebabCase;
42424
42424
  lodash.last = last5;
42425
42425
  lodash.lastIndexOf = lastIndexOf;
@@ -42555,12 +42555,12 @@ var require_lodash = __commonJS({
42555
42555
  LazyWrapper.prototype.findLast = function(predicate) {
42556
42556
  return this.reverse().find(predicate);
42557
42557
  };
42558
- LazyWrapper.prototype.invokeMap = baseRest(function(path14, args2) {
42559
- if (typeof path14 == "function") {
42558
+ LazyWrapper.prototype.invokeMap = baseRest(function(path15, args2) {
42559
+ if (typeof path15 == "function") {
42560
42560
  return new LazyWrapper(this);
42561
42561
  }
42562
42562
  return this.map(function(value5) {
42563
- return baseInvoke(value5, path14, args2);
42563
+ return baseInvoke(value5, path15, args2);
42564
42564
  });
42565
42565
  });
42566
42566
  LazyWrapper.prototype.reject = function(predicate) {
@@ -45061,11 +45061,11 @@ var require_baseGet = __commonJS({
45061
45061
  "node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_baseGet.js"(exports, module) {
45062
45062
  var castPath = require_castPath();
45063
45063
  var toKey = require_toKey();
45064
- function baseGet(object, path14) {
45065
- path14 = castPath(path14, object);
45066
- var index = 0, length4 = path14.length;
45064
+ function baseGet(object, path15) {
45065
+ path15 = castPath(path15, object);
45066
+ var index = 0, length4 = path15.length;
45067
45067
  while (object != null && index < length4) {
45068
- object = object[toKey(path14[index++])];
45068
+ object = object[toKey(path15[index++])];
45069
45069
  }
45070
45070
  return index && index == length4 ? object : void 0;
45071
45071
  }
@@ -45077,8 +45077,8 @@ var require_baseGet = __commonJS({
45077
45077
  var require_get = __commonJS({
45078
45078
  "node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/get.js"(exports, module) {
45079
45079
  var baseGet = require_baseGet();
45080
- function get16(object, path14, defaultValue) {
45081
- var result = object == null ? void 0 : baseGet(object, path14);
45080
+ function get16(object, path15, defaultValue) {
45081
+ var result = object == null ? void 0 : baseGet(object, path15);
45082
45082
  return result === void 0 ? defaultValue : result;
45083
45083
  }
45084
45084
  module.exports = get16;
@@ -45104,11 +45104,11 @@ var require_hasPath = __commonJS({
45104
45104
  var isIndex = require_isIndex();
45105
45105
  var isLength = require_isLength();
45106
45106
  var toKey = require_toKey();
45107
- function hasPath(object, path14, hasFunc) {
45108
- path14 = castPath(path14, object);
45109
- var index = -1, length4 = path14.length, result = false;
45107
+ function hasPath(object, path15, hasFunc) {
45108
+ path15 = castPath(path15, object);
45109
+ var index = -1, length4 = path15.length, result = false;
45110
45110
  while (++index < length4) {
45111
- var key = toKey(path14[index]);
45111
+ var key = toKey(path15[index]);
45112
45112
  if (!(result = object != null && hasFunc(object, key))) {
45113
45113
  break;
45114
45114
  }
@@ -45129,8 +45129,8 @@ var require_hasIn = __commonJS({
45129
45129
  "node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/hasIn.js"(exports, module) {
45130
45130
  var baseHasIn = require_baseHasIn();
45131
45131
  var hasPath = require_hasPath();
45132
- function hasIn(object, path14) {
45133
- return object != null && hasPath(object, path14, baseHasIn);
45132
+ function hasIn(object, path15) {
45133
+ return object != null && hasPath(object, path15, baseHasIn);
45134
45134
  }
45135
45135
  module.exports = hasIn;
45136
45136
  }
@@ -45148,13 +45148,13 @@ var require_baseMatchesProperty = __commonJS({
45148
45148
  var toKey = require_toKey();
45149
45149
  var COMPARE_PARTIAL_FLAG = 1;
45150
45150
  var COMPARE_UNORDERED_FLAG = 2;
45151
- function baseMatchesProperty(path14, srcValue) {
45152
- if (isKey(path14) && isStrictComparable(srcValue)) {
45153
- return matchesStrictComparable(toKey(path14), srcValue);
45151
+ function baseMatchesProperty(path15, srcValue) {
45152
+ if (isKey(path15) && isStrictComparable(srcValue)) {
45153
+ return matchesStrictComparable(toKey(path15), srcValue);
45154
45154
  }
45155
45155
  return function(object) {
45156
- var objValue = get16(object, path14);
45157
- return objValue === void 0 && objValue === srcValue ? hasIn(object, path14) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
45156
+ var objValue = get16(object, path15);
45157
+ return objValue === void 0 && objValue === srcValue ? hasIn(object, path15) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
45158
45158
  };
45159
45159
  }
45160
45160
  module.exports = baseMatchesProperty;
@@ -45177,9 +45177,9 @@ var require_baseProperty = __commonJS({
45177
45177
  var require_basePropertyDeep = __commonJS({
45178
45178
  "node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/_basePropertyDeep.js"(exports, module) {
45179
45179
  var baseGet = require_baseGet();
45180
- function basePropertyDeep(path14) {
45180
+ function basePropertyDeep(path15) {
45181
45181
  return function(object) {
45182
- return baseGet(object, path14);
45182
+ return baseGet(object, path15);
45183
45183
  };
45184
45184
  }
45185
45185
  module.exports = basePropertyDeep;
@@ -45193,8 +45193,8 @@ var require_property = __commonJS({
45193
45193
  var basePropertyDeep = require_basePropertyDeep();
45194
45194
  var isKey = require_isKey();
45195
45195
  var toKey = require_toKey();
45196
- function property(path14) {
45197
- return isKey(path14) ? baseProperty(toKey(path14)) : basePropertyDeep(path14);
45196
+ function property(path15) {
45197
+ return isKey(path15) ? baseProperty(toKey(path15)) : basePropertyDeep(path15);
45198
45198
  }
45199
45199
  module.exports = property;
45200
45200
  }
@@ -46467,10 +46467,10 @@ var require_isRemoteUrl = __commonJS({
46467
46467
  var require_getSDKVersions = __commonJS({
46468
46468
  "node_modules/.pnpm/cloudinary@2.7.0/node_modules/cloudinary/lib/utils/analytics/getSDKVersions.js"(exports, module) {
46469
46469
  var fs = __require("fs");
46470
- var path14 = __require("path");
46470
+ var path15 = __require("path");
46471
46471
  var sdkCode = "M";
46472
46472
  function readSdkSemver() {
46473
- const pkgJsonPath = path14.join(__dirname, "../../../package.json");
46473
+ const pkgJsonPath = path15.join(__dirname, "../../../package.json");
46474
46474
  try {
46475
46475
  const pkgJSONFile = fs.readFileSync(pkgJsonPath, "utf-8");
46476
46476
  return JSON.parse(pkgJSONFile).version;
@@ -47688,11 +47688,11 @@ var require_utils2 = __commonJS({
47688
47688
  if (!api_version || api_version.length === 0) {
47689
47689
  throw new Error("api_version needs to be a non-empty string");
47690
47690
  }
47691
- return (path14 = [], options3 = []) => {
47691
+ return (path15 = [], options3 = []) => {
47692
47692
  let cloudinary2 = ensureOption(options3, "upload_prefix", UPLOAD_PREFIX);
47693
47693
  let cloud_name = ensureOption(options3, "cloud_name");
47694
47694
  let encode_path = (unencoded_path) => encodeURIComponent(unencoded_path).replace("'", "%27");
47695
- let encoded_path = Array.isArray(path14) ? path14.map(encode_path) : encode_path(path14);
47695
+ let encoded_path = Array.isArray(path15) ? path15.map(encode_path) : encode_path(path15);
47696
47696
  return [cloudinary2, api_version, cloud_name].concat(encoded_path).join("/");
47697
47697
  };
47698
47698
  }
@@ -49595,19 +49595,19 @@ var require_uploader = __commonJS({
49595
49595
  return isRemoteUrl(file6) ? [params, { file: file6 }] : [params, {}, file6];
49596
49596
  });
49597
49597
  };
49598
- exports.upload_large = function upload_large(path14, callback, options3 = {}) {
49599
- if (path14 != null && isRemoteUrl(path14)) {
49600
- return exports.upload(path14, callback, options3);
49598
+ exports.upload_large = function upload_large(path15, callback, options3 = {}) {
49599
+ if (path15 != null && isRemoteUrl(path15)) {
49600
+ return exports.upload(path15, callback, options3);
49601
49601
  }
49602
- if (path14 != null && !options3.filename) {
49603
- options3.filename = path14.split(/(\\|\/)/g).pop().replace(/\.[^/.]+$/, "");
49602
+ if (path15 != null && !options3.filename) {
49603
+ options3.filename = path15.split(/(\\|\/)/g).pop().replace(/\.[^/.]+$/, "");
49604
49604
  }
49605
- return exports.upload_chunked(path14, callback, extend5({
49605
+ return exports.upload_chunked(path15, callback, extend5({
49606
49606
  resource_type: "raw"
49607
49607
  }, options3));
49608
49608
  };
49609
- exports.upload_chunked = function upload_chunked(path14, callback, options3) {
49610
- let file_reader = fs.createReadStream(path14);
49609
+ exports.upload_chunked = function upload_chunked(path15, callback, options3) {
49610
+ let file_reader = fs.createReadStream(path15);
49611
49611
  let out_stream = exports.upload_chunked_stream(callback, options3);
49612
49612
  return file_reader.pipe(out_stream);
49613
49613
  };
@@ -50586,20 +50586,20 @@ var require_api2 = __commonJS({
50586
50586
  params = pickOnlyExistingValues(options3, "next_cursor", "max_results");
50587
50587
  return call_api("get", uri, params, callback, options3);
50588
50588
  };
50589
- exports.sub_folders = function sub_folders(path14, callback, options3 = {}) {
50589
+ exports.sub_folders = function sub_folders(path15, callback, options3 = {}) {
50590
50590
  let uri, params;
50591
- uri = ["folders", path14];
50591
+ uri = ["folders", path15];
50592
50592
  params = pickOnlyExistingValues(options3, "next_cursor", "max_results");
50593
50593
  return call_api("get", uri, params, callback, options3);
50594
50594
  };
50595
- exports.create_folder = function create_folder(path14, callback, options3 = {}) {
50595
+ exports.create_folder = function create_folder(path15, callback, options3 = {}) {
50596
50596
  let uri;
50597
- uri = ["folders", path14];
50597
+ uri = ["folders", path15];
50598
50598
  return call_api("post", uri, {}, callback, options3);
50599
50599
  };
50600
- exports.delete_folder = function delete_folder(path14, callback, options3 = {}) {
50600
+ exports.delete_folder = function delete_folder(path15, callback, options3 = {}) {
50601
50601
  let uri;
50602
- uri = ["folders", path14];
50602
+ uri = ["folders", path15];
50603
50603
  return call_api("delete", uri, {}, callback, options3);
50604
50604
  };
50605
50605
  exports.rename_folder = function rename_folder(old_path, new_path, callback, options3 = {}) {
@@ -51776,7 +51776,7 @@ var require_package2 = __commonJS({
51776
51776
  var require_main = __commonJS({
51777
51777
  "node_modules/.pnpm/dotenv@17.2.3/node_modules/dotenv/lib/main.js"(exports, module) {
51778
51778
  var fs = __require("fs");
51779
- var path14 = __require("path");
51779
+ var path15 = __require("path");
51780
51780
  var os = __require("os");
51781
51781
  var crypto = __require("crypto");
51782
51782
  var packageJson = require_package2();
@@ -51925,7 +51925,7 @@ var require_main = __commonJS({
51925
51925
  possibleVaultPath = options3.path.endsWith(".vault") ? options3.path : `${options3.path}.vault`;
51926
51926
  }
51927
51927
  } else {
51928
- possibleVaultPath = path14.resolve(process.cwd(), ".env.vault");
51928
+ possibleVaultPath = path15.resolve(process.cwd(), ".env.vault");
51929
51929
  }
51930
51930
  if (fs.existsSync(possibleVaultPath)) {
51931
51931
  return possibleVaultPath;
@@ -51933,7 +51933,7 @@ var require_main = __commonJS({
51933
51933
  return null;
51934
51934
  }
51935
51935
  function _resolveHome(envPath) {
51936
- return envPath[0] === "~" ? path14.join(os.homedir(), envPath.slice(1)) : envPath;
51936
+ return envPath[0] === "~" ? path15.join(os.homedir(), envPath.slice(1)) : envPath;
51937
51937
  }
51938
51938
  function _configVault(options3) {
51939
51939
  const debug3 = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options3 && options3.debug);
@@ -51950,7 +51950,7 @@ var require_main = __commonJS({
51950
51950
  return { parsed };
51951
51951
  }
51952
51952
  function configDotenv(options3) {
51953
- const dotenvPath = path14.resolve(process.cwd(), ".env");
51953
+ const dotenvPath = path15.resolve(process.cwd(), ".env");
51954
51954
  let encoding = "utf8";
51955
51955
  let processEnv = process.env;
51956
51956
  if (options3 && options3.processEnv != null) {
@@ -51978,13 +51978,13 @@ var require_main = __commonJS({
51978
51978
  }
51979
51979
  let lastError;
51980
51980
  const parsedAll = {};
51981
- for (const path15 of optionPaths) {
51981
+ for (const path16 of optionPaths) {
51982
51982
  try {
51983
- const parsed = DotenvModule.parse(fs.readFileSync(path15, { encoding }));
51983
+ const parsed = DotenvModule.parse(fs.readFileSync(path16, { encoding }));
51984
51984
  DotenvModule.populate(parsedAll, parsed, options3);
51985
51985
  } catch (e) {
51986
51986
  if (debug3) {
51987
- _debug(`Failed to load ${path15} ${e.message}`);
51987
+ _debug(`Failed to load ${path16} ${e.message}`);
51988
51988
  }
51989
51989
  lastError = e;
51990
51990
  }
@@ -51997,7 +51997,7 @@ var require_main = __commonJS({
51997
51997
  const shortPaths = [];
51998
51998
  for (const filePath of optionPaths) {
51999
51999
  try {
52000
- const relative3 = path14.relative(process.cwd(), filePath);
52000
+ const relative3 = path15.relative(process.cwd(), filePath);
52001
52001
  shortPaths.push(relative3);
52002
52002
  } catch (e) {
52003
52003
  if (debug3) {
@@ -59065,67 +59065,67 @@ var Or = (self2, that) => {
59065
59065
  });
59066
59066
  return error4;
59067
59067
  };
59068
- var InvalidData = (path14, message, options3 = {
59068
+ var InvalidData = (path15, message, options3 = {
59069
59069
  pathDelim: "."
59070
59070
  }) => {
59071
59071
  const error4 = Object.create(proto2);
59072
59072
  error4._op = OP_INVALID_DATA;
59073
- error4.path = path14;
59073
+ error4.path = path15;
59074
59074
  error4.message = message;
59075
59075
  Object.defineProperty(error4, "toString", {
59076
59076
  enumerable: false,
59077
59077
  value() {
59078
- const path15 = pipe(this.path, join(options3.pathDelim));
59079
- return `(Invalid data at ${path15}: "${this.message}")`;
59078
+ const path16 = pipe(this.path, join(options3.pathDelim));
59079
+ return `(Invalid data at ${path16}: "${this.message}")`;
59080
59080
  }
59081
59081
  });
59082
59082
  return error4;
59083
59083
  };
59084
- var MissingData = (path14, message, options3 = {
59084
+ var MissingData = (path15, message, options3 = {
59085
59085
  pathDelim: "."
59086
59086
  }) => {
59087
59087
  const error4 = Object.create(proto2);
59088
59088
  error4._op = OP_MISSING_DATA;
59089
- error4.path = path14;
59089
+ error4.path = path15;
59090
59090
  error4.message = message;
59091
59091
  Object.defineProperty(error4, "toString", {
59092
59092
  enumerable: false,
59093
59093
  value() {
59094
- const path15 = pipe(this.path, join(options3.pathDelim));
59095
- return `(Missing data at ${path15}: "${this.message}")`;
59094
+ const path16 = pipe(this.path, join(options3.pathDelim));
59095
+ return `(Missing data at ${path16}: "${this.message}")`;
59096
59096
  }
59097
59097
  });
59098
59098
  return error4;
59099
59099
  };
59100
- var SourceUnavailable = (path14, message, cause3, options3 = {
59100
+ var SourceUnavailable = (path15, message, cause3, options3 = {
59101
59101
  pathDelim: "."
59102
59102
  }) => {
59103
59103
  const error4 = Object.create(proto2);
59104
59104
  error4._op = OP_SOURCE_UNAVAILABLE;
59105
- error4.path = path14;
59105
+ error4.path = path15;
59106
59106
  error4.message = message;
59107
59107
  error4.cause = cause3;
59108
59108
  Object.defineProperty(error4, "toString", {
59109
59109
  enumerable: false,
59110
59110
  value() {
59111
- const path15 = pipe(this.path, join(options3.pathDelim));
59112
- return `(Source unavailable at ${path15}: "${this.message}")`;
59111
+ const path16 = pipe(this.path, join(options3.pathDelim));
59112
+ return `(Source unavailable at ${path16}: "${this.message}")`;
59113
59113
  }
59114
59114
  });
59115
59115
  return error4;
59116
59116
  };
59117
- var Unsupported = (path14, message, options3 = {
59117
+ var Unsupported = (path15, message, options3 = {
59118
59118
  pathDelim: "."
59119
59119
  }) => {
59120
59120
  const error4 = Object.create(proto2);
59121
59121
  error4._op = OP_UNSUPPORTED;
59122
- error4.path = path14;
59122
+ error4.path = path15;
59123
59123
  error4.message = message;
59124
59124
  Object.defineProperty(error4, "toString", {
59125
59125
  enumerable: false,
59126
59126
  value() {
59127
- const path15 = pipe(this.path, join(options3.pathDelim));
59128
- return `(Unsupported operation at ${path15}: "${this.message}")`;
59127
+ const path16 = pipe(this.path, join(options3.pathDelim));
59128
+ return `(Unsupported operation at ${path16}: "${this.message}")`;
59129
59129
  }
59130
59130
  });
59131
59131
  return error4;
@@ -59241,9 +59241,9 @@ var isMissingDataOnly = (self2) => reduceWithContext2(self2, void 0, IsMissingDa
59241
59241
  var empty19 = {
59242
59242
  _tag: "Empty"
59243
59243
  };
59244
- var patch5 = /* @__PURE__ */ dual(2, (path14, patch9) => {
59244
+ var patch5 = /* @__PURE__ */ dual(2, (path15, patch9) => {
59245
59245
  let input = of3(patch9);
59246
- let output = path14;
59246
+ let output = path15;
59247
59247
  while (isCons(input)) {
59248
59248
  const patch10 = input.head;
59249
59249
  switch (patch10._tag) {
@@ -59310,7 +59310,7 @@ var make21 = (options3) => ({
59310
59310
  var makeFlat = (options3) => ({
59311
59311
  [FlatConfigProviderTypeId]: FlatConfigProviderTypeId,
59312
59312
  patch: options3.patch,
59313
- load: (path14, config3, split3 = true) => options3.load(path14, config3, split3),
59313
+ load: (path15, config3, split3 = true) => options3.load(path15, config3, split3),
59314
59314
  enumerateChildren: options3.enumerateChildren
59315
59315
  });
59316
59316
  var fromFlat = (flat) => make21({
@@ -59328,29 +59328,29 @@ var fromEnv = (options3) => {
59328
59328
  pathDelim: "_",
59329
59329
  seqDelim: ","
59330
59330
  }, options3);
59331
- const makePathString = (path14) => pipe(path14, join(pathDelim));
59331
+ const makePathString = (path15) => pipe(path15, join(pathDelim));
59332
59332
  const unmakePathString = (pathString) => pathString.split(pathDelim);
59333
59333
  const getEnv = () => typeof process !== "undefined" && "env" in process && typeof process.env === "object" ? process.env : {};
59334
- const load = (path14, primitive2, split3 = true) => {
59335
- const pathString = makePathString(path14);
59334
+ const load = (path15, primitive2, split3 = true) => {
59335
+ const pathString = makePathString(path15);
59336
59336
  const current = getEnv();
59337
59337
  const valueOpt = pathString in current ? some2(current[pathString]) : none2();
59338
- return pipe(valueOpt, mapError(() => MissingData(path14, `Expected ${pathString} to exist in the process context`)), flatMap7((value5) => parsePrimitive(value5, path14, primitive2, seqDelim, split3)));
59338
+ return pipe(valueOpt, mapError(() => MissingData(path15, `Expected ${pathString} to exist in the process context`)), flatMap7((value5) => parsePrimitive(value5, path15, primitive2, seqDelim, split3)));
59339
59339
  };
59340
- const enumerateChildren = (path14) => sync(() => {
59340
+ const enumerateChildren = (path15) => sync(() => {
59341
59341
  const current = getEnv();
59342
59342
  const keys6 = Object.keys(current);
59343
59343
  const keyPaths = keys6.map((value5) => unmakePathString(value5.toUpperCase()));
59344
59344
  const filteredKeyPaths = keyPaths.filter((keyPath) => {
59345
- for (let i = 0; i < path14.length; i++) {
59346
- const pathComponent = pipe(path14, unsafeGet(i));
59345
+ for (let i = 0; i < path15.length; i++) {
59346
+ const pathComponent = pipe(path15, unsafeGet(i));
59347
59347
  const currentElement = keyPath[i];
59348
59348
  if (currentElement === void 0 || pathComponent !== currentElement) {
59349
59349
  return false;
59350
59350
  }
59351
59351
  }
59352
59352
  return true;
59353
- }).flatMap((keyPath) => keyPath.slice(path14.length, path14.length + 1));
59353
+ }).flatMap((keyPath) => keyPath.slice(path15.length, path15.length + 1));
59354
59354
  return fromIterable6(filteredKeyPaths);
59355
59355
  });
59356
59356
  return fromFlat(makeFlat({
@@ -59366,17 +59366,17 @@ var extend2 = (leftDef, rightDef, left3, right3) => {
59366
59366
  const rightExtension = concat(right3, rightPad);
59367
59367
  return [leftExtension, rightExtension];
59368
59368
  };
59369
- var appendConfigPath = (path14, config3) => {
59369
+ var appendConfigPath = (path15, config3) => {
59370
59370
  let op = config3;
59371
59371
  if (op._tag === "Nested") {
59372
- const out = path14.slice();
59372
+ const out = path15.slice();
59373
59373
  while (op._tag === "Nested") {
59374
59374
  out.push(op.name);
59375
59375
  op = op.config;
59376
59376
  }
59377
59377
  return out;
59378
59378
  }
59379
- return path14;
59379
+ return path15;
59380
59380
  };
59381
59381
  var fromFlatLoop = (flat, prefix, config3, split3) => {
59382
59382
  const op = config3;
@@ -59452,8 +59452,8 @@ var fromFlatLoop = (flat, prefix, config3, split3) => {
59452
59452
  return fail2(right3.left);
59453
59453
  }
59454
59454
  if (isRight2(left3) && isRight2(right3)) {
59455
- const path14 = pipe(prefix, join("."));
59456
- const fail19 = fromFlatLoopFail(prefix, path14);
59455
+ const path15 = pipe(prefix, join("."));
59456
+ const fail19 = fromFlatLoopFail(prefix, path15);
59457
59457
  const [lefts, rights] = extend2(fail19, fail19, pipe(left3.right, map3(right2)), pipe(right3.right, map3(right2)));
59458
59458
  return pipe(lefts, zip(rights), forEachSequential(([left4, right4]) => pipe(zip2(left4, right4), map10(([left5, right5]) => op.zip(left5, right5)))));
59459
59459
  }
@@ -59462,19 +59462,19 @@ var fromFlatLoop = (flat, prefix, config3, split3) => {
59462
59462
  }
59463
59463
  }
59464
59464
  };
59465
- var fromFlatLoopFail = (prefix, path14) => (index) => left2(MissingData(prefix, `The element at index ${index} in a sequence at path "${path14}" was missing`));
59465
+ var fromFlatLoopFail = (prefix, path15) => (index) => left2(MissingData(prefix, `The element at index ${index} in a sequence at path "${path15}" was missing`));
59466
59466
  var splitPathString = (text11, delim) => {
59467
59467
  const split3 = text11.split(new RegExp(`\\s*${escape(delim)}\\s*`));
59468
59468
  return split3;
59469
59469
  };
59470
- var parsePrimitive = (text11, path14, primitive2, delimiter, split3) => {
59470
+ var parsePrimitive = (text11, path15, primitive2, delimiter, split3) => {
59471
59471
  if (!split3) {
59472
59472
  return pipe(primitive2.parse(text11), mapBoth2({
59473
- onFailure: prefixed(path14),
59473
+ onFailure: prefixed(path15),
59474
59474
  onSuccess: of
59475
59475
  }));
59476
59476
  }
59477
- return pipe(splitPathString(text11, delimiter), forEachSequential((char4) => primitive2.parse(char4.trim())), mapError(prefixed(path14)));
59477
+ return pipe(splitPathString(text11, delimiter), forEachSequential((char4) => primitive2.parse(char4.trim())), mapError(prefixed(path15)));
59478
59478
  };
59479
59479
  var transpose = (array8) => {
59480
59480
  return Object.keys(array8[0]).map((column3) => array8.map((row) => row[column3]));
@@ -70680,14 +70680,14 @@ var formatPropertyKey = (name) => typeof name === "string" ? JSON.stringify(name
70680
70680
  var isNonEmpty5 = (x) => Array.isArray(x);
70681
70681
  var isSingle = (x) => !Array.isArray(x);
70682
70682
  var formatPathKey = (key) => `[${formatPropertyKey(key)}]`;
70683
- var formatPath = (path14) => isNonEmpty5(path14) ? path14.map(formatPathKey).join("") : formatPathKey(path14);
70683
+ var formatPath = (path15) => isNonEmpty5(path15) ? path15.map(formatPathKey).join("") : formatPathKey(path15);
70684
70684
 
70685
70685
  // node_modules/.pnpm/effect@3.17.7/node_modules/effect/dist/esm/internal/schema/errors.js
70686
- var getErrorMessage = (reason, details, path14, ast) => {
70686
+ var getErrorMessage = (reason, details, path15, ast) => {
70687
70687
  let out = reason;
70688
- if (path14 && isNonEmptyReadonlyArray(path14)) {
70688
+ if (path15 && isNonEmptyReadonlyArray(path15)) {
70689
70689
  out += `
70690
- at path: ${formatPath(path14)}`;
70690
+ at path: ${formatPath(path15)}`;
70691
70691
  }
70692
70692
  if (details !== void 0) {
70693
70693
  out += `
@@ -70699,7 +70699,7 @@ schema (${ast._tag}): ${ast}`;
70699
70699
  }
70700
70700
  return out;
70701
70701
  };
70702
- var getSchemaExtendErrorMessage = (x, y, path14) => getErrorMessage("Unsupported schema or overlapping types", `cannot extend ${x} with ${y}`, path14);
70702
+ var getSchemaExtendErrorMessage = (x, y, path15) => getErrorMessage("Unsupported schema or overlapping types", `cannot extend ${x} with ${y}`, path15);
70703
70703
  var getASTUnsupportedKeySchemaErrorMessage = (ast) => getErrorMessage("Unsupported key schema", void 0, void 0, ast);
70704
70704
  var getASTUnsupportedLiteralErrorMessage = (literal2) => getErrorMessage("Unsupported literal", `literal value: ${formatUnknown(literal2)}`);
70705
70705
  var getASTDuplicateIndexSignatureErrorMessage = (type2) => getErrorMessage("Duplicate index signature", `${type2} index signature`);
@@ -71888,8 +71888,8 @@ var Pointer = class {
71888
71888
  * @since 3.10.0
71889
71889
  */
71890
71890
  _tag = "Pointer";
71891
- constructor(path14, actual, issue) {
71892
- this.path = path14;
71891
+ constructor(path15, actual, issue) {
71892
+ this.path = path15;
71893
71893
  this.actual = actual;
71894
71894
  this.issue = issue;
71895
71895
  }
@@ -73379,7 +73379,7 @@ function makeTypeLiteralClass(fields, records, ast = getDefaultTypeLiteralAST(fi
73379
73379
  function Struct(fields, ...records) {
73380
73380
  return makeTypeLiteralClass(fields, records);
73381
73381
  }
73382
- var intersectTypeLiterals = (x, y, path14) => {
73382
+ var intersectTypeLiterals = (x, y, path15) => {
73383
73383
  if (isTypeLiteral(x) && isTypeLiteral(y)) {
73384
73384
  const propertySignatures = [...x.propertySignatures];
73385
73385
  for (const ps of y.propertySignatures) {
@@ -73392,18 +73392,18 @@ var intersectTypeLiterals = (x, y, path14) => {
73392
73392
  isOptional,
73393
73393
  type: type2
73394
73394
  } = propertySignatures[i];
73395
- propertySignatures[i] = new PropertySignature(name, extendAST(type2, ps.type, path14.concat(name)), isOptional, true);
73395
+ propertySignatures[i] = new PropertySignature(name, extendAST(type2, ps.type, path15.concat(name)), isOptional, true);
73396
73396
  }
73397
73397
  }
73398
73398
  return new TypeLiteral(propertySignatures, x.indexSignatures.concat(y.indexSignatures));
73399
73399
  }
73400
- throw new Error(getSchemaExtendErrorMessage(x, y, path14));
73400
+ throw new Error(getSchemaExtendErrorMessage(x, y, path15));
73401
73401
  };
73402
73402
  var preserveRefinementAnnotations = /* @__PURE__ */ omitAnnotations([IdentifierAnnotationId]);
73403
73403
  var addRefinementToMembers = (refinement, asts) => asts.map((ast) => new Refinement(ast, refinement.filter, preserveRefinementAnnotations(refinement)));
73404
- var extendAST = (x, y, path14) => Union.make(intersectUnionMembers([x], [y], path14));
73404
+ var extendAST = (x, y, path15) => Union.make(intersectUnionMembers([x], [y], path15));
73405
73405
  var getTypes = (ast) => isUnion(ast) ? ast.types : [ast];
73406
- var intersectUnionMembers = (xs, ys, path14) => flatMap2(xs, (x) => flatMap2(ys, (y) => {
73406
+ var intersectUnionMembers = (xs, ys, path15) => flatMap2(xs, (x) => flatMap2(ys, (y) => {
73407
73407
  switch (y._tag) {
73408
73408
  case "Literal": {
73409
73409
  if (isString(y.literal) && isStringKeyword(x) || isNumber(y.literal) && isNumberKeyword(x) || isBoolean(y.literal) && isBooleanKeyword(x)) {
@@ -73416,7 +73416,7 @@ var intersectUnionMembers = (xs, ys, path14) => flatMap2(xs, (x) => flatMap2(ys,
73416
73416
  if (isStringKeyword(x) || isLiteral(x) && isString(x.literal)) {
73417
73417
  return [x];
73418
73418
  } else if (isRefinement(x)) {
73419
- return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path14));
73419
+ return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path15));
73420
73420
  }
73421
73421
  } else if (x === stringKeyword) {
73422
73422
  return [y];
@@ -73428,7 +73428,7 @@ var intersectUnionMembers = (xs, ys, path14) => flatMap2(xs, (x) => flatMap2(ys,
73428
73428
  if (isNumberKeyword(x) || isLiteral(x) && isNumber(x.literal)) {
73429
73429
  return [x];
73430
73430
  } else if (isRefinement(x)) {
73431
- return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path14));
73431
+ return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path15));
73432
73432
  }
73433
73433
  } else if (x === numberKeyword) {
73434
73434
  return [y];
@@ -73440,7 +73440,7 @@ var intersectUnionMembers = (xs, ys, path14) => flatMap2(xs, (x) => flatMap2(ys,
73440
73440
  if (isBooleanKeyword(x) || isLiteral(x) && isBoolean(x.literal)) {
73441
73441
  return [x];
73442
73442
  } else if (isRefinement(x)) {
73443
- return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path14));
73443
+ return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path15));
73444
73444
  }
73445
73445
  } else if (x === booleanKeyword) {
73446
73446
  return [y];
@@ -73448,25 +73448,25 @@ var intersectUnionMembers = (xs, ys, path14) => flatMap2(xs, (x) => flatMap2(ys,
73448
73448
  break;
73449
73449
  }
73450
73450
  case "Union":
73451
- return intersectUnionMembers(getTypes(x), y.types, path14);
73451
+ return intersectUnionMembers(getTypes(x), y.types, path15);
73452
73452
  case "Suspend":
73453
- return [new Suspend(() => extendAST(x, y.f(), path14))];
73453
+ return [new Suspend(() => extendAST(x, y.f(), path15))];
73454
73454
  case "Refinement":
73455
- return addRefinementToMembers(y, intersectUnionMembers(getTypes(x), getTypes(y.from), path14));
73455
+ return addRefinementToMembers(y, intersectUnionMembers(getTypes(x), getTypes(y.from), path15));
73456
73456
  case "TypeLiteral": {
73457
73457
  switch (x._tag) {
73458
73458
  case "Union":
73459
- return intersectUnionMembers(x.types, [y], path14);
73459
+ return intersectUnionMembers(x.types, [y], path15);
73460
73460
  case "Suspend":
73461
- return [new Suspend(() => extendAST(x.f(), y, path14))];
73461
+ return [new Suspend(() => extendAST(x.f(), y, path15))];
73462
73462
  case "Refinement":
73463
- return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path14));
73463
+ return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path15));
73464
73464
  case "TypeLiteral":
73465
- return [intersectTypeLiterals(x, y, path14)];
73465
+ return [intersectTypeLiterals(x, y, path15)];
73466
73466
  case "Transformation": {
73467
73467
  const transformation = x.transformation;
73468
- const from = intersectTypeLiterals(x.from, y, path14);
73469
- const to = intersectTypeLiterals(x.to, typeAST(y), path14);
73468
+ const from = intersectTypeLiterals(x.from, y, path15);
73469
+ const to = intersectTypeLiterals(x.to, typeAST(y), path15);
73470
73470
  switch (transformation._tag) {
73471
73471
  case "TypeLiteralTransformation":
73472
73472
  return [new Transformation(from, to, new TypeLiteralTransformation(transformation.propertySignatureTransformations))];
@@ -73488,15 +73488,15 @@ var intersectUnionMembers = (xs, ys, path14) => flatMap2(xs, (x) => flatMap2(ys,
73488
73488
  case "Transformation": {
73489
73489
  if (isTransformation(x)) {
73490
73490
  if (isTypeLiteralTransformation(y.transformation) && isTypeLiteralTransformation(x.transformation)) {
73491
- return [new Transformation(intersectTypeLiterals(x.from, y.from, path14), intersectTypeLiterals(x.to, y.to, path14), new TypeLiteralTransformation(y.transformation.propertySignatureTransformations.concat(x.transformation.propertySignatureTransformations)))];
73491
+ return [new Transformation(intersectTypeLiterals(x.from, y.from, path15), intersectTypeLiterals(x.to, y.to, path15), new TypeLiteralTransformation(y.transformation.propertySignatureTransformations.concat(x.transformation.propertySignatureTransformations)))];
73492
73492
  }
73493
73493
  } else {
73494
- return intersectUnionMembers([y], [x], path14);
73494
+ return intersectUnionMembers([y], [x], path15);
73495
73495
  }
73496
73496
  break;
73497
73497
  }
73498
73498
  }
73499
- throw new Error(getSchemaExtendErrorMessage(x, y, path14));
73499
+ throw new Error(getSchemaExtendErrorMessage(x, y, path15));
73500
73500
  }));
73501
73501
  var extend4 = /* @__PURE__ */ dual(2, (self2, that) => make54(extendAST(self2.ast, that.ast, [])));
73502
73502
  var compose3 = /* @__PURE__ */ dual((args2) => isSchema(args2[1]), (from, to) => makeTransformationClass(from, to, compose2(from.ast, to.ast)));
@@ -74166,8 +74166,8 @@ var PiB = (n) => Size(BigInt(n) * bigintPiB);
74166
74166
  var make55 = (impl) => {
74167
74167
  return tag.of({
74168
74168
  ...impl,
74169
- exists: (path14) => pipe(impl.access(path14), as5(true), catchTag2("SystemError", (e) => e.reason === "NotFound" ? succeed9(false) : fail9(e))),
74170
- readFileString: (path14, encoding) => tryMap2(impl.readFile(path14), {
74169
+ exists: (path15) => pipe(impl.access(path15), as5(true), catchTag2("SystemError", (e) => e.reason === "NotFound" ? succeed9(false) : fail9(e))),
74170
+ readFileString: (path15, encoding) => tryMap2(impl.readFile(path15), {
74171
74171
  try: (_) => new TextDecoder(encoding).decode(_),
74172
74172
  catch: (cause3) => new BadArgument({
74173
74173
  module: "FileSystem",
@@ -74176,14 +74176,14 @@ var make55 = (impl) => {
74176
74176
  cause: cause3
74177
74177
  })
74178
74178
  }),
74179
- stream: (path14, options3) => pipe(impl.open(path14, {
74179
+ stream: (path15, options3) => pipe(impl.open(path15, {
74180
74180
  flag: "r"
74181
74181
  }), options3?.offset ? tap3((file6) => file6.seek(options3.offset, "start")) : identity, map17((file6) => stream3(file6, options3)), unwrapScoped5),
74182
- sink: (path14, options3) => pipe(impl.open(path14, {
74182
+ sink: (path15, options3) => pipe(impl.open(path15, {
74183
74183
  flag: "w",
74184
74184
  ...options3
74185
74185
  }), map17((file6) => forEach11((_) => file6.writeAll(_))), unwrapScoped6),
74186
- writeFileString: (path14, data, options3) => flatMap10(try_2({
74186
+ writeFileString: (path15, data, options3) => flatMap10(try_2({
74187
74187
  try: () => new TextEncoder().encode(data),
74188
74188
  catch: (cause3) => new BadArgument({
74189
74189
  module: "FileSystem",
@@ -74191,38 +74191,38 @@ var make55 = (impl) => {
74191
74191
  description: "could not encode string",
74192
74192
  cause: cause3
74193
74193
  })
74194
- }), (_) => impl.writeFile(path14, _, options3))
74194
+ }), (_) => impl.writeFile(path15, _, options3))
74195
74195
  });
74196
74196
  };
74197
- var notFound = (method, path14) => new SystemError({
74197
+ var notFound = (method, path15) => new SystemError({
74198
74198
  module: "FileSystem",
74199
74199
  method,
74200
74200
  reason: "NotFound",
74201
74201
  description: "No such file or directory",
74202
- pathOrDescriptor: path14
74202
+ pathOrDescriptor: path15
74203
74203
  });
74204
74204
  var makeNoop = (fileSystem) => {
74205
74205
  return {
74206
- access(path14) {
74207
- return fail9(notFound("access", path14));
74206
+ access(path15) {
74207
+ return fail9(notFound("access", path15));
74208
74208
  },
74209
- chmod(path14) {
74210
- return fail9(notFound("chmod", path14));
74209
+ chmod(path15) {
74210
+ return fail9(notFound("chmod", path15));
74211
74211
  },
74212
- chown(path14) {
74213
- return fail9(notFound("chown", path14));
74212
+ chown(path15) {
74213
+ return fail9(notFound("chown", path15));
74214
74214
  },
74215
- copy(path14) {
74216
- return fail9(notFound("copy", path14));
74215
+ copy(path15) {
74216
+ return fail9(notFound("copy", path15));
74217
74217
  },
74218
- copyFile(path14) {
74219
- return fail9(notFound("copyFile", path14));
74218
+ copyFile(path15) {
74219
+ return fail9(notFound("copyFile", path15));
74220
74220
  },
74221
74221
  exists() {
74222
74222
  return succeed9(false);
74223
74223
  },
74224
- link(path14) {
74225
- return fail9(notFound("link", path14));
74224
+ link(path15) {
74225
+ return fail9(notFound("link", path15));
74226
74226
  },
74227
74227
  makeDirectory() {
74228
74228
  return die5("not implemented");
@@ -74239,23 +74239,23 @@ var makeNoop = (fileSystem) => {
74239
74239
  makeTempFileScoped() {
74240
74240
  return die5("not implemented");
74241
74241
  },
74242
- open(path14) {
74243
- return fail9(notFound("open", path14));
74242
+ open(path15) {
74243
+ return fail9(notFound("open", path15));
74244
74244
  },
74245
- readDirectory(path14) {
74246
- return fail9(notFound("readDirectory", path14));
74245
+ readDirectory(path15) {
74246
+ return fail9(notFound("readDirectory", path15));
74247
74247
  },
74248
- readFile(path14) {
74249
- return fail9(notFound("readFile", path14));
74248
+ readFile(path15) {
74249
+ return fail9(notFound("readFile", path15));
74250
74250
  },
74251
- readFileString(path14) {
74252
- return fail9(notFound("readFileString", path14));
74251
+ readFileString(path15) {
74252
+ return fail9(notFound("readFileString", path15));
74253
74253
  },
74254
- readLink(path14) {
74255
- return fail9(notFound("readLink", path14));
74254
+ readLink(path15) {
74255
+ return fail9(notFound("readLink", path15));
74256
74256
  },
74257
- realPath(path14) {
74258
- return fail9(notFound("realPath", path14));
74257
+ realPath(path15) {
74258
+ return fail9(notFound("realPath", path15));
74259
74259
  },
74260
74260
  remove() {
74261
74261
  return _void;
@@ -74263,32 +74263,32 @@ var makeNoop = (fileSystem) => {
74263
74263
  rename(oldPath) {
74264
74264
  return fail9(notFound("rename", oldPath));
74265
74265
  },
74266
- sink(path14) {
74267
- return fail14(notFound("sink", path14));
74266
+ sink(path15) {
74267
+ return fail14(notFound("sink", path15));
74268
74268
  },
74269
- stat(path14) {
74270
- return fail9(notFound("stat", path14));
74269
+ stat(path15) {
74270
+ return fail9(notFound("stat", path15));
74271
74271
  },
74272
- stream(path14) {
74273
- return fail13(notFound("stream", path14));
74272
+ stream(path15) {
74273
+ return fail13(notFound("stream", path15));
74274
74274
  },
74275
74275
  symlink(fromPath) {
74276
74276
  return fail9(notFound("symlink", fromPath));
74277
74277
  },
74278
- truncate(path14) {
74279
- return fail9(notFound("truncate", path14));
74278
+ truncate(path15) {
74279
+ return fail9(notFound("truncate", path15));
74280
74280
  },
74281
- utimes(path14) {
74282
- return fail9(notFound("utimes", path14));
74281
+ utimes(path15) {
74282
+ return fail9(notFound("utimes", path15));
74283
74283
  },
74284
- watch(path14) {
74285
- return fail13(notFound("watch", path14));
74284
+ watch(path15) {
74285
+ return fail13(notFound("watch", path15));
74286
74286
  },
74287
- writeFile(path14) {
74288
- return fail9(notFound("writeFile", path14));
74287
+ writeFile(path15) {
74288
+ return fail9(notFound("writeFile", path15));
74289
74289
  },
74290
- writeFileString(path14) {
74291
- return fail9(notFound("writeFileString", path14));
74290
+ writeFileString(path15) {
74291
+ return fail9(notFound("writeFileString", path15));
74292
74292
  },
74293
74293
  ...fileSystem
74294
74294
  };
@@ -74337,7 +74337,7 @@ var WatchBackend = class extends (/* @__PURE__ */ Tag2("@effect/platform/FileSys
74337
74337
  };
74338
74338
 
74339
74339
  // node_modules/.pnpm/@effect+platform-node-shared@0.48.0_@effect+cluster@0.47.0_@effect+platform@0.90.2_effe_c51441e982837e38e66e4ef8533c2d61/node_modules/@effect/platform-node-shared/dist/esm/internal/error.js
74340
- var handleErrnoException = (module, method) => (err, [path14]) => {
74340
+ var handleErrnoException = (module, method) => (err, [path15]) => {
74341
74341
  let reason = "Unknown";
74342
74342
  switch (err.code) {
74343
74343
  case "ENOENT":
@@ -74366,7 +74366,7 @@ var handleErrnoException = (module, method) => (err, [path14]) => {
74366
74366
  reason,
74367
74367
  module,
74368
74368
  method,
74369
- pathOrDescriptor: path14,
74369
+ pathOrDescriptor: path15,
74370
74370
  syscall: err.syscall,
74371
74371
  description: err.message,
74372
74372
  cause: err
@@ -74625,7 +74625,7 @@ var handleBadArgument = (method) => (cause3) => new BadArgument({
74625
74625
  });
74626
74626
  var access2 = /* @__PURE__ */ (() => {
74627
74627
  const nodeAccess = /* @__PURE__ */ effectify2(NFS__namespace.access, /* @__PURE__ */ handleErrnoException("FileSystem", "access"), /* @__PURE__ */ handleBadArgument("access"));
74628
- return (path14, options3) => {
74628
+ return (path15, options3) => {
74629
74629
  let mode = NFS__namespace.constants.F_OK;
74630
74630
  if (options3?.readable) {
74631
74631
  mode |= NFS__namespace.constants.R_OK;
@@ -74633,7 +74633,7 @@ var access2 = /* @__PURE__ */ (() => {
74633
74633
  if (options3?.writable) {
74634
74634
  mode |= NFS__namespace.constants.W_OK;
74635
74635
  }
74636
- return nodeAccess(path14, mode);
74636
+ return nodeAccess(path15, mode);
74637
74637
  };
74638
74638
  })();
74639
74639
  var copy3 = /* @__PURE__ */ (() => {
@@ -74650,11 +74650,11 @@ var copyFile2 = /* @__PURE__ */ (() => {
74650
74650
  })();
74651
74651
  var chmod2 = /* @__PURE__ */ (() => {
74652
74652
  const nodeChmod = /* @__PURE__ */ effectify2(NFS__namespace.chmod, /* @__PURE__ */ handleErrnoException("FileSystem", "chmod"), /* @__PURE__ */ handleBadArgument("chmod"));
74653
- return (path14, mode) => nodeChmod(path14, mode);
74653
+ return (path15, mode) => nodeChmod(path15, mode);
74654
74654
  })();
74655
74655
  var chown2 = /* @__PURE__ */ (() => {
74656
74656
  const nodeChown = /* @__PURE__ */ effectify2(NFS__namespace.chown, /* @__PURE__ */ handleErrnoException("FileSystem", "chown"), /* @__PURE__ */ handleBadArgument("chown"));
74657
- return (path14, uid, gid) => nodeChown(path14, uid, gid);
74657
+ return (path15, uid, gid) => nodeChown(path15, uid, gid);
74658
74658
  })();
74659
74659
  var link2 = /* @__PURE__ */ (() => {
74660
74660
  const nodeLink = /* @__PURE__ */ effectify2(NFS__namespace.link, /* @__PURE__ */ handleErrnoException("FileSystem", "link"), /* @__PURE__ */ handleBadArgument("link"));
@@ -74662,7 +74662,7 @@ var link2 = /* @__PURE__ */ (() => {
74662
74662
  })();
74663
74663
  var makeDirectory = /* @__PURE__ */ (() => {
74664
74664
  const nodeMkdir = /* @__PURE__ */ effectify2(NFS__namespace.mkdir, /* @__PURE__ */ handleErrnoException("FileSystem", "makeDirectory"), /* @__PURE__ */ handleBadArgument("makeDirectory"));
74665
- return (path14, options3) => nodeMkdir(path14, {
74665
+ return (path15, options3) => nodeMkdir(path15, {
74666
74666
  recursive: options3?.recursive ?? false,
74667
74667
  mode: options3?.mode
74668
74668
  });
@@ -74678,7 +74678,7 @@ var makeTempDirectoryFactory = (method) => {
74678
74678
  var makeTempDirectory = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectory");
74679
74679
  var removeFactory = (method) => {
74680
74680
  const nodeRm = effectify2(NFS__namespace.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
74681
- return (path14, options3) => nodeRm(path14, {
74681
+ return (path15, options3) => nodeRm(path15, {
74682
74682
  recursive: options3?.recursive ?? false,
74683
74683
  force: options3?.force ?? false
74684
74684
  });
@@ -74694,7 +74694,7 @@ var makeTempDirectoryScoped = /* @__PURE__ */ (() => {
74694
74694
  var openFactory = (method) => {
74695
74695
  const nodeOpen = effectify2(NFS__namespace.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
74696
74696
  const nodeClose = effectify2(NFS__namespace.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
74697
- return (path14, options3) => pipe(acquireRelease2(nodeOpen(path14, options3?.flag ?? "r", options3?.mode), (fd) => orDie2(nodeClose(fd))), map17((fd) => makeFile(FileDescriptor(fd), options3?.flag?.startsWith("a") ?? false)));
74697
+ return (path15, options3) => pipe(acquireRelease2(nodeOpen(path15, options3?.flag ?? "r", options3?.mode), (fd) => orDie2(nodeClose(fd))), map17((fd) => makeFile(FileDescriptor(fd), options3?.flag?.startsWith("a") ?? false)));
74698
74698
  };
74699
74699
  var open2 = /* @__PURE__ */ openFactory("open");
74700
74700
  var makeFile = /* @__PURE__ */ (() => {
@@ -74809,7 +74809,7 @@ var makeTempFileFactory = (method) => {
74809
74809
  const makeDirectory2 = makeTempDirectoryFactory(method);
74810
74810
  const open3 = openFactory(method);
74811
74811
  const randomHexString2 = (bytes) => sync5(() => Crypto__namespace.randomBytes(bytes).toString("hex"));
74812
- return (options3) => pipe(zip6(makeDirectory2(options3), randomHexString2(6)), map17(([directory5, random4]) => path5__namespace.join(directory5, random4)), tap3((path14) => scoped2(open3(path14, {
74812
+ return (options3) => pipe(zip6(makeDirectory2(options3), randomHexString2(6)), map17(([directory5, random4]) => path5__namespace.join(directory5, random4)), tap3((path15) => scoped2(open3(path15, {
74813
74813
  flag: "w+"
74814
74814
  }))));
74815
74815
  };
@@ -74821,17 +74821,17 @@ var makeTempFileScoped = /* @__PURE__ */ (() => {
74821
74821
  recursive: true
74822
74822
  })));
74823
74823
  })();
74824
- var readDirectory = (path14, options3) => tryPromise2({
74825
- try: () => NFS__namespace.promises.readdir(path14, options3),
74826
- catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path14])
74824
+ var readDirectory = (path15, options3) => tryPromise2({
74825
+ try: () => NFS__namespace.promises.readdir(path15, options3),
74826
+ catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path15])
74827
74827
  });
74828
- var readFile2 = (path14) => async2((resume2, signal) => {
74828
+ var readFile2 = (path15) => async2((resume2, signal) => {
74829
74829
  try {
74830
- NFS__namespace.readFile(path14, {
74830
+ NFS__namespace.readFile(path15, {
74831
74831
  signal
74832
74832
  }, (err, data) => {
74833
74833
  if (err) {
74834
- resume2(fail9(handleErrnoException("FileSystem", "readFile")(err, [path14])));
74834
+ resume2(fail9(handleErrnoException("FileSystem", "readFile")(err, [path15])));
74835
74835
  } else {
74836
74836
  resume2(succeed9(data));
74837
74837
  }
@@ -74842,11 +74842,11 @@ var readFile2 = (path14) => async2((resume2, signal) => {
74842
74842
  });
74843
74843
  var readLink = /* @__PURE__ */ (() => {
74844
74844
  const nodeReadLink = /* @__PURE__ */ effectify2(NFS__namespace.readlink, /* @__PURE__ */ handleErrnoException("FileSystem", "readLink"), /* @__PURE__ */ handleBadArgument("readLink"));
74845
- return (path14) => nodeReadLink(path14);
74845
+ return (path15) => nodeReadLink(path15);
74846
74846
  })();
74847
74847
  var realPath = /* @__PURE__ */ (() => {
74848
74848
  const nodeRealPath = /* @__PURE__ */ effectify2(NFS__namespace.realpath, /* @__PURE__ */ handleErrnoException("FileSystem", "realPath"), /* @__PURE__ */ handleBadArgument("realPath"));
74849
- return (path14) => nodeRealPath(path14);
74849
+ return (path15) => nodeRealPath(path15);
74850
74850
  })();
74851
74851
  var rename3 = /* @__PURE__ */ (() => {
74852
74852
  const nodeRename = /* @__PURE__ */ effectify2(NFS__namespace.rename, /* @__PURE__ */ handleErrnoException("FileSystem", "rename"), /* @__PURE__ */ handleBadArgument("rename"));
@@ -74870,40 +74870,40 @@ var makeFileInfo = (stat3) => ({
74870
74870
  });
74871
74871
  var stat2 = /* @__PURE__ */ (() => {
74872
74872
  const nodeStat = /* @__PURE__ */ effectify2(NFS__namespace.stat, /* @__PURE__ */ handleErrnoException("FileSystem", "stat"), /* @__PURE__ */ handleBadArgument("stat"));
74873
- return (path14) => map17(nodeStat(path14), makeFileInfo);
74873
+ return (path15) => map17(nodeStat(path15), makeFileInfo);
74874
74874
  })();
74875
74875
  var symlink2 = /* @__PURE__ */ (() => {
74876
74876
  const nodeSymlink = /* @__PURE__ */ effectify2(NFS__namespace.symlink, /* @__PURE__ */ handleErrnoException("FileSystem", "symlink"), /* @__PURE__ */ handleBadArgument("symlink"));
74877
- return (target, path14) => nodeSymlink(target, path14);
74877
+ return (target, path15) => nodeSymlink(target, path15);
74878
74878
  })();
74879
74879
  var truncate2 = /* @__PURE__ */ (() => {
74880
74880
  const nodeTruncate = /* @__PURE__ */ effectify2(NFS__namespace.truncate, /* @__PURE__ */ handleErrnoException("FileSystem", "truncate"), /* @__PURE__ */ handleBadArgument("truncate"));
74881
- return (path14, length4) => nodeTruncate(path14, length4 !== void 0 ? Number(length4) : void 0);
74881
+ return (path15, length4) => nodeTruncate(path15, length4 !== void 0 ? Number(length4) : void 0);
74882
74882
  })();
74883
74883
  var utimes2 = /* @__PURE__ */ (() => {
74884
74884
  const nodeUtimes = /* @__PURE__ */ effectify2(NFS__namespace.utimes, /* @__PURE__ */ handleErrnoException("FileSystem", "utime"), /* @__PURE__ */ handleBadArgument("utime"));
74885
- return (path14, atime, mtime) => nodeUtimes(path14, atime, mtime);
74885
+ return (path15, atime, mtime) => nodeUtimes(path15, atime, mtime);
74886
74886
  })();
74887
- var watchNode = (path14, options3) => asyncScoped2((emit) => acquireRelease2(sync5(() => {
74888
- const watcher = NFS__namespace.watch(path14, {
74887
+ var watchNode = (path15, options3) => asyncScoped2((emit) => acquireRelease2(sync5(() => {
74888
+ const watcher = NFS__namespace.watch(path15, {
74889
74889
  recursive: options3?.recursive
74890
- }, (event, path15) => {
74891
- if (!path15) return;
74890
+ }, (event, path16) => {
74891
+ if (!path16) return;
74892
74892
  switch (event) {
74893
74893
  case "rename": {
74894
- emit.fromEffect(matchEffect2(stat2(path15), {
74894
+ emit.fromEffect(matchEffect2(stat2(path16), {
74895
74895
  onSuccess: (_) => succeed9(WatchEventCreate({
74896
- path: path15
74896
+ path: path16
74897
74897
  })),
74898
74898
  onFailure: (err) => err._tag === "SystemError" && err.reason === "NotFound" ? succeed9(WatchEventRemove({
74899
- path: path15
74899
+ path: path16
74900
74900
  })) : fail9(err)
74901
74901
  }));
74902
74902
  return;
74903
74903
  }
74904
74904
  case "change": {
74905
74905
  emit.single(WatchEventUpdate({
74906
- path: path15
74906
+ path: path16
74907
74907
  }));
74908
74908
  return;
74909
74909
  }
@@ -74914,7 +74914,7 @@ var watchNode = (path14, options3) => asyncScoped2((emit) => acquireRelease2(syn
74914
74914
  module: "FileSystem",
74915
74915
  reason: "Unknown",
74916
74916
  method: "watch",
74917
- pathOrDescriptor: path14,
74917
+ pathOrDescriptor: path15,
74918
74918
  cause: error4
74919
74919
  }));
74920
74920
  });
@@ -74923,16 +74923,16 @@ var watchNode = (path14, options3) => asyncScoped2((emit) => acquireRelease2(syn
74923
74923
  });
74924
74924
  return watcher;
74925
74925
  }), (watcher) => sync5(() => watcher.close())));
74926
- var watch2 = (backend, path14, options3) => stat2(path14).pipe(map17((stat3) => backend.pipe(flatMap((_) => _.register(path14, stat3, options3)), getOrElse(() => watchNode(path14, options3)))), unwrap3);
74927
- var writeFile2 = (path14, data, options3) => async2((resume2, signal) => {
74926
+ var watch2 = (backend, path15, options3) => stat2(path15).pipe(map17((stat3) => backend.pipe(flatMap((_) => _.register(path15, stat3, options3)), getOrElse(() => watchNode(path15, options3)))), unwrap3);
74927
+ var writeFile2 = (path15, data, options3) => async2((resume2, signal) => {
74928
74928
  try {
74929
- NFS__namespace.writeFile(path14, data, {
74929
+ NFS__namespace.writeFile(path15, data, {
74930
74930
  signal,
74931
74931
  flag: options3?.flag,
74932
74932
  mode: options3?.mode
74933
74933
  }, (err) => {
74934
74934
  if (err) {
74935
- resume2(fail9(handleErrnoException("FileSystem", "writeFile")(err, [path14])));
74935
+ resume2(fail9(handleErrnoException("FileSystem", "writeFile")(err, [path15])));
74936
74936
  } else {
74937
74937
  resume2(_void);
74938
74938
  }
@@ -74964,8 +74964,8 @@ var makeFileSystem = /* @__PURE__ */ map17(/* @__PURE__ */ serviceOption2(WatchB
74964
74964
  symlink: symlink2,
74965
74965
  truncate: truncate2,
74966
74966
  utimes: utimes2,
74967
- watch(path14, options3) {
74968
- return watch2(backend, path14, options3);
74967
+ watch(path15, options3) {
74968
+ return watch2(backend, path15, options3);
74969
74969
  },
74970
74970
  writeFile: writeFile2
74971
74971
  }));
@@ -74990,12 +74990,12 @@ var fromFileUrl2 = (url2) => try_2({
74990
74990
  cause: error4
74991
74991
  })
74992
74992
  });
74993
- var toFileUrl2 = (path14) => try_2({
74994
- try: () => NodeUrl__namespace.pathToFileURL(path14),
74993
+ var toFileUrl2 = (path15) => try_2({
74994
+ try: () => NodeUrl__namespace.pathToFileURL(path15),
74995
74995
  catch: (error4) => new BadArgument({
74996
74996
  module: "Path",
74997
74997
  method: "toFileUrl",
74998
- description: `Invalid path: ${path14}`,
74998
+ description: `Invalid path: ${path15}`,
74999
74999
  cause: error4
75000
75000
  })
75001
75001
  });
@@ -75481,8 +75481,8 @@ var make59 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
75481
75481
  readlineInterface.once("line", onLine);
75482
75482
  return sync5(() => readlineInterface.off("line", onLine));
75483
75483
  })), scoped2);
75484
- const display = (prompt6) => uninterruptible2(async2((resume2) => {
75485
- stdout3.write(prompt6, (err) => err ? resume2(fail9(new BadArgument({
75484
+ const display = (prompt8) => uninterruptible2(async2((resume2) => {
75485
+ stdout3.write(prompt8, (err) => err ? resume2(fail9(new BadArgument({
75486
75486
  module: "Terminal",
75487
75487
  method: "display",
75488
75488
  description: "Failed to write prompt to stdout",
@@ -76153,22 +76153,22 @@ var fileParsers = {
76153
76153
  toml: (content) => Toml.parse(content),
76154
76154
  tml: (content) => Toml.parse(content)
76155
76155
  };
76156
- var read3 = (path14) => flatMap10(FileSystem, (fs) => matchEffect2(fs.readFile(path14), {
76157
- onFailure: (error4) => fail9(`Could not read file (${path14}): ${error4}`),
76158
- onSuccess: (content) => succeed9([path14, content])
76156
+ var read3 = (path15) => flatMap10(FileSystem, (fs) => matchEffect2(fs.readFile(path15), {
76157
+ onFailure: (error4) => fail9(`Could not read file (${path15}): ${error4}`),
76158
+ onSuccess: (content) => succeed9([path15, content])
76159
76159
  }));
76160
- var readString = (path14) => flatMap10(FileSystem, (fs) => matchEffect2(fs.readFileString(path14), {
76161
- onFailure: (error4) => fail9(`Could not read file (${path14}): ${error4}`),
76162
- onSuccess: (content) => succeed9([path14, content])
76160
+ var readString = (path15) => flatMap10(FileSystem, (fs) => matchEffect2(fs.readFileString(path15), {
76161
+ onFailure: (error4) => fail9(`Could not read file (${path15}): ${error4}`),
76162
+ onSuccess: (content) => succeed9([path15, content])
76163
76163
  }));
76164
- var parse5 = (path14, content, format6) => {
76165
- const parser = fileParsers[format6 ?? path14.split(".").pop()];
76164
+ var parse5 = (path15, content, format6) => {
76165
+ const parser = fileParsers[format6 ?? path15.split(".").pop()];
76166
76166
  if (parser === void 0) {
76167
76167
  return fail9(`Unsupported file format: ${format6}`);
76168
76168
  }
76169
76169
  return try_2({
76170
76170
  try: () => parser(content),
76171
- catch: (e) => `Could not parse ${format6} file (${path14}): ${e}`
76171
+ catch: (e) => `Could not parse ${format6} file (${path15}): ${e}`
76172
76172
  });
76173
76173
  };
76174
76174
 
@@ -77753,8 +77753,8 @@ var run5 = /* @__PURE__ */ fnUntraced2(function* (self2) {
77753
77753
  const input = yield* terminal.readInput;
77754
77754
  return yield* runWithInput(self2, terminal, input);
77755
77755
  }, /* @__PURE__ */ mapError2(() => new QuitException()), scoped2);
77756
- var runWithInput = (prompt6, terminal, input) => suspend4(() => {
77757
- const op = prompt6;
77756
+ var runWithInput = (prompt8, terminal, input) => suspend4(() => {
77757
+ const op = prompt8;
77758
77758
  switch (op._tag) {
77759
77759
  case "Loop": {
77760
77760
  return runLoop(op, terminal, input);
@@ -77967,8 +77967,8 @@ function eraseText(text11, columns) {
77967
77967
  }
77968
77968
  return eraseLines3(rows);
77969
77969
  }
77970
- function lines3(prompt6, columns) {
77971
- const lines4 = prompt6.split(/\r?\n/);
77970
+ function lines3(prompt8, columns) {
77971
+ const lines4 = prompt8.split(/\r?\n/);
77972
77972
  return columns === 0 ? lines4.length : pipe(map3(lines4, (line4) => Math.ceil(line4.length / columns)), reduce(0, (left3, right3) => left3 + right3));
77973
77973
  }
77974
77974
 
@@ -78470,22 +78470,22 @@ var showConfirmation = /* @__PURE__ */ Confirm.$is("Show");
78470
78470
  var renderBeep2 = /* @__PURE__ */ render3(beep3, {
78471
78471
  style: "pretty"
78472
78472
  });
78473
- function resolveCurrentPath(path14, options3) {
78474
- return match2(path14, {
78473
+ function resolveCurrentPath(path15, options3) {
78474
+ return match2(path15, {
78475
78475
  onNone: () => match2(options3.startingPath, {
78476
78476
  onNone: () => sync5(() => process.cwd()),
78477
- onSome: (path15) => flatMap10(FileSystem, (fs) => (
78477
+ onSome: (path16) => flatMap10(FileSystem, (fs) => (
78478
78478
  // Ensure the user provided starting path exists
78479
- orDie2(fs.exists(path15)).pipe(filterOrDieMessage2(identity, `The provided starting path '${path15}' does not exist`), as5(path15))
78479
+ orDie2(fs.exists(path16)).pipe(filterOrDieMessage2(identity, `The provided starting path '${path16}' does not exist`), as5(path16))
78480
78480
  ))
78481
78481
  }),
78482
- onSome: (path15) => succeed9(path15)
78482
+ onSome: (path16) => succeed9(path16)
78483
78483
  });
78484
78484
  }
78485
78485
  function getFileList(directory5, options3) {
78486
78486
  return gen3(function* () {
78487
78487
  const fs = yield* FileSystem;
78488
- const path14 = yield* Path3;
78488
+ const path15 = yield* Path3;
78489
78489
  const files = yield* orDie2(fs.readDirectory(directory5)).pipe(
78490
78490
  // Always prepend the `".."` option to the file list but allow it
78491
78491
  // to be filtered out if the user so desires
@@ -78494,7 +78494,7 @@ function getFileList(directory5, options3) {
78494
78494
  return yield* filter8(files, (file6) => {
78495
78495
  const result = options3.filter(file6);
78496
78496
  const userDefinedFilter = isEffect2(result) ? result : succeed9(result);
78497
- const directoryFilter = options3.type === "directory" ? map17(orDie2(fs.stat(path14.join(directory5, file6))), (info3) => info3.type === "Directory") : succeed9(true);
78497
+ const directoryFilter = options3.type === "directory" ? map17(orDie2(fs.stat(path15.join(directory5, file6))), (info3) => info3.type === "Directory") : succeed9(true);
78498
78498
  return zipWith5(userDefinedFilter, directoryFilter, (a, b) => a && b);
78499
78499
  }, {
78500
78500
  concurrency: files.length
@@ -78560,13 +78560,13 @@ function renderFiles(state, files, figures2, options3) {
78560
78560
  }
78561
78561
  function renderNextFrame2(state, options3) {
78562
78562
  return gen3(function* () {
78563
- const path14 = yield* Path3;
78563
+ const path15 = yield* Path3;
78564
78564
  const terminal = yield* Terminal;
78565
78565
  const columns = yield* terminal.columns;
78566
78566
  const figures2 = yield* figures;
78567
78567
  const currentPath = yield* resolveCurrentPath(state.path, options3);
78568
78568
  const selectedPath = state.files[state.cursor];
78569
- const resolvedPath = path14.resolve(currentPath, selectedPath);
78569
+ const resolvedPath = path15.resolve(currentPath, selectedPath);
78570
78570
  const resolvedPathMsg = figures2.pointerSmall.pipe(cat2(space2), cat2(text3(resolvedPath)), annotate2(blackBright2));
78571
78571
  if (showConfirmation(state.confirm)) {
78572
78572
  const leadingSymbol2 = annotate2(text3("?"), cyanBright2);
@@ -78641,10 +78641,10 @@ function processCursorDown(state) {
78641
78641
  function processSelection(state, options3) {
78642
78642
  return gen3(function* () {
78643
78643
  const fs = yield* FileSystem;
78644
- const path14 = yield* Path3;
78644
+ const path15 = yield* Path3;
78645
78645
  const currentPath = yield* resolveCurrentPath(state.path, options3);
78646
78646
  const selectedPath = state.files[state.cursor];
78647
- const resolvedPath = path14.resolve(currentPath, selectedPath);
78647
+ const resolvedPath = path15.resolve(currentPath, selectedPath);
78648
78648
  const info3 = yield* orDie2(fs.stat(resolvedPath));
78649
78649
  if (info3.type === "Directory") {
78650
78650
  const files = yield* getFileList(resolvedPath, options3);
@@ -78692,10 +78692,10 @@ function handleProcess2(options3) {
78692
78692
  case "y":
78693
78693
  case "t": {
78694
78694
  if (showConfirmation(state.confirm)) {
78695
- const path14 = yield* Path3;
78695
+ const path15 = yield* Path3;
78696
78696
  const currentPath = yield* resolveCurrentPath(state.path, options3);
78697
78697
  const selectedPath = state.files[state.cursor];
78698
- const resolvedPath = path14.resolve(currentPath, selectedPath);
78698
+ const resolvedPath = path15.resolve(currentPath, selectedPath);
78699
78699
  const files = yield* getFileList(resolvedPath, options3);
78700
78700
  return Action.NextFrame({
78701
78701
  state: {
@@ -78711,10 +78711,10 @@ function handleProcess2(options3) {
78711
78711
  case "n":
78712
78712
  case "f": {
78713
78713
  if (showConfirmation(state.confirm)) {
78714
- const path14 = yield* Path3;
78714
+ const path15 = yield* Path3;
78715
78715
  const currentPath = yield* resolveCurrentPath(state.path, options3);
78716
78716
  const selectedPath = state.files[state.cursor];
78717
- const resolvedPath = path14.resolve(currentPath, selectedPath);
78717
+ const resolvedPath = path15.resolve(currentPath, selectedPath);
78718
78718
  return Action.Submit({
78719
78719
  value: resolvedPath
78720
78720
  });
@@ -78736,14 +78736,14 @@ var file = (options3 = {}) => {
78736
78736
  filter: options3.filter ?? (() => succeed9(true))
78737
78737
  };
78738
78738
  const initialState3 = gen3(function* () {
78739
- const path14 = none2();
78740
- const currentPath = yield* resolveCurrentPath(path14, opts);
78739
+ const path15 = none2();
78740
+ const currentPath = yield* resolveCurrentPath(path15, opts);
78741
78741
  const files = yield* getFileList(currentPath, opts);
78742
78742
  const confirm = Confirm.Hide();
78743
78743
  return {
78744
78744
  cursor: 0,
78745
78745
  files,
78746
- path: path14,
78746
+ path: path15,
78747
78747
  confirm
78748
78748
  };
78749
78749
  });
@@ -79888,7 +79888,7 @@ var validateInternal = (self2, value5, config3) => {
79888
79888
  case "Path": {
79889
79889
  return flatMap10(FileSystem, (fileSystem) => {
79890
79890
  const errorMsg = "Path options do not have a default value";
79891
- return orElseFail2(value5, () => errorMsg).pipe(tap3((path14) => orDie2(fileSystem.exists(path14)).pipe(tap3((pathExists) => validatePathExistence(path14, self2.pathExists, pathExists).pipe(zipRight5(validatePathType(path14, self2.pathType, fileSystem).pipe(when2(() => self2.pathExists !== "no" && pathExists))))))));
79891
+ return orElseFail2(value5, () => errorMsg).pipe(tap3((path15) => orDie2(fileSystem.exists(path15)).pipe(tap3((pathExists) => validatePathExistence(path15, self2.pathExists, pathExists).pipe(zipRight5(validatePathType(path15, self2.pathType, fileSystem).pipe(when2(() => self2.pathExists !== "no" && pathExists))))))));
79892
79892
  });
79893
79893
  }
79894
79894
  case "Redacted": {
@@ -79903,24 +79903,24 @@ var validateInternal = (self2, value5, config3) => {
79903
79903
  }
79904
79904
  };
79905
79905
  var attempt = (option5, typeName, parse9) => orElseFail2(option5, () => `${typeName} options do not have a default value`).pipe(flatMap10((value5) => orElseFail2(parse9(value5), () => `'${value5}' is not a ${typeName}`)));
79906
- var validatePathExistence = (path14, shouldPathExist, pathExists) => {
79906
+ var validatePathExistence = (path15, shouldPathExist, pathExists) => {
79907
79907
  if (shouldPathExist === "no" && pathExists) {
79908
- return fail9(`Path '${path14}' must not exist`);
79908
+ return fail9(`Path '${path15}' must not exist`);
79909
79909
  }
79910
79910
  if (shouldPathExist === "yes" && !pathExists) {
79911
- return fail9(`Path '${path14}' must exist`);
79911
+ return fail9(`Path '${path15}' must exist`);
79912
79912
  }
79913
79913
  return _void;
79914
79914
  };
79915
- var validatePathType = (path14, pathType, fileSystem) => {
79915
+ var validatePathType = (path15, pathType, fileSystem) => {
79916
79916
  switch (pathType) {
79917
79917
  case "file": {
79918
- const checkIsFile = fileSystem.stat(path14).pipe(map17((info3) => info3.type === "File"), orDie2);
79919
- return fail9(`Expected path '${path14}' to be a regular file`).pipe(unlessEffect2(checkIsFile), asVoid4);
79918
+ const checkIsFile = fileSystem.stat(path15).pipe(map17((info3) => info3.type === "File"), orDie2);
79919
+ return fail9(`Expected path '${path15}' to be a regular file`).pipe(unlessEffect2(checkIsFile), asVoid4);
79920
79920
  }
79921
79921
  case "directory": {
79922
- const checkIsDirectory = fileSystem.stat(path14).pipe(map17((info3) => info3.type === "Directory"), orDie2);
79923
- return fail9(`Expected path '${path14}' to be a directory`).pipe(unlessEffect2(checkIsDirectory), asVoid4);
79922
+ const checkIsDirectory = fileSystem.stat(path15).pipe(map17((info3) => info3.type === "Directory"), orDie2);
79923
+ return fail9(`Expected path '${path15}' to be a directory`).pipe(unlessEffect2(checkIsDirectory), asVoid4);
79924
79924
  }
79925
79925
  case "either": {
79926
79926
  return _void;
@@ -80342,13 +80342,13 @@ var file2 = (config3) => makeSingle(fromNullable(config3?.name), path("file", co
80342
80342
  var fileContent = (config3) => mapEffect6(file2({
80343
80343
  ...config3,
80344
80344
  exists: "yes"
80345
- }), (path14) => mapError2(read3(path14), (e) => p(e)));
80346
- var fileParse = (config3) => mapEffect6(fileText(config3), ([path14, content]) => mapError2(parse5(path14, content, config3?.format), (e) => p(e)));
80345
+ }), (path15) => mapError2(read3(path15), (e) => p(e)));
80346
+ var fileParse = (config3) => mapEffect6(fileText(config3), ([path15, content]) => mapError2(parse5(path15, content, config3?.format), (e) => p(e)));
80347
80347
  var fileSchema = (schema, config3) => withSchema(fileParse(config3), schema);
80348
80348
  var fileText = (config3) => mapEffect6(file2({
80349
80349
  ...config3,
80350
80350
  exists: "yes"
80351
- }), (path14) => mapError2(readString(path14), (e) => p(e)));
80351
+ }), (path15) => mapError2(readString(path15), (e) => p(e)));
80352
80352
  var float3 = (config3) => makeSingle(fromNullable(config3?.name), float2);
80353
80353
  var integer4 = (config3) => makeSingle(fromNullable(config3?.name), integer3);
80354
80354
  var none12 = /* @__PURE__ */ (() => {
@@ -80964,12 +80964,12 @@ var directory3 = (name, config3) => makeSingle2(name, empty3(), path("directory"
80964
80964
  var file4 = (name, config3) => makeSingle2(name, empty3(), path("file", config3?.exists ?? "either"));
80965
80965
  var fileContent3 = (name) => mapEffect8(file4(name, {
80966
80966
  exists: "yes"
80967
- }), (path14) => mapError2(read3(path14), (msg) => invalidValue(p(msg))));
80968
- var fileParse3 = (name, format6) => mapEffect8(fileText3(name), ([path14, content]) => mapError2(parse5(path14, content, format6), (error4) => invalidValue(p(error4))));
80967
+ }), (path15) => mapError2(read3(path15), (msg) => invalidValue(p(msg))));
80968
+ var fileParse3 = (name, format6) => mapEffect8(fileText3(name), ([path15, content]) => mapError2(parse5(path15, content, format6), (error4) => invalidValue(p(error4))));
80969
80969
  var fileSchema3 = (name, schema, format6) => withSchema3(fileParse3(name, format6), schema);
80970
80970
  var fileText3 = (name) => mapEffect8(file4(name, {
80971
80971
  exists: "yes"
80972
- }), (path14) => mapError2(readString(path14), (error4) => invalidValue(p(error4))));
80972
+ }), (path15) => mapError2(readString(path15), (error4) => invalidValue(p(error4))));
80973
80973
  var filterMap8 = /* @__PURE__ */ dual(3, (self2, f, message) => mapEffect8(self2, (a) => match2(f(a), {
80974
80974
  onNone: () => left2(invalidValue(p(message))),
80975
80975
  onSome: right2
@@ -81031,11 +81031,11 @@ var withFallbackConfig3 = /* @__PURE__ */ dual(2, (self2, config3) => {
81031
81031
  }
81032
81032
  return makeWithFallback(self2, config3);
81033
81033
  });
81034
- var withFallbackPrompt = /* @__PURE__ */ dual(2, (self2, prompt6) => {
81034
+ var withFallbackPrompt = /* @__PURE__ */ dual(2, (self2, prompt8) => {
81035
81035
  if (isInstruction2(self2) && isWithDefault2(self2)) {
81036
- return makeWithDefault2(withFallbackPrompt(self2.options, prompt6), self2.fallback);
81036
+ return makeWithDefault2(withFallbackPrompt(self2.options, prompt8), self2.fallback);
81037
81037
  }
81038
- return makeWithFallback(self2, prompt6);
81038
+ return makeWithFallback(self2, prompt8);
81039
81039
  });
81040
81040
  var withDescription4 = /* @__PURE__ */ dual(2, (self2, desc) => modifySingle(self2, (single2) => {
81041
81041
  const description = sequence(single2.description, p(desc));
@@ -82178,12 +82178,12 @@ var make65 = (name, options3 = none14, args2 = none12) => {
82178
82178
  op.args = args2;
82179
82179
  return op;
82180
82180
  };
82181
- var prompt = (name, prompt6) => {
82181
+ var prompt = (name, prompt8) => {
82182
82182
  const op = Object.create(proto23);
82183
82183
  op._tag = "GetUserInput";
82184
82184
  op.name = name;
82185
82185
  op.description = empty39;
82186
- op.prompt = prompt6;
82186
+ op.prompt = prompt8;
82187
82187
  return op;
82188
82188
  };
82189
82189
  var getHelp7 = (self2, config3) => getHelpInternal4(self2, config3);
@@ -83024,7 +83024,7 @@ var getUsage6 = (self2) => getUsage5(self2.descriptor);
83024
83024
  var mapDescriptor = /* @__PURE__ */ dual(2, (self2, f) => makeDerive(self2, {
83025
83025
  descriptor: f(self2.descriptor)
83026
83026
  }));
83027
- var prompt2 = (name, prompt6, handler) => makeProto(map35(prompt(name, prompt6), (_) => _.value), handler, GenericTag(`@effect/cli/Prompt/${name}`));
83027
+ var prompt2 = (name, prompt8, handler) => makeProto(map35(prompt(name, prompt8), (_) => _.value), handler, GenericTag(`@effect/cli/Prompt/${name}`));
83028
83028
  var withHandler = /* @__PURE__ */ dual(2, (self2, handler) => makeDerive(self2, {
83029
83029
  handler,
83030
83030
  transform: identity
@@ -83125,22 +83125,202 @@ var make69 = make42;
83125
83125
  var makeWith2 = makeWith;
83126
83126
  var makeCacheStats2 = makeCacheStats;
83127
83127
  var makeEntryStats2 = makeEntryStats;
83128
- var NotAGitRepoError = class extends Data_exports.TaggedError(
83129
- "NotAGitRepoError"
83128
+
83129
+ // src/commit-utils.ts
83130
+ var import_prompts = __toESM(require_prompts3());
83131
+
83132
+ // src/prompt-utils.ts
83133
+ var PromptCancelledError = class extends Data_exports.TaggedError(
83134
+ "PromptCancelledError"
83130
83135
  ) {
83131
83136
  };
83137
+ var runPrompt = (promptFn) => {
83138
+ return Effect_exports.gen(function* () {
83139
+ const result = yield* Effect_exports.promise(() => promptFn());
83140
+ if (Object.keys(result).length === 0) {
83141
+ return yield* new PromptCancelledError();
83142
+ }
83143
+ return result;
83144
+ });
83145
+ };
83146
+
83147
+ // src/commit-utils.ts
83132
83148
  var CommitNotFoundError = class extends Data_exports.TaggedError(
83133
83149
  "CommitNotFoundError"
83134
83150
  ) {
83135
83151
  };
83152
+ var NoParentCommitError = class extends Data_exports.TaggedError(
83153
+ "NoParentCommitError"
83154
+ ) {
83155
+ };
83156
+ var parseCommits = (commitHistory) => {
83157
+ return commitHistory.trim().split("\n").filter(Boolean).map((line4) => {
83158
+ const [sha, ...messageParts] = line4.split(" ");
83159
+ const fullMessage = messageParts.join(" ");
83160
+ const lessonMatch = fullMessage.match(
83161
+ /^(\d+)[.-](\d+)[.-](\d+)\s*/
83162
+ );
83163
+ const extractedLessonId = lessonMatch ? `${lessonMatch[1].padStart(
83164
+ 2,
83165
+ "0"
83166
+ )}.${lessonMatch[2].padStart(
83167
+ 2,
83168
+ "0"
83169
+ )}.${lessonMatch[3].padStart(2, "0")}` : null;
83170
+ const message = lessonMatch ? fullMessage.slice(lessonMatch[0].length).trim() : fullMessage;
83171
+ return {
83172
+ sha,
83173
+ message,
83174
+ lessonId: extractedLessonId
83175
+ };
83176
+ });
83177
+ };
83178
+ var selectLessonCommit = ({
83179
+ branch,
83180
+ cwd,
83181
+ excludeCurrentBranch,
83182
+ lessonId,
83183
+ promptMessage
83184
+ }) => Effect_exports.gen(function* () {
83185
+ let commits;
83186
+ if (excludeCurrentBranch) {
83187
+ const currentBranchCommand = Command_exports.make(
83188
+ "git",
83189
+ "log",
83190
+ "HEAD",
83191
+ "--oneline"
83192
+ ).pipe(Command_exports.workingDirectory(cwd));
83193
+ const currentBranchHistory = yield* Command_exports.string(
83194
+ currentBranchCommand
83195
+ );
83196
+ const currentBranchCommits = parseCommits(currentBranchHistory);
83197
+ const currentLessonIds = new Set(
83198
+ currentBranchCommits.filter((c) => c.lessonId !== null).map((c) => c.lessonId)
83199
+ );
83200
+ const targetBranchCommand = Command_exports.make(
83201
+ "git",
83202
+ "log",
83203
+ branch,
83204
+ "--oneline"
83205
+ ).pipe(Command_exports.workingDirectory(cwd));
83206
+ const targetBranchHistory = yield* Command_exports.string(
83207
+ targetBranchCommand
83208
+ );
83209
+ const allTargetCommits = parseCommits(targetBranchHistory);
83210
+ commits = allTargetCommits.filter(
83211
+ (c) => !c.lessonId || !currentLessonIds.has(c.lessonId)
83212
+ );
83213
+ } else {
83214
+ const gitLogCommand = Command_exports.make(
83215
+ "git",
83216
+ "log",
83217
+ branch,
83218
+ "--oneline"
83219
+ ).pipe(Command_exports.workingDirectory(cwd));
83220
+ const commitHistory = yield* Command_exports.string(gitLogCommand);
83221
+ commits = parseCommits(commitHistory);
83222
+ }
83223
+ let selectedLessonId;
83224
+ if (Option_exports.isSome(lessonId)) {
83225
+ selectedLessonId = lessonId.value;
83226
+ yield* Console_exports.log(
83227
+ `Searching for lesson ${selectedLessonId} on branch ${branch}...`
83228
+ );
83229
+ } else {
83230
+ const commitsWithLessonIds = commits.filter(
83231
+ (commit) => commit.lessonId !== null
83232
+ );
83233
+ if (commitsWithLessonIds.length === 0) {
83234
+ return yield* Effect_exports.fail(
83235
+ new CommitNotFoundError({
83236
+ lessonId: "any",
83237
+ branch
83238
+ })
83239
+ );
83240
+ }
83241
+ const sortedCommits = commitsWithLessonIds.sort((a, b) => {
83242
+ return a.lessonId.localeCompare(b.lessonId);
83243
+ });
83244
+ const { lesson } = yield* runPrompt(
83245
+ () => (0, import_prompts.default)([
83246
+ {
83247
+ type: "autocomplete",
83248
+ name: "lesson",
83249
+ message: promptMessage,
83250
+ choices: sortedCommits.map((commit) => ({
83251
+ title: commit.lessonId,
83252
+ value: commit.lessonId,
83253
+ description: commit.message
83254
+ })),
83255
+ suggest: async (input, choices) => {
83256
+ return choices.filter((choice6) => {
83257
+ const searchText = `${choice6.title} ${choice6.description}`;
83258
+ return searchText.toLowerCase().includes(input.toLowerCase());
83259
+ });
83260
+ }
83261
+ }
83262
+ ])
83263
+ );
83264
+ selectedLessonId = lesson;
83265
+ }
83266
+ const matchingCommits = commits.filter(
83267
+ (commit) => commit.lessonId === selectedLessonId
83268
+ );
83269
+ if (matchingCommits.length === 0) {
83270
+ return yield* new CommitNotFoundError({
83271
+ lessonId: selectedLessonId,
83272
+ branch
83273
+ });
83274
+ }
83275
+ const targetCommit = matchingCommits[matchingCommits.length - 1];
83276
+ yield* Console_exports.log(
83277
+ `Found commit: ${targetCommit.sha} ${targetCommit.message}`
83278
+ );
83279
+ return {
83280
+ commit: targetCommit,
83281
+ lessonId: selectedLessonId
83282
+ };
83283
+ });
83284
+ var getParentCommit = ({
83285
+ commitSha,
83286
+ cwd
83287
+ }) => Effect_exports.gen(function* () {
83288
+ const gitRevParseCommand = Command_exports.make(
83289
+ "git",
83290
+ "rev-parse",
83291
+ `${commitSha}^`
83292
+ ).pipe(Command_exports.workingDirectory(cwd));
83293
+ const parentSha = yield* Command_exports.string(
83294
+ gitRevParseCommand
83295
+ ).pipe(
83296
+ Effect_exports.mapError(() => new NoParentCommitError({ commitSha }))
83297
+ );
83298
+ return parentSha.trim();
83299
+ });
83300
+
83301
+ // src/constants.ts
83302
+ var DEFAULT_PROJECT_TARGET_BRANCH = "live-run-through";
83303
+
83304
+ // src/cherry-pick.ts
83305
+ var NotAGitRepoError = class extends Data_exports.TaggedError(
83306
+ "NotAGitRepoError"
83307
+ ) {
83308
+ };
83309
+ var InvalidBranchOperationError = class extends Data_exports.TaggedError(
83310
+ "InvalidBranchOperationError"
83311
+ ) {
83312
+ };
83136
83313
  var cherryPick = Command_exports2.make(
83137
83314
  "cherry-pick",
83138
83315
  {
83139
- lessonId: Args_exports.text({ name: "lesson-id" }),
83316
+ lessonId: Args_exports.text({ name: "lesson-id" }).pipe(
83317
+ Args_exports.optional
83318
+ ),
83140
83319
  branch: Options_exports.text("branch").pipe(
83141
83320
  Options_exports.withDescription(
83142
83321
  "Branch to search for the lesson commit"
83143
- )
83322
+ ),
83323
+ Options_exports.withDefault(DEFAULT_PROJECT_TARGET_BRANCH)
83144
83324
  )
83145
83325
  },
83146
83326
  ({ branch, lessonId }) => Effect_exports.gen(function* () {
@@ -83154,9 +83334,6 @@ var cherryPick = Command_exports2.make(
83154
83334
  })
83155
83335
  );
83156
83336
  }
83157
- yield* Console_exports.log(
83158
- `Searching for lesson ${lessonId} on branch ${branch}...`
83159
- );
83160
83337
  const gitFetchCommand = Command_exports.make(
83161
83338
  "git",
83162
83339
  "fetch",
@@ -83174,45 +83351,34 @@ var cherryPick = Command_exports2.make(
83174
83351
  process.exitCode = 1;
83175
83352
  return;
83176
83353
  }
83177
- const gitLogCommand = Command_exports.make(
83178
- "git",
83179
- "log",
83354
+ const {
83355
+ commit: targetCommit,
83356
+ lessonId: selectedLessonId
83357
+ } = yield* selectLessonCommit({
83358
+ cwd,
83180
83359
  branch,
83181
- "--oneline"
83182
- ).pipe(Command_exports.workingDirectory(cwd));
83183
- const commitHistory = yield* Command_exports.string(gitLogCommand);
83184
- const commits = commitHistory.trim().split("\n").filter(Boolean).map((line4) => {
83185
- const [sha, ...messageParts] = line4.split(" ");
83186
- const message = messageParts.join(" ");
83187
- const lessonMatch = message.match(
83188
- /^(\d+)[.-](\d+)[.-](\d+)/
83189
- );
83190
- const extractedLessonId = lessonMatch ? `${lessonMatch[1].padStart(
83191
- 2,
83192
- "0"
83193
- )}.${lessonMatch[2].padStart(
83194
- 2,
83195
- "0"
83196
- )}.${lessonMatch[3].padStart(2, "0")}` : null;
83197
- return {
83198
- sha,
83199
- message,
83200
- lessonId: extractedLessonId
83201
- };
83360
+ lessonId,
83361
+ promptMessage: "Which lesson do you want to cherry-pick? (type to search)",
83362
+ excludeCurrentBranch: true
83202
83363
  });
83203
- const matchingCommits = commits.filter(
83204
- (commit) => commit.lessonId === lessonId
83205
- );
83206
- if (matchingCommits.length === 0) {
83207
- return yield* new CommitNotFoundError({
83208
- lessonId,
83209
- branch
83364
+ const currentBranchCommand = Command_exports.make(
83365
+ "git",
83366
+ "branch",
83367
+ "--show-current"
83368
+ ).pipe(Command_exports.workingDirectory(cwd));
83369
+ const currentBranch = (yield* Command_exports.string(
83370
+ currentBranchCommand
83371
+ )).trim();
83372
+ if (currentBranch === branch) {
83373
+ return yield* new InvalidBranchOperationError({
83374
+ message: `Cannot cherry-pick when on target branch "${branch}"`
83375
+ });
83376
+ }
83377
+ if (currentBranch === "main") {
83378
+ return yield* new InvalidBranchOperationError({
83379
+ message: `Cannot cherry-pick when on "main" branch`
83210
83380
  });
83211
83381
  }
83212
- const targetCommit = matchingCommits[matchingCommits.length - 1];
83213
- yield* Console_exports.log(
83214
- `Found commit: ${targetCommit.sha} ${targetCommit.message}`
83215
- );
83216
83382
  yield* Console_exports.log(
83217
83383
  `Cherry-picking ${targetCommit.sha} onto current branch...
83218
83384
  `
@@ -83236,7 +83402,7 @@ var cherryPick = Command_exports2.make(
83236
83402
  }
83237
83403
  yield* Console_exports.log(
83238
83404
  `
83239
- \u2713 Successfully cherry-picked lesson ${lessonId}`
83405
+ \u2713 Successfully cherry-picked lesson ${selectedLessonId}`
83240
83406
  );
83241
83407
  }).pipe(
83242
83408
  Effect_exports.catchTags({
@@ -83253,6 +83419,18 @@ var cherryPick = Command_exports2.make(
83253
83419
  );
83254
83420
  process.exitCode = 1;
83255
83421
  });
83422
+ },
83423
+ InvalidBranchOperationError: (error4) => {
83424
+ return Effect_exports.gen(function* () {
83425
+ yield* Console_exports.error(`Error: ${error4.message}`);
83426
+ process.exitCode = 1;
83427
+ });
83428
+ },
83429
+ PromptCancelledError: () => {
83430
+ return Effect_exports.gen(function* () {
83431
+ yield* Console_exports.log("Operation cancelled");
83432
+ process.exitCode = 0;
83433
+ });
83256
83434
  }
83257
83435
  }),
83258
83436
  Effect_exports.catchAll((error4) => {
@@ -83269,7 +83447,7 @@ var cherryPick = Command_exports2.make(
83269
83447
  );
83270
83448
 
83271
83449
  // src/exercise.ts
83272
- var import_prompts = __toESM(require_prompts3());
83450
+ var import_prompts2 = __toESM(require_prompts3());
83273
83451
 
83274
83452
  // node_modules/.pnpm/@effect+platform-node@0.95.0_@effect+cluster@0.47.0_@effect+platform@0.90.2_effect@3.17_717c1c3b02c892e86f9e65866f1c696c/node_modules/@effect/platform-node/dist/esm/Undici.js
83275
83453
  var Undici_exports = {};
@@ -83365,13 +83543,13 @@ var Lesson = class {
83365
83543
  });
83366
83544
  }
83367
83545
  };
83368
- var getNameAndNumberFromPath = (path14) => {
83369
- const numSection = path14.split("-")[0];
83546
+ var getNameAndNumberFromPath = (path15) => {
83547
+ const numSection = path15.split("-")[0];
83370
83548
  if (typeof numSection === "undefined") {
83371
83549
  return Effect_exports.fail(
83372
83550
  new InvalidPathError({
83373
- path: path14,
83374
- message: `Could not retrieve number from path: ${path14}`
83551
+ path: path15,
83552
+ message: `Could not retrieve number from path: ${path15}`
83375
83553
  })
83376
83554
  );
83377
83555
  }
@@ -83379,18 +83557,18 @@ var getNameAndNumberFromPath = (path14) => {
83379
83557
  if (Number.isNaN(num)) {
83380
83558
  return Effect_exports.fail(
83381
83559
  new PathNumberIsNaNError({
83382
- path: path14,
83560
+ path: path15,
83383
83561
  numSection,
83384
- message: `Could not retrieve number from path: ${path14}`
83562
+ message: `Could not retrieve number from path: ${path15}`
83385
83563
  })
83386
83564
  );
83387
83565
  }
83388
- const name = path14.split("-").slice(1).join("-");
83566
+ const name = path15.split("-").slice(1).join("-");
83389
83567
  if (!name) {
83390
83568
  return Effect_exports.fail(
83391
83569
  new InvalidPathError({
83392
- path: path14,
83393
- message: `Could not retrieve name from path: ${path14}`
83570
+ path: path15,
83571
+ message: `Could not retrieve name from path: ${path15}`
83394
83572
  })
83395
83573
  );
83396
83574
  }
@@ -83399,12 +83577,12 @@ var getNameAndNumberFromPath = (path14) => {
83399
83577
  num
83400
83578
  });
83401
83579
  };
83402
- var parseSection = Effect_exports.fn("parseSection")(function* (path14) {
83403
- const { name, num } = yield* getNameAndNumberFromPath(path14);
83580
+ var parseSection = Effect_exports.fn("parseSection")(function* (path15) {
83581
+ const { name, num } = yield* getNameAndNumberFromPath(path15);
83404
83582
  return {
83405
83583
  name,
83406
83584
  num,
83407
- path: path14
83585
+ path: path15
83408
83586
  };
83409
83587
  });
83410
83588
  var filterMeOut = Symbol("filterMeOut");
@@ -83505,19 +83683,6 @@ var envFilePathOption = Options_exports.text("env-file").pipe(
83505
83683
  );
83506
83684
 
83507
83685
  // src/exercise.ts
83508
- var PromptCancelledError = class extends Data_exports.TaggedError(
83509
- "PromptCancelledError"
83510
- ) {
83511
- };
83512
- var runPrompt = (prompt6) => {
83513
- return Effect_exports.gen(function* () {
83514
- const result = yield* Effect_exports.promise(() => prompt6());
83515
- if (!result) {
83516
- return yield* new PromptCancelledError();
83517
- }
83518
- return result;
83519
- });
83520
- };
83521
83686
  var LessonNotFoundError = class extends Data_exports.TaggedError(
83522
83687
  "LessonNotFoundError"
83523
83688
  ) {
@@ -83650,7 +83815,7 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
83650
83815
  lowercase: "exercise"
83651
83816
  };
83652
83817
  const { choice: choice6 } = yield* runPrompt(
83653
- () => (0, import_prompts.default)([
83818
+ () => (0, import_prompts2.default)([
83654
83819
  {
83655
83820
  type: "select",
83656
83821
  name: "choice",
@@ -83739,7 +83904,7 @@ var chooseLessonAndRunIt = (opts) => Effect_exports.gen(function* () {
83739
83904
  );
83740
83905
  yield* Console_exports.clear;
83741
83906
  const { lesson: lessonNumber } = yield* runPrompt(
83742
- () => (0, import_prompts.default)([
83907
+ () => (0, import_prompts2.default)([
83743
83908
  {
83744
83909
  type: "autocomplete",
83745
83910
  name: "lesson",
@@ -83839,7 +84004,7 @@ var selectSubfolderIndex = Effect_exports.fn("selectSubfolder")(
83839
84004
  });
83840
84005
  }
83841
84006
  const result = yield* runPrompt(
83842
- () => (0, import_prompts.default)([
84007
+ () => (0, import_prompts2.default)([
83843
84008
  {
83844
84009
  type: "select",
83845
84010
  name: "subfolderIndex",
@@ -83887,8 +84052,8 @@ var RunLessonSimpleError = class extends Data_exports.TaggedError(
83887
84052
  ) {
83888
84053
  };
83889
84054
  var notFound2 = Symbol("notFound");
83890
- var getNumberFromPathSegment = (path14) => {
83891
- const numberSegment = path14.split("-")[0];
84055
+ var getNumberFromPathSegment = (path15) => {
84056
+ const numberSegment = path15.split("-")[0];
83892
84057
  return Number.isNaN(Number(numberSegment)) ? notFound2 : Number(numberSegment);
83893
84058
  };
83894
84059
  var startsWithNumber = (segment) => {
@@ -84511,10 +84676,10 @@ var MissingExerciseFolderError = class extends Data_exports.TaggedError(
84511
84676
  "DiffGenerationError"
84512
84677
  ) {
84513
84678
  });
84514
- var DirtyWorkingTreeError = class extends Data_exports.TaggedError(
84679
+ (class extends Data_exports.TaggedError(
84515
84680
  "DirtyWorkingTreeError"
84516
84681
  ) {
84517
- };
84682
+ });
84518
84683
  var NoExerciseFoundError = class extends Data_exports.TaggedError(
84519
84684
  "NoExerciseFoundError"
84520
84685
  ) {
@@ -84528,9 +84693,8 @@ var getDiffs = Command_exports2.make(
84528
84693
  )
84529
84694
  ),
84530
84695
  branch: Options_exports.text("branch").pipe(
84531
- Options_exports.withDescription(
84532
- "Branch to checkout before getting diffs"
84533
- )
84696
+ Options_exports.withDescription("Branch to get diffs from"),
84697
+ Options_exports.withDefault(DEFAULT_PROJECT_TARGET_BRANCH)
84534
84698
  ),
84535
84699
  root: Options_exports.text("root").pipe(
84536
84700
  Options_exports.withDescription(
@@ -84558,39 +84722,24 @@ var getDiffs = Command_exports2.make(
84558
84722
  })
84559
84723
  );
84560
84724
  }
84561
- const gitStatusCommand = Command_exports.make(
84562
- "git",
84563
- "status",
84564
- "--porcelain"
84565
- ).pipe(Command_exports.workingDirectory(projectRepo));
84566
- const statusOutput = yield* Command_exports.string(
84567
- gitStatusCommand
84568
- );
84569
- if (statusOutput.trim() !== "") {
84570
- return yield* Effect_exports.fail(
84571
- new DirtyWorkingTreeError({
84572
- path: projectRepo,
84573
- message: `Working tree has uncommitted changes. Commit or stash changes before running get-diffs`
84574
- })
84575
- );
84576
- }
84577
- const gitCheckoutCommand = Command_exports.make(
84725
+ yield* Console_exports.log("Fetching latest from origin...");
84726
+ const gitFetchCommand = Command_exports.make(
84578
84727
  "git",
84579
- "checkout",
84580
- branch
84728
+ "fetch",
84729
+ "origin"
84581
84730
  ).pipe(Command_exports.workingDirectory(projectRepo));
84582
- const checkoutExitCode = yield* Command_exports.exitCode(
84583
- gitCheckoutCommand
84731
+ const fetchExitCode = yield* Command_exports.exitCode(
84732
+ gitFetchCommand
84584
84733
  ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
84585
- if (checkoutExitCode !== 0) {
84734
+ if (fetchExitCode !== 0) {
84586
84735
  return yield* Effect_exports.fail(
84587
84736
  new InvalidProjectRepoError({
84588
84737
  path: projectRepo,
84589
- message: `Failed to checkout branch: ${branch}`
84738
+ message: `Failed to fetch from origin`
84590
84739
  })
84591
84740
  );
84592
84741
  }
84593
- yield* Console_exports.log(`\u2713 Checked out branch: ${branch}`);
84742
+ yield* Console_exports.log(`\u2713 Fetched latest from origin`);
84594
84743
  yield* Console_exports.log(
84595
84744
  `\u2713 Validated project repo: ${projectRepo}`
84596
84745
  );
@@ -84602,7 +84751,7 @@ var getDiffs = Command_exports2.make(
84602
84751
  "--oneline",
84603
84752
  "--reverse",
84604
84753
  // Chronological order (oldest first)
84605
- "--all"
84754
+ branch
84606
84755
  ).pipe(Command_exports.workingDirectory(projectRepo));
84607
84756
  const commitHistory = yield* Command_exports.string(gitLogCommand);
84608
84757
  const commits = commitHistory.trim().split("\n").filter(Boolean).map((line4) => {
@@ -84802,17 +84951,419 @@ var getDiffs = Command_exports2.make(
84802
84951
  process.exitCode = 1;
84803
84952
  });
84804
84953
  },
84805
- DirtyWorkingTreeError: (error4) => {
84954
+ NoExerciseFoundError: (error4) => {
84955
+ return Effect_exports.gen(function* () {
84956
+ yield* Console_exports.error(
84957
+ `Error: No exercise found for ${error4.exerciseId} (commit: ${error4.commitSha})`
84958
+ );
84959
+ process.exitCode = 1;
84960
+ });
84961
+ }
84962
+ }),
84963
+ Effect_exports.catchAll((error4) => {
84964
+ return Effect_exports.gen(function* () {
84965
+ yield* Console_exports.error(`Unexpected error: ${error4}`);
84966
+ process.exitCode = 1;
84967
+ });
84968
+ })
84969
+ )
84970
+ ).pipe(
84971
+ Command_exports2.withDescription(
84972
+ "Get commit diffs from a project repo and save to exercise folders"
84973
+ )
84974
+ );
84975
+
84976
+ // src/internal/edit-commit.ts
84977
+ var import_prompts3 = __toESM(require_prompts3());
84978
+ var NotAGitRepoError2 = class extends Data_exports.TaggedError(
84979
+ "NotAGitRepoError"
84980
+ ) {
84981
+ };
84982
+ (class extends Data_exports.TaggedError(
84983
+ "NoFollowingCommitsError"
84984
+ ) {
84985
+ });
84986
+ (class extends Data_exports.TaggedError(
84987
+ "CherryPickConflictError"
84988
+ ) {
84989
+ });
84990
+ var CommitFailedError = class extends Data_exports.TaggedError(
84991
+ "CommitFailedError"
84992
+ ) {
84993
+ };
84994
+ var editCommit = Command_exports2.make(
84995
+ "edit-commit",
84996
+ {
84997
+ lessonId: Args_exports.text({ name: "lesson-id" }).pipe(
84998
+ Args_exports.optional
84999
+ ),
85000
+ branch: Options_exports.text("branch").pipe(
85001
+ Options_exports.withDescription(
85002
+ "Branch to search for the lesson commit"
85003
+ ),
85004
+ Options_exports.withDefault(DEFAULT_PROJECT_TARGET_BRANCH)
85005
+ )
85006
+ },
85007
+ ({ branch, lessonId }) => Effect_exports.gen(function* () {
85008
+ const cwd = process.cwd();
85009
+ const gitDirPath = path5__namespace.join(cwd, ".git");
85010
+ if (!NFS.existsSync(gitDirPath)) {
85011
+ return yield* Effect_exports.fail(
85012
+ new NotAGitRepoError2({
85013
+ path: cwd,
85014
+ message: `Current directory is not a git repository: ${cwd}`
85015
+ })
85016
+ );
85017
+ }
85018
+ const gitFetchCommand = Command_exports.make(
85019
+ "git",
85020
+ "fetch",
85021
+ "origin"
85022
+ ).pipe(
85023
+ Command_exports.workingDirectory(cwd),
85024
+ Command_exports.stdout("inherit"),
85025
+ Command_exports.stderr("inherit")
85026
+ );
85027
+ const fetchExitCode = yield* Command_exports.exitCode(
85028
+ gitFetchCommand
85029
+ );
85030
+ if (fetchExitCode !== 0) {
85031
+ yield* Console_exports.error("Failed to fetch branch");
85032
+ process.exitCode = 1;
85033
+ return;
85034
+ }
85035
+ const currentBranchCommand = Command_exports.make(
85036
+ "git",
85037
+ "branch",
85038
+ "--show-current"
85039
+ ).pipe(Command_exports.workingDirectory(cwd));
85040
+ const currentBranch = (yield* Command_exports.string(
85041
+ currentBranchCommand
85042
+ )).trim();
85043
+ if (currentBranch === branch) {
85044
+ yield* Console_exports.error(
85045
+ `Error: Cannot edit commit on target branch "${branch}". Switch to a different branch first.`
85046
+ );
85047
+ process.exitCode = 1;
85048
+ return;
85049
+ }
85050
+ const {
85051
+ commit: targetCommit,
85052
+ lessonId: selectedLessonId
85053
+ } = yield* selectLessonCommit({
85054
+ cwd,
85055
+ branch,
85056
+ lessonId,
85057
+ promptMessage: "Which lesson do you want to edit? (type to search)",
85058
+ excludeCurrentBranch: false
85059
+ });
85060
+ const originalMessage = `${selectedLessonId} ${targetCommit.message}`;
85061
+ const targetSha = targetCommit.sha;
85062
+ const getTargetBranchHeadCommand = Command_exports.make(
85063
+ "git",
85064
+ "rev-parse",
85065
+ `origin/${branch}`
85066
+ ).pipe(Command_exports.workingDirectory(cwd));
85067
+ const targetBranchHead = (yield* Command_exports.string(
85068
+ getTargetBranchHeadCommand
85069
+ )).trim();
85070
+ const countCommand = Command_exports.make(
85071
+ "git",
85072
+ "rev-list",
85073
+ "--count",
85074
+ `${targetSha}..origin/${branch}`
85075
+ ).pipe(Command_exports.workingDirectory(cwd));
85076
+ const countOutput = (yield* Command_exports.string(
85077
+ countCommand
85078
+ )).trim();
85079
+ const followingCommitCount = parseInt(countOutput, 10);
85080
+ if (followingCommitCount === 0) {
85081
+ yield* Console_exports.log(
85082
+ `Warning: No commits after ${selectedLessonId}. You can still edit this commit.`
85083
+ );
85084
+ } else {
85085
+ yield* Console_exports.log(
85086
+ `Will reset to ${selectedLessonId}. Will cherry-pick ${followingCommitCount} commit${followingCommitCount === 1 ? "" : "s"} after.`
85087
+ );
85088
+ }
85089
+ yield* Console_exports.log(
85090
+ `Resetting to ${targetSha} (${selectedLessonId})...`
85091
+ );
85092
+ const resetCommand = Command_exports.make(
85093
+ "git",
85094
+ "reset",
85095
+ "--hard",
85096
+ targetSha
85097
+ ).pipe(
85098
+ Command_exports.workingDirectory(cwd),
85099
+ Command_exports.stdout("inherit"),
85100
+ Command_exports.stderr("inherit")
85101
+ );
85102
+ const resetExitCode = yield* Command_exports.exitCode(
85103
+ resetCommand
85104
+ ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
85105
+ if (resetExitCode !== 0) {
85106
+ yield* Console_exports.error("Failed to reset");
85107
+ process.exitCode = 1;
85108
+ return;
85109
+ }
85110
+ yield* Console_exports.log(
85111
+ "Undoing commit and unstaging changes..."
85112
+ );
85113
+ const undoCommand = Command_exports.make(
85114
+ "git",
85115
+ "reset",
85116
+ "HEAD^"
85117
+ ).pipe(
85118
+ Command_exports.workingDirectory(cwd),
85119
+ Command_exports.stdout("inherit"),
85120
+ Command_exports.stderr("inherit")
85121
+ );
85122
+ const undoExitCode = yield* Command_exports.exitCode(
85123
+ undoCommand
85124
+ ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
85125
+ if (undoExitCode !== 0) {
85126
+ yield* Console_exports.error("Failed to undo commit");
85127
+ process.exitCode = 1;
85128
+ return;
85129
+ }
85130
+ const unstageCommand = Command_exports.make(
85131
+ "git",
85132
+ "restore",
85133
+ "--staged",
85134
+ "."
85135
+ ).pipe(
85136
+ Command_exports.workingDirectory(cwd),
85137
+ Command_exports.stdout("inherit"),
85138
+ Command_exports.stderr("inherit")
85139
+ );
85140
+ const unstageExitCode = yield* Command_exports.exitCode(
85141
+ unstageCommand
85142
+ ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
85143
+ if (unstageExitCode !== 0) {
85144
+ yield* Console_exports.error("Failed to unstage changes");
85145
+ process.exitCode = 1;
85146
+ return;
85147
+ }
85148
+ yield* Console_exports.log(
85149
+ "\u2713 Reset complete with unstaged changes"
85150
+ );
85151
+ yield* Console_exports.log(
85152
+ "\nSession active. Make your changes to the code."
85153
+ );
85154
+ const { ready } = yield* runPrompt(
85155
+ () => (0, import_prompts3.default)([
85156
+ {
85157
+ type: "confirm",
85158
+ name: "ready",
85159
+ message: "Ready to commit?",
85160
+ initial: true
85161
+ }
85162
+ ])
85163
+ );
85164
+ if (!ready) {
85165
+ yield* Console_exports.log(
85166
+ "Session cancelled. Branch left as-is."
85167
+ );
85168
+ return;
85169
+ }
85170
+ yield* Console_exports.log(
85171
+ `Committing with original message: "${originalMessage}"`
85172
+ );
85173
+ const addCommand = Command_exports.make("git", "add", "-A").pipe(
85174
+ Command_exports.workingDirectory(cwd),
85175
+ Command_exports.stdout("inherit"),
85176
+ Command_exports.stderr("inherit")
85177
+ );
85178
+ const addExitCode = yield* Command_exports.exitCode(
85179
+ addCommand
85180
+ ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
85181
+ if (addExitCode !== 0) {
85182
+ yield* Console_exports.error("Failed to add files");
85183
+ process.exitCode = 1;
85184
+ return;
85185
+ }
85186
+ const commitCommand = Command_exports.make(
85187
+ "git",
85188
+ "commit",
85189
+ "-m",
85190
+ originalMessage
85191
+ ).pipe(
85192
+ Command_exports.workingDirectory(cwd),
85193
+ Command_exports.stdout("inherit"),
85194
+ Command_exports.stderr("inherit")
85195
+ );
85196
+ const commitExitCode = yield* Command_exports.exitCode(
85197
+ commitCommand
85198
+ ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
85199
+ if (commitExitCode !== 0) {
85200
+ return yield* Effect_exports.fail(
85201
+ new CommitFailedError({
85202
+ message: "Failed to commit. You may have no changes to commit."
85203
+ })
85204
+ );
85205
+ }
85206
+ yield* Console_exports.log("\u2713 Commit complete");
85207
+ if (followingCommitCount > 0) {
85208
+ yield* Console_exports.log(
85209
+ `
85210
+ Cherry-picking ${followingCommitCount} commit${followingCommitCount === 1 ? "" : "s"}...`
85211
+ );
85212
+ const cherryPickCommand = Command_exports.make(
85213
+ "git",
85214
+ "cherry-pick",
85215
+ `${targetSha}..${targetBranchHead}`
85216
+ ).pipe(
85217
+ Command_exports.workingDirectory(cwd),
85218
+ Command_exports.stdout("inherit"),
85219
+ Command_exports.stderr("inherit")
85220
+ );
85221
+ const cherryPickExitCode = yield* Command_exports.exitCode(
85222
+ cherryPickCommand
85223
+ ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
85224
+ if (cherryPickExitCode !== 0) {
85225
+ yield* Console_exports.log(
85226
+ "\n\u26A0\uFE0F Cherry-pick conflict detected!"
85227
+ );
85228
+ yield* Console_exports.log(
85229
+ "Resolve conflicts, then continue.\n"
85230
+ );
85231
+ yield* resolveConflictLoop(cwd);
85232
+ } else {
85233
+ yield* Console_exports.log("\u2713 Cherry-pick complete");
85234
+ }
85235
+ }
85236
+ yield* Console_exports.log(
85237
+ `
85238
+ \u2713 Edit complete! Lesson ${selectedLessonId} updated.`
85239
+ );
85240
+ const { saveToTarget } = yield* runPrompt(
85241
+ () => (0, import_prompts3.default)([
85242
+ {
85243
+ type: "confirm",
85244
+ name: "saveToTarget",
85245
+ message: `Save changes to ${branch} branch?`,
85246
+ initial: true
85247
+ }
85248
+ ])
85249
+ );
85250
+ if (!saveToTarget) {
85251
+ yield* Console_exports.log(
85252
+ `Changes kept on ${currentBranch}. Session complete.`
85253
+ );
85254
+ return;
85255
+ }
85256
+ yield* Console_exports.log(
85257
+ `Switching to ${branch} and applying changes...`
85258
+ );
85259
+ const checkoutTargetCommand = Command_exports.make(
85260
+ "git",
85261
+ "checkout",
85262
+ branch
85263
+ ).pipe(
85264
+ Command_exports.workingDirectory(cwd),
85265
+ Command_exports.stdout("inherit"),
85266
+ Command_exports.stderr("inherit")
85267
+ );
85268
+ const checkoutExitCode = yield* Command_exports.exitCode(
85269
+ checkoutTargetCommand
85270
+ ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
85271
+ if (checkoutExitCode !== 0) {
85272
+ yield* Console_exports.error(
85273
+ `Failed to checkout ${branch}. Changes remain on ${currentBranch}.`
85274
+ );
85275
+ process.exitCode = 1;
85276
+ return;
85277
+ }
85278
+ const resetToCurrentCommand = Command_exports.make(
85279
+ "git",
85280
+ "reset",
85281
+ "--hard",
85282
+ currentBranch
85283
+ ).pipe(
85284
+ Command_exports.workingDirectory(cwd),
85285
+ Command_exports.stdout("inherit"),
85286
+ Command_exports.stderr("inherit")
85287
+ );
85288
+ const resetToCurrentExitCode = yield* Command_exports.exitCode(
85289
+ resetToCurrentCommand
85290
+ ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
85291
+ if (resetToCurrentExitCode !== 0) {
85292
+ yield* Console_exports.error(
85293
+ `Failed to reset ${branch} to ${currentBranch}.`
85294
+ );
85295
+ process.exitCode = 1;
85296
+ return;
85297
+ }
85298
+ yield* Console_exports.log(
85299
+ `\u2713 ${branch} updated with your changes`
85300
+ );
85301
+ const { forcePush } = yield* runPrompt(
85302
+ () => (0, import_prompts3.default)([
85303
+ {
85304
+ type: "confirm",
85305
+ name: "forcePush",
85306
+ message: `Force push ${branch} to origin?`,
85307
+ initial: false
85308
+ }
85309
+ ])
85310
+ );
85311
+ if (!forcePush) {
85312
+ yield* Console_exports.log(
85313
+ "Local changes saved. Session complete."
85314
+ );
85315
+ return;
85316
+ }
85317
+ yield* Console_exports.log(`Force pushing ${branch} to origin...`);
85318
+ const forcePushCommand = Command_exports.make(
85319
+ "git",
85320
+ "push",
85321
+ "origin",
85322
+ branch,
85323
+ "--force-with-lease"
85324
+ ).pipe(
85325
+ Command_exports.workingDirectory(cwd),
85326
+ Command_exports.stdout("inherit"),
85327
+ Command_exports.stderr("inherit")
85328
+ );
85329
+ const forcePushExitCode = yield* Command_exports.exitCode(
85330
+ forcePushCommand
85331
+ ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
85332
+ if (forcePushExitCode !== 0) {
85333
+ yield* Console_exports.error("Failed to force push");
85334
+ process.exitCode = 1;
85335
+ return;
85336
+ }
85337
+ yield* Console_exports.log(
85338
+ `\u2713 Successfully pushed ${branch} to origin`
85339
+ );
85340
+ }).pipe(
85341
+ Effect_exports.catchTags({
85342
+ NotAGitRepoError: (error4) => {
84806
85343
  return Effect_exports.gen(function* () {
84807
85344
  yield* Console_exports.error(`Error: ${error4.message}`);
84808
85345
  process.exitCode = 1;
84809
85346
  });
84810
85347
  },
84811
- NoExerciseFoundError: (error4) => {
85348
+ CommitNotFoundError: (error4) => {
84812
85349
  return Effect_exports.gen(function* () {
84813
85350
  yield* Console_exports.error(
84814
- `Error: No exercise found for ${error4.exerciseId} (commit: ${error4.commitSha})`
85351
+ `Error: No commit found for lesson ${error4.lessonId} on branch ${error4.branch}`
85352
+ );
85353
+ process.exitCode = 1;
85354
+ });
85355
+ },
85356
+ PromptCancelledError: () => {
85357
+ return Effect_exports.gen(function* () {
85358
+ yield* Console_exports.log(
85359
+ "Operation cancelled. Branch left as-is."
84815
85360
  );
85361
+ process.exitCode = 0;
85362
+ });
85363
+ },
85364
+ CommitFailedError: (error4) => {
85365
+ return Effect_exports.gen(function* () {
85366
+ yield* Console_exports.error(`Error: ${error4.message}`);
84816
85367
  process.exitCode = 1;
84817
85368
  });
84818
85369
  }
@@ -84826,9 +85377,90 @@ var getDiffs = Command_exports2.make(
84826
85377
  )
84827
85378
  ).pipe(
84828
85379
  Command_exports2.withDescription(
84829
- "Get commit diffs from a project repo and save to exercise folders"
85380
+ "Edit a commit and cherry-pick following commits"
84830
85381
  )
84831
85382
  );
85383
+ function resolveConflictLoop(cwd) {
85384
+ return Effect_exports.gen(function* () {
85385
+ const statusCommand = Command_exports.make(
85386
+ "git",
85387
+ "status",
85388
+ "--short"
85389
+ ).pipe(
85390
+ Command_exports.workingDirectory(cwd),
85391
+ Command_exports.stdout("inherit"),
85392
+ Command_exports.stderr("inherit")
85393
+ );
85394
+ yield* Command_exports.exitCode(statusCommand);
85395
+ const { action } = yield* runPrompt(
85396
+ () => (0, import_prompts3.default)([
85397
+ {
85398
+ type: "select",
85399
+ name: "action",
85400
+ message: "Cherry-pick conflict. What do you want to do?",
85401
+ choices: [
85402
+ {
85403
+ title: "Continue (run git cherry-pick --continue)",
85404
+ value: "continue",
85405
+ description: "Continue cherry-pick after resolving conflicts"
85406
+ },
85407
+ {
85408
+ title: "Skip (already resolved in another session)",
85409
+ value: "skip",
85410
+ description: "Skip running git command, conflicts already resolved"
85411
+ },
85412
+ {
85413
+ title: "Abort (stop cherry-pick)",
85414
+ value: "abort",
85415
+ description: "Abort the cherry-pick process"
85416
+ }
85417
+ ]
85418
+ }
85419
+ ])
85420
+ );
85421
+ if (action === "abort") {
85422
+ yield* Console_exports.log(
85423
+ "Cherry-pick aborted. Branch left as-is."
85424
+ );
85425
+ const abortCommand = Command_exports.make(
85426
+ "git",
85427
+ "cherry-pick",
85428
+ "--abort"
85429
+ ).pipe(
85430
+ Command_exports.workingDirectory(cwd),
85431
+ Command_exports.stdout("inherit"),
85432
+ Command_exports.stderr("inherit")
85433
+ );
85434
+ yield* Command_exports.exitCode(abortCommand);
85435
+ return;
85436
+ }
85437
+ if (action === "skip") {
85438
+ yield* Console_exports.log("\u2713 Skipping git command");
85439
+ return;
85440
+ }
85441
+ const continueCommand = Command_exports.make(
85442
+ "git",
85443
+ "cherry-pick",
85444
+ "--continue"
85445
+ ).pipe(
85446
+ Command_exports.workingDirectory(cwd),
85447
+ Command_exports.stdout("inherit"),
85448
+ Command_exports.stderr("inherit")
85449
+ );
85450
+ const continueExitCode = yield* Command_exports.exitCode(
85451
+ continueCommand
85452
+ ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
85453
+ if (continueExitCode !== 0) {
85454
+ yield* Console_exports.log(
85455
+ "\n\u26A0\uFE0F Another conflict detected during cherry-pick!"
85456
+ );
85457
+ yield* Console_exports.log("Resolve conflicts, then continue.\n");
85458
+ yield* resolveConflictLoop(cwd);
85459
+ } else {
85460
+ yield* Console_exports.log("\u2713 Cherry-pick complete");
85461
+ }
85462
+ });
85463
+ }
84832
85464
 
84833
85465
  // src/internal/internal.ts
84834
85466
  var upgradePackages = Command_exports2.make(
@@ -84881,50 +85513,54 @@ var internal = Command_exports2.make("internal").pipe(
84881
85513
  lint,
84882
85514
  rename4,
84883
85515
  uploadToCloudinary,
84884
- getDiffs
85516
+ getDiffs,
85517
+ editCommit
84885
85518
  ]),
84886
85519
  Command_exports2.withDescription("Internal commands for AI Hero")
84887
85520
  );
84888
85521
 
84889
85522
  // src/reset.ts
84890
- var import_prompts2 = __toESM(require_prompts3());
84891
- var NotAGitRepoError2 = class extends Data_exports.TaggedError(
85523
+ var import_prompts4 = __toESM(require_prompts3());
85524
+ var NotAGitRepoError3 = class extends Data_exports.TaggedError(
84892
85525
  "NotAGitRepoError"
84893
85526
  ) {
84894
85527
  };
84895
- var CommitNotFoundError2 = class extends Data_exports.TaggedError(
84896
- "CommitNotFoundError"
84897
- ) {
84898
- };
84899
- var PromptCancelledError2 = class extends Data_exports.TaggedError(
84900
- "PromptCancelledError"
85528
+ var InvalidBranchOperationError2 = class extends Data_exports.TaggedError(
85529
+ "InvalidBranchOperationError"
84901
85530
  ) {
84902
85531
  };
84903
- var runPrompt2 = (promptFn) => {
84904
- return Effect_exports.gen(function* () {
84905
- const result = yield* Effect_exports.promise(() => promptFn());
84906
- if (!result) {
84907
- return yield* new PromptCancelledError2();
84908
- }
84909
- return result;
84910
- });
84911
- };
84912
85532
  var reset2 = Command_exports2.make(
84913
85533
  "reset",
84914
85534
  {
84915
- lessonId: Args_exports.text({ name: "lesson-id" }),
85535
+ lessonId: Args_exports.text({ name: "lesson-id" }).pipe(
85536
+ Args_exports.optional
85537
+ ),
84916
85538
  branch: Options_exports.text("branch").pipe(
84917
85539
  Options_exports.withDescription(
84918
85540
  "Branch to search for the lesson commit"
85541
+ ),
85542
+ Options_exports.withDefault(DEFAULT_PROJECT_TARGET_BRANCH)
85543
+ ),
85544
+ problem: Options_exports.boolean("problem").pipe(
85545
+ Options_exports.withAlias("p"),
85546
+ Options_exports.withDescription(
85547
+ "Reset to problem state (start the exercise)"
84919
85548
  )
84920
- )
85549
+ ),
85550
+ solution: Options_exports.boolean("solution").pipe(
85551
+ Options_exports.withAlias("s"),
85552
+ Options_exports.withDescription(
85553
+ "Reset to solution state (final code)"
85554
+ )
85555
+ ),
85556
+ demo: Options_exports.boolean("demo").pipe(Options_exports.withAlias("d"))
84921
85557
  },
84922
- ({ branch, lessonId }) => Effect_exports.gen(function* () {
85558
+ ({ branch, demo, lessonId, problem, solution }) => Effect_exports.gen(function* () {
84923
85559
  const cwd = process.cwd();
84924
85560
  const gitDirPath = path5__namespace.join(cwd, ".git");
84925
85561
  if (!NFS.existsSync(gitDirPath)) {
84926
85562
  return yield* Effect_exports.fail(
84927
- new NotAGitRepoError2({
85563
+ new NotAGitRepoError3({
84928
85564
  path: cwd,
84929
85565
  message: `Current directory is not a git repository: ${cwd}`
84930
85566
  })
@@ -84947,70 +85583,116 @@ var reset2 = Command_exports2.make(
84947
85583
  process.exitCode = 1;
84948
85584
  return;
84949
85585
  }
84950
- yield* Console_exports.log(
84951
- `Searching for lesson ${lessonId} on branch ${branch}...`
84952
- );
84953
- const gitLogCommand = Command_exports.make(
84954
- "git",
84955
- "log",
85586
+ const {
85587
+ commit: targetCommit,
85588
+ lessonId: selectedLessonId
85589
+ } = yield* selectLessonCommit({
85590
+ cwd,
84956
85591
  branch,
84957
- "--oneline"
84958
- ).pipe(Command_exports.workingDirectory(cwd));
84959
- const commitHistory = yield* Command_exports.string(gitLogCommand);
84960
- const commits = commitHistory.trim().split("\n").filter(Boolean).map((line4) => {
84961
- const [sha, ...messageParts] = line4.split(" ");
84962
- const message = messageParts.join(" ");
84963
- const lessonMatch = message.match(
84964
- /^(\d+)[.-](\d+)[.-](\d+) /
84965
- );
84966
- const extractedLessonId = lessonMatch ? `${lessonMatch[1].padStart(
84967
- 2,
84968
- "0"
84969
- )}.${lessonMatch[2].padStart(
84970
- 2,
84971
- "0"
84972
- )}.${lessonMatch[3].padStart(2, "0")}` : null;
84973
- return {
84974
- sha,
84975
- message,
84976
- lessonId: extractedLessonId
84977
- };
85592
+ lessonId,
85593
+ promptMessage: "Which lesson do you want to reset to? (type to search)",
85594
+ excludeCurrentBranch: false
84978
85595
  });
84979
- const matchingCommits = commits.filter(
84980
- (commit) => commit.lessonId === lessonId
84981
- );
84982
- if (matchingCommits.length === 0) {
84983
- return yield* new CommitNotFoundError2({
84984
- lessonId,
84985
- branch
85596
+ let commitToUse = targetCommit.sha;
85597
+ let stateDescription = "final code";
85598
+ if (problem && solution) {
85599
+ return yield* Effect_exports.fail(
85600
+ new InvalidBranchOperationError2({
85601
+ message: "Cannot use both --problem and --solution flags"
85602
+ })
85603
+ );
85604
+ }
85605
+ if (demo && (problem || solution)) {
85606
+ return yield* Effect_exports.fail(
85607
+ new InvalidBranchOperationError2({
85608
+ message: "Cannot use --demo with --problem or --solution flags"
85609
+ })
85610
+ );
85611
+ }
85612
+ if (!problem && !solution && !demo) {
85613
+ const { state } = yield* runPrompt(
85614
+ () => (0, import_prompts4.default)([
85615
+ {
85616
+ type: "select",
85617
+ name: "state",
85618
+ message: "Start the exercise or view final code?",
85619
+ choices: [
85620
+ {
85621
+ title: "Start the exercise",
85622
+ value: "problem",
85623
+ description: "Reset to problem state (commit before solution)"
85624
+ },
85625
+ {
85626
+ title: "Final code",
85627
+ value: "solution",
85628
+ description: "Reset to solution state (completed exercise)"
85629
+ }
85630
+ ]
85631
+ }
85632
+ ])
85633
+ );
85634
+ if (state === "problem") {
85635
+ commitToUse = yield* getParentCommit({
85636
+ commitSha: targetCommit.sha,
85637
+ cwd
85638
+ });
85639
+ stateDescription = "problem state";
85640
+ }
85641
+ } else if (problem) {
85642
+ commitToUse = yield* getParentCommit({
85643
+ commitSha: targetCommit.sha,
85644
+ cwd
84986
85645
  });
85646
+ stateDescription = "problem state";
85647
+ }
85648
+ const currentBranchCommand = Command_exports.make(
85649
+ "git",
85650
+ "branch",
85651
+ "--show-current"
85652
+ ).pipe(Command_exports.workingDirectory(cwd));
85653
+ const currentBranch = (yield* Command_exports.string(
85654
+ currentBranchCommand
85655
+ )).trim();
85656
+ let action;
85657
+ if (demo) {
85658
+ action = "reset-current";
85659
+ } else {
85660
+ const result = yield* runPrompt(
85661
+ () => (0, import_prompts4.default)([
85662
+ {
85663
+ type: "select",
85664
+ name: "action",
85665
+ message: "How would you like to proceed?",
85666
+ choices: [
85667
+ {
85668
+ title: `Reset current branch (${currentBranch})`,
85669
+ value: "reset-current"
85670
+ },
85671
+ {
85672
+ title: "Create new branch from commit",
85673
+ value: "create-branch"
85674
+ }
85675
+ ]
85676
+ }
85677
+ ])
85678
+ );
85679
+ action = result.action;
85680
+ }
85681
+ if (action === "reset-current") {
85682
+ if (currentBranch === branch) {
85683
+ return yield* new InvalidBranchOperationError2({
85684
+ message: `Cannot reset current branch when on target branch "${branch}"`
85685
+ });
85686
+ }
85687
+ if (currentBranch === "main") {
85688
+ return yield* new InvalidBranchOperationError2({
85689
+ message: `Cannot reset current branch when on "main" branch`
85690
+ });
85691
+ }
84987
85692
  }
84988
- const targetCommit = matchingCommits[matchingCommits.length - 1];
84989
- yield* Console_exports.log(
84990
- `Found commit: ${targetCommit.sha} ${targetCommit.message}`
84991
- );
84992
- const { action } = yield* runPrompt2(
84993
- () => (0, import_prompts2.default)([
84994
- {
84995
- type: "select",
84996
- name: "action",
84997
- message: "How would you like to proceed?",
84998
- choices: [
84999
- {
85000
- title: "Reset current branch",
85001
- value: "reset-current"
85002
- },
85003
- {
85004
- title: "Create new branch from commit",
85005
- value: "create-branch"
85006
- }
85007
- ]
85008
- }
85009
- ])
85010
- );
85011
85693
  if (action === "create-branch") {
85012
- const { branchName } = yield* runPrompt2(
85013
- () => (0, import_prompts2.default)([
85694
+ const { branchName } = yield* runPrompt(
85695
+ () => (0, import_prompts4.default)([
85014
85696
  {
85015
85697
  type: "text",
85016
85698
  name: "branchName",
@@ -85019,14 +85701,14 @@ var reset2 = Command_exports2.make(
85019
85701
  ])
85020
85702
  );
85021
85703
  yield* Console_exports.log(
85022
- `Creating branch ${branchName} from ${targetCommit.sha}...`
85704
+ `Creating branch ${branchName} from ${commitToUse} (${stateDescription})...`
85023
85705
  );
85024
85706
  const createBranchCommand = Command_exports.make(
85025
85707
  "git",
85026
85708
  "checkout",
85027
85709
  "-b",
85028
85710
  branchName,
85029
- targetCommit.sha
85711
+ commitToUse
85030
85712
  ).pipe(
85031
85713
  Command_exports.workingDirectory(cwd),
85032
85714
  Command_exports.stdout("inherit"),
@@ -85045,40 +85727,44 @@ var reset2 = Command_exports2.make(
85045
85727
  );
85046
85728
  return;
85047
85729
  }
85048
- const gitStatusCommand = Command_exports.make(
85049
- "git",
85050
- "status",
85051
- "--porcelain"
85052
- ).pipe(Command_exports.workingDirectory(cwd));
85053
- const statusOutput = yield* Command_exports.string(
85054
- gitStatusCommand
85055
- );
85056
- if (statusOutput.trim() !== "") {
85057
- yield* Console_exports.log(
85058
- "\nWarning: You have uncommitted changes:"
85059
- );
85060
- yield* Console_exports.log(statusOutput);
85061
- const { confirm } = yield* runPrompt2(
85062
- () => (0, import_prompts2.default)([
85063
- {
85064
- type: "confirm",
85065
- name: "confirm",
85066
- message: "This will lose all uncommitted work. Continue?",
85067
- initial: false
85068
- }
85069
- ])
85730
+ if (!demo) {
85731
+ const gitStatusCommand = Command_exports.make(
85732
+ "git",
85733
+ "status",
85734
+ "--porcelain"
85735
+ ).pipe(Command_exports.workingDirectory(cwd));
85736
+ const statusOutput = yield* Command_exports.string(
85737
+ gitStatusCommand
85070
85738
  );
85071
- if (!confirm) {
85072
- yield* Console_exports.log("Reset cancelled");
85073
- return;
85739
+ if (statusOutput.trim() !== "") {
85740
+ yield* Console_exports.log(
85741
+ "\nWarning: You have uncommitted changes:"
85742
+ );
85743
+ yield* Console_exports.log(statusOutput);
85744
+ const { confirm } = yield* runPrompt(
85745
+ () => (0, import_prompts4.default)([
85746
+ {
85747
+ type: "confirm",
85748
+ name: "confirm",
85749
+ message: "This will lose all uncommitted work. Continue?",
85750
+ initial: false
85751
+ }
85752
+ ])
85753
+ );
85754
+ if (!confirm) {
85755
+ yield* Console_exports.log("Reset cancelled");
85756
+ return;
85757
+ }
85074
85758
  }
85075
85759
  }
85076
- yield* Console_exports.log(`Resetting to ${targetCommit.sha}...`);
85760
+ yield* Console_exports.log(
85761
+ `Resetting to ${commitToUse} (${stateDescription})...`
85762
+ );
85077
85763
  const resetCommand = Command_exports.make(
85078
85764
  "git",
85079
85765
  "reset",
85080
85766
  "--hard",
85081
- targetCommit.sha
85767
+ commitToUse
85082
85768
  ).pipe(
85083
85769
  Command_exports.workingDirectory(cwd),
85084
85770
  Command_exports.stdout("inherit"),
@@ -85092,9 +85778,63 @@ var reset2 = Command_exports2.make(
85092
85778
  process.exitCode = 1;
85093
85779
  return;
85094
85780
  }
85095
- yield* Console_exports.log(`\u2713 Reset to lesson ${lessonId}`);
85781
+ if (demo) {
85782
+ yield* Console_exports.log(
85783
+ "Undoing commit and unstaging changes..."
85784
+ );
85785
+ const undoCommand = Command_exports.make(
85786
+ "git",
85787
+ "reset",
85788
+ "HEAD^"
85789
+ ).pipe(
85790
+ Command_exports.workingDirectory(cwd),
85791
+ Command_exports.stdout("inherit"),
85792
+ Command_exports.stderr("inherit")
85793
+ );
85794
+ const undoExitCode = yield* Command_exports.exitCode(
85795
+ undoCommand
85796
+ ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
85797
+ if (undoExitCode !== 0) {
85798
+ yield* Console_exports.error("Failed to undo commit");
85799
+ process.exitCode = 1;
85800
+ return;
85801
+ }
85802
+ const unstageCommand = Command_exports.make(
85803
+ "git",
85804
+ "restore",
85805
+ "--staged",
85806
+ "."
85807
+ ).pipe(
85808
+ Command_exports.workingDirectory(cwd),
85809
+ Command_exports.stdout("inherit"),
85810
+ Command_exports.stderr("inherit")
85811
+ );
85812
+ const unstageExitCode = yield* Command_exports.exitCode(
85813
+ unstageCommand
85814
+ ).pipe(Effect_exports.catchAll(() => Effect_exports.succeed(1)));
85815
+ if (unstageExitCode !== 0) {
85816
+ yield* Console_exports.error("Failed to unstage changes");
85817
+ process.exitCode = 1;
85818
+ return;
85819
+ }
85820
+ yield* Console_exports.log(
85821
+ `\u2713 Demo mode: Reset to lesson ${selectedLessonId} with unstaged changes`
85822
+ );
85823
+ } else {
85824
+ yield* Console_exports.log(
85825
+ `\u2713 Reset to lesson ${selectedLessonId} (${stateDescription})`
85826
+ );
85827
+ }
85096
85828
  }).pipe(
85097
85829
  Effect_exports.catchTags({
85830
+ NoParentCommitError: (error4) => {
85831
+ return Effect_exports.gen(function* () {
85832
+ yield* Console_exports.error(
85833
+ `Error: Commit ${error4.commitSha} has no parent commit. Repository may be in an invalid state.`
85834
+ );
85835
+ process.exitCode = 1;
85836
+ });
85837
+ },
85098
85838
  NotAGitRepoError: (error4) => {
85099
85839
  return Effect_exports.gen(function* () {
85100
85840
  yield* Console_exports.error(`Error: ${error4.message}`);
@@ -85114,6 +85854,12 @@ var reset2 = Command_exports2.make(
85114
85854
  yield* Console_exports.log("Operation cancelled");
85115
85855
  process.exitCode = 0;
85116
85856
  });
85857
+ },
85858
+ InvalidBranchOperationError: (error4) => {
85859
+ return Effect_exports.gen(function* () {
85860
+ yield* Console_exports.error(`Error: ${error4.message}`);
85861
+ process.exitCode = 1;
85862
+ });
85117
85863
  }
85118
85864
  }),
85119
85865
  Effect_exports.catchAll((error4) => {