ai-hero-cli 0.0.7 → 0.0.9
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.js → bin.cjs} +653 -475
- package/package.json +2 -2
package/{bin.js → bin.cjs}
RENAMED
|
@@ -1,13 +1,42 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var ChildProcess = require('child_process');
|
|
5
|
+
var Crypto = require('crypto');
|
|
6
|
+
var NFS = require('fs');
|
|
7
|
+
var OS = require('os');
|
|
8
|
+
var path4 = require('path');
|
|
9
|
+
var NodeUrl = require('url');
|
|
10
|
+
var readline = require('readline');
|
|
11
|
+
var readline2 = require('readline/promises');
|
|
12
|
+
var util = require('util');
|
|
13
|
+
|
|
14
|
+
function _interopNamespace(e) {
|
|
15
|
+
if (e && e.__esModule) return e;
|
|
16
|
+
var n = Object.create(null);
|
|
17
|
+
if (e) {
|
|
18
|
+
Object.keys(e).forEach(function (k) {
|
|
19
|
+
if (k !== 'default') {
|
|
20
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
21
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return e[k]; }
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
n.default = e;
|
|
29
|
+
return Object.freeze(n);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var ChildProcess__namespace = /*#__PURE__*/_interopNamespace(ChildProcess);
|
|
33
|
+
var Crypto__namespace = /*#__PURE__*/_interopNamespace(Crypto);
|
|
34
|
+
var NFS__namespace = /*#__PURE__*/_interopNamespace(NFS);
|
|
35
|
+
var OS__namespace = /*#__PURE__*/_interopNamespace(OS);
|
|
36
|
+
var path4__namespace = /*#__PURE__*/_interopNamespace(path4);
|
|
37
|
+
var NodeUrl__namespace = /*#__PURE__*/_interopNamespace(NodeUrl);
|
|
38
|
+
var readline__namespace = /*#__PURE__*/_interopNamespace(readline);
|
|
39
|
+
var readline2__namespace = /*#__PURE__*/_interopNamespace(readline2);
|
|
11
40
|
|
|
12
41
|
var __create = Object.create;
|
|
13
42
|
var __defProp = Object.defineProperty;
|
|
@@ -3859,8 +3888,8 @@ var require_compiler = __commonJS({
|
|
|
3859
3888
|
valueAssignments.push(fullPath);
|
|
3860
3889
|
}
|
|
3861
3890
|
}
|
|
3862
|
-
function pathAssigned(
|
|
3863
|
-
return assignedPaths.indexOf(
|
|
3891
|
+
function pathAssigned(path7) {
|
|
3892
|
+
return assignedPaths.indexOf(path7) !== -1;
|
|
3864
3893
|
}
|
|
3865
3894
|
function reduceValueNode(node) {
|
|
3866
3895
|
if (node.type === "Array") {
|
|
@@ -3884,20 +3913,20 @@ var require_compiler = __commonJS({
|
|
|
3884
3913
|
return obj;
|
|
3885
3914
|
}
|
|
3886
3915
|
function setPath(node) {
|
|
3887
|
-
var
|
|
3888
|
-
var quotedPath =
|
|
3916
|
+
var path7 = node.value;
|
|
3917
|
+
var quotedPath = path7.map(quoteDottedString).join(".");
|
|
3889
3918
|
var line4 = node.line;
|
|
3890
3919
|
var column3 = node.column;
|
|
3891
3920
|
if (pathAssigned(quotedPath)) {
|
|
3892
|
-
genError("Cannot redefine existing key '" +
|
|
3921
|
+
genError("Cannot redefine existing key '" + path7 + "'.", line4, column3);
|
|
3893
3922
|
}
|
|
3894
3923
|
assignedPaths.push(quotedPath);
|
|
3895
|
-
context7 = deepRef(data,
|
|
3896
|
-
currentPath =
|
|
3924
|
+
context7 = deepRef(data, path7, /* @__PURE__ */ Object.create(null), line4, column3);
|
|
3925
|
+
currentPath = path7;
|
|
3897
3926
|
}
|
|
3898
3927
|
function addTableArray(node) {
|
|
3899
|
-
var
|
|
3900
|
-
var quotedPath =
|
|
3928
|
+
var path7 = node.value;
|
|
3929
|
+
var quotedPath = path7.map(quoteDottedString).join(".");
|
|
3901
3930
|
var line4 = node.line;
|
|
3902
3931
|
var column3 = node.column;
|
|
3903
3932
|
if (!pathAssigned(quotedPath)) {
|
|
@@ -3907,14 +3936,14 @@ var require_compiler = __commonJS({
|
|
|
3907
3936
|
return p3.indexOf(quotedPath) !== 0;
|
|
3908
3937
|
});
|
|
3909
3938
|
assignedPaths.push(quotedPath);
|
|
3910
|
-
context7 = deepRef(data,
|
|
3939
|
+
context7 = deepRef(data, path7, [], line4, column3);
|
|
3911
3940
|
currentPath = quotedPath;
|
|
3912
3941
|
if (context7 instanceof Array) {
|
|
3913
3942
|
var newObj = /* @__PURE__ */ Object.create(null);
|
|
3914
3943
|
context7.push(newObj);
|
|
3915
3944
|
context7 = newObj;
|
|
3916
3945
|
} else {
|
|
3917
|
-
genError("Cannot redefine existing key '" +
|
|
3946
|
+
genError("Cannot redefine existing key '" + path7 + "'.", line4, column3);
|
|
3918
3947
|
}
|
|
3919
3948
|
}
|
|
3920
3949
|
function deepRef(start5, keys5, value5, line4, column3) {
|
|
@@ -4059,17 +4088,17 @@ var require_visit = __commonJS({
|
|
|
4059
4088
|
visit.BREAK = BREAK;
|
|
4060
4089
|
visit.SKIP = SKIP;
|
|
4061
4090
|
visit.REMOVE = REMOVE;
|
|
4062
|
-
function visit_(key, node, visitor,
|
|
4063
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
4091
|
+
function visit_(key, node, visitor, path7) {
|
|
4092
|
+
const ctrl = callVisitor(key, node, visitor, path7);
|
|
4064
4093
|
if (identity3.isNode(ctrl) || identity3.isPair(ctrl)) {
|
|
4065
|
-
replaceNode(key,
|
|
4066
|
-
return visit_(key, ctrl, visitor,
|
|
4094
|
+
replaceNode(key, path7, ctrl);
|
|
4095
|
+
return visit_(key, ctrl, visitor, path7);
|
|
4067
4096
|
}
|
|
4068
4097
|
if (typeof ctrl !== "symbol") {
|
|
4069
4098
|
if (identity3.isCollection(node)) {
|
|
4070
|
-
|
|
4099
|
+
path7 = Object.freeze(path7.concat(node));
|
|
4071
4100
|
for (let i = 0; i < node.items.length; ++i) {
|
|
4072
|
-
const ci = visit_(i, node.items[i], visitor,
|
|
4101
|
+
const ci = visit_(i, node.items[i], visitor, path7);
|
|
4073
4102
|
if (typeof ci === "number")
|
|
4074
4103
|
i = ci - 1;
|
|
4075
4104
|
else if (ci === BREAK)
|
|
@@ -4080,13 +4109,13 @@ var require_visit = __commonJS({
|
|
|
4080
4109
|
}
|
|
4081
4110
|
}
|
|
4082
4111
|
} else if (identity3.isPair(node)) {
|
|
4083
|
-
|
|
4084
|
-
const ck = visit_("key", node.key, visitor,
|
|
4112
|
+
path7 = Object.freeze(path7.concat(node));
|
|
4113
|
+
const ck = visit_("key", node.key, visitor, path7);
|
|
4085
4114
|
if (ck === BREAK)
|
|
4086
4115
|
return BREAK;
|
|
4087
4116
|
else if (ck === REMOVE)
|
|
4088
4117
|
node.key = null;
|
|
4089
|
-
const cv = visit_("value", node.value, visitor,
|
|
4118
|
+
const cv = visit_("value", node.value, visitor, path7);
|
|
4090
4119
|
if (cv === BREAK)
|
|
4091
4120
|
return BREAK;
|
|
4092
4121
|
else if (cv === REMOVE)
|
|
@@ -4107,17 +4136,17 @@ var require_visit = __commonJS({
|
|
|
4107
4136
|
visitAsync.BREAK = BREAK;
|
|
4108
4137
|
visitAsync.SKIP = SKIP;
|
|
4109
4138
|
visitAsync.REMOVE = REMOVE;
|
|
4110
|
-
async function visitAsync_(key, node, visitor,
|
|
4111
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
4139
|
+
async function visitAsync_(key, node, visitor, path7) {
|
|
4140
|
+
const ctrl = await callVisitor(key, node, visitor, path7);
|
|
4112
4141
|
if (identity3.isNode(ctrl) || identity3.isPair(ctrl)) {
|
|
4113
|
-
replaceNode(key,
|
|
4114
|
-
return visitAsync_(key, ctrl, visitor,
|
|
4142
|
+
replaceNode(key, path7, ctrl);
|
|
4143
|
+
return visitAsync_(key, ctrl, visitor, path7);
|
|
4115
4144
|
}
|
|
4116
4145
|
if (typeof ctrl !== "symbol") {
|
|
4117
4146
|
if (identity3.isCollection(node)) {
|
|
4118
|
-
|
|
4147
|
+
path7 = Object.freeze(path7.concat(node));
|
|
4119
4148
|
for (let i = 0; i < node.items.length; ++i) {
|
|
4120
|
-
const ci = await visitAsync_(i, node.items[i], visitor,
|
|
4149
|
+
const ci = await visitAsync_(i, node.items[i], visitor, path7);
|
|
4121
4150
|
if (typeof ci === "number")
|
|
4122
4151
|
i = ci - 1;
|
|
4123
4152
|
else if (ci === BREAK)
|
|
@@ -4128,13 +4157,13 @@ var require_visit = __commonJS({
|
|
|
4128
4157
|
}
|
|
4129
4158
|
}
|
|
4130
4159
|
} else if (identity3.isPair(node)) {
|
|
4131
|
-
|
|
4132
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
4160
|
+
path7 = Object.freeze(path7.concat(node));
|
|
4161
|
+
const ck = await visitAsync_("key", node.key, visitor, path7);
|
|
4133
4162
|
if (ck === BREAK)
|
|
4134
4163
|
return BREAK;
|
|
4135
4164
|
else if (ck === REMOVE)
|
|
4136
4165
|
node.key = null;
|
|
4137
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
4166
|
+
const cv = await visitAsync_("value", node.value, visitor, path7);
|
|
4138
4167
|
if (cv === BREAK)
|
|
4139
4168
|
return BREAK;
|
|
4140
4169
|
else if (cv === REMOVE)
|
|
@@ -4161,23 +4190,23 @@ var require_visit = __commonJS({
|
|
|
4161
4190
|
}
|
|
4162
4191
|
return visitor;
|
|
4163
4192
|
}
|
|
4164
|
-
function callVisitor(key, node, visitor,
|
|
4193
|
+
function callVisitor(key, node, visitor, path7) {
|
|
4165
4194
|
if (typeof visitor === "function")
|
|
4166
|
-
return visitor(key, node,
|
|
4195
|
+
return visitor(key, node, path7);
|
|
4167
4196
|
if (identity3.isMap(node))
|
|
4168
|
-
return visitor.Map?.(key, node,
|
|
4197
|
+
return visitor.Map?.(key, node, path7);
|
|
4169
4198
|
if (identity3.isSeq(node))
|
|
4170
|
-
return visitor.Seq?.(key, node,
|
|
4199
|
+
return visitor.Seq?.(key, node, path7);
|
|
4171
4200
|
if (identity3.isPair(node))
|
|
4172
|
-
return visitor.Pair?.(key, node,
|
|
4201
|
+
return visitor.Pair?.(key, node, path7);
|
|
4173
4202
|
if (identity3.isScalar(node))
|
|
4174
|
-
return visitor.Scalar?.(key, node,
|
|
4203
|
+
return visitor.Scalar?.(key, node, path7);
|
|
4175
4204
|
if (identity3.isAlias(node))
|
|
4176
|
-
return visitor.Alias?.(key, node,
|
|
4205
|
+
return visitor.Alias?.(key, node, path7);
|
|
4177
4206
|
return void 0;
|
|
4178
4207
|
}
|
|
4179
|
-
function replaceNode(key,
|
|
4180
|
-
const parent =
|
|
4208
|
+
function replaceNode(key, path7, node) {
|
|
4209
|
+
const parent = path7[path7.length - 1];
|
|
4181
4210
|
if (identity3.isCollection(parent)) {
|
|
4182
4211
|
parent.items[key] = node;
|
|
4183
4212
|
} else if (identity3.isPair(parent)) {
|
|
@@ -4776,10 +4805,10 @@ var require_Collection = __commonJS({
|
|
|
4776
4805
|
var createNode = require_createNode();
|
|
4777
4806
|
var identity3 = require_identity();
|
|
4778
4807
|
var Node = require_Node();
|
|
4779
|
-
function collectionFromPath(schema,
|
|
4808
|
+
function collectionFromPath(schema, path7, value5) {
|
|
4780
4809
|
let v = value5;
|
|
4781
|
-
for (let i =
|
|
4782
|
-
const k =
|
|
4810
|
+
for (let i = path7.length - 1; i >= 0; --i) {
|
|
4811
|
+
const k = path7[i];
|
|
4783
4812
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
4784
4813
|
const a = [];
|
|
4785
4814
|
a[k] = v;
|
|
@@ -4798,7 +4827,7 @@ var require_Collection = __commonJS({
|
|
|
4798
4827
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
4799
4828
|
});
|
|
4800
4829
|
}
|
|
4801
|
-
var isEmptyPath = (
|
|
4830
|
+
var isEmptyPath = (path7) => path7 == null || typeof path7 === "object" && !!path7[Symbol.iterator]().next().done;
|
|
4802
4831
|
var Collection = class extends Node.NodeBase {
|
|
4803
4832
|
constructor(type2, schema) {
|
|
4804
4833
|
super(type2);
|
|
@@ -4828,11 +4857,11 @@ var require_Collection = __commonJS({
|
|
|
4828
4857
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
4829
4858
|
* that already exists in the map.
|
|
4830
4859
|
*/
|
|
4831
|
-
addIn(
|
|
4832
|
-
if (isEmptyPath(
|
|
4860
|
+
addIn(path7, value5) {
|
|
4861
|
+
if (isEmptyPath(path7))
|
|
4833
4862
|
this.add(value5);
|
|
4834
4863
|
else {
|
|
4835
|
-
const [key, ...rest] =
|
|
4864
|
+
const [key, ...rest] = path7;
|
|
4836
4865
|
const node = this.get(key, true);
|
|
4837
4866
|
if (identity3.isCollection(node))
|
|
4838
4867
|
node.addIn(rest, value5);
|
|
@@ -4846,8 +4875,8 @@ var require_Collection = __commonJS({
|
|
|
4846
4875
|
* Removes a value from the collection.
|
|
4847
4876
|
* @returns `true` if the item was found and removed.
|
|
4848
4877
|
*/
|
|
4849
|
-
deleteIn(
|
|
4850
|
-
const [key, ...rest] =
|
|
4878
|
+
deleteIn(path7) {
|
|
4879
|
+
const [key, ...rest] = path7;
|
|
4851
4880
|
if (rest.length === 0)
|
|
4852
4881
|
return this.delete(key);
|
|
4853
4882
|
const node = this.get(key, true);
|
|
@@ -4861,8 +4890,8 @@ var require_Collection = __commonJS({
|
|
|
4861
4890
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
4862
4891
|
* `true` (collections are always returned intact).
|
|
4863
4892
|
*/
|
|
4864
|
-
getIn(
|
|
4865
|
-
const [key, ...rest] =
|
|
4893
|
+
getIn(path7, keepScalar) {
|
|
4894
|
+
const [key, ...rest] = path7;
|
|
4866
4895
|
const node = this.get(key, true);
|
|
4867
4896
|
if (rest.length === 0)
|
|
4868
4897
|
return !keepScalar && identity3.isScalar(node) ? node.value : node;
|
|
@@ -4880,8 +4909,8 @@ var require_Collection = __commonJS({
|
|
|
4880
4909
|
/**
|
|
4881
4910
|
* Checks if the collection includes a value with the key `key`.
|
|
4882
4911
|
*/
|
|
4883
|
-
hasIn(
|
|
4884
|
-
const [key, ...rest] =
|
|
4912
|
+
hasIn(path7) {
|
|
4913
|
+
const [key, ...rest] = path7;
|
|
4885
4914
|
if (rest.length === 0)
|
|
4886
4915
|
return this.has(key);
|
|
4887
4916
|
const node = this.get(key, true);
|
|
@@ -4891,8 +4920,8 @@ var require_Collection = __commonJS({
|
|
|
4891
4920
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
4892
4921
|
* boolean to add/remove the item from the set.
|
|
4893
4922
|
*/
|
|
4894
|
-
setIn(
|
|
4895
|
-
const [key, ...rest] =
|
|
4923
|
+
setIn(path7, value5) {
|
|
4924
|
+
const [key, ...rest] = path7;
|
|
4896
4925
|
if (rest.length === 0) {
|
|
4897
4926
|
this.set(key, value5);
|
|
4898
4927
|
} else {
|
|
@@ -7361,9 +7390,9 @@ var require_Document = __commonJS({
|
|
|
7361
7390
|
this.contents.add(value5);
|
|
7362
7391
|
}
|
|
7363
7392
|
/** Adds a value to the document. */
|
|
7364
|
-
addIn(
|
|
7393
|
+
addIn(path7, value5) {
|
|
7365
7394
|
if (assertCollection(this.contents))
|
|
7366
|
-
this.contents.addIn(
|
|
7395
|
+
this.contents.addIn(path7, value5);
|
|
7367
7396
|
}
|
|
7368
7397
|
/**
|
|
7369
7398
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -7438,14 +7467,14 @@ var require_Document = __commonJS({
|
|
|
7438
7467
|
* Removes a value from the document.
|
|
7439
7468
|
* @returns `true` if the item was found and removed.
|
|
7440
7469
|
*/
|
|
7441
|
-
deleteIn(
|
|
7442
|
-
if (Collection.isEmptyPath(
|
|
7470
|
+
deleteIn(path7) {
|
|
7471
|
+
if (Collection.isEmptyPath(path7)) {
|
|
7443
7472
|
if (this.contents == null)
|
|
7444
7473
|
return false;
|
|
7445
7474
|
this.contents = null;
|
|
7446
7475
|
return true;
|
|
7447
7476
|
}
|
|
7448
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
7477
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path7) : false;
|
|
7449
7478
|
}
|
|
7450
7479
|
/**
|
|
7451
7480
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -7460,10 +7489,10 @@ var require_Document = __commonJS({
|
|
|
7460
7489
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
7461
7490
|
* `true` (collections are always returned intact).
|
|
7462
7491
|
*/
|
|
7463
|
-
getIn(
|
|
7464
|
-
if (Collection.isEmptyPath(
|
|
7492
|
+
getIn(path7, keepScalar) {
|
|
7493
|
+
if (Collection.isEmptyPath(path7))
|
|
7465
7494
|
return !keepScalar && identity3.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
7466
|
-
return identity3.isCollection(this.contents) ? this.contents.getIn(
|
|
7495
|
+
return identity3.isCollection(this.contents) ? this.contents.getIn(path7, keepScalar) : void 0;
|
|
7467
7496
|
}
|
|
7468
7497
|
/**
|
|
7469
7498
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -7474,10 +7503,10 @@ var require_Document = __commonJS({
|
|
|
7474
7503
|
/**
|
|
7475
7504
|
* Checks if the document includes a value at `path`.
|
|
7476
7505
|
*/
|
|
7477
|
-
hasIn(
|
|
7478
|
-
if (Collection.isEmptyPath(
|
|
7506
|
+
hasIn(path7) {
|
|
7507
|
+
if (Collection.isEmptyPath(path7))
|
|
7479
7508
|
return this.contents !== void 0;
|
|
7480
|
-
return identity3.isCollection(this.contents) ? this.contents.hasIn(
|
|
7509
|
+
return identity3.isCollection(this.contents) ? this.contents.hasIn(path7) : false;
|
|
7481
7510
|
}
|
|
7482
7511
|
/**
|
|
7483
7512
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -7494,13 +7523,13 @@ var require_Document = __commonJS({
|
|
|
7494
7523
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
7495
7524
|
* boolean to add/remove the item from the set.
|
|
7496
7525
|
*/
|
|
7497
|
-
setIn(
|
|
7498
|
-
if (Collection.isEmptyPath(
|
|
7526
|
+
setIn(path7, value5) {
|
|
7527
|
+
if (Collection.isEmptyPath(path7)) {
|
|
7499
7528
|
this.contents = value5;
|
|
7500
7529
|
} else if (this.contents == null) {
|
|
7501
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
7530
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path7), value5);
|
|
7502
7531
|
} else if (assertCollection(this.contents)) {
|
|
7503
|
-
this.contents.setIn(
|
|
7532
|
+
this.contents.setIn(path7, value5);
|
|
7504
7533
|
}
|
|
7505
7534
|
}
|
|
7506
7535
|
/**
|
|
@@ -7880,10 +7909,10 @@ var require_resolve_block_map = __commonJS({
|
|
|
7880
7909
|
let offset = bm.offset;
|
|
7881
7910
|
let commentEnd = null;
|
|
7882
7911
|
for (const collItem of bm.items) {
|
|
7883
|
-
const { start: start5, key, sep:
|
|
7912
|
+
const { start: start5, key, sep: sep3, value: value5 } = collItem;
|
|
7884
7913
|
const keyProps = resolveProps.resolveProps(start5, {
|
|
7885
7914
|
indicator: "explicit-key-ind",
|
|
7886
|
-
next: key ??
|
|
7915
|
+
next: key ?? sep3?.[0],
|
|
7887
7916
|
offset,
|
|
7888
7917
|
onError: onError4,
|
|
7889
7918
|
parentIndent: bm.indent,
|
|
@@ -7897,7 +7926,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
7897
7926
|
else if ("indent" in key && key.indent !== bm.indent)
|
|
7898
7927
|
onError4(offset, "BAD_INDENT", startColMsg);
|
|
7899
7928
|
}
|
|
7900
|
-
if (!keyProps.anchor && !keyProps.tag && !
|
|
7929
|
+
if (!keyProps.anchor && !keyProps.tag && !sep3) {
|
|
7901
7930
|
commentEnd = keyProps.end;
|
|
7902
7931
|
if (keyProps.comment) {
|
|
7903
7932
|
if (map35.comment)
|
|
@@ -7921,7 +7950,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
7921
7950
|
ctx.atKey = false;
|
|
7922
7951
|
if (utilMapIncludes.mapIncludes(ctx, map35.items, keyNode))
|
|
7923
7952
|
onError4(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
|
|
7924
|
-
const valueProps = resolveProps.resolveProps(
|
|
7953
|
+
const valueProps = resolveProps.resolveProps(sep3 ?? [], {
|
|
7925
7954
|
indicator: "map-value-ind",
|
|
7926
7955
|
next: value5,
|
|
7927
7956
|
offset: keyNode.range[2],
|
|
@@ -7937,7 +7966,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
7937
7966
|
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
|
|
7938
7967
|
onError4(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
|
|
7939
7968
|
}
|
|
7940
|
-
const valueNode = value5 ? composeNode(ctx, value5, valueProps, onError4) : composeEmptyNode(ctx, offset,
|
|
7969
|
+
const valueNode = value5 ? composeNode(ctx, value5, valueProps, onError4) : composeEmptyNode(ctx, offset, sep3, null, valueProps, onError4);
|
|
7941
7970
|
if (ctx.schema.compat)
|
|
7942
7971
|
utilFlowIndentCheck.flowIndentCheck(bm.indent, value5, onError4);
|
|
7943
7972
|
offset = valueNode.range[2];
|
|
@@ -8026,7 +8055,7 @@ var require_resolve_end = __commonJS({
|
|
|
8026
8055
|
let comment = "";
|
|
8027
8056
|
if (end5) {
|
|
8028
8057
|
let hasSpace = false;
|
|
8029
|
-
let
|
|
8058
|
+
let sep3 = "";
|
|
8030
8059
|
for (const token of end5) {
|
|
8031
8060
|
const { source, type: type2 } = token;
|
|
8032
8061
|
switch (type2) {
|
|
@@ -8040,13 +8069,13 @@ var require_resolve_end = __commonJS({
|
|
|
8040
8069
|
if (!comment)
|
|
8041
8070
|
comment = cb;
|
|
8042
8071
|
else
|
|
8043
|
-
comment +=
|
|
8044
|
-
|
|
8072
|
+
comment += sep3 + cb;
|
|
8073
|
+
sep3 = "";
|
|
8045
8074
|
break;
|
|
8046
8075
|
}
|
|
8047
8076
|
case "newline":
|
|
8048
8077
|
if (comment)
|
|
8049
|
-
|
|
8078
|
+
sep3 += source;
|
|
8050
8079
|
hasSpace = true;
|
|
8051
8080
|
break;
|
|
8052
8081
|
default:
|
|
@@ -8088,18 +8117,18 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
8088
8117
|
let offset = fc.offset + fc.start.source.length;
|
|
8089
8118
|
for (let i = 0; i < fc.items.length; ++i) {
|
|
8090
8119
|
const collItem = fc.items[i];
|
|
8091
|
-
const { start: start5, key, sep:
|
|
8120
|
+
const { start: start5, key, sep: sep3, value: value5 } = collItem;
|
|
8092
8121
|
const props = resolveProps.resolveProps(start5, {
|
|
8093
8122
|
flow: fcName,
|
|
8094
8123
|
indicator: "explicit-key-ind",
|
|
8095
|
-
next: key ??
|
|
8124
|
+
next: key ?? sep3?.[0],
|
|
8096
8125
|
offset,
|
|
8097
8126
|
onError: onError4,
|
|
8098
8127
|
parentIndent: fc.indent,
|
|
8099
8128
|
startOnNewline: false
|
|
8100
8129
|
});
|
|
8101
8130
|
if (!props.found) {
|
|
8102
|
-
if (!props.anchor && !props.tag && !
|
|
8131
|
+
if (!props.anchor && !props.tag && !sep3 && !value5) {
|
|
8103
8132
|
if (i === 0 && props.comma)
|
|
8104
8133
|
onError4(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
|
|
8105
8134
|
else if (i < fc.items.length - 1)
|
|
@@ -8153,8 +8182,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
8153
8182
|
}
|
|
8154
8183
|
}
|
|
8155
8184
|
}
|
|
8156
|
-
if (!isMap2 && !
|
|
8157
|
-
const valueNode = value5 ? composeNode(ctx, value5, props, onError4) : composeEmptyNode(ctx, props.end,
|
|
8185
|
+
if (!isMap2 && !sep3 && !props.found) {
|
|
8186
|
+
const valueNode = value5 ? composeNode(ctx, value5, props, onError4) : composeEmptyNode(ctx, props.end, sep3, null, props, onError4);
|
|
8158
8187
|
coll.items.push(valueNode);
|
|
8159
8188
|
offset = valueNode.range[2];
|
|
8160
8189
|
if (isBlock(value5))
|
|
@@ -8166,7 +8195,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
8166
8195
|
if (isBlock(key))
|
|
8167
8196
|
onError4(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
8168
8197
|
ctx.atKey = false;
|
|
8169
|
-
const valueProps = resolveProps.resolveProps(
|
|
8198
|
+
const valueProps = resolveProps.resolveProps(sep3 ?? [], {
|
|
8170
8199
|
flow: fcName,
|
|
8171
8200
|
indicator: "map-value-ind",
|
|
8172
8201
|
next: value5,
|
|
@@ -8177,8 +8206,8 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
8177
8206
|
});
|
|
8178
8207
|
if (valueProps.found) {
|
|
8179
8208
|
if (!isMap2 && !props.found && ctx.options.strict) {
|
|
8180
|
-
if (
|
|
8181
|
-
for (const st of
|
|
8209
|
+
if (sep3)
|
|
8210
|
+
for (const st of sep3) {
|
|
8182
8211
|
if (st === valueProps.found)
|
|
8183
8212
|
break;
|
|
8184
8213
|
if (st.type === "newline") {
|
|
@@ -8195,7 +8224,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
8195
8224
|
else
|
|
8196
8225
|
onError4(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
|
|
8197
8226
|
}
|
|
8198
|
-
const valueNode = value5 ? composeNode(ctx, value5, valueProps, onError4) : valueProps.found ? composeEmptyNode(ctx, valueProps.end,
|
|
8227
|
+
const valueNode = value5 ? composeNode(ctx, value5, valueProps, onError4) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep3, null, valueProps, onError4) : null;
|
|
8199
8228
|
if (valueNode) {
|
|
8200
8229
|
if (isBlock(value5))
|
|
8201
8230
|
onError4(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
|
|
@@ -8373,7 +8402,7 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
8373
8402
|
chompStart = i + 1;
|
|
8374
8403
|
}
|
|
8375
8404
|
let value5 = "";
|
|
8376
|
-
let
|
|
8405
|
+
let sep3 = "";
|
|
8377
8406
|
let prevMoreIndented = false;
|
|
8378
8407
|
for (let i = 0; i < contentStart; ++i)
|
|
8379
8408
|
value5 += lines4[i][0].slice(trimIndent) + "\n";
|
|
@@ -8390,24 +8419,24 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
8390
8419
|
indent3 = "";
|
|
8391
8420
|
}
|
|
8392
8421
|
if (type2 === Scalar.Scalar.BLOCK_LITERAL) {
|
|
8393
|
-
value5 +=
|
|
8394
|
-
|
|
8422
|
+
value5 += sep3 + indent3.slice(trimIndent) + content;
|
|
8423
|
+
sep3 = "\n";
|
|
8395
8424
|
} else if (indent3.length > trimIndent || content[0] === " ") {
|
|
8396
|
-
if (
|
|
8397
|
-
|
|
8398
|
-
else if (!prevMoreIndented &&
|
|
8399
|
-
|
|
8400
|
-
value5 +=
|
|
8401
|
-
|
|
8425
|
+
if (sep3 === " ")
|
|
8426
|
+
sep3 = "\n";
|
|
8427
|
+
else if (!prevMoreIndented && sep3 === "\n")
|
|
8428
|
+
sep3 = "\n\n";
|
|
8429
|
+
value5 += sep3 + indent3.slice(trimIndent) + content;
|
|
8430
|
+
sep3 = "\n";
|
|
8402
8431
|
prevMoreIndented = true;
|
|
8403
8432
|
} else if (content === "") {
|
|
8404
|
-
if (
|
|
8433
|
+
if (sep3 === "\n")
|
|
8405
8434
|
value5 += "\n";
|
|
8406
8435
|
else
|
|
8407
|
-
|
|
8436
|
+
sep3 = "\n";
|
|
8408
8437
|
} else {
|
|
8409
|
-
value5 +=
|
|
8410
|
-
|
|
8438
|
+
value5 += sep3 + content;
|
|
8439
|
+
sep3 = " ";
|
|
8411
8440
|
prevMoreIndented = false;
|
|
8412
8441
|
}
|
|
8413
8442
|
}
|
|
@@ -8588,25 +8617,25 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
8588
8617
|
if (!match17)
|
|
8589
8618
|
return source;
|
|
8590
8619
|
let res = match17[1];
|
|
8591
|
-
let
|
|
8620
|
+
let sep3 = " ";
|
|
8592
8621
|
let pos = first3.lastIndex;
|
|
8593
8622
|
line4.lastIndex = pos;
|
|
8594
8623
|
while (match17 = line4.exec(source)) {
|
|
8595
8624
|
if (match17[1] === "") {
|
|
8596
|
-
if (
|
|
8597
|
-
res +=
|
|
8625
|
+
if (sep3 === "\n")
|
|
8626
|
+
res += sep3;
|
|
8598
8627
|
else
|
|
8599
|
-
|
|
8628
|
+
sep3 = "\n";
|
|
8600
8629
|
} else {
|
|
8601
|
-
res +=
|
|
8602
|
-
|
|
8630
|
+
res += sep3 + match17[1];
|
|
8631
|
+
sep3 = " ";
|
|
8603
8632
|
}
|
|
8604
8633
|
pos = line4.lastIndex;
|
|
8605
8634
|
}
|
|
8606
8635
|
const last5 = /[ \t]*(.*)/sy;
|
|
8607
8636
|
last5.lastIndex = pos;
|
|
8608
8637
|
match17 = last5.exec(source);
|
|
8609
|
-
return res +
|
|
8638
|
+
return res + sep3 + (match17?.[1] ?? "");
|
|
8610
8639
|
}
|
|
8611
8640
|
function doubleQuotedValue(source, onError4) {
|
|
8612
8641
|
let res = "";
|
|
@@ -9401,14 +9430,14 @@ var require_cst_stringify = __commonJS({
|
|
|
9401
9430
|
}
|
|
9402
9431
|
}
|
|
9403
9432
|
}
|
|
9404
|
-
function stringifyItem({ start: start5, key, sep:
|
|
9433
|
+
function stringifyItem({ start: start5, key, sep: sep3, value: value5 }) {
|
|
9405
9434
|
let res = "";
|
|
9406
9435
|
for (const st of start5)
|
|
9407
9436
|
res += st.source;
|
|
9408
9437
|
if (key)
|
|
9409
9438
|
res += stringifyToken(key);
|
|
9410
|
-
if (
|
|
9411
|
-
for (const st of
|
|
9439
|
+
if (sep3)
|
|
9440
|
+
for (const st of sep3)
|
|
9412
9441
|
res += st.source;
|
|
9413
9442
|
if (value5)
|
|
9414
9443
|
res += stringifyToken(value5);
|
|
@@ -9432,9 +9461,9 @@ var require_cst_visit = __commonJS({
|
|
|
9432
9461
|
visit.BREAK = BREAK;
|
|
9433
9462
|
visit.SKIP = SKIP;
|
|
9434
9463
|
visit.REMOVE = REMOVE;
|
|
9435
|
-
visit.itemAtPath = (cst,
|
|
9464
|
+
visit.itemAtPath = (cst, path7) => {
|
|
9436
9465
|
let item = cst;
|
|
9437
|
-
for (const [field, index] of
|
|
9466
|
+
for (const [field, index] of path7) {
|
|
9438
9467
|
const tok = item?.[field];
|
|
9439
9468
|
if (tok && "items" in tok) {
|
|
9440
9469
|
item = tok.items[index];
|
|
@@ -9443,23 +9472,23 @@ var require_cst_visit = __commonJS({
|
|
|
9443
9472
|
}
|
|
9444
9473
|
return item;
|
|
9445
9474
|
};
|
|
9446
|
-
visit.parentCollection = (cst,
|
|
9447
|
-
const parent = visit.itemAtPath(cst,
|
|
9448
|
-
const field =
|
|
9475
|
+
visit.parentCollection = (cst, path7) => {
|
|
9476
|
+
const parent = visit.itemAtPath(cst, path7.slice(0, -1));
|
|
9477
|
+
const field = path7[path7.length - 1][0];
|
|
9449
9478
|
const coll = parent?.[field];
|
|
9450
9479
|
if (coll && "items" in coll)
|
|
9451
9480
|
return coll;
|
|
9452
9481
|
throw new Error("Parent collection not found");
|
|
9453
9482
|
};
|
|
9454
|
-
function _visit(
|
|
9455
|
-
let ctrl = visitor(item,
|
|
9483
|
+
function _visit(path7, item, visitor) {
|
|
9484
|
+
let ctrl = visitor(item, path7);
|
|
9456
9485
|
if (typeof ctrl === "symbol")
|
|
9457
9486
|
return ctrl;
|
|
9458
9487
|
for (const field of ["key", "value"]) {
|
|
9459
9488
|
const token = item[field];
|
|
9460
9489
|
if (token && "items" in token) {
|
|
9461
9490
|
for (let i = 0; i < token.items.length; ++i) {
|
|
9462
|
-
const ci = _visit(Object.freeze(
|
|
9491
|
+
const ci = _visit(Object.freeze(path7.concat([[field, i]])), token.items[i], visitor);
|
|
9463
9492
|
if (typeof ci === "number")
|
|
9464
9493
|
i = ci - 1;
|
|
9465
9494
|
else if (ci === BREAK)
|
|
@@ -9470,10 +9499,10 @@ var require_cst_visit = __commonJS({
|
|
|
9470
9499
|
}
|
|
9471
9500
|
}
|
|
9472
9501
|
if (typeof ctrl === "function" && field === "key")
|
|
9473
|
-
ctrl = ctrl(item,
|
|
9502
|
+
ctrl = ctrl(item, path7);
|
|
9474
9503
|
}
|
|
9475
9504
|
}
|
|
9476
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
9505
|
+
return typeof ctrl === "function" ? ctrl(item, path7) : ctrl;
|
|
9477
9506
|
}
|
|
9478
9507
|
exports.visit = visit;
|
|
9479
9508
|
}
|
|
@@ -10553,18 +10582,18 @@ var require_parser2 = __commonJS({
|
|
|
10553
10582
|
if (this.type === "map-value-ind") {
|
|
10554
10583
|
const prev = getPrevProps(this.peek(2));
|
|
10555
10584
|
const start5 = getFirstKeyStartProps(prev);
|
|
10556
|
-
let
|
|
10585
|
+
let sep3;
|
|
10557
10586
|
if (scalar.end) {
|
|
10558
|
-
|
|
10559
|
-
|
|
10587
|
+
sep3 = scalar.end;
|
|
10588
|
+
sep3.push(this.sourceToken);
|
|
10560
10589
|
delete scalar.end;
|
|
10561
10590
|
} else
|
|
10562
|
-
|
|
10591
|
+
sep3 = [this.sourceToken];
|
|
10563
10592
|
const map35 = {
|
|
10564
10593
|
type: "block-map",
|
|
10565
10594
|
offset: scalar.offset,
|
|
10566
10595
|
indent: scalar.indent,
|
|
10567
|
-
items: [{ start: start5, key: scalar, sep:
|
|
10596
|
+
items: [{ start: start5, key: scalar, sep: sep3 }]
|
|
10568
10597
|
};
|
|
10569
10598
|
this.onKeyLine = true;
|
|
10570
10599
|
this.stack[this.stack.length - 1] = map35;
|
|
@@ -10717,15 +10746,15 @@ var require_parser2 = __commonJS({
|
|
|
10717
10746
|
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
|
|
10718
10747
|
const start6 = getFirstKeyStartProps(it.start);
|
|
10719
10748
|
const key = it.key;
|
|
10720
|
-
const
|
|
10721
|
-
|
|
10749
|
+
const sep3 = it.sep;
|
|
10750
|
+
sep3.push(this.sourceToken);
|
|
10722
10751
|
delete it.key;
|
|
10723
10752
|
delete it.sep;
|
|
10724
10753
|
this.stack.push({
|
|
10725
10754
|
type: "block-map",
|
|
10726
10755
|
offset: this.offset,
|
|
10727
10756
|
indent: this.indent,
|
|
10728
|
-
items: [{ start: start6, key, sep:
|
|
10757
|
+
items: [{ start: start6, key, sep: sep3 }]
|
|
10729
10758
|
});
|
|
10730
10759
|
} else if (start5.length > 0) {
|
|
10731
10760
|
it.sep = it.sep.concat(start5, this.sourceToken);
|
|
@@ -10919,13 +10948,13 @@ var require_parser2 = __commonJS({
|
|
|
10919
10948
|
const prev = getPrevProps(parent);
|
|
10920
10949
|
const start5 = getFirstKeyStartProps(prev);
|
|
10921
10950
|
fixFlowSeqItems(fc);
|
|
10922
|
-
const
|
|
10923
|
-
|
|
10951
|
+
const sep3 = fc.end.splice(1, fc.end.length);
|
|
10952
|
+
sep3.push(this.sourceToken);
|
|
10924
10953
|
const map35 = {
|
|
10925
10954
|
type: "block-map",
|
|
10926
10955
|
offset: fc.offset,
|
|
10927
10956
|
indent: fc.indent,
|
|
10928
|
-
items: [{ start: start5, key: fc, sep:
|
|
10957
|
+
items: [{ start: start5, key: fc, sep: sep3 }]
|
|
10929
10958
|
};
|
|
10930
10959
|
this.onKeyLine = true;
|
|
10931
10960
|
this.stack[this.stack.length - 1] = map35;
|
|
@@ -13604,9 +13633,9 @@ var require_prompts = __commonJS({
|
|
|
13604
13633
|
$.date = (args2) => toPrompt("DatePrompt", args2);
|
|
13605
13634
|
$.confirm = (args2) => toPrompt("ConfirmPrompt", args2);
|
|
13606
13635
|
$.list = (args2) => {
|
|
13607
|
-
const
|
|
13636
|
+
const sep3 = args2.separator || ",";
|
|
13608
13637
|
return toPrompt("TextPrompt", args2, {
|
|
13609
|
-
onSubmit: (str) => str.split(
|
|
13638
|
+
onSubmit: (str) => str.split(sep3).map((s) => s.trim())
|
|
13610
13639
|
});
|
|
13611
13640
|
};
|
|
13612
13641
|
$.toggle = (args2) => toPrompt("TogglePrompt", args2);
|
|
@@ -15866,9 +15895,9 @@ var require_prompts2 = __commonJS({
|
|
|
15866
15895
|
$.date = (args2) => toPrompt("DatePrompt", args2);
|
|
15867
15896
|
$.confirm = (args2) => toPrompt("ConfirmPrompt", args2);
|
|
15868
15897
|
$.list = (args2) => {
|
|
15869
|
-
const
|
|
15898
|
+
const sep3 = args2.separator || ",";
|
|
15870
15899
|
return toPrompt("TextPrompt", args2, {
|
|
15871
|
-
onSubmit: (str) => str.split(
|
|
15900
|
+
onSubmit: (str) => str.split(sep3).map((s) => s.trim())
|
|
15872
15901
|
});
|
|
15873
15902
|
};
|
|
15874
15903
|
$.toggle = (args2) => toPrompt("TogglePrompt", args2);
|
|
@@ -16896,14 +16925,14 @@ var require_util3 = __commonJS({
|
|
|
16896
16925
|
}
|
|
16897
16926
|
const port2 = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
|
|
16898
16927
|
let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port2}`;
|
|
16899
|
-
let
|
|
16928
|
+
let path7 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
|
|
16900
16929
|
if (origin[origin.length - 1] === "/") {
|
|
16901
16930
|
origin = origin.slice(0, origin.length - 1);
|
|
16902
16931
|
}
|
|
16903
|
-
if (
|
|
16904
|
-
|
|
16932
|
+
if (path7 && path7[0] !== "/") {
|
|
16933
|
+
path7 = `/${path7}`;
|
|
16905
16934
|
}
|
|
16906
|
-
return new URL(`${origin}${
|
|
16935
|
+
return new URL(`${origin}${path7}`);
|
|
16907
16936
|
}
|
|
16908
16937
|
if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
|
|
16909
16938
|
throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
|
|
@@ -17449,9 +17478,9 @@ var require_diagnostics = __commonJS({
|
|
|
17449
17478
|
"undici:client:sendHeaders",
|
|
17450
17479
|
(evt) => {
|
|
17451
17480
|
const {
|
|
17452
|
-
request: { method, path:
|
|
17481
|
+
request: { method, path: path7, origin }
|
|
17453
17482
|
} = evt;
|
|
17454
|
-
debugLog("sending request to %s %s%s", method, origin,
|
|
17483
|
+
debugLog("sending request to %s %s%s", method, origin, path7);
|
|
17455
17484
|
}
|
|
17456
17485
|
);
|
|
17457
17486
|
}
|
|
@@ -17465,14 +17494,14 @@ var require_diagnostics = __commonJS({
|
|
|
17465
17494
|
"undici:request:headers",
|
|
17466
17495
|
(evt) => {
|
|
17467
17496
|
const {
|
|
17468
|
-
request: { method, path:
|
|
17497
|
+
request: { method, path: path7, origin },
|
|
17469
17498
|
response: { statusCode }
|
|
17470
17499
|
} = evt;
|
|
17471
17500
|
debugLog(
|
|
17472
17501
|
"received response to %s %s%s - HTTP %d",
|
|
17473
17502
|
method,
|
|
17474
17503
|
origin,
|
|
17475
|
-
|
|
17504
|
+
path7,
|
|
17476
17505
|
statusCode
|
|
17477
17506
|
);
|
|
17478
17507
|
}
|
|
@@ -17481,23 +17510,23 @@ var require_diagnostics = __commonJS({
|
|
|
17481
17510
|
"undici:request:trailers",
|
|
17482
17511
|
(evt) => {
|
|
17483
17512
|
const {
|
|
17484
|
-
request: { method, path:
|
|
17513
|
+
request: { method, path: path7, origin }
|
|
17485
17514
|
} = evt;
|
|
17486
|
-
debugLog("trailers received from %s %s%s", method, origin,
|
|
17515
|
+
debugLog("trailers received from %s %s%s", method, origin, path7);
|
|
17487
17516
|
}
|
|
17488
17517
|
);
|
|
17489
17518
|
diagnosticsChannel.subscribe(
|
|
17490
17519
|
"undici:request:error",
|
|
17491
17520
|
(evt) => {
|
|
17492
17521
|
const {
|
|
17493
|
-
request: { method, path:
|
|
17522
|
+
request: { method, path: path7, origin },
|
|
17494
17523
|
error: error4
|
|
17495
17524
|
} = evt;
|
|
17496
17525
|
debugLog(
|
|
17497
17526
|
"request to %s %s%s errored - %s",
|
|
17498
17527
|
method,
|
|
17499
17528
|
origin,
|
|
17500
|
-
|
|
17529
|
+
path7,
|
|
17501
17530
|
error4.message
|
|
17502
17531
|
);
|
|
17503
17532
|
}
|
|
@@ -17591,7 +17620,7 @@ var require_request = __commonJS({
|
|
|
17591
17620
|
var kHandler = Symbol("handler");
|
|
17592
17621
|
var Request = class {
|
|
17593
17622
|
constructor(origin, {
|
|
17594
|
-
path:
|
|
17623
|
+
path: path7,
|
|
17595
17624
|
method,
|
|
17596
17625
|
body,
|
|
17597
17626
|
headers,
|
|
@@ -17607,11 +17636,11 @@ var require_request = __commonJS({
|
|
|
17607
17636
|
throwOnError,
|
|
17608
17637
|
maxRedirections
|
|
17609
17638
|
}, handler) {
|
|
17610
|
-
if (typeof
|
|
17639
|
+
if (typeof path7 !== "string") {
|
|
17611
17640
|
throw new InvalidArgumentError("path must be a string");
|
|
17612
|
-
} else if (
|
|
17641
|
+
} else if (path7[0] !== "/" && !(path7.startsWith("http://") || path7.startsWith("https://")) && method !== "CONNECT") {
|
|
17613
17642
|
throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
|
|
17614
|
-
} else if (invalidPathRegex.test(
|
|
17643
|
+
} else if (invalidPathRegex.test(path7)) {
|
|
17615
17644
|
throw new InvalidArgumentError("invalid request path");
|
|
17616
17645
|
}
|
|
17617
17646
|
if (typeof method !== "string") {
|
|
@@ -17679,7 +17708,7 @@ var require_request = __commonJS({
|
|
|
17679
17708
|
this.completed = false;
|
|
17680
17709
|
this.aborted = false;
|
|
17681
17710
|
this.upgrade = upgrade || null;
|
|
17682
|
-
this.path = query ? serializePathWithQuery(
|
|
17711
|
+
this.path = query ? serializePathWithQuery(path7, query) : path7;
|
|
17683
17712
|
this.origin = origin;
|
|
17684
17713
|
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
|
|
17685
17714
|
this.blocking = blocking ?? this.method !== "HEAD";
|
|
@@ -22422,7 +22451,7 @@ var require_client_h1 = __commonJS({
|
|
|
22422
22451
|
return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
|
|
22423
22452
|
}
|
|
22424
22453
|
function writeH1(client, request2) {
|
|
22425
|
-
const { method, path:
|
|
22454
|
+
const { method, path: path7, host, upgrade, blocking, reset: reset2 } = request2;
|
|
22426
22455
|
let { body, headers, contentLength } = request2;
|
|
22427
22456
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
|
|
22428
22457
|
if (util.isFormDataLike(body)) {
|
|
@@ -22488,7 +22517,7 @@ var require_client_h1 = __commonJS({
|
|
|
22488
22517
|
if (blocking) {
|
|
22489
22518
|
socket[kBlocking] = true;
|
|
22490
22519
|
}
|
|
22491
|
-
let header = `${method} ${
|
|
22520
|
+
let header = `${method} ${path7} HTTP/1.1\r
|
|
22492
22521
|
`;
|
|
22493
22522
|
if (typeof host === "string") {
|
|
22494
22523
|
header += `host: ${host}\r
|
|
@@ -23044,7 +23073,7 @@ var require_client_h2 = __commonJS({
|
|
|
23044
23073
|
function writeH2(client, request2) {
|
|
23045
23074
|
const requestTimeout = request2.bodyTimeout ?? client[kBodyTimeout];
|
|
23046
23075
|
const session = client[kHTTP2Session];
|
|
23047
|
-
const { method, path:
|
|
23076
|
+
const { method, path: path7, host, upgrade, expectContinue, signal, headers: reqHeaders } = request2;
|
|
23048
23077
|
let { body } = request2;
|
|
23049
23078
|
if (upgrade) {
|
|
23050
23079
|
util.errorRequest(client, request2, new Error("Upgrade not supported for H2"));
|
|
@@ -23115,7 +23144,7 @@ var require_client_h2 = __commonJS({
|
|
|
23115
23144
|
stream4.setTimeout(requestTimeout);
|
|
23116
23145
|
return true;
|
|
23117
23146
|
}
|
|
23118
|
-
headers[HTTP2_HEADER_PATH] =
|
|
23147
|
+
headers[HTTP2_HEADER_PATH] = path7;
|
|
23119
23148
|
headers[HTTP2_HEADER_SCHEME] = "https";
|
|
23120
23149
|
const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
|
|
23121
23150
|
if (body && typeof body.read === "function") {
|
|
@@ -24554,10 +24583,10 @@ var require_proxy_agent = __commonJS({
|
|
|
24554
24583
|
};
|
|
24555
24584
|
const {
|
|
24556
24585
|
origin,
|
|
24557
|
-
path:
|
|
24586
|
+
path: path7 = "/",
|
|
24558
24587
|
headers = {}
|
|
24559
24588
|
} = opts;
|
|
24560
|
-
opts.path = origin +
|
|
24589
|
+
opts.path = origin + path7;
|
|
24561
24590
|
if (!("host" in headers) && !("Host" in headers)) {
|
|
24562
24591
|
const { host } = new URL2(origin);
|
|
24563
24592
|
headers.host = host;
|
|
@@ -26611,20 +26640,20 @@ var require_mock_utils = __commonJS({
|
|
|
26611
26640
|
}
|
|
26612
26641
|
return normalizedQp;
|
|
26613
26642
|
}
|
|
26614
|
-
function safeUrl(
|
|
26615
|
-
if (typeof
|
|
26616
|
-
return
|
|
26643
|
+
function safeUrl(path7) {
|
|
26644
|
+
if (typeof path7 !== "string") {
|
|
26645
|
+
return path7;
|
|
26617
26646
|
}
|
|
26618
|
-
const pathSegments =
|
|
26647
|
+
const pathSegments = path7.split("?", 3);
|
|
26619
26648
|
if (pathSegments.length !== 2) {
|
|
26620
|
-
return
|
|
26649
|
+
return path7;
|
|
26621
26650
|
}
|
|
26622
26651
|
const qp = new URLSearchParams(pathSegments.pop());
|
|
26623
26652
|
qp.sort();
|
|
26624
26653
|
return [...pathSegments, qp.toString()].join("?");
|
|
26625
26654
|
}
|
|
26626
|
-
function matchKey(mockDispatch2, { path:
|
|
26627
|
-
const pathMatch = matchValue(mockDispatch2.path,
|
|
26655
|
+
function matchKey(mockDispatch2, { path: path7, method, body, headers }) {
|
|
26656
|
+
const pathMatch = matchValue(mockDispatch2.path, path7);
|
|
26628
26657
|
const methodMatch = matchValue(mockDispatch2.method, method);
|
|
26629
26658
|
const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
|
|
26630
26659
|
const headersMatch = matchHeaders(mockDispatch2, headers);
|
|
@@ -26649,8 +26678,8 @@ var require_mock_utils = __commonJS({
|
|
|
26649
26678
|
const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
|
|
26650
26679
|
const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
|
|
26651
26680
|
const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
|
|
26652
|
-
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path:
|
|
26653
|
-
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(
|
|
26681
|
+
let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path7, ignoreTrailingSlash }) => {
|
|
26682
|
+
return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path7)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path7), resolvedPath);
|
|
26654
26683
|
});
|
|
26655
26684
|
if (matchedMockDispatches.length === 0) {
|
|
26656
26685
|
throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
|
|
@@ -26688,19 +26717,19 @@ var require_mock_utils = __commonJS({
|
|
|
26688
26717
|
mockDispatches.splice(index, 1);
|
|
26689
26718
|
}
|
|
26690
26719
|
}
|
|
26691
|
-
function removeTrailingSlash(
|
|
26692
|
-
while (
|
|
26693
|
-
|
|
26720
|
+
function removeTrailingSlash(path7) {
|
|
26721
|
+
while (path7.endsWith("/")) {
|
|
26722
|
+
path7 = path7.slice(0, -1);
|
|
26694
26723
|
}
|
|
26695
|
-
if (
|
|
26696
|
-
|
|
26724
|
+
if (path7.length === 0) {
|
|
26725
|
+
path7 = "/";
|
|
26697
26726
|
}
|
|
26698
|
-
return
|
|
26727
|
+
return path7;
|
|
26699
26728
|
}
|
|
26700
26729
|
function buildKey(opts) {
|
|
26701
|
-
const { path:
|
|
26730
|
+
const { path: path7, method, body, headers, query } = opts;
|
|
26702
26731
|
return {
|
|
26703
|
-
path:
|
|
26732
|
+
path: path7,
|
|
26704
26733
|
method,
|
|
26705
26734
|
body,
|
|
26706
26735
|
headers,
|
|
@@ -27333,7 +27362,7 @@ var require_mock_pool = __commonJS({
|
|
|
27333
27362
|
var require_pending_interceptors_formatter = __commonJS({
|
|
27334
27363
|
"node_modules/.pnpm/undici@7.13.0/node_modules/undici/lib/mock/pending-interceptors-formatter.js"(exports, module) {
|
|
27335
27364
|
var { Transform } = __require("stream");
|
|
27336
|
-
var { Console:
|
|
27365
|
+
var { Console: Console3 } = __require("console");
|
|
27337
27366
|
var PERSISTENT = process.versions.icu ? "\u2705" : "Y ";
|
|
27338
27367
|
var NOT_PERSISTENT = process.versions.icu ? "\u274C" : "N ";
|
|
27339
27368
|
module.exports = class PendingInterceptorsFormatter {
|
|
@@ -27343,7 +27372,7 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
27343
27372
|
cb(null, chunk4);
|
|
27344
27373
|
}
|
|
27345
27374
|
});
|
|
27346
|
-
this.logger = new
|
|
27375
|
+
this.logger = new Console3({
|
|
27347
27376
|
stdout: this.transform,
|
|
27348
27377
|
inspectOptions: {
|
|
27349
27378
|
colors: !disableColors && !process.env.CI
|
|
@@ -27352,10 +27381,10 @@ var require_pending_interceptors_formatter = __commonJS({
|
|
|
27352
27381
|
}
|
|
27353
27382
|
format(pendingInterceptors) {
|
|
27354
27383
|
const withPrettyHeaders = pendingInterceptors.map(
|
|
27355
|
-
({ method, path:
|
|
27384
|
+
({ method, path: path7, data: { statusCode }, persist, times: times2, timesInvoked, origin }) => ({
|
|
27356
27385
|
Method: method,
|
|
27357
27386
|
Origin: origin,
|
|
27358
|
-
Path:
|
|
27387
|
+
Path: path7,
|
|
27359
27388
|
"Status code": statusCode,
|
|
27360
27389
|
Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
|
|
27361
27390
|
Invocations: timesInvoked,
|
|
@@ -27434,9 +27463,9 @@ var require_mock_agent = __commonJS({
|
|
|
27434
27463
|
const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
|
|
27435
27464
|
const dispatchOpts = { ...opts };
|
|
27436
27465
|
if (acceptNonStandardSearchParameters && dispatchOpts.path) {
|
|
27437
|
-
const [
|
|
27466
|
+
const [path7, searchParams] = dispatchOpts.path.split("?");
|
|
27438
27467
|
const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
|
|
27439
|
-
dispatchOpts.path = `${
|
|
27468
|
+
dispatchOpts.path = `${path7}?${normalizedSearchParams}`;
|
|
27440
27469
|
}
|
|
27441
27470
|
return this[kAgent].dispatch(dispatchOpts, handler);
|
|
27442
27471
|
}
|
|
@@ -27774,12 +27803,12 @@ var require_snapshot_recorder = __commonJS({
|
|
|
27774
27803
|
* Loads snapshots from file
|
|
27775
27804
|
*/
|
|
27776
27805
|
async loadSnapshots(filePath) {
|
|
27777
|
-
const
|
|
27778
|
-
if (!
|
|
27806
|
+
const path7 = filePath || this.snapshotPath;
|
|
27807
|
+
if (!path7) {
|
|
27779
27808
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
27780
27809
|
}
|
|
27781
27810
|
try {
|
|
27782
|
-
const data = await readFile3(resolve4(
|
|
27811
|
+
const data = await readFile3(resolve4(path7), "utf8");
|
|
27783
27812
|
const parsed = JSON.parse(data);
|
|
27784
27813
|
if (Array.isArray(parsed)) {
|
|
27785
27814
|
this.snapshots.clear();
|
|
@@ -27795,7 +27824,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
27795
27824
|
this.snapshots.clear();
|
|
27796
27825
|
this.loaded = true;
|
|
27797
27826
|
} else {
|
|
27798
|
-
throw new UndiciError(`Failed to load snapshots from ${
|
|
27827
|
+
throw new UndiciError(`Failed to load snapshots from ${path7}`, { cause: error4 });
|
|
27799
27828
|
}
|
|
27800
27829
|
}
|
|
27801
27830
|
}
|
|
@@ -27803,11 +27832,11 @@ var require_snapshot_recorder = __commonJS({
|
|
|
27803
27832
|
* Saves snapshots to file
|
|
27804
27833
|
*/
|
|
27805
27834
|
async saveSnapshots(filePath) {
|
|
27806
|
-
const
|
|
27807
|
-
if (!
|
|
27835
|
+
const path7 = filePath || this.snapshotPath;
|
|
27836
|
+
if (!path7) {
|
|
27808
27837
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
27809
27838
|
}
|
|
27810
|
-
const resolvedPath = resolve4(
|
|
27839
|
+
const resolvedPath = resolve4(path7);
|
|
27811
27840
|
await mkdir2(dirname2(resolvedPath), { recursive: true });
|
|
27812
27841
|
const data = Array.from(this.snapshots.entries()).map(([hash2, snapshot]) => ({
|
|
27813
27842
|
hash: hash2,
|
|
@@ -28384,15 +28413,15 @@ var require_redirect_handler = __commonJS({
|
|
|
28384
28413
|
return;
|
|
28385
28414
|
}
|
|
28386
28415
|
const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
|
|
28387
|
-
const
|
|
28388
|
-
const redirectUrlString = `${origin}${
|
|
28416
|
+
const path7 = search ? `${pathname}${search}` : pathname;
|
|
28417
|
+
const redirectUrlString = `${origin}${path7}`;
|
|
28389
28418
|
for (const historyUrl of this.history) {
|
|
28390
28419
|
if (historyUrl.toString() === redirectUrlString) {
|
|
28391
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.`);
|
|
28392
28421
|
}
|
|
28393
28422
|
}
|
|
28394
28423
|
this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
|
|
28395
|
-
this.opts.path =
|
|
28424
|
+
this.opts.path = path7;
|
|
28396
28425
|
this.opts.origin = origin;
|
|
28397
28426
|
this.opts.query = null;
|
|
28398
28427
|
}
|
|
@@ -32320,7 +32349,7 @@ var require_fetch = __commonJS({
|
|
|
32320
32349
|
function handleFetchDone(response) {
|
|
32321
32350
|
finalizeAndReportTiming(response, "fetch");
|
|
32322
32351
|
}
|
|
32323
|
-
function
|
|
32352
|
+
function fetch2(input, init = void 0) {
|
|
32324
32353
|
webidl.argumentLengthCheck(arguments, 1, "globalThis.fetch");
|
|
32325
32354
|
let p3 = createDeferredPromise();
|
|
32326
32355
|
let requestObject;
|
|
@@ -33250,7 +33279,7 @@ var require_fetch = __commonJS({
|
|
|
33250
33279
|
}
|
|
33251
33280
|
}
|
|
33252
33281
|
module.exports = {
|
|
33253
|
-
fetch,
|
|
33282
|
+
fetch: fetch2,
|
|
33254
33283
|
Fetch,
|
|
33255
33284
|
fetching,
|
|
33256
33285
|
finalizeAndReportTiming
|
|
@@ -34016,9 +34045,9 @@ var require_util6 = __commonJS({
|
|
|
34016
34045
|
}
|
|
34017
34046
|
}
|
|
34018
34047
|
}
|
|
34019
|
-
function validateCookiePath(
|
|
34020
|
-
for (let i = 0; i <
|
|
34021
|
-
const code2 =
|
|
34048
|
+
function validateCookiePath(path7) {
|
|
34049
|
+
for (let i = 0; i < path7.length; ++i) {
|
|
34050
|
+
const code2 = path7.charCodeAt(i);
|
|
34022
34051
|
if (code2 < 32 || // exclude CTLs (0-31)
|
|
34023
34052
|
code2 === 127 || // DEL
|
|
34024
34053
|
code2 === 59) {
|
|
@@ -37075,11 +37104,11 @@ var require_undici = __commonJS({
|
|
|
37075
37104
|
if (typeof opts.path !== "string") {
|
|
37076
37105
|
throw new InvalidArgumentError("invalid opts.path");
|
|
37077
37106
|
}
|
|
37078
|
-
let
|
|
37107
|
+
let path7 = opts.path;
|
|
37079
37108
|
if (!opts.path.startsWith("/")) {
|
|
37080
|
-
|
|
37109
|
+
path7 = `/${path7}`;
|
|
37081
37110
|
}
|
|
37082
|
-
url2 = new URL(util.parseOrigin(url2).origin +
|
|
37111
|
+
url2 = new URL(util.parseOrigin(url2).origin + path7);
|
|
37083
37112
|
} else {
|
|
37084
37113
|
if (!opts) {
|
|
37085
37114
|
opts = typeof url2 === "object" ? url2 : {};
|
|
@@ -37101,7 +37130,7 @@ var require_undici = __commonJS({
|
|
|
37101
37130
|
module.exports.setGlobalDispatcher = setGlobalDispatcher;
|
|
37102
37131
|
module.exports.getGlobalDispatcher = getGlobalDispatcher;
|
|
37103
37132
|
var fetchImpl = require_fetch().fetch;
|
|
37104
|
-
module.exports.fetch = async function
|
|
37133
|
+
module.exports.fetch = async function fetch2(init, options3 = void 0) {
|
|
37105
37134
|
try {
|
|
37106
37135
|
return await fetchImpl(init, options3);
|
|
37107
37136
|
} catch (err) {
|
|
@@ -38647,7 +38676,7 @@ var dedupeWith = /* @__PURE__ */ dual(2, (self, isEquivalent) => {
|
|
|
38647
38676
|
return [];
|
|
38648
38677
|
});
|
|
38649
38678
|
var dedupe = (self) => dedupeWith(self, equivalence());
|
|
38650
|
-
var join = /* @__PURE__ */ dual(2, (self,
|
|
38679
|
+
var join = /* @__PURE__ */ dual(2, (self, sep3) => fromIterable2(self).join(sep3));
|
|
38651
38680
|
|
|
38652
38681
|
// node_modules/.pnpm/effect@3.17.7/node_modules/effect/dist/esm/Chunk.js
|
|
38653
38682
|
var TypeId4 = /* @__PURE__ */ Symbol.for("effect/Chunk");
|
|
@@ -43336,67 +43365,67 @@ var Or = (self, that) => {
|
|
|
43336
43365
|
});
|
|
43337
43366
|
return error4;
|
|
43338
43367
|
};
|
|
43339
|
-
var InvalidData = (
|
|
43368
|
+
var InvalidData = (path7, message, options3 = {
|
|
43340
43369
|
pathDelim: "."
|
|
43341
43370
|
}) => {
|
|
43342
43371
|
const error4 = Object.create(proto2);
|
|
43343
43372
|
error4._op = OP_INVALID_DATA;
|
|
43344
|
-
error4.path =
|
|
43373
|
+
error4.path = path7;
|
|
43345
43374
|
error4.message = message;
|
|
43346
43375
|
Object.defineProperty(error4, "toString", {
|
|
43347
43376
|
enumerable: false,
|
|
43348
43377
|
value() {
|
|
43349
|
-
const
|
|
43350
|
-
return `(Invalid data at ${
|
|
43378
|
+
const path8 = pipe(this.path, join(options3.pathDelim));
|
|
43379
|
+
return `(Invalid data at ${path8}: "${this.message}")`;
|
|
43351
43380
|
}
|
|
43352
43381
|
});
|
|
43353
43382
|
return error4;
|
|
43354
43383
|
};
|
|
43355
|
-
var MissingData = (
|
|
43384
|
+
var MissingData = (path7, message, options3 = {
|
|
43356
43385
|
pathDelim: "."
|
|
43357
43386
|
}) => {
|
|
43358
43387
|
const error4 = Object.create(proto2);
|
|
43359
43388
|
error4._op = OP_MISSING_DATA;
|
|
43360
|
-
error4.path =
|
|
43389
|
+
error4.path = path7;
|
|
43361
43390
|
error4.message = message;
|
|
43362
43391
|
Object.defineProperty(error4, "toString", {
|
|
43363
43392
|
enumerable: false,
|
|
43364
43393
|
value() {
|
|
43365
|
-
const
|
|
43366
|
-
return `(Missing data at ${
|
|
43394
|
+
const path8 = pipe(this.path, join(options3.pathDelim));
|
|
43395
|
+
return `(Missing data at ${path8}: "${this.message}")`;
|
|
43367
43396
|
}
|
|
43368
43397
|
});
|
|
43369
43398
|
return error4;
|
|
43370
43399
|
};
|
|
43371
|
-
var SourceUnavailable = (
|
|
43400
|
+
var SourceUnavailable = (path7, message, cause3, options3 = {
|
|
43372
43401
|
pathDelim: "."
|
|
43373
43402
|
}) => {
|
|
43374
43403
|
const error4 = Object.create(proto2);
|
|
43375
43404
|
error4._op = OP_SOURCE_UNAVAILABLE;
|
|
43376
|
-
error4.path =
|
|
43405
|
+
error4.path = path7;
|
|
43377
43406
|
error4.message = message;
|
|
43378
43407
|
error4.cause = cause3;
|
|
43379
43408
|
Object.defineProperty(error4, "toString", {
|
|
43380
43409
|
enumerable: false,
|
|
43381
43410
|
value() {
|
|
43382
|
-
const
|
|
43383
|
-
return `(Source unavailable at ${
|
|
43411
|
+
const path8 = pipe(this.path, join(options3.pathDelim));
|
|
43412
|
+
return `(Source unavailable at ${path8}: "${this.message}")`;
|
|
43384
43413
|
}
|
|
43385
43414
|
});
|
|
43386
43415
|
return error4;
|
|
43387
43416
|
};
|
|
43388
|
-
var Unsupported = (
|
|
43417
|
+
var Unsupported = (path7, message, options3 = {
|
|
43389
43418
|
pathDelim: "."
|
|
43390
43419
|
}) => {
|
|
43391
43420
|
const error4 = Object.create(proto2);
|
|
43392
43421
|
error4._op = OP_UNSUPPORTED;
|
|
43393
|
-
error4.path =
|
|
43422
|
+
error4.path = path7;
|
|
43394
43423
|
error4.message = message;
|
|
43395
43424
|
Object.defineProperty(error4, "toString", {
|
|
43396
43425
|
enumerable: false,
|
|
43397
43426
|
value() {
|
|
43398
|
-
const
|
|
43399
|
-
return `(Unsupported operation at ${
|
|
43427
|
+
const path8 = pipe(this.path, join(options3.pathDelim));
|
|
43428
|
+
return `(Unsupported operation at ${path8}: "${this.message}")`;
|
|
43400
43429
|
}
|
|
43401
43430
|
});
|
|
43402
43431
|
return error4;
|
|
@@ -43512,9 +43541,9 @@ var isMissingDataOnly = (self) => reduceWithContext2(self, void 0, IsMissingData
|
|
|
43512
43541
|
var empty18 = {
|
|
43513
43542
|
_tag: "Empty"
|
|
43514
43543
|
};
|
|
43515
|
-
var patch5 = /* @__PURE__ */ dual(2, (
|
|
43544
|
+
var patch5 = /* @__PURE__ */ dual(2, (path7, patch9) => {
|
|
43516
43545
|
let input = of3(patch9);
|
|
43517
|
-
let output =
|
|
43546
|
+
let output = path7;
|
|
43518
43547
|
while (isCons(input)) {
|
|
43519
43548
|
const patch10 = input.head;
|
|
43520
43549
|
switch (patch10._tag) {
|
|
@@ -43581,7 +43610,7 @@ var make21 = (options3) => ({
|
|
|
43581
43610
|
var makeFlat = (options3) => ({
|
|
43582
43611
|
[FlatConfigProviderTypeId]: FlatConfigProviderTypeId,
|
|
43583
43612
|
patch: options3.patch,
|
|
43584
|
-
load: (
|
|
43613
|
+
load: (path7, config2, split2 = true) => options3.load(path7, config2, split2),
|
|
43585
43614
|
enumerateChildren: options3.enumerateChildren
|
|
43586
43615
|
});
|
|
43587
43616
|
var fromFlat = (flat) => make21({
|
|
@@ -43599,29 +43628,29 @@ var fromEnv = (options3) => {
|
|
|
43599
43628
|
pathDelim: "_",
|
|
43600
43629
|
seqDelim: ","
|
|
43601
43630
|
}, options3);
|
|
43602
|
-
const makePathString = (
|
|
43631
|
+
const makePathString = (path7) => pipe(path7, join(pathDelim));
|
|
43603
43632
|
const unmakePathString = (pathString) => pathString.split(pathDelim);
|
|
43604
43633
|
const getEnv = () => typeof process !== "undefined" && "env" in process && typeof process.env === "object" ? process.env : {};
|
|
43605
|
-
const load = (
|
|
43606
|
-
const pathString = makePathString(
|
|
43634
|
+
const load = (path7, primitive2, split2 = true) => {
|
|
43635
|
+
const pathString = makePathString(path7);
|
|
43607
43636
|
const current = getEnv();
|
|
43608
43637
|
const valueOpt = pathString in current ? some2(current[pathString]) : none2();
|
|
43609
|
-
return pipe(valueOpt, mapError(() => MissingData(
|
|
43638
|
+
return pipe(valueOpt, mapError(() => MissingData(path7, `Expected ${pathString} to exist in the process context`)), flatMap7((value5) => parsePrimitive(value5, path7, primitive2, seqDelim, split2)));
|
|
43610
43639
|
};
|
|
43611
|
-
const enumerateChildren = (
|
|
43640
|
+
const enumerateChildren = (path7) => sync(() => {
|
|
43612
43641
|
const current = getEnv();
|
|
43613
43642
|
const keys5 = Object.keys(current);
|
|
43614
43643
|
const keyPaths = keys5.map((value5) => unmakePathString(value5.toUpperCase()));
|
|
43615
43644
|
const filteredKeyPaths = keyPaths.filter((keyPath) => {
|
|
43616
|
-
for (let i = 0; i <
|
|
43617
|
-
const pathComponent = pipe(
|
|
43645
|
+
for (let i = 0; i < path7.length; i++) {
|
|
43646
|
+
const pathComponent = pipe(path7, unsafeGet(i));
|
|
43618
43647
|
const currentElement = keyPath[i];
|
|
43619
43648
|
if (currentElement === void 0 || pathComponent !== currentElement) {
|
|
43620
43649
|
return false;
|
|
43621
43650
|
}
|
|
43622
43651
|
}
|
|
43623
43652
|
return true;
|
|
43624
|
-
}).flatMap((keyPath) => keyPath.slice(
|
|
43653
|
+
}).flatMap((keyPath) => keyPath.slice(path7.length, path7.length + 1));
|
|
43625
43654
|
return fromIterable6(filteredKeyPaths);
|
|
43626
43655
|
});
|
|
43627
43656
|
return fromFlat(makeFlat({
|
|
@@ -43637,17 +43666,17 @@ var extend = (leftDef, rightDef, left3, right3) => {
|
|
|
43637
43666
|
const rightExtension = concat(right3, rightPad);
|
|
43638
43667
|
return [leftExtension, rightExtension];
|
|
43639
43668
|
};
|
|
43640
|
-
var appendConfigPath = (
|
|
43669
|
+
var appendConfigPath = (path7, config2) => {
|
|
43641
43670
|
let op = config2;
|
|
43642
43671
|
if (op._tag === "Nested") {
|
|
43643
|
-
const out =
|
|
43672
|
+
const out = path7.slice();
|
|
43644
43673
|
while (op._tag === "Nested") {
|
|
43645
43674
|
out.push(op.name);
|
|
43646
43675
|
op = op.config;
|
|
43647
43676
|
}
|
|
43648
43677
|
return out;
|
|
43649
43678
|
}
|
|
43650
|
-
return
|
|
43679
|
+
return path7;
|
|
43651
43680
|
};
|
|
43652
43681
|
var fromFlatLoop = (flat, prefix, config2, split2) => {
|
|
43653
43682
|
const op = config2;
|
|
@@ -43723,8 +43752,8 @@ var fromFlatLoop = (flat, prefix, config2, split2) => {
|
|
|
43723
43752
|
return fail2(right3.left);
|
|
43724
43753
|
}
|
|
43725
43754
|
if (isRight2(left3) && isRight2(right3)) {
|
|
43726
|
-
const
|
|
43727
|
-
const fail19 = fromFlatLoopFail(prefix,
|
|
43755
|
+
const path7 = pipe(prefix, join("."));
|
|
43756
|
+
const fail19 = fromFlatLoopFail(prefix, path7);
|
|
43728
43757
|
const [lefts, rights] = extend(fail19, fail19, pipe(left3.right, map3(right2)), pipe(right3.right, map3(right2)));
|
|
43729
43758
|
return pipe(lefts, zip(rights), forEachSequential(([left4, right4]) => pipe(zip2(left4, right4), map10(([left5, right5]) => op.zip(left5, right5)))));
|
|
43730
43759
|
}
|
|
@@ -43733,19 +43762,19 @@ var fromFlatLoop = (flat, prefix, config2, split2) => {
|
|
|
43733
43762
|
}
|
|
43734
43763
|
}
|
|
43735
43764
|
};
|
|
43736
|
-
var fromFlatLoopFail = (prefix,
|
|
43765
|
+
var fromFlatLoopFail = (prefix, path7) => (index) => left2(MissingData(prefix, `The element at index ${index} in a sequence at path "${path7}" was missing`));
|
|
43737
43766
|
var splitPathString = (text11, delim) => {
|
|
43738
43767
|
const split2 = text11.split(new RegExp(`\\s*${escape(delim)}\\s*`));
|
|
43739
43768
|
return split2;
|
|
43740
43769
|
};
|
|
43741
|
-
var parsePrimitive = (text11,
|
|
43770
|
+
var parsePrimitive = (text11, path7, primitive2, delimiter, split2) => {
|
|
43742
43771
|
if (!split2) {
|
|
43743
43772
|
return pipe(primitive2.parse(text11), mapBoth2({
|
|
43744
|
-
onFailure: prefixed(
|
|
43773
|
+
onFailure: prefixed(path7),
|
|
43745
43774
|
onSuccess: of
|
|
43746
43775
|
}));
|
|
43747
43776
|
}
|
|
43748
|
-
return pipe(splitPathString(text11, delimiter), forEachSequential((char4) => primitive2.parse(char4.trim())), mapError(prefixed(
|
|
43777
|
+
return pipe(splitPathString(text11, delimiter), forEachSequential((char4) => primitive2.parse(char4.trim())), mapError(prefixed(path7)));
|
|
43749
43778
|
};
|
|
43750
43779
|
var transpose = (array7) => {
|
|
43751
43780
|
return Object.keys(array7[0]).map((column3) => array7.map((row) => row[column3]));
|
|
@@ -54744,14 +54773,14 @@ var formatPropertyKey = (name) => typeof name === "string" ? JSON.stringify(name
|
|
|
54744
54773
|
var isNonEmpty5 = (x) => Array.isArray(x);
|
|
54745
54774
|
var isSingle = (x) => !Array.isArray(x);
|
|
54746
54775
|
var formatPathKey = (key) => `[${formatPropertyKey(key)}]`;
|
|
54747
|
-
var formatPath = (
|
|
54776
|
+
var formatPath = (path7) => isNonEmpty5(path7) ? path7.map(formatPathKey).join("") : formatPathKey(path7);
|
|
54748
54777
|
|
|
54749
54778
|
// node_modules/.pnpm/effect@3.17.7/node_modules/effect/dist/esm/internal/schema/errors.js
|
|
54750
|
-
var getErrorMessage = (reason, details,
|
|
54779
|
+
var getErrorMessage = (reason, details, path7, ast) => {
|
|
54751
54780
|
let out = reason;
|
|
54752
|
-
if (
|
|
54781
|
+
if (path7 && isNonEmptyReadonlyArray(path7)) {
|
|
54753
54782
|
out += `
|
|
54754
|
-
at path: ${formatPath(
|
|
54783
|
+
at path: ${formatPath(path7)}`;
|
|
54755
54784
|
}
|
|
54756
54785
|
if (details !== void 0) {
|
|
54757
54786
|
out += `
|
|
@@ -54763,7 +54792,7 @@ schema (${ast._tag}): ${ast}`;
|
|
|
54763
54792
|
}
|
|
54764
54793
|
return out;
|
|
54765
54794
|
};
|
|
54766
|
-
var getSchemaExtendErrorMessage = (x, y,
|
|
54795
|
+
var getSchemaExtendErrorMessage = (x, y, path7) => getErrorMessage("Unsupported schema or overlapping types", `cannot extend ${x} with ${y}`, path7);
|
|
54767
54796
|
var getASTUnsupportedKeySchemaErrorMessage = (ast) => getErrorMessage("Unsupported key schema", void 0, void 0, ast);
|
|
54768
54797
|
var getASTUnsupportedLiteralErrorMessage = (literal2) => getErrorMessage("Unsupported literal", `literal value: ${formatUnknown(literal2)}`);
|
|
54769
54798
|
var getASTDuplicateIndexSignatureErrorMessage = (type2) => getErrorMessage("Duplicate index signature", `${type2} index signature`);
|
|
@@ -55952,8 +55981,8 @@ var Pointer = class {
|
|
|
55952
55981
|
* @since 3.10.0
|
|
55953
55982
|
*/
|
|
55954
55983
|
_tag = "Pointer";
|
|
55955
|
-
constructor(
|
|
55956
|
-
this.path =
|
|
55984
|
+
constructor(path7, actual, issue) {
|
|
55985
|
+
this.path = path7;
|
|
55957
55986
|
this.actual = actual;
|
|
55958
55987
|
this.issue = issue;
|
|
55959
55988
|
}
|
|
@@ -57443,7 +57472,7 @@ function makeTypeLiteralClass(fields, records, ast = getDefaultTypeLiteralAST(fi
|
|
|
57443
57472
|
function Struct(fields, ...records) {
|
|
57444
57473
|
return makeTypeLiteralClass(fields, records);
|
|
57445
57474
|
}
|
|
57446
|
-
var intersectTypeLiterals = (x, y,
|
|
57475
|
+
var intersectTypeLiterals = (x, y, path7) => {
|
|
57447
57476
|
if (isTypeLiteral(x) && isTypeLiteral(y)) {
|
|
57448
57477
|
const propertySignatures = [...x.propertySignatures];
|
|
57449
57478
|
for (const ps of y.propertySignatures) {
|
|
@@ -57456,18 +57485,18 @@ var intersectTypeLiterals = (x, y, path6) => {
|
|
|
57456
57485
|
isOptional,
|
|
57457
57486
|
type: type2
|
|
57458
57487
|
} = propertySignatures[i];
|
|
57459
|
-
propertySignatures[i] = new PropertySignature(name, extendAST(type2, ps.type,
|
|
57488
|
+
propertySignatures[i] = new PropertySignature(name, extendAST(type2, ps.type, path7.concat(name)), isOptional, true);
|
|
57460
57489
|
}
|
|
57461
57490
|
}
|
|
57462
57491
|
return new TypeLiteral(propertySignatures, x.indexSignatures.concat(y.indexSignatures));
|
|
57463
57492
|
}
|
|
57464
|
-
throw new Error(getSchemaExtendErrorMessage(x, y,
|
|
57493
|
+
throw new Error(getSchemaExtendErrorMessage(x, y, path7));
|
|
57465
57494
|
};
|
|
57466
57495
|
var preserveRefinementAnnotations = /* @__PURE__ */ omitAnnotations([IdentifierAnnotationId]);
|
|
57467
57496
|
var addRefinementToMembers = (refinement, asts) => asts.map((ast) => new Refinement(ast, refinement.filter, preserveRefinementAnnotations(refinement)));
|
|
57468
|
-
var extendAST = (x, y,
|
|
57497
|
+
var extendAST = (x, y, path7) => Union.make(intersectUnionMembers([x], [y], path7));
|
|
57469
57498
|
var getTypes = (ast) => isUnion(ast) ? ast.types : [ast];
|
|
57470
|
-
var intersectUnionMembers = (xs, ys,
|
|
57499
|
+
var intersectUnionMembers = (xs, ys, path7) => flatMap2(xs, (x) => flatMap2(ys, (y) => {
|
|
57471
57500
|
switch (y._tag) {
|
|
57472
57501
|
case "Literal": {
|
|
57473
57502
|
if (isString(y.literal) && isStringKeyword(x) || isNumber(y.literal) && isNumberKeyword(x) || isBoolean(y.literal) && isBooleanKeyword(x)) {
|
|
@@ -57480,7 +57509,7 @@ var intersectUnionMembers = (xs, ys, path6) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
57480
57509
|
if (isStringKeyword(x) || isLiteral(x) && isString(x.literal)) {
|
|
57481
57510
|
return [x];
|
|
57482
57511
|
} else if (isRefinement(x)) {
|
|
57483
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
57512
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path7));
|
|
57484
57513
|
}
|
|
57485
57514
|
} else if (x === stringKeyword) {
|
|
57486
57515
|
return [y];
|
|
@@ -57492,7 +57521,7 @@ var intersectUnionMembers = (xs, ys, path6) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
57492
57521
|
if (isNumberKeyword(x) || isLiteral(x) && isNumber(x.literal)) {
|
|
57493
57522
|
return [x];
|
|
57494
57523
|
} else if (isRefinement(x)) {
|
|
57495
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
57524
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path7));
|
|
57496
57525
|
}
|
|
57497
57526
|
} else if (x === numberKeyword) {
|
|
57498
57527
|
return [y];
|
|
@@ -57504,7 +57533,7 @@ var intersectUnionMembers = (xs, ys, path6) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
57504
57533
|
if (isBooleanKeyword(x) || isLiteral(x) && isBoolean(x.literal)) {
|
|
57505
57534
|
return [x];
|
|
57506
57535
|
} else if (isRefinement(x)) {
|
|
57507
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
57536
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path7));
|
|
57508
57537
|
}
|
|
57509
57538
|
} else if (x === booleanKeyword) {
|
|
57510
57539
|
return [y];
|
|
@@ -57512,25 +57541,25 @@ var intersectUnionMembers = (xs, ys, path6) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
57512
57541
|
break;
|
|
57513
57542
|
}
|
|
57514
57543
|
case "Union":
|
|
57515
|
-
return intersectUnionMembers(getTypes(x), y.types,
|
|
57544
|
+
return intersectUnionMembers(getTypes(x), y.types, path7);
|
|
57516
57545
|
case "Suspend":
|
|
57517
|
-
return [new Suspend(() => extendAST(x, y.f(),
|
|
57546
|
+
return [new Suspend(() => extendAST(x, y.f(), path7))];
|
|
57518
57547
|
case "Refinement":
|
|
57519
|
-
return addRefinementToMembers(y, intersectUnionMembers(getTypes(x), getTypes(y.from),
|
|
57548
|
+
return addRefinementToMembers(y, intersectUnionMembers(getTypes(x), getTypes(y.from), path7));
|
|
57520
57549
|
case "TypeLiteral": {
|
|
57521
57550
|
switch (x._tag) {
|
|
57522
57551
|
case "Union":
|
|
57523
|
-
return intersectUnionMembers(x.types, [y],
|
|
57552
|
+
return intersectUnionMembers(x.types, [y], path7);
|
|
57524
57553
|
case "Suspend":
|
|
57525
|
-
return [new Suspend(() => extendAST(x.f(), y,
|
|
57554
|
+
return [new Suspend(() => extendAST(x.f(), y, path7))];
|
|
57526
57555
|
case "Refinement":
|
|
57527
|
-
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y],
|
|
57556
|
+
return addRefinementToMembers(x, intersectUnionMembers(getTypes(x.from), [y], path7));
|
|
57528
57557
|
case "TypeLiteral":
|
|
57529
|
-
return [intersectTypeLiterals(x, y,
|
|
57558
|
+
return [intersectTypeLiterals(x, y, path7)];
|
|
57530
57559
|
case "Transformation": {
|
|
57531
57560
|
const transformation = x.transformation;
|
|
57532
|
-
const from = intersectTypeLiterals(x.from, y,
|
|
57533
|
-
const to = intersectTypeLiterals(x.to, typeAST(y),
|
|
57561
|
+
const from = intersectTypeLiterals(x.from, y, path7);
|
|
57562
|
+
const to = intersectTypeLiterals(x.to, typeAST(y), path7);
|
|
57534
57563
|
switch (transformation._tag) {
|
|
57535
57564
|
case "TypeLiteralTransformation":
|
|
57536
57565
|
return [new Transformation(from, to, new TypeLiteralTransformation(transformation.propertySignatureTransformations))];
|
|
@@ -57552,15 +57581,15 @@ var intersectUnionMembers = (xs, ys, path6) => flatMap2(xs, (x) => flatMap2(ys,
|
|
|
57552
57581
|
case "Transformation": {
|
|
57553
57582
|
if (isTransformation(x)) {
|
|
57554
57583
|
if (isTypeLiteralTransformation(y.transformation) && isTypeLiteralTransformation(x.transformation)) {
|
|
57555
|
-
return [new Transformation(intersectTypeLiterals(x.from, y.from,
|
|
57584
|
+
return [new Transformation(intersectTypeLiterals(x.from, y.from, path7), intersectTypeLiterals(x.to, y.to, path7), new TypeLiteralTransformation(y.transformation.propertySignatureTransformations.concat(x.transformation.propertySignatureTransformations)))];
|
|
57556
57585
|
}
|
|
57557
57586
|
} else {
|
|
57558
|
-
return intersectUnionMembers([y], [x],
|
|
57587
|
+
return intersectUnionMembers([y], [x], path7);
|
|
57559
57588
|
}
|
|
57560
57589
|
break;
|
|
57561
57590
|
}
|
|
57562
57591
|
}
|
|
57563
|
-
throw new Error(getSchemaExtendErrorMessage(x, y,
|
|
57592
|
+
throw new Error(getSchemaExtendErrorMessage(x, y, path7));
|
|
57564
57593
|
}));
|
|
57565
57594
|
var extend3 = /* @__PURE__ */ dual(2, (self, that) => make53(extendAST(self.ast, that.ast, [])));
|
|
57566
57595
|
var compose3 = /* @__PURE__ */ dual((args2) => isSchema(args2[1]), (from, to) => makeTransformationClass(from, to, compose2(from.ast, to.ast)));
|
|
@@ -58230,8 +58259,8 @@ var PiB = (n) => Size(BigInt(n) * bigintPiB);
|
|
|
58230
58259
|
var make54 = (impl) => {
|
|
58231
58260
|
return tag.of({
|
|
58232
58261
|
...impl,
|
|
58233
|
-
exists: (
|
|
58234
|
-
readFileString: (
|
|
58262
|
+
exists: (path7) => pipe(impl.access(path7), as5(true), catchTag2("SystemError", (e) => e.reason === "NotFound" ? succeed8(false) : fail8(e))),
|
|
58263
|
+
readFileString: (path7, encoding) => tryMap2(impl.readFile(path7), {
|
|
58235
58264
|
try: (_) => new TextDecoder(encoding).decode(_),
|
|
58236
58265
|
catch: (cause3) => new BadArgument({
|
|
58237
58266
|
module: "FileSystem",
|
|
@@ -58240,14 +58269,14 @@ var make54 = (impl) => {
|
|
|
58240
58269
|
cause: cause3
|
|
58241
58270
|
})
|
|
58242
58271
|
}),
|
|
58243
|
-
stream: (
|
|
58272
|
+
stream: (path7, options3) => pipe(impl.open(path7, {
|
|
58244
58273
|
flag: "r"
|
|
58245
58274
|
}), options3?.offset ? tap3((file6) => file6.seek(options3.offset, "start")) : identity, map16((file6) => stream3(file6, options3)), unwrapScoped5),
|
|
58246
|
-
sink: (
|
|
58275
|
+
sink: (path7, options3) => pipe(impl.open(path7, {
|
|
58247
58276
|
flag: "w",
|
|
58248
58277
|
...options3
|
|
58249
58278
|
}), map16((file6) => forEach10((_) => file6.writeAll(_))), unwrapScoped6),
|
|
58250
|
-
writeFileString: (
|
|
58279
|
+
writeFileString: (path7, data, options3) => flatMap9(try_2({
|
|
58251
58280
|
try: () => new TextEncoder().encode(data),
|
|
58252
58281
|
catch: (cause3) => new BadArgument({
|
|
58253
58282
|
module: "FileSystem",
|
|
@@ -58255,38 +58284,38 @@ var make54 = (impl) => {
|
|
|
58255
58284
|
description: "could not encode string",
|
|
58256
58285
|
cause: cause3
|
|
58257
58286
|
})
|
|
58258
|
-
}), (_) => impl.writeFile(
|
|
58287
|
+
}), (_) => impl.writeFile(path7, _, options3))
|
|
58259
58288
|
});
|
|
58260
58289
|
};
|
|
58261
|
-
var notFound = (method,
|
|
58290
|
+
var notFound = (method, path7) => new SystemError({
|
|
58262
58291
|
module: "FileSystem",
|
|
58263
58292
|
method,
|
|
58264
58293
|
reason: "NotFound",
|
|
58265
58294
|
description: "No such file or directory",
|
|
58266
|
-
pathOrDescriptor:
|
|
58295
|
+
pathOrDescriptor: path7
|
|
58267
58296
|
});
|
|
58268
58297
|
var makeNoop = (fileSystem) => {
|
|
58269
58298
|
return {
|
|
58270
|
-
access(
|
|
58271
|
-
return fail8(notFound("access",
|
|
58299
|
+
access(path7) {
|
|
58300
|
+
return fail8(notFound("access", path7));
|
|
58272
58301
|
},
|
|
58273
|
-
chmod(
|
|
58274
|
-
return fail8(notFound("chmod",
|
|
58302
|
+
chmod(path7) {
|
|
58303
|
+
return fail8(notFound("chmod", path7));
|
|
58275
58304
|
},
|
|
58276
|
-
chown(
|
|
58277
|
-
return fail8(notFound("chown",
|
|
58305
|
+
chown(path7) {
|
|
58306
|
+
return fail8(notFound("chown", path7));
|
|
58278
58307
|
},
|
|
58279
|
-
copy(
|
|
58280
|
-
return fail8(notFound("copy",
|
|
58308
|
+
copy(path7) {
|
|
58309
|
+
return fail8(notFound("copy", path7));
|
|
58281
58310
|
},
|
|
58282
|
-
copyFile(
|
|
58283
|
-
return fail8(notFound("copyFile",
|
|
58311
|
+
copyFile(path7) {
|
|
58312
|
+
return fail8(notFound("copyFile", path7));
|
|
58284
58313
|
},
|
|
58285
58314
|
exists() {
|
|
58286
58315
|
return succeed8(false);
|
|
58287
58316
|
},
|
|
58288
|
-
link(
|
|
58289
|
-
return fail8(notFound("link",
|
|
58317
|
+
link(path7) {
|
|
58318
|
+
return fail8(notFound("link", path7));
|
|
58290
58319
|
},
|
|
58291
58320
|
makeDirectory() {
|
|
58292
58321
|
return die5("not implemented");
|
|
@@ -58303,23 +58332,23 @@ var makeNoop = (fileSystem) => {
|
|
|
58303
58332
|
makeTempFileScoped() {
|
|
58304
58333
|
return die5("not implemented");
|
|
58305
58334
|
},
|
|
58306
|
-
open(
|
|
58307
|
-
return fail8(notFound("open",
|
|
58335
|
+
open(path7) {
|
|
58336
|
+
return fail8(notFound("open", path7));
|
|
58308
58337
|
},
|
|
58309
|
-
readDirectory(
|
|
58310
|
-
return fail8(notFound("readDirectory",
|
|
58338
|
+
readDirectory(path7) {
|
|
58339
|
+
return fail8(notFound("readDirectory", path7));
|
|
58311
58340
|
},
|
|
58312
|
-
readFile(
|
|
58313
|
-
return fail8(notFound("readFile",
|
|
58341
|
+
readFile(path7) {
|
|
58342
|
+
return fail8(notFound("readFile", path7));
|
|
58314
58343
|
},
|
|
58315
|
-
readFileString(
|
|
58316
|
-
return fail8(notFound("readFileString",
|
|
58344
|
+
readFileString(path7) {
|
|
58345
|
+
return fail8(notFound("readFileString", path7));
|
|
58317
58346
|
},
|
|
58318
|
-
readLink(
|
|
58319
|
-
return fail8(notFound("readLink",
|
|
58347
|
+
readLink(path7) {
|
|
58348
|
+
return fail8(notFound("readLink", path7));
|
|
58320
58349
|
},
|
|
58321
|
-
realPath(
|
|
58322
|
-
return fail8(notFound("realPath",
|
|
58350
|
+
realPath(path7) {
|
|
58351
|
+
return fail8(notFound("realPath", path7));
|
|
58323
58352
|
},
|
|
58324
58353
|
remove() {
|
|
58325
58354
|
return _void;
|
|
@@ -58327,32 +58356,32 @@ var makeNoop = (fileSystem) => {
|
|
|
58327
58356
|
rename(oldPath) {
|
|
58328
58357
|
return fail8(notFound("rename", oldPath));
|
|
58329
58358
|
},
|
|
58330
|
-
sink(
|
|
58331
|
-
return fail14(notFound("sink",
|
|
58359
|
+
sink(path7) {
|
|
58360
|
+
return fail14(notFound("sink", path7));
|
|
58332
58361
|
},
|
|
58333
|
-
stat(
|
|
58334
|
-
return fail8(notFound("stat",
|
|
58362
|
+
stat(path7) {
|
|
58363
|
+
return fail8(notFound("stat", path7));
|
|
58335
58364
|
},
|
|
58336
|
-
stream(
|
|
58337
|
-
return fail13(notFound("stream",
|
|
58365
|
+
stream(path7) {
|
|
58366
|
+
return fail13(notFound("stream", path7));
|
|
58338
58367
|
},
|
|
58339
58368
|
symlink(fromPath) {
|
|
58340
58369
|
return fail8(notFound("symlink", fromPath));
|
|
58341
58370
|
},
|
|
58342
|
-
truncate(
|
|
58343
|
-
return fail8(notFound("truncate",
|
|
58371
|
+
truncate(path7) {
|
|
58372
|
+
return fail8(notFound("truncate", path7));
|
|
58344
58373
|
},
|
|
58345
|
-
utimes(
|
|
58346
|
-
return fail8(notFound("utimes",
|
|
58374
|
+
utimes(path7) {
|
|
58375
|
+
return fail8(notFound("utimes", path7));
|
|
58347
58376
|
},
|
|
58348
|
-
watch(
|
|
58349
|
-
return fail13(notFound("watch",
|
|
58377
|
+
watch(path7) {
|
|
58378
|
+
return fail13(notFound("watch", path7));
|
|
58350
58379
|
},
|
|
58351
|
-
writeFile(
|
|
58352
|
-
return fail8(notFound("writeFile",
|
|
58380
|
+
writeFile(path7) {
|
|
58381
|
+
return fail8(notFound("writeFile", path7));
|
|
58353
58382
|
},
|
|
58354
|
-
writeFileString(
|
|
58355
|
-
return fail8(notFound("writeFileString",
|
|
58383
|
+
writeFileString(path7) {
|
|
58384
|
+
return fail8(notFound("writeFileString", path7));
|
|
58356
58385
|
},
|
|
58357
58386
|
...fileSystem
|
|
58358
58387
|
};
|
|
@@ -58401,7 +58430,7 @@ var WatchBackend = class extends (/* @__PURE__ */ Tag2("@effect/platform/FileSys
|
|
|
58401
58430
|
};
|
|
58402
58431
|
|
|
58403
58432
|
// 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
|
|
58404
|
-
var handleErrnoException = (module, method) => (err, [
|
|
58433
|
+
var handleErrnoException = (module, method) => (err, [path7]) => {
|
|
58405
58434
|
let reason = "Unknown";
|
|
58406
58435
|
switch (err.code) {
|
|
58407
58436
|
case "ENOENT":
|
|
@@ -58430,7 +58459,7 @@ var handleErrnoException = (module, method) => (err, [path6]) => {
|
|
|
58430
58459
|
reason,
|
|
58431
58460
|
module,
|
|
58432
58461
|
method,
|
|
58433
|
-
pathOrDescriptor:
|
|
58462
|
+
pathOrDescriptor: path7,
|
|
58434
58463
|
syscall: err.syscall,
|
|
58435
58464
|
description: err.message,
|
|
58436
58465
|
cause: err
|
|
@@ -58561,7 +58590,7 @@ var runCommand = (fileSystem) => (command2) => {
|
|
|
58561
58590
|
switch (command2._tag) {
|
|
58562
58591
|
case "StandardCommand": {
|
|
58563
58592
|
const spawn2 = flatMap9(make24(), (exitCode3) => async2((resume2) => {
|
|
58564
|
-
const handle =
|
|
58593
|
+
const handle = ChildProcess__namespace.spawn(command2.command, command2.args, {
|
|
58565
58594
|
stdio: [inputToStdioOption(command2.stdin), outputToStdioOption(command2.stdout), outputToStdioOption(command2.stderr)],
|
|
58566
58595
|
cwd: getOrElse(command2.cwd, constUndefined),
|
|
58567
58596
|
shell: command2.shell,
|
|
@@ -58585,7 +58614,7 @@ var runCommand = (fileSystem) => (command2) => {
|
|
|
58585
58614
|
});
|
|
58586
58615
|
}));
|
|
58587
58616
|
const killProcessGroup = process.platform === "win32" ? (handle, _) => async2((resume2) => {
|
|
58588
|
-
|
|
58617
|
+
ChildProcess__namespace.exec(`taskkill /pid ${handle.pid} /T /F`, (error4) => {
|
|
58589
58618
|
if (error4) {
|
|
58590
58619
|
resume2(fail8(toPlatformError("kill", toError(error4), command2)));
|
|
58591
58620
|
} else {
|
|
@@ -58688,20 +58717,20 @@ var handleBadArgument = (method) => (cause3) => new BadArgument({
|
|
|
58688
58717
|
cause: cause3
|
|
58689
58718
|
});
|
|
58690
58719
|
var access2 = /* @__PURE__ */ (() => {
|
|
58691
|
-
const nodeAccess = /* @__PURE__ */ effectify2(
|
|
58692
|
-
return (
|
|
58693
|
-
let mode =
|
|
58720
|
+
const nodeAccess = /* @__PURE__ */ effectify2(NFS__namespace.access, /* @__PURE__ */ handleErrnoException("FileSystem", "access"), /* @__PURE__ */ handleBadArgument("access"));
|
|
58721
|
+
return (path7, options3) => {
|
|
58722
|
+
let mode = NFS__namespace.constants.F_OK;
|
|
58694
58723
|
if (options3?.readable) {
|
|
58695
|
-
mode |=
|
|
58724
|
+
mode |= NFS__namespace.constants.R_OK;
|
|
58696
58725
|
}
|
|
58697
58726
|
if (options3?.writable) {
|
|
58698
|
-
mode |=
|
|
58727
|
+
mode |= NFS__namespace.constants.W_OK;
|
|
58699
58728
|
}
|
|
58700
|
-
return nodeAccess(
|
|
58729
|
+
return nodeAccess(path7, mode);
|
|
58701
58730
|
};
|
|
58702
58731
|
})();
|
|
58703
58732
|
var copy3 = /* @__PURE__ */ (() => {
|
|
58704
|
-
const nodeCp = /* @__PURE__ */ effectify2(
|
|
58733
|
+
const nodeCp = /* @__PURE__ */ effectify2(NFS__namespace.cp, /* @__PURE__ */ handleErrnoException("FileSystem", "copy"), /* @__PURE__ */ handleBadArgument("copy"));
|
|
58705
58734
|
return (fromPath, toPath, options3) => nodeCp(fromPath, toPath, {
|
|
58706
58735
|
force: options3?.overwrite ?? false,
|
|
58707
58736
|
preserveTimestamps: options3?.preserveTimestamps ?? false,
|
|
@@ -58709,40 +58738,40 @@ var copy3 = /* @__PURE__ */ (() => {
|
|
|
58709
58738
|
});
|
|
58710
58739
|
})();
|
|
58711
58740
|
var copyFile2 = /* @__PURE__ */ (() => {
|
|
58712
|
-
const nodeCopyFile = /* @__PURE__ */ effectify2(
|
|
58741
|
+
const nodeCopyFile = /* @__PURE__ */ effectify2(NFS__namespace.copyFile, /* @__PURE__ */ handleErrnoException("FileSystem", "copyFile"), /* @__PURE__ */ handleBadArgument("copyFile"));
|
|
58713
58742
|
return (fromPath, toPath) => nodeCopyFile(fromPath, toPath);
|
|
58714
58743
|
})();
|
|
58715
58744
|
var chmod2 = /* @__PURE__ */ (() => {
|
|
58716
|
-
const nodeChmod = /* @__PURE__ */ effectify2(
|
|
58717
|
-
return (
|
|
58745
|
+
const nodeChmod = /* @__PURE__ */ effectify2(NFS__namespace.chmod, /* @__PURE__ */ handleErrnoException("FileSystem", "chmod"), /* @__PURE__ */ handleBadArgument("chmod"));
|
|
58746
|
+
return (path7, mode) => nodeChmod(path7, mode);
|
|
58718
58747
|
})();
|
|
58719
58748
|
var chown2 = /* @__PURE__ */ (() => {
|
|
58720
|
-
const nodeChown = /* @__PURE__ */ effectify2(
|
|
58721
|
-
return (
|
|
58749
|
+
const nodeChown = /* @__PURE__ */ effectify2(NFS__namespace.chown, /* @__PURE__ */ handleErrnoException("FileSystem", "chown"), /* @__PURE__ */ handleBadArgument("chown"));
|
|
58750
|
+
return (path7, uid, gid) => nodeChown(path7, uid, gid);
|
|
58722
58751
|
})();
|
|
58723
58752
|
var link2 = /* @__PURE__ */ (() => {
|
|
58724
|
-
const nodeLink = /* @__PURE__ */ effectify2(
|
|
58753
|
+
const nodeLink = /* @__PURE__ */ effectify2(NFS__namespace.link, /* @__PURE__ */ handleErrnoException("FileSystem", "link"), /* @__PURE__ */ handleBadArgument("link"));
|
|
58725
58754
|
return (existingPath, newPath) => nodeLink(existingPath, newPath);
|
|
58726
58755
|
})();
|
|
58727
58756
|
var makeDirectory = /* @__PURE__ */ (() => {
|
|
58728
|
-
const nodeMkdir = /* @__PURE__ */ effectify2(
|
|
58729
|
-
return (
|
|
58757
|
+
const nodeMkdir = /* @__PURE__ */ effectify2(NFS__namespace.mkdir, /* @__PURE__ */ handleErrnoException("FileSystem", "makeDirectory"), /* @__PURE__ */ handleBadArgument("makeDirectory"));
|
|
58758
|
+
return (path7, options3) => nodeMkdir(path7, {
|
|
58730
58759
|
recursive: options3?.recursive ?? false,
|
|
58731
58760
|
mode: options3?.mode
|
|
58732
58761
|
});
|
|
58733
58762
|
})();
|
|
58734
58763
|
var makeTempDirectoryFactory = (method) => {
|
|
58735
|
-
const nodeMkdtemp = effectify2(
|
|
58764
|
+
const nodeMkdtemp = effectify2(NFS__namespace.mkdtemp, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
58736
58765
|
return (options3) => suspend4(() => {
|
|
58737
58766
|
const prefix = options3?.prefix ?? "";
|
|
58738
|
-
const directory5 = typeof options3?.directory === "string" ?
|
|
58739
|
-
return nodeMkdtemp(prefix ?
|
|
58767
|
+
const directory5 = typeof options3?.directory === "string" ? path4__namespace.join(options3.directory, ".") : OS__namespace.tmpdir();
|
|
58768
|
+
return nodeMkdtemp(prefix ? path4__namespace.join(directory5, prefix) : directory5 + "/");
|
|
58740
58769
|
});
|
|
58741
58770
|
};
|
|
58742
58771
|
var makeTempDirectory = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectory");
|
|
58743
58772
|
var removeFactory = (method) => {
|
|
58744
|
-
const nodeRm = effectify2(
|
|
58745
|
-
return (
|
|
58773
|
+
const nodeRm = effectify2(NFS__namespace.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
58774
|
+
return (path7, options3) => nodeRm(path7, {
|
|
58746
58775
|
recursive: options3?.recursive ?? false,
|
|
58747
58776
|
force: options3?.force ?? false
|
|
58748
58777
|
});
|
|
@@ -58756,19 +58785,19 @@ var makeTempDirectoryScoped = /* @__PURE__ */ (() => {
|
|
|
58756
58785
|
})));
|
|
58757
58786
|
})();
|
|
58758
58787
|
var openFactory = (method) => {
|
|
58759
|
-
const nodeOpen = effectify2(
|
|
58760
|
-
const nodeClose = effectify2(
|
|
58761
|
-
return (
|
|
58788
|
+
const nodeOpen = effectify2(NFS__namespace.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
58789
|
+
const nodeClose = effectify2(NFS__namespace.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
58790
|
+
return (path7, options3) => pipe(acquireRelease2(nodeOpen(path7, options3?.flag ?? "r", options3?.mode), (fd) => orDie2(nodeClose(fd))), map16((fd) => makeFile(FileDescriptor(fd), options3?.flag?.startsWith("a") ?? false)));
|
|
58762
58791
|
};
|
|
58763
58792
|
var open2 = /* @__PURE__ */ openFactory("open");
|
|
58764
58793
|
var makeFile = /* @__PURE__ */ (() => {
|
|
58765
|
-
const nodeReadFactory = (method) => effectify2(
|
|
58794
|
+
const nodeReadFactory = (method) => effectify2(NFS__namespace.read, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
58766
58795
|
const nodeRead = /* @__PURE__ */ nodeReadFactory("read");
|
|
58767
58796
|
const nodeReadAlloc = /* @__PURE__ */ nodeReadFactory("readAlloc");
|
|
58768
|
-
const nodeStat = /* @__PURE__ */ effectify2(
|
|
58769
|
-
const nodeTruncate = /* @__PURE__ */ effectify2(
|
|
58770
|
-
const nodeSync = /* @__PURE__ */ effectify2(
|
|
58771
|
-
const nodeWriteFactory = (method) => effectify2(
|
|
58797
|
+
const nodeStat = /* @__PURE__ */ effectify2(NFS__namespace.fstat, /* @__PURE__ */ handleErrnoException("FileSystem", "stat"), /* @__PURE__ */ handleBadArgument("stat"));
|
|
58798
|
+
const nodeTruncate = /* @__PURE__ */ effectify2(NFS__namespace.ftruncate, /* @__PURE__ */ handleErrnoException("FileSystem", "truncate"), /* @__PURE__ */ handleBadArgument("truncate"));
|
|
58799
|
+
const nodeSync = /* @__PURE__ */ effectify2(NFS__namespace.fsync, /* @__PURE__ */ handleErrnoException("FileSystem", "sync"), /* @__PURE__ */ handleBadArgument("sync"));
|
|
58800
|
+
const nodeWriteFactory = (method) => effectify2(NFS__namespace.write, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
58772
58801
|
const nodeWrite = /* @__PURE__ */ nodeWriteFactory("write");
|
|
58773
58802
|
const nodeWriteAll = /* @__PURE__ */ nodeWriteFactory("writeAll");
|
|
58774
58803
|
class FileImpl {
|
|
@@ -58872,8 +58901,8 @@ var makeFile = /* @__PURE__ */ (() => {
|
|
|
58872
58901
|
var makeTempFileFactory = (method) => {
|
|
58873
58902
|
const makeDirectory2 = makeTempDirectoryFactory(method);
|
|
58874
58903
|
const open3 = openFactory(method);
|
|
58875
|
-
const randomHexString2 = (bytes) => sync4(() =>
|
|
58876
|
-
return (options3) => pipe(zip5(makeDirectory2(options3), randomHexString2(6)), map16(([directory5, random4]) =>
|
|
58904
|
+
const randomHexString2 = (bytes) => sync4(() => Crypto__namespace.randomBytes(bytes).toString("hex"));
|
|
58905
|
+
return (options3) => pipe(zip5(makeDirectory2(options3), randomHexString2(6)), map16(([directory5, random4]) => path4__namespace.join(directory5, random4)), tap3((path7) => scoped2(open3(path7, {
|
|
58877
58906
|
flag: "w+"
|
|
58878
58907
|
}))));
|
|
58879
58908
|
};
|
|
@@ -58881,21 +58910,21 @@ var makeTempFile = /* @__PURE__ */ makeTempFileFactory("makeTempFile");
|
|
|
58881
58910
|
var makeTempFileScoped = /* @__PURE__ */ (() => {
|
|
58882
58911
|
const makeFile2 = /* @__PURE__ */ makeTempFileFactory("makeTempFileScoped");
|
|
58883
58912
|
const removeDirectory = /* @__PURE__ */ removeFactory("makeTempFileScoped");
|
|
58884
|
-
return (options3) => acquireRelease2(makeFile2(options3), (file6) => orDie2(removeDirectory(
|
|
58913
|
+
return (options3) => acquireRelease2(makeFile2(options3), (file6) => orDie2(removeDirectory(path4__namespace.dirname(file6), {
|
|
58885
58914
|
recursive: true
|
|
58886
58915
|
})));
|
|
58887
58916
|
})();
|
|
58888
|
-
var readDirectory = (
|
|
58889
|
-
try: () =>
|
|
58890
|
-
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [
|
|
58917
|
+
var readDirectory = (path7, options3) => tryPromise2({
|
|
58918
|
+
try: () => NFS__namespace.promises.readdir(path7, options3),
|
|
58919
|
+
catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path7])
|
|
58891
58920
|
});
|
|
58892
|
-
var readFile2 = (
|
|
58921
|
+
var readFile2 = (path7) => async2((resume2, signal) => {
|
|
58893
58922
|
try {
|
|
58894
|
-
|
|
58923
|
+
NFS__namespace.readFile(path7, {
|
|
58895
58924
|
signal
|
|
58896
58925
|
}, (err, data) => {
|
|
58897
58926
|
if (err) {
|
|
58898
|
-
resume2(fail8(handleErrnoException("FileSystem", "readFile")(err, [
|
|
58927
|
+
resume2(fail8(handleErrnoException("FileSystem", "readFile")(err, [path7])));
|
|
58899
58928
|
} else {
|
|
58900
58929
|
resume2(succeed8(data));
|
|
58901
58930
|
}
|
|
@@ -58905,15 +58934,15 @@ var readFile2 = (path6) => async2((resume2, signal) => {
|
|
|
58905
58934
|
}
|
|
58906
58935
|
});
|
|
58907
58936
|
var readLink = /* @__PURE__ */ (() => {
|
|
58908
|
-
const nodeReadLink = /* @__PURE__ */ effectify2(
|
|
58909
|
-
return (
|
|
58937
|
+
const nodeReadLink = /* @__PURE__ */ effectify2(NFS__namespace.readlink, /* @__PURE__ */ handleErrnoException("FileSystem", "readLink"), /* @__PURE__ */ handleBadArgument("readLink"));
|
|
58938
|
+
return (path7) => nodeReadLink(path7);
|
|
58910
58939
|
})();
|
|
58911
58940
|
var realPath = /* @__PURE__ */ (() => {
|
|
58912
|
-
const nodeRealPath = /* @__PURE__ */ effectify2(
|
|
58913
|
-
return (
|
|
58941
|
+
const nodeRealPath = /* @__PURE__ */ effectify2(NFS__namespace.realpath, /* @__PURE__ */ handleErrnoException("FileSystem", "realPath"), /* @__PURE__ */ handleBadArgument("realPath"));
|
|
58942
|
+
return (path7) => nodeRealPath(path7);
|
|
58914
58943
|
})();
|
|
58915
58944
|
var rename3 = /* @__PURE__ */ (() => {
|
|
58916
|
-
const nodeRename = /* @__PURE__ */ effectify2(
|
|
58945
|
+
const nodeRename = /* @__PURE__ */ effectify2(NFS__namespace.rename, /* @__PURE__ */ handleErrnoException("FileSystem", "rename"), /* @__PURE__ */ handleBadArgument("rename"));
|
|
58917
58946
|
return (oldPath, newPath) => nodeRename(oldPath, newPath);
|
|
58918
58947
|
})();
|
|
58919
58948
|
var makeFileInfo = (stat3) => ({
|
|
@@ -58933,41 +58962,41 @@ var makeFileInfo = (stat3) => ({
|
|
|
58933
58962
|
blocks: fromNullable(stat3.blocks)
|
|
58934
58963
|
});
|
|
58935
58964
|
var stat2 = /* @__PURE__ */ (() => {
|
|
58936
|
-
const nodeStat = /* @__PURE__ */ effectify2(
|
|
58937
|
-
return (
|
|
58965
|
+
const nodeStat = /* @__PURE__ */ effectify2(NFS__namespace.stat, /* @__PURE__ */ handleErrnoException("FileSystem", "stat"), /* @__PURE__ */ handleBadArgument("stat"));
|
|
58966
|
+
return (path7) => map16(nodeStat(path7), makeFileInfo);
|
|
58938
58967
|
})();
|
|
58939
58968
|
var symlink2 = /* @__PURE__ */ (() => {
|
|
58940
|
-
const nodeSymlink = /* @__PURE__ */ effectify2(
|
|
58941
|
-
return (target,
|
|
58969
|
+
const nodeSymlink = /* @__PURE__ */ effectify2(NFS__namespace.symlink, /* @__PURE__ */ handleErrnoException("FileSystem", "symlink"), /* @__PURE__ */ handleBadArgument("symlink"));
|
|
58970
|
+
return (target, path7) => nodeSymlink(target, path7);
|
|
58942
58971
|
})();
|
|
58943
58972
|
var truncate2 = /* @__PURE__ */ (() => {
|
|
58944
|
-
const nodeTruncate = /* @__PURE__ */ effectify2(
|
|
58945
|
-
return (
|
|
58973
|
+
const nodeTruncate = /* @__PURE__ */ effectify2(NFS__namespace.truncate, /* @__PURE__ */ handleErrnoException("FileSystem", "truncate"), /* @__PURE__ */ handleBadArgument("truncate"));
|
|
58974
|
+
return (path7, length3) => nodeTruncate(path7, length3 !== void 0 ? Number(length3) : void 0);
|
|
58946
58975
|
})();
|
|
58947
58976
|
var utimes2 = /* @__PURE__ */ (() => {
|
|
58948
|
-
const nodeUtimes = /* @__PURE__ */ effectify2(
|
|
58949
|
-
return (
|
|
58977
|
+
const nodeUtimes = /* @__PURE__ */ effectify2(NFS__namespace.utimes, /* @__PURE__ */ handleErrnoException("FileSystem", "utime"), /* @__PURE__ */ handleBadArgument("utime"));
|
|
58978
|
+
return (path7, atime, mtime) => nodeUtimes(path7, atime, mtime);
|
|
58950
58979
|
})();
|
|
58951
|
-
var watchNode = (
|
|
58952
|
-
const watcher =
|
|
58980
|
+
var watchNode = (path7, options3) => asyncScoped2((emit) => acquireRelease2(sync4(() => {
|
|
58981
|
+
const watcher = NFS__namespace.watch(path7, {
|
|
58953
58982
|
recursive: options3?.recursive
|
|
58954
|
-
}, (event,
|
|
58955
|
-
if (!
|
|
58983
|
+
}, (event, path8) => {
|
|
58984
|
+
if (!path8) return;
|
|
58956
58985
|
switch (event) {
|
|
58957
58986
|
case "rename": {
|
|
58958
|
-
emit.fromEffect(matchEffect2(stat2(
|
|
58987
|
+
emit.fromEffect(matchEffect2(stat2(path8), {
|
|
58959
58988
|
onSuccess: (_) => succeed8(WatchEventCreate({
|
|
58960
|
-
path:
|
|
58989
|
+
path: path8
|
|
58961
58990
|
})),
|
|
58962
58991
|
onFailure: (err) => err._tag === "SystemError" && err.reason === "NotFound" ? succeed8(WatchEventRemove({
|
|
58963
|
-
path:
|
|
58992
|
+
path: path8
|
|
58964
58993
|
})) : fail8(err)
|
|
58965
58994
|
}));
|
|
58966
58995
|
return;
|
|
58967
58996
|
}
|
|
58968
58997
|
case "change": {
|
|
58969
58998
|
emit.single(WatchEventUpdate({
|
|
58970
|
-
path:
|
|
58999
|
+
path: path8
|
|
58971
59000
|
}));
|
|
58972
59001
|
return;
|
|
58973
59002
|
}
|
|
@@ -58978,7 +59007,7 @@ var watchNode = (path6, options3) => asyncScoped2((emit) => acquireRelease2(sync
|
|
|
58978
59007
|
module: "FileSystem",
|
|
58979
59008
|
reason: "Unknown",
|
|
58980
59009
|
method: "watch",
|
|
58981
|
-
pathOrDescriptor:
|
|
59010
|
+
pathOrDescriptor: path7,
|
|
58982
59011
|
cause: error4
|
|
58983
59012
|
}));
|
|
58984
59013
|
});
|
|
@@ -58987,16 +59016,16 @@ var watchNode = (path6, options3) => asyncScoped2((emit) => acquireRelease2(sync
|
|
|
58987
59016
|
});
|
|
58988
59017
|
return watcher;
|
|
58989
59018
|
}), (watcher) => sync4(() => watcher.close())));
|
|
58990
|
-
var watch2 = (backend,
|
|
58991
|
-
var writeFile2 = (
|
|
59019
|
+
var watch2 = (backend, path7, options3) => stat2(path7).pipe(map16((stat3) => backend.pipe(flatMap((_) => _.register(path7, stat3, options3)), getOrElse(() => watchNode(path7, options3)))), unwrap3);
|
|
59020
|
+
var writeFile2 = (path7, data, options3) => async2((resume2, signal) => {
|
|
58992
59021
|
try {
|
|
58993
|
-
|
|
59022
|
+
NFS__namespace.writeFile(path7, data, {
|
|
58994
59023
|
signal,
|
|
58995
59024
|
flag: options3?.flag,
|
|
58996
59025
|
mode: options3?.mode
|
|
58997
59026
|
}, (err) => {
|
|
58998
59027
|
if (err) {
|
|
58999
|
-
resume2(fail8(handleErrnoException("FileSystem", "writeFile")(err, [
|
|
59028
|
+
resume2(fail8(handleErrnoException("FileSystem", "writeFile")(err, [path7])));
|
|
59000
59029
|
} else {
|
|
59001
59030
|
resume2(_void);
|
|
59002
59031
|
}
|
|
@@ -59028,8 +59057,8 @@ var makeFileSystem = /* @__PURE__ */ map16(/* @__PURE__ */ serviceOption2(WatchB
|
|
|
59028
59057
|
symlink: symlink2,
|
|
59029
59058
|
truncate: truncate2,
|
|
59030
59059
|
utimes: utimes2,
|
|
59031
|
-
watch(
|
|
59032
|
-
return watch2(backend,
|
|
59060
|
+
watch(path7, options3) {
|
|
59061
|
+
return watch2(backend, path7, options3);
|
|
59033
59062
|
},
|
|
59034
59063
|
writeFile: writeFile2
|
|
59035
59064
|
}));
|
|
@@ -59046,7 +59075,7 @@ var Path2 = /* @__PURE__ */ GenericTag("@effect/platform/Path");
|
|
|
59046
59075
|
var TypeId22 = TypeId21;
|
|
59047
59076
|
var Path3 = Path2;
|
|
59048
59077
|
var fromFileUrl2 = (url2) => try_2({
|
|
59049
|
-
try: () =>
|
|
59078
|
+
try: () => NodeUrl__namespace.fileURLToPath(url2),
|
|
59050
59079
|
catch: (error4) => new BadArgument({
|
|
59051
59080
|
module: "Path",
|
|
59052
59081
|
method: "fromFileUrl",
|
|
@@ -59054,18 +59083,18 @@ var fromFileUrl2 = (url2) => try_2({
|
|
|
59054
59083
|
cause: error4
|
|
59055
59084
|
})
|
|
59056
59085
|
});
|
|
59057
|
-
var toFileUrl2 = (
|
|
59058
|
-
try: () =>
|
|
59086
|
+
var toFileUrl2 = (path7) => try_2({
|
|
59087
|
+
try: () => NodeUrl__namespace.pathToFileURL(path7),
|
|
59059
59088
|
catch: (error4) => new BadArgument({
|
|
59060
59089
|
module: "Path",
|
|
59061
59090
|
method: "toFileUrl",
|
|
59062
|
-
description: `Invalid path: ${
|
|
59091
|
+
description: `Invalid path: ${path7}`,
|
|
59063
59092
|
cause: error4
|
|
59064
59093
|
})
|
|
59065
59094
|
});
|
|
59066
59095
|
var layer6 = /* @__PURE__ */ succeed9(Path3, /* @__PURE__ */ Path3.of({
|
|
59067
59096
|
[TypeId22]: TypeId22,
|
|
59068
|
-
...
|
|
59097
|
+
...path4__namespace,
|
|
59069
59098
|
fromFileUrl: fromFileUrl2,
|
|
59070
59099
|
toFileUrl: toFileUrl2
|
|
59071
59100
|
}));
|
|
@@ -59500,11 +59529,11 @@ var make58 = /* @__PURE__ */ fnUntraced2(function* (shouldQuit = defaultShouldQu
|
|
|
59500
59529
|
const stdout3 = process.stdout;
|
|
59501
59530
|
const rlRef = yield* make45({
|
|
59502
59531
|
acquire: acquireRelease2(sync4(() => {
|
|
59503
|
-
const rl =
|
|
59532
|
+
const rl = readline__namespace.createInterface({
|
|
59504
59533
|
input: stdin3,
|
|
59505
59534
|
escapeCodeTimeout: 50
|
|
59506
59535
|
});
|
|
59507
|
-
|
|
59536
|
+
readline__namespace.emitKeypressEvents(stdin3, rl);
|
|
59508
59537
|
if (stdin3.isTTY) {
|
|
59509
59538
|
stdin3.setRawMode(true);
|
|
59510
59539
|
}
|
|
@@ -60121,22 +60150,22 @@ var fileParsers = {
|
|
|
60121
60150
|
toml: (content) => Toml.parse(content),
|
|
60122
60151
|
tml: (content) => Toml.parse(content)
|
|
60123
60152
|
};
|
|
60124
|
-
var read3 = (
|
|
60125
|
-
onFailure: (error4) => fail8(`Could not read file (${
|
|
60126
|
-
onSuccess: (content) => succeed8([
|
|
60153
|
+
var read3 = (path7) => flatMap9(FileSystem, (fs) => matchEffect2(fs.readFile(path7), {
|
|
60154
|
+
onFailure: (error4) => fail8(`Could not read file (${path7}): ${error4}`),
|
|
60155
|
+
onSuccess: (content) => succeed8([path7, content])
|
|
60127
60156
|
}));
|
|
60128
|
-
var readString = (
|
|
60129
|
-
onFailure: (error4) => fail8(`Could not read file (${
|
|
60130
|
-
onSuccess: (content) => succeed8([
|
|
60157
|
+
var readString = (path7) => flatMap9(FileSystem, (fs) => matchEffect2(fs.readFileString(path7), {
|
|
60158
|
+
onFailure: (error4) => fail8(`Could not read file (${path7}): ${error4}`),
|
|
60159
|
+
onSuccess: (content) => succeed8([path7, content])
|
|
60131
60160
|
}));
|
|
60132
|
-
var parse5 = (
|
|
60133
|
-
const parser = fileParsers[format6 ??
|
|
60161
|
+
var parse5 = (path7, content, format6) => {
|
|
60162
|
+
const parser = fileParsers[format6 ?? path7.split(".").pop()];
|
|
60134
60163
|
if (parser === void 0) {
|
|
60135
60164
|
return fail8(`Unsupported file format: ${format6}`);
|
|
60136
60165
|
}
|
|
60137
60166
|
return try_2({
|
|
60138
60167
|
try: () => parser(content),
|
|
60139
|
-
catch: (e) => `Could not parse ${format6} file (${
|
|
60168
|
+
catch: (e) => `Could not parse ${format6} file (${path7}): ${e}`
|
|
60140
60169
|
});
|
|
60141
60170
|
};
|
|
60142
60171
|
|
|
@@ -62438,22 +62467,22 @@ var showConfirmation = /* @__PURE__ */ Confirm.$is("Show");
|
|
|
62438
62467
|
var renderBeep2 = /* @__PURE__ */ render3(beep3, {
|
|
62439
62468
|
style: "pretty"
|
|
62440
62469
|
});
|
|
62441
|
-
function resolveCurrentPath(
|
|
62442
|
-
return match2(
|
|
62470
|
+
function resolveCurrentPath(path7, options3) {
|
|
62471
|
+
return match2(path7, {
|
|
62443
62472
|
onNone: () => match2(options3.startingPath, {
|
|
62444
62473
|
onNone: () => sync4(() => process.cwd()),
|
|
62445
|
-
onSome: (
|
|
62474
|
+
onSome: (path8) => flatMap9(FileSystem, (fs) => (
|
|
62446
62475
|
// Ensure the user provided starting path exists
|
|
62447
|
-
orDie2(fs.exists(
|
|
62476
|
+
orDie2(fs.exists(path8)).pipe(filterOrDieMessage2(identity, `The provided starting path '${path8}' does not exist`), as5(path8))
|
|
62448
62477
|
))
|
|
62449
62478
|
}),
|
|
62450
|
-
onSome: (
|
|
62479
|
+
onSome: (path8) => succeed8(path8)
|
|
62451
62480
|
});
|
|
62452
62481
|
}
|
|
62453
62482
|
function getFileList(directory5, options3) {
|
|
62454
62483
|
return gen3(function* () {
|
|
62455
62484
|
const fs = yield* FileSystem;
|
|
62456
|
-
const
|
|
62485
|
+
const path7 = yield* Path3;
|
|
62457
62486
|
const files = yield* orDie2(fs.readDirectory(directory5)).pipe(
|
|
62458
62487
|
// Always prepend the `".."` option to the file list but allow it
|
|
62459
62488
|
// to be filtered out if the user so desires
|
|
@@ -62462,7 +62491,7 @@ function getFileList(directory5, options3) {
|
|
|
62462
62491
|
return yield* filter8(files, (file6) => {
|
|
62463
62492
|
const result = options3.filter(file6);
|
|
62464
62493
|
const userDefinedFilter = isEffect2(result) ? result : succeed8(result);
|
|
62465
|
-
const directoryFilter = options3.type === "directory" ? map16(orDie2(fs.stat(
|
|
62494
|
+
const directoryFilter = options3.type === "directory" ? map16(orDie2(fs.stat(path7.join(directory5, file6))), (info3) => info3.type === "Directory") : succeed8(true);
|
|
62466
62495
|
return zipWith5(userDefinedFilter, directoryFilter, (a, b) => a && b);
|
|
62467
62496
|
}, {
|
|
62468
62497
|
concurrency: files.length
|
|
@@ -62528,13 +62557,13 @@ function renderFiles(state, files, figures2, options3) {
|
|
|
62528
62557
|
}
|
|
62529
62558
|
function renderNextFrame2(state, options3) {
|
|
62530
62559
|
return gen3(function* () {
|
|
62531
|
-
const
|
|
62560
|
+
const path7 = yield* Path3;
|
|
62532
62561
|
const terminal = yield* Terminal;
|
|
62533
62562
|
const columns = yield* terminal.columns;
|
|
62534
62563
|
const figures2 = yield* figures;
|
|
62535
62564
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
62536
62565
|
const selectedPath = state.files[state.cursor];
|
|
62537
|
-
const resolvedPath =
|
|
62566
|
+
const resolvedPath = path7.resolve(currentPath, selectedPath);
|
|
62538
62567
|
const resolvedPathMsg = figures2.pointerSmall.pipe(cat2(space2), cat2(text3(resolvedPath)), annotate2(blackBright2));
|
|
62539
62568
|
if (showConfirmation(state.confirm)) {
|
|
62540
62569
|
const leadingSymbol2 = annotate2(text3("?"), cyanBright2);
|
|
@@ -62609,10 +62638,10 @@ function processCursorDown(state) {
|
|
|
62609
62638
|
function processSelection(state, options3) {
|
|
62610
62639
|
return gen3(function* () {
|
|
62611
62640
|
const fs = yield* FileSystem;
|
|
62612
|
-
const
|
|
62641
|
+
const path7 = yield* Path3;
|
|
62613
62642
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
62614
62643
|
const selectedPath = state.files[state.cursor];
|
|
62615
|
-
const resolvedPath =
|
|
62644
|
+
const resolvedPath = path7.resolve(currentPath, selectedPath);
|
|
62616
62645
|
const info3 = yield* orDie2(fs.stat(resolvedPath));
|
|
62617
62646
|
if (info3.type === "Directory") {
|
|
62618
62647
|
const files = yield* getFileList(resolvedPath, options3);
|
|
@@ -62660,10 +62689,10 @@ function handleProcess2(options3) {
|
|
|
62660
62689
|
case "y":
|
|
62661
62690
|
case "t": {
|
|
62662
62691
|
if (showConfirmation(state.confirm)) {
|
|
62663
|
-
const
|
|
62692
|
+
const path7 = yield* Path3;
|
|
62664
62693
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
62665
62694
|
const selectedPath = state.files[state.cursor];
|
|
62666
|
-
const resolvedPath =
|
|
62695
|
+
const resolvedPath = path7.resolve(currentPath, selectedPath);
|
|
62667
62696
|
const files = yield* getFileList(resolvedPath, options3);
|
|
62668
62697
|
return Action.NextFrame({
|
|
62669
62698
|
state: {
|
|
@@ -62679,10 +62708,10 @@ function handleProcess2(options3) {
|
|
|
62679
62708
|
case "n":
|
|
62680
62709
|
case "f": {
|
|
62681
62710
|
if (showConfirmation(state.confirm)) {
|
|
62682
|
-
const
|
|
62711
|
+
const path7 = yield* Path3;
|
|
62683
62712
|
const currentPath = yield* resolveCurrentPath(state.path, options3);
|
|
62684
62713
|
const selectedPath = state.files[state.cursor];
|
|
62685
|
-
const resolvedPath =
|
|
62714
|
+
const resolvedPath = path7.resolve(currentPath, selectedPath);
|
|
62686
62715
|
return Action.Submit({
|
|
62687
62716
|
value: resolvedPath
|
|
62688
62717
|
});
|
|
@@ -62704,14 +62733,14 @@ var file = (options3 = {}) => {
|
|
|
62704
62733
|
filter: options3.filter ?? (() => succeed8(true))
|
|
62705
62734
|
};
|
|
62706
62735
|
const initialState3 = gen3(function* () {
|
|
62707
|
-
const
|
|
62708
|
-
const currentPath = yield* resolveCurrentPath(
|
|
62736
|
+
const path7 = none2();
|
|
62737
|
+
const currentPath = yield* resolveCurrentPath(path7, opts);
|
|
62709
62738
|
const files = yield* getFileList(currentPath, opts);
|
|
62710
62739
|
const confirm = Confirm.Hide();
|
|
62711
62740
|
return {
|
|
62712
62741
|
cursor: 0,
|
|
62713
62742
|
files,
|
|
62714
|
-
path:
|
|
62743
|
+
path: path7,
|
|
62715
62744
|
confirm
|
|
62716
62745
|
};
|
|
62717
62746
|
});
|
|
@@ -63856,7 +63885,7 @@ var validateInternal = (self, value5, config2) => {
|
|
|
63856
63885
|
case "Path": {
|
|
63857
63886
|
return flatMap9(FileSystem, (fileSystem) => {
|
|
63858
63887
|
const errorMsg = "Path options do not have a default value";
|
|
63859
|
-
return orElseFail2(value5, () => errorMsg).pipe(tap3((
|
|
63888
|
+
return orElseFail2(value5, () => errorMsg).pipe(tap3((path7) => orDie2(fileSystem.exists(path7)).pipe(tap3((pathExists) => validatePathExistence(path7, self.pathExists, pathExists).pipe(zipRight4(validatePathType(path7, self.pathType, fileSystem).pipe(when2(() => self.pathExists !== "no" && pathExists))))))));
|
|
63860
63889
|
});
|
|
63861
63890
|
}
|
|
63862
63891
|
case "Redacted": {
|
|
@@ -63871,24 +63900,24 @@ var validateInternal = (self, value5, config2) => {
|
|
|
63871
63900
|
}
|
|
63872
63901
|
};
|
|
63873
63902
|
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}`)));
|
|
63874
|
-
var validatePathExistence = (
|
|
63903
|
+
var validatePathExistence = (path7, shouldPathExist, pathExists) => {
|
|
63875
63904
|
if (shouldPathExist === "no" && pathExists) {
|
|
63876
|
-
return fail8(`Path '${
|
|
63905
|
+
return fail8(`Path '${path7}' must not exist`);
|
|
63877
63906
|
}
|
|
63878
63907
|
if (shouldPathExist === "yes" && !pathExists) {
|
|
63879
|
-
return fail8(`Path '${
|
|
63908
|
+
return fail8(`Path '${path7}' must exist`);
|
|
63880
63909
|
}
|
|
63881
63910
|
return _void;
|
|
63882
63911
|
};
|
|
63883
|
-
var validatePathType = (
|
|
63912
|
+
var validatePathType = (path7, pathType, fileSystem) => {
|
|
63884
63913
|
switch (pathType) {
|
|
63885
63914
|
case "file": {
|
|
63886
|
-
const checkIsFile = fileSystem.stat(
|
|
63887
|
-
return fail8(`Expected path '${
|
|
63915
|
+
const checkIsFile = fileSystem.stat(path7).pipe(map16((info3) => info3.type === "File"), orDie2);
|
|
63916
|
+
return fail8(`Expected path '${path7}' to be a regular file`).pipe(unlessEffect2(checkIsFile), asVoid4);
|
|
63888
63917
|
}
|
|
63889
63918
|
case "directory": {
|
|
63890
|
-
const checkIsDirectory = fileSystem.stat(
|
|
63891
|
-
return fail8(`Expected path '${
|
|
63919
|
+
const checkIsDirectory = fileSystem.stat(path7).pipe(map16((info3) => info3.type === "Directory"), orDie2);
|
|
63920
|
+
return fail8(`Expected path '${path7}' to be a directory`).pipe(unlessEffect2(checkIsDirectory), asVoid4);
|
|
63892
63921
|
}
|
|
63893
63922
|
case "either": {
|
|
63894
63923
|
return _void;
|
|
@@ -64310,13 +64339,13 @@ var file2 = (config2) => makeSingle(fromNullable(config2?.name), path("file", co
|
|
|
64310
64339
|
var fileContent = (config2) => mapEffect6(file2({
|
|
64311
64340
|
...config2,
|
|
64312
64341
|
exists: "yes"
|
|
64313
|
-
}), (
|
|
64314
|
-
var fileParse = (config2) => mapEffect6(fileText(config2), ([
|
|
64342
|
+
}), (path7) => mapError2(read3(path7), (e) => p(e)));
|
|
64343
|
+
var fileParse = (config2) => mapEffect6(fileText(config2), ([path7, content]) => mapError2(parse5(path7, content, config2?.format), (e) => p(e)));
|
|
64315
64344
|
var fileSchema = (schema, config2) => withSchema(fileParse(config2), schema);
|
|
64316
64345
|
var fileText = (config2) => mapEffect6(file2({
|
|
64317
64346
|
...config2,
|
|
64318
64347
|
exists: "yes"
|
|
64319
|
-
}), (
|
|
64348
|
+
}), (path7) => mapError2(readString(path7), (e) => p(e)));
|
|
64320
64349
|
var float3 = (config2) => makeSingle(fromNullable(config2?.name), float2);
|
|
64321
64350
|
var integer4 = (config2) => makeSingle(fromNullable(config2?.name), integer3);
|
|
64322
64351
|
var none11 = /* @__PURE__ */ (() => {
|
|
@@ -64932,12 +64961,12 @@ var directory3 = (name, config2) => makeSingle2(name, empty2(), path("directory"
|
|
|
64932
64961
|
var file4 = (name, config2) => makeSingle2(name, empty2(), path("file", config2?.exists ?? "either"));
|
|
64933
64962
|
var fileContent3 = (name) => mapEffect8(file4(name, {
|
|
64934
64963
|
exists: "yes"
|
|
64935
|
-
}), (
|
|
64936
|
-
var fileParse3 = (name, format6) => mapEffect8(fileText3(name), ([
|
|
64964
|
+
}), (path7) => mapError2(read3(path7), (msg) => invalidValue(p(msg))));
|
|
64965
|
+
var fileParse3 = (name, format6) => mapEffect8(fileText3(name), ([path7, content]) => mapError2(parse5(path7, content, format6), (error4) => invalidValue(p(error4))));
|
|
64937
64966
|
var fileSchema3 = (name, schema, format6) => withSchema3(fileParse3(name, format6), schema);
|
|
64938
64967
|
var fileText3 = (name) => mapEffect8(file4(name, {
|
|
64939
64968
|
exists: "yes"
|
|
64940
|
-
}), (
|
|
64969
|
+
}), (path7) => mapError2(readString(path7), (error4) => invalidValue(p(error4))));
|
|
64941
64970
|
var filterMap8 = /* @__PURE__ */ dual(3, (self, f, message) => mapEffect8(self, (a) => match2(f(a), {
|
|
64942
64971
|
onNone: () => left2(invalidValue(p(message))),
|
|
64943
64972
|
onSome: right2
|
|
@@ -67116,7 +67145,7 @@ var Lesson = class {
|
|
|
67116
67145
|
this.root = opts.root;
|
|
67117
67146
|
}
|
|
67118
67147
|
absolutePath() {
|
|
67119
|
-
return
|
|
67148
|
+
return path4__namespace.resolve(this.root, this.sectionName, this.path);
|
|
67120
67149
|
}
|
|
67121
67150
|
allFiles() {
|
|
67122
67151
|
const absolutePath = this.absolutePath();
|
|
@@ -67125,27 +67154,27 @@ var Lesson = class {
|
|
|
67125
67154
|
const files = yield* fs.readDirectory(absolutePath, {
|
|
67126
67155
|
recursive: true
|
|
67127
67156
|
});
|
|
67128
|
-
return files.map((file6) =>
|
|
67157
|
+
return files.map((file6) => path4__namespace.join(absolutePath, file6));
|
|
67129
67158
|
});
|
|
67130
67159
|
}
|
|
67131
67160
|
subfolders() {
|
|
67132
67161
|
const absolutePath = this.absolutePath();
|
|
67133
67162
|
return this.allFiles().pipe(
|
|
67134
67163
|
Effect_exports.map(
|
|
67135
|
-
(files) => files.map((file6) =>
|
|
67136
|
-
return file6.split(
|
|
67164
|
+
(files) => files.map((file6) => path4__namespace.relative(absolutePath, file6)).filter((file6) => {
|
|
67165
|
+
return file6.split(path4__namespace.sep).length === 1;
|
|
67137
67166
|
})
|
|
67138
67167
|
)
|
|
67139
67168
|
);
|
|
67140
67169
|
}
|
|
67141
67170
|
};
|
|
67142
|
-
var getNameAndNumberFromPath = (
|
|
67143
|
-
const numSection =
|
|
67171
|
+
var getNameAndNumberFromPath = (path7) => {
|
|
67172
|
+
const numSection = path7.split("-")[0];
|
|
67144
67173
|
if (typeof numSection === "undefined") {
|
|
67145
67174
|
return Effect_exports.fail(
|
|
67146
67175
|
new InvalidPathError({
|
|
67147
|
-
path:
|
|
67148
|
-
message: `Could not retrieve number from path: ${
|
|
67176
|
+
path: path7,
|
|
67177
|
+
message: `Could not retrieve number from path: ${path7}`
|
|
67149
67178
|
})
|
|
67150
67179
|
);
|
|
67151
67180
|
}
|
|
@@ -67153,18 +67182,18 @@ var getNameAndNumberFromPath = (path6) => {
|
|
|
67153
67182
|
if (Number.isNaN(num)) {
|
|
67154
67183
|
return Effect_exports.fail(
|
|
67155
67184
|
new PathNumberIsNaNError({
|
|
67156
|
-
path:
|
|
67185
|
+
path: path7,
|
|
67157
67186
|
numSection,
|
|
67158
|
-
message: `Could not retrieve number from path: ${
|
|
67187
|
+
message: `Could not retrieve number from path: ${path7}`
|
|
67159
67188
|
})
|
|
67160
67189
|
);
|
|
67161
67190
|
}
|
|
67162
|
-
const name =
|
|
67191
|
+
const name = path7.split("-").slice(1).join("-");
|
|
67163
67192
|
if (!name) {
|
|
67164
67193
|
return Effect_exports.fail(
|
|
67165
67194
|
new InvalidPathError({
|
|
67166
|
-
path:
|
|
67167
|
-
message: `Could not retrieve name from path: ${
|
|
67195
|
+
path: path7,
|
|
67196
|
+
message: `Could not retrieve name from path: ${path7}`
|
|
67168
67197
|
})
|
|
67169
67198
|
);
|
|
67170
67199
|
}
|
|
@@ -67173,12 +67202,12 @@ var getNameAndNumberFromPath = (path6) => {
|
|
|
67173
67202
|
num
|
|
67174
67203
|
});
|
|
67175
67204
|
};
|
|
67176
|
-
var parseSection = Effect_exports.fn("parseSection")(function* (
|
|
67177
|
-
const { name, num } = yield* getNameAndNumberFromPath(
|
|
67205
|
+
var parseSection = Effect_exports.fn("parseSection")(function* (path7) {
|
|
67206
|
+
const { name, num } = yield* getNameAndNumberFromPath(path7);
|
|
67178
67207
|
return {
|
|
67179
67208
|
name,
|
|
67180
67209
|
num,
|
|
67181
|
-
path:
|
|
67210
|
+
path: path7
|
|
67182
67211
|
};
|
|
67183
67212
|
});
|
|
67184
67213
|
var filterMeOut = Symbol("filterMeOut");
|
|
@@ -67207,7 +67236,7 @@ var LessonParserService = class extends Effect_exports.Service()(
|
|
|
67207
67236
|
const sections = yield* Effect_exports.all(
|
|
67208
67237
|
rawSections.map((section) => {
|
|
67209
67238
|
return Effect_exports.gen(function* () {
|
|
67210
|
-
const sectionPath =
|
|
67239
|
+
const sectionPath = path4__namespace.join(root, section);
|
|
67211
67240
|
const stat3 = yield* fs.stat(sectionPath);
|
|
67212
67241
|
if (stat3.type !== "Directory") {
|
|
67213
67242
|
return filterMeOut;
|
|
@@ -67226,10 +67255,10 @@ var LessonParserService = class extends Effect_exports.Service()(
|
|
|
67226
67255
|
yield* Effect_exports.forEach(sections, (section) => {
|
|
67227
67256
|
return Effect_exports.gen(function* () {
|
|
67228
67257
|
const rawLessons = yield* fs.readDirectory(
|
|
67229
|
-
|
|
67258
|
+
path4__namespace.join(root, section.path)
|
|
67230
67259
|
);
|
|
67231
67260
|
for (const lesson of rawLessons) {
|
|
67232
|
-
const lessonPath =
|
|
67261
|
+
const lessonPath = path4__namespace.join(
|
|
67233
67262
|
root,
|
|
67234
67263
|
section.path,
|
|
67235
67264
|
lesson
|
|
@@ -67304,7 +67333,7 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
|
|
|
67304
67333
|
const previousLesson = lessons[foundLessonIndex - 1];
|
|
67305
67334
|
const nextLesson = lessons[foundLessonIndex + 1];
|
|
67306
67335
|
const subfolders = yield* foundLesson.subfolders().pipe(
|
|
67307
|
-
Effect_exports.map((files) => files.map((p3) =>
|
|
67336
|
+
Effect_exports.map((files) => files.map((p3) => path4__namespace.basename(p3)))
|
|
67308
67337
|
);
|
|
67309
67338
|
if (subfolders.length === 0) {
|
|
67310
67339
|
return yield* new LessonEntrypointNotFoundError({
|
|
@@ -67372,7 +67401,7 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
|
|
|
67372
67401
|
const mainFile = yield* foundLesson.allFiles().pipe(
|
|
67373
67402
|
Effect_exports.map(
|
|
67374
67403
|
(files) => files.find(
|
|
67375
|
-
(file6) => file6.includes(
|
|
67404
|
+
(file6) => file6.includes(path4__namespace.join(subfolder, "main.ts"))
|
|
67376
67405
|
)
|
|
67377
67406
|
)
|
|
67378
67407
|
);
|
|
@@ -67385,30 +67414,30 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
|
|
|
67385
67414
|
const readmeFile = yield* foundLesson.allFiles().pipe(
|
|
67386
67415
|
Effect_exports.map(
|
|
67387
67416
|
(files) => files.find(
|
|
67388
|
-
(file6) => file6.includes(
|
|
67417
|
+
(file6) => file6.includes(path4__namespace.join(subfolder, "readme.md"))
|
|
67389
67418
|
)
|
|
67390
67419
|
)
|
|
67391
67420
|
);
|
|
67392
67421
|
yield* Console_exports.clear;
|
|
67393
67422
|
yield* Console_exports.log(
|
|
67394
|
-
styleText(
|
|
67423
|
+
util.styleText(
|
|
67395
67424
|
"bold",
|
|
67396
67425
|
`Running ${foundLesson.num} ${subfolder}...`
|
|
67397
67426
|
)
|
|
67398
67427
|
);
|
|
67399
67428
|
yield* Console_exports.log(
|
|
67400
|
-
styleText(
|
|
67429
|
+
util.styleText(
|
|
67401
67430
|
"dim",
|
|
67402
67431
|
" Press n + enter to go to the next exercise"
|
|
67403
67432
|
)
|
|
67404
67433
|
);
|
|
67405
67434
|
yield* Console_exports.log(
|
|
67406
|
-
styleText("dim", " Press h + enter for more shortcuts\n")
|
|
67435
|
+
util.styleText("dim", " Press h + enter for more shortcuts\n")
|
|
67407
67436
|
);
|
|
67408
67437
|
if (readmeFile) {
|
|
67409
67438
|
yield* Console_exports.log(
|
|
67410
|
-
`${styleText([], "Instructions:")}
|
|
67411
|
-
${styleText(
|
|
67439
|
+
`${util.styleText([], "Instructions:")}
|
|
67440
|
+
${util.styleText(
|
|
67412
67441
|
"dim",
|
|
67413
67442
|
readmeFile
|
|
67414
67443
|
)}
|
|
@@ -67431,7 +67460,7 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
|
|
|
67431
67460
|
Effect_exports.map((code2) => code2 === 0 ? "exit" : "failed")
|
|
67432
67461
|
),
|
|
67433
67462
|
Effect_exports.gen(function* () {
|
|
67434
|
-
const rl =
|
|
67463
|
+
const rl = readline2__namespace.createInterface({
|
|
67435
67464
|
input: process.stdin
|
|
67436
67465
|
});
|
|
67437
67466
|
yield* Effect_exports.addFinalizer(() => {
|
|
@@ -67442,10 +67471,10 @@ var runLesson = Effect_exports.fn("runLesson")(function* (opts) {
|
|
|
67442
67471
|
() => rl.question("")
|
|
67443
67472
|
);
|
|
67444
67473
|
if (line4 === "h") {
|
|
67445
|
-
yield* Console_exports.log(styleText("bold", "Shortcuts:"));
|
|
67474
|
+
yield* Console_exports.log(util.styleText("bold", "Shortcuts:"));
|
|
67446
67475
|
for (const [key, value5] of Object.entries(shortcuts)) {
|
|
67447
67476
|
yield* Console_exports.log(
|
|
67448
|
-
` ${key} ${styleText("dim", `- ${value5}`)}`
|
|
67477
|
+
` ${key} ${util.styleText("dim", `- ${value5}`)}`
|
|
67449
67478
|
);
|
|
67450
67479
|
}
|
|
67451
67480
|
} else if (line4 === "q") {
|
|
@@ -67596,13 +67625,13 @@ var exercise = Command_exports2.make(
|
|
|
67596
67625
|
Options_exports.withDescription(
|
|
67597
67626
|
"The directory to look for lessons"
|
|
67598
67627
|
),
|
|
67599
|
-
Options_exports.withDefault(
|
|
67628
|
+
Options_exports.withDefault(path4__namespace.join(process.cwd(), "exercises"))
|
|
67600
67629
|
),
|
|
67601
67630
|
envFilePath: Options_exports.text("env-file").pipe(
|
|
67602
67631
|
Options_exports.withDescription(
|
|
67603
67632
|
"The path to the environment file to use"
|
|
67604
67633
|
),
|
|
67605
|
-
Options_exports.withDefault(
|
|
67634
|
+
Options_exports.withDefault(path4__namespace.join(process.cwd(), ".env"))
|
|
67606
67635
|
),
|
|
67607
67636
|
cwd: Options_exports.text("cwd").pipe(
|
|
67608
67637
|
Options_exports.withDescription(
|
|
@@ -67630,6 +67659,155 @@ var exercise = Command_exports2.make(
|
|
|
67630
67659
|
});
|
|
67631
67660
|
}
|
|
67632
67661
|
);
|
|
67662
|
+
var notFound2 = Symbol("notFound");
|
|
67663
|
+
var getNumberFromPathSegment = (path7) => {
|
|
67664
|
+
const numberSegment = path7.split("-")[0];
|
|
67665
|
+
return Number.isNaN(Number(numberSegment)) ? notFound2 : Number(numberSegment);
|
|
67666
|
+
};
|
|
67667
|
+
var startsWithNumber = (segment) => {
|
|
67668
|
+
const numberSegment = segment.split("-")[0];
|
|
67669
|
+
if (numberSegment === void 0) {
|
|
67670
|
+
return false;
|
|
67671
|
+
}
|
|
67672
|
+
return !Number.isNaN(Number(numberSegment));
|
|
67673
|
+
};
|
|
67674
|
+
var splitFilePath = (filePath) => filePath.split(path4__namespace.sep);
|
|
67675
|
+
var getSectionAndLessonNumberFromPath = (filePath) => {
|
|
67676
|
+
const segments = splitFilePath(filePath);
|
|
67677
|
+
const lastSegmentWithNumber = segments.findLastIndex(startsWithNumber);
|
|
67678
|
+
if (lastSegmentWithNumber === -1) {
|
|
67679
|
+
return notFound2;
|
|
67680
|
+
}
|
|
67681
|
+
const exerciseSegment = segments[lastSegmentWithNumber];
|
|
67682
|
+
const sectionSegment = segments[lastSegmentWithNumber - 1];
|
|
67683
|
+
if (sectionSegment === void 0) {
|
|
67684
|
+
return notFound2;
|
|
67685
|
+
}
|
|
67686
|
+
const sectionNumber = getNumberFromPathSegment(sectionSegment);
|
|
67687
|
+
if (sectionNumber === notFound2) {
|
|
67688
|
+
return notFound2;
|
|
67689
|
+
}
|
|
67690
|
+
const lessonNumber = getNumberFromPathSegment(exerciseSegment);
|
|
67691
|
+
if (lessonNumber === notFound2) {
|
|
67692
|
+
return notFound2;
|
|
67693
|
+
}
|
|
67694
|
+
return {
|
|
67695
|
+
sectionNumber,
|
|
67696
|
+
lessonNumber,
|
|
67697
|
+
lessonPathWithNumber: exerciseSegment,
|
|
67698
|
+
sectionPathWithNumber: sectionSegment
|
|
67699
|
+
};
|
|
67700
|
+
};
|
|
67701
|
+
var unique = (arr) => [...new Set(arr)];
|
|
67702
|
+
var mapToLessonPath = (filePath) => {
|
|
67703
|
+
const sectionAndLessonNumber = getSectionAndLessonNumberFromPath(filePath);
|
|
67704
|
+
if (sectionAndLessonNumber === notFound2) {
|
|
67705
|
+
return notFound2;
|
|
67706
|
+
}
|
|
67707
|
+
return `${sectionAndLessonNumber.sectionPathWithNumber}${path4__namespace.sep}${sectionAndLessonNumber.lessonPathWithNumber}`;
|
|
67708
|
+
};
|
|
67709
|
+
var getChangedFiles = (rawDiffOutput) => {
|
|
67710
|
+
const splitDiffOutput = rawDiffOutput.trim().split("\n").filter(Boolean);
|
|
67711
|
+
const renamedFiles = splitDiffOutput.filter((line4) => line4.includes("rename")).map((line4) => {
|
|
67712
|
+
line4 = line4.replace(/\s*\(\d+%\)$/, "");
|
|
67713
|
+
const match17 = line4.match(
|
|
67714
|
+
/rename (.*?){(.+?) => (.+?)}(.*)/
|
|
67715
|
+
);
|
|
67716
|
+
if (!match17) return null;
|
|
67717
|
+
const [, prefix, oldSegment, newSegment, suffix] = match17;
|
|
67718
|
+
const oldPath = prefix + oldSegment + suffix;
|
|
67719
|
+
const newPath = prefix + newSegment + suffix;
|
|
67720
|
+
return { oldPath, newPath };
|
|
67721
|
+
}).filter((m) => m !== null);
|
|
67722
|
+
const createdFiles = splitDiffOutput.filter((line4) => line4.includes("create")).map((line4) => line4.replace(/^create mode \d+/, "").trim());
|
|
67723
|
+
const deletedFiles = splitDiffOutput.filter((line4) => line4.includes("delete")).map((line4) => line4.replace(/^delete mode \d+/, "").trim());
|
|
67724
|
+
return {
|
|
67725
|
+
created: unique(
|
|
67726
|
+
createdFiles.map(mapToLessonPath).filter((m) => m !== notFound2)
|
|
67727
|
+
),
|
|
67728
|
+
deleted: unique(
|
|
67729
|
+
deletedFiles.map(mapToLessonPath).filter((m) => m !== notFound2)
|
|
67730
|
+
),
|
|
67731
|
+
renamed: renamedFiles.reduce((acc, m) => {
|
|
67732
|
+
const oldPath = mapToLessonPath(m.oldPath);
|
|
67733
|
+
const newPath = mapToLessonPath(m.newPath);
|
|
67734
|
+
if (oldPath === notFound2 || newPath === notFound2) {
|
|
67735
|
+
return acc;
|
|
67736
|
+
}
|
|
67737
|
+
acc[oldPath] = newPath;
|
|
67738
|
+
return acc;
|
|
67739
|
+
}, {})
|
|
67740
|
+
};
|
|
67741
|
+
};
|
|
67742
|
+
var updateCVM = Command_exports2.make(
|
|
67743
|
+
"update-cvm",
|
|
67744
|
+
{
|
|
67745
|
+
root: Options_exports.text("root").pipe(
|
|
67746
|
+
Options_exports.withDescription(
|
|
67747
|
+
"The root directory of the exercises"
|
|
67748
|
+
),
|
|
67749
|
+
Options_exports.withDefault(path4__namespace.join(process.cwd(), "exercises"))
|
|
67750
|
+
)
|
|
67751
|
+
},
|
|
67752
|
+
({ root }) => Effect_exports.gen(function* () {
|
|
67753
|
+
if (!process.env.ALWAYS_UPDATE_CVM) {
|
|
67754
|
+
yield* Effect_exports.log(
|
|
67755
|
+
"[update-cvm] Skipping CVM update because ALWAYS_UPDATE_CVM is not set in the environment"
|
|
67756
|
+
);
|
|
67757
|
+
return;
|
|
67758
|
+
}
|
|
67759
|
+
const diffCommand = Command_exports.make(
|
|
67760
|
+
"git",
|
|
67761
|
+
"diff",
|
|
67762
|
+
"--summary",
|
|
67763
|
+
"--cached"
|
|
67764
|
+
);
|
|
67765
|
+
const diff8 = yield* Command_exports.string(diffCommand);
|
|
67766
|
+
const changedFiles = getChangedFiles(diff8);
|
|
67767
|
+
if (changedFiles.created.length === 0 && changedFiles.deleted.length === 0 && Object.keys(changedFiles.renamed).length === 0) {
|
|
67768
|
+
yield* Effect_exports.log("[update-cvm] No changes to the CVM");
|
|
67769
|
+
return;
|
|
67770
|
+
}
|
|
67771
|
+
const filteredDeletedLessons = changedFiles.deleted.filter(
|
|
67772
|
+
(lesson) => {
|
|
67773
|
+
const lessonPath = path4__namespace.join(root, lesson);
|
|
67774
|
+
return !NFS.existsSync(lessonPath);
|
|
67775
|
+
}
|
|
67776
|
+
);
|
|
67777
|
+
const wasPingSuccessful = yield* Effect_exports.promise(
|
|
67778
|
+
() => fetch("http://localhost:5173/api/ping")
|
|
67779
|
+
).pipe(Effect_exports.map((res) => res.ok));
|
|
67780
|
+
if (!wasPingSuccessful) {
|
|
67781
|
+
yield* Effect_exports.logError(
|
|
67782
|
+
"[update-cvm] Failed to ping the CVM - is the CVM running?"
|
|
67783
|
+
);
|
|
67784
|
+
return;
|
|
67785
|
+
}
|
|
67786
|
+
const updateResponse = yield* Effect_exports.promise(
|
|
67787
|
+
() => fetch("http://localhost:5173/api/repos/update", {
|
|
67788
|
+
method: "POST",
|
|
67789
|
+
body: JSON.stringify({
|
|
67790
|
+
filePath: root,
|
|
67791
|
+
modifiedLessons: changedFiles.renamed,
|
|
67792
|
+
addedLessons: changedFiles.created,
|
|
67793
|
+
deletedLessons: filteredDeletedLessons
|
|
67794
|
+
})
|
|
67795
|
+
})
|
|
67796
|
+
);
|
|
67797
|
+
if (!updateResponse.ok) {
|
|
67798
|
+
const output = yield* Effect_exports.promise(
|
|
67799
|
+
() => updateResponse.text()
|
|
67800
|
+
);
|
|
67801
|
+
yield* Effect_exports.logError(
|
|
67802
|
+
"[update-cvm] Failed to update the CVM: " + output
|
|
67803
|
+
);
|
|
67804
|
+
return;
|
|
67805
|
+
}
|
|
67806
|
+
yield* Effect_exports.log(
|
|
67807
|
+
"[update-cvm] Successfully updated the CVM"
|
|
67808
|
+
);
|
|
67809
|
+
})
|
|
67810
|
+
);
|
|
67633
67811
|
|
|
67634
67812
|
// src/internal/internal.ts
|
|
67635
67813
|
var upgradePackages = Command_exports2.make(
|
|
@@ -67653,9 +67831,9 @@ var upgradePackages = Command_exports2.make(
|
|
|
67653
67831
|
const updateCommand = Command_exports.make(
|
|
67654
67832
|
"pnpm",
|
|
67655
67833
|
"upgrade",
|
|
67656
|
-
"ai",
|
|
67657
|
-
"@ai-sdk
|
|
67658
|
-
"ai-hero-cli"
|
|
67834
|
+
"ai@latest",
|
|
67835
|
+
"@ai-sdk/*@latest",
|
|
67836
|
+
"ai-hero-cli@latest"
|
|
67659
67837
|
).pipe(
|
|
67660
67838
|
verbose ? Command_exports.stdout("inherit") : Command_exports.stdout("pipe"),
|
|
67661
67839
|
verbose ? Command_exports.stderr("inherit") : Command_exports.stderr("pipe"),
|
|
@@ -67665,7 +67843,7 @@ var upgradePackages = Command_exports2.make(
|
|
|
67665
67843
|
if (exitCode3 === 0) {
|
|
67666
67844
|
yield* Console_exports.log("Successfully upgraded");
|
|
67667
67845
|
} else {
|
|
67668
|
-
yield* Console_exports.
|
|
67846
|
+
yield* Console_exports.error(
|
|
67669
67847
|
"Failed to upgrade. Please try again."
|
|
67670
67848
|
);
|
|
67671
67849
|
}
|
|
@@ -67674,7 +67852,7 @@ var upgradePackages = Command_exports2.make(
|
|
|
67674
67852
|
Command_exports2.withDescription("Upgrade the AI SDK packages")
|
|
67675
67853
|
);
|
|
67676
67854
|
var internal = Command_exports2.make("internal").pipe(
|
|
67677
|
-
Command_exports2.withSubcommands([upgradePackages]),
|
|
67855
|
+
Command_exports2.withSubcommands([upgradePackages, updateCVM]),
|
|
67678
67856
|
Command_exports2.withDescription("Internal commands for AI Hero")
|
|
67679
67857
|
);
|
|
67680
67858
|
|