ai-hero-cli 0.0.12 → 0.0.14
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.
- package/bin.cjs +606 -471
- package/package.json +1 -1
package/bin.cjs
CHANGED
|
@@ -3888,8 +3888,8 @@ var require_compiler = __commonJS({
|
|
|
3888
3888
|
valueAssignments.push(fullPath);
|
|
3889
3889
|
}
|
|
3890
3890
|
}
|
|
3891
|
-
function pathAssigned(
|
|
3892
|
-
return assignedPaths.indexOf(
|
|
3891
|
+
function pathAssigned(path10) {
|
|
3892
|
+
return assignedPaths.indexOf(path10) !== -1;
|
|
3893
3893
|
}
|
|
3894
3894
|
function reduceValueNode(node) {
|
|
3895
3895
|
if (node.type === "Array") {
|
|
@@ -3913,20 +3913,20 @@ var require_compiler = __commonJS({
|
|
|
3913
3913
|
return obj;
|
|
3914
3914
|
}
|
|
3915
3915
|
function setPath(node) {
|
|
3916
|
-
var
|
|
3917
|
-
var quotedPath =
|
|
3916
|
+
var path10 = node.value;
|
|
3917
|
+
var quotedPath = path10.map(quoteDottedString).join(".");
|
|
3918
3918
|
var line4 = node.line;
|
|
3919
3919
|
var column3 = node.column;
|
|
3920
3920
|
if (pathAssigned(quotedPath)) {
|
|
3921
|
-
genError("Cannot redefine existing key '" +
|
|
3921
|
+
genError("Cannot redefine existing key '" + path10 + "'.", line4, column3);
|
|
3922
3922
|
}
|
|
3923
3923
|
assignedPaths.push(quotedPath);
|
|
3924
|
-
context7 = deepRef(data,
|
|
3925
|
-
currentPath =
|
|
3924
|
+
context7 = deepRef(data, path10, /* @__PURE__ */ Object.create(null), line4, column3);
|
|
3925
|
+
currentPath = path10;
|
|
3926
3926
|
}
|
|
3927
3927
|
function addTableArray(node) {
|
|
3928
|
-
var
|
|
3929
|
-
var quotedPath =
|
|
3928
|
+
var path10 = node.value;
|
|
3929
|
+
var quotedPath = path10.map(quoteDottedString).join(".");
|
|
3930
3930
|
var line4 = node.line;
|
|
3931
3931
|
var column3 = node.column;
|
|
3932
3932
|
if (!pathAssigned(quotedPath)) {
|
|
@@ -3936,14 +3936,14 @@ var require_compiler = __commonJS({
|
|
|
3936
3936
|
return p3.indexOf(quotedPath) !== 0;
|
|
3937
3937
|
});
|
|
3938
3938
|
assignedPaths.push(quotedPath);
|
|
3939
|
-
context7 = deepRef(data,
|
|
3939
|
+
context7 = deepRef(data, path10, [], line4, column3);
|
|
3940
3940
|
currentPath = quotedPath;
|
|
3941
3941
|
if (context7 instanceof Array) {
|
|
3942
3942
|
var newObj = /* @__PURE__ */ Object.create(null);
|
|
3943
3943
|
context7.push(newObj);
|
|
3944
3944
|
context7 = newObj;
|
|
3945
3945
|
} else {
|
|
3946
|
-
genError("Cannot redefine existing key '" +
|
|
3946
|
+
genError("Cannot redefine existing key '" + path10 + "'.", line4, column3);
|
|
3947
3947
|
}
|
|
3948
3948
|
}
|
|
3949
3949
|
function deepRef(start5, keys6, value5, line4, column3) {
|
|
@@ -4088,17 +4088,17 @@ var require_visit = __commonJS({
|
|
|
4088
4088
|
visit.BREAK = BREAK;
|
|
4089
4089
|
visit.SKIP = SKIP;
|
|
4090
4090
|
visit.REMOVE = REMOVE;
|
|
4091
|
-
function visit_(key, node, visitor,
|
|
4092
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
4091
|
+
function visit_(key, node, visitor, path10) {
|
|
4092
|
+
const ctrl = callVisitor(key, node, visitor, path10);
|
|
4093
4093
|
if (identity3.isNode(ctrl) || identity3.isPair(ctrl)) {
|
|
4094
|
-
replaceNode(key,
|
|
4095
|
-
return visit_(key, ctrl, visitor,
|
|
4094
|
+
replaceNode(key, path10, ctrl);
|
|
4095
|
+
return visit_(key, ctrl, visitor, path10);
|
|
4096
4096
|
}
|
|
4097
4097
|
if (typeof ctrl !== "symbol") {
|
|
4098
4098
|
if (identity3.isCollection(node)) {
|
|
4099
|
-
|
|
4099
|
+
path10 = Object.freeze(path10.concat(node));
|
|
4100
4100
|
for (let i = 0; i < node.items.length; ++i) {
|
|
4101
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
4101
|
+
const ci = visit_(i, node.items[i], visitor, path10);
|
|
4102
4102
|
if (typeof ci === "number")
|
|
4103
4103
|
i = ci - 1;
|
|
4104
4104
|
else if (ci === BREAK)
|
|
@@ -4109,13 +4109,13 @@ var require_visit = __commonJS({
|
|
|
4109
4109
|
}
|
|
4110
4110
|
}
|
|
4111
4111
|
} else if (identity3.isPair(node)) {
|
|
4112
|
-
|
|
4113
|
-
const ck = visit_("key", node.key, visitor,
|
|
4112
|
+
path10 = Object.freeze(path10.concat(node));
|
|
4113
|
+
const ck = visit_("key", node.key, visitor, path10);
|
|
4114
4114
|
if (ck === BREAK)
|
|
4115
4115
|
return BREAK;
|
|
4116
4116
|
else if (ck === REMOVE)
|
|
4117
4117
|
node.key = null;
|
|
4118
|
-
const cv = visit_("value", node.value, visitor,
|
|
4118
|
+
const cv = visit_("value", node.value, visitor, path10);
|
|
4119
4119
|
if (cv === BREAK)
|
|
4120
4120
|
return BREAK;
|
|
4121
4121
|
else if (cv === REMOVE)
|
|
@@ -4136,17 +4136,17 @@ var require_visit = __commonJS({
|
|
|
4136
4136
|
visitAsync.BREAK = BREAK;
|
|
4137
4137
|
visitAsync.SKIP = SKIP;
|
|
4138
4138
|
visitAsync.REMOVE = REMOVE;
|
|
4139
|
-
async function visitAsync_(key, node, visitor,
|
|
4140
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
4139
|
+
async function visitAsync_(key, node, visitor, path10) {
|
|
4140
|
+
const ctrl = await callVisitor(key, node, visitor, path10);
|
|
4141
4141
|
if (identity3.isNode(ctrl) || identity3.isPair(ctrl)) {
|
|
4142
|
-
replaceNode(key,
|
|
4143
|
-
return visitAsync_(key, ctrl, visitor,
|
|
4142
|
+
replaceNode(key, path10, ctrl);
|
|
4143
|
+
return visitAsync_(key, ctrl, visitor, path10);
|
|
4144
4144
|
}
|
|
4145
4145
|
if (typeof ctrl !== "symbol") {
|
|
4146
4146
|
if (identity3.isCollection(node)) {
|
|
4147
|
-
|
|
4147
|
+
path10 = Object.freeze(path10.concat(node));
|
|
4148
4148
|
for (let i = 0; i < node.items.length; ++i) {
|
|
4149
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
4149
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path10);
|
|
4150
4150
|
if (typeof ci === "number")
|
|
4151
4151
|
i = ci - 1;
|
|
4152
4152
|
else if (ci === BREAK)
|
|
@@ -4157,13 +4157,13 @@ var require_visit = __commonJS({
|
|
|
4157
4157
|
}
|
|
4158
4158
|
}
|
|
4159
4159
|
} else if (identity3.isPair(node)) {
|
|
4160
|
-
|
|
4161
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
4160
|
+
path10 = Object.freeze(path10.concat(node));
|
|
4161
|
+
const ck = await visitAsync_("key", node.key, visitor, path10);
|
|
4162
4162
|
if (ck === BREAK)
|
|
4163
4163
|
return BREAK;
|
|
4164
4164
|
else if (ck === REMOVE)
|
|
4165
4165
|
node.key = null;
|
|
4166
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
4166
|
+
const cv = await visitAsync_("value", node.value, visitor, path10);
|
|
4167
4167
|
if (cv === BREAK)
|
|
4168
4168
|
return BREAK;
|
|
4169
4169
|
else if (cv === REMOVE)
|
|
@@ -4190,23 +4190,23 @@ var require_visit = __commonJS({
|
|
|
4190
4190
|
}
|
|
4191
4191
|
return visitor;
|
|
4192
4192
|
}
|
|
4193
|
-
function callVisitor(key, node, visitor,
|
|
4193
|
+
function callVisitor(key, node, visitor, path10) {
|
|
4194
4194
|
if (typeof visitor === "function")
|
|
4195
|
-
return visitor(key, node,
|
|
4195
|
+
return visitor(key, node, path10);
|
|
4196
4196
|
if (identity3.isMap(node))
|
|
4197
|
-
return visitor.Map?.(key, node,
|
|
4197
|
+
return visitor.Map?.(key, node, path10);
|
|
4198
4198
|
if (identity3.isSeq(node))
|
|
4199
|
-
return visitor.Seq?.(key, node,
|
|
4199
|
+
return visitor.Seq?.(key, node, path10);
|
|
4200
4200
|
if (identity3.isPair(node))
|
|
4201
|
-
return visitor.Pair?.(key, node,
|
|
4201
|
+
return visitor.Pair?.(key, node, path10);
|
|
4202
4202
|
if (identity3.isScalar(node))
|
|
4203
|
-
return visitor.Scalar?.(key, node,
|
|
4203
|
+
return visitor.Scalar?.(key, node, path10);
|
|
4204
4204
|
if (identity3.isAlias(node))
|
|
4205
|
-
return visitor.Alias?.(key, node,
|
|
4205
|
+
return visitor.Alias?.(key, node, path10);
|
|
4206
4206
|
return void 0;
|
|
4207
4207
|
}
|
|
4208
|
-
function replaceNode(key,
|
|
4209
|
-
const parent =
|
|
4208
|
+
function replaceNode(key, path10, node) {
|
|
4209
|
+
const parent = path10[path10.length - 1];
|
|
4210
4210
|
if (identity3.isCollection(parent)) {
|
|
4211
4211
|
parent.items[key] = node;
|
|
4212
4212
|
} else if (identity3.isPair(parent)) {
|
|
@@ -4805,10 +4805,10 @@ var require_Collection = __commonJS({
|
|
|
4805
4805
|
var createNode = require_createNode();
|
|
4806
4806
|
var identity3 = require_identity();
|
|
4807
4807
|
var Node = require_Node();
|
|
4808
|
-
function collectionFromPath(schema,
|
|
4808
|
+
function collectionFromPath(schema, path10, value5) {
|
|
4809
4809
|
let v = value5;
|
|
4810
|
-
for (let i =
|
|
4811
|
-
const k =
|
|
4810
|
+
for (let i = path10.length - 1; i >= 0; --i) {
|
|
4811
|
+
const k = path10[i];
|
|
4812
4812
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
4813
4813
|
const a = [];
|
|
4814
4814
|
a[k] = v;
|
|
@@ -4827,7 +4827,7 @@ var require_Collection = __commonJS({
|
|
|
4827
4827
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
4828
4828
|
});
|
|
4829
4829
|
}
|
|
4830
|
-
var isEmptyPath = (
|
|
4830
|
+
var isEmptyPath = (path10) => path10 == null || typeof path10 === "object" && !!path10[Symbol.iterator]().next().done;
|
|
4831
4831
|
var Collection = class extends Node.NodeBase {
|
|
4832
4832
|
constructor(type2, schema) {
|
|
4833
4833
|
super(type2);
|
|
@@ -4857,11 +4857,11 @@ var require_Collection = __commonJS({
|
|
|
4857
4857
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
4858
4858
|
* that already exists in the map.
|
|
4859
4859
|
*/
|
|
4860
|
-
addIn(
|
|
4861
|
-
if (isEmptyPath(
|
|
4860
|
+
addIn(path10, value5) {
|
|
4861
|
+
if (isEmptyPath(path10))
|
|
4862
4862
|
this.add(value5);
|
|
4863
4863
|
else {
|
|
4864
|
-
const [key, ...rest] =
|
|
4864
|
+
const [key, ...rest] = path10;
|
|
4865
4865
|
const node = this.get(key, true);
|
|
4866
4866
|
if (identity3.isCollection(node))
|
|
4867
4867
|
node.addIn(rest, value5);
|
|
@@ -4875,8 +4875,8 @@ var require_Collection = __commonJS({
|
|
|
4875
4875
|
* Removes a value from the collection.
|
|
4876
4876
|
* @returns `true` if the item was found and removed.
|
|
4877
4877
|
*/
|
|
4878
|
-
deleteIn(
|
|
4879
|
-
const [key, ...rest] =
|
|
4878
|
+
deleteIn(path10) {
|
|
4879
|
+
const [key, ...rest] = path10;
|
|
4880
4880
|
if (rest.length === 0)
|
|
4881
4881
|
return this.delete(key);
|
|
4882
4882
|
const node = this.get(key, true);
|
|
@@ -4890,8 +4890,8 @@ var require_Collection = __commonJS({
|
|
|
4890
4890
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
4891
4891
|
* `true` (collections are always returned intact).
|
|
4892
4892
|
*/
|
|
4893
|
-
getIn(
|
|
4894
|
-
const [key, ...rest] =
|
|
4893
|
+
getIn(path10, keepScalar) {
|
|
4894
|
+
const [key, ...rest] = path10;
|
|
4895
4895
|
const node = this.get(key, true);
|
|
4896
4896
|
if (rest.length === 0)
|
|
4897
4897
|
return !keepScalar && identity3.isScalar(node) ? node.value : node;
|
|
@@ -4909,8 +4909,8 @@ var require_Collection = __commonJS({
|
|
|
4909
4909
|
/**
|
|
4910
4910
|
* Checks if the collection includes a value with the key `key`.
|
|
4911
4911
|
*/
|
|
4912
|
-
hasIn(
|
|
4913
|
-
const [key, ...rest] =
|
|
4912
|
+
hasIn(path10) {
|
|
4913
|
+
const [key, ...rest] = path10;
|
|
4914
4914
|
if (rest.length === 0)
|
|
4915
4915
|
return this.has(key);
|
|
4916
4916
|
const node = this.get(key, true);
|
|
@@ -4920,8 +4920,8 @@ var require_Collection = __commonJS({
|
|
|
4920
4920
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
4921
4921
|
* boolean to add/remove the item from the set.
|
|
4922
4922
|
*/
|
|
4923
|
-
setIn(
|
|
4924
|
-
const [key, ...rest] =
|
|
4923
|
+
setIn(path10, value5) {
|
|
4924
|
+
const [key, ...rest] = path10;
|
|
4925
4925
|
if (rest.length === 0) {
|
|
4926
4926
|
this.set(key, value5);
|
|
4927
4927
|
} else {
|
|
@@ -7390,9 +7390,9 @@ var require_Document = __commonJS({
|
|
|
7390
7390
|
this.contents.add(value5);
|
|
7391
7391
|
}
|
|
7392
7392
|
/** Adds a value to the document. */
|
|
7393
|
-
addIn(
|
|
7393
|
+
addIn(path10, value5) {
|
|
7394
7394
|
if (assertCollection(this.contents))
|
|
7395
|
-
this.contents.addIn(
|
|
7395
|
+
this.contents.addIn(path10, value5);
|
|
7396
7396
|
}
|
|
7397
7397
|
/**
|
|
7398
7398
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -7467,14 +7467,14 @@ var require_Document = __commonJS({
|
|
|
7467
7467
|
* Removes a value from the document.
|
|
7468
7468
|
* @returns `true` if the item was found and removed.
|
|
7469
7469
|
*/
|
|
7470
|
-
deleteIn(
|
|
7471
|
-
if (Collection.isEmptyPath(
|
|
7470
|
+
deleteIn(path10) {
|
|
7471
|
+
if (Collection.isEmptyPath(path10)) {
|
|
7472
7472
|
if (this.contents == null)
|
|
7473
7473
|
return false;
|
|
7474
7474
|
this.contents = null;
|
|
7475
7475
|
return true;
|
|
7476
7476
|
}
|
|
7477
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
7477
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path10) : false;
|
|
7478
7478
|
}
|
|
7479
7479
|
/**
|
|
7480
7480
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -7489,10 +7489,10 @@ var require_Document = __commonJS({
|
|
|
7489
7489
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
7490
7490
|
* `true` (collections are always returned intact).
|
|
7491
7491
|
*/
|
|
7492
|
-
getIn(
|
|
7493
|
-
if (Collection.isEmptyPath(
|
|
7492
|
+
getIn(path10, keepScalar) {
|
|
7493
|
+
if (Collection.isEmptyPath(path10))
|
|
7494
7494
|
return !keepScalar && identity3.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
7495
|
-
return identity3.isCollection(this.contents) ? this.contents.getIn(
|
|
7495
|
+
return identity3.isCollection(this.contents) ? this.contents.getIn(path10, keepScalar) : void 0;
|
|
7496
7496
|
}
|
|
7497
7497
|
/**
|
|
7498
7498
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -7503,10 +7503,10 @@ var require_Document = __commonJS({
|
|
|
7503
7503
|
/**
|
|
7504
7504
|
* Checks if the document includes a value at `path`.
|
|
7505
7505
|
*/
|
|
7506
|
-
hasIn(
|
|
7507
|
-
if (Collection.isEmptyPath(
|
|
7506
|
+
hasIn(path10) {
|
|
7507
|
+
if (Collection.isEmptyPath(path10))
|
|
7508
7508
|
return this.contents !== void 0;
|
|
7509
|
-
return identity3.isCollection(this.contents) ? this.contents.hasIn(
|
|
7509
|
+
return identity3.isCollection(this.contents) ? this.contents.hasIn(path10) : false;
|
|
7510
7510
|
}
|
|
7511
7511
|
/**
|
|
7512
7512
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -7523,13 +7523,13 @@ var require_Document = __commonJS({
|
|
|
7523
7523
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
7524
7524
|
* boolean to add/remove the item from the set.
|
|
7525
7525
|
*/
|
|
7526
|
-
setIn(
|
|
7527
|
-
if (Collection.isEmptyPath(
|
|
7526
|
+
setIn(path10, value5) {
|
|
7527
|
+
if (Collection.isEmptyPath(path10)) {
|
|
7528
7528
|
this.contents = value5;
|
|
7529
7529
|
} else if (this.contents == null) {
|
|
7530
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
7530
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path10), value5);
|
|
7531
7531
|
} else if (assertCollection(this.contents)) {
|
|
7532
|
-
this.contents.setIn(
|
|
7532
|
+
this.contents.setIn(path10, value5);
|
|
7533
7533
|
}
|
|
7534
7534
|
}
|
|
7535
7535
|
/**
|
|
@@ -9461,9 +9461,9 @@ var require_cst_visit = __commonJS({
|
|
|
9461
9461
|
visit.BREAK = BREAK;
|
|
9462
9462
|
visit.SKIP = SKIP;
|
|
9463
9463
|
visit.REMOVE = REMOVE;
|
|
9464
|
-
visit.itemAtPath = (cst,
|
|
9464
|
+
visit.itemAtPath = (cst, path10) => {
|
|
9465
9465
|
let item = cst;
|
|
9466
|
-
for (const [field, index] of
|
|
9466
|
+
for (const [field, index] of path10) {
|
|
9467
9467
|
const tok = item?.[field];
|
|
9468
9468
|
if (tok && "items" in tok) {
|
|
9469
9469
|
item = tok.items[index];
|
|
@@ -9472,23 +9472,23 @@ var require_cst_visit = __commonJS({
|
|
|
9472
9472
|
}
|
|
9473
9473
|
return item;
|
|
9474
9474
|
};
|
|
9475
|
-
visit.parentCollection = (cst,
|
|
9476
|
-
const parent = visit.itemAtPath(cst,
|
|
9477
|
-
const field =
|
|
9475
|
+
visit.parentCollection = (cst, path10) => {
|
|
9476
|
+
const parent = visit.itemAtPath(cst, path10.slice(0, -1));
|
|
9477
|
+
const field = path10[path10.length - 1][0];
|
|
9478
9478
|
const coll = parent?.[field];
|
|
9479
9479
|
if (coll && "items" in coll)
|
|
9480
9480
|
return coll;
|
|
9481
9481
|
throw new Error("Parent collection not found");
|
|
9482
9482
|
};
|
|
9483
|
-
function _visit(
|
|
9484
|
-
let ctrl = visitor(item,
|
|
9483
|
+
function _visit(path10, item, visitor) {
|
|
9484
|
+
let ctrl = visitor(item, path10);
|
|
9485
9485
|
if (typeof ctrl === "symbol")
|
|
9486
9486
|
return ctrl;
|
|
9487
9487
|
for (const field of ["key", "value"]) {
|
|
9488
9488
|
const token = item[field];
|
|
9489
9489
|
if (token && "items" in token) {
|
|
9490
9490
|
for (let i = 0; i < token.items.length; ++i) {
|
|
9491
|
-
const ci = _visit(Object.freeze(
|
|
9491
|
+
const ci = _visit(Object.freeze(path10.concat([[field, i]])), token.items[i], visitor);
|
|
9492
9492
|
if (typeof ci === "number")
|
|
9493
9493
|
i = ci - 1;
|
|
9494
9494
|
else if (ci === BREAK)
|
|
@@ -9499,10 +9499,10 @@ var require_cst_visit = __commonJS({
|
|
|
9499
9499
|
}
|
|
9500
9500
|
}
|
|
9501
9501
|
if (typeof ctrl === "function" && field === "key")
|
|
9502
|
-
ctrl = ctrl(item,
|
|
9502
|
+
ctrl = ctrl(item, path10);
|
|
9503
9503
|
}
|
|
9504
9504
|
}
|
|
9505
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
9505
|
+
return typeof ctrl === "function" ? ctrl(item, path10) : ctrl;
|
|
9506
9506
|
}
|
|
9507
9507
|
exports.visit = visit;
|
|
9508
9508
|
}
|
|
@@ -11710,7 +11710,7 @@ var require_prompt = __commonJS({
|
|
|
11710
11710
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js
|
|
11711
11711
|
var require_text = __commonJS({
|
|
11712
11712
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/text.js"(exports, module) {
|
|
11713
|
-
function asyncGeneratorStep(gen4,
|
|
11713
|
+
function asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, key, arg) {
|
|
11714
11714
|
try {
|
|
11715
11715
|
var info3 = gen4[key](arg);
|
|
11716
11716
|
var value5 = info3.value;
|
|
@@ -11719,7 +11719,7 @@ var require_text = __commonJS({
|
|
|
11719
11719
|
return;
|
|
11720
11720
|
}
|
|
11721
11721
|
if (info3.done) {
|
|
11722
|
-
|
|
11722
|
+
resolve6(value5);
|
|
11723
11723
|
} else {
|
|
11724
11724
|
Promise.resolve(value5).then(_next, _throw);
|
|
11725
11725
|
}
|
|
@@ -11727,13 +11727,13 @@ var require_text = __commonJS({
|
|
|
11727
11727
|
function _asyncToGenerator(fn2) {
|
|
11728
11728
|
return function() {
|
|
11729
11729
|
var self = this, args2 = arguments;
|
|
11730
|
-
return new Promise(function(
|
|
11730
|
+
return new Promise(function(resolve6, reject) {
|
|
11731
11731
|
var gen4 = fn2.apply(self, args2);
|
|
11732
11732
|
function _next(value5) {
|
|
11733
|
-
asyncGeneratorStep(gen4,
|
|
11733
|
+
asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, "next", value5);
|
|
11734
11734
|
}
|
|
11735
11735
|
function _throw(err) {
|
|
11736
|
-
asyncGeneratorStep(gen4,
|
|
11736
|
+
asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, "throw", err);
|
|
11737
11737
|
}
|
|
11738
11738
|
_next(void 0);
|
|
11739
11739
|
});
|
|
@@ -12436,7 +12436,7 @@ var require_dateparts = __commonJS({
|
|
|
12436
12436
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js
|
|
12437
12437
|
var require_date = __commonJS({
|
|
12438
12438
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/date.js"(exports, module) {
|
|
12439
|
-
function asyncGeneratorStep(gen4,
|
|
12439
|
+
function asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, key, arg) {
|
|
12440
12440
|
try {
|
|
12441
12441
|
var info3 = gen4[key](arg);
|
|
12442
12442
|
var value5 = info3.value;
|
|
@@ -12445,7 +12445,7 @@ var require_date = __commonJS({
|
|
|
12445
12445
|
return;
|
|
12446
12446
|
}
|
|
12447
12447
|
if (info3.done) {
|
|
12448
|
-
|
|
12448
|
+
resolve6(value5);
|
|
12449
12449
|
} else {
|
|
12450
12450
|
Promise.resolve(value5).then(_next, _throw);
|
|
12451
12451
|
}
|
|
@@ -12453,13 +12453,13 @@ var require_date = __commonJS({
|
|
|
12453
12453
|
function _asyncToGenerator(fn2) {
|
|
12454
12454
|
return function() {
|
|
12455
12455
|
var self = this, args2 = arguments;
|
|
12456
|
-
return new Promise(function(
|
|
12456
|
+
return new Promise(function(resolve6, reject) {
|
|
12457
12457
|
var gen4 = fn2.apply(self, args2);
|
|
12458
12458
|
function _next(value5) {
|
|
12459
|
-
asyncGeneratorStep(gen4,
|
|
12459
|
+
asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, "next", value5);
|
|
12460
12460
|
}
|
|
12461
12461
|
function _throw(err) {
|
|
12462
|
-
asyncGeneratorStep(gen4,
|
|
12462
|
+
asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, "throw", err);
|
|
12463
12463
|
}
|
|
12464
12464
|
_next(void 0);
|
|
12465
12465
|
});
|
|
@@ -12661,7 +12661,7 @@ ${i ? ` ` : figures2.pointerSmall} ${color3.red().italic(l)}`, ``);
|
|
|
12661
12661
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js
|
|
12662
12662
|
var require_number = __commonJS({
|
|
12663
12663
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/number.js"(exports, module) {
|
|
12664
|
-
function asyncGeneratorStep(gen4,
|
|
12664
|
+
function asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, key, arg) {
|
|
12665
12665
|
try {
|
|
12666
12666
|
var info3 = gen4[key](arg);
|
|
12667
12667
|
var value5 = info3.value;
|
|
@@ -12670,7 +12670,7 @@ var require_number = __commonJS({
|
|
|
12670
12670
|
return;
|
|
12671
12671
|
}
|
|
12672
12672
|
if (info3.done) {
|
|
12673
|
-
|
|
12673
|
+
resolve6(value5);
|
|
12674
12674
|
} else {
|
|
12675
12675
|
Promise.resolve(value5).then(_next, _throw);
|
|
12676
12676
|
}
|
|
@@ -12678,13 +12678,13 @@ var require_number = __commonJS({
|
|
|
12678
12678
|
function _asyncToGenerator(fn2) {
|
|
12679
12679
|
return function() {
|
|
12680
12680
|
var self = this, args2 = arguments;
|
|
12681
|
-
return new Promise(function(
|
|
12681
|
+
return new Promise(function(resolve6, reject) {
|
|
12682
12682
|
var gen4 = fn2.apply(self, args2);
|
|
12683
12683
|
function _next(value5) {
|
|
12684
|
-
asyncGeneratorStep(gen4,
|
|
12684
|
+
asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, "next", value5);
|
|
12685
12685
|
}
|
|
12686
12686
|
function _throw(err) {
|
|
12687
|
-
asyncGeneratorStep(gen4,
|
|
12687
|
+
asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, "throw", err);
|
|
12688
12688
|
}
|
|
12689
12689
|
_next(void 0);
|
|
12690
12690
|
});
|
|
@@ -13105,7 +13105,7 @@ Instructions:
|
|
|
13105
13105
|
// node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js
|
|
13106
13106
|
var require_autocomplete = __commonJS({
|
|
13107
13107
|
"node_modules/.pnpm/prompts@2.4.2/node_modules/prompts/dist/elements/autocomplete.js"(exports, module) {
|
|
13108
|
-
function asyncGeneratorStep(gen4,
|
|
13108
|
+
function asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, key, arg) {
|
|
13109
13109
|
try {
|
|
13110
13110
|
var info3 = gen4[key](arg);
|
|
13111
13111
|
var value5 = info3.value;
|
|
@@ -13114,7 +13114,7 @@ var require_autocomplete = __commonJS({
|
|
|
13114
13114
|
return;
|
|
13115
13115
|
}
|
|
13116
13116
|
if (info3.done) {
|
|
13117
|
-
|
|
13117
|
+
resolve6(value5);
|
|
13118
13118
|
} else {
|
|
13119
13119
|
Promise.resolve(value5).then(_next, _throw);
|
|
13120
13120
|
}
|
|
@@ -13122,13 +13122,13 @@ var require_autocomplete = __commonJS({
|
|
|
13122
13122
|
function _asyncToGenerator(fn2) {
|
|
13123
13123
|
return function() {
|
|
13124
13124
|
var self = this, args2 = arguments;
|
|
13125
|
-
return new Promise(function(
|
|
13125
|
+
return new Promise(function(resolve6, reject) {
|
|
13126
13126
|
var gen4 = fn2.apply(self, args2);
|
|
13127
13127
|
function _next(value5) {
|
|
13128
|
-
asyncGeneratorStep(gen4,
|
|
13128
|
+
asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, "next", value5);
|
|
13129
13129
|
}
|
|
13130
13130
|
function _throw(err) {
|
|
13131
|
-
asyncGeneratorStep(gen4,
|
|
13131
|
+
asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, "throw", err);
|
|
13132
13132
|
}
|
|
13133
13133
|
_next(void 0);
|
|
13134
13134
|
});
|
|
@@ -13754,7 +13754,7 @@ var require_dist2 = __commonJS({
|
|
|
13754
13754
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
13755
13755
|
return arr2;
|
|
13756
13756
|
}
|
|
13757
|
-
function asyncGeneratorStep(gen4,
|
|
13757
|
+
function asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, key, arg) {
|
|
13758
13758
|
try {
|
|
13759
13759
|
var info3 = gen4[key](arg);
|
|
13760
13760
|
var value5 = info3.value;
|
|
@@ -13763,7 +13763,7 @@ var require_dist2 = __commonJS({
|
|
|
13763
13763
|
return;
|
|
13764
13764
|
}
|
|
13765
13765
|
if (info3.done) {
|
|
13766
|
-
|
|
13766
|
+
resolve6(value5);
|
|
13767
13767
|
} else {
|
|
13768
13768
|
Promise.resolve(value5).then(_next, _throw);
|
|
13769
13769
|
}
|
|
@@ -13771,13 +13771,13 @@ var require_dist2 = __commonJS({
|
|
|
13771
13771
|
function _asyncToGenerator(fn2) {
|
|
13772
13772
|
return function() {
|
|
13773
13773
|
var self = this, args2 = arguments;
|
|
13774
|
-
return new Promise(function(
|
|
13774
|
+
return new Promise(function(resolve6, reject) {
|
|
13775
13775
|
var gen4 = fn2.apply(self, args2);
|
|
13776
13776
|
function _next(value5) {
|
|
13777
|
-
asyncGeneratorStep(gen4,
|
|
13777
|
+
asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, "next", value5);
|
|
13778
13778
|
}
|
|
13779
13779
|
function _throw(err) {
|
|
13780
|
-
asyncGeneratorStep(gen4,
|
|
13780
|
+
asyncGeneratorStep(gen4, resolve6, reject, _next, _throw, "throw", err);
|
|
13781
13781
|
}
|
|
13782
13782
|
_next(void 0);
|
|
13783
13783
|
});
|
|
@@ -16925,14 +16925,14 @@ var require_util3 = __commonJS({
|
|
|
16925
16925
|
}
|
|
16926
16926
|
const port2 = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
|
|
16927
16927
|
let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port2}`;
|
|
16928
|
-
let
|
|
16928
|
+
let path10 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
|
|
16929
16929
|
if (origin[origin.length - 1] === "/") {
|
|
16930
16930
|
origin = origin.slice(0, origin.length - 1);
|
|
16931
16931
|
}
|
|
16932
|
-
if (
|
|
16933
|
-
|
|
16932
|
+
if (path10 && path10[0] !== "/") {
|
|
16933
|
+
path10 = `/${path10}`;
|
|
16934
16934
|
}
|
|
16935
|
-
return new URL(`${origin}${
|
|
16935
|
+
return new URL(`${origin}${path10}`);
|
|
16936
16936
|
}
|
|
16937
16937
|
if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
|
|
16938
16938
|
throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -17478,9 +17478,9 @@ var require_diagnostics = __commonJS({
|
|
|
17478
17478
|
"undici:client:sendHeaders",
|
|
17479
17479
|
(evt) => {
|
|
17480
17480
|
const {
|
|
17481
|
-
request: { method, path:
|
|
17481
|
+
request: { method, path: path10, origin }
|
|
17482
17482
|
} = evt;
|
|
17483
|
-
debugLog("sending request to %s %s%s", method, origin,
|
|
17483
|
+
debugLog("sending request to %s %s%s", method, origin, path10);
|
|
17484
17484
|
}
|
|
17485
17485
|
);
|
|
17486
17486
|
}
|
|
@@ -17494,14 +17494,14 @@ var require_diagnostics = __commonJS({
|
|
|
17494
17494
|
"undici:request:headers",
|
|
17495
17495
|
(evt) => {
|
|
17496
17496
|
const {
|
|
17497
|
-
request: { method, path:
|
|
17497
|
+
request: { method, path: path10, origin },
|
|
17498
17498
|
response: { statusCode }
|
|
17499
17499
|
} = evt;
|
|
17500
17500
|
debugLog(
|
|
17501
17501
|
"received response to %s %s%s - HTTP %d",
|
|
17502
17502
|
method,
|
|
17503
17503
|
origin,
|
|
17504
|
-
|
|
17504
|
+
path10,
|
|
17505
17505
|
statusCode
|
|
17506
17506
|
);
|
|
17507
17507
|
}
|
|
@@ -17510,23 +17510,23 @@ var require_diagnostics = __commonJS({
|
|
|
17510
17510
|
"undici:request:trailers",
|
|
17511
17511
|
(evt) => {
|
|
17512
17512
|
const {
|
|
17513
|
-
request: { method, path:
|
|
17513
|
+
request: { method, path: path10, origin }
|
|
17514
17514
|
} = evt;
|
|
17515
|
-
debugLog("trailers received from %s %s%s", method, origin,
|
|
17515
|
+
debugLog("trailers received from %s %s%s", method, origin, path10);
|
|
17516
17516
|
}
|
|
17517
17517
|
);
|
|
17518
17518
|
diagnosticsChannel.subscribe(
|
|
17519
17519
|
"undici:request:error",
|
|
17520
17520
|
(evt) => {
|
|
17521
17521
|
const {
|
|
17522
|
-
request: { method, path:
|
|
17522
|
+
request: { method, path: path10, origin },
|
|
17523
17523
|
error: error4
|
|
17524
17524
|
} = evt;
|
|
17525
17525
|
debugLog(
|
|
17526
17526
|
"request to %s %s%s errored - %s",
|
|
17527
17527
|
method,
|
|
17528
17528
|
origin,
|
|
17529
|
-
|
|
17529
|
+
path10,
|
|
17530
17530
|
error4.message
|
|
17531
17531
|
);
|
|
17532
17532
|
}
|
|
@@ -17620,7 +17620,7 @@ var require_request = __commonJS({
|
|
|
17620
17620
|
var kHandler = Symbol("handler");
|
|
17621
17621
|
var Request = class {
|
|
17622
17622
|
constructor(origin, {
|
|
17623
|
-
path:
|
|
17623
|
+
path: path10,
|
|
17624
17624
|
method,
|
|
17625
17625
|
body,
|
|
17626
17626
|
headers,
|
|
@@ -17636,11 +17636,11 @@ var require_request = __commonJS({
|
|
|
17636
17636
|
throwOnError,
|
|
17637
17637
|
maxRedirections
|
|
17638
17638
|
}, handler) {
|
|
17639
|
-
if (typeof
|
|
17639
|
+
if (typeof path10 !== "string") {
|
|
17640
17640
|
throw new InvalidArgumentError("path must be a string");
|
|
17641
|
-
} else if (
|
|
17641
|
+
} else if (path10[0] !== "/" && !(path10.startsWith("http://") || path10.startsWith("https://")) && method !== "CONNECT") {
|
|
17642
17642
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
17643
|
-
} else if (invalidPathRegex.test(
|
|
17643
|
+
} else if (invalidPathRegex.test(path10)) {
|
|
17644
17644
|
throw new InvalidArgumentError("invalid request path");
|
|
17645
17645
|
}
|
|
17646
17646
|
if (typeof method !== "string") {
|
|
@@ -17708,7 +17708,7 @@ var require_request = __commonJS({
|
|
|
17708
17708
|
this.completed = false;
|
|
17709
17709
|
this.aborted = false;
|
|
17710
17710
|
this.upgrade = upgrade || null;
|
|
17711
|
-
this.path = query ? serializePathWithQuery(
|
|
17711
|
+
this.path = query ? serializePathWithQuery(path10, query) : path10;
|
|
17712
17712
|
this.origin = origin;
|
|
17713
17713
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
17714
17714
|
this.blocking = blocking ?? this.method !== "HEAD";
|
|
@@ -18153,9 +18153,9 @@ var require_dispatcher_base = __commonJS({
|
|
|
18153
18153
|
}
|
|
18154
18154
|
close(callback) {
|
|
18155
18155
|
if (callback === void 0) {
|
|
18156
|
-
return new Promise((
|
|
18156
|
+
return new Promise((resolve6, reject) => {
|
|
18157
18157
|
this.close((err, data) => {
|
|
18158
|
-
return err ? reject(err) :
|
|
18158
|
+
return err ? reject(err) : resolve6(data);
|
|
18159
18159
|
});
|
|
18160
18160
|
});
|
|
18161
18161
|
}
|
|
@@ -18193,12 +18193,12 @@ var require_dispatcher_base = __commonJS({
|
|
|
18193
18193
|
err = null;
|
|
18194
18194
|
}
|
|
18195
18195
|
if (callback === void 0) {
|
|
18196
|
-
return new Promise((
|
|
18196
|
+
return new Promise((resolve6, reject) => {
|
|
18197
18197
|
this.destroy(err, (err2, data) => {
|
|
18198
18198
|
return err2 ? (
|
|
18199
18199
|
/* istanbul ignore next: should never error */
|
|
18200
18200
|
reject(err2)
|
|
18201
|
-
) :
|
|
18201
|
+
) : resolve6(data);
|
|
18202
18202
|
});
|
|
18203
18203
|
});
|
|
18204
18204
|
}
|
|
@@ -21399,8 +21399,8 @@ var require_promise = __commonJS({
|
|
|
21399
21399
|
function createDeferredPromise() {
|
|
21400
21400
|
let res;
|
|
21401
21401
|
let rej;
|
|
21402
|
-
const promise3 = new Promise((
|
|
21403
|
-
res =
|
|
21402
|
+
const promise3 = new Promise((resolve6, reject) => {
|
|
21403
|
+
res = resolve6;
|
|
21404
21404
|
rej = reject;
|
|
21405
21405
|
});
|
|
21406
21406
|
return { promise: promise3, resolve: res, reject: rej };
|
|
@@ -22451,7 +22451,7 @@ var require_client_h1 = __commonJS({
|
|
|
22451
22451
|
return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
|
|
22452
22452
|
}
|
|
22453
22453
|
function writeH1(client, request2) {
|
|
22454
|
-
const { method, path:
|
|
22454
|
+
const { method, path: path10, host, upgrade, blocking, reset: reset2 } = request2;
|
|
22455
22455
|
let { body, headers, contentLength } = request2;
|
|
22456
22456
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
22457
22457
|
if (util.isFormDataLike(body)) {
|
|
@@ -22517,7 +22517,7 @@ var require_client_h1 = __commonJS({
|
|
|
22517
22517
|
if (blocking) {
|
|
22518
22518
|
socket[kBlocking] = true;
|
|
22519
22519
|
}
|
|
22520
|
-
let header = `${method} ${
|
|
22520
|
+
let header = `${method} ${path10} HTTP/1.1\r
|
|
22521
22521
|
`;
|
|
22522
22522
|
if (typeof host === "string") {
|
|
22523
22523
|
header += `host: ${host}\r
|
|
@@ -22704,12 +22704,12 @@ upgrade: ${upgrade}\r
|
|
|
22704
22704
|
cb();
|
|
22705
22705
|
}
|
|
22706
22706
|
}
|
|
22707
|
-
const waitForDrain = () => new Promise((
|
|
22707
|
+
const waitForDrain = () => new Promise((resolve6, reject) => {
|
|
22708
22708
|
assert3(callback === null);
|
|
22709
22709
|
if (socket[kError]) {
|
|
22710
22710
|
reject(socket[kError]);
|
|
22711
22711
|
} else {
|
|
22712
|
-
callback =
|
|
22712
|
+
callback = resolve6;
|
|
22713
22713
|
}
|
|
22714
22714
|
});
|
|
22715
22715
|
socket.on("close", onDrain).on("drain", onDrain);
|
|
@@ -23073,7 +23073,7 @@ var require_client_h2 = __commonJS({
|
|
|
23073
23073
|
function writeH2(client, request2) {
|
|
23074
23074
|
const requestTimeout = request2.bodyTimeout ?? client[kBodyTimeout];
|
|
23075
23075
|
const session = client[kHTTP2Session];
|
|
23076
|
-
const { method, path:
|
|
23076
|
+
const { method, path: path10, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2;
|
|
23077
23077
|
let { body } = request2;
|
|
23078
23078
|
if (upgrade) {
|
|
23079
23079
|
util.errorRequest(client, request2, new Error("Upgrade not supported for H2"));
|
|
@@ -23144,7 +23144,7 @@ var require_client_h2 = __commonJS({
|
|
|
23144
23144
|
stream4.setTimeout(requestTimeout);
|
|
23145
23145
|
return true;
|
|
23146
23146
|
}
|
|
23147
|
-
headers[HTTP2_HEADER_PATH] =
|
|
23147
|
+
headers[HTTP2_HEADER_PATH] = path10;
|
|
23148
23148
|
headers[HTTP2_HEADER_SCHEME] = "https";
|
|
23149
23149
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
23150
23150
|
if (body && typeof body.read === "function") {
|
|
@@ -23415,12 +23415,12 @@ var require_client_h2 = __commonJS({
|
|
|
23415
23415
|
cb();
|
|
23416
23416
|
}
|
|
23417
23417
|
}
|
|
23418
|
-
const waitForDrain = () => new Promise((
|
|
23418
|
+
const waitForDrain = () => new Promise((resolve6, reject) => {
|
|
23419
23419
|
assert3(callback === null);
|
|
23420
23420
|
if (socket[kError]) {
|
|
23421
23421
|
reject(socket[kError]);
|
|
23422
23422
|
} else {
|
|
23423
|
-
callback =
|
|
23423
|
+
callback = resolve6;
|
|
23424
23424
|
}
|
|
23425
23425
|
});
|
|
23426
23426
|
h2stream.on("close", onDrain).on("drain", onDrain);
|
|
@@ -23705,16 +23705,16 @@ var require_client = __commonJS({
|
|
|
23705
23705
|
return this[kNeedDrain] < 2;
|
|
23706
23706
|
}
|
|
23707
23707
|
async [kClose]() {
|
|
23708
|
-
return new Promise((
|
|
23708
|
+
return new Promise((resolve6) => {
|
|
23709
23709
|
if (this[kSize]) {
|
|
23710
|
-
this[kClosedResolve] =
|
|
23710
|
+
this[kClosedResolve] = resolve6;
|
|
23711
23711
|
} else {
|
|
23712
|
-
|
|
23712
|
+
resolve6(null);
|
|
23713
23713
|
}
|
|
23714
23714
|
});
|
|
23715
23715
|
}
|
|
23716
23716
|
async [kDestroy](err) {
|
|
23717
|
-
return new Promise((
|
|
23717
|
+
return new Promise((resolve6) => {
|
|
23718
23718
|
const requests = this[kQueue].splice(this[kPendingIdx]);
|
|
23719
23719
|
for (let i = 0; i < requests.length; i++) {
|
|
23720
23720
|
const request2 = requests[i];
|
|
@@ -23725,7 +23725,7 @@ var require_client = __commonJS({
|
|
|
23725
23725
|
this[kClosedResolve]();
|
|
23726
23726
|
this[kClosedResolve] = null;
|
|
23727
23727
|
}
|
|
23728
|
-
|
|
23728
|
+
resolve6(null);
|
|
23729
23729
|
};
|
|
23730
23730
|
if (this[kHTTPContext]) {
|
|
23731
23731
|
this[kHTTPContext].destroy(err, callback);
|
|
@@ -23775,7 +23775,7 @@ var require_client = __commonJS({
|
|
|
23775
23775
|
});
|
|
23776
23776
|
}
|
|
23777
23777
|
try {
|
|
23778
|
-
const socket = await new Promise((
|
|
23778
|
+
const socket = await new Promise((resolve6, reject) => {
|
|
23779
23779
|
client[kConnector]({
|
|
23780
23780
|
host,
|
|
23781
23781
|
hostname,
|
|
@@ -23787,7 +23787,7 @@ var require_client = __commonJS({
|
|
|
23787
23787
|
if (err) {
|
|
23788
23788
|
reject(err);
|
|
23789
23789
|
} else {
|
|
23790
|
-
|
|
23790
|
+
resolve6(socket2);
|
|
23791
23791
|
}
|
|
23792
23792
|
});
|
|
23793
23793
|
});
|
|
@@ -24111,8 +24111,8 @@ var require_pool_base = __commonJS({
|
|
|
24111
24111
|
if (this[kQueue].isEmpty()) {
|
|
24112
24112
|
await Promise.all(this[kClients].map((c) => c.close()));
|
|
24113
24113
|
} else {
|
|
24114
|
-
await new Promise((
|
|
24115
|
-
this[kClosedResolve] =
|
|
24114
|
+
await new Promise((resolve6) => {
|
|
24115
|
+
this[kClosedResolve] = resolve6;
|
|
24116
24116
|
});
|
|
24117
24117
|
}
|
|
24118
24118
|
}
|
|
@@ -24583,10 +24583,10 @@ var require_proxy_agent = __commonJS({
|
|
|
24583
24583
|
};
|
|
24584
24584
|
const {
|
|
24585
24585
|
origin,
|
|
24586
|
-
path:
|
|
24586
|
+
path: path10 = "/",
|
|
24587
24587
|
headers = {}
|
|
24588
24588
|
} = opts;
|
|
24589
|
-
opts.path = origin +
|
|
24589
|
+
opts.path = origin + path10;
|
|
24590
24590
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
24591
24591
|
const { host } = new URL2(origin);
|
|
24592
24592
|
headers.host = host;
|
|
@@ -25530,7 +25530,7 @@ var require_readable = __commonJS({
|
|
|
25530
25530
|
if (this._readableState.closeEmitted) {
|
|
25531
25531
|
return null;
|
|
25532
25532
|
}
|
|
25533
|
-
return await new Promise((
|
|
25533
|
+
return await new Promise((resolve6, reject) => {
|
|
25534
25534
|
if (this[kContentLength] && this[kContentLength] > limit || this[kBytesRead] > limit) {
|
|
25535
25535
|
this.destroy(new AbortError());
|
|
25536
25536
|
}
|
|
@@ -25544,11 +25544,11 @@ var require_readable = __commonJS({
|
|
|
25544
25544
|
if (signal.aborted) {
|
|
25545
25545
|
reject(signal.reason ?? new AbortError());
|
|
25546
25546
|
} else {
|
|
25547
|
-
|
|
25547
|
+
resolve6(null);
|
|
25548
25548
|
}
|
|
25549
25549
|
});
|
|
25550
25550
|
} else {
|
|
25551
|
-
this.on("close",
|
|
25551
|
+
this.on("close", resolve6);
|
|
25552
25552
|
}
|
|
25553
25553
|
this.on("error", noop).on("data", () => {
|
|
25554
25554
|
if (this[kBytesRead] > limit) {
|
|
@@ -25576,7 +25576,7 @@ var require_readable = __commonJS({
|
|
|
25576
25576
|
}
|
|
25577
25577
|
function consume(stream4, type2) {
|
|
25578
25578
|
assert3(!stream4[kConsume]);
|
|
25579
|
-
return new Promise((
|
|
25579
|
+
return new Promise((resolve6, reject) => {
|
|
25580
25580
|
if (isUnusable(stream4)) {
|
|
25581
25581
|
const rState = stream4._readableState;
|
|
25582
25582
|
if (rState.destroyed && rState.closeEmitted === false) {
|
|
@@ -25591,7 +25591,7 @@ var require_readable = __commonJS({
|
|
|
25591
25591
|
stream4[kConsume] = {
|
|
25592
25592
|
type: type2,
|
|
25593
25593
|
stream: stream4,
|
|
25594
|
-
resolve:
|
|
25594
|
+
resolve: resolve6,
|
|
25595
25595
|
reject,
|
|
25596
25596
|
length: 0,
|
|
25597
25597
|
body: []
|
|
@@ -25665,18 +25665,18 @@ var require_readable = __commonJS({
|
|
|
25665
25665
|
return buffer3;
|
|
25666
25666
|
}
|
|
25667
25667
|
function consumeEnd(consume2, encoding) {
|
|
25668
|
-
const { type: type2, body, resolve:
|
|
25668
|
+
const { type: type2, body, resolve: resolve6, stream: stream4, length: length4 } = consume2;
|
|
25669
25669
|
try {
|
|
25670
25670
|
if (type2 === "text") {
|
|
25671
|
-
|
|
25671
|
+
resolve6(chunksDecode(body, length4, encoding));
|
|
25672
25672
|
} else if (type2 === "json") {
|
|
25673
|
-
|
|
25673
|
+
resolve6(JSON.parse(chunksDecode(body, length4, encoding)));
|
|
25674
25674
|
} else if (type2 === "arrayBuffer") {
|
|
25675
|
-
|
|
25675
|
+
resolve6(chunksConcat(body, length4).buffer);
|
|
25676
25676
|
} else if (type2 === "blob") {
|
|
25677
|
-
|
|
25677
|
+
resolve6(new Blob(body, { type: stream4[kContentType] }));
|
|
25678
25678
|
} else if (type2 === "bytes") {
|
|
25679
|
-
|
|
25679
|
+
resolve6(chunksConcat(body, length4));
|
|
25680
25680
|
}
|
|
25681
25681
|
consumeFinish(consume2);
|
|
25682
25682
|
} catch (err) {
|
|
@@ -25856,9 +25856,9 @@ var require_api_request = __commonJS({
|
|
|
25856
25856
|
};
|
|
25857
25857
|
function request2(opts, callback) {
|
|
25858
25858
|
if (callback === void 0) {
|
|
25859
|
-
return new Promise((
|
|
25859
|
+
return new Promise((resolve6, reject) => {
|
|
25860
25860
|
request2.call(this, opts, (err, data) => {
|
|
25861
|
-
return err ? reject(err) :
|
|
25861
|
+
return err ? reject(err) : resolve6(data);
|
|
25862
25862
|
});
|
|
25863
25863
|
});
|
|
25864
25864
|
}
|
|
@@ -26068,9 +26068,9 @@ var require_api_stream = __commonJS({
|
|
|
26068
26068
|
};
|
|
26069
26069
|
function stream4(opts, factory, callback) {
|
|
26070
26070
|
if (callback === void 0) {
|
|
26071
|
-
return new Promise((
|
|
26071
|
+
return new Promise((resolve6, reject) => {
|
|
26072
26072
|
stream4.call(this, opts, factory, (err, data) => {
|
|
26073
|
-
return err ? reject(err) :
|
|
26073
|
+
return err ? reject(err) : resolve6(data);
|
|
26074
26074
|
});
|
|
26075
26075
|
});
|
|
26076
26076
|
}
|
|
@@ -26355,9 +26355,9 @@ var require_api_upgrade = __commonJS({
|
|
|
26355
26355
|
};
|
|
26356
26356
|
function upgrade(opts, callback) {
|
|
26357
26357
|
if (callback === void 0) {
|
|
26358
|
-
return new Promise((
|
|
26358
|
+
return new Promise((resolve6, reject) => {
|
|
26359
26359
|
upgrade.call(this, opts, (err, data) => {
|
|
26360
|
-
return err ? reject(err) :
|
|
26360
|
+
return err ? reject(err) : resolve6(data);
|
|
26361
26361
|
});
|
|
26362
26362
|
});
|
|
26363
26363
|
}
|
|
@@ -26449,9 +26449,9 @@ var require_api_connect = __commonJS({
|
|
|
26449
26449
|
};
|
|
26450
26450
|
function connect(opts, callback) {
|
|
26451
26451
|
if (callback === void 0) {
|
|
26452
|
-
return new Promise((
|
|
26452
|
+
return new Promise((resolve6, reject) => {
|
|
26453
26453
|
connect.call(this, opts, (err, data) => {
|
|
26454
|
-
return err ? reject(err) :
|
|
26454
|
+
return err ? reject(err) : resolve6(data);
|
|
26455
26455
|
});
|
|
26456
26456
|
});
|
|
26457
26457
|
}
|
|
@@ -26640,20 +26640,20 @@ var require_mock_utils = __commonJS({
|
|
|
26640
26640
|
}
|
|
26641
26641
|
return normalizedQp;
|
|
26642
26642
|
}
|
|
26643
|
-
function safeUrl(
|
|
26644
|
-
if (typeof
|
|
26645
|
-
return
|
|
26643
|
+
function safeUrl(path10) {
|
|
26644
|
+
if (typeof path10 !== "string") {
|
|
26645
|
+
return path10;
|
|
26646
26646
|
}
|
|
26647
|
-
const pathSegments =
|
|
26647
|
+
const pathSegments = path10.split("?", 3);
|
|
26648
26648
|
if (pathSegments.length !== 2) {
|
|
26649
|
-
return
|
|
26649
|
+
return path10;
|
|
26650
26650
|
}
|
|
26651
26651
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
26652
26652
|
qp.sort();
|
|
26653
26653
|
return [...pathSegments, qp.toString()].join("?");
|
|
26654
26654
|
}
|
|
26655
|
-
function matchKey(mockDispatch2, { path:
|
|
26656
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
26655
|
+
function matchKey(mockDispatch2, { path: path10, method, body, headers }) {
|
|
26656
|
+
const pathMatch = matchValue(mockDispatch2.path, path10);
|
|
26657
26657
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
26658
26658
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
26659
26659
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -26678,8 +26678,8 @@ var require_mock_utils = __commonJS({
|
|
|
26678
26678
|
const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
|
|
26679
26679
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
26680
26680
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
26681
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
26682
|
-
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(
|
|
26681
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path10, ignoreTrailingSlash }) => {
|
|
26682
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path10)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path10), resolvedPath);
|
|
26683
26683
|
});
|
|
26684
26684
|
if (matchedMockDispatches.length === 0) {
|
|
26685
26685
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
@@ -26717,19 +26717,19 @@ var require_mock_utils = __commonJS({
|
|
|
26717
26717
|
mockDispatches.splice(index, 1);
|
|
26718
26718
|
}
|
|
26719
26719
|
}
|
|
26720
|
-
function removeTrailingSlash(
|
|
26721
|
-
while (
|
|
26722
|
-
|
|
26720
|
+
function removeTrailingSlash(path10) {
|
|
26721
|
+
while (path10.endsWith("/")) {
|
|
26722
|
+
path10 = path10.slice(0, -1);
|
|
26723
26723
|
}
|
|
26724
|
-
if (
|
|
26725
|
-
|
|
26724
|
+
if (path10.length === 0) {
|
|
26725
|
+
path10 = "/";
|
|
26726
26726
|
}
|
|
26727
|
-
return
|
|
26727
|
+
return path10;
|
|
26728
26728
|
}
|
|
26729
26729
|
function buildKey(opts) {
|
|
26730
|
-
const { path:
|
|
26730
|
+
const { path: path10, method, body, headers, query } = opts;
|
|
26731
26731
|
return {
|
|
26732
|
-
path:
|
|
26732
|
+
path: path10,
|
|
26733
26733
|
method,
|
|
26734
26734
|
body,
|
|
26735
26735
|
headers,
|
|
@@ -27381,10 +27381,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
27381
27381
|
}
|
|
27382
27382
|
format(pendingInterceptors) {
|
|
27383
27383
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
27384
|
-
({ method, path:
|
|
27384
|
+
({ method, path: path10, data: { statusCode }, persist, times: times2, timesInvoked, origin }) => ({
|
|
27385
27385
|
Method: method,
|
|
27386
27386
|
Origin: origin,
|
|
27387
|
-
Path:
|
|
27387
|
+
Path: path10,
|
|
27388
27388
|
"Status code": statusCode,
|
|
27389
27389
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
27390
27390
|
Invocations: timesInvoked,
|
|
@@ -27463,9 +27463,9 @@ var require_mock_agent = __commonJS({
|
|
|
27463
27463
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
27464
27464
|
const dispatchOpts = { ...opts };
|
|
27465
27465
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
27466
|
-
const [
|
|
27466
|
+
const [path10, searchParams] = dispatchOpts.path.split("?");
|
|
27467
27467
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
27468
|
-
dispatchOpts.path = `${
|
|
27468
|
+
dispatchOpts.path = `${path10}?${normalizedSearchParams}`;
|
|
27469
27469
|
}
|
|
27470
27470
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
27471
27471
|
}
|
|
@@ -27583,7 +27583,7 @@ ${pendingInterceptorsFormatter.format(pending3)}`.trim()
|
|
|
27583
27583
|
var require_snapshot_recorder = __commonJS({
|
|
27584
27584
|
"node_modules/.pnpm/undici@7.13.0/node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
|
|
27585
27585
|
var { writeFile: writeFile3, readFile: readFile3, mkdir: mkdir2 } = __require("fs/promises");
|
|
27586
|
-
var { dirname: dirname2, resolve:
|
|
27586
|
+
var { dirname: dirname2, resolve: resolve6 } = __require("path");
|
|
27587
27587
|
var { InvalidArgumentError, UndiciError } = require_errors2();
|
|
27588
27588
|
function formatRequestKey(opts, cachedSets, matchOptions2 = {}) {
|
|
27589
27589
|
const url2 = new URL(opts.path, opts.origin);
|
|
@@ -27803,12 +27803,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
27803
27803
|
* Loads snapshots from file
|
|
27804
27804
|
*/
|
|
27805
27805
|
async loadSnapshots(filePath) {
|
|
27806
|
-
const
|
|
27807
|
-
if (!
|
|
27806
|
+
const path10 = filePath || this.snapshotPath;
|
|
27807
|
+
if (!path10) {
|
|
27808
27808
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
27809
27809
|
}
|
|
27810
27810
|
try {
|
|
27811
|
-
const data = await readFile3(
|
|
27811
|
+
const data = await readFile3(resolve6(path10), "utf8");
|
|
27812
27812
|
const parsed = JSON.parse(data);
|
|
27813
27813
|
if (Array.isArray(parsed)) {
|
|
27814
27814
|
this.snapshots.clear();
|
|
@@ -27824,7 +27824,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
27824
27824
|
this.snapshots.clear();
|
|
27825
27825
|
this.loaded = true;
|
|
27826
27826
|
} else {
|
|
27827
|
-
throw new UndiciError(`Failed to load snapshots from ${
|
|
27827
|
+
throw new UndiciError(`Failed to load snapshots from ${path10}`, { cause: error4 });
|
|
27828
27828
|
}
|
|
27829
27829
|
}
|
|
27830
27830
|
}
|
|
@@ -27832,11 +27832,11 @@ var require_snapshot_recorder = __commonJS({
|
|
|
27832
27832
|
* Saves snapshots to file
|
|
27833
27833
|
*/
|
|
27834
27834
|
async saveSnapshots(filePath) {
|
|
27835
|
-
const
|
|
27836
|
-
if (!
|
|
27835
|
+
const path10 = filePath || this.snapshotPath;
|
|
27836
|
+
if (!path10) {
|
|
27837
27837
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
27838
27838
|
}
|
|
27839
|
-
const resolvedPath =
|
|
27839
|
+
const resolvedPath = resolve6(path10);
|
|
27840
27840
|
await mkdir2(dirname2(resolvedPath), { recursive: true });
|
|
27841
27841
|
const data = Array.from(this.snapshots.entries()).map(([hash2, snapshot]) => ({
|
|
27842
27842
|
hash: hash2,
|
|
@@ -28108,7 +28108,7 @@ var require_snapshot_agent = __commonJS({
|
|
|
28108
28108
|
* Replays a recorded response
|
|
28109
28109
|
*/
|
|
28110
28110
|
_replaySnapshot(snapshot, handler) {
|
|
28111
|
-
return new Promise((
|
|
28111
|
+
return new Promise((resolve6) => {
|
|
28112
28112
|
setImmediate(() => {
|
|
28113
28113
|
try {
|
|
28114
28114
|
const { response } = snapshot;
|
|
@@ -28129,7 +28129,7 @@ var require_snapshot_agent = __commonJS({
|
|
|
28129
28129
|
const body = Buffer.from(response.body, "base64");
|
|
28130
28130
|
handler.onResponseData(controller, body);
|
|
28131
28131
|
handler.onResponseEnd(controller, response.trailers);
|
|
28132
|
-
|
|
28132
|
+
resolve6();
|
|
28133
28133
|
} catch (error4) {
|
|
28134
28134
|
handler.onError?.(error4);
|
|
28135
28135
|
}
|
|
@@ -28413,15 +28413,15 @@ var require_redirect_handler = __commonJS({
|
|
|
28413
28413
|
return;
|
|
28414
28414
|
}
|
|
28415
28415
|
const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
28416
|
-
const
|
|
28417
|
-
const redirectUrlString = `${origin}${
|
|
28416
|
+
const path10 = search ? `${pathname}${search}` : pathname;
|
|
28417
|
+
const redirectUrlString = `${origin}${path10}`;
|
|
28418
28418
|
for (const historyUrl of this.history) {
|
|
28419
28419
|
if (historyUrl.toString() === redirectUrlString) {
|
|
28420
28420
|
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.`);
|
|
28421
28421
|
}
|
|
28422
28422
|
}
|
|
28423
28423
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
28424
|
-
this.opts.path =
|
|
28424
|
+
this.opts.path = path10;
|
|
28425
28425
|
this.opts.origin = origin;
|
|
28426
28426
|
this.opts.query = null;
|
|
28427
28427
|
}
|
|
@@ -33145,7 +33145,7 @@ var require_fetch = __commonJS({
|
|
|
33145
33145
|
function dispatch({ body }) {
|
|
33146
33146
|
const url2 = requestCurrentURL(request2);
|
|
33147
33147
|
const agent = fetchParams.controller.dispatcher;
|
|
33148
|
-
return new Promise((
|
|
33148
|
+
return new Promise((resolve6, reject) => agent.dispatch(
|
|
33149
33149
|
{
|
|
33150
33150
|
path: url2.pathname + url2.search,
|
|
33151
33151
|
origin: url2.origin,
|
|
@@ -33223,7 +33223,7 @@ var require_fetch = __commonJS({
|
|
|
33223
33223
|
}
|
|
33224
33224
|
}
|
|
33225
33225
|
const onError4 = this.onError.bind(this);
|
|
33226
|
-
|
|
33226
|
+
resolve6({
|
|
33227
33227
|
status: status2,
|
|
33228
33228
|
statusText,
|
|
33229
33229
|
headersList,
|
|
@@ -33266,7 +33266,7 @@ var require_fetch = __commonJS({
|
|
|
33266
33266
|
for (let i = 0; i < rawHeaders.length; i += 2) {
|
|
33267
33267
|
headersList.append(bufferToLowerCasedHeaderName(rawHeaders[i]), rawHeaders[i + 1].toString("latin1"), true);
|
|
33268
33268
|
}
|
|
33269
|
-
|
|
33269
|
+
resolve6({
|
|
33270
33270
|
status: status2,
|
|
33271
33271
|
statusText: STATUS_CODES[status2],
|
|
33272
33272
|
headersList,
|
|
@@ -34045,9 +34045,9 @@ var require_util6 = __commonJS({
|
|
|
34045
34045
|
}
|
|
34046
34046
|
}
|
|
34047
34047
|
}
|
|
34048
|
-
function validateCookiePath(
|
|
34049
|
-
for (let i = 0; i <
|
|
34050
|
-
const code2 =
|
|
34048
|
+
function validateCookiePath(path10) {
|
|
34049
|
+
for (let i = 0; i < path10.length; ++i) {
|
|
34050
|
+
const code2 = path10.charCodeAt(i);
|
|
34051
34051
|
if (code2 < 32 || // exclude CTLs (0-31)
|
|
34052
34052
|
code2 === 127 || // DEL
|
|
34053
34053
|
code2 === 59) {
|
|
@@ -36490,8 +36490,8 @@ var require_util8 = __commonJS({
|
|
|
36490
36490
|
return true;
|
|
36491
36491
|
}
|
|
36492
36492
|
function delay3(ms) {
|
|
36493
|
-
return new Promise((
|
|
36494
|
-
setTimeout(
|
|
36493
|
+
return new Promise((resolve6) => {
|
|
36494
|
+
setTimeout(resolve6, ms);
|
|
36495
36495
|
});
|
|
36496
36496
|
}
|
|
36497
36497
|
module.exports = {
|
|
@@ -37104,11 +37104,11 @@ var require_undici = __commonJS({
|
|
|
37104
37104
|
if (typeof opts.path !== "string") {
|
|
37105
37105
|
throw new InvalidArgumentError("invalid opts.path");
|
|
37106
37106
|
}
|
|
37107
|
-
let
|
|
37107
|
+
let path10 = opts.path;
|
|
37108
37108
|
if (!opts.path.startsWith("/")) {
|
|
37109
|
-
|
|
37109
|
+
path10 = `/${path10}`;
|
|
37110
37110
|
}
|
|
37111
|
-
url2 = new URL(util.parseOrigin(url2).origin +
|
|
37111
|
+
url2 = new URL(util.parseOrigin(url2).origin + path10);
|
|
37112
37112
|
} else {
|
|
37113
37113
|
if (!opts) {
|
|
37114
37114
|
opts = typeof url2 === "object" ? url2 : {};
|
|
@@ -44160,67 +44160,67 @@ var Or = (self, that) => {
|
|
|
44160
44160
|
});
|
|
44161
44161
|
return error4;
|
|
44162
44162
|
};
|
|
44163
|
-
var InvalidData = (
|
|
44163
|
+
var InvalidData = (path10, message, options3 = {
|
|
44164
44164
|
pathDelim: "."
|
|
44165
44165
|
}) => {
|
|
44166
44166
|
const error4 = Object.create(proto2);
|
|
44167
44167
|
error4._op = OP_INVALID_DATA;
|
|
44168
|
-
error4.path =
|
|
44168
|
+
error4.path = path10;
|
|
44169
44169
|
error4.message = message;
|
|
44170
44170
|
Object.defineProperty(error4, "toString", {
|
|
44171
44171
|
enumerable: false,
|
|
44172
44172
|
value() {
|
|
44173
|
-
const
|
|
44174
|
-
return `(Invalid data at ${
|
|
44173
|
+
const path11 = pipe(this.path, join(options3.pathDelim));
|
|
44174
|
+
return `(Invalid data at ${path11}: "${this.message}")`;
|
|
44175
44175
|
}
|
|
44176
44176
|
});
|
|
44177
44177
|
return error4;
|
|
44178
44178
|
};
|
|
44179
|
-
var MissingData = (
|
|
44179
|
+
var MissingData = (path10, message, options3 = {
|
|
44180
44180
|
pathDelim: "."
|
|
44181
44181
|
}) => {
|
|
44182
44182
|
const error4 = Object.create(proto2);
|
|
44183
44183
|
error4._op = OP_MISSING_DATA;
|
|
44184
|
-
error4.path =
|
|
44184
|
+
error4.path = path10;
|
|
44185
44185
|
error4.message = message;
|
|
44186
44186
|
Object.defineProperty(error4, "toString", {
|
|
44187
44187
|
enumerable: false,
|
|
44188
44188
|
value() {
|
|
44189
|
-
const
|
|
44190
|
-
return `(Missing data at ${
|
|
44189
|
+
const path11 = pipe(this.path, join(options3.pathDelim));
|
|
44190
|
+
return `(Missing data at ${path11}: "${this.message}")`;
|
|
44191
44191
|
}
|
|
44192
44192
|
});
|
|
44193
44193
|
return error4;
|
|
44194
44194
|
};
|
|
44195
|
-
var SourceUnavailable = (
|
|
44195
|
+
var SourceUnavailable = (path10, message, cause3, options3 = {
|
|
44196
44196
|
pathDelim: "."
|
|
44197
44197
|
}) => {
|
|
44198
44198
|
const error4 = Object.create(proto2);
|
|
44199
44199
|
error4._op = OP_SOURCE_UNAVAILABLE;
|
|
44200
|
-
error4.path =
|
|
44200
|
+
error4.path = path10;
|
|
44201
44201
|
error4.message = message;
|
|
44202
44202
|
error4.cause = cause3;
|
|
44203
44203
|
Object.defineProperty(error4, "toString", {
|
|
44204
44204
|
enumerable: false,
|
|
44205
44205
|
value() {
|
|
44206
|
-
const
|
|
44207
|
-
return `(Source unavailable at ${
|
|
44206
|
+
const path11 = pipe(this.path, join(options3.pathDelim));
|
|
44207
|
+
return `(Source unavailable at ${path11}: "${this.message}")`;
|
|
44208
44208
|
}
|
|
44209
44209
|
});
|
|
44210
44210
|
return error4;
|
|
44211
44211
|
};
|
|
44212
|
-
var Unsupported = (
|
|
44212
|
+
var Unsupported = (path10, message, options3 = {
|
|
44213
44213
|
pathDelim: "."
|
|
44214
44214
|
}) => {
|
|
44215
44215
|
const error4 = Object.create(proto2);
|
|
44216
44216
|
error4._op = OP_UNSUPPORTED;
|
|
44217
|
-
error4.path =
|
|
44217
|
+
error4.path = path10;
|
|
44218
44218
|
error4.message = message;
|
|
44219
44219
|
Object.defineProperty(error4, "toString", {
|
|
44220
44220
|
enumerable: false,
|
|
44221
44221
|
value() {
|
|
44222
|
-
const
|
|
44223
|
-
return `(Unsupported operation at ${
|
|
44222
|
+
const path11 = pipe(this.path, join(options3.pathDelim));
|
|
44223
|
+
return `(Unsupported operation at ${path11}: "${this.message}")`;
|
|
44224
44224
|
}
|
|
44225
44225
|
});
|
|
44226
44226
|
return error4;
|
|
@@ -44336,9 +44336,9 @@ var isMissingDataOnly = (self) => reduceWithContext2(self, void 0, IsMissingData
|
|
|
44336
44336
|
var empty19 = {
|
|
44337
44337
|
_tag: "Empty"
|
|
44338
44338
|
};
|
|
44339
|
-
var patch5 = /* @__PURE__ */ dual(2, (
|
|
44339
|
+
var patch5 = /* @__PURE__ */ dual(2, (path10, patch9) => {
|
|
44340
44340
|
let input = of3(patch9);
|
|
44341
|
-
let output =
|
|
44341
|
+
let output = path10;
|
|
44342
44342
|
while (isCons(input)) {
|
|
44343
44343
|
const patch10 = input.head;
|
|
44344
44344
|
switch (patch10._tag) {
|
|
@@ -44405,7 +44405,7 @@ var make21 = (options3) => ({
|
|
|
44405
44405
|
var makeFlat = (options3) => ({
|
|
44406
44406
|
[FlatConfigProviderTypeId]: FlatConfigProviderTypeId,
|
|
44407
44407
|
patch: options3.patch,
|
|
44408
|
-
load: (
|
|
44408
|
+
load: (path10, config2, split3 = true) => options3.load(path10, config2, split3),
|
|
44409
44409
|
enumerateChildren: options3.enumerateChildren
|
|
44410
44410
|
});
|
|
44411
44411
|
var fromFlat = (flat) => make21({
|
|
@@ -44423,29 +44423,29 @@ var fromEnv = (options3) => {
|
|
|
44423
44423
|
pathDelim: "_",
|
|
44424
44424
|
seqDelim: ","
|
|
44425
44425
|
}, options3);
|
|
44426
|
-
const makePathString = (
|
|
44426
|
+
const makePathString = (path10) => pipe(path10, join(pathDelim));
|
|
44427
44427
|
const unmakePathString = (pathString) => pathString.split(pathDelim);
|
|
44428
44428
|
const getEnv = () => typeof process !== "undefined" && "env" in process && typeof process.env === "object" ? process.env : {};
|
|
44429
|
-
const load = (
|
|
44430
|
-
const pathString = makePathString(
|
|
44429
|
+
const load = (path10, primitive2, split3 = true) => {
|
|
44430
|
+
const pathString = makePathString(path10);
|
|
44431
44431
|
const current = getEnv();
|
|
44432
44432
|
const valueOpt = pathString in current ? some2(current[pathString]) : none2();
|
|
44433
|
-
return pipe(valueOpt, mapError(() => MissingData(
|
|
44433
|
+
return pipe(valueOpt, mapError(() => MissingData(path10, `Expected ${pathString} to exist in the process context`)), flatMap7((value5) => parsePrimitive(value5, path10, primitive2, seqDelim, split3)));
|
|
44434
44434
|
};
|
|
44435
|
-
const enumerateChildren = (
|
|
44435
|
+
const enumerateChildren = (path10) => sync(() => {
|
|
44436
44436
|
const current = getEnv();
|
|
44437
44437
|
const keys6 = Object.keys(current);
|
|
44438
44438
|
const keyPaths = keys6.map((value5) => unmakePathString(value5.toUpperCase()));
|
|
44439
44439
|
const filteredKeyPaths = keyPaths.filter((keyPath) => {
|
|
44440
|
-
for (let i = 0; i <
|
|
44441
|
-
const pathComponent = pipe(
|
|
44440
|
+
for (let i = 0; i < path10.length; i++) {
|
|
44441
|
+
const pathComponent = pipe(path10, unsafeGet(i));
|
|
44442
44442
|
const currentElement = keyPath[i];
|
|
44443
44443
|
if (currentElement === void 0 || pathComponent !== currentElement) {
|
|
44444
44444
|
return false;
|
|
44445
44445
|
}
|
|
44446
44446
|
}
|
|
44447
44447
|
return true;
|
|
44448
|
-
}).flatMap((keyPath) => keyPath.slice(
|
|
44448
|
+
}).flatMap((keyPath) => keyPath.slice(path10.length, path10.length + 1));
|
|
44449
44449
|
return fromIterable6(filteredKeyPaths);
|
|
44450
44450
|
});
|
|
44451
44451
|
return fromFlat(makeFlat({
|
|
@@ -44461,17 +44461,17 @@ var extend2 = (leftDef, rightDef, left3, right3) => {
|
|
|
44461
44461
|
const rightExtension = concat(right3, rightPad);
|
|
44462
44462
|
return [leftExtension, rightExtension];
|
|
44463
44463
|
};
|
|
44464
|
-
var appendConfigPath = (
|
|
44464
|
+
var appendConfigPath = (path10, config2) => {
|
|
44465
44465
|
let op = config2;
|
|
44466
44466
|
if (op._tag === "Nested") {
|
|
44467
|
-
const out =
|
|
44467
|
+
const out = path10.slice();
|
|
44468
44468
|
while (op._tag === "Nested") {
|
|
44469
44469
|
out.push(op.name);
|
|
44470
44470
|
op = op.config;
|
|
44471
44471
|
}
|
|
44472
44472
|
return out;
|
|
44473
44473
|
}
|
|
44474
|
-
return
|
|
44474
|
+
return path10;
|
|
44475
44475
|
};
|
|
44476
44476
|
var fromFlatLoop = (flat, prefix, config2, split3) => {
|
|
44477
44477
|
const op = config2;
|
|
@@ -44547,8 +44547,8 @@ var fromFlatLoop = (flat, prefix, config2, split3) => {
|
|
|
44547
44547
|
return fail2(right3.left);
|
|
44548
44548
|
}
|
|
44549
44549
|
if (isRight2(left3) && isRight2(right3)) {
|
|
44550
|
-
const
|
|
44551
|
-
const fail19 = fromFlatLoopFail(prefix,
|
|
44550
|
+
const path10 = pipe(prefix, join("."));
|
|
44551
|
+
const fail19 = fromFlatLoopFail(prefix, path10);
|
|
44552
44552
|
const [lefts, rights] = extend2(fail19, fail19, pipe(left3.right, map3(right2)), pipe(right3.right, map3(right2)));
|
|
44553
44553
|
return pipe(lefts, zip(rights), forEachSequential(([left4, right4]) => pipe(zip2(left4, right4), map10(([left5, right5]) => op.zip(left5, right5)))));
|
|
44554
44554
|
}
|
|
@@ -44557,19 +44557,19 @@ var fromFlatLoop = (flat, prefix, config2, split3) => {
|
|
|
44557
44557
|
}
|
|
44558
44558
|
}
|
|
44559
44559
|
};
|
|
44560
|
-
var fromFlatLoopFail = (prefix,
|
|
44560
|
+
var fromFlatLoopFail = (prefix, path10) => (index) => left2(MissingData(prefix, `The element at index ${index} in a sequence at path "${path10}" was missing`));
|
|
44561
44561
|
var splitPathString = (text11, delim) => {
|
|
44562
44562
|
const split3 = text11.split(new RegExp(`\\s*${escape(delim)}\\s*`));
|
|
44563
44563
|
return split3;
|
|
44564
44564
|
};
|
|
44565
|
-
var parsePrimitive = (text11,
|
|
44565
|
+
var parsePrimitive = (text11, path10, primitive2, delimiter, split3) => {
|
|
44566
44566
|
if (!split3) {
|
|
44567
44567
|
return pipe(primitive2.parse(text11), mapBoth2({
|
|
44568
|
-
onFailure: prefixed(
|
|
44568
|
+
onFailure: prefixed(path10),
|
|
44569
44569
|
onSuccess: of
|
|
44570
44570
|
}));
|
|
44571
44571
|
}
|
|
44572
|
-
return pipe(splitPathString(text11, delimiter), forEachSequential((char4) => primitive2.parse(char4.trim())), mapError(prefixed(
|
|
44572
|
+
return pipe(splitPathString(text11, delimiter), forEachSequential((char4) => primitive2.parse(char4.trim())), mapError(prefixed(path10)));
|
|
44573
44573
|
};
|
|
44574
44574
|
var transpose = (array8) => {
|
|
44575
44575
|
return Object.keys(array8[0]).map((column3) => array8.map((row) => row[column3]));
|
|
@@ -46337,17 +46337,17 @@ var parallelErrors = (self) => matchCauseEffect(self, {
|
|
|
46337
46337
|
onSuccess: succeed
|
|
46338
46338
|
});
|
|
46339
46339
|
var patchFiberRefs = (patch9) => updateFiberRefs((fiberId3, fiberRefs3) => pipe(patch9, patch6(fiberId3, fiberRefs3)));
|
|
46340
|
-
var promise = (evaluate2) => evaluate2.length >= 1 ? async_((
|
|
46340
|
+
var promise = (evaluate2) => evaluate2.length >= 1 ? async_((resolve6, signal) => {
|
|
46341
46341
|
try {
|
|
46342
|
-
evaluate2(signal).then((a) =>
|
|
46342
|
+
evaluate2(signal).then((a) => resolve6(exitSucceed(a)), (e) => resolve6(exitDie(e)));
|
|
46343
46343
|
} catch (e) {
|
|
46344
|
-
|
|
46344
|
+
resolve6(exitDie(e));
|
|
46345
46345
|
}
|
|
46346
|
-
}) : async_((
|
|
46346
|
+
}) : async_((resolve6) => {
|
|
46347
46347
|
try {
|
|
46348
|
-
evaluate2().then((a) =>
|
|
46348
|
+
evaluate2().then((a) => resolve6(exitSucceed(a)), (e) => resolve6(exitDie(e)));
|
|
46349
46349
|
} catch (e) {
|
|
46350
|
-
|
|
46350
|
+
resolve6(exitDie(e));
|
|
46351
46351
|
}
|
|
46352
46352
|
});
|
|
46353
46353
|
var provideService = /* @__PURE__ */ dual(3, (self, tag4, service2) => contextWithEffect((env3) => provideContext(self, add4(env3, tag4, service2))));
|
|
@@ -46473,19 +46473,19 @@ var tryPromise = (arg) => {
|
|
|
46473
46473
|
}
|
|
46474
46474
|
const fail19 = (e) => catcher ? failSync(() => catcher(e)) : fail2(new UnknownException(e, "An unknown error occurred in Effect.tryPromise"));
|
|
46475
46475
|
if (evaluate2.length >= 1) {
|
|
46476
|
-
return async_((
|
|
46476
|
+
return async_((resolve6, signal) => {
|
|
46477
46477
|
try {
|
|
46478
|
-
evaluate2(signal).then((a) =>
|
|
46478
|
+
evaluate2(signal).then((a) => resolve6(exitSucceed(a)), (e) => resolve6(fail19(e)));
|
|
46479
46479
|
} catch (e) {
|
|
46480
|
-
|
|
46480
|
+
resolve6(fail19(e));
|
|
46481
46481
|
}
|
|
46482
46482
|
});
|
|
46483
46483
|
}
|
|
46484
|
-
return async_((
|
|
46484
|
+
return async_((resolve6) => {
|
|
46485
46485
|
try {
|
|
46486
|
-
evaluate2().then((a) =>
|
|
46486
|
+
evaluate2().then((a) => resolve6(exitSucceed(a)), (e) => resolve6(fail19(e)));
|
|
46487
46487
|
} catch (e) {
|
|
46488
|
-
|
|
46488
|
+
resolve6(fail19(e));
|
|
46489
46489
|
}
|
|
46490
46490
|
});
|
|
46491
46491
|
};
|
|
@@ -50611,14 +50611,14 @@ var unsafeRunPromise = /* @__PURE__ */ makeDual((runtime5, effect3, options3) =>
|
|
|
50611
50611
|
}
|
|
50612
50612
|
}
|
|
50613
50613
|
}));
|
|
50614
|
-
var unsafeRunPromiseExit = /* @__PURE__ */ makeDual((runtime5, effect3, options3) => new Promise((
|
|
50614
|
+
var unsafeRunPromiseExit = /* @__PURE__ */ makeDual((runtime5, effect3, options3) => new Promise((resolve6) => {
|
|
50615
50615
|
const op = fastPath(effect3);
|
|
50616
50616
|
if (op) {
|
|
50617
|
-
|
|
50617
|
+
resolve6(op);
|
|
50618
50618
|
}
|
|
50619
50619
|
const fiber = unsafeFork3(runtime5)(effect3);
|
|
50620
50620
|
fiber.addObserver((exit4) => {
|
|
50621
|
-
|
|
50621
|
+
resolve6(exit4);
|
|
50622
50622
|
});
|
|
50623
50623
|
if (options3?.signal !== void 0) {
|
|
50624
50624
|
if (options3.signal.aborted) {
|
|
@@ -55577,14 +55577,14 @@ var formatPropertyKey = (name) => typeof name === "string" ? JSON.stringify(name
|
|
|
55577
55577
|
var isNonEmpty5 = (x) => Array.isArray(x);
|
|
55578
55578
|
var isSingle = (x) => !Array.isArray(x);
|
|
55579
55579
|
var formatPathKey = (key) => `[${formatPropertyKey(key)}]`;
|
|
55580
|
-
var formatPath = (
|
|
55580
|
+
var formatPath = (path10) => isNonEmpty5(path10) ? path10.map(formatPathKey).join("") : formatPathKey(path10);
|
|
55581
55581
|
|
|
55582
55582
|
// node_modules/.pnpm/effect@3.17.7/node_modules/effect/dist/esm/internal/schema/errors.js
|
|
55583
|
-
var getErrorMessage = (reason, details,
|
|
55583
|
+
var getErrorMessage = (reason, details, path10, ast) => {
|
|
55584
55584
|
let out = reason;
|
|
55585
|
-
if (
|
|
55585
|
+
if (path10 && isNonEmptyReadonlyArray(path10)) {
|
|
55586
55586
|
out += `
|
|
55587
|
-
at path: ${formatPath(
|
|
55587
|
+
at path: ${formatPath(path10)}`;
|
|
55588
55588
|
}
|
|
55589
55589
|
if (details !== void 0) {
|
|
55590
55590
|
out += `
|
|
@@ -55596,7 +55596,7 @@ schema (${ast._tag}): ${ast}`;
|
|
|
55596
55596
|
}
|
|
55597
55597
|
return out;
|
|
55598
55598
|
};
|
|
55599
|
-
var getSchemaExtendErrorMessage = (x, y,
|
|
55599
|
+
var getSchemaExtendErrorMessage = (x, y, path10) => getErrorMessage("Unsupported schema or overlapping types", `cannot extend ${x} with ${y}`, path10);
|
|
55600
55600
|
var getASTUnsupportedKeySchemaErrorMessage = (ast) => getErrorMessage("Unsupported key schema", void 0, void 0, ast);
|
|
55601
55601
|
var getASTUnsupportedLiteralErrorMessage = (literal2) => getErrorMessage("Unsupported literal", `literal value: ${formatUnknown(literal2)}`);
|
|
55602
55602
|
var getASTDuplicateIndexSignatureErrorMessage = (type2) => getErrorMessage("Duplicate index signature", `${type2} index signature`);
|
|
@@ -56785,8 +56785,8 @@ var Pointer = class {
|
|
|
56785
56785
|
* @since 3.10.0
|
|
56786
56786
|
*/
|
|
56787
56787
|
_tag = "Pointer";
|
|
56788
|
-
constructor(
|
|
56789
|
-
this.path =
|
|
56788
|
+
constructor(path10, actual, issue) {
|
|
56789
|
+
this.path = path10;
|
|
56790
56790
|
this.actual = actual;
|
|
56791
56791
|
this.issue = issue;
|
|
56792
56792
|
}
|
|
@@ -58276,7 +58276,7 @@ function makeTypeLiteralClass(fields, records, ast = getDefaultTypeLiteralAST(fi
|
|
|
58276
58276
|
function Struct(fields, ...records) {
|
|
58277
58277
|
return makeTypeLiteralClass(fields, records);
|
|
58278
58278
|
}
|
|
58279
|
-
var intersectTypeLiterals = (x, y,
|
|
58279
|
+
var intersectTypeLiterals = (x, y, path10) => {
|
|
58280
58280
|
if (isTypeLiteral(x) && isTypeLiteral(y)) {
|
|
58281
58281
|
const propertySignatures = [...x.propertySignatures];
|
|
58282
58282
|
for (const ps of y.propertySignatures) {
|
|
@@ -58289,18 +58289,18 @@ var intersectTypeLiterals = (x, y, path9) => {
|
|
|
58289
58289
|
isOptional,
|
|
58290
58290
|
type: type2
|
|
58291
58291
|
} = propertySignatures[i];
|
|
58292
|
-
propertySignatures[i] = new PropertySignature(name, extendAST(type2, ps.type,
|
|
58292
|
+
propertySignatures[i] = new PropertySignature(name, extendAST(type2, ps.type, path10.concat(name)), isOptional, true);
|
|
58293
58293
|
}
|
|
58294
58294
|
}
|
|
58295
58295
|
return new TypeLiteral(propertySignatures, x.indexSignatures.concat(y.indexSignatures));
|
|
58296
58296
|
}
|
|
58297
|
-
throw new Error(getSchemaExtendErrorMessage(x, y,
|
|
58297
|
+
throw new Error(getSchemaExtendErrorMessage(x, y, path10));
|
|
58298
58298
|
};
|
|
58299
58299
|
var preserveRefinementAnnotations = /* @__PURE__ */ omitAnnotations([IdentifierAnnotationId]);
|
|
58300
58300
|
var addRefinementToMembers = (refinement, asts) => asts.map((ast) => new Refinement(ast, refinement.filter, preserveRefinementAnnotations(refinement)));
|
|
58301
|
-
var extendAST = (x, y,
|
|
58301
|
+
var extendAST = (x, y, path10) => Union.make(intersectUnionMembers([x], [y], path10));
|
|
58302
58302
|
var getTypes = (ast) => isUnion(ast) ? ast.types : [ast];
|
|
58303
|
-
var intersectUnionMembers = (xs, ys,
|
|
58303
|
+
var intersectUnionMembers = (xs, ys, path10) => flatMap2(xs, (x) => flatMap2(ys, (y) => {
|
|
58304
58304
|
switch (y._tag) {
|
|
58305
58305
|
case "Literal": {
|
|
58306
58306
|
if (isString(y.literal) && isStringKeyword(x) || isNumber(y.literal) && isNumberKeyword(x) || isBoolean(y.literal) && isBooleanKeyword(x)) {
|
|
@@ -58313,7 +58313,7 @@ var intersectUnionMembers = (xs, ys, path9) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
58313
58313
|
if (isStringKeyword(x) || isLiteral(x) && isString(x.literal)) {
|
|
58314
58314
|
return [x];
|
|
58315
58315
|
} else if (isRefinement(x)) {
|
|
58316
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
58316
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path10));
|
|
58317
58317
|
}
|
|
58318
58318
|
} else if (x === stringKeyword) {
|
|
58319
58319
|
return [y];
|
|
@@ -58325,7 +58325,7 @@ var intersectUnionMembers = (xs, ys, path9) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
58325
58325
|
if (isNumberKeyword(x) || isLiteral(x) && isNumber(x.literal)) {
|
|
58326
58326
|
return [x];
|
|
58327
58327
|
} else if (isRefinement(x)) {
|
|
58328
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
58328
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path10));
|
|
58329
58329
|
}
|
|
58330
58330
|
} else if (x === numberKeyword) {
|
|
58331
58331
|
return [y];
|
|
@@ -58337,7 +58337,7 @@ var intersectUnionMembers = (xs, ys, path9) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
58337
58337
|
if (isBooleanKeyword(x) || isLiteral(x) && isBoolean(x.literal)) {
|
|
58338
58338
|
return [x];
|
|
58339
58339
|
} else if (isRefinement(x)) {
|
|
58340
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
58340
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path10));
|
|
58341
58341
|
}
|
|
58342
58342
|
} else if (x === booleanKeyword) {
|
|
58343
58343
|
return [y];
|
|
@@ -58345,25 +58345,25 @@ var intersectUnionMembers = (xs, ys, path9) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
58345
58345
|
break;
|
|
58346
58346
|
}
|
|
58347
58347
|
case "Union":
|
|
58348
|
-
return intersectUnionMembers(getTypes(x), y.types,
|
|
58348
|
+
return intersectUnionMembers(getTypes(x), y.types, path10);
|
|
58349
58349
|
case "Suspend":
|
|
58350
|
-
return [new Suspend(() => extendAST(x, y.f(),
|
|
58350
|
+
return [new Suspend(() => extendAST(x, y.f(), path10))];
|
|
58351
58351
|
case "Refinement":
|
|
58352
|
-
return addRefinementToMembers(y, intersectUnionMembers(getTypes(x), getTypes(y.from),
|
|
58352
|
+
return addRefinementToMembers(y, intersectUnionMembers(getTypes(x), getTypes(y.from), path10));
|
|
58353
58353
|
case "TypeLiteral": {
|
|
58354
58354
|
switch (x._tag) {
|
|
58355
58355
|
case "Union":
|
|
58356
|
-
return intersectUnionMembers(x.types, [y],
|
|
58356
|
+
return intersectUnionMembers(x.types, [y], path10);
|
|
58357
58357
|
case "Suspend":
|
|
58358
|
-
return [new Suspend(() => extendAST(x.f(), y,
|
|
58358
|
+
return [new Suspend(() => extendAST(x.f(), y, path10))];
|
|
58359
58359
|
case "Refinement":
|
|
58360
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
58360
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path10));
|
|
58361
58361
|
case "TypeLiteral":
|
|
58362
|
-
return [intersectTypeLiterals(x, y,
|
|
58362
|
+
return [intersectTypeLiterals(x, y, path10)];
|
|
58363
58363
|
case "Transformation": {
|
|
58364
58364
|
const transformation = x.transformation;
|
|
58365
|
-
const from = intersectTypeLiterals(x.from, y,
|
|
58366
|
-
const to = intersectTypeLiterals(x.to, typeAST(y),
|
|
58365
|
+
const from = intersectTypeLiterals(x.from, y, path10);
|
|
58366
|
+
const to = intersectTypeLiterals(x.to, typeAST(y), path10);
|
|
58367
58367
|
switch (transformation._tag) {
|
|
58368
58368
|
case "TypeLiteralTransformation":
|
|
58369
58369
|
return [new Transformation(from, to, new TypeLiteralTransformation(transformation.propertySignatureTransformations))];
|
|
@@ -58385,15 +58385,15 @@ var intersectUnionMembers = (xs, ys, path9) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
58385
58385
|
case "Transformation": {
|
|
58386
58386
|
if (isTransformation(x)) {
|
|
58387
58387
|
if (isTypeLiteralTransformation(y.transformation) && isTypeLiteralTransformation(x.transformation)) {
|
|
58388
|
-
return [new Transformation(intersectTypeLiterals(x.from, y.from,
|
|
58388
|
+
return [new Transformation(intersectTypeLiterals(x.from, y.from, path10), intersectTypeLiterals(x.to, y.to, path10), new TypeLiteralTransformation(y.transformation.propertySignatureTransformations.concat(x.transformation.propertySignatureTransformations)))];
|
|
58389
58389
|
}
|
|
58390
58390
|
} else {
|
|
58391
|
-
return intersectUnionMembers([y], [x],
|
|
58391
|
+
return intersectUnionMembers([y], [x], path10);
|
|
58392
58392
|
}
|
|
58393
58393
|
break;
|
|
58394
58394
|
}
|
|
58395
58395
|
}
|
|
58396
|
-
throw new Error(getSchemaExtendErrorMessage(x, y,
|
|
58396
|
+
throw new Error(getSchemaExtendErrorMessage(x, y, path10));
|
|
58397
58397
|
}));
|
|
58398
58398
|
var extend4 = /* @__PURE__ */ dual(2, (self, that) => make54(extendAST(self.ast, that.ast, [])));
|
|
58399
58399
|
var compose3 = /* @__PURE__ */ dual((args2) => isSchema(args2[1]), (from, to) => makeTransformationClass(from, to, compose2(from.ast, to.ast)));
|
|
@@ -59063,8 +59063,8 @@ var PiB = (n) => Size(BigInt(n) * bigintPiB);
|
|
|
59063
59063
|
var make55 = (impl) => {
|
|
59064
59064
|
return tag.of({
|
|
59065
59065
|
...impl,
|
|
59066
|
-
exists: (
|
|
59067
|
-
readFileString: (
|
|
59066
|
+
exists: (path10) => pipe(impl.access(path10), as5(true), catchTag2("SystemError", (e) => e.reason === "NotFound" ? succeed8(false) : fail8(e))),
|
|
59067
|
+
readFileString: (path10, encoding) => tryMap2(impl.readFile(path10), {
|
|
59068
59068
|
try: (_) => new TextDecoder(encoding).decode(_),
|
|
59069
59069
|
catch: (cause3) => new BadArgument({
|
|
59070
59070
|
module: "FileSystem",
|
|
@@ -59073,14 +59073,14 @@ var make55 = (impl) => {
|
|
|
59073
59073
|
cause: cause3
|
|
59074
59074
|
})
|
|
59075
59075
|
}),
|
|
59076
|
-
stream: (
|
|
59076
|
+
stream: (path10, options3) => pipe(impl.open(path10, {
|
|
59077
59077
|
flag: "r"
|
|
59078
59078
|
}), options3?.offset ? tap3((file6) => file6.seek(options3.offset, "start")) : identity, map16((file6) => stream3(file6, options3)), unwrapScoped5),
|
|
59079
|
-
sink: (
|
|
59079
|
+
sink: (path10, options3) => pipe(impl.open(path10, {
|
|
59080
59080
|
flag: "w",
|
|
59081
59081
|
...options3
|
|
59082
59082
|
}), map16((file6) => forEach11((_) => file6.writeAll(_))), unwrapScoped6),
|
|
59083
|
-
writeFileString: (
|
|
59083
|
+
writeFileString: (path10, data, options3) => flatMap9(try_2({
|
|
59084
59084
|
try: () => new TextEncoder().encode(data),
|
|
59085
59085
|
catch: (cause3) => new BadArgument({
|
|
59086
59086
|
module: "FileSystem",
|
|
@@ -59088,38 +59088,38 @@ var make55 = (impl) => {
|
|
|
59088
59088
|
description: "could not encode string",
|
|
59089
59089
|
cause: cause3
|
|
59090
59090
|
})
|
|
59091
|
-
}), (_) => impl.writeFile(
|
|
59091
|
+
}), (_) => impl.writeFile(path10, _, options3))
|
|
59092
59092
|
});
|
|
59093
59093
|
};
|
|
59094
|
-
var notFound = (method,
|
|
59094
|
+
var notFound = (method, path10) => new SystemError({
|
|
59095
59095
|
module: "FileSystem",
|
|
59096
59096
|
method,
|
|
59097
59097
|
reason: "NotFound",
|
|
59098
59098
|
description: "No such file or directory",
|
|
59099
|
-
pathOrDescriptor:
|
|
59099
|
+
pathOrDescriptor: path10
|
|
59100
59100
|
});
|
|
59101
59101
|
var makeNoop = (fileSystem) => {
|
|
59102
59102
|
return {
|
|
59103
|
-
access(
|
|
59104
|
-
return fail8(notFound("access",
|
|
59103
|
+
access(path10) {
|
|
59104
|
+
return fail8(notFound("access", path10));
|
|
59105
59105
|
},
|
|
59106
|
-
chmod(
|
|
59107
|
-
return fail8(notFound("chmod",
|
|
59106
|
+
chmod(path10) {
|
|
59107
|
+
return fail8(notFound("chmod", path10));
|
|
59108
59108
|
},
|
|
59109
|
-
chown(
|
|
59110
|
-
return fail8(notFound("chown",
|
|
59109
|
+
chown(path10) {
|
|
59110
|
+
return fail8(notFound("chown", path10));
|
|
59111
59111
|
},
|
|
59112
|
-
copy(
|
|
59113
|
-
return fail8(notFound("copy",
|
|
59112
|
+
copy(path10) {
|
|
59113
|
+
return fail8(notFound("copy", path10));
|
|
59114
59114
|
},
|
|
59115
|
-
copyFile(
|
|
59116
|
-
return fail8(notFound("copyFile",
|
|
59115
|
+
copyFile(path10) {
|
|
59116
|
+
return fail8(notFound("copyFile", path10));
|
|
59117
59117
|
},
|
|
59118
59118
|
exists() {
|
|
59119
59119
|
return succeed8(false);
|
|
59120
59120
|
},
|
|
59121
|
-
link(
|
|
59122
|
-
return fail8(notFound("link",
|
|
59121
|
+
link(path10) {
|
|
59122
|
+
return fail8(notFound("link", path10));
|
|
59123
59123
|
},
|
|
59124
59124
|
makeDirectory() {
|
|
59125
59125
|
return die5("not implemented");
|
|
@@ -59136,23 +59136,23 @@ var makeNoop = (fileSystem) => {
|
|
|
59136
59136
|
makeTempFileScoped() {
|
|
59137
59137
|
return die5("not implemented");
|
|
59138
59138
|
},
|
|
59139
|
-
open(
|
|
59140
|
-
return fail8(notFound("open",
|
|
59139
|
+
open(path10) {
|
|
59140
|
+
return fail8(notFound("open", path10));
|
|
59141
59141
|
},
|
|
59142
|
-
readDirectory(
|
|
59143
|
-
return fail8(notFound("readDirectory",
|
|
59142
|
+
readDirectory(path10) {
|
|
59143
|
+
return fail8(notFound("readDirectory", path10));
|
|
59144
59144
|
},
|
|
59145
|
-
readFile(
|
|
59146
|
-
return fail8(notFound("readFile",
|
|
59145
|
+
readFile(path10) {
|
|
59146
|
+
return fail8(notFound("readFile", path10));
|
|
59147
59147
|
},
|
|
59148
|
-
readFileString(
|
|
59149
|
-
return fail8(notFound("readFileString",
|
|
59148
|
+
readFileString(path10) {
|
|
59149
|
+
return fail8(notFound("readFileString", path10));
|
|
59150
59150
|
},
|
|
59151
|
-
readLink(
|
|
59152
|
-
return fail8(notFound("readLink",
|
|
59151
|
+
readLink(path10) {
|
|
59152
|
+
return fail8(notFound("readLink", path10));
|
|
59153
59153
|
},
|
|
59154
|
-
realPath(
|
|
59155
|
-
return fail8(notFound("realPath",
|
|
59154
|
+
realPath(path10) {
|
|
59155
|
+
return fail8(notFound("realPath", path10));
|
|
59156
59156
|
},
|
|
59157
59157
|
remove() {
|
|
59158
59158
|
return _void;
|
|
@@ -59160,32 +59160,32 @@ var makeNoop = (fileSystem) => {
|
|
|
59160
59160
|
rename(oldPath) {
|
|
59161
59161
|
return fail8(notFound("rename", oldPath));
|
|
59162
59162
|
},
|
|
59163
|
-
sink(
|
|
59164
|
-
return fail14(notFound("sink",
|
|
59163
|
+
sink(path10) {
|
|
59164
|
+
return fail14(notFound("sink", path10));
|
|
59165
59165
|
},
|
|
59166
|
-
stat(
|
|
59167
|
-
return fail8(notFound("stat",
|
|
59166
|
+
stat(path10) {
|
|
59167
|
+
return fail8(notFound("stat", path10));
|
|
59168
59168
|
},
|
|
59169
|
-
stream(
|
|
59170
|
-
return fail13(notFound("stream",
|
|
59169
|
+
stream(path10) {
|
|
59170
|
+
return fail13(notFound("stream", path10));
|
|
59171
59171
|
},
|
|
59172
59172
|
symlink(fromPath) {
|
|
59173
59173
|
return fail8(notFound("symlink", fromPath));
|
|
59174
59174
|
},
|
|
59175
|
-
truncate(
|
|
59176
|
-
return fail8(notFound("truncate",
|
|
59175
|
+
truncate(path10) {
|
|
59176
|
+
return fail8(notFound("truncate", path10));
|
|
59177
59177
|
},
|
|
59178
|
-
utimes(
|
|
59179
|
-
return fail8(notFound("utimes",
|
|
59178
|
+
utimes(path10) {
|
|
59179
|
+
return fail8(notFound("utimes", path10));
|
|
59180
59180
|
},
|
|
59181
|
-
watch(
|
|
59182
|
-
return fail13(notFound("watch",
|
|
59181
|
+
watch(path10) {
|
|
59182
|
+
return fail13(notFound("watch", path10));
|
|
59183
59183
|
},
|
|
59184
|
-
writeFile(
|
|
59185
|
-
return fail8(notFound("writeFile",
|
|
59184
|
+
writeFile(path10) {
|
|
59185
|
+
return fail8(notFound("writeFile", path10));
|
|
59186
59186
|
},
|
|
59187
|
-
writeFileString(
|
|
59188
|
-
return fail8(notFound("writeFileString",
|
|
59187
|
+
writeFileString(path10) {
|
|
59188
|
+
return fail8(notFound("writeFileString", path10));
|
|
59189
59189
|
},
|
|
59190
59190
|
...fileSystem
|
|
59191
59191
|
};
|
|
@@ -59234,7 +59234,7 @@ var WatchBackend = class extends (/* @__PURE__ */ Tag2("@effect/platform/FileSys
|
|
|
59234
59234
|
};
|
|
59235
59235
|
|
|
59236
59236
|
// 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
|
|
59237
|
-
var handleErrnoException = (module, method) => (err, [
|
|
59237
|
+
var handleErrnoException = (module, method) => (err, [path10]) => {
|
|
59238
59238
|
let reason = "Unknown";
|
|
59239
59239
|
switch (err.code) {
|
|
59240
59240
|
case "ENOENT":
|
|
@@ -59263,7 +59263,7 @@ var handleErrnoException = (module, method) => (err, [path9]) => {
|
|
|
59263
59263
|
reason,
|
|
59264
59264
|
module,
|
|
59265
59265
|
method,
|
|
59266
|
-
pathOrDescriptor:
|
|
59266
|
+
pathOrDescriptor: path10,
|
|
59267
59267
|
syscall: err.syscall,
|
|
59268
59268
|
description: err.message,
|
|
59269
59269
|
cause: err
|
|
@@ -59522,7 +59522,7 @@ var handleBadArgument = (method) => (cause3) => new BadArgument({
|
|
|
59522
59522
|
});
|
|
59523
59523
|
var access2 = /* @__PURE__ */ (() => {
|
|
59524
59524
|
const nodeAccess = /* @__PURE__ */ effectify2(NFS__namespace.access, /* @__PURE__ */ handleErrnoException("FileSystem", "access"), /* @__PURE__ */ handleBadArgument("access"));
|
|
59525
|
-
return (
|
|
59525
|
+
return (path10, options3) => {
|
|
59526
59526
|
let mode = NFS__namespace.constants.F_OK;
|
|
59527
59527
|
if (options3?.readable) {
|
|
59528
59528
|
mode |= NFS__namespace.constants.R_OK;
|
|
@@ -59530,7 +59530,7 @@ var access2 = /* @__PURE__ */ (() => {
|
|
|
59530
59530
|
if (options3?.writable) {
|
|
59531
59531
|
mode |= NFS__namespace.constants.W_OK;
|
|
59532
59532
|
}
|
|
59533
|
-
return nodeAccess(
|
|
59533
|
+
return nodeAccess(path10, mode);
|
|
59534
59534
|
};
|
|
59535
59535
|
})();
|
|
59536
59536
|
var copy3 = /* @__PURE__ */ (() => {
|
|
@@ -59547,11 +59547,11 @@ var copyFile2 = /* @__PURE__ */ (() => {
|
|
|
59547
59547
|
})();
|
|
59548
59548
|
var chmod2 = /* @__PURE__ */ (() => {
|
|
59549
59549
|
const nodeChmod = /* @__PURE__ */ effectify2(NFS__namespace.chmod, /* @__PURE__ */ handleErrnoException("FileSystem", "chmod"), /* @__PURE__ */ handleBadArgument("chmod"));
|
|
59550
|
-
return (
|
|
59550
|
+
return (path10, mode) => nodeChmod(path10, mode);
|
|
59551
59551
|
})();
|
|
59552
59552
|
var chown2 = /* @__PURE__ */ (() => {
|
|
59553
59553
|
const nodeChown = /* @__PURE__ */ effectify2(NFS__namespace.chown, /* @__PURE__ */ handleErrnoException("FileSystem", "chown"), /* @__PURE__ */ handleBadArgument("chown"));
|
|
59554
|
-
return (
|
|
59554
|
+
return (path10, uid, gid) => nodeChown(path10, uid, gid);
|
|
59555
59555
|
})();
|
|
59556
59556
|
var link2 = /* @__PURE__ */ (() => {
|
|
59557
59557
|
const nodeLink = /* @__PURE__ */ effectify2(NFS__namespace.link, /* @__PURE__ */ handleErrnoException("FileSystem", "link"), /* @__PURE__ */ handleBadArgument("link"));
|
|
@@ -59559,7 +59559,7 @@ var link2 = /* @__PURE__ */ (() => {
|
|
|
59559
59559
|
})();
|
|
59560
59560
|
var makeDirectory = /* @__PURE__ */ (() => {
|
|
59561
59561
|
const nodeMkdir = /* @__PURE__ */ effectify2(NFS__namespace.mkdir, /* @__PURE__ */ handleErrnoException("FileSystem", "makeDirectory"), /* @__PURE__ */ handleBadArgument("makeDirectory"));
|
|
59562
|
-
return (
|
|
59562
|
+
return (path10, options3) => nodeMkdir(path10, {
|
|
59563
59563
|
recursive: options3?.recursive ?? false,
|
|
59564
59564
|
mode: options3?.mode
|
|
59565
59565
|
});
|
|
@@ -59575,7 +59575,7 @@ var makeTempDirectoryFactory = (method) => {
|
|
|
59575
59575
|
var makeTempDirectory = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectory");
|
|
59576
59576
|
var removeFactory = (method) => {
|
|
59577
59577
|
const nodeRm = effectify2(NFS__namespace.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
59578
|
-
return (
|
|
59578
|
+
return (path10, options3) => nodeRm(path10, {
|
|
59579
59579
|
recursive: options3?.recursive ?? false,
|
|
59580
59580
|
force: options3?.force ?? false
|
|
59581
59581
|
});
|
|
@@ -59591,7 +59591,7 @@ var makeTempDirectoryScoped = /* @__PURE__ */ (() => {
|
|
|
59591
59591
|
var openFactory = (method) => {
|
|
59592
59592
|
const nodeOpen = effectify2(NFS__namespace.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
59593
59593
|
const nodeClose = effectify2(NFS__namespace.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
59594
|
-
return (
|
|
59594
|
+
return (path10, options3) => pipe(acquireRelease2(nodeOpen(path10, options3?.flag ?? "r", options3?.mode), (fd) => orDie2(nodeClose(fd))), map16((fd) => makeFile(FileDescriptor(fd), options3?.flag?.startsWith("a") ?? false)));
|
|
59595
59595
|
};
|
|
59596
59596
|
var open2 = /* @__PURE__ */ openFactory("open");
|
|
59597
59597
|
var makeFile = /* @__PURE__ */ (() => {
|
|
@@ -59706,7 +59706,7 @@ var makeTempFileFactory = (method) => {
|
|
|
59706
59706
|
const makeDirectory2 = makeTempDirectoryFactory(method);
|
|
59707
59707
|
const open3 = openFactory(method);
|
|
59708
59708
|
const randomHexString2 = (bytes) => sync4(() => Crypto__namespace.randomBytes(bytes).toString("hex"));
|
|
59709
|
-
return (options3) => pipe(zip5(makeDirectory2(options3), randomHexString2(6)), map16(([directory5, random4]) => path4__namespace.join(directory5, random4)), tap3((
|
|
59709
|
+
return (options3) => pipe(zip5(makeDirectory2(options3), randomHexString2(6)), map16(([directory5, random4]) => path4__namespace.join(directory5, random4)), tap3((path10) => scoped2(open3(path10, {
|
|
59710
59710
|
flag: "w+"
|
|
59711
59711
|
}))));
|
|
59712
59712
|
};
|
|
@@ -59718,17 +59718,17 @@ var makeTempFileScoped = /* @__PURE__ */ (() => {
|
|
|
59718
59718
|
recursive: true
|
|
59719
59719
|
})));
|
|
59720
59720
|
})();
|
|
59721
|
-
var readDirectory = (
|
|
59722
|
-
try: () => NFS__namespace.promises.readdir(
|
|
59723
|
-
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [
|
|
59721
|
+
var readDirectory = (path10, options3) => tryPromise2({
|
|
59722
|
+
try: () => NFS__namespace.promises.readdir(path10, options3),
|
|
59723
|
+
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path10])
|
|
59724
59724
|
});
|
|
59725
|
-
var readFile2 = (
|
|
59725
|
+
var readFile2 = (path10) => async2((resume2, signal) => {
|
|
59726
59726
|
try {
|
|
59727
|
-
NFS__namespace.readFile(
|
|
59727
|
+
NFS__namespace.readFile(path10, {
|
|
59728
59728
|
signal
|
|
59729
59729
|
}, (err, data) => {
|
|
59730
59730
|
if (err) {
|
|
59731
|
-
resume2(fail8(handleErrnoException("FileSystem", "readFile")(err, [
|
|
59731
|
+
resume2(fail8(handleErrnoException("FileSystem", "readFile")(err, [path10])));
|
|
59732
59732
|
} else {
|
|
59733
59733
|
resume2(succeed8(data));
|
|
59734
59734
|
}
|
|
@@ -59739,11 +59739,11 @@ var readFile2 = (path9) => async2((resume2, signal) => {
|
|
|
59739
59739
|
});
|
|
59740
59740
|
var readLink = /* @__PURE__ */ (() => {
|
|
59741
59741
|
const nodeReadLink = /* @__PURE__ */ effectify2(NFS__namespace.readlink, /* @__PURE__ */ handleErrnoException("FileSystem", "readLink"), /* @__PURE__ */ handleBadArgument("readLink"));
|
|
59742
|
-
return (
|
|
59742
|
+
return (path10) => nodeReadLink(path10);
|
|
59743
59743
|
})();
|
|
59744
59744
|
var realPath = /* @__PURE__ */ (() => {
|
|
59745
59745
|
const nodeRealPath = /* @__PURE__ */ effectify2(NFS__namespace.realpath, /* @__PURE__ */ handleErrnoException("FileSystem", "realPath"), /* @__PURE__ */ handleBadArgument("realPath"));
|
|
59746
|
-
return (
|
|
59746
|
+
return (path10) => nodeRealPath(path10);
|
|
59747
59747
|
})();
|
|
59748
59748
|
var rename3 = /* @__PURE__ */ (() => {
|
|
59749
59749
|
const nodeRename = /* @__PURE__ */ effectify2(NFS__namespace.rename, /* @__PURE__ */ handleErrnoException("FileSystem", "rename"), /* @__PURE__ */ handleBadArgument("rename"));
|
|
@@ -59767,40 +59767,40 @@ var makeFileInfo = (stat3) => ({
|
|
|
59767
59767
|
});
|
|
59768
59768
|
var stat2 = /* @__PURE__ */ (() => {
|
|
59769
59769
|
const nodeStat = /* @__PURE__ */ effectify2(NFS__namespace.stat, /* @__PURE__ */ handleErrnoException("FileSystem", "stat"), /* @__PURE__ */ handleBadArgument("stat"));
|
|
59770
|
-
return (
|
|
59770
|
+
return (path10) => map16(nodeStat(path10), makeFileInfo);
|
|
59771
59771
|
})();
|
|
59772
59772
|
var symlink2 = /* @__PURE__ */ (() => {
|
|
59773
59773
|
const nodeSymlink = /* @__PURE__ */ effectify2(NFS__namespace.symlink, /* @__PURE__ */ handleErrnoException("FileSystem", "symlink"), /* @__PURE__ */ handleBadArgument("symlink"));
|
|
59774
|
-
return (target,
|
|
59774
|
+
return (target, path10) => nodeSymlink(target, path10);
|
|
59775
59775
|
})();
|
|
59776
59776
|
var truncate2 = /* @__PURE__ */ (() => {
|
|
59777
59777
|
const nodeTruncate = /* @__PURE__ */ effectify2(NFS__namespace.truncate, /* @__PURE__ */ handleErrnoException("FileSystem", "truncate"), /* @__PURE__ */ handleBadArgument("truncate"));
|
|
59778
|
-
return (
|
|
59778
|
+
return (path10, length4) => nodeTruncate(path10, length4 !== void 0 ? Number(length4) : void 0);
|
|
59779
59779
|
})();
|
|
59780
59780
|
var utimes2 = /* @__PURE__ */ (() => {
|
|
59781
59781
|
const nodeUtimes = /* @__PURE__ */ effectify2(NFS__namespace.utimes, /* @__PURE__ */ handleErrnoException("FileSystem", "utime"), /* @__PURE__ */ handleBadArgument("utime"));
|
|
59782
|
-
return (
|
|
59782
|
+
return (path10, atime, mtime) => nodeUtimes(path10, atime, mtime);
|
|
59783
59783
|
})();
|
|
59784
|
-
var watchNode = (
|
|
59785
|
-
const watcher = NFS__namespace.watch(
|
|
59784
|
+
var watchNode = (path10, options3) => asyncScoped2((emit) => acquireRelease2(sync4(() => {
|
|
59785
|
+
const watcher = NFS__namespace.watch(path10, {
|
|
59786
59786
|
recursive: options3?.recursive
|
|
59787
|
-
}, (event,
|
|
59788
|
-
if (!
|
|
59787
|
+
}, (event, path11) => {
|
|
59788
|
+
if (!path11) return;
|
|
59789
59789
|
switch (event) {
|
|
59790
59790
|
case "rename": {
|
|
59791
|
-
emit.fromEffect(matchEffect2(stat2(
|
|
59791
|
+
emit.fromEffect(matchEffect2(stat2(path11), {
|
|
59792
59792
|
onSuccess: (_) => succeed8(WatchEventCreate({
|
|
59793
|
-
path:
|
|
59793
|
+
path: path11
|
|
59794
59794
|
})),
|
|
59795
59795
|
onFailure: (err) => err._tag === "SystemError" && err.reason === "NotFound" ? succeed8(WatchEventRemove({
|
|
59796
|
-
path:
|
|
59796
|
+
path: path11
|
|
59797
59797
|
})) : fail8(err)
|
|
59798
59798
|
}));
|
|
59799
59799
|
return;
|
|
59800
59800
|
}
|
|
59801
59801
|
case "change": {
|
|
59802
59802
|
emit.single(WatchEventUpdate({
|
|
59803
|
-
path:
|
|
59803
|
+
path: path11
|
|
59804
59804
|
}));
|
|
59805
59805
|
return;
|
|
59806
59806
|
}
|
|
@@ -59811,7 +59811,7 @@ var watchNode = (path9, options3) => asyncScoped2((emit) => acquireRelease2(sync
|
|
|
59811
59811
|
module: "FileSystem",
|
|
59812
59812
|
reason: "Unknown",
|
|
59813
59813
|
method: "watch",
|
|
59814
|
-
pathOrDescriptor:
|
|
59814
|
+
pathOrDescriptor: path10,
|
|
59815
59815
|
cause: error4
|
|
59816
59816
|
}));
|
|
59817
59817
|
});
|
|
@@ -59820,16 +59820,16 @@ var watchNode = (path9, options3) => asyncScoped2((emit) => acquireRelease2(sync
|
|
|
59820
59820
|
});
|
|
59821
59821
|
return watcher;
|
|
59822
59822
|
}), (watcher) => sync4(() => watcher.close())));
|
|
59823
|
-
var watch2 = (backend,
|
|
59824
|
-
var writeFile2 = (
|
|
59823
|
+
var watch2 = (backend, path10, options3) => stat2(path10).pipe(map16((stat3) => backend.pipe(flatMap((_) => _.register(path10, stat3, options3)), getOrElse(() => watchNode(path10, options3)))), unwrap3);
|
|
59824
|
+
var writeFile2 = (path10, data, options3) => async2((resume2, signal) => {
|
|
59825
59825
|
try {
|
|
59826
|
-
NFS__namespace.writeFile(
|
|
59826
|
+
NFS__namespace.writeFile(path10, data, {
|
|
59827
59827
|
signal,
|
|
59828
59828
|
flag: options3?.flag,
|
|
59829
59829
|
mode: options3?.mode
|
|
59830
59830
|
}, (err) => {
|
|
59831
59831
|
if (err) {
|
|
59832
|
-
resume2(fail8(handleErrnoException("FileSystem", "writeFile")(err, [
|
|
59832
|
+
resume2(fail8(handleErrnoException("FileSystem", "writeFile")(err, [path10])));
|
|
59833
59833
|
} else {
|
|
59834
59834
|
resume2(_void);
|
|
59835
59835
|
}
|
|
@@ -59861,8 +59861,8 @@ var makeFileSystem = /* @__PURE__ */ map16(/* @__PURE__ */ serviceOption2(WatchB
|
|
|
59861
59861
|
symlink: symlink2,
|
|
59862
59862
|
truncate: truncate2,
|
|
59863
59863
|
utimes: utimes2,
|
|
59864
|
-
watch(
|
|
59865
|
-
return watch2(backend,
|
|
59864
|
+
watch(path10, options3) {
|
|
59865
|
+
return watch2(backend, path10, options3);
|
|
59866
59866
|
},
|
|
59867
59867
|
writeFile: writeFile2
|
|
59868
59868
|
}));
|
|
@@ -59887,12 +59887,12 @@ var fromFileUrl2 = (url2) => try_2({
|
|
|
59887
59887
|
cause: error4
|
|
59888
59888
|
})
|
|
59889
59889
|
});
|
|
59890
|
-
var toFileUrl2 = (
|
|
59891
|
-
try: () => NodeUrl__namespace.pathToFileURL(
|
|
59890
|
+
var toFileUrl2 = (path10) => try_2({
|
|
59891
|
+
try: () => NodeUrl__namespace.pathToFileURL(path10),
|
|
59892
59892
|
catch: (error4) => new BadArgument({
|
|
59893
59893
|
module: "Path",
|
|
59894
59894
|
method: "toFileUrl",
|
|
59895
|
-
description: `Invalid path: ${
|
|
59895
|
+
description: `Invalid path: ${path10}`,
|
|
59896
59896
|
cause: error4
|
|
59897
59897
|
})
|
|
59898
59898
|
});
|
|
@@ -60954,22 +60954,22 @@ var fileParsers = {
|
|
|
60954
60954
|
toml: (content) => Toml.parse(content),
|
|
60955
60955
|
tml: (content) => Toml.parse(content)
|
|
60956
60956
|
};
|
|
60957
|
-
var read3 = (
|
|
60958
|
-
onFailure: (error4) => fail8(`Could not read file (${
|
|
60959
|
-
onSuccess: (content) => succeed8([
|
|
60957
|
+
var read3 = (path10) => flatMap9(FileSystem, (fs) => matchEffect2(fs.readFile(path10), {
|
|
60958
|
+
onFailure: (error4) => fail8(`Could not read file (${path10}): ${error4}`),
|
|
60959
|
+
onSuccess: (content) => succeed8([path10, content])
|
|
60960
60960
|
}));
|
|
60961
|
-
var readString = (
|
|
60962
|
-
onFailure: (error4) => fail8(`Could not read file (${
|
|
60963
|
-
onSuccess: (content) => succeed8([
|
|
60961
|
+
var readString = (path10) => flatMap9(FileSystem, (fs) => matchEffect2(fs.readFileString(path10), {
|
|
60962
|
+
onFailure: (error4) => fail8(`Could not read file (${path10}): ${error4}`),
|
|
60963
|
+
onSuccess: (content) => succeed8([path10, content])
|
|
60964
60964
|
}));
|
|
60965
|
-
var parse5 = (
|
|
60966
|
-
const parser = fileParsers[format6 ??
|
|
60965
|
+
var parse5 = (path10, content, format6) => {
|
|
60966
|
+
const parser = fileParsers[format6 ?? path10.split(".").pop()];
|
|
60967
60967
|
if (parser === void 0) {
|
|
60968
60968
|
return fail8(`Unsupported file format: ${format6}`);
|
|
60969
60969
|
}
|
|
60970
60970
|
return try_2({
|
|
60971
60971
|
try: () => parser(content),
|
|
60972
|
-
catch: (e) => `Could not parse ${format6} file (${
|
|
60972
|
+
catch: (e) => `Could not parse ${format6} file (${path10}): ${e}`
|
|
60973
60973
|
});
|
|
60974
60974
|
};
|
|
60975
60975
|
|
|
@@ -63271,22 +63271,22 @@ var showConfirmation = /* @__PURE__ */ Confirm.$is("Show");
|
|
|
63271
63271
|
var renderBeep2 = /* @__PURE__ */ render3(beep3, {
|
|
63272
63272
|
style: "pretty"
|
|
63273
63273
|
});
|
|
63274
|
-
function resolveCurrentPath(
|
|
63275
|
-
return match2(
|
|
63274
|
+
function resolveCurrentPath(path10, options3) {
|
|
63275
|
+
return match2(path10, {
|
|
63276
63276
|
onNone: () => match2(options3.startingPath, {
|
|
63277
63277
|
onNone: () => sync4(() => process.cwd()),
|
|
63278
|
-
onSome: (
|
|
63278
|
+
onSome: (path11) => flatMap9(FileSystem, (fs) => (
|
|
63279
63279
|
// Ensure the user provided starting path exists
|
|
63280
|
-
orDie2(fs.exists(
|
|
63280
|
+
orDie2(fs.exists(path11)).pipe(filterOrDieMessage2(identity, `The provided starting path '${path11}' does not exist`), as5(path11))
|
|
63281
63281
|
))
|
|
63282
63282
|
}),
|
|
63283
|
-
onSome: (
|
|
63283
|
+
onSome: (path11) => succeed8(path11)
|
|
63284
63284
|
});
|
|
63285
63285
|
}
|
|
63286
63286
|
function getFileList(directory5, options3) {
|
|
63287
63287
|
return gen3(function* () {
|
|
63288
63288
|
const fs = yield* FileSystem;
|
|
63289
|
-
const
|
|
63289
|
+
const path10 = yield* Path3;
|
|
63290
63290
|
const files = yield* orDie2(fs.readDirectory(directory5)).pipe(
|
|
63291
63291
|
// Always prepend the `".."` option to the file list but allow it
|
|
63292
63292
|
// to be filtered out if the user so desires
|
|
@@ -63295,7 +63295,7 @@ function getFileList(directory5, options3) {
|
|
|
63295
63295
|
return yield* filter8(files, (file6) => {
|
|
63296
63296
|
const result = options3.filter(file6);
|
|
63297
63297
|
const userDefinedFilter = isEffect2(result) ? result : succeed8(result);
|
|
63298
|
-
const directoryFilter = options3.type === "directory" ? map16(orDie2(fs.stat(
|
|
63298
|
+
const directoryFilter = options3.type === "directory" ? map16(orDie2(fs.stat(path10.join(directory5, file6))), (info3) => info3.type === "Directory") : succeed8(true);
|
|
63299
63299
|
return zipWith5(userDefinedFilter, directoryFilter, (a, b) => a && b);
|
|
63300
63300
|
}, {
|
|
63301
63301
|
concurrency: files.length
|
|
@@ -63361,13 +63361,13 @@ function renderFiles(state, files, figures2, options3) {
|
|
|
63361
63361
|
}
|
|
63362
63362
|
function renderNextFrame2(state, options3) {
|
|
63363
63363
|
return gen3(function* () {
|
|
63364
|
-
const
|
|
63364
|
+
const path10 = yield* Path3;
|
|
63365
63365
|
const terminal = yield* Terminal;
|
|
63366
63366
|
const columns = yield* terminal.columns;
|
|
63367
63367
|
const figures2 = yield* figures;
|
|
63368
63368
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
63369
63369
|
const selectedPath = state.files[state.cursor];
|
|
63370
|
-
const resolvedPath =
|
|
63370
|
+
const resolvedPath = path10.resolve(currentPath, selectedPath);
|
|
63371
63371
|
const resolvedPathMsg = figures2.pointerSmall.pipe(cat2(space2), cat2(text3(resolvedPath)), annotate2(blackBright2));
|
|
63372
63372
|
if (showConfirmation(state.confirm)) {
|
|
63373
63373
|
const leadingSymbol2 = annotate2(text3("?"), cyanBright2);
|
|
@@ -63442,10 +63442,10 @@ function processCursorDown(state) {
|
|
|
63442
63442
|
function processSelection(state, options3) {
|
|
63443
63443
|
return gen3(function* () {
|
|
63444
63444
|
const fs = yield* FileSystem;
|
|
63445
|
-
const
|
|
63445
|
+
const path10 = yield* Path3;
|
|
63446
63446
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
63447
63447
|
const selectedPath = state.files[state.cursor];
|
|
63448
|
-
const resolvedPath =
|
|
63448
|
+
const resolvedPath = path10.resolve(currentPath, selectedPath);
|
|
63449
63449
|
const info3 = yield* orDie2(fs.stat(resolvedPath));
|
|
63450
63450
|
if (info3.type === "Directory") {
|
|
63451
63451
|
const files = yield* getFileList(resolvedPath, options3);
|
|
@@ -63493,10 +63493,10 @@ function handleProcess2(options3) {
|
|
|
63493
63493
|
case "y":
|
|
63494
63494
|
case "t": {
|
|
63495
63495
|
if (showConfirmation(state.confirm)) {
|
|
63496
|
-
const
|
|
63496
|
+
const path10 = yield* Path3;
|
|
63497
63497
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
63498
63498
|
const selectedPath = state.files[state.cursor];
|
|
63499
|
-
const resolvedPath =
|
|
63499
|
+
const resolvedPath = path10.resolve(currentPath, selectedPath);
|
|
63500
63500
|
const files = yield* getFileList(resolvedPath, options3);
|
|
63501
63501
|
return Action.NextFrame({
|
|
63502
63502
|
state: {
|
|
@@ -63512,10 +63512,10 @@ function handleProcess2(options3) {
|
|
|
63512
63512
|
case "n":
|
|
63513
63513
|
case "f": {
|
|
63514
63514
|
if (showConfirmation(state.confirm)) {
|
|
63515
|
-
const
|
|
63515
|
+
const path10 = yield* Path3;
|
|
63516
63516
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
63517
63517
|
const selectedPath = state.files[state.cursor];
|
|
63518
|
-
const resolvedPath =
|
|
63518
|
+
const resolvedPath = path10.resolve(currentPath, selectedPath);
|
|
63519
63519
|
return Action.Submit({
|
|
63520
63520
|
value: resolvedPath
|
|
63521
63521
|
});
|
|
@@ -63537,14 +63537,14 @@ var file = (options3 = {}) => {
|
|
|
63537
63537
|
filter: options3.filter ?? (() => succeed8(true))
|
|
63538
63538
|
};
|
|
63539
63539
|
const initialState3 = gen3(function* () {
|
|
63540
|
-
const
|
|
63541
|
-
const currentPath = yield* resolveCurrentPath(
|
|
63540
|
+
const path10 = none2();
|
|
63541
|
+
const currentPath = yield* resolveCurrentPath(path10, opts);
|
|
63542
63542
|
const files = yield* getFileList(currentPath, opts);
|
|
63543
63543
|
const confirm = Confirm.Hide();
|
|
63544
63544
|
return {
|
|
63545
63545
|
cursor: 0,
|
|
63546
63546
|
files,
|
|
63547
|
-
path:
|
|
63547
|
+
path: path10,
|
|
63548
63548
|
confirm
|
|
63549
63549
|
};
|
|
63550
63550
|
});
|
|
@@ -64689,7 +64689,7 @@ var validateInternal = (self, value5, config2) => {
|
|
|
64689
64689
|
case "Path": {
|
|
64690
64690
|
return flatMap9(FileSystem, (fileSystem) => {
|
|
64691
64691
|
const errorMsg = "Path options do not have a default value";
|
|
64692
|
-
return orElseFail2(value5, () => errorMsg).pipe(tap3((
|
|
64692
|
+
return orElseFail2(value5, () => errorMsg).pipe(tap3((path10) => orDie2(fileSystem.exists(path10)).pipe(tap3((pathExists) => validatePathExistence(path10, self.pathExists, pathExists).pipe(zipRight4(validatePathType(path10, self.pathType, fileSystem).pipe(when2(() => self.pathExists !== "no" && pathExists))))))));
|
|
64693
64693
|
});
|
|
64694
64694
|
}
|
|
64695
64695
|
case "Redacted": {
|
|
@@ -64704,24 +64704,24 @@ var validateInternal = (self, value5, config2) => {
|
|
|
64704
64704
|
}
|
|
64705
64705
|
};
|
|
64706
64706
|
var attempt = (option5, typeName, parse9) => orElseFail2(option5, () => `${typeName} options do not have a default value`).pipe(flatMap9((value5) => orElseFail2(parse9(value5), () => `'${value5}' is not a ${typeName}`)));
|
|
64707
|
-
var validatePathExistence = (
|
|
64707
|
+
var validatePathExistence = (path10, shouldPathExist, pathExists) => {
|
|
64708
64708
|
if (shouldPathExist === "no" && pathExists) {
|
|
64709
|
-
return fail8(`Path '${
|
|
64709
|
+
return fail8(`Path '${path10}' must not exist`);
|
|
64710
64710
|
}
|
|
64711
64711
|
if (shouldPathExist === "yes" && !pathExists) {
|
|
64712
|
-
return fail8(`Path '${
|
|
64712
|
+
return fail8(`Path '${path10}' must exist`);
|
|
64713
64713
|
}
|
|
64714
64714
|
return _void;
|
|
64715
64715
|
};
|
|
64716
|
-
var validatePathType = (
|
|
64716
|
+
var validatePathType = (path10, pathType, fileSystem) => {
|
|
64717
64717
|
switch (pathType) {
|
|
64718
64718
|
case "file": {
|
|
64719
|
-
const checkIsFile = fileSystem.stat(
|
|
64720
|
-
return fail8(`Expected path '${
|
|
64719
|
+
const checkIsFile = fileSystem.stat(path10).pipe(map16((info3) => info3.type === "File"), orDie2);
|
|
64720
|
+
return fail8(`Expected path '${path10}' to be a regular file`).pipe(unlessEffect2(checkIsFile), asVoid4);
|
|
64721
64721
|
}
|
|
64722
64722
|
case "directory": {
|
|
64723
|
-
const checkIsDirectory = fileSystem.stat(
|
|
64724
|
-
return fail8(`Expected path '${
|
|
64723
|
+
const checkIsDirectory = fileSystem.stat(path10).pipe(map16((info3) => info3.type === "Directory"), orDie2);
|
|
64724
|
+
return fail8(`Expected path '${path10}' to be a directory`).pipe(unlessEffect2(checkIsDirectory), asVoid4);
|
|
64725
64725
|
}
|
|
64726
64726
|
case "either": {
|
|
64727
64727
|
return _void;
|
|
@@ -65143,13 +65143,13 @@ var file2 = (config2) => makeSingle(fromNullable(config2?.name), path("file", co
|
|
|
65143
65143
|
var fileContent = (config2) => mapEffect6(file2({
|
|
65144
65144
|
...config2,
|
|
65145
65145
|
exists: "yes"
|
|
65146
|
-
}), (
|
|
65147
|
-
var fileParse = (config2) => mapEffect6(fileText(config2), ([
|
|
65146
|
+
}), (path10) => mapError2(read3(path10), (e) => p(e)));
|
|
65147
|
+
var fileParse = (config2) => mapEffect6(fileText(config2), ([path10, content]) => mapError2(parse5(path10, content, config2?.format), (e) => p(e)));
|
|
65148
65148
|
var fileSchema = (schema, config2) => withSchema(fileParse(config2), schema);
|
|
65149
65149
|
var fileText = (config2) => mapEffect6(file2({
|
|
65150
65150
|
...config2,
|
|
65151
65151
|
exists: "yes"
|
|
65152
|
-
}), (
|
|
65152
|
+
}), (path10) => mapError2(readString(path10), (e) => p(e)));
|
|
65153
65153
|
var float3 = (config2) => makeSingle(fromNullable(config2?.name), float2);
|
|
65154
65154
|
var integer4 = (config2) => makeSingle(fromNullable(config2?.name), integer3);
|
|
65155
65155
|
var none11 = /* @__PURE__ */ (() => {
|
|
@@ -65765,12 +65765,12 @@ var directory3 = (name, config2) => makeSingle2(name, empty3(), path("directory"
|
|
|
65765
65765
|
var file4 = (name, config2) => makeSingle2(name, empty3(), path("file", config2?.exists ?? "either"));
|
|
65766
65766
|
var fileContent3 = (name) => mapEffect8(file4(name, {
|
|
65767
65767
|
exists: "yes"
|
|
65768
|
-
}), (
|
|
65769
|
-
var fileParse3 = (name, format6) => mapEffect8(fileText3(name), ([
|
|
65768
|
+
}), (path10) => mapError2(read3(path10), (msg) => invalidValue(p(msg))));
|
|
65769
|
+
var fileParse3 = (name, format6) => mapEffect8(fileText3(name), ([path10, content]) => mapError2(parse5(path10, content, format6), (error4) => invalidValue(p(error4))));
|
|
65770
65770
|
var fileSchema3 = (name, schema, format6) => withSchema3(fileParse3(name, format6), schema);
|
|
65771
65771
|
var fileText3 = (name) => mapEffect8(file4(name, {
|
|
65772
65772
|
exists: "yes"
|
|
65773
|
-
}), (
|
|
65773
|
+
}), (path10) => mapError2(readString(path10), (error4) => invalidValue(p(error4))));
|
|
65774
65774
|
var filterMap8 = /* @__PURE__ */ dual(3, (self, f, message) => mapEffect8(self, (a) => match2(f(a), {
|
|
65775
65775
|
onNone: () => left2(invalidValue(p(message))),
|
|
65776
65776
|
onSome: right2
|
|
@@ -67955,18 +67955,31 @@ var PathNumberIsNaNError = class extends Data_exports.TaggedError(
|
|
|
67955
67955
|
var Lesson = class {
|
|
67956
67956
|
num;
|
|
67957
67957
|
name;
|
|
67958
|
-
sectionName;
|
|
67959
|
-
root;
|
|
67960
67958
|
path;
|
|
67959
|
+
root;
|
|
67960
|
+
sectionNum;
|
|
67961
|
+
sectionName;
|
|
67962
|
+
sectionPath;
|
|
67961
67963
|
constructor(opts) {
|
|
67962
|
-
this.num = opts.
|
|
67963
|
-
this.name = opts.
|
|
67964
|
-
this.path = opts.
|
|
67964
|
+
this.num = opts.lessonNum;
|
|
67965
|
+
this.name = opts.lessonName;
|
|
67966
|
+
this.path = opts.lessonPath;
|
|
67967
|
+
this.sectionNum = opts.sectionNum;
|
|
67965
67968
|
this.sectionName = opts.sectionName;
|
|
67969
|
+
this.sectionPath = opts.sectionPath;
|
|
67966
67970
|
this.root = opts.root;
|
|
67967
67971
|
}
|
|
67972
|
+
isExplainer() {
|
|
67973
|
+
return this.subfolders().pipe(
|
|
67974
|
+
Effect_exports.map(
|
|
67975
|
+
Array_exports.some((subfolder) => {
|
|
67976
|
+
return subfolder.includes("explainer");
|
|
67977
|
+
})
|
|
67978
|
+
)
|
|
67979
|
+
);
|
|
67980
|
+
}
|
|
67968
67981
|
absolutePath() {
|
|
67969
|
-
return path4__namespace.resolve(this.root, this.
|
|
67982
|
+
return path4__namespace.resolve(this.root, this.sectionPath, this.path);
|
|
67970
67983
|
}
|
|
67971
67984
|
allFiles() {
|
|
67972
67985
|
const absolutePath = this.absolutePath();
|
|
@@ -68011,13 +68024,13 @@ var Lesson = class {
|
|
|
68011
68024
|
});
|
|
68012
68025
|
}
|
|
68013
68026
|
};
|
|
68014
|
-
var getNameAndNumberFromPath = (
|
|
68015
|
-
const numSection =
|
|
68027
|
+
var getNameAndNumberFromPath = (path10) => {
|
|
68028
|
+
const numSection = path10.split("-")[0];
|
|
68016
68029
|
if (typeof numSection === "undefined") {
|
|
68017
68030
|
return Effect_exports.fail(
|
|
68018
68031
|
new InvalidPathError({
|
|
68019
|
-
path:
|
|
68020
|
-
message: `Could not retrieve number from path: ${
|
|
68032
|
+
path: path10,
|
|
68033
|
+
message: `Could not retrieve number from path: ${path10}`
|
|
68021
68034
|
})
|
|
68022
68035
|
);
|
|
68023
68036
|
}
|
|
@@ -68025,18 +68038,18 @@ var getNameAndNumberFromPath = (path9) => {
|
|
|
68025
68038
|
if (Number.isNaN(num)) {
|
|
68026
68039
|
return Effect_exports.fail(
|
|
68027
68040
|
new PathNumberIsNaNError({
|
|
68028
|
-
path:
|
|
68041
|
+
path: path10,
|
|
68029
68042
|
numSection,
|
|
68030
|
-
message: `Could not retrieve number from path: ${
|
|
68043
|
+
message: `Could not retrieve number from path: ${path10}`
|
|
68031
68044
|
})
|
|
68032
68045
|
);
|
|
68033
68046
|
}
|
|
68034
|
-
const name =
|
|
68047
|
+
const name = path10.split("-").slice(1).join("-");
|
|
68035
68048
|
if (!name) {
|
|
68036
68049
|
return Effect_exports.fail(
|
|
68037
68050
|
new InvalidPathError({
|
|
68038
|
-
path:
|
|
68039
|
-
message: `Could not retrieve name from path: ${
|
|
68051
|
+
path: path10,
|
|
68052
|
+
message: `Could not retrieve name from path: ${path10}`
|
|
68040
68053
|
})
|
|
68041
68054
|
);
|
|
68042
68055
|
}
|
|
@@ -68045,12 +68058,12 @@ var getNameAndNumberFromPath = (path9) => {
|
|
|
68045
68058
|
num
|
|
68046
68059
|
});
|
|
68047
68060
|
};
|
|
68048
|
-
var parseSection = Effect_exports.fn("parseSection")(function* (
|
|
68049
|
-
const { name, num } = yield* getNameAndNumberFromPath(
|
|
68061
|
+
var parseSection = Effect_exports.fn("parseSection")(function* (path10) {
|
|
68062
|
+
const { name, num } = yield* getNameAndNumberFromPath(path10);
|
|
68050
68063
|
return {
|
|
68051
68064
|
name,
|
|
68052
68065
|
num,
|
|
68053
|
-
path:
|
|
68066
|
+
path: path10
|
|
68054
68067
|
};
|
|
68055
68068
|
});
|
|
68056
68069
|
var filterMeOut = Symbol("filterMeOut");
|
|
@@ -68064,12 +68077,15 @@ var LessonParserService = class extends Effect_exports.Service()(
|
|
|
68064
68077
|
const { name, num } = yield* getNameAndNumberFromPath(
|
|
68065
68078
|
opts.lessonPath
|
|
68066
68079
|
);
|
|
68080
|
+
const { name: sectionName, num: sectionNum } = yield* getNameAndNumberFromPath(opts.sectionPath);
|
|
68067
68081
|
return new Lesson({
|
|
68068
|
-
name,
|
|
68069
|
-
num,
|
|
68070
|
-
|
|
68071
|
-
|
|
68072
|
-
|
|
68082
|
+
lessonName: name,
|
|
68083
|
+
lessonNum: num,
|
|
68084
|
+
lessonPath: opts.lessonPath,
|
|
68085
|
+
sectionNum,
|
|
68086
|
+
sectionName,
|
|
68087
|
+
root: path4__namespace.resolve(opts.root),
|
|
68088
|
+
sectionPath: opts.sectionPath
|
|
68073
68089
|
});
|
|
68074
68090
|
}
|
|
68075
68091
|
);
|
|
@@ -68218,12 +68234,14 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
|
|
|
68218
68234
|
if (nextSubfolder) {
|
|
68219
68235
|
nextExerciseToRun = {
|
|
68220
68236
|
lessonNumber: foundLesson.num,
|
|
68237
|
+
lessonName: foundLesson.name,
|
|
68221
68238
|
subfolderIndex: subfolderIndex + 1,
|
|
68222
68239
|
subfolder: nextSubfolder
|
|
68223
68240
|
};
|
|
68224
68241
|
} else if (nextLesson) {
|
|
68225
68242
|
nextExerciseToRun = {
|
|
68226
68243
|
lessonNumber: nextLesson.num,
|
|
68244
|
+
lessonName: nextLesson.name,
|
|
68227
68245
|
subfolderIndex: 0,
|
|
68228
68246
|
subfolder: (yield* nextLesson.subfolders())[0]
|
|
68229
68247
|
};
|
|
@@ -68234,6 +68252,7 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
|
|
|
68234
68252
|
if (subfolderIndex > 0) {
|
|
68235
68253
|
previousExerciseToRun = {
|
|
68236
68254
|
lessonNumber: foundLesson.num,
|
|
68255
|
+
lessonName: foundLesson.name,
|
|
68237
68256
|
subfolderIndex: subfolderIndex - 1,
|
|
68238
68257
|
subfolder: subfolders[subfolderIndex - 1]
|
|
68239
68258
|
};
|
|
@@ -68242,6 +68261,7 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
|
|
|
68242
68261
|
const previousLessonLastSubfolderIndex = previousLessonSubfolders.length - 1;
|
|
68243
68262
|
previousExerciseToRun = {
|
|
68244
68263
|
lessonNumber: previousLesson.num,
|
|
68264
|
+
lessonName: previousLesson.name,
|
|
68245
68265
|
subfolderIndex: previousLessonLastSubfolderIndex,
|
|
68246
68266
|
subfolder: previousLessonSubfolders[previousLessonLastSubfolderIndex]
|
|
68247
68267
|
};
|
|
@@ -68269,14 +68289,7 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
|
|
|
68269
68289
|
util.styleText("dim", " Press h + enter for more shortcuts\n")
|
|
68270
68290
|
);
|
|
68271
68291
|
if (readmeFile) {
|
|
68272
|
-
yield*
|
|
68273
|
-
`${util.styleText([], "Instructions:")}
|
|
68274
|
-
${util.styleText(
|
|
68275
|
-
"dim",
|
|
68276
|
-
readmeFile
|
|
68277
|
-
)}
|
|
68278
|
-
`
|
|
68279
|
-
);
|
|
68292
|
+
yield* logReadmeFile({ readmeFile });
|
|
68280
68293
|
}
|
|
68281
68294
|
const command2 = Command_exports.make(
|
|
68282
68295
|
"pnpm",
|
|
@@ -68350,26 +68363,38 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
|
|
|
68350
68363
|
cwd
|
|
68351
68364
|
});
|
|
68352
68365
|
}
|
|
68366
|
+
if (foundLesson.isExplainer() && readmeFile) {
|
|
68367
|
+
yield* logReadmeFile({ readmeFile });
|
|
68368
|
+
}
|
|
68369
|
+
const lessonNoun = foundLesson.isExplainer() ? {
|
|
68370
|
+
successMessage: `Explainer executed! Once you've read the readme and understand the code, you can go to the next exercise.`,
|
|
68371
|
+
failureMessage: `Looks like the explainer errored! Want to try again?`,
|
|
68372
|
+
lowercase: "explainer"
|
|
68373
|
+
} : {
|
|
68374
|
+
successMessage: "Exercise complete! What's next?",
|
|
68375
|
+
failureMessage: `Looks like the exercise errored! Want to try again?`,
|
|
68376
|
+
lowercase: "exercise"
|
|
68377
|
+
};
|
|
68353
68378
|
const { choice: choice6 } = yield* runPrompt(
|
|
68354
68379
|
() => (0, import_prompts.default)([
|
|
68355
68380
|
{
|
|
68356
68381
|
type: "select",
|
|
68357
68382
|
name: "choice",
|
|
68358
|
-
message: processOutcome === "exit" ?
|
|
68383
|
+
message: processOutcome === "exit" ? lessonNoun.successMessage : lessonNoun.failureMessage,
|
|
68359
68384
|
choices: [
|
|
68360
68385
|
{
|
|
68361
|
-
title: processOutcome === "failed" ?
|
|
68386
|
+
title: processOutcome === "failed" ? `\u{1F504} Run the ${lessonNoun.lowercase} again` : `\u{1F504} Try the ${lessonNoun.lowercase} again`,
|
|
68362
68387
|
value: "run-again"
|
|
68363
68388
|
},
|
|
68364
68389
|
...nextExerciseToRun ? [
|
|
68365
68390
|
{
|
|
68366
|
-
title: `\u27A1\uFE0F Run the next exercise: ${nextExerciseToRun?.lessonNumber} ${nextExerciseToRun?.subfolder}`,
|
|
68391
|
+
title: `\u27A1\uFE0F Run the next exercise: ${nextExerciseToRun?.lessonNumber}-${nextExerciseToRun?.lessonName} ${nextExerciseToRun?.subfolder}`,
|
|
68367
68392
|
value: "next-exercise"
|
|
68368
68393
|
}
|
|
68369
68394
|
] : [],
|
|
68370
68395
|
...previousExerciseToRun ? [
|
|
68371
68396
|
{
|
|
68372
|
-
title: `\u2B05\uFE0F Run the previous exercise: ${previousExerciseToRun?.lessonNumber} ${previousExerciseToRun?.subfolder}`,
|
|
68397
|
+
title: `\u2B05\uFE0F Run the previous exercise: ${previousExerciseToRun?.lessonNumber}-${previousExerciseToRun?.lessonName} ${previousExerciseToRun?.subfolder}`,
|
|
68373
68398
|
value: "previous-exercise"
|
|
68374
68399
|
}
|
|
68375
68400
|
] : [],
|
|
@@ -68422,6 +68447,18 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
|
|
|
68422
68447
|
});
|
|
68423
68448
|
}
|
|
68424
68449
|
});
|
|
68450
|
+
var logReadmeFile = Effect_exports.fn("logReadmeFile")(
|
|
68451
|
+
function* (opts) {
|
|
68452
|
+
yield* Console_exports.log(
|
|
68453
|
+
`${util.styleText([], "Instructions:")}
|
|
68454
|
+
${util.styleText(
|
|
68455
|
+
"dim",
|
|
68456
|
+
opts.readmeFile
|
|
68457
|
+
)}
|
|
68458
|
+
`
|
|
68459
|
+
);
|
|
68460
|
+
}
|
|
68461
|
+
);
|
|
68425
68462
|
var chooseLessonAndRunIt = (opts) => Effect_exports.gen(function* () {
|
|
68426
68463
|
const lessonService = yield* LessonParserService;
|
|
68427
68464
|
const lessons = yield* lessonService.getLessonsFromRepo(
|
|
@@ -68579,14 +68616,7 @@ var runLessonSimple = (opts) => Effect_exports.gen(function* () {
|
|
|
68579
68616
|
subfolder
|
|
68580
68617
|
});
|
|
68581
68618
|
if (readmeFile) {
|
|
68582
|
-
yield*
|
|
68583
|
-
`${util.styleText([], "Instructions:")}
|
|
68584
|
-
${util.styleText(
|
|
68585
|
-
"dim",
|
|
68586
|
-
readmeFile
|
|
68587
|
-
)}
|
|
68588
|
-
`
|
|
68589
|
-
);
|
|
68619
|
+
yield* logReadmeFile({ readmeFile });
|
|
68590
68620
|
}
|
|
68591
68621
|
yield* Console_exports.log(
|
|
68592
68622
|
util.styleText("bold", `Running ${lesson} ${subfolder}...`)
|
|
@@ -68595,10 +68625,13 @@ var runLessonSimple = (opts) => Effect_exports.gen(function* () {
|
|
|
68595
68625
|
stdio: "inherit",
|
|
68596
68626
|
cwd
|
|
68597
68627
|
});
|
|
68628
|
+
if (foundLesson.isExplainer() && readmeFile) {
|
|
68629
|
+
yield* logReadmeFile({ readmeFile });
|
|
68630
|
+
}
|
|
68598
68631
|
});
|
|
68599
68632
|
var notFound2 = Symbol("notFound");
|
|
68600
|
-
var getNumberFromPathSegment = (
|
|
68601
|
-
const numberSegment =
|
|
68633
|
+
var getNumberFromPathSegment = (path10) => {
|
|
68634
|
+
const numberSegment = path10.split("-")[0];
|
|
68602
68635
|
return Number.isNaN(Number(numberSegment)) ? notFound2 : Number(numberSegment);
|
|
68603
68636
|
};
|
|
68604
68637
|
var startsWithNumber = (segment) => {
|
|
@@ -68749,13 +68782,13 @@ var createErrorTracker = () => {
|
|
|
68749
68782
|
const groupedErrors = {};
|
|
68750
68783
|
return {
|
|
68751
68784
|
addError: (lesson, error4) => {
|
|
68752
|
-
if (!groupedErrors[lesson.
|
|
68753
|
-
groupedErrors[lesson.
|
|
68785
|
+
if (!groupedErrors[lesson.sectionPath]) {
|
|
68786
|
+
groupedErrors[lesson.sectionPath] = {};
|
|
68754
68787
|
}
|
|
68755
|
-
if (!groupedErrors[lesson.
|
|
68756
|
-
groupedErrors[lesson.
|
|
68788
|
+
if (!groupedErrors[lesson.sectionPath][lesson.path]) {
|
|
68789
|
+
groupedErrors[lesson.sectionPath][lesson.path] = [];
|
|
68757
68790
|
}
|
|
68758
|
-
groupedErrors[lesson.
|
|
68791
|
+
groupedErrors[lesson.sectionPath][lesson.path].push(error4);
|
|
68759
68792
|
},
|
|
68760
68793
|
log: Effect_exports.gen(function* () {
|
|
68761
68794
|
for (const [section, exercises] of Object.entries(
|
|
@@ -68842,8 +68875,15 @@ var lint = Command_exports2.make(
|
|
|
68842
68875
|
);
|
|
68843
68876
|
continue;
|
|
68844
68877
|
}
|
|
68845
|
-
|
|
68846
|
-
|
|
68878
|
+
if (readmeContent.includes("`pnpm run exercise ")) {
|
|
68879
|
+
errorTracker.addError(
|
|
68880
|
+
lesson,
|
|
68881
|
+
"readme.md file contains a pnpm run exercise command. Please remove it."
|
|
68882
|
+
);
|
|
68883
|
+
continue;
|
|
68884
|
+
}
|
|
68885
|
+
const absoluteLinks = readmeContent.match(/\[[^\]]+\]\(\/[^)]+\)/gm) ?? [];
|
|
68886
|
+
for (const link3 of absoluteLinks) {
|
|
68847
68887
|
const splitResult = link3.split("](");
|
|
68848
68888
|
const url2 = splitResult[1]?.slice(1, -1);
|
|
68849
68889
|
if (!url2) continue;
|
|
@@ -68853,7 +68893,26 @@ var lint = Command_exports2.make(
|
|
|
68853
68893
|
if (!linkExists) {
|
|
68854
68894
|
errorTracker.addError(
|
|
68855
68895
|
lesson,
|
|
68856
|
-
`Broken link in readme.md: ${url2}`
|
|
68896
|
+
`Broken absolute link in readme.md: ${url2}`
|
|
68897
|
+
);
|
|
68898
|
+
}
|
|
68899
|
+
}
|
|
68900
|
+
const relativeLinks = readmeContent.match(/\[[^\]]+\]\(\.\/[^)]+\)/gm) ?? [];
|
|
68901
|
+
for (const link3 of relativeLinks) {
|
|
68902
|
+
const splitResult = link3.split("](");
|
|
68903
|
+
const url2 = splitResult[1]?.slice(0, -1);
|
|
68904
|
+
if (!url2) continue;
|
|
68905
|
+
const linkExists = yield* existsCache.get(
|
|
68906
|
+
path4__namespace.resolve(
|
|
68907
|
+
lesson.absolutePath(),
|
|
68908
|
+
folderForReadme,
|
|
68909
|
+
url2
|
|
68910
|
+
)
|
|
68911
|
+
);
|
|
68912
|
+
if (!linkExists) {
|
|
68913
|
+
errorTracker.addError(
|
|
68914
|
+
lesson,
|
|
68915
|
+
`Broken relative link in readme.md: ${url2}`
|
|
68857
68916
|
);
|
|
68858
68917
|
}
|
|
68859
68918
|
}
|
|
@@ -68905,6 +68964,77 @@ var lint = Command_exports2.make(
|
|
|
68905
68964
|
"Lint the repository to ensure it is formatted correctly"
|
|
68906
68965
|
)
|
|
68907
68966
|
);
|
|
68967
|
+
var rename4 = Command_exports2.make(
|
|
68968
|
+
"rename",
|
|
68969
|
+
{
|
|
68970
|
+
root: rootOption
|
|
68971
|
+
},
|
|
68972
|
+
Effect_exports.fn("rename")(
|
|
68973
|
+
function* ({ root }) {
|
|
68974
|
+
const lessonParser = yield* LessonParserService;
|
|
68975
|
+
const fs = yield* FileSystem_exports.FileSystem;
|
|
68976
|
+
const lessons = yield* lessonParser.getLessonsFromRepo(
|
|
68977
|
+
root
|
|
68978
|
+
);
|
|
68979
|
+
const sections = /* @__PURE__ */ new Set();
|
|
68980
|
+
for (const lesson of lessons) {
|
|
68981
|
+
sections.add(lesson.sectionPath);
|
|
68982
|
+
}
|
|
68983
|
+
const sectionsAsArray = Array.from(sections).sort(
|
|
68984
|
+
(a, b) => a.localeCompare(b)
|
|
68985
|
+
);
|
|
68986
|
+
let totalLessonsRenamed = 0;
|
|
68987
|
+
for (const section of sectionsAsArray) {
|
|
68988
|
+
const lessonsInSection = lessons.filter((lesson) => lesson.sectionPath === section).sort((a, b) => a.num - b.num);
|
|
68989
|
+
const fullSectionPath = path4__namespace.resolve(root, section);
|
|
68990
|
+
yield* Effect_exports.forEach(
|
|
68991
|
+
lessonsInSection,
|
|
68992
|
+
(lesson, index) => {
|
|
68993
|
+
return Effect_exports.gen(function* () {
|
|
68994
|
+
const newLessonNum = (index + 1).toString().padStart(2, "0");
|
|
68995
|
+
const sectionNum = lesson.sectionNum.toString().padStart(2, "0");
|
|
68996
|
+
const newLessonDirname = `${sectionNum}.${newLessonNum}-${lesson.name}`;
|
|
68997
|
+
const newLessonPath = path4__namespace.join(
|
|
68998
|
+
fullSectionPath,
|
|
68999
|
+
newLessonDirname
|
|
69000
|
+
);
|
|
69001
|
+
if (newLessonPath === lesson.absolutePath()) {
|
|
69002
|
+
return;
|
|
69003
|
+
}
|
|
69004
|
+
yield* fs.rename(
|
|
69005
|
+
lesson.absolutePath(),
|
|
69006
|
+
newLessonPath
|
|
69007
|
+
);
|
|
69008
|
+
totalLessonsRenamed++;
|
|
69009
|
+
});
|
|
69010
|
+
}
|
|
69011
|
+
);
|
|
69012
|
+
}
|
|
69013
|
+
yield* Console_exports.log(
|
|
69014
|
+
`Renamed ${totalLessonsRenamed} lessons`
|
|
69015
|
+
);
|
|
69016
|
+
},
|
|
69017
|
+
Effect_exports.catchTags({
|
|
69018
|
+
InvalidPathError: (error4) => {
|
|
69019
|
+
return Effect_exports.logError(
|
|
69020
|
+
`ParseError: [${error4.path}] ${error4.message}`
|
|
69021
|
+
);
|
|
69022
|
+
},
|
|
69023
|
+
PathNumberIsNaNError: (error4) => {
|
|
69024
|
+
return Effect_exports.logError(
|
|
69025
|
+
`ParseError: [${error4.path}] ${error4.message}`
|
|
69026
|
+
);
|
|
69027
|
+
}
|
|
69028
|
+
}),
|
|
69029
|
+
Effect_exports.catchAll((error4) => {
|
|
69030
|
+
return Effect_exports.logError(error4);
|
|
69031
|
+
})
|
|
69032
|
+
)
|
|
69033
|
+
).pipe(
|
|
69034
|
+
Command_exports2.withDescription(
|
|
69035
|
+
"Rename all the lessons in the repository to use proper 01-09 numbering"
|
|
69036
|
+
)
|
|
69037
|
+
);
|
|
68908
69038
|
|
|
68909
69039
|
// src/internal/internal.ts
|
|
68910
69040
|
var upgradePackages = Command_exports2.make(
|
|
@@ -68949,7 +69079,12 @@ var upgradePackages = Command_exports2.make(
|
|
|
68949
69079
|
Command_exports2.withDescription("Upgrade the AI SDK packages")
|
|
68950
69080
|
);
|
|
68951
69081
|
var internal = Command_exports2.make("internal").pipe(
|
|
68952
|
-
Command_exports2.withSubcommands([
|
|
69082
|
+
Command_exports2.withSubcommands([
|
|
69083
|
+
upgradePackages,
|
|
69084
|
+
updateCVM,
|
|
69085
|
+
lint,
|
|
69086
|
+
rename4
|
|
69087
|
+
]),
|
|
68953
69088
|
Command_exports2.withDescription("Internal commands for AI Hero")
|
|
68954
69089
|
);
|
|
68955
69090
|
|