paper-snapshot-cli 0.1.2 → 0.1.3
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/dist/bin.mjs +149 -291
- package/package.json +1 -1
package/dist/bin.mjs
CHANGED
|
@@ -2915,7 +2915,7 @@ const Prototype = (options) => makePrimitiveProto({
|
|
|
2915
2915
|
* @category constructors
|
|
2916
2916
|
* @since 2.0.0
|
|
2917
2917
|
*/
|
|
2918
|
-
const make$
|
|
2918
|
+
const make$37 = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
2919
2919
|
const isStrictEquivalent = (x, y) => x === y;
|
|
2920
2920
|
/**
|
|
2921
2921
|
* Creates an equivalence relation that uses strict equality (`===`) to compare values.
|
|
@@ -3025,7 +3025,7 @@ const strictEqual = () => isStrictEquivalent;
|
|
|
3025
3025
|
* @since 4.0.0
|
|
3026
3026
|
*/
|
|
3027
3027
|
function Tuple$1(elements) {
|
|
3028
|
-
return make$
|
|
3028
|
+
return make$37((self, that) => {
|
|
3029
3029
|
if (self.length !== that.length) return false;
|
|
3030
3030
|
for (let i = 0; i < self.length; i++) if (!elements[i](self[i], that[i])) return false;
|
|
3031
3031
|
return true;
|
|
@@ -3035,7 +3035,7 @@ function Tuple$1(elements) {
|
|
|
3035
3035
|
* @since 4.0.0
|
|
3036
3036
|
*/
|
|
3037
3037
|
function Array_(item) {
|
|
3038
|
-
return make$
|
|
3038
|
+
return make$37((self, that) => {
|
|
3039
3039
|
if (self.length !== that.length) return false;
|
|
3040
3040
|
for (let i = 0; i < self.length; i++) if (!item(self[i], that[i])) return false;
|
|
3041
3041
|
return true;
|
|
@@ -3237,7 +3237,7 @@ const succeed$7 = (success) => new SuccessImpl(success);
|
|
|
3237
3237
|
* @category constructors
|
|
3238
3238
|
* @since 2.0.0
|
|
3239
3239
|
*/
|
|
3240
|
-
function make$
|
|
3240
|
+
function make$36(compare) {
|
|
3241
3241
|
return (self, that) => self === that ? 0 : compare(self, that);
|
|
3242
3242
|
}
|
|
3243
3243
|
/**
|
|
@@ -3268,7 +3268,7 @@ function make$35(compare) {
|
|
|
3268
3268
|
* @category instances
|
|
3269
3269
|
* @since 4.0.0
|
|
3270
3270
|
*/
|
|
3271
|
-
const String$10 = /*#__PURE__*/ make$
|
|
3271
|
+
const String$10 = /*#__PURE__*/ make$36((self, that) => self < that ? -1 : 1);
|
|
3272
3272
|
/**
|
|
3273
3273
|
* Order instance for numbers that compares them numerically.
|
|
3274
3274
|
*
|
|
@@ -3301,7 +3301,7 @@ const String$10 = /*#__PURE__*/ make$35((self, that) => self < that ? -1 : 1);
|
|
|
3301
3301
|
* @category instances
|
|
3302
3302
|
* @since 4.0.0
|
|
3303
3303
|
*/
|
|
3304
|
-
const Number$6 = /*#__PURE__*/ make$
|
|
3304
|
+
const Number$6 = /*#__PURE__*/ make$36((self, that) => {
|
|
3305
3305
|
if (globalThis.Number.isNaN(self) && globalThis.Number.isNaN(that)) return 0;
|
|
3306
3306
|
if (globalThis.Number.isNaN(self)) return -1;
|
|
3307
3307
|
if (globalThis.Number.isNaN(that)) return 1;
|
|
@@ -3340,7 +3340,7 @@ const Number$6 = /*#__PURE__*/ make$35((self, that) => {
|
|
|
3340
3340
|
* @category mapping
|
|
3341
3341
|
* @since 2.0.0
|
|
3342
3342
|
*/
|
|
3343
|
-
const mapInput = /*#__PURE__*/ dual(2, (self, f) => make$
|
|
3343
|
+
const mapInput = /*#__PURE__*/ dual(2, (self, f) => make$36((b1, b2) => self(f(b1), f(b2))));
|
|
3344
3344
|
/**
|
|
3345
3345
|
* Checks whether one value is strictly greater than another according to the given order.
|
|
3346
3346
|
*
|
|
@@ -3972,7 +3972,7 @@ const ServiceProto = {
|
|
|
3972
3972
|
return self;
|
|
3973
3973
|
},
|
|
3974
3974
|
context(self) {
|
|
3975
|
-
return make$
|
|
3975
|
+
return make$35(this, self);
|
|
3976
3976
|
},
|
|
3977
3977
|
use(f) {
|
|
3978
3978
|
return withFiber$1((fiber) => f(get$2(fiber.context, this)));
|
|
@@ -4177,7 +4177,7 @@ const emptyContext = /*#__PURE__*/ makeUnsafe$5(/*#__PURE__*/ new Map());
|
|
|
4177
4177
|
* @category constructors
|
|
4178
4178
|
* @since 2.0.0
|
|
4179
4179
|
*/
|
|
4180
|
-
const make$
|
|
4180
|
+
const make$35 = (key, service) => makeUnsafe$5(/* @__PURE__ */ new Map([[key.key, service]]));
|
|
4181
4181
|
/**
|
|
4182
4182
|
* Adds a service to a given `Context`.
|
|
4183
4183
|
*
|
|
@@ -5393,7 +5393,7 @@ const bigintNanosPerDay = /*#__PURE__*/ BigInt(864e11);
|
|
|
5393
5393
|
const bigintNanosPerWeek = /*#__PURE__*/ BigInt(6048e11);
|
|
5394
5394
|
const roundTiesAwayFromZero = (input) => BigInt(Math.sign(input) * Math.round(Math.abs(input)));
|
|
5395
5395
|
const roundMillisToNanos = (millis) => Number.isInteger(millis) ? BigInt(millis) * bigint1e6 : roundTiesAwayFromZero(millis * 1e6);
|
|
5396
|
-
const fromNanosNumber = (nanos) => make$
|
|
5396
|
+
const fromNanosNumber = (nanos) => make$34(Number.isFinite(nanos) ? roundTiesAwayFromZero(nanos) : nanos);
|
|
5397
5397
|
const nanosToUnit = (nanos, divisor) => {
|
|
5398
5398
|
const value = Number(nanos);
|
|
5399
5399
|
if (Number.isFinite(value)) return value / divisor;
|
|
@@ -5416,9 +5416,9 @@ const divideTiesAwayFromZero = (numerator, denominator) => {
|
|
|
5416
5416
|
};
|
|
5417
5417
|
const fromMillisString = (input, scale) => {
|
|
5418
5418
|
const millis = Number(input) * scale;
|
|
5419
|
-
if (!Number.isFinite(millis)) return make$
|
|
5419
|
+
if (!Number.isFinite(millis)) return make$34(millis);
|
|
5420
5420
|
const nanos = parseNanos(input, BigInt(scale) * bigint1e6);
|
|
5421
|
-
return make$
|
|
5421
|
+
return make$34(Number.isInteger(millis) && BigInt(millis) * bigint1e6 === nanos ? millis : nanos);
|
|
5422
5422
|
};
|
|
5423
5423
|
const DURATION_REGEXP = /^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/;
|
|
5424
5424
|
/**
|
|
@@ -5485,7 +5485,7 @@ const fromInputUnsafe$1 = (input) => {
|
|
|
5485
5485
|
if (input[0] === -Infinity || input[1] === -Infinity) return negativeInfinity;
|
|
5486
5486
|
if (input[0] === Infinity || input[1] === Infinity) return infinity;
|
|
5487
5487
|
const nanos = input[0] * 1e9 + input[1];
|
|
5488
|
-
return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ? make$
|
|
5488
|
+
return Number.isFinite(nanos) && Number.isInteger(input[0]) && Number.isInteger(input[1]) ? make$34(BigInt(input[0]) * bigint1e9 + BigInt(input[1])) : fromNanosNumber(nanos);
|
|
5489
5489
|
}
|
|
5490
5490
|
const obj = input;
|
|
5491
5491
|
let millis = 0;
|
|
@@ -5496,13 +5496,13 @@ const fromInputUnsafe$1 = (input) => {
|
|
|
5496
5496
|
if (obj.seconds) millis += obj.seconds * 1e3;
|
|
5497
5497
|
if (obj.milliseconds) millis += obj.milliseconds;
|
|
5498
5498
|
if (!obj.microseconds && !obj.nanoseconds) {
|
|
5499
|
-
if (!Number.isFinite(millis)) return make$
|
|
5499
|
+
if (!Number.isFinite(millis)) return make$34(millis);
|
|
5500
5500
|
const exact = sumObjectNanos(obj);
|
|
5501
|
-
return exact === void 0 || BigInt(millis) * bigint1e6 === exact ? make$
|
|
5501
|
+
return exact === void 0 || BigInt(millis) * bigint1e6 === exact ? make$34(millis) : make$34(exact);
|
|
5502
5502
|
}
|
|
5503
5503
|
const nanos = millis * 1e6 + (obj.microseconds ?? 0) * 1e3 + (obj.nanoseconds ?? 0);
|
|
5504
5504
|
const exact = Number.isFinite(nanos) ? sumObjectNanos(obj) : void 0;
|
|
5505
|
-
return exact === void 0 ? fromNanosNumber(nanos) : make$
|
|
5505
|
+
return exact === void 0 ? fromNanosNumber(nanos) : make$34(exact);
|
|
5506
5506
|
}
|
|
5507
5507
|
}
|
|
5508
5508
|
return invalid$2(input);
|
|
@@ -5579,7 +5579,7 @@ const DurationProto = {
|
|
|
5579
5579
|
return pipeArguments(this, arguments);
|
|
5580
5580
|
}
|
|
5581
5581
|
};
|
|
5582
|
-
const make$
|
|
5582
|
+
const make$34 = (input) => {
|
|
5583
5583
|
const duration = Object.create(DurationProto);
|
|
5584
5584
|
if (typeof input === "number") {
|
|
5585
5585
|
if (isNaN(input) || input === 0 || Object.is(input, -0)) duration.value = zeroDurationValue;
|
|
@@ -5702,8 +5702,8 @@ const abs = (self) => {
|
|
|
5702
5702
|
switch (self.value._tag) {
|
|
5703
5703
|
case "Infinity":
|
|
5704
5704
|
case "NegativeInfinity": return infinity;
|
|
5705
|
-
case "Millis": return self.value.millis < 0 ? make$
|
|
5706
|
-
case "Nanos": return self.value.nanos < bigint0$3 ? make$
|
|
5705
|
+
case "Millis": return self.value.millis < 0 ? make$34(-self.value.millis) : self;
|
|
5706
|
+
case "Nanos": return self.value.nanos < bigint0$3 ? make$34(-self.value.nanos) : self;
|
|
5707
5707
|
}
|
|
5708
5708
|
};
|
|
5709
5709
|
/**
|
|
@@ -5721,7 +5721,7 @@ const abs = (self) => {
|
|
|
5721
5721
|
* @category constructors
|
|
5722
5722
|
* @since 2.0.0
|
|
5723
5723
|
*/
|
|
5724
|
-
const zero$1 = /*#__PURE__*/ make$
|
|
5724
|
+
const zero$1 = /*#__PURE__*/ make$34(0);
|
|
5725
5725
|
/**
|
|
5726
5726
|
* A Duration representing infinite time.
|
|
5727
5727
|
*
|
|
@@ -5737,7 +5737,7 @@ const zero$1 = /*#__PURE__*/ make$33(0);
|
|
|
5737
5737
|
* @category constructors
|
|
5738
5738
|
* @since 2.0.0
|
|
5739
5739
|
*/
|
|
5740
|
-
const infinity = /*#__PURE__*/ make$
|
|
5740
|
+
const infinity = /*#__PURE__*/ make$34(Infinity);
|
|
5741
5741
|
/**
|
|
5742
5742
|
* A Duration representing negative infinite time.
|
|
5743
5743
|
*
|
|
@@ -5753,7 +5753,7 @@ const infinity = /*#__PURE__*/ make$33(Infinity);
|
|
|
5753
5753
|
* @category constructors
|
|
5754
5754
|
* @since 4.0.0
|
|
5755
5755
|
*/
|
|
5756
|
-
const negativeInfinity = /*#__PURE__*/ make$
|
|
5756
|
+
const negativeInfinity = /*#__PURE__*/ make$34(-Infinity);
|
|
5757
5757
|
/**
|
|
5758
5758
|
* Creates a Duration from nanoseconds.
|
|
5759
5759
|
*
|
|
@@ -5769,7 +5769,7 @@ const negativeInfinity = /*#__PURE__*/ make$33(-Infinity);
|
|
|
5769
5769
|
* @category constructors
|
|
5770
5770
|
* @since 2.0.0
|
|
5771
5771
|
*/
|
|
5772
|
-
const nanos = (nanos) => make$
|
|
5772
|
+
const nanos = (nanos) => make$34(nanos);
|
|
5773
5773
|
/**
|
|
5774
5774
|
* Creates a Duration from milliseconds.
|
|
5775
5775
|
*
|
|
@@ -5785,7 +5785,7 @@ const nanos = (nanos) => make$33(nanos);
|
|
|
5785
5785
|
* @category constructors
|
|
5786
5786
|
* @since 2.0.0
|
|
5787
5787
|
*/
|
|
5788
|
-
const millis = (millis) => make$
|
|
5788
|
+
const millis = (millis) => make$34(millis);
|
|
5789
5789
|
/**
|
|
5790
5790
|
* Creates a Duration from seconds.
|
|
5791
5791
|
*
|
|
@@ -5801,7 +5801,7 @@ const millis = (millis) => make$33(millis);
|
|
|
5801
5801
|
* @category constructors
|
|
5802
5802
|
* @since 2.0.0
|
|
5803
5803
|
*/
|
|
5804
|
-
const seconds = (seconds) => make$
|
|
5804
|
+
const seconds = (seconds) => make$34(seconds * 1e3);
|
|
5805
5805
|
/**
|
|
5806
5806
|
* Creates a Duration from minutes.
|
|
5807
5807
|
*
|
|
@@ -5817,7 +5817,7 @@ const seconds = (seconds) => make$33(seconds * 1e3);
|
|
|
5817
5817
|
* @category constructors
|
|
5818
5818
|
* @since 2.0.0
|
|
5819
5819
|
*/
|
|
5820
|
-
const minutes = (minutes) => make$
|
|
5820
|
+
const minutes = (minutes) => make$34(minutes * 6e4);
|
|
5821
5821
|
/**
|
|
5822
5822
|
* Converts a Duration to milliseconds.
|
|
5823
5823
|
*
|
|
@@ -5962,7 +5962,7 @@ const matchPair = /*#__PURE__*/ dual(3, (self, that, options) => {
|
|
|
5962
5962
|
* @category instances
|
|
5963
5963
|
* @since 2.0.0
|
|
5964
5964
|
*/
|
|
5965
|
-
const Order$1 = /*#__PURE__*/ make$
|
|
5965
|
+
const Order$1 = /*#__PURE__*/ make$36((self, that) => matchPair(self, that, {
|
|
5966
5966
|
onMillis: (self, that) => self < that ? -1 : self > that ? 1 : 0,
|
|
5967
5967
|
onNanos: (self, that) => self < that ? -1 : self > that ? 1 : 0,
|
|
5968
5968
|
onInfinity: (self, that) => {
|
|
@@ -6664,7 +6664,7 @@ var ParentSpan = class extends (/*#__PURE__*/ Service$3()(ParentSpanKey, { fiber
|
|
|
6664
6664
|
* @category constructors
|
|
6665
6665
|
* @since 2.0.0
|
|
6666
6666
|
*/
|
|
6667
|
-
const make$
|
|
6667
|
+
const make$33 = (options) => options;
|
|
6668
6668
|
/**
|
|
6669
6669
|
* Context reference for disabling trace propagation.
|
|
6670
6670
|
*
|
|
@@ -6769,7 +6769,7 @@ const TracerKey = "effect/Tracer";
|
|
|
6769
6769
|
* @category references
|
|
6770
6770
|
* @since 4.0.0
|
|
6771
6771
|
*/
|
|
6772
|
-
const nativeTracer = /*#__PURE__*/ make$
|
|
6772
|
+
const nativeTracer = /*#__PURE__*/ make$33({ span: (options) => new NativeSpan(options) });
|
|
6773
6773
|
/**
|
|
6774
6774
|
* Default in-memory `Span` implementation used by the native tracer. It
|
|
6775
6775
|
* generates span and trace identifiers, stores attributes, events, and links,
|
|
@@ -7195,7 +7195,7 @@ var FiberImpl = class {
|
|
|
7195
7195
|
interruptUnsafe(fiberId, annotations) {
|
|
7196
7196
|
if (this._exit) return;
|
|
7197
7197
|
let cause = causeInterrupt(fiberId);
|
|
7198
|
-
if (this.cache.stackFrame) cause = causeAnnotate(cause, make$
|
|
7198
|
+
if (this.cache.stackFrame) cause = causeAnnotate(cause, make$35(StackTraceKey, this.cache.stackFrame));
|
|
7199
7199
|
if (annotations) cause = causeAnnotate(cause, annotations);
|
|
7200
7200
|
this._interruptedCause = this._interruptedCause ? causeAddInterrupts(this._interruptedCause, cause) : cause;
|
|
7201
7201
|
if (this.interruptible) {
|
|
@@ -8899,7 +8899,7 @@ const isLogLevelGreaterThan = /*#__PURE__*/ isGreaterThan$1(/* @__PURE__ */ mapI
|
|
|
8899
8899
|
/** @internal */
|
|
8900
8900
|
const CurrentLoggers$1 = /*#__PURE__*/ Reference("effect/Logger/CurrentLoggers", { defaultValue: () => /* @__PURE__ */ new Set([defaultLogger, tracerLogger]) });
|
|
8901
8901
|
/** @internal */
|
|
8902
|
-
const LogToStderr
|
|
8902
|
+
const LogToStderr = /*#__PURE__*/ Reference("effect/Logger/LogToStderr", { defaultValue: constFalse });
|
|
8903
8903
|
const LoggerProto = {
|
|
8904
8904
|
["~effect/Logger"]: {
|
|
8905
8905
|
_Message: identity,
|
|
@@ -8931,14 +8931,6 @@ const formatLogSpan = (self, now) => {
|
|
|
8931
8931
|
return `${formatLabel(self[0])}=${now - self[1]}ms`;
|
|
8932
8932
|
};
|
|
8933
8933
|
/** @internal */
|
|
8934
|
-
const structuredMessage = (u) => {
|
|
8935
|
-
switch (typeof u) {
|
|
8936
|
-
case "function":
|
|
8937
|
-
case "symbol": return String(u);
|
|
8938
|
-
default: return toJson(u);
|
|
8939
|
-
}
|
|
8940
|
-
};
|
|
8941
|
-
/** @internal */
|
|
8942
8934
|
const logWithLevel = (level) => (...message) => {
|
|
8943
8935
|
let cause = void 0;
|
|
8944
8936
|
for (let i = 0, len = message.length; i < len; i++) {
|
|
@@ -8969,12 +8961,6 @@ const logWithLevel = (level) => (...message) => {
|
|
|
8969
8961
|
return void_$2;
|
|
8970
8962
|
});
|
|
8971
8963
|
};
|
|
8972
|
-
const withColor = (text, ...colors) => {
|
|
8973
|
-
let out = "";
|
|
8974
|
-
for (let i = 0; i < colors.length; i++) out += `\x1b[${colors[i]}m`;
|
|
8975
|
-
return out + text + "\x1B[0m";
|
|
8976
|
-
};
|
|
8977
|
-
const withColorNoop = (text, ..._colors) => text;
|
|
8978
8964
|
const colors = {
|
|
8979
8965
|
bold: "1",
|
|
8980
8966
|
red: "31",
|
|
@@ -8987,107 +8973,9 @@ const colors = {
|
|
|
8987
8973
|
black: "30",
|
|
8988
8974
|
bgBrightRed: "101"
|
|
8989
8975
|
};
|
|
8990
|
-
|
|
8991
|
-
None: [],
|
|
8992
|
-
All: [],
|
|
8993
|
-
Trace: [colors.gray],
|
|
8994
|
-
Debug: [colors.blue],
|
|
8995
|
-
Info: [colors.green],
|
|
8996
|
-
Warn: [colors.yellow],
|
|
8997
|
-
Error: [colors.red],
|
|
8998
|
-
Fatal: [colors.bgBrightRed, colors.black]
|
|
8999
|
-
};
|
|
9000
|
-
const logLevelStyle = {
|
|
9001
|
-
None: "",
|
|
9002
|
-
All: "",
|
|
9003
|
-
Trace: "color:gray",
|
|
9004
|
-
Debug: "color:blue",
|
|
9005
|
-
Info: "color:green",
|
|
9006
|
-
Warn: "color:orange",
|
|
9007
|
-
Error: "color:red",
|
|
9008
|
-
Fatal: "background-color:red;color:white"
|
|
9009
|
-
};
|
|
8976
|
+
colors.gray, colors.blue, colors.green, colors.yellow, colors.red, colors.bgBrightRed, colors.black;
|
|
9010
8977
|
const defaultDateFormat = (date) => `${date.getHours().toString().padStart(2, "0")}:${date.getMinutes().toString().padStart(2, "0")}:${date.getSeconds().toString().padStart(2, "0")}.${date.getMilliseconds().toString().padStart(3, "0")}`;
|
|
9011
8978
|
/** @internal */
|
|
9012
|
-
const consolePretty$1 = (options) => {
|
|
9013
|
-
const process = globalThis.process;
|
|
9014
|
-
const hasProcessStdout = typeof process?.stdout === "object" && process.stdout !== null;
|
|
9015
|
-
const isDeno = "Deno" in globalThis;
|
|
9016
|
-
const mode = options?.mode ?? "auto";
|
|
9017
|
-
return (mode === "auto" ? hasProcessStdout || isDeno : mode === "tty") ? prettyLoggerTty(options) : prettyLoggerBrowser(options);
|
|
9018
|
-
};
|
|
9019
|
-
/** @internal */
|
|
9020
|
-
const prettyLoggerTty = (options) => {
|
|
9021
|
-
const formatDate = options?.formatDate ?? defaultDateFormat;
|
|
9022
|
-
const process = globalThis.process;
|
|
9023
|
-
const processStdoutIsTTY = typeof process?.stdout === "object" && process.stdout !== null && process.stdout.isTTY === true;
|
|
9024
|
-
const color = (typeof options?.colors === "boolean" ? options.colors : processStdoutIsTTY) ? withColor : withColorNoop;
|
|
9025
|
-
const processIsBun = process?.isBun === true;
|
|
9026
|
-
return loggerMake(({ cause, date, fiber, logLevel, message: message_ }) => {
|
|
9027
|
-
const console = fiber.getRef(ConsoleRef);
|
|
9028
|
-
const log = fiber.getRef(LogToStderr$1) ? console.error : console.log;
|
|
9029
|
-
const message = Array.isArray(message_) ? message_.slice() : [message_];
|
|
9030
|
-
let firstLine = color(`[${formatDate(date)}]`, colors.white) + ` ${color(logLevel.toUpperCase(), ...logLevelColors[logLevel])} (#${fiber.id})`;
|
|
9031
|
-
const now = date.getTime();
|
|
9032
|
-
const spans = fiber.getRef(CurrentLogSpans);
|
|
9033
|
-
for (const span of spans) firstLine += " " + formatLogSpan(span, now);
|
|
9034
|
-
firstLine += ":";
|
|
9035
|
-
let messageIndex = 0;
|
|
9036
|
-
if (message.length > 0) {
|
|
9037
|
-
const firstMaybeString = structuredMessage(message[0]);
|
|
9038
|
-
if (typeof firstMaybeString === "string") {
|
|
9039
|
-
firstLine += " " + color(firstMaybeString, colors.bold, colors.cyan);
|
|
9040
|
-
messageIndex++;
|
|
9041
|
-
}
|
|
9042
|
-
}
|
|
9043
|
-
log(firstLine);
|
|
9044
|
-
if (!processIsBun) console.group();
|
|
9045
|
-
if (cause.reasons.length > 0) log(causePretty(cause));
|
|
9046
|
-
if (messageIndex < message.length) for (; messageIndex < message.length; messageIndex++) log(redact$2(message[messageIndex]));
|
|
9047
|
-
const annotations = fiber.getRef(CurrentLogAnnotations);
|
|
9048
|
-
for (const [key, value] of Object.entries(annotations)) log(color(`${key}:`, colors.bold, colors.white), redact$2(value));
|
|
9049
|
-
if (!processIsBun) console.groupEnd();
|
|
9050
|
-
});
|
|
9051
|
-
};
|
|
9052
|
-
/** @internal */
|
|
9053
|
-
const prettyLoggerBrowser = (options) => {
|
|
9054
|
-
const showColors = options?.colors !== false;
|
|
9055
|
-
const color = showColors ? "%c" : "";
|
|
9056
|
-
const formatDate = options?.formatDate ?? defaultDateFormat;
|
|
9057
|
-
return loggerMake(({ cause, date, fiber, logLevel, message: message_ }) => {
|
|
9058
|
-
const console = fiber.getRef(ConsoleRef);
|
|
9059
|
-
const message = Array.isArray(message_) ? message_.slice() : [message_];
|
|
9060
|
-
let firstLine = `${color}[${formatDate(date)}]`;
|
|
9061
|
-
const firstParams = [];
|
|
9062
|
-
if (showColors) firstParams.push("color:gray");
|
|
9063
|
-
firstLine += ` ${color}${logLevel.toUpperCase()}${color} (#${fiber.id})`;
|
|
9064
|
-
if (showColors) firstParams.push(logLevelStyle[logLevel], "");
|
|
9065
|
-
const now = date.getTime();
|
|
9066
|
-
const spans = fiber.getRef(CurrentLogSpans);
|
|
9067
|
-
for (const span of spans) firstLine += " " + formatLogSpan(span, now);
|
|
9068
|
-
firstLine += ":";
|
|
9069
|
-
let messageIndex = 0;
|
|
9070
|
-
if (message.length > 0) {
|
|
9071
|
-
const firstMaybeString = structuredMessage(message[0]);
|
|
9072
|
-
if (typeof firstMaybeString === "string") {
|
|
9073
|
-
firstLine += ` ${color}${firstMaybeString}`;
|
|
9074
|
-
if (showColors) firstParams.push("color:deepskyblue");
|
|
9075
|
-
messageIndex++;
|
|
9076
|
-
}
|
|
9077
|
-
}
|
|
9078
|
-
console.groupCollapsed(firstLine, ...firstParams);
|
|
9079
|
-
if (cause.reasons.length > 0) console.error(causePretty(cause));
|
|
9080
|
-
if (messageIndex < message.length) for (; messageIndex < message.length; messageIndex++) console.log(redact$2(message[messageIndex]));
|
|
9081
|
-
const annotations = fiber.getRef(CurrentLogAnnotations);
|
|
9082
|
-
for (const [key, value] of Object.entries(annotations)) {
|
|
9083
|
-
const redacted = redact$2(value);
|
|
9084
|
-
if (showColors) console.log(`%c${key}:`, "color:gray", redacted);
|
|
9085
|
-
else console.log(`${key}:`, redacted);
|
|
9086
|
-
}
|
|
9087
|
-
console.groupEnd();
|
|
9088
|
-
});
|
|
9089
|
-
};
|
|
9090
|
-
/** @internal */
|
|
9091
8979
|
const defaultLogger = /*#__PURE__*/ loggerMake(({ cause, date, fiber, logLevel, message }) => {
|
|
9092
8980
|
const message_ = Array.isArray(message) ? message.slice() : [message];
|
|
9093
8981
|
if (cause.reasons.length > 0) message_.push(causePretty(cause));
|
|
@@ -9098,7 +8986,7 @@ const defaultLogger = /*#__PURE__*/ loggerMake(({ cause, date, fiber, logLevel,
|
|
|
9098
8986
|
const annotations = fiber.getRef(CurrentLogAnnotations);
|
|
9099
8987
|
if (Object.keys(annotations).length > 0) message_.push(annotations);
|
|
9100
8988
|
const console = fiber.getRef(ConsoleRef);
|
|
9101
|
-
(fiber.getRef(LogToStderr
|
|
8989
|
+
(fiber.getRef(LogToStderr) ? console.error : console.log)(`[${defaultDateFormat(date)}] ${logLevel.toUpperCase()} (#${fiber.id})${spanString}:`, ...message_);
|
|
9102
8990
|
});
|
|
9103
8991
|
/** @internal */
|
|
9104
8992
|
const tracerLogger = /*#__PURE__*/ loggerMake(({ cause, fiber, logLevel, message }) => {
|
|
@@ -9948,7 +9836,7 @@ const Scope = scopeTag;
|
|
|
9948
9836
|
* @category constructors
|
|
9949
9837
|
* @since 2.0.0
|
|
9950
9838
|
*/
|
|
9951
|
-
const make$
|
|
9839
|
+
const make$32 = scopeMake;
|
|
9952
9840
|
/**
|
|
9953
9841
|
* Creates a new `Scope` synchronously without wrapping it in an `Effect`.
|
|
9954
9842
|
* This is useful when you need a scope immediately but should be used with caution
|
|
@@ -10536,8 +10424,8 @@ const buildWithScope = /*#__PURE__*/ dual(2, (self, scope) => withFiber$1((fiber
|
|
|
10536
10424
|
* @since 2.0.0
|
|
10537
10425
|
*/
|
|
10538
10426
|
const succeed$3 = function() {
|
|
10539
|
-
if (arguments.length === 1) return (resource) => succeedContext(make$
|
|
10540
|
-
return succeedContext(make$
|
|
10427
|
+
if (arguments.length === 1) return (resource) => succeedContext(make$35(arguments[0], resource));
|
|
10428
|
+
return succeedContext(make$35(arguments[0], arguments[1]));
|
|
10541
10429
|
};
|
|
10542
10430
|
/**
|
|
10543
10431
|
* Constructs a layer that provides all services in an already available
|
|
@@ -10631,7 +10519,7 @@ const effect = function() {
|
|
|
10631
10519
|
if (arguments.length === 1) return (effect) => effectImpl(arguments[0], effect);
|
|
10632
10520
|
return effectImpl(arguments[0], arguments[1]);
|
|
10633
10521
|
};
|
|
10634
|
-
const effectImpl = (service, effect) => effectContext(map$5(effect, (value) => make$
|
|
10522
|
+
const effectImpl = (service, effect) => effectContext(map$5(effect, (value) => make$35(service, value)));
|
|
10635
10523
|
/**
|
|
10636
10524
|
* Constructs a layer from an effect that produces all services in a `Context`.
|
|
10637
10525
|
*
|
|
@@ -15622,13 +15510,13 @@ const binaryUnits = [
|
|
|
15622
15510
|
];
|
|
15623
15511
|
const allUnits = [...decimalUnits, .../*#__PURE__*/ binaryUnits.slice(1)];
|
|
15624
15512
|
const unitsByName = /*#__PURE__*/ new Map(/*#__PURE__*/ allUnits.flatMap((unit) => unit.names.map((name) => [name, unit])));
|
|
15625
|
-
const make$
|
|
15513
|
+
const make$30 = (value) => value;
|
|
15626
15514
|
const invalid$1 = (message) => {
|
|
15627
15515
|
throw new Error(`Invalid ByteSize: ${message}`);
|
|
15628
15516
|
};
|
|
15629
15517
|
const fromNumber = (input) => {
|
|
15630
15518
|
if (!Number.isSafeInteger(input) || input < 0) return invalid$1(`expected a non-negative safe integer, received ${input}`);
|
|
15631
|
-
return make$
|
|
15519
|
+
return make$30(BigInt(input));
|
|
15632
15520
|
};
|
|
15633
15521
|
/**
|
|
15634
15522
|
* Parses a byte-size string and throws for invalid syntax, unsupported units,
|
|
@@ -15654,7 +15542,7 @@ const fromStringUnsafe = (input) => {
|
|
|
15654
15542
|
const scale = BigInt(10) ** BigInt(fraction.length);
|
|
15655
15543
|
const numerator = BigInt(match[1] + fraction) * unit.factor;
|
|
15656
15544
|
if (numerator % scale !== bigint0$1) return invalid$1(`${JSON.stringify(input)} does not represent an integral number of bytes`);
|
|
15657
|
-
return make$
|
|
15545
|
+
return make$30(numerator / scale);
|
|
15658
15546
|
};
|
|
15659
15547
|
/**
|
|
15660
15548
|
* Decodes a trusted input into a byte size and throws for invalid input.
|
|
@@ -15667,7 +15555,7 @@ const fromInputUnsafe = (input) => {
|
|
|
15667
15555
|
switch (typeof input) {
|
|
15668
15556
|
case "bigint":
|
|
15669
15557
|
if (input < bigint0$1) return invalid$1(`expected a non-negative bigint, received ${input}`);
|
|
15670
|
-
return make$
|
|
15558
|
+
return make$30(input);
|
|
15671
15559
|
case "number": return fromNumber(input);
|
|
15672
15560
|
case "string": return fromStringUnsafe(input);
|
|
15673
15561
|
}
|
|
@@ -16058,7 +15946,7 @@ const MutableRefProto = {
|
|
|
16058
15946
|
* @category constructors
|
|
16059
15947
|
* @since 2.0.0
|
|
16060
15948
|
*/
|
|
16061
|
-
const make$
|
|
15949
|
+
const make$29 = (value) => {
|
|
16062
15950
|
const ref = Object.create(MutableRefProto);
|
|
16063
15951
|
ref.current = value;
|
|
16064
15952
|
return ref;
|
|
@@ -16109,7 +15997,7 @@ const Empty$1 = /*#__PURE__*/ Symbol.for("effect/MutableList/Empty");
|
|
|
16109
15997
|
* @category constructors
|
|
16110
15998
|
* @since 2.0.0
|
|
16111
15999
|
*/
|
|
16112
|
-
const make$
|
|
16000
|
+
const make$28 = () => ({
|
|
16113
16001
|
head: void 0,
|
|
16114
16002
|
tail: void 0,
|
|
16115
16003
|
length: 0
|
|
@@ -16343,12 +16231,12 @@ const QueueProto = {
|
|
|
16343
16231
|
* @category constructors
|
|
16344
16232
|
* @since 4.0.0
|
|
16345
16233
|
*/
|
|
16346
|
-
const make$
|
|
16234
|
+
const make$27 = (options) => withFiber$1((fiber) => {
|
|
16347
16235
|
const self = Object.create(QueueProto);
|
|
16348
16236
|
self.dispatcher = fiber.currentDispatcher;
|
|
16349
16237
|
self.capacity = options?.capacity ?? Number.POSITIVE_INFINITY;
|
|
16350
16238
|
self.strategy = options?.strategy ?? "suspend";
|
|
16351
|
-
self.messages = make$
|
|
16239
|
+
self.messages = make$28();
|
|
16352
16240
|
self.scheduleRunning = false;
|
|
16353
16241
|
self.state = {
|
|
16354
16242
|
_tag: "Open",
|
|
@@ -16389,7 +16277,7 @@ const make$26 = (options) => withFiber$1((fiber) => {
|
|
|
16389
16277
|
* @category constructors
|
|
16390
16278
|
* @since 2.0.0
|
|
16391
16279
|
*/
|
|
16392
|
-
const bounded = (capacity) => make$
|
|
16280
|
+
const bounded = (capacity) => make$27({ capacity });
|
|
16393
16281
|
/**
|
|
16394
16282
|
* Adds a message to the queue. Returns `false` if the queue is done.
|
|
16395
16283
|
*
|
|
@@ -17244,7 +17132,7 @@ const fromTransformBracket = (f) => fromTransform$1(fnUntraced(function* (upstre
|
|
|
17244
17132
|
* @since 4.0.0
|
|
17245
17133
|
*/
|
|
17246
17134
|
const toTransform = (channel) => channel.transform;
|
|
17247
|
-
const asyncQueue = (scope, f, options) => make$
|
|
17135
|
+
const asyncQueue = (scope, f, options) => make$27({
|
|
17248
17136
|
capacity: options?.bufferSize,
|
|
17249
17137
|
strategy: options?.strategy
|
|
17250
17138
|
}).pipe(tap((queue) => addFinalizer$1(scope, shutdown(queue))), tap((queue) => provide$3(f(queue), scope).pipe(catchCause((cause) => failCause(queue, cause)), forkIn(scope, { startImmediately: true }))));
|
|
@@ -17369,7 +17257,7 @@ const fromReadableStream$1 = (options) => fromTransform$1((_, scope) => readable
|
|
|
17369
17257
|
}));
|
|
17370
17258
|
const readableStreamToPullUnsafe = (options) => {
|
|
17371
17259
|
const reader = options.readable.getReader();
|
|
17372
|
-
const exit = options.exit ?? make$
|
|
17260
|
+
const exit = options.exit ?? make$29(void 0);
|
|
17373
17261
|
const pull = suspend$2(() => {
|
|
17374
17262
|
if (exit.current) return exit.current;
|
|
17375
17263
|
return matchCauseEffect(tryPromise({
|
|
@@ -18055,7 +17943,7 @@ var RcRefImpl = class {
|
|
|
18055
17943
|
}
|
|
18056
17944
|
};
|
|
18057
17945
|
/** @internal */
|
|
18058
|
-
const make$
|
|
17946
|
+
const make$26 = (options) => withFiber((fiber) => {
|
|
18059
17947
|
const context = fiber.context;
|
|
18060
17948
|
const scope = get$2(context, Scope);
|
|
18061
17949
|
const ref = new RcRefImpl(options.acquire, context, scope, options.idleTimeToLive !== void 0 ? fromInputUnsafe$1(options.idleTimeToLive) : void 0);
|
|
@@ -18192,7 +18080,7 @@ const release = (self, state) => {
|
|
|
18192
18080
|
* @category constructors
|
|
18193
18081
|
* @since 3.5.0
|
|
18194
18082
|
*/
|
|
18195
|
-
const make$
|
|
18083
|
+
const make$25 = make$26;
|
|
18196
18084
|
/**
|
|
18197
18085
|
* Gets the value from an `RcRef`, acquiring it first if needed.
|
|
18198
18086
|
*
|
|
@@ -18970,7 +18858,7 @@ const FileSystem = /*#__PURE__*/ Service$3("effect/FileSystem");
|
|
|
18970
18858
|
* @category constructors
|
|
18971
18859
|
* @since 4.0.0
|
|
18972
18860
|
*/
|
|
18973
|
-
const make$
|
|
18861
|
+
const make$24 = (impl) => FileSystem.of({
|
|
18974
18862
|
...impl,
|
|
18975
18863
|
[TypeId$29]: TypeId$29,
|
|
18976
18864
|
exists: (path) => pipe$1(impl.access(path), as(true), catchTag("PlatformError", (e) => e.reason._tag === "NotFound" ? succeed$2(false) : fail$3(e))),
|
|
@@ -19192,7 +19080,7 @@ const Path$1 = /*#__PURE__*/ Service$3("effect/Path");
|
|
|
19192
19080
|
* @category constructors
|
|
19193
19081
|
* @since 4.0.0
|
|
19194
19082
|
*/
|
|
19195
|
-
const make$
|
|
19083
|
+
const make$23 = (impl) => Path$1.of({
|
|
19196
19084
|
...impl,
|
|
19197
19085
|
[TypeId$28]: TypeId$28,
|
|
19198
19086
|
resolveWithin(root, input) {
|
|
@@ -20046,7 +19934,7 @@ const isBigDecimal = (u) => hasProperty(u, TypeId$26);
|
|
|
20046
19934
|
* @category constructors
|
|
20047
19935
|
* @since 2.0.0
|
|
20048
19936
|
*/
|
|
20049
|
-
const make$
|
|
19937
|
+
const make$21 = (value, scale) => {
|
|
20050
19938
|
if (!Number.isSafeInteger(scale)) throw new RangeError(`Scale must be a safe integer, got ${scale}`);
|
|
20051
19939
|
const o = Object.create(BigDecimalProto);
|
|
20052
19940
|
o.value = value;
|
|
@@ -20054,7 +19942,7 @@ const make$20 = (value, scale) => {
|
|
|
20054
19942
|
return o;
|
|
20055
19943
|
};
|
|
20056
19944
|
const makeNormalized = (value, scale) => {
|
|
20057
|
-
const o = make$
|
|
19945
|
+
const o = make$21(value, scale);
|
|
20058
19946
|
o.normalized = o;
|
|
20059
19947
|
return o;
|
|
20060
19948
|
};
|
|
@@ -22536,7 +22424,7 @@ const makeHandle = (params) => Object.setPrototypeOf({ ...params }, HandleProto)
|
|
|
22536
22424
|
* @category constructors
|
|
22537
22425
|
* @since 4.0.0
|
|
22538
22426
|
*/
|
|
22539
|
-
const make$
|
|
22427
|
+
const make$20 = (spawn) => {
|
|
22540
22428
|
const streamString = (command, options) => spawn(command).pipe(map$3((handle) => decodeText(options?.includeStderr === true ? handle.all : handle.stdout)), unwrap$1);
|
|
22541
22429
|
const streamLines = (command, options) => splitLines(streamString(command, options));
|
|
22542
22430
|
return ChildProcessSpawner.of({
|
|
@@ -22620,7 +22508,7 @@ const makeStandardCommand = (command, args, options) => Object.assign(Object.cre
|
|
|
22620
22508
|
* @category constructors
|
|
22621
22509
|
* @since 4.0.0
|
|
22622
22510
|
*/
|
|
22623
|
-
const make$
|
|
22511
|
+
const make$19 = function make(...args) {
|
|
22624
22512
|
if (isTemplateString(args[0])) {
|
|
22625
22513
|
const [templates, ...expressions] = args;
|
|
22626
22514
|
const tokens = parseTemplates(templates, expressions);
|
|
@@ -23010,7 +22898,7 @@ const fromReadableChannel = (options) => fromTransform$1((_, scope) => readableT
|
|
|
23010
22898
|
const readableToPullUnsafe = (options) => {
|
|
23011
22899
|
const readable = options.readable;
|
|
23012
22900
|
const closeOnDone = options.closeOnDone ?? true;
|
|
23013
|
-
const exit = options.exit ?? make$
|
|
22901
|
+
const exit = options.exit ?? make$29(void 0);
|
|
23014
22902
|
const latch = options.latch ?? makeUnsafe$1(false);
|
|
23015
22903
|
function onReadable() {
|
|
23016
22904
|
latch.openUnsafe();
|
|
@@ -23424,7 +23312,7 @@ const layer$16 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
23424
23312
|
const stdinConfig = resolveStdinOption(command.options);
|
|
23425
23313
|
const sourceStream = unwrap$1(succeed$2(getSourceStream(handles[handles.length - 1], options.from)));
|
|
23426
23314
|
const toOption = options.to ?? "stdin";
|
|
23427
|
-
if (toOption === "stdin") handles.push(yield* spawnCommand(make$
|
|
23315
|
+
if (toOption === "stdin") handles.push(yield* spawnCommand(make$19(command.command, command.args, {
|
|
23428
23316
|
...command.options,
|
|
23429
23317
|
stdin: {
|
|
23430
23318
|
...stdinConfig,
|
|
@@ -23436,7 +23324,7 @@ const layer$16 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
23436
23324
|
if (isNotUndefined(fd)) {
|
|
23437
23325
|
const fdName$1 = fdName(fd);
|
|
23438
23326
|
const existingFds = command.options.additionalFds ?? {};
|
|
23439
|
-
handles.push(yield* spawnCommand(make$
|
|
23327
|
+
handles.push(yield* spawnCommand(make$19(command.command, command.args, {
|
|
23440
23328
|
...command.options,
|
|
23441
23329
|
additionalFds: {
|
|
23442
23330
|
...existingFds,
|
|
@@ -23446,7 +23334,7 @@ const layer$16 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
23446
23334
|
}
|
|
23447
23335
|
}
|
|
23448
23336
|
})));
|
|
23449
|
-
} else handles.push(yield* spawnCommand(make$
|
|
23337
|
+
} else handles.push(yield* spawnCommand(make$19(command.command, command.args, {
|
|
23450
23338
|
...command.options,
|
|
23451
23339
|
stdin: {
|
|
23452
23340
|
...stdinConfig,
|
|
@@ -23478,7 +23366,7 @@ const layer$16 = /*#__PURE__*/ effect(ChildProcessSpawner, /* @__PURE__ */ gen(f
|
|
|
23478
23366
|
}
|
|
23479
23367
|
}
|
|
23480
23368
|
});
|
|
23481
|
-
return make$
|
|
23369
|
+
return make$20(spawnCommand);
|
|
23482
23370
|
}));
|
|
23483
23371
|
/**
|
|
23484
23372
|
* Flattens a `Command` into an array of `StandardCommand`s along with pipe
|
|
@@ -23641,7 +23529,7 @@ const Crypto = /*#__PURE__*/ Service$3("effect/Crypto");
|
|
|
23641
23529
|
* @category constructors
|
|
23642
23530
|
* @since 4.0.0
|
|
23643
23531
|
*/
|
|
23644
|
-
const make$
|
|
23532
|
+
const make$17 = (impl) => {
|
|
23645
23533
|
const randomBytesUnsafe = impl.randomBytes;
|
|
23646
23534
|
const randomBytes = (size) => map$3(validateSize("randomBytes", size), randomBytesUnsafe);
|
|
23647
23535
|
const readUint53 = (bytes) => (bytes[0] & 31) * 2 ** 48 + bytes[1] * 2 ** 40 + bytes[2] * 2 ** 32 + bytes[3] * 2 ** 24 + bytes[4] * 2 ** 16 + bytes[5] * 256 + bytes[6];
|
|
@@ -23752,7 +23640,7 @@ const digest = (algorithm, data) => try_({
|
|
|
23752
23640
|
* @category layers
|
|
23753
23641
|
* @since 1.0.0
|
|
23754
23642
|
*/
|
|
23755
|
-
const layer$14 = /* @__PURE__ */ succeed$3(Crypto, /* @__PURE__ */ make$
|
|
23643
|
+
const layer$14 = /* @__PURE__ */ succeed$3(Crypto, /* @__PURE__ */ make$17({
|
|
23756
23644
|
randomBytes: NodeCrypto.randomBytes,
|
|
23757
23645
|
digest
|
|
23758
23646
|
}));
|
|
@@ -24142,7 +24030,7 @@ const writeFile = (path, data, options) => callback$1((resume, signal) => {
|
|
|
24142
24030
|
resume(fail$3(handleBadArgument("writeFile")(err)));
|
|
24143
24031
|
}
|
|
24144
24032
|
});
|
|
24145
|
-
const makeFileSystem = /*#__PURE__*/ map$3(/*#__PURE__*/ serviceOption(WatchBackend), (backend) => make$
|
|
24033
|
+
const makeFileSystem = /*#__PURE__*/ map$3(/*#__PURE__*/ serviceOption(WatchBackend), (backend) => make$24({
|
|
24146
24034
|
access,
|
|
24147
24035
|
chmod,
|
|
24148
24036
|
chown,
|
|
@@ -24253,7 +24141,7 @@ const fileUrlOps = (windows) => ({
|
|
|
24253
24141
|
* @category layers
|
|
24254
24142
|
* @since 4.0.0
|
|
24255
24143
|
*/
|
|
24256
|
-
const layer$10 = /* @__PURE__ */ succeed$3(Path$1)(/*#__PURE__*/ make$
|
|
24144
|
+
const layer$10 = /* @__PURE__ */ succeed$3(Path$1)(/*#__PURE__*/ make$23({
|
|
24257
24145
|
...Path,
|
|
24258
24146
|
.../*#__PURE__*/ fileUrlOps(void 0)
|
|
24259
24147
|
}));
|
|
@@ -24323,7 +24211,7 @@ const Stdio = /*#__PURE__*/ Service$3(TypeId$21);
|
|
|
24323
24211
|
* @category constructors
|
|
24324
24212
|
* @since 4.0.0
|
|
24325
24213
|
*/
|
|
24326
|
-
const make$
|
|
24214
|
+
const make$15 = (options) => ({
|
|
24327
24215
|
[TypeId$21]: TypeId$21,
|
|
24328
24216
|
stdinIsTerminal: succeed$2(false),
|
|
24329
24217
|
stdoutIsTerminal: succeed$2(false),
|
|
@@ -24351,7 +24239,7 @@ const make$14 = (options) => ({
|
|
|
24351
24239
|
* @category layers
|
|
24352
24240
|
* @since 4.0.0
|
|
24353
24241
|
*/
|
|
24354
|
-
const layer$8 = /* @__PURE__ */ succeed$3(Stdio, /*#__PURE__*/ make$
|
|
24242
|
+
const layer$8 = /* @__PURE__ */ succeed$3(Stdio, /*#__PURE__*/ make$15({
|
|
24355
24243
|
args: /*#__PURE__*/ sync(() => process.argv.slice(2)),
|
|
24356
24244
|
stdinIsTerminal: /*#__PURE__*/ sync(() => process.stdin.isTTY === true),
|
|
24357
24245
|
stdoutIsTerminal: /*#__PURE__*/ sync(() => process.stdout.isTTY === true),
|
|
@@ -24641,7 +24529,7 @@ const isRedacted = (u) => hasProperty(u, TypeId$19);
|
|
|
24641
24529
|
* @category constructors
|
|
24642
24530
|
* @since 3.3.0
|
|
24643
24531
|
*/
|
|
24644
|
-
const make$
|
|
24532
|
+
const make$14 = (value, options) => {
|
|
24645
24533
|
const self = Object.create(Proto$10);
|
|
24646
24534
|
if (options?.label) self.label = options.label;
|
|
24647
24535
|
redactedRegistry.set(self, value);
|
|
@@ -24730,7 +24618,7 @@ const Proto$9 = /*#__PURE__*/ Object.defineProperties(/*#__PURE__*/ Object.creat
|
|
|
24730
24618
|
toString: { value: BaseProto.toString },
|
|
24731
24619
|
[NodeInspectSymbol]: { value: BaseProto[NodeInspectSymbol] }
|
|
24732
24620
|
});
|
|
24733
|
-
const make$
|
|
24621
|
+
const make$13 = (input) => Object.assign(Object.create(Proto$9), input);
|
|
24734
24622
|
/**
|
|
24735
24623
|
* Provides an `Equivalence` instance that compares `Headers` by header names
|
|
24736
24624
|
* and string values.
|
|
@@ -24795,7 +24683,7 @@ const fromRecordUnsafe = (input) => Object.setPrototypeOf(input, Proto$9);
|
|
|
24795
24683
|
* @since 4.0.0
|
|
24796
24684
|
*/
|
|
24797
24685
|
const set = /*#__PURE__*/ dual(3, (self, key, value) => {
|
|
24798
|
-
const out = make$
|
|
24686
|
+
const out = make$13(self);
|
|
24799
24687
|
out[key.toLowerCase()] = value;
|
|
24800
24688
|
return out;
|
|
24801
24689
|
});
|
|
@@ -24810,7 +24698,7 @@ const set = /*#__PURE__*/ dual(3, (self, key, value) => {
|
|
|
24810
24698
|
* @category combinators
|
|
24811
24699
|
* @since 4.0.0
|
|
24812
24700
|
*/
|
|
24813
|
-
const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$
|
|
24701
|
+
const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$13({
|
|
24814
24702
|
...self,
|
|
24815
24703
|
...fromInput$1(headers)
|
|
24816
24704
|
}));
|
|
@@ -24826,7 +24714,7 @@ const setAll$1 = /*#__PURE__*/ dual(2, (self, headers) => make$12({
|
|
|
24826
24714
|
* @since 4.0.0
|
|
24827
24715
|
*/
|
|
24828
24716
|
const merge$1 = /*#__PURE__*/ dual(2, (self, headers) => {
|
|
24829
|
-
const out = make$
|
|
24717
|
+
const out = make$13(self);
|
|
24830
24718
|
Object.assign(out, headers);
|
|
24831
24719
|
return out;
|
|
24832
24720
|
});
|
|
@@ -24842,7 +24730,7 @@ const merge$1 = /*#__PURE__*/ dual(2, (self, headers) => {
|
|
|
24842
24730
|
* @since 4.0.0
|
|
24843
24731
|
*/
|
|
24844
24732
|
const remove = /*#__PURE__*/ dual(2, (self, key) => {
|
|
24845
|
-
const out = make$
|
|
24733
|
+
const out = make$13(self);
|
|
24846
24734
|
delete out[key.toLowerCase()];
|
|
24847
24735
|
return out;
|
|
24848
24736
|
});
|
|
@@ -24862,8 +24750,8 @@ const redact$1 = /*#__PURE__*/ dual(2, (self, key) => {
|
|
|
24862
24750
|
const modify = (key) => {
|
|
24863
24751
|
if (typeof key === "string") {
|
|
24864
24752
|
const k = key.toLowerCase();
|
|
24865
|
-
if (k in self) out[k] = make$
|
|
24866
|
-
} else for (const name in self) if (name.search(key) !== -1) out[name] = make$
|
|
24753
|
+
if (k in self) out[k] = make$14(self[k]);
|
|
24754
|
+
} else for (const name in self) if (name.search(key) !== -1) out[name] = make$14(self[name]);
|
|
24867
24755
|
};
|
|
24868
24756
|
if (Array.isArray(key)) for (let i = 0; i < key.length; i++) modify(key[i]);
|
|
24869
24757
|
else modify(key);
|
|
@@ -24970,7 +24858,7 @@ const Proto$8 = {
|
|
|
24970
24858
|
* @category constructors
|
|
24971
24859
|
* @since 4.0.0
|
|
24972
24860
|
*/
|
|
24973
|
-
const make$
|
|
24861
|
+
const make$12 = (params) => {
|
|
24974
24862
|
const self = Object.create(Proto$8);
|
|
24975
24863
|
self.params = params;
|
|
24976
24864
|
return self;
|
|
@@ -24996,7 +24884,7 @@ const fromInput = (input) => {
|
|
|
24996
24884
|
const [keys, value] = parsed[i];
|
|
24997
24885
|
out.push([`${keys[0]}[${keys.slice(1).join("][")}]`, value]);
|
|
24998
24886
|
} else out.push(parsed[i]);
|
|
24999
|
-
return make$
|
|
24887
|
+
return make$12(out);
|
|
25000
24888
|
};
|
|
25001
24889
|
const fromInputNested = (input) => {
|
|
25002
24890
|
const entries = typeof input[Symbol.iterator] === "function" ? fromIterable$1(input) : Object.entries(input);
|
|
@@ -25022,7 +24910,7 @@ const coerce = (value) => isRedacted(value) ? value : String(value);
|
|
|
25022
24910
|
* @category instances
|
|
25023
24911
|
* @since 4.0.0
|
|
25024
24912
|
*/
|
|
25025
|
-
const Equivalence$1 = /*#__PURE__*/ make$
|
|
24913
|
+
const Equivalence$1 = /*#__PURE__*/ make$37((a, b) => arrayEquivalence(a.params, b.params));
|
|
25026
24914
|
const arrayEquivalence = /*#__PURE__*/ makeEquivalence(/*#__PURE__*/ makeEquivalence$2([/*#__PURE__*/ strictEqual(), /*#__PURE__*/ asEquivalence()]));
|
|
25027
24915
|
/**
|
|
25028
24916
|
* An empty `UrlParams` value.
|
|
@@ -25031,7 +24919,7 @@ const arrayEquivalence = /*#__PURE__*/ makeEquivalence(/*#__PURE__*/ makeEquival
|
|
|
25031
24919
|
* @category constructors
|
|
25032
24920
|
* @since 4.0.0
|
|
25033
24921
|
*/
|
|
25034
|
-
const empty$2 = /*#__PURE__*/ make$
|
|
24922
|
+
const empty$2 = /*#__PURE__*/ make$12([]);
|
|
25035
24923
|
/**
|
|
25036
24924
|
* Sets multiple query parameters from input.
|
|
25037
24925
|
*
|
|
@@ -25052,7 +24940,7 @@ const setAll = /*#__PURE__*/ dual(2, (self, input) => {
|
|
|
25052
24940
|
if (keys.has(self.params[i][0])) continue;
|
|
25053
24941
|
params.push(self.params[i]);
|
|
25054
24942
|
}
|
|
25055
|
-
return make$
|
|
24943
|
+
return make$12(params);
|
|
25056
24944
|
});
|
|
25057
24945
|
/**
|
|
25058
24946
|
* Returns the parameter pairs with selected values wrapped in `Redacted`.
|
|
@@ -25068,7 +24956,7 @@ const setAll = /*#__PURE__*/ dual(2, (self, input) => {
|
|
|
25068
24956
|
*/
|
|
25069
24957
|
const redact = /*#__PURE__*/ dual(2, (self, key) => {
|
|
25070
24958
|
const patterns = Array.isArray(key) ? key : [key];
|
|
25071
|
-
return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName(name, patterns) ? make$
|
|
24959
|
+
return self.params.map(([name, value]) => [name, typeof value === "string" && isRedactedName(name, patterns) ? make$14(value) : value]);
|
|
25072
24960
|
});
|
|
25073
24961
|
/**
|
|
25074
24962
|
* Checks whether a parameter name matches one of the redaction patterns.
|
|
@@ -25445,7 +25333,7 @@ function makeOption(schema) {
|
|
|
25445
25333
|
* @category constructors
|
|
25446
25334
|
* @since 4.0.0
|
|
25447
25335
|
*/
|
|
25448
|
-
function make$
|
|
25336
|
+
function make$11(schema) {
|
|
25449
25337
|
return makeConstructorSync(toType(schema.ast));
|
|
25450
25338
|
}
|
|
25451
25339
|
/**
|
|
@@ -25633,7 +25521,7 @@ const RebuildOptions = /*#__PURE__*/ Symbol();
|
|
|
25633
25521
|
const SchemaProto = {
|
|
25634
25522
|
[TypeId$16]: TypeId$16,
|
|
25635
25523
|
get make() {
|
|
25636
|
-
const value = make$
|
|
25524
|
+
const value = make$11(this);
|
|
25637
25525
|
Object.defineProperty(this, "make", {
|
|
25638
25526
|
value,
|
|
25639
25527
|
enumerable: true
|
|
@@ -25669,11 +25557,11 @@ const SchemaProto = {
|
|
|
25669
25557
|
return this.rebuild(appendChecks(this.ast, checks));
|
|
25670
25558
|
},
|
|
25671
25559
|
rebuild(ast) {
|
|
25672
|
-
return make$
|
|
25560
|
+
return make$10(ast, this[RebuildOptions]);
|
|
25673
25561
|
}
|
|
25674
25562
|
};
|
|
25675
25563
|
/** @internal */
|
|
25676
|
-
function make$
|
|
25564
|
+
function make$10(ast, options) {
|
|
25677
25565
|
function Schema() {}
|
|
25678
25566
|
const self = Object.setPrototypeOf(Schema, SchemaProto);
|
|
25679
25567
|
if (options && (Object.hasOwn(options, "name") || Object.hasOwn(options, "length") || Object.hasOwn(options, "__proto__"))) Object.defineProperties(self, Object.getOwnPropertyDescriptors({ ...options }));
|
|
@@ -25699,7 +25587,7 @@ function makeReorder(getPriority) {
|
|
|
25699
25587
|
}
|
|
25700
25588
|
/** @internal */
|
|
25701
25589
|
function toCodecStringTree$1(schema) {
|
|
25702
|
-
return make$
|
|
25590
|
+
return make$10(toCodecStringTreeAST(schema.ast), { schema });
|
|
25703
25591
|
}
|
|
25704
25592
|
const toStringTreeReorder = /*#__PURE__*/ makeReorder((ast) => {
|
|
25705
25593
|
switch (ast._tag) {
|
|
@@ -25715,7 +25603,7 @@ const toStringTreeReorder = /*#__PURE__*/ makeReorder((ast) => {
|
|
|
25715
25603
|
function toCodecStringTreeASTStep(ast, recur, onMissingAnnotation) {
|
|
25716
25604
|
switch (ast._tag) {
|
|
25717
25605
|
case "Declaration": {
|
|
25718
|
-
const typeParameters = ast.typeParameters.map((tp) => make$
|
|
25606
|
+
const typeParameters = ast.typeParameters.map((tp) => make$10(recur(toEncoded(tp))));
|
|
25719
25607
|
const getStringTreeLink = ast.annotations?.toCodecStringTree;
|
|
25720
25608
|
if (isFunction(getStringTreeLink)) {
|
|
25721
25609
|
const link = getStringTreeLink(typeParameters);
|
|
@@ -26077,7 +25965,7 @@ const encodeEffect = encodeUnknownEffect;
|
|
|
26077
25965
|
* @category constructors
|
|
26078
25966
|
* @since 3.10.0
|
|
26079
25967
|
*/
|
|
26080
|
-
const make$
|
|
25968
|
+
const make$9 = make$10;
|
|
26081
25969
|
/**
|
|
26082
25970
|
* Checks whether a value is a `Schema`.
|
|
26083
25971
|
*
|
|
@@ -26111,7 +25999,7 @@ function isSchema(u) {
|
|
|
26111
25999
|
* @category combinators
|
|
26112
26000
|
* @since 4.0.0
|
|
26113
26001
|
*/
|
|
26114
|
-
const optionalKey = /*#__PURE__*/ lambda((schema) => make$
|
|
26002
|
+
const optionalKey = /*#__PURE__*/ lambda((schema) => make$9(optionalKey$1(schema.ast), { schema }));
|
|
26115
26003
|
/**
|
|
26116
26004
|
* Marks a struct field as optional, allowing the key to be absent or
|
|
26117
26005
|
* `undefined`.
|
|
@@ -26144,7 +26032,7 @@ const optionalKey = /*#__PURE__*/ lambda((schema) => make$8(optionalKey$1(schema
|
|
|
26144
26032
|
*/
|
|
26145
26033
|
const optional$3 = /*#__PURE__*/ lambda((self) => {
|
|
26146
26034
|
const schema = UndefinedOr(self);
|
|
26147
|
-
return make$
|
|
26035
|
+
return make$9(optional$4(self.ast), { schema });
|
|
26148
26036
|
});
|
|
26149
26037
|
/**
|
|
26150
26038
|
* Creates a schema for a single literal value (string, number, bigint, boolean, or null).
|
|
@@ -26167,7 +26055,7 @@ const optional$3 = /*#__PURE__*/ lambda((self) => {
|
|
|
26167
26055
|
* @since 3.10.0
|
|
26168
26056
|
*/
|
|
26169
26057
|
function Literal(literal) {
|
|
26170
|
-
const out = make$
|
|
26058
|
+
const out = make$9(new Literal$1(literal), {
|
|
26171
26059
|
literal,
|
|
26172
26060
|
transform(to) {
|
|
26173
26061
|
return out.pipe(decodeTo(Literal(to), {
|
|
@@ -26191,7 +26079,7 @@ function Literal(literal) {
|
|
|
26191
26079
|
* @category schemas
|
|
26192
26080
|
* @since 3.10.0
|
|
26193
26081
|
*/
|
|
26194
|
-
const Unknown = /*#__PURE__*/ make$
|
|
26082
|
+
const Unknown = /*#__PURE__*/ make$9(unknown$1);
|
|
26195
26083
|
/**
|
|
26196
26084
|
* Schema for the `null` literal. Validates that the input is strictly `null`.
|
|
26197
26085
|
*
|
|
@@ -26200,7 +26088,7 @@ const Unknown = /*#__PURE__*/ make$8(unknown$1);
|
|
|
26200
26088
|
* @category schemas
|
|
26201
26089
|
* @since 3.10.0
|
|
26202
26090
|
*/
|
|
26203
|
-
const Null = /*#__PURE__*/ make$
|
|
26091
|
+
const Null = /*#__PURE__*/ make$9(null_);
|
|
26204
26092
|
/**
|
|
26205
26093
|
* Schema for the `undefined` literal. Validates that the input is strictly `undefined`.
|
|
26206
26094
|
*
|
|
@@ -26209,7 +26097,7 @@ const Null = /*#__PURE__*/ make$8(null_);
|
|
|
26209
26097
|
* @category schemas
|
|
26210
26098
|
* @since 3.10.0
|
|
26211
26099
|
*/
|
|
26212
|
-
const Undefined = /*#__PURE__*/ make$
|
|
26100
|
+
const Undefined = /*#__PURE__*/ make$9(undefined_);
|
|
26213
26101
|
/**
|
|
26214
26102
|
* Schema for `string` values. Validates that the input is `typeof` `"string"`.
|
|
26215
26103
|
*
|
|
@@ -26217,7 +26105,7 @@ const Undefined = /*#__PURE__*/ make$8(undefined_);
|
|
|
26217
26105
|
* @category schemas
|
|
26218
26106
|
* @since 4.0.0
|
|
26219
26107
|
*/
|
|
26220
|
-
const String$7 = /*#__PURE__*/ make$
|
|
26108
|
+
const String$7 = /*#__PURE__*/ make$9(string$1);
|
|
26221
26109
|
/**
|
|
26222
26110
|
* Schema for `number` values, including `NaN`, `Infinity`, and `-Infinity`.
|
|
26223
26111
|
*
|
|
@@ -26233,7 +26121,7 @@ const String$7 = /*#__PURE__*/ make$8(string$1);
|
|
|
26233
26121
|
* @category schemas
|
|
26234
26122
|
* @since 4.0.0
|
|
26235
26123
|
*/
|
|
26236
|
-
const Number$2 = /*#__PURE__*/ make$
|
|
26124
|
+
const Number$2 = /*#__PURE__*/ make$9(number$2);
|
|
26237
26125
|
/**
|
|
26238
26126
|
* Schema for `boolean` values. Validates that the input is `typeof` `"boolean"`.
|
|
26239
26127
|
*
|
|
@@ -26247,9 +26135,9 @@ const Number$2 = /*#__PURE__*/ make$8(number$2);
|
|
|
26247
26135
|
* @category schemas
|
|
26248
26136
|
* @since 4.0.0
|
|
26249
26137
|
*/
|
|
26250
|
-
const Boolean$4 = /*#__PURE__*/ make$
|
|
26138
|
+
const Boolean$4 = /*#__PURE__*/ make$9(boolean$2);
|
|
26251
26139
|
function makeStruct(ast, fields) {
|
|
26252
|
-
return make$
|
|
26140
|
+
return make$9(ast, {
|
|
26253
26141
|
fields,
|
|
26254
26142
|
mapFields(f, options) {
|
|
26255
26143
|
const fields = f(this.fields);
|
|
@@ -26335,7 +26223,7 @@ function Struct(fields) {
|
|
|
26335
26223
|
* @since 3.10.0
|
|
26336
26224
|
*/
|
|
26337
26225
|
function Record(key, value) {
|
|
26338
|
-
return make$
|
|
26226
|
+
return make$9(record$1(key.ast, value.ast), {
|
|
26339
26227
|
key,
|
|
26340
26228
|
value
|
|
26341
26229
|
});
|
|
@@ -26344,9 +26232,9 @@ function Record(key, value) {
|
|
|
26344
26232
|
* @category constructors
|
|
26345
26233
|
* @since 4.0.0
|
|
26346
26234
|
*/
|
|
26347
|
-
const ArraySchema = /*#__PURE__*/ lambda((schema) => make$
|
|
26235
|
+
const ArraySchema = /*#__PURE__*/ lambda((schema) => make$9(new Arrays(false, [], [schema.ast]), { value: schema }));
|
|
26348
26236
|
function makeUnion(ast, members) {
|
|
26349
|
-
return make$
|
|
26237
|
+
return make$9(ast, {
|
|
26350
26238
|
members,
|
|
26351
26239
|
mapMembers(f, options) {
|
|
26352
26240
|
const members = f(this.members);
|
|
@@ -26401,7 +26289,7 @@ function Union(members, options) {
|
|
|
26401
26289
|
*/
|
|
26402
26290
|
function Literals$2(literals) {
|
|
26403
26291
|
const members = literals.map(Literal);
|
|
26404
|
-
return make$
|
|
26292
|
+
return make$9(union$1(members, void 0, void 0), {
|
|
26405
26293
|
literals,
|
|
26406
26294
|
members,
|
|
26407
26295
|
mapMembers(f) {
|
|
@@ -26433,7 +26321,7 @@ const NullOr = /*#__PURE__*/ lambda((self) => Union([self, Null]));
|
|
|
26433
26321
|
const UndefinedOr = /*#__PURE__*/ lambda((self) => Union([self, Undefined]));
|
|
26434
26322
|
function decodeTo(to, transformation) {
|
|
26435
26323
|
return (from) => {
|
|
26436
|
-
return make$
|
|
26324
|
+
return make$9(decodeTo$1(from.ast, to.ast, transformation ? makeTransformation(transformation) : passthrough()), {
|
|
26437
26325
|
from,
|
|
26438
26326
|
to
|
|
26439
26327
|
});
|
|
@@ -26488,7 +26376,7 @@ const BooleanLiterals = /*#__PURE__*/ Literals$2([...TrueLiterals.literals, ...F
|
|
|
26488
26376
|
* @since 3.10.0
|
|
26489
26377
|
*/
|
|
26490
26378
|
function withConstructorDefault(defaultValue) {
|
|
26491
|
-
return (schema) => make$
|
|
26379
|
+
return (schema) => make$9(withConstructorDefault$1(schema.ast, defaultValue), { schema });
|
|
26492
26380
|
}
|
|
26493
26381
|
/**
|
|
26494
26382
|
* Combines a {@link Literal} schema with {@link withConstructorDefault}, making it ideal
|
|
@@ -26637,7 +26525,7 @@ const makeFilter = makeFilter$1;
|
|
|
26637
26525
|
* @category schemas
|
|
26638
26526
|
* @since 3.10.0
|
|
26639
26527
|
*/
|
|
26640
|
-
const Finite$3 = /*#__PURE__*/ make$
|
|
26528
|
+
const Finite$3 = /*#__PURE__*/ make$9(finite);
|
|
26641
26529
|
/**
|
|
26642
26530
|
* Validates that a number is a safe integer (within the safe integer range
|
|
26643
26531
|
* that can be exactly represented in JavaScript).
|
|
@@ -26822,7 +26710,7 @@ function makeClass(Inherited, identifier, struct$1, annotations, proto) {
|
|
|
26822
26710
|
return getClassSchema(this).rebuild(ast);
|
|
26823
26711
|
}
|
|
26824
26712
|
static make(input, options) {
|
|
26825
|
-
return make$
|
|
26713
|
+
return make$11(getClassSchema(this))(input ?? {}, options);
|
|
26826
26714
|
}
|
|
26827
26715
|
static makeOption(input, options) {
|
|
26828
26716
|
return makeOption(getClassSchema(this))(input ?? {}, options);
|
|
@@ -26882,7 +26770,7 @@ function getClassSchemaFactory(from, identifier, annotations) {
|
|
|
26882
26770
|
const ClassTypeId = getClassTypeId(identifier);
|
|
26883
26771
|
const isClassValue = (input) => input instanceof self || hasProperty(input, ClassTypeId);
|
|
26884
26772
|
const transformation = getClassTransformation(self);
|
|
26885
|
-
return memo = decodeTo(make$
|
|
26773
|
+
return memo = decodeTo(make$9(new Declaration([from.ast], () => (input, ast, options) => {
|
|
26886
26774
|
return isClassValue(input) ? succeed$2(input) : fail$3(new InvalidType(ast, input, options));
|
|
26887
26775
|
}, {
|
|
26888
26776
|
identifier,
|
|
@@ -27007,7 +26895,7 @@ const toCodecStringTree = toCodecStringTree$1;
|
|
|
27007
26895
|
* @category schemas
|
|
27008
26896
|
* @since 4.0.0
|
|
27009
26897
|
*/
|
|
27010
|
-
const Json = /*#__PURE__*/ make$
|
|
26898
|
+
const Json = /*#__PURE__*/ make$9(/*#__PURE__*/ annotate$1(Json$1, { toCode: () => ({
|
|
27011
26899
|
runtime: "Schema.Json",
|
|
27012
26900
|
Type: "Schema.Json"
|
|
27013
26901
|
}) }));
|
|
@@ -27090,7 +26978,7 @@ const Terminal = /*#__PURE__*/ Service$3("effect/Terminal");
|
|
|
27090
26978
|
* @category constructors
|
|
27091
26979
|
* @since 4.0.0
|
|
27092
26980
|
*/
|
|
27093
|
-
const make$
|
|
26981
|
+
const make$8 = (impl) => Terminal.of({
|
|
27094
26982
|
...impl,
|
|
27095
26983
|
[TypeId$12]: TypeId$12
|
|
27096
26984
|
});
|
|
@@ -27105,7 +26993,7 @@ const make$7 = (impl) => Terminal.of({
|
|
|
27105
26993
|
const layer$7 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fnUntraced(function* (shouldQuit = defaultShouldQuit) {
|
|
27106
26994
|
const stdin = process.stdin;
|
|
27107
26995
|
const stdout = process.stdout;
|
|
27108
|
-
const lines = yield* make$
|
|
26996
|
+
const lines = yield* make$27();
|
|
27109
26997
|
let inputEnded = stdin.readableEnded;
|
|
27110
26998
|
let readlineActive = false;
|
|
27111
26999
|
const onStdinEnd = () => {
|
|
@@ -27114,7 +27002,7 @@ const layer$7 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
|
|
|
27114
27002
|
};
|
|
27115
27003
|
stdin.once("end", onStdinEnd);
|
|
27116
27004
|
yield* addFinalizer(() => sync(() => stdin.off("end", onStdinEnd)));
|
|
27117
|
-
const rlRef = yield* make$
|
|
27005
|
+
const rlRef = yield* make$25({
|
|
27118
27006
|
acquire: acquireRelease(sync(() => {
|
|
27119
27007
|
const rl = readline.createInterface({
|
|
27120
27008
|
input: stdin,
|
|
@@ -27146,14 +27034,14 @@ const layer$7 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
|
|
|
27146
27034
|
const setRawMode = (enabled) => sync(() => {
|
|
27147
27035
|
if (stdin.isTTY) stdin.setRawMode(enabled);
|
|
27148
27036
|
});
|
|
27149
|
-
const rawModeRef = yield* make$
|
|
27037
|
+
const rawModeRef = yield* make$25({
|
|
27150
27038
|
acquire: acquireRelease(setRawMode(true), () => setRawMode(false)),
|
|
27151
27039
|
idleTimeToLive: "10 millis"
|
|
27152
27040
|
});
|
|
27153
27041
|
const columns = sync(() => stdout.columns ?? 0);
|
|
27154
27042
|
const rows = sync(() => stdout.rows ?? 0);
|
|
27155
27043
|
const readInput = gen(function* () {
|
|
27156
|
-
const queue = yield* make$
|
|
27044
|
+
const queue = yield* make$27();
|
|
27157
27045
|
const handleKeypress = (s, k) => {
|
|
27158
27046
|
const userInput = {
|
|
27159
27047
|
input: fromUndefinedOr(s),
|
|
@@ -27198,7 +27086,7 @@ const layer$7 = /*#__PURE__*/ effect(Terminal, /*#__PURE__*/ (/* @__PURE__ */ fn
|
|
|
27198
27086
|
cause: err
|
|
27199
27087
|
}))));
|
|
27200
27088
|
}));
|
|
27201
|
-
return make$
|
|
27089
|
+
return make$8({
|
|
27202
27090
|
columns,
|
|
27203
27091
|
rows,
|
|
27204
27092
|
readInput,
|
|
@@ -27398,78 +27286,36 @@ const log = (...args) => consoleWith((console) => sync$1(() => {
|
|
|
27398
27286
|
*/
|
|
27399
27287
|
const CurrentLoggers = CurrentLoggers$1;
|
|
27400
27288
|
/**
|
|
27401
|
-
*
|
|
27402
|
-
* console logger to stderr.
|
|
27403
|
-
*
|
|
27404
|
-
* **When to use**
|
|
27405
|
-
*
|
|
27406
|
-
* Use to route built-in logger output to stderr while keeping stdout reserved
|
|
27407
|
-
* for protocol messages or data output.
|
|
27289
|
+
* Creates a new `Logger` from a log function.
|
|
27408
27290
|
*
|
|
27409
27291
|
* **Details**
|
|
27410
27292
|
*
|
|
27411
|
-
* The
|
|
27412
|
-
*
|
|
27293
|
+
* The log function receives an options object containing the message, log level,
|
|
27294
|
+
* cause, fiber information, and timestamp, and should return the desired output.
|
|
27413
27295
|
*
|
|
27414
|
-
*
|
|
27415
|
-
* @see {@link consolePretty} for the TTY-mode pretty console logger affected by this reference
|
|
27416
|
-
* @see {@link withConsoleError} for routing a specific formatter logger to `console.error`
|
|
27417
|
-
*
|
|
27418
|
-
* @stability stable
|
|
27419
|
-
* @category services
|
|
27420
|
-
* @since 4.0.0
|
|
27421
|
-
*/
|
|
27422
|
-
const LogToStderr = LogToStderr$1;
|
|
27423
|
-
/**
|
|
27424
|
-
* A `Logger` which outputs logs in a "pretty" format and writes them to the
|
|
27425
|
-
* console. Chooses between tty and browser implementation. If the runtime
|
|
27426
|
-
* platform is known and fixed, prefer {@link consolePrettyBrowser} or
|
|
27427
|
-
* {@link consolePrettyTty}.
|
|
27428
|
-
*
|
|
27429
|
-
* **Details**
|
|
27430
|
-
*
|
|
27431
|
-
* For example, pretty output can render as
|
|
27432
|
-
* `[09:37:17.579] INFO (#1) label=0ms: hello` followed by an annotation line
|
|
27433
|
-
* such as `key: value`.
|
|
27434
|
-
*
|
|
27435
|
-
* **Example** (Logging with pretty console output)
|
|
27296
|
+
* **Example** (Creating loggers from functions)
|
|
27436
27297
|
*
|
|
27437
27298
|
* ```ts import.meta.vitest
|
|
27438
27299
|
* import { Effect, Logger } from "effect"
|
|
27439
27300
|
*
|
|
27440
|
-
* const
|
|
27441
|
-
*
|
|
27442
|
-
*
|
|
27443
|
-
* Effect.withLogSpan('label'),
|
|
27444
|
-
* Effect.annotateLogs('key', 'value'),
|
|
27445
|
-
* Effect.provide(prettyLogger),
|
|
27446
|
-
* Effect.runSync
|
|
27301
|
+
* const outputs: Array<string> = []
|
|
27302
|
+
* const textLogger = Logger.make((options) =>
|
|
27303
|
+
* `${options.logLevel}: ${options.message}`
|
|
27447
27304
|
* )
|
|
27448
|
-
*
|
|
27449
|
-
*
|
|
27450
|
-
* **Example** (Logging with console.error, when the environment has TTY)
|
|
27305
|
+
* const collector = Logger.make((options) => outputs.push(textLogger.log(options)))
|
|
27451
27306
|
*
|
|
27452
|
-
*
|
|
27453
|
-
*
|
|
27454
|
-
*
|
|
27455
|
-
* const prettyLoggerLayer = Layer.merge(
|
|
27456
|
-
* Logger.layer([Logger.consolePretty()]),
|
|
27457
|
-
* Layer.succeed(Logger.LogToStderr, true)
|
|
27458
|
-
* )
|
|
27459
|
-
*
|
|
27460
|
-
* Effect.log('hello').pipe(
|
|
27461
|
-
* Effect.provide(prettyLoggerLayer),
|
|
27462
|
-
* Effect.runSync
|
|
27307
|
+
* const program = Effect.log("Hello World").pipe(
|
|
27308
|
+
* Effect.provide(Logger.layer([collector]))
|
|
27463
27309
|
* )
|
|
27310
|
+
* Effect.runSync(program)
|
|
27311
|
+
* outputs // => ["Info: Hello World"]
|
|
27464
27312
|
* ```
|
|
27465
27313
|
*
|
|
27466
|
-
* @see {@link consolePrettyBrowser} for browser-specific implementation
|
|
27467
|
-
* @see {@link consolePrettyTty} for the TTY-mode implementation
|
|
27468
27314
|
* @stability stable
|
|
27469
27315
|
* @category constructors
|
|
27470
|
-
* @since
|
|
27316
|
+
* @since 2.0.0
|
|
27471
27317
|
*/
|
|
27472
|
-
const
|
|
27318
|
+
const make$6 = loggerMake;
|
|
27473
27319
|
/**
|
|
27474
27320
|
* Creates a `Layer` which will overwrite the current set of loggers with the
|
|
27475
27321
|
* specified array of `loggers`.
|
|
@@ -28195,7 +28041,7 @@ const toConfigCursorAST = /*#__PURE__*/ memoize((root) => {
|
|
|
28195
28041
|
function schema(codec, path) {
|
|
28196
28042
|
const codecStringTree = toCodecStringTree(codec);
|
|
28197
28043
|
const encodedAst = toEncoded(codecStringTree.ast);
|
|
28198
|
-
const decodeCursor = decodeUnknownEffect$1(make$
|
|
28044
|
+
const decodeCursor = decodeUnknownEffect$1(make$9(toConfigCursorAST(codecStringTree.ast)));
|
|
28199
28045
|
const localPath = typeof path === "string" ? [path] : path ?? [];
|
|
28200
28046
|
return make$4((provider, pathPrefix) => {
|
|
28201
28047
|
const fullPath = [...pathPrefix, ...localPath];
|
|
@@ -29640,7 +29486,7 @@ const map$1 = /*#__PURE__*/ dual(2, (self, f) => flatMap(self, (a) => succeed(f(
|
|
|
29640
29486
|
* @category constructors
|
|
29641
29487
|
* @since 4.0.0
|
|
29642
29488
|
*/
|
|
29643
|
-
const Password = (options) => basePrompt(options, "password").pipe(map$1(make$
|
|
29489
|
+
const Password = (options) => basePrompt(options, "password").pipe(map$1(make$14));
|
|
29644
29490
|
/**
|
|
29645
29491
|
* Runs a prompt by reading terminal input and rendering prompt frames until the
|
|
29646
29492
|
* prompt submits a value.
|
|
@@ -35328,7 +35174,7 @@ const runWith = (command, config) => {
|
|
|
35328
35174
|
}
|
|
35329
35175
|
const services = match$5(logLevel, {
|
|
35330
35176
|
onNone: () => empty$7(),
|
|
35331
|
-
onSome: (level) => make$
|
|
35177
|
+
onSome: (level) => make$35(MinimumLogLevel, level)
|
|
35332
35178
|
});
|
|
35333
35179
|
yield* provideContext(program, services);
|
|
35334
35180
|
}, catchFilter((error) => isCliError(error) && error._tag === "ShowHelp" ? succeed$6(error) : fail$7(error), (error) => andThen(showHelp(command, error, config.renderErrors !== false), fail$3(error))), catchFilter((error) => config.renderErrors !== false && isCliError(error) && error._tag === "UserError" ? succeed$6(error) : fail$7(error), (error) => andThen(showUserError(error), fail$3(error))), catchFilter((e) => isQuitError(e) ? succeed$6(e) : fail$7(e), (_) => interrupt$1));
|
|
@@ -36577,7 +36423,7 @@ const layer$2 = effect(Service$2, gen(function* () {
|
|
|
36577
36423
|
const fs = yield* FileSystem;
|
|
36578
36424
|
const path = yield* Path$1;
|
|
36579
36425
|
const spawner = yield* ChildProcessSpawner;
|
|
36580
|
-
const run = (command, args, timeout$2) => spawner.string(make$
|
|
36426
|
+
const run = (command, args, timeout$2) => spawner.string(make$19(command, args)).pipe(timeout(timeout$2), mapError((error) => new BrowserError({ message: `\`${command} ${args.join(" ")}\` failed: ${error.message}` })));
|
|
36581
36427
|
const close = (browser) => promise(() => browser.close()).pipe(ignore);
|
|
36582
36428
|
const downloadChromium = fn("Browser.downloadChromium")(function* (timeout) {
|
|
36583
36429
|
const cli = yield* path.fromFileUrl(new URL(import.meta.resolve("playwright-core/cli.js"))).pipe(mapError(() => new BrowserError({ message: "Could not locate playwright-core's CLI" })));
|
|
@@ -37503,7 +37349,7 @@ const write = fn("Clipboard.write")(function* (html) {
|
|
|
37503
37349
|
const spawner = yield* ChildProcessSpawner;
|
|
37504
37350
|
const file = yield* fs.makeTempFileScoped({ suffix: ".html" });
|
|
37505
37351
|
yield* fs.writeFileString(file, `<x-paper-html>${html}</x-paper-html>`);
|
|
37506
|
-
const exitCode = yield* spawner.exitCode(make$
|
|
37352
|
+
const exitCode = yield* spawner.exitCode(make$19("osascript", [
|
|
37507
37353
|
"-l",
|
|
37508
37354
|
"JavaScript",
|
|
37509
37355
|
"-e",
|
|
@@ -54767,7 +54613,7 @@ const NodeInfo = fromJsonString(Struct({
|
|
|
54767
54613
|
const layer = succeed$3(Service, Service.of({ connect: fn("Paper.connect")(function* (settings) {
|
|
54768
54614
|
const client = new Client({
|
|
54769
54615
|
name: "paper-snapshot",
|
|
54770
|
-
version: "0.1.
|
|
54616
|
+
version: "0.1.3"
|
|
54771
54617
|
});
|
|
54772
54618
|
yield* acquireRelease(tryPromise({
|
|
54773
54619
|
try: () => client.connect(new StdioClientTransport({
|
|
@@ -55246,7 +55092,7 @@ const handler = fn("paper-snapshot")(function* (input) {
|
|
|
55246
55092
|
refresh: input.refreshExtension
|
|
55247
55093
|
});
|
|
55248
55094
|
yield* logDebug(`Paper Snapshot ${serializer.version} from ${serializer.origin}`);
|
|
55249
|
-
const runScope = yield* make$
|
|
55095
|
+
const runScope = yield* make$32();
|
|
55250
55096
|
yield* addFinalizer((exit) => close(runScope, exit));
|
|
55251
55097
|
const hasUrl = jobs.some((job) => isSome(job.url));
|
|
55252
55098
|
const sources = yield* resolveSources(input, hasUrl, home, localAppData);
|
|
@@ -55419,10 +55265,22 @@ const command = make$3("paper-snapshot", flags, run).pipe(withDescription("Snaps
|
|
|
55419
55265
|
}
|
|
55420
55266
|
]));
|
|
55421
55267
|
//#endregion
|
|
55268
|
+
//#region src/log.ts
|
|
55269
|
+
/** Human-readable log lines on stderr: `› step`, `✓ result`, `! warning`, `✗ error`. */
|
|
55270
|
+
const colored = process.stderr.isTTY === true;
|
|
55271
|
+
const paint = (code, text) => colored ? `\u001B[${code}m${text}\u001B[0m` : text;
|
|
55272
|
+
/** Lines that report something the user asked for, rather than a step on the way. */
|
|
55273
|
+
const outcome = /^(?:Created|Replaced) artboard|^Copied to the clipboard/;
|
|
55274
|
+
//#endregion
|
|
55422
55275
|
//#region src/bin.ts
|
|
55423
|
-
const LoggerLive =
|
|
55276
|
+
const LoggerLive = layer$4([make$6((options) => {
|
|
55277
|
+
const message = options.message;
|
|
55278
|
+
const text = Array.isArray(message) ? message.map(String).join(" ") : String(message);
|
|
55279
|
+
const mark = value(options.logLevel).pipe(when("Warn", () => paint(33, "!")), when("Error", () => paint(31, "✗")), when("Fatal", () => paint(31, "✗")), when("Info", () => outcome.test(text) ? paint(32, "✓") : paint(2, "›")), orElse(() => paint(2, "·")));
|
|
55280
|
+
process.stderr.write(`${mark} ${text}\n`);
|
|
55281
|
+
})]);
|
|
55424
55282
|
const MainLive = mergeAll(layer$2, layer$1.pipe(provide$2(layer$3)), layer).pipe(provideMerge(layer$5), provideMerge(LoggerLive));
|
|
55425
|
-
run$1(command, { version: "0.1.
|
|
55283
|
+
run$1(command, { version: "0.1.3" }).pipe(tapError((error) => isCliError(error) ? void_ : error$1(`paper-snapshot: ${error.message}`)), tapDefect((defect) => error$1(`paper-snapshot: unexpected error: ${defect instanceof Error ? defect.stack ?? defect.message : String(defect)}`)), provide(MainLive), runMain({
|
|
55426
55284
|
disableErrorReporting: true,
|
|
55427
55285
|
teardown: (exit, onExit) => defaultTeardown(exit, (code) => {
|
|
55428
55286
|
onExit(code);
|
package/package.json
CHANGED