react-doctor 0.9.8-dev.7f028ea → 0.9.9-dev.e69faca
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/{build-section-divider-DKzi1sn2.js → build-section-divider-Dqnkjosd.js} +22 -103
- package/dist/{ci-BKAwxTDf.js → ci-uLJQVsey.js} +11 -11
- package/dist/cli.js +33 -30
- package/dist/{design-ROS4n3k3.js → design-Pe_3Az8X.js} +4 -4
- package/dist/{exit-gracefully-De1Nzy3z.js → exit-gracefully-DrpCqAEw.js} +7 -6
- package/dist/index.d.ts +9 -1
- package/dist/index.js +159 -159
- package/dist/{inspect-Z_e5RkQs.js → inspect-DspBK6iV.js} +16 -16
- package/dist/{install-BDS2ISd_.js → install-Bq82FRWq.js} +8 -8
- package/dist/{install-doctor-script-J-zvzVqR.js → install-doctor-script-DE8IUn7u.js} +4 -4
- package/dist/{install-github-workflow-CAo3dNh1.js → install-github-workflow-COlI8Ygf.js} +6 -6
- package/dist/{install-react-doctor-C_5DWtTC.js → install-react-doctor-CN-Ysvqg.js} +8 -8
- package/dist/lsp.js +2122 -327
- package/dist/{print-branded-header-UfYgFqhb.js → print-branded-header-CyZuPgPz.js} +4 -4
- package/dist/{read-object-file-BDLV3R4X.js → read-object-file-NUALLod8.js} +4 -4
- package/dist/{record-metric-BGxpNcR0.js → record-metric-BE4W9NsY.js} +1654 -295
- package/dist/{report-error-Wat6_MDs.js → report-error-BcxyEZqQ.js} +18 -12
- package/dist/{report-workflow-result-CULZXneJ.js → report-workflow-result-BIYz6Xh4.js} +5 -5
- package/dist/{resolve-scope-BbndLz4E.js → resolve-scope-O3agwyD8.js} +6 -6
- package/dist/{rules-BSF6erEQ.js → rules-BsGDAd3P.js} +6 -6
- package/dist/{run-scan-app-D1yyCXe2.js → run-scan-app-DyCMqHI5.js} +10 -10
- package/dist/{scan-BTYPKfS9.js → scan-XCE1aa38.js} +8 -8
- package/dist/{should-fail-scan-gate-CgCFA8pU.js → should-fail-scan-gate-ChTwe1SJ.js} +114 -192
- package/dist/{should-skip-prompts-CZbr6sjQ.js → should-skip-prompts-f3iHsUsZ.js} +4 -4
- package/dist/{unref-stdin-noiOzC5n.js → unref-stdin-WJS2VNFJ.js} +112 -5
- package/dist/{version-BAsYYPLc.js → version-sAGj465-.js} +4 -4
- package/dist/{why-DZ9AgG5O.js → why-CukgIunZ.js} +4 -4
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="11709fb0-7eca-5c5d-bdbd-68701ac41afd")}catch(e){}}();
|
|
3
3
|
import { n as __require, r as __toESM$1, t as __commonJSMin$1 } from "./chunk-q7NCDQ7-.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as NodeChildProcess from "node:child_process";
|
|
@@ -24,7 +24,6 @@ import { PassThrough } from "node:stream";
|
|
|
24
24
|
import { convertToTSX } from "@astrojs/compiler/sync";
|
|
25
25
|
import { STATUS_CODES } from "node:http";
|
|
26
26
|
import { gzipSync } from "node:zlib";
|
|
27
|
-
import * as Sentry from "@sentry/node";
|
|
28
27
|
import { performance as performance$1 } from "node:perf_hooks";
|
|
29
28
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Pipeable.js
|
|
30
29
|
/**
|
|
@@ -1175,7 +1174,7 @@ const random = (self) => {
|
|
|
1175
1174
|
* @category hashing
|
|
1176
1175
|
* @since 2.0.0
|
|
1177
1176
|
*/
|
|
1178
|
-
const combine = /* @__PURE__ */ dual(2, (self, b) => self * 53 ^ b);
|
|
1177
|
+
const combine$1 = /* @__PURE__ */ dual(2, (self, b) => self * 53 ^ b);
|
|
1179
1178
|
/**
|
|
1180
1179
|
* Applies bit manipulation techniques to optimize a hash value.
|
|
1181
1180
|
*
|
|
@@ -1350,7 +1349,7 @@ const string$2 = (str) => {
|
|
|
1350
1349
|
*/
|
|
1351
1350
|
const structureKeys = (o, keys) => {
|
|
1352
1351
|
let h = 12289;
|
|
1353
|
-
for (const key of keys) h ^= combine(hash(key), hash(o[key]));
|
|
1352
|
+
for (const key of keys) h ^= combine$1(hash(key), hash(o[key]));
|
|
1354
1353
|
return optimize(h);
|
|
1355
1354
|
};
|
|
1356
1355
|
/**
|
|
@@ -1431,7 +1430,7 @@ const iterableWith = (seed, f) => (iter) => {
|
|
|
1431
1430
|
* @since 2.0.0
|
|
1432
1431
|
*/
|
|
1433
1432
|
const array = /* @__PURE__ */ iterableWith(6151, hash);
|
|
1434
|
-
const hashMap = /* @__PURE__ */ iterableWith(/* @__PURE__ */ string$2("Map"), ([k, v]) => combine(hash(k), hash(v)));
|
|
1433
|
+
const hashMap = /* @__PURE__ */ iterableWith(/* @__PURE__ */ string$2("Map"), ([k, v]) => combine$1(hash(k), hash(v)));
|
|
1435
1434
|
const hashSet = /* @__PURE__ */ iterableWith(/* @__PURE__ */ string$2("Set"), hash);
|
|
1436
1435
|
const randomHashCache = /* @__PURE__ */ new WeakMap();
|
|
1437
1436
|
const hashCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -2657,7 +2656,7 @@ var Fail = class extends ReasonBase {
|
|
|
2657
2656
|
return isFailReason$1(that) && equals$2(this.error, that.error) && equals$2(this.annotations, that.annotations);
|
|
2658
2657
|
}
|
|
2659
2658
|
[symbol$1]() {
|
|
2660
|
-
return combine(string$2(this._tag))(combine(hash(this.error))(hash(this.annotations)));
|
|
2659
|
+
return combine$1(string$2(this._tag))(combine$1(hash(this.error))(hash(this.annotations)));
|
|
2661
2660
|
}
|
|
2662
2661
|
};
|
|
2663
2662
|
/** @internal */
|
|
@@ -2686,7 +2685,7 @@ var Die = class extends ReasonBase {
|
|
|
2686
2685
|
return isDieReason(that) && equals$2(this.defect, that.defect) && equals$2(this.annotations, that.annotations);
|
|
2687
2686
|
}
|
|
2688
2687
|
[symbol$1]() {
|
|
2689
|
-
return combine(string$2(this._tag))(combine(hash(this.defect))(hash(this.annotations)));
|
|
2688
|
+
return combine$1(string$2(this._tag))(combine$1(hash(this.defect))(hash(this.annotations)));
|
|
2690
2689
|
}
|
|
2691
2690
|
};
|
|
2692
2691
|
/** @internal */
|
|
@@ -2746,7 +2745,7 @@ const makeExit = (options) => {
|
|
|
2746
2745
|
return isExit(that) && that._tag === this._tag && equals$2(this[args], that[args]);
|
|
2747
2746
|
},
|
|
2748
2747
|
[symbol$1]() {
|
|
2749
|
-
return combine(string$2(options.op), hash(this[args]));
|
|
2748
|
+
return combine$1(string$2(options.op), hash(this[args]));
|
|
2750
2749
|
}
|
|
2751
2750
|
};
|
|
2752
2751
|
return function(value) {
|
|
@@ -2868,9 +2867,9 @@ const done$2 = (value) => {
|
|
|
2868
2867
|
/**
|
|
2869
2868
|
* @since 2.0.0
|
|
2870
2869
|
*/
|
|
2871
|
-
const TypeId$
|
|
2870
|
+
const TypeId$39 = "~effect/data/Option";
|
|
2872
2871
|
const CommonProto$1 = {
|
|
2873
|
-
[TypeId$
|
|
2872
|
+
[TypeId$39]: { _A: (_) => _ },
|
|
2874
2873
|
...PipeInspectableProto,
|
|
2875
2874
|
[Symbol.iterator]() {
|
|
2876
2875
|
return new SingleShotGen(this);
|
|
@@ -2883,7 +2882,7 @@ const SomeProto = /* @__PURE__ */ Object.defineProperty(/* @__PURE__ */ Object.a
|
|
|
2883
2882
|
return isOption(that) && isSome$1(that) && equals$2(this.value, that.value);
|
|
2884
2883
|
},
|
|
2885
2884
|
[symbol$1]() {
|
|
2886
|
-
return combine(hash(this._tag))(hash(this.value));
|
|
2885
|
+
return combine$1(hash(this._tag))(hash(this.value));
|
|
2887
2886
|
},
|
|
2888
2887
|
toString() {
|
|
2889
2888
|
return `some(${format$1(this.value)})`;
|
|
@@ -2920,7 +2919,7 @@ const NoneProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(Co
|
|
|
2920
2919
|
}
|
|
2921
2920
|
});
|
|
2922
2921
|
/** @internal */
|
|
2923
|
-
const isOption = (input) => hasProperty(input, TypeId$
|
|
2922
|
+
const isOption = (input) => hasProperty(input, TypeId$39);
|
|
2924
2923
|
/** @internal */
|
|
2925
2924
|
const isNone$1 = (fa) => fa._tag === "None";
|
|
2926
2925
|
/** @internal */
|
|
@@ -2935,9 +2934,9 @@ const some$1 = (value) => {
|
|
|
2935
2934
|
};
|
|
2936
2935
|
//#endregion
|
|
2937
2936
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/result.js
|
|
2938
|
-
const TypeId$
|
|
2937
|
+
const TypeId$38 = "~effect/data/Result";
|
|
2939
2938
|
const CommonProto = {
|
|
2940
|
-
[TypeId$
|
|
2939
|
+
[TypeId$38]: {
|
|
2941
2940
|
/* v8 ignore next 2 */
|
|
2942
2941
|
_A: (_) => _,
|
|
2943
2942
|
_E: (_) => _
|
|
@@ -2954,7 +2953,7 @@ const SuccessProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create
|
|
|
2954
2953
|
return isResult(that) && isSuccess$2(that) && equals$2(this.success, that.success);
|
|
2955
2954
|
},
|
|
2956
2955
|
[symbol$1]() {
|
|
2957
|
-
return combine(hash(this._tag))(hash(this.success));
|
|
2956
|
+
return combine$1(hash(this._tag))(hash(this.success));
|
|
2958
2957
|
},
|
|
2959
2958
|
toString() {
|
|
2960
2959
|
return `success(${format$1(this.success)})`;
|
|
@@ -2974,7 +2973,7 @@ const FailureProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create
|
|
|
2974
2973
|
return isResult(that) && isFailure$2(that) && equals$2(this.failure, that.failure);
|
|
2975
2974
|
},
|
|
2976
2975
|
[symbol$1]() {
|
|
2977
|
-
return combine(hash(this._tag))(hash(this.failure));
|
|
2976
|
+
return combine$1(hash(this._tag))(hash(this.failure));
|
|
2978
2977
|
},
|
|
2979
2978
|
toString() {
|
|
2980
2979
|
return `failure(${format$1(this.failure)})`;
|
|
@@ -2988,7 +2987,7 @@ const FailureProto = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create
|
|
|
2988
2987
|
}
|
|
2989
2988
|
});
|
|
2990
2989
|
/** @internal */
|
|
2991
|
-
const isResult = (input) => hasProperty(input, TypeId$
|
|
2990
|
+
const isResult = (input) => hasProperty(input, TypeId$38);
|
|
2992
2991
|
/** @internal */
|
|
2993
2992
|
const isFailure$2 = (result) => result._tag === "Failure";
|
|
2994
2993
|
/** @internal */
|
|
@@ -4223,6 +4222,37 @@ const isArrayNonEmpty = isArrayNonEmpty$1;
|
|
|
4223
4222
|
* @since 4.0.0
|
|
4224
4223
|
*/
|
|
4225
4224
|
const isReadonlyArrayNonEmpty = isArrayNonEmpty$1;
|
|
4225
|
+
/**
|
|
4226
|
+
* Sorts an array by the given `Order`, returning a new array.
|
|
4227
|
+
*
|
|
4228
|
+
* **When to use**
|
|
4229
|
+
*
|
|
4230
|
+
* Use to sort an array using a single `Order` comparator.
|
|
4231
|
+
*
|
|
4232
|
+
* **Details**
|
|
4233
|
+
*
|
|
4234
|
+
* Preserves `NonEmptyArray` in the return type. Use `sortWith` to sort by a
|
|
4235
|
+
* derived key, or `sortBy` for multi-key sorting.
|
|
4236
|
+
*
|
|
4237
|
+
* **Example** (Sorting numbers)
|
|
4238
|
+
*
|
|
4239
|
+
* ```ts
|
|
4240
|
+
* import { Array, Order } from "effect"
|
|
4241
|
+
*
|
|
4242
|
+
* console.log(Array.sort([3, 1, 4, 1, 5], Order.Number)) // [1, 1, 3, 4, 5]
|
|
4243
|
+
* ```
|
|
4244
|
+
*
|
|
4245
|
+
* @see {@link sortWith} — sort by a mapping function
|
|
4246
|
+
* @see {@link sortBy} — sort by multiple orders
|
|
4247
|
+
*
|
|
4248
|
+
* @category sorting
|
|
4249
|
+
* @since 2.0.0
|
|
4250
|
+
*/
|
|
4251
|
+
const sort$1 = /* @__PURE__ */ dual(2, (self, O) => {
|
|
4252
|
+
const out = Array$1.from(self);
|
|
4253
|
+
out.sort(O);
|
|
4254
|
+
return out;
|
|
4255
|
+
});
|
|
4226
4256
|
const hashBucketsAdd = (buckets, value) => {
|
|
4227
4257
|
const hash$5 = hash(value);
|
|
4228
4258
|
const bucket = buckets.get(hash$5);
|
|
@@ -4388,12 +4418,12 @@ const dedupe = (self) => {
|
|
|
4388
4418
|
*
|
|
4389
4419
|
* @since 2.0.0
|
|
4390
4420
|
*/
|
|
4391
|
-
const TypeId$
|
|
4421
|
+
const TypeId$37 = "~effect/BigDecimal";
|
|
4392
4422
|
const BigDecimalProto = {
|
|
4393
|
-
[TypeId$
|
|
4423
|
+
[TypeId$37]: TypeId$37,
|
|
4394
4424
|
[symbol$1]() {
|
|
4395
4425
|
const normalized = normalize(this);
|
|
4396
|
-
return combine(hash(normalized.value), number$1(normalized.scale));
|
|
4426
|
+
return combine$1(hash(normalized.value), number$1(normalized.scale));
|
|
4397
4427
|
},
|
|
4398
4428
|
[symbol](that) {
|
|
4399
4429
|
return isBigDecimal(that) && equals$1(this, that);
|
|
@@ -4436,7 +4466,7 @@ const BigDecimalProto = {
|
|
|
4436
4466
|
* @category guards
|
|
4437
4467
|
* @since 2.0.0
|
|
4438
4468
|
*/
|
|
4439
|
-
const isBigDecimal = (u) => hasProperty(u, TypeId$
|
|
4469
|
+
const isBigDecimal = (u) => hasProperty(u, TypeId$37);
|
|
4440
4470
|
/**
|
|
4441
4471
|
* Creates a `BigDecimal` from a `bigint` value and a scale.
|
|
4442
4472
|
*
|
|
@@ -4476,14 +4506,14 @@ const make$36 = (value, scale) => {
|
|
|
4476
4506
|
* @internal
|
|
4477
4507
|
*/
|
|
4478
4508
|
const makeNormalizedUnsafe = (value, scale) => {
|
|
4479
|
-
if (value !== bigint0$
|
|
4509
|
+
if (value !== bigint0$3 && value % bigint10 === bigint0$3) throw new RangeError("Value must be normalized");
|
|
4480
4510
|
const o = make$36(value, scale);
|
|
4481
4511
|
o.normalized = o;
|
|
4482
4512
|
return o;
|
|
4483
4513
|
};
|
|
4484
|
-
const bigint0$
|
|
4514
|
+
const bigint0$3 = /* @__PURE__ */ BigInt(0);
|
|
4485
4515
|
const bigint10 = /* @__PURE__ */ BigInt(10);
|
|
4486
|
-
const zero$1 = /* @__PURE__ */ makeNormalizedUnsafe(bigint0$
|
|
4516
|
+
const zero$1 = /* @__PURE__ */ makeNormalizedUnsafe(bigint0$3, 0);
|
|
4487
4517
|
/**
|
|
4488
4518
|
* Normalizes a given `BigDecimal` by removing trailing zeros.
|
|
4489
4519
|
*
|
|
@@ -4514,7 +4544,7 @@ const zero$1 = /* @__PURE__ */ makeNormalizedUnsafe(bigint0$2, 0);
|
|
|
4514
4544
|
* @since 2.0.0
|
|
4515
4545
|
*/
|
|
4516
4546
|
const normalize = (self) => {
|
|
4517
|
-
if (self.normalized === void 0) if (self.value === bigint0$
|
|
4547
|
+
if (self.normalized === void 0) if (self.value === bigint0$3) self.normalized = zero$1;
|
|
4518
4548
|
else {
|
|
4519
4549
|
const digits = `${self.value}`;
|
|
4520
4550
|
let trail = 0;
|
|
@@ -4585,7 +4615,7 @@ const scale = /* @__PURE__ */ dual(2, (self, scale) => {
|
|
|
4585
4615
|
* @category math
|
|
4586
4616
|
* @since 2.0.0
|
|
4587
4617
|
*/
|
|
4588
|
-
const abs = (n) => n.value < bigint0$
|
|
4618
|
+
const abs = (n) => n.value < bigint0$3 ? make$36(-n.value, n.scale) : n;
|
|
4589
4619
|
/**
|
|
4590
4620
|
* Provides an `Equivalence` instance for `BigDecimal` that determines equality between BigDecimal values.
|
|
4591
4621
|
*
|
|
@@ -4673,7 +4703,7 @@ const equals$1 = /* @__PURE__ */ dual(2, (self, that) => Equivalence$5(self, tha
|
|
|
4673
4703
|
const format = (n) => {
|
|
4674
4704
|
const normalized = normalize(n);
|
|
4675
4705
|
if (Math.abs(normalized.scale) >= 16) return toExponential(normalized);
|
|
4676
|
-
const negative = normalized.value < bigint0$
|
|
4706
|
+
const negative = normalized.value < bigint0$3;
|
|
4677
4707
|
const absolute = negative ? `${normalized.value}`.substring(1) : `${normalized.value}`;
|
|
4678
4708
|
let before;
|
|
4679
4709
|
let after;
|
|
@@ -4746,7 +4776,7 @@ const toExponential = (n) => {
|
|
|
4746
4776
|
* @category predicates
|
|
4747
4777
|
* @since 2.0.0
|
|
4748
4778
|
*/
|
|
4749
|
-
const isZero$1 = (n) => n.value === bigint0$
|
|
4779
|
+
const isZero$1 = (n) => n.value === bigint0$3;
|
|
4750
4780
|
/**
|
|
4751
4781
|
* Checks whether a given `BigDecimal` is negative.
|
|
4752
4782
|
*
|
|
@@ -4768,7 +4798,7 @@ const isZero$1 = (n) => n.value === bigint0$2;
|
|
|
4768
4798
|
* @category predicates
|
|
4769
4799
|
* @since 2.0.0
|
|
4770
4800
|
*/
|
|
4771
|
-
const isNegative = (n) => n.value < bigint0$
|
|
4801
|
+
const isNegative = (n) => n.value < bigint0$3;
|
|
4772
4802
|
//#endregion
|
|
4773
4803
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Effectable.js
|
|
4774
4804
|
/**
|
|
@@ -4937,7 +4967,7 @@ const ServiceProto = {
|
|
|
4937
4967
|
}
|
|
4938
4968
|
};
|
|
4939
4969
|
const ReferenceTypeId = "~effect/Context/Reference";
|
|
4940
|
-
const TypeId$
|
|
4970
|
+
const TypeId$36 = "~effect/Context";
|
|
4941
4971
|
/**
|
|
4942
4972
|
* Creates a `Context` from an existing service map.
|
|
4943
4973
|
*
|
|
@@ -4976,7 +5006,7 @@ const makeUnsafe$7 = (mapUnsafe) => {
|
|
|
4976
5006
|
};
|
|
4977
5007
|
const Proto$13 = {
|
|
4978
5008
|
...PipeInspectableProto,
|
|
4979
|
-
[TypeId$
|
|
5009
|
+
[TypeId$36]: { _Services: (_) => _ },
|
|
4980
5010
|
toJSON() {
|
|
4981
5011
|
return {
|
|
4982
5012
|
_id: "Context",
|
|
@@ -5028,7 +5058,7 @@ const Proto$13 = {
|
|
|
5028
5058
|
* @category guards
|
|
5029
5059
|
* @since 2.0.0
|
|
5030
5060
|
*/
|
|
5031
|
-
const isContext = (u) => hasProperty(u, TypeId$
|
|
5061
|
+
const isContext = (u) => hasProperty(u, TypeId$36);
|
|
5032
5062
|
/**
|
|
5033
5063
|
* Checks whether the provided argument is a `Reference`.
|
|
5034
5064
|
*
|
|
@@ -5364,7 +5394,7 @@ const getOption = /* @__PURE__ */ dual(2, (self, service) => {
|
|
|
5364
5394
|
* @category combining
|
|
5365
5395
|
* @since 2.0.0
|
|
5366
5396
|
*/
|
|
5367
|
-
const merge$
|
|
5397
|
+
const merge$4 = /* @__PURE__ */ dual(2, (self, that) => {
|
|
5368
5398
|
if (self.mapUnsafe.size === 0) return that;
|
|
5369
5399
|
if (that.mapUnsafe.size === 0) return self;
|
|
5370
5400
|
return withMapUnsafe(self, (map) => {
|
|
@@ -5474,8 +5504,8 @@ const withMapUnsafe = (self, f) => {
|
|
|
5474
5504
|
const Reference = Service;
|
|
5475
5505
|
//#endregion
|
|
5476
5506
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Duration.js
|
|
5477
|
-
const TypeId$
|
|
5478
|
-
const bigint0$
|
|
5507
|
+
const TypeId$35 = "~effect/time/Duration";
|
|
5508
|
+
const bigint0$2 = /* @__PURE__ */ BigInt(0);
|
|
5479
5509
|
const bigint1 = /* @__PURE__ */ BigInt(1);
|
|
5480
5510
|
const bigint1e3 = /* @__PURE__ */ BigInt(1e3);
|
|
5481
5511
|
const roundTiesAwayFromZero = (input) => BigInt(input < 0 ? Math.ceil(input - .5) : Math.floor(input + .5));
|
|
@@ -5539,7 +5569,7 @@ const fromInputUnsafe = (input) => {
|
|
|
5539
5569
|
}
|
|
5540
5570
|
case "object": {
|
|
5541
5571
|
if (input === null) break;
|
|
5542
|
-
if (TypeId$
|
|
5572
|
+
if (TypeId$35 in input) return input;
|
|
5543
5573
|
if (Array.isArray(input)) {
|
|
5544
5574
|
if (input.length !== 2 || !input.every(isNumber)) return invalid(input);
|
|
5545
5575
|
if (Number.isNaN(input[0]) || Number.isNaN(input[1])) return zero;
|
|
@@ -5571,7 +5601,7 @@ const zeroDurationValue = {
|
|
|
5571
5601
|
const infinityDurationValue = { _tag: "Infinity" };
|
|
5572
5602
|
const negativeInfinityDurationValue = { _tag: "NegativeInfinity" };
|
|
5573
5603
|
const DurationProto = {
|
|
5574
|
-
[TypeId$
|
|
5604
|
+
[TypeId$35]: TypeId$35,
|
|
5575
5605
|
[symbol$1]() {
|
|
5576
5606
|
return structure(this.value);
|
|
5577
5607
|
},
|
|
@@ -5627,7 +5657,7 @@ const make$34 = (input) => {
|
|
|
5627
5657
|
_tag: "Millis",
|
|
5628
5658
|
millis: input
|
|
5629
5659
|
};
|
|
5630
|
-
else if (input === bigint0$
|
|
5660
|
+
else if (input === bigint0$2) duration.value = zeroDurationValue;
|
|
5631
5661
|
else duration.value = {
|
|
5632
5662
|
_tag: "Nanos",
|
|
5633
5663
|
nanos: input
|
|
@@ -5649,7 +5679,7 @@ const make$34 = (input) => {
|
|
|
5649
5679
|
* @category guards
|
|
5650
5680
|
* @since 2.0.0
|
|
5651
5681
|
*/
|
|
5652
|
-
const isDuration = (u) => hasProperty(u, TypeId$
|
|
5682
|
+
const isDuration = (u) => hasProperty(u, TypeId$35);
|
|
5653
5683
|
/**
|
|
5654
5684
|
* Checks whether a Duration is finite (not infinite).
|
|
5655
5685
|
*
|
|
@@ -5684,7 +5714,7 @@ const isFinite$1 = (self) => self.value._tag !== "Infinity" && self.value._tag !
|
|
|
5684
5714
|
const isZero = (self) => {
|
|
5685
5715
|
switch (self.value._tag) {
|
|
5686
5716
|
case "Millis": return self.value.millis === 0;
|
|
5687
|
-
case "Nanos": return self.value.nanos === bigint0$
|
|
5717
|
+
case "Nanos": return self.value.nanos === bigint0$2;
|
|
5688
5718
|
case "Infinity":
|
|
5689
5719
|
case "NegativeInfinity": return false;
|
|
5690
5720
|
}
|
|
@@ -6453,39 +6483,6 @@ var ParentSpan = class extends Service()(ParentSpanKey) {};
|
|
|
6453
6483
|
*/
|
|
6454
6484
|
const make$33 = (options) => options;
|
|
6455
6485
|
/**
|
|
6456
|
-
* Creates an `ExternalSpan` from trace and span identifiers, defaulting
|
|
6457
|
-
* `sampled` to `true` and annotations to an empty context when they are not
|
|
6458
|
-
* provided.
|
|
6459
|
-
*
|
|
6460
|
-
* **Example** (Creating an external span)
|
|
6461
|
-
*
|
|
6462
|
-
* ```ts
|
|
6463
|
-
* import { Effect, Tracer } from "effect"
|
|
6464
|
-
*
|
|
6465
|
-
* // Create an external span from another tracing system
|
|
6466
|
-
* const span = Tracer.externalSpan({
|
|
6467
|
-
* spanId: "span-abc-123",
|
|
6468
|
-
* traceId: "trace-xyz-789",
|
|
6469
|
-
* sampled: true
|
|
6470
|
-
* })
|
|
6471
|
-
*
|
|
6472
|
-
* // Use the external span as a parent
|
|
6473
|
-
* const program = Effect.succeed("Hello").pipe(
|
|
6474
|
-
* Effect.withSpan("child-operation", { parent: span })
|
|
6475
|
-
* )
|
|
6476
|
-
* ```
|
|
6477
|
-
*
|
|
6478
|
-
* @category constructors
|
|
6479
|
-
* @since 2.0.0
|
|
6480
|
-
*/
|
|
6481
|
-
const externalSpan = (options) => ({
|
|
6482
|
-
_tag: "ExternalSpan",
|
|
6483
|
-
spanId: options.spanId,
|
|
6484
|
-
traceId: options.traceId,
|
|
6485
|
-
sampled: options.sampled ?? true,
|
|
6486
|
-
annotations: options.annotations ?? empty$8()
|
|
6487
|
-
});
|
|
6488
|
-
/**
|
|
6489
6486
|
* Context reference for disabling trace propagation.
|
|
6490
6487
|
*
|
|
6491
6488
|
* **When to use**
|
|
@@ -6750,7 +6747,7 @@ var Interrupt = class extends ReasonBase {
|
|
|
6750
6747
|
return isInterruptReason(that) && this.fiberId === that.fiberId && this.annotations === that.annotations;
|
|
6751
6748
|
}
|
|
6752
6749
|
[symbol$1]() {
|
|
6753
|
-
return combine(string$2(`${this._tag}:${this.fiberId}`))(random(this.annotations));
|
|
6750
|
+
return combine$1(string$2(`${this._tag}:${this.fiberId}`))(random(this.annotations));
|
|
6754
6751
|
}
|
|
6755
6752
|
};
|
|
6756
6753
|
/** @internal */
|
|
@@ -7180,7 +7177,7 @@ const fiberInterrupt = (self) => withFiber$1((fiber) => fiberInterruptAs(self, f
|
|
|
7180
7177
|
/** @internal */
|
|
7181
7178
|
const fiberInterruptAs = /* @__PURE__ */ dual((args) => hasProperty(args[0], FiberTypeId), (self, fiberId, annotations) => withFiber$1((parent) => {
|
|
7182
7179
|
let ann = fiberStackAnnotations(parent);
|
|
7183
|
-
ann = ann && annotations ? merge$
|
|
7180
|
+
ann = ann && annotations ? merge$4(ann, annotations) : ann ?? annotations;
|
|
7184
7181
|
self.interruptUnsafe(fiberId, ann);
|
|
7185
7182
|
return asVoid$1(fiberAwait(self));
|
|
7186
7183
|
}));
|
|
@@ -7540,6 +7537,8 @@ const exitAsVoidAll = (exits) => {
|
|
|
7540
7537
|
return failures.length === 0 ? exitVoid : exitFailCause(causeFromReasons(failures));
|
|
7541
7538
|
};
|
|
7542
7539
|
/** @internal */
|
|
7540
|
+
const service$1 = (service) => service;
|
|
7541
|
+
/** @internal */
|
|
7543
7542
|
const serviceOption$1 = (service) => withFiber$1((fiber) => succeed$5(getOption(fiber.context, service)));
|
|
7544
7543
|
/** @internal */
|
|
7545
7544
|
const updateContext$1 = /* @__PURE__ */ dual(2, (self, f) => withFiber$1((fiber) => {
|
|
@@ -7566,7 +7565,7 @@ const contextWith$1 = (f) => withFiber$1((fiber) => f(fiber.context));
|
|
|
7566
7565
|
/** @internal */
|
|
7567
7566
|
const provideContext$1 = /* @__PURE__ */ dual(2, (self, context) => {
|
|
7568
7567
|
if (effectIsExit(self)) return self;
|
|
7569
|
-
return updateContext$1(self, merge$
|
|
7568
|
+
return updateContext$1(self, merge$4(context));
|
|
7570
7569
|
});
|
|
7571
7570
|
/** @internal */
|
|
7572
7571
|
const provideService$3 = function() {
|
|
@@ -8293,10 +8292,8 @@ const makeLatchUnsafe = (open) => new Latch(open ?? false);
|
|
|
8293
8292
|
/** @internal */
|
|
8294
8293
|
const makeLatch = (open) => sync$2(() => makeLatchUnsafe(open));
|
|
8295
8294
|
/** @internal */
|
|
8296
|
-
const withTracer$1 = /* @__PURE__ */ dual(2, (effect, tracer) => provideService$3(effect, Tracer, tracer));
|
|
8297
|
-
/** @internal */
|
|
8298
8295
|
const withTracerEnabled$1 = /* @__PURE__ */ provideService$3(TracerEnabled);
|
|
8299
|
-
const bigint0 = /* @__PURE__ */ BigInt(0);
|
|
8296
|
+
const bigint0$1 = /* @__PURE__ */ BigInt(0);
|
|
8300
8297
|
const NoopSpanProto = {
|
|
8301
8298
|
_tag: "Span",
|
|
8302
8299
|
spanId: "noop",
|
|
@@ -8304,8 +8301,8 @@ const NoopSpanProto = {
|
|
|
8304
8301
|
sampled: false,
|
|
8305
8302
|
status: {
|
|
8306
8303
|
_tag: "Ended",
|
|
8307
|
-
startTime: bigint0,
|
|
8308
|
-
endTime: bigint0,
|
|
8304
|
+
startTime: bigint0$1,
|
|
8305
|
+
endTime: bigint0$1,
|
|
8309
8306
|
exit: exitVoid
|
|
8310
8307
|
},
|
|
8311
8308
|
attributes: /* @__PURE__ */ new Map(),
|
|
@@ -8355,6 +8352,8 @@ const makeSpanUnsafe = (fiber, name, options) => {
|
|
|
8355
8352
|
}
|
|
8356
8353
|
return span;
|
|
8357
8354
|
};
|
|
8355
|
+
/** @internal */
|
|
8356
|
+
const makeSpan$2 = (name, options) => withFiber$1((fiber) => succeed$5(makeSpanUnsafe(fiber, name, options)));
|
|
8358
8357
|
const provideSpanStackFrame = (name, stack) => {
|
|
8359
8358
|
stack = typeof stack === "function" ? stack : constUndefined;
|
|
8360
8359
|
return updateService(CurrentStackFrame, (parent) => ({
|
|
@@ -8738,6 +8737,38 @@ const hasInterruptsOnly = hasInterruptsOnly$1;
|
|
|
8738
8737
|
*/
|
|
8739
8738
|
const map$4 = causeMap;
|
|
8740
8739
|
/**
|
|
8740
|
+
* Merges two causes into a single cause whose `reasons` array is the union
|
|
8741
|
+
* of both inputs (de-duplicated by value equality).
|
|
8742
|
+
*
|
|
8743
|
+
* **When to use**
|
|
8744
|
+
*
|
|
8745
|
+
* Use to merge independent causes into one structured failure value.
|
|
8746
|
+
*
|
|
8747
|
+
* **Details**
|
|
8748
|
+
*
|
|
8749
|
+
* - Combining with `empty` returns the other cause unchanged.
|
|
8750
|
+
* - If the result is structurally equal to `self`, `self` is returned
|
|
8751
|
+
* (referential shortcut).
|
|
8752
|
+
*
|
|
8753
|
+
* **Example** (Combining two causes)
|
|
8754
|
+
*
|
|
8755
|
+
* ```ts
|
|
8756
|
+
* import { Cause } from "effect"
|
|
8757
|
+
*
|
|
8758
|
+
* const cause1 = Cause.fail("error1")
|
|
8759
|
+
* const cause2 = Cause.fail("error2")
|
|
8760
|
+
* const combined = Cause.combine(cause1, cause2)
|
|
8761
|
+
* console.log(combined.reasons.length) // 2
|
|
8762
|
+
* ```
|
|
8763
|
+
*
|
|
8764
|
+
* @see {@link fromReasons} — build a cause from an array of reasons
|
|
8765
|
+
* @see {@link empty} for the identity cause used when combining
|
|
8766
|
+
*
|
|
8767
|
+
* @category combining
|
|
8768
|
+
* @since 4.0.0
|
|
8769
|
+
*/
|
|
8770
|
+
const combine = causeCombine;
|
|
8771
|
+
/**
|
|
8741
8772
|
* Collapses a `Cause` into a single `unknown` value, picking the "most
|
|
8742
8773
|
* important" failure in this order:
|
|
8743
8774
|
*
|
|
@@ -9909,14 +9940,14 @@ const forkUnsafe = scopeForkUnsafe;
|
|
|
9909
9940
|
const close = scopeClose;
|
|
9910
9941
|
//#endregion
|
|
9911
9942
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Layer.js
|
|
9912
|
-
const TypeId$
|
|
9943
|
+
const TypeId$33 = "~effect/Layer";
|
|
9913
9944
|
const MemoMapTypeId = "~effect/Layer/MemoMap";
|
|
9914
9945
|
const memoMapReuse = (entry, scope) => {
|
|
9915
9946
|
entry.observers++;
|
|
9916
9947
|
return andThen$1(scopeAddFinalizerExit(scope, (exit) => entry.finalizer(exit)), entry.effect);
|
|
9917
9948
|
};
|
|
9918
9949
|
const LayerProto = {
|
|
9919
|
-
[TypeId$
|
|
9950
|
+
[TypeId$33]: {
|
|
9920
9951
|
_ROut: identity,
|
|
9921
9952
|
_E: identity,
|
|
9922
9953
|
_RIn: identity
|
|
@@ -10572,6 +10603,50 @@ const mergeAllEffect = (layers, memoMap, scope) => {
|
|
|
10572
10603
|
* @since 2.0.0
|
|
10573
10604
|
*/
|
|
10574
10605
|
const mergeAll$1 = (...layers) => fromBuild((memoMap, scope) => mergeAllEffect(layers, memoMap, scope));
|
|
10606
|
+
/**
|
|
10607
|
+
* Merges this layer with another layer concurrently, producing a new layer with
|
|
10608
|
+
* combined input, error, and output types.
|
|
10609
|
+
*
|
|
10610
|
+
* **When to use**
|
|
10611
|
+
*
|
|
10612
|
+
* Use to combine an existing `Layer` with another `Layer` or an array of
|
|
10613
|
+
* layers while preserving pipeline style.
|
|
10614
|
+
*
|
|
10615
|
+
* **Details**
|
|
10616
|
+
*
|
|
10617
|
+
* This is a binary version of `mergeAll` that merges exactly two layers or one
|
|
10618
|
+
* layer with an array of layers. The layers are built concurrently and their
|
|
10619
|
+
* outputs are combined.
|
|
10620
|
+
*
|
|
10621
|
+
* **Example** (Merging two layers)
|
|
10622
|
+
*
|
|
10623
|
+
* ```ts
|
|
10624
|
+
* import { Context, Effect, Layer } from "effect"
|
|
10625
|
+
*
|
|
10626
|
+
* class Database extends Context.Service<Database, {
|
|
10627
|
+
* readonly query: (sql: string) => Effect.Effect<string>
|
|
10628
|
+
* }>()("Database") {}
|
|
10629
|
+
*
|
|
10630
|
+
* class Logger extends Context.Service<Logger, {
|
|
10631
|
+
* readonly log: (msg: string) => Effect.Effect<void>
|
|
10632
|
+
* }>()("Logger") {}
|
|
10633
|
+
*
|
|
10634
|
+
* const dbLayer = Layer.succeed(Database, {
|
|
10635
|
+
* query: Effect.fn("Database.query")((sql: string) => Effect.succeed("result"))
|
|
10636
|
+
* })
|
|
10637
|
+
* const loggerLayer = Layer.succeed(Logger, {
|
|
10638
|
+
* log: Effect.fn("Logger.log")((msg: string) => Effect.sync(() => console.log(msg)))
|
|
10639
|
+
* })
|
|
10640
|
+
*
|
|
10641
|
+
* const mergedLayer = Layer.merge(dbLayer, loggerLayer)
|
|
10642
|
+
* ```
|
|
10643
|
+
*
|
|
10644
|
+
* @see {@link mergeAll} for merging several layers at once
|
|
10645
|
+
*
|
|
10646
|
+
* @category zipping
|
|
10647
|
+
* @since 2.0.0
|
|
10648
|
+
*/
|
|
10649
|
+
const merge$3 = /* @__PURE__ */ dual(2, (self, that) => mergeAll$1(self, ...Array.isArray(that) ? that : [that]));
|
|
10575
10650
|
const provideWith = (self, that, f) => fromBuild((memoMap, scope) => flatMap$4(Array.isArray(that) ? mergeAllEffect(that, memoMap, scope) : that.build(memoMap, scope), (context) => self.build(memoMap, scope).pipe(provideContext$1(context), map$5((merged) => f(merged, context)))));
|
|
10576
10651
|
/**
|
|
10577
10652
|
* Feeds the output services of the dependency layer into the requirements of
|
|
@@ -10734,7 +10809,7 @@ const provide$2 = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that
|
|
|
10734
10809
|
* @category providing services
|
|
10735
10810
|
* @since 2.0.0
|
|
10736
10811
|
*/
|
|
10737
|
-
const provideMerge = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, (self, that) => merge$
|
|
10812
|
+
const provideMerge = /* @__PURE__ */ dual(2, (self, that) => provideWith(self, that, (self, that) => merge$4(that, self)));
|
|
10738
10813
|
/**
|
|
10739
10814
|
* Constructs a layer dynamically based on the output of this layer.
|
|
10740
10815
|
*
|
|
@@ -10839,11 +10914,11 @@ const Clock = ClockRef;
|
|
|
10839
10914
|
//#endregion
|
|
10840
10915
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/internal/dateTime.js
|
|
10841
10916
|
/** @internal */
|
|
10842
|
-
const TypeId$
|
|
10917
|
+
const TypeId$32 = "~effect/time/DateTime";
|
|
10843
10918
|
/** @internal */
|
|
10844
10919
|
const TimeZoneTypeId = "~effect/time/DateTime/TimeZone";
|
|
10845
10920
|
const Proto$12 = {
|
|
10846
|
-
[TypeId$
|
|
10921
|
+
[TypeId$32]: TypeId$32,
|
|
10847
10922
|
pipe() {
|
|
10848
10923
|
return pipeArguments(this, arguments);
|
|
10849
10924
|
},
|
|
@@ -11088,7 +11163,7 @@ const matchEffect$1 = /* @__PURE__ */ dual(2, (self, options) => matchCauseEffec
|
|
|
11088
11163
|
}));
|
|
11089
11164
|
//#endregion
|
|
11090
11165
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Schedule.js
|
|
11091
|
-
const TypeId$
|
|
11166
|
+
const TypeId$31 = "~effect/Schedule";
|
|
11092
11167
|
/**
|
|
11093
11168
|
* Context reference containing metadata for the currently running schedule step.
|
|
11094
11169
|
*
|
|
@@ -11113,7 +11188,7 @@ const CurrentMetadata = /* @__PURE__ */ Reference("effect/Schedule/CurrentMetada
|
|
|
11113
11188
|
elapsedSincePrevious: 0
|
|
11114
11189
|
}) });
|
|
11115
11190
|
const ScheduleProto = {
|
|
11116
|
-
[TypeId$
|
|
11191
|
+
[TypeId$31]: {
|
|
11117
11192
|
_Out: identity,
|
|
11118
11193
|
_In: identity,
|
|
11119
11194
|
_Env: identity
|
|
@@ -11142,7 +11217,7 @@ const ScheduleProto = {
|
|
|
11142
11217
|
* @category guards
|
|
11143
11218
|
* @since 2.0.0
|
|
11144
11219
|
*/
|
|
11145
|
-
const isSchedule = (u) => hasProperty(u, TypeId$
|
|
11220
|
+
const isSchedule = (u) => hasProperty(u, TypeId$31);
|
|
11146
11221
|
/**
|
|
11147
11222
|
* Creates a Schedule from a step function that returns a Pull.
|
|
11148
11223
|
*
|
|
@@ -11607,6 +11682,54 @@ const buildFromOptions = (options) => {
|
|
|
11607
11682
|
return schedule;
|
|
11608
11683
|
};
|
|
11609
11684
|
/**
|
|
11685
|
+
* Context reference for metric attributes applied from the current Effect
|
|
11686
|
+
* context.
|
|
11687
|
+
*
|
|
11688
|
+
* **When to use**
|
|
11689
|
+
*
|
|
11690
|
+
* Use to provide default attributes that should be merged into metric updates
|
|
11691
|
+
* and reads in a scoped part of a program.
|
|
11692
|
+
*
|
|
11693
|
+
* **Details**
|
|
11694
|
+
*
|
|
11695
|
+
* The default value is an empty attribute set. Metric reads and updates merge
|
|
11696
|
+
* these contextual attributes with the metric's own attributes to select the
|
|
11697
|
+
* metric series being accessed.
|
|
11698
|
+
*
|
|
11699
|
+
* **Example** (Providing current metric attributes)
|
|
11700
|
+
*
|
|
11701
|
+
* ```ts
|
|
11702
|
+
* import { Data, Effect, Metric } from "effect"
|
|
11703
|
+
*
|
|
11704
|
+
* class AttributesError extends Data.TaggedError("AttributesError")<{
|
|
11705
|
+
* readonly operation: string
|
|
11706
|
+
* }> {}
|
|
11707
|
+
*
|
|
11708
|
+
* const program = Effect.gen(function*() {
|
|
11709
|
+
* // Access current metric attributes
|
|
11710
|
+
* const attributes = yield* Metric.CurrentMetricAttributes
|
|
11711
|
+
* console.log("Current attributes:", attributes)
|
|
11712
|
+
*
|
|
11713
|
+
* // Set new attributes context
|
|
11714
|
+
* const newAttributes = { service: "api", version: "1.0" }
|
|
11715
|
+
* const result = yield* Effect.provideService(
|
|
11716
|
+
* Effect.gen(function*() {
|
|
11717
|
+
* const updatedAttributes = yield* Metric.CurrentMetricAttributes
|
|
11718
|
+
* return updatedAttributes
|
|
11719
|
+
* }),
|
|
11720
|
+
* Metric.CurrentMetricAttributes,
|
|
11721
|
+
* newAttributes
|
|
11722
|
+
* )
|
|
11723
|
+
*
|
|
11724
|
+
* return result
|
|
11725
|
+
* })
|
|
11726
|
+
* ```
|
|
11727
|
+
*
|
|
11728
|
+
* @category references
|
|
11729
|
+
* @since 4.0.0
|
|
11730
|
+
*/
|
|
11731
|
+
const CurrentMetricAttributes = /* @__PURE__ */ Reference("effect/Metric/CurrentMetricAttributes", { defaultValue: () => ({}) });
|
|
11732
|
+
/**
|
|
11610
11733
|
* Context reference for the metric registry in the current context.
|
|
11611
11734
|
*
|
|
11612
11735
|
* **When to use**
|
|
@@ -11633,6 +11756,348 @@ const buildFromOptions = (options) => {
|
|
|
11633
11756
|
* @since 4.0.0
|
|
11634
11757
|
*/
|
|
11635
11758
|
const MetricRegistry = /* @__PURE__ */ Reference("~effect/observability/Metric/MetricRegistryKey", { defaultValue: () => /* @__PURE__ */ new Map() });
|
|
11759
|
+
const TypeId$30 = "~effect/observability/Metric";
|
|
11760
|
+
var Metric$ = class {
|
|
11761
|
+
[TypeId$30] = TypeId$30;
|
|
11762
|
+
#metadataCache = /* @__PURE__ */ new WeakMap();
|
|
11763
|
+
#metadata;
|
|
11764
|
+
id;
|
|
11765
|
+
description;
|
|
11766
|
+
attributes;
|
|
11767
|
+
constructor(id, description, attributes) {
|
|
11768
|
+
this.id = id;
|
|
11769
|
+
this.description = description;
|
|
11770
|
+
this.attributes = attributes;
|
|
11771
|
+
}
|
|
11772
|
+
valueUnsafe(context) {
|
|
11773
|
+
return this.hook(context).get(context);
|
|
11774
|
+
}
|
|
11775
|
+
modifyUnsafe(input, context) {
|
|
11776
|
+
return this.hook(context).modify(input, context);
|
|
11777
|
+
}
|
|
11778
|
+
updateUnsafe(input, context) {
|
|
11779
|
+
return this.hook(context).update(input, context);
|
|
11780
|
+
}
|
|
11781
|
+
hook(context) {
|
|
11782
|
+
const extraAttributes = get$4(context, CurrentMetricAttributes);
|
|
11783
|
+
if (Object.keys(extraAttributes).length === 0) {
|
|
11784
|
+
if (isNotUndefined(this.#metadata)) return this.#metadata.hooks;
|
|
11785
|
+
this.#metadata = this.getOrCreate(context, this.attributes);
|
|
11786
|
+
return this.#metadata.hooks;
|
|
11787
|
+
}
|
|
11788
|
+
const mergedAttributes = mergeAttributes(this.attributes, extraAttributes);
|
|
11789
|
+
let metadata = this.#metadataCache.get(mergedAttributes);
|
|
11790
|
+
if (isNotUndefined(metadata)) return metadata.hooks;
|
|
11791
|
+
metadata = this.getOrCreate(context, mergedAttributes);
|
|
11792
|
+
this.#metadataCache.set(mergedAttributes, metadata);
|
|
11793
|
+
return metadata.hooks;
|
|
11794
|
+
}
|
|
11795
|
+
getOrCreate(context, attributes) {
|
|
11796
|
+
const key = makeKey(this, attributes);
|
|
11797
|
+
const registry = get$4(context, MetricRegistry);
|
|
11798
|
+
if (registry.has(key)) return registry.get(key);
|
|
11799
|
+
const hooks = this.createHooks();
|
|
11800
|
+
const meta = {
|
|
11801
|
+
id: this.id,
|
|
11802
|
+
type: this.type,
|
|
11803
|
+
description: this.description,
|
|
11804
|
+
attributes: attributesToRecord(attributes),
|
|
11805
|
+
hooks
|
|
11806
|
+
};
|
|
11807
|
+
registry.set(key, meta);
|
|
11808
|
+
return meta;
|
|
11809
|
+
}
|
|
11810
|
+
pipe() {
|
|
11811
|
+
return pipeArguments(this, arguments);
|
|
11812
|
+
}
|
|
11813
|
+
};
|
|
11814
|
+
const bigint0 = /* @__PURE__ */ BigInt(0);
|
|
11815
|
+
var CounterMetric = class extends Metric$ {
|
|
11816
|
+
type = "Counter";
|
|
11817
|
+
#bigint;
|
|
11818
|
+
#incremental;
|
|
11819
|
+
constructor(id, options) {
|
|
11820
|
+
super(id, options?.description, attributesToRecord(options?.attributes));
|
|
11821
|
+
this.#bigint = options?.bigint ?? false;
|
|
11822
|
+
this.#incremental = options?.incremental ?? false;
|
|
11823
|
+
}
|
|
11824
|
+
createHooks() {
|
|
11825
|
+
let count = this.#bigint ? bigint0 : 0;
|
|
11826
|
+
const canUpdate = this.#incremental ? this.#bigint ? (value) => value >= bigint0 : (value) => value >= 0 : (_value) => true;
|
|
11827
|
+
const update = (value) => {
|
|
11828
|
+
if (canUpdate(value)) count = count + value;
|
|
11829
|
+
};
|
|
11830
|
+
return makeHooks(() => ({
|
|
11831
|
+
count,
|
|
11832
|
+
incremental: this.#incremental
|
|
11833
|
+
}), update);
|
|
11834
|
+
}
|
|
11835
|
+
};
|
|
11836
|
+
var HistogramMetric = class extends Metric$ {
|
|
11837
|
+
type = "Histogram";
|
|
11838
|
+
#boundaries;
|
|
11839
|
+
constructor(id, options) {
|
|
11840
|
+
super(id, options?.description, attributesToRecord(options?.attributes));
|
|
11841
|
+
this.#boundaries = options.boundaries;
|
|
11842
|
+
}
|
|
11843
|
+
createHooks() {
|
|
11844
|
+
const bounds = this.#boundaries;
|
|
11845
|
+
const size = bounds.length;
|
|
11846
|
+
const values = new Uint32Array(size + 1);
|
|
11847
|
+
const boundaries = new Float64Array(size);
|
|
11848
|
+
let count = 0;
|
|
11849
|
+
let sum = 0;
|
|
11850
|
+
let min = Number.MAX_VALUE;
|
|
11851
|
+
let max = -Number.MAX_VALUE;
|
|
11852
|
+
map$6(sort$1(bounds, Number$5), (n, i) => {
|
|
11853
|
+
boundaries[i] = n;
|
|
11854
|
+
});
|
|
11855
|
+
const update = (value) => {
|
|
11856
|
+
let from = 0;
|
|
11857
|
+
let to = size;
|
|
11858
|
+
while (from !== to) {
|
|
11859
|
+
const mid = Math.floor(from + (to - from) / 2);
|
|
11860
|
+
if (value <= boundaries[mid]) to = mid;
|
|
11861
|
+
else from = mid;
|
|
11862
|
+
if (to === from + 1) if (value <= boundaries[from]) to = from;
|
|
11863
|
+
else from = to;
|
|
11864
|
+
}
|
|
11865
|
+
values[from] = values[from] + 1;
|
|
11866
|
+
count = count + 1;
|
|
11867
|
+
sum = sum + value;
|
|
11868
|
+
if (value < min) min = value;
|
|
11869
|
+
if (value > max) max = value;
|
|
11870
|
+
};
|
|
11871
|
+
const getBuckets = () => {
|
|
11872
|
+
const builder = allocate(size);
|
|
11873
|
+
let cumulated = 0;
|
|
11874
|
+
for (let i = 0; i < size; i++) {
|
|
11875
|
+
const boundary = boundaries[i];
|
|
11876
|
+
const value = values[i];
|
|
11877
|
+
cumulated = cumulated + value;
|
|
11878
|
+
builder[i] = [boundary, cumulated];
|
|
11879
|
+
}
|
|
11880
|
+
return builder;
|
|
11881
|
+
};
|
|
11882
|
+
return makeHooks(() => ({
|
|
11883
|
+
buckets: getBuckets(),
|
|
11884
|
+
count,
|
|
11885
|
+
min,
|
|
11886
|
+
max,
|
|
11887
|
+
sum
|
|
11888
|
+
}), update);
|
|
11889
|
+
}
|
|
11890
|
+
};
|
|
11891
|
+
var MetricTransform = class extends Metric$ {
|
|
11892
|
+
type;
|
|
11893
|
+
metric;
|
|
11894
|
+
valueUnsafe;
|
|
11895
|
+
updateUnsafe;
|
|
11896
|
+
modifyUnsafe;
|
|
11897
|
+
constructor(metric, valueUnsafe, updateUnsafe, modifyUnsafe) {
|
|
11898
|
+
super(metric.id, metric.description, metric.attributes);
|
|
11899
|
+
this.metric = metric;
|
|
11900
|
+
this.valueUnsafe = valueUnsafe;
|
|
11901
|
+
this.updateUnsafe = updateUnsafe;
|
|
11902
|
+
this.modifyUnsafe = modifyUnsafe;
|
|
11903
|
+
this.type = metric.type;
|
|
11904
|
+
}
|
|
11905
|
+
createHooks() {
|
|
11906
|
+
return this.metric.createHooks();
|
|
11907
|
+
}
|
|
11908
|
+
};
|
|
11909
|
+
/**
|
|
11910
|
+
* Represents a Counter metric that tracks cumulative numerical values over
|
|
11911
|
+
* time. Counters can be incremented and decremented and provide a running total
|
|
11912
|
+
* of changes.
|
|
11913
|
+
*
|
|
11914
|
+
* **Details**
|
|
11915
|
+
*
|
|
11916
|
+
* The optional `description` describes the counter, and `attributes` attach
|
|
11917
|
+
* dimensions to it. Set `bigint` to create a counter that accepts `bigint`
|
|
11918
|
+
* inputs. Set `incremental` to `true` to create a counter that can only ever be
|
|
11919
|
+
* incremented.
|
|
11920
|
+
*
|
|
11921
|
+
* **Example** (Creating counter metrics)
|
|
11922
|
+
*
|
|
11923
|
+
* ```ts
|
|
11924
|
+
* import { Data, Effect, Metric } from "effect"
|
|
11925
|
+
*
|
|
11926
|
+
* class CounterError extends Data.TaggedError("CounterError")<{
|
|
11927
|
+
* readonly operation: string
|
|
11928
|
+
* }> {}
|
|
11929
|
+
*
|
|
11930
|
+
* const program = Effect.gen(function*() {
|
|
11931
|
+
* // Create a basic counter for tracking requests
|
|
11932
|
+
* const requestCounter = Metric.counter("http_requests_total", {
|
|
11933
|
+
* description: "Total number of HTTP requests processed"
|
|
11934
|
+
* })
|
|
11935
|
+
*
|
|
11936
|
+
* // Create an incremental-only counter for events
|
|
11937
|
+
* const eventCounter = Metric.counter("events_processed", {
|
|
11938
|
+
* description: "Events processed (increment only)",
|
|
11939
|
+
* incremental: true
|
|
11940
|
+
* })
|
|
11941
|
+
*
|
|
11942
|
+
* // Create a bigint counter for large values
|
|
11943
|
+
* const bytesCounter = Metric.counter("bytes_transferred", {
|
|
11944
|
+
* description: "Total bytes transferred",
|
|
11945
|
+
* bigint: true,
|
|
11946
|
+
* attributes: { service: "file-transfer" }
|
|
11947
|
+
* })
|
|
11948
|
+
*
|
|
11949
|
+
* // Update counters with values
|
|
11950
|
+
* yield* Metric.update(requestCounter, 1) // Increment by 1
|
|
11951
|
+
* yield* Metric.update(requestCounter, 5) // Increment by 5 (total: 6)
|
|
11952
|
+
* yield* Metric.update(eventCounter, 1) // Increment by 1
|
|
11953
|
+
* yield* Metric.update(bytesCounter, 1024n) // Add 1024 bytes
|
|
11954
|
+
*
|
|
11955
|
+
* // Get current counter values
|
|
11956
|
+
* const requestValue = yield* Metric.value(requestCounter)
|
|
11957
|
+
* const eventValue = yield* Metric.value(eventCounter)
|
|
11958
|
+
* const bytesValue = yield* Metric.value(bytesCounter)
|
|
11959
|
+
*
|
|
11960
|
+
* return { requestValue, eventValue, bytesValue }
|
|
11961
|
+
* })
|
|
11962
|
+
* ```
|
|
11963
|
+
*
|
|
11964
|
+
* @category constructors
|
|
11965
|
+
* @since 2.0.0
|
|
11966
|
+
*/
|
|
11967
|
+
const counter = (name, options) => new CounterMetric(name, options);
|
|
11968
|
+
/**
|
|
11969
|
+
* Represents a `Histogram` metric that records observations into buckets.
|
|
11970
|
+
*
|
|
11971
|
+
* **When to use**
|
|
11972
|
+
*
|
|
11973
|
+
* Use when you need a metric for measuring the distribution of values within a
|
|
11974
|
+
* range.
|
|
11975
|
+
*
|
|
11976
|
+
* **Details**
|
|
11977
|
+
*
|
|
11978
|
+
* The optional `description` describes the histogram, and `attributes` attach
|
|
11979
|
+
* dimensions to it. The required `boundaries` option defines the histogram
|
|
11980
|
+
* bucket boundaries.
|
|
11981
|
+
*
|
|
11982
|
+
* **Example** (Creating histogram metrics)
|
|
11983
|
+
*
|
|
11984
|
+
* ```ts
|
|
11985
|
+
* import { Data, Effect, Metric } from "effect"
|
|
11986
|
+
*
|
|
11987
|
+
* class HistogramError extends Data.TaggedError("HistogramError")<{
|
|
11988
|
+
* readonly operation: string
|
|
11989
|
+
* }> {}
|
|
11990
|
+
*
|
|
11991
|
+
* const program = Effect.gen(function*() {
|
|
11992
|
+
* // Create a histogram for API response times
|
|
11993
|
+
* const responseTimeHistogram = Metric.histogram("api_response_time", {
|
|
11994
|
+
* description: "Distribution of API response times in milliseconds",
|
|
11995
|
+
* boundaries: Metric.linearBoundaries({ start: 0, width: 50, count: 10 })
|
|
11996
|
+
* // Creates buckets: 0-50ms, 50-100ms, 100-150ms, ..., 400-450ms, 450ms+
|
|
11997
|
+
* })
|
|
11998
|
+
*
|
|
11999
|
+
* // Create a histogram for request payload sizes
|
|
12000
|
+
* const payloadSizeHistogram = Metric.histogram("payload_size", {
|
|
12001
|
+
* description: "Distribution of request payload sizes in KB",
|
|
12002
|
+
* boundaries: Metric.exponentialBoundaries({ start: 1, factor: 2, count: 8 }),
|
|
12003
|
+
* // Creates exponential buckets: 1KB, 2KB, 4KB, 8KB, 16KB, 32KB, 64KB, 128KB+
|
|
12004
|
+
* attributes: { service: "api-gateway" }
|
|
12005
|
+
* })
|
|
12006
|
+
*
|
|
12007
|
+
* // Create a histogram with custom boundaries
|
|
12008
|
+
* const customHistogram = Metric.histogram("custom_metric", {
|
|
12009
|
+
* description: "Custom distribution metric",
|
|
12010
|
+
* boundaries: [0.1, 0.5, 1, 2.5, 5, 10, 25, 50, 100]
|
|
12011
|
+
* })
|
|
12012
|
+
*
|
|
12013
|
+
* // Record various response times
|
|
12014
|
+
* yield* Metric.update(responseTimeHistogram, 25) // Goes in 0-50ms bucket
|
|
12015
|
+
* yield* Metric.update(responseTimeHistogram, 75) // Goes in 50-100ms bucket
|
|
12016
|
+
* yield* Metric.update(responseTimeHistogram, 125) // Goes in 100-150ms bucket
|
|
12017
|
+
* yield* Metric.update(responseTimeHistogram, 200) // Goes in 150-200ms bucket
|
|
12018
|
+
* yield* Metric.update(responseTimeHistogram, 75) // Another 50-100ms
|
|
12019
|
+
*
|
|
12020
|
+
* // Record payload sizes
|
|
12021
|
+
* yield* Metric.update(payloadSizeHistogram, 3) // Goes in 2-4KB bucket
|
|
12022
|
+
* yield* Metric.update(payloadSizeHistogram, 15) // Goes in 8-16KB bucket
|
|
12023
|
+
* yield* Metric.update(payloadSizeHistogram, 0.5) // Goes in 0-1KB bucket
|
|
12024
|
+
*
|
|
12025
|
+
* // Get histogram state with distribution data
|
|
12026
|
+
* const responseTimeState = yield* Metric.value(responseTimeHistogram)
|
|
12027
|
+
* const payloadSizeState = yield* Metric.value(payloadSizeHistogram)
|
|
12028
|
+
*
|
|
12029
|
+
* // responseTimeState will contain:
|
|
12030
|
+
* // - buckets: [[50, 1], [100, 3], [150, 4], [200, 5], ...]
|
|
12031
|
+
* // - count: 5, min: 25, max: 200, sum: 500
|
|
12032
|
+
* // - Useful for calculating percentiles, averages, etc.
|
|
12033
|
+
*
|
|
12034
|
+
* return { responseTimeState, payloadSizeState }
|
|
12035
|
+
* })
|
|
12036
|
+
* ```
|
|
12037
|
+
*
|
|
12038
|
+
* @category constructors
|
|
12039
|
+
* @since 2.0.0
|
|
12040
|
+
*/
|
|
12041
|
+
const histogram = (name, options) => new HistogramMetric(name, options);
|
|
12042
|
+
/**
|
|
12043
|
+
* Returns a new metric that applies the specified attributes to all operations.
|
|
12044
|
+
*
|
|
12045
|
+
* **Details**
|
|
12046
|
+
*
|
|
12047
|
+
* Attributes are key-value pairs that provide additional context for metrics,
|
|
12048
|
+
* enabling filtering, grouping, and more detailed analysis. Each combination
|
|
12049
|
+
* of attribute values creates a separate metric series.
|
|
12050
|
+
*
|
|
12051
|
+
* **Example** (Applying metric attributes)
|
|
12052
|
+
*
|
|
12053
|
+
* ```ts
|
|
12054
|
+
* import { Effect, Metric } from "effect"
|
|
12055
|
+
*
|
|
12056
|
+
* const requestCounter = Metric.counter("http_requests_total", {
|
|
12057
|
+
* description: "Total HTTP requests"
|
|
12058
|
+
* })
|
|
12059
|
+
*
|
|
12060
|
+
* // Create tagged versions of the metric
|
|
12061
|
+
* const getRequests = Metric.withAttributes(requestCounter, {
|
|
12062
|
+
* method: "GET",
|
|
12063
|
+
* endpoint: "/api/users"
|
|
12064
|
+
* })
|
|
12065
|
+
*
|
|
12066
|
+
* const postRequests = Metric.withAttributes(requestCounter, {
|
|
12067
|
+
* method: "POST",
|
|
12068
|
+
* endpoint: "/api/users"
|
|
12069
|
+
* })
|
|
12070
|
+
*
|
|
12071
|
+
* const program = Effect.gen(function*() {
|
|
12072
|
+
* // These will be tracked as separate metric series
|
|
12073
|
+
* yield* Metric.update(getRequests, 1) // http_requests_total{method="GET", endpoint="/api/users"}
|
|
12074
|
+
* yield* Metric.update(postRequests, 1) // http_requests_total{method="POST", endpoint="/api/users"}
|
|
12075
|
+
* yield* Metric.update(getRequests, 1) // Increments the GET counter
|
|
12076
|
+
*
|
|
12077
|
+
* // You can also chain attributes
|
|
12078
|
+
* const taggedMetric = requestCounter.pipe(
|
|
12079
|
+
* Metric.withAttributes({ service: "user-api" }),
|
|
12080
|
+
* Metric.withAttributes({ version: "v1" })
|
|
12081
|
+
* )
|
|
12082
|
+
*
|
|
12083
|
+
* yield* Metric.update(taggedMetric, 1) // http_requests_total{service="user-api", version="v1"}
|
|
12084
|
+
* })
|
|
12085
|
+
*
|
|
12086
|
+
* // When taking snapshots, each attribute combination appears as a separate metric
|
|
12087
|
+
* const viewMetrics = Effect.gen(function*() {
|
|
12088
|
+
* const snapshots = yield* Metric.snapshot
|
|
12089
|
+
* for (const metric of snapshots) {
|
|
12090
|
+
* if (metric.id === "http_requests_total") {
|
|
12091
|
+
* console.log(`${metric.id}`, metric.attributes, metric.state)
|
|
12092
|
+
* }
|
|
12093
|
+
* }
|
|
12094
|
+
* })
|
|
12095
|
+
* ```
|
|
12096
|
+
*
|
|
12097
|
+
* @category Attributes
|
|
12098
|
+
* @since 4.0.0
|
|
12099
|
+
*/
|
|
12100
|
+
const withAttributes = /* @__PURE__ */ dual(2, (self, attributes) => new MetricTransform(self, (context) => self.valueUnsafe(addAttributesToContext(context, attributes)), (input, context) => self.updateUnsafe(input, addAttributesToContext(context, attributes)), (input, context) => self.modifyUnsafe(input, addAttributesToContext(context, attributes))));
|
|
11636
12101
|
/**
|
|
11637
12102
|
* Captures a snapshot of all registered metrics synchronously using the provided
|
|
11638
12103
|
* service context.
|
|
@@ -11709,6 +12174,41 @@ const snapshotUnsafe = (context) => {
|
|
|
11709
12174
|
state: hooks.get(context)
|
|
11710
12175
|
}));
|
|
11711
12176
|
};
|
|
12177
|
+
function makeKey(metric, attributes) {
|
|
12178
|
+
let key = `${metric.type}:${metric.id}`;
|
|
12179
|
+
if (isNotUndefined(metric.description)) key += `:${metric.description}`;
|
|
12180
|
+
if (isNotUndefined(attributes)) key += `:${serializeAttributes(attributes)}`;
|
|
12181
|
+
return key;
|
|
12182
|
+
}
|
|
12183
|
+
function makeHooks(get, update, modify) {
|
|
12184
|
+
return {
|
|
12185
|
+
get,
|
|
12186
|
+
update,
|
|
12187
|
+
modify: modify ?? update
|
|
12188
|
+
};
|
|
12189
|
+
}
|
|
12190
|
+
function serializeAttributes(attributes) {
|
|
12191
|
+
return serializeEntries(Array.isArray(attributes) ? attributes : Object.entries(attributes));
|
|
12192
|
+
}
|
|
12193
|
+
function serializeEntries(entries) {
|
|
12194
|
+
return entries.map(([key, value]) => `${key}=${value}`).join(",");
|
|
12195
|
+
}
|
|
12196
|
+
function mergeAttributes(self, other) {
|
|
12197
|
+
return {
|
|
12198
|
+
...attributesToRecord(self),
|
|
12199
|
+
...attributesToRecord(other)
|
|
12200
|
+
};
|
|
12201
|
+
}
|
|
12202
|
+
function attributesToRecord(attributes) {
|
|
12203
|
+
if (isNotUndefined(attributes) && Array.isArray(attributes)) return attributes.reduce((acc, [key, value]) => {
|
|
12204
|
+
assignProperty(acc, key, value);
|
|
12205
|
+
return acc;
|
|
12206
|
+
}, {});
|
|
12207
|
+
return attributes;
|
|
12208
|
+
}
|
|
12209
|
+
function addAttributesToContext(context, attributes) {
|
|
12210
|
+
return add(context, CurrentMetricAttributes, mergeAttributes(get$4(context, CurrentMetricAttributes), attributes));
|
|
12211
|
+
}
|
|
11712
12212
|
//#endregion
|
|
11713
12213
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/Effect.js
|
|
11714
12214
|
/**
|
|
@@ -13733,6 +14233,30 @@ const provide = provide$1;
|
|
|
13733
14233
|
*/
|
|
13734
14234
|
const provideContext = provideContext$1;
|
|
13735
14235
|
/**
|
|
14236
|
+
* Accesses a service from the context.
|
|
14237
|
+
*
|
|
14238
|
+
* **Example** (Accessing a required service)
|
|
14239
|
+
*
|
|
14240
|
+
* ```ts
|
|
14241
|
+
* import { Context, Effect } from "effect"
|
|
14242
|
+
*
|
|
14243
|
+
* interface Database {
|
|
14244
|
+
* readonly query: (sql: string) => Effect.Effect<string>
|
|
14245
|
+
* }
|
|
14246
|
+
*
|
|
14247
|
+
* const Database = Context.Service<Database>("Database")
|
|
14248
|
+
*
|
|
14249
|
+
* const program = Effect.gen(function*() {
|
|
14250
|
+
* const db = yield* Effect.service(Database)
|
|
14251
|
+
* return yield* db.query("SELECT * FROM users")
|
|
14252
|
+
* })
|
|
14253
|
+
* ```
|
|
14254
|
+
*
|
|
14255
|
+
* @category context
|
|
14256
|
+
* @since 4.0.0
|
|
14257
|
+
*/
|
|
14258
|
+
const service = service$1;
|
|
14259
|
+
/**
|
|
13736
14260
|
* Optionally accesses a service from the environment.
|
|
13737
14261
|
*
|
|
13738
14262
|
* **When to use**
|
|
@@ -14337,27 +14861,6 @@ const forever = forever$2;
|
|
|
14337
14861
|
*/
|
|
14338
14862
|
const repeat = repeat$1;
|
|
14339
14863
|
/**
|
|
14340
|
-
* Provides a tracer to an effect.
|
|
14341
|
-
*
|
|
14342
|
-
* **Example** (Providing a tracer)
|
|
14343
|
-
*
|
|
14344
|
-
* ```ts
|
|
14345
|
-
* import { Effect } from "effect"
|
|
14346
|
-
*
|
|
14347
|
-
* const program = Effect.gen(function*() {
|
|
14348
|
-
* yield* Effect.log("Using tracer")
|
|
14349
|
-
* return "completed"
|
|
14350
|
-
* })
|
|
14351
|
-
*
|
|
14352
|
-
* // withTracer provides a tracer to the effect context
|
|
14353
|
-
* // const traced = Effect.withTracer(program, customTracer)
|
|
14354
|
-
* ```
|
|
14355
|
-
*
|
|
14356
|
-
* @category tracing
|
|
14357
|
-
* @since 2.0.0
|
|
14358
|
-
*/
|
|
14359
|
-
const withTracer = withTracer$1;
|
|
14360
|
-
/**
|
|
14361
14864
|
* Enables or disables tracing for spans created by the given effect.
|
|
14362
14865
|
*
|
|
14363
14866
|
* **Details**
|
|
@@ -14407,6 +14910,31 @@ const withTracerEnabled = withTracerEnabled$1;
|
|
|
14407
14910
|
*/
|
|
14408
14911
|
const annotateCurrentSpan = annotateCurrentSpan$1;
|
|
14409
14912
|
/**
|
|
14913
|
+
* Creates a new tracing span and returns it without managing its lifetime.
|
|
14914
|
+
*
|
|
14915
|
+
* **Details**
|
|
14916
|
+
*
|
|
14917
|
+
* The span is not added to the current span stack and is not ended
|
|
14918
|
+
* automatically. Use `withSpan`, `useSpan`, or `makeSpanScoped` when the span
|
|
14919
|
+
* should be installed as context or closed automatically.
|
|
14920
|
+
*
|
|
14921
|
+
* **Example** (Creating a span manually)
|
|
14922
|
+
*
|
|
14923
|
+
* ```ts
|
|
14924
|
+
* import { Effect } from "effect"
|
|
14925
|
+
*
|
|
14926
|
+
* const program = Effect.gen(function*() {
|
|
14927
|
+
* const span = yield* Effect.makeSpan("my-operation")
|
|
14928
|
+
* yield* Effect.log("Operation in progress")
|
|
14929
|
+
* return "completed"
|
|
14930
|
+
* })
|
|
14931
|
+
* ```
|
|
14932
|
+
*
|
|
14933
|
+
* @category tracing
|
|
14934
|
+
* @since 2.0.0
|
|
14935
|
+
*/
|
|
14936
|
+
const makeSpan$1 = makeSpan$2;
|
|
14937
|
+
/**
|
|
14410
14938
|
* Create a new span for tracing, and automatically close it when the effect
|
|
14411
14939
|
* completes.
|
|
14412
14940
|
*
|
|
@@ -56655,7 +57183,7 @@ const flatten = /* @__PURE__ */ dual((args) => isStream(args[0]), (self, options
|
|
|
56655
57183
|
* @category sequencing
|
|
56656
57184
|
* @since 2.0.0
|
|
56657
57185
|
*/
|
|
56658
|
-
const concat = /* @__PURE__ */ dual(2, (self, that) => flatten(fromArray([self, that])));
|
|
57186
|
+
const concat$1 = /* @__PURE__ */ dual(2, (self, that) => flatten(fromArray([self, that])));
|
|
56659
57187
|
/**
|
|
56660
57188
|
* Merges two streams, emitting elements from both as they arrive.
|
|
56661
57189
|
*
|
|
@@ -59943,7 +60471,7 @@ const SpanNameGenerator = /* @__PURE__ */ Reference("effect/http/HttpClient/Span
|
|
|
59943
60471
|
* @category layers
|
|
59944
60472
|
* @since 4.0.0
|
|
59945
60473
|
*/
|
|
59946
|
-
const layerMergedContext = (effect$2) => effect(HttpClient)(contextWith((context) => map$3(effect$2, (client) => transformResponse(client, updateContext((input) => merge$
|
|
60474
|
+
const layerMergedContext = (effect$2) => effect(HttpClient)(contextWith((context) => map$3(effect$2, (client) => transformResponse(client, updateContext((input) => merge$4(context, input))))));
|
|
59947
60475
|
const responseRegistry = /* @__PURE__ */ (() => {
|
|
59948
60476
|
if ("FinalizationRegistry" in globalThis && globalThis.FinalizationRegistry) {
|
|
59949
60477
|
const registry = /* @__PURE__ */ new FinalizationRegistry((controller) => {
|
|
@@ -60775,6 +61303,537 @@ const unknownToAttributeValue = (value) => {
|
|
|
60775
61303
|
}
|
|
60776
61304
|
};
|
|
60777
61305
|
//#endregion
|
|
61306
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/unstable/observability/internal/protobuf.js
|
|
61307
|
+
/**
|
|
61308
|
+
* Low-level protobuf wire format encoding utilities.
|
|
61309
|
+
*
|
|
61310
|
+
* Protobuf wire types:
|
|
61311
|
+
* - 0: Varint (int32, int64, uint32, uint64, sint32, sint64, bool, enum)
|
|
61312
|
+
* - 1: 64-bit (fixed64, sfixed64, double)
|
|
61313
|
+
* - 2: Length-delimited (string, bytes, embedded messages, packed repeated fields)
|
|
61314
|
+
* - 5: 32-bit (fixed32, sfixed32, float)
|
|
61315
|
+
*/
|
|
61316
|
+
const WireType = {
|
|
61317
|
+
Varint: 0,
|
|
61318
|
+
Fixed64: 1,
|
|
61319
|
+
LengthDelimited: 2,
|
|
61320
|
+
Fixed32: 5
|
|
61321
|
+
};
|
|
61322
|
+
/**
|
|
61323
|
+
* Encodes a field tag (field number + wire type)
|
|
61324
|
+
*/
|
|
61325
|
+
const encodeTag = (fieldNumber, wireType) => fieldNumber << 3 | wireType;
|
|
61326
|
+
/**
|
|
61327
|
+
* Encodes a varint (variable-length integer)
|
|
61328
|
+
*
|
|
61329
|
+
* @internal
|
|
61330
|
+
*/
|
|
61331
|
+
const encodeVarint = (value) => {
|
|
61332
|
+
const bytes = [];
|
|
61333
|
+
let n = typeof value === "bigint" ? value : BigInt(value);
|
|
61334
|
+
while (n > BigInt(127)) {
|
|
61335
|
+
bytes.push(Number(n & BigInt(127)) | 128);
|
|
61336
|
+
n >>= BigInt(7);
|
|
61337
|
+
}
|
|
61338
|
+
bytes.push(Number(n));
|
|
61339
|
+
return new Uint8Array(bytes);
|
|
61340
|
+
};
|
|
61341
|
+
/**
|
|
61342
|
+
* Encodes a 64-bit fixed value (little-endian)
|
|
61343
|
+
*
|
|
61344
|
+
* @internal
|
|
61345
|
+
*/
|
|
61346
|
+
const encodeFixed64 = (value) => {
|
|
61347
|
+
const bytes = new Uint8Array(8);
|
|
61348
|
+
new DataView(bytes.buffer).setBigUint64(0, value, true);
|
|
61349
|
+
return bytes;
|
|
61350
|
+
};
|
|
61351
|
+
/**
|
|
61352
|
+
* Encodes a 32-bit fixed value (little-endian)
|
|
61353
|
+
*
|
|
61354
|
+
* @internal
|
|
61355
|
+
*/
|
|
61356
|
+
const encodeFixed32 = (value) => {
|
|
61357
|
+
const bytes = new Uint8Array(4);
|
|
61358
|
+
new DataView(bytes.buffer).setUint32(0, value, true);
|
|
61359
|
+
return bytes;
|
|
61360
|
+
};
|
|
61361
|
+
/**
|
|
61362
|
+
* Encodes a double (64-bit float, little-endian)
|
|
61363
|
+
*
|
|
61364
|
+
* @internal
|
|
61365
|
+
*/
|
|
61366
|
+
const encodeDouble = (value) => {
|
|
61367
|
+
const bytes = new Uint8Array(8);
|
|
61368
|
+
new DataView(bytes.buffer).setFloat64(0, value, true);
|
|
61369
|
+
return bytes;
|
|
61370
|
+
};
|
|
61371
|
+
/**
|
|
61372
|
+
* Encodes a string to UTF-8 bytes
|
|
61373
|
+
*
|
|
61374
|
+
* @internal
|
|
61375
|
+
*/
|
|
61376
|
+
const encodeString = (value) => new TextEncoder().encode(value);
|
|
61377
|
+
/**
|
|
61378
|
+
* Encodes bytes as a hex string to Uint8Array
|
|
61379
|
+
*
|
|
61380
|
+
* @internal
|
|
61381
|
+
*/
|
|
61382
|
+
const encodeHexBytes = (hex) => {
|
|
61383
|
+
const bytes = new Uint8Array(hex.length / 2);
|
|
61384
|
+
for (let i = 0; i < hex.length; i += 2) bytes[i / 2] = parseInt(hex.slice(i, i + 2), 16);
|
|
61385
|
+
return bytes;
|
|
61386
|
+
};
|
|
61387
|
+
/**
|
|
61388
|
+
* Concatenates multiple Uint8Arrays
|
|
61389
|
+
*
|
|
61390
|
+
* @internal
|
|
61391
|
+
*/
|
|
61392
|
+
const concat = (...arrays) => {
|
|
61393
|
+
const totalLength = arrays.reduce((sum, arr) => sum + arr.length, 0);
|
|
61394
|
+
const result = new Uint8Array(totalLength);
|
|
61395
|
+
let offset = 0;
|
|
61396
|
+
for (const arr of arrays) {
|
|
61397
|
+
result.set(arr, offset);
|
|
61398
|
+
offset += arr.length;
|
|
61399
|
+
}
|
|
61400
|
+
return result;
|
|
61401
|
+
};
|
|
61402
|
+
/**
|
|
61403
|
+
* Encodes a varint field
|
|
61404
|
+
*
|
|
61405
|
+
* @internal
|
|
61406
|
+
*/
|
|
61407
|
+
const varintField = (fieldNumber, value) => concat(encodeVarint(encodeTag(fieldNumber, WireType.Varint)), encodeVarint(value));
|
|
61408
|
+
/**
|
|
61409
|
+
* Encodes a bool field
|
|
61410
|
+
*
|
|
61411
|
+
* @internal
|
|
61412
|
+
*/
|
|
61413
|
+
const boolField = (fieldNumber, value) => varintField(fieldNumber, value ? 1 : 0);
|
|
61414
|
+
/**
|
|
61415
|
+
* Encodes a fixed64 field
|
|
61416
|
+
*
|
|
61417
|
+
* @internal
|
|
61418
|
+
*/
|
|
61419
|
+
const fixed64Field = (fieldNumber, value) => concat(encodeVarint(encodeTag(fieldNumber, WireType.Fixed64)), encodeFixed64(value));
|
|
61420
|
+
/**
|
|
61421
|
+
* Encodes a fixed32 field
|
|
61422
|
+
*
|
|
61423
|
+
* @internal
|
|
61424
|
+
*/
|
|
61425
|
+
const fixed32Field = (fieldNumber, value) => concat(encodeVarint(encodeTag(fieldNumber, WireType.Fixed32)), encodeFixed32(value));
|
|
61426
|
+
/**
|
|
61427
|
+
* Encodes a double field
|
|
61428
|
+
*
|
|
61429
|
+
* @internal
|
|
61430
|
+
*/
|
|
61431
|
+
const doubleField = (fieldNumber, value) => concat(encodeVarint(encodeTag(fieldNumber, WireType.Fixed64)), encodeDouble(value));
|
|
61432
|
+
/**
|
|
61433
|
+
* Encodes a length-delimited field (bytes, string, embedded message)
|
|
61434
|
+
*
|
|
61435
|
+
* @internal
|
|
61436
|
+
*/
|
|
61437
|
+
const lengthDelimitedField = (fieldNumber, value) => concat(encodeVarint(encodeTag(fieldNumber, WireType.LengthDelimited)), encodeVarint(value.length), value);
|
|
61438
|
+
/**
|
|
61439
|
+
* Encodes a string field
|
|
61440
|
+
*
|
|
61441
|
+
* @internal
|
|
61442
|
+
*/
|
|
61443
|
+
const stringField = (fieldNumber, value) => lengthDelimitedField(fieldNumber, encodeString(value));
|
|
61444
|
+
/**
|
|
61445
|
+
* Encodes a bytes field from hex string
|
|
61446
|
+
*
|
|
61447
|
+
* @internal
|
|
61448
|
+
*/
|
|
61449
|
+
const bytesFieldFromHex = (fieldNumber, hex) => lengthDelimitedField(fieldNumber, encodeHexBytes(hex));
|
|
61450
|
+
/**
|
|
61451
|
+
* Encodes an embedded message field
|
|
61452
|
+
*
|
|
61453
|
+
* @internal
|
|
61454
|
+
*/
|
|
61455
|
+
const messageField = (fieldNumber, message) => lengthDelimitedField(fieldNumber, message);
|
|
61456
|
+
/**
|
|
61457
|
+
* Encodes repeated fields
|
|
61458
|
+
*
|
|
61459
|
+
* @internal
|
|
61460
|
+
*/
|
|
61461
|
+
const repeatedField = (fieldNumber, values, encode) => concat(...values.map((v) => messageField(fieldNumber, encode(v))));
|
|
61462
|
+
/**
|
|
61463
|
+
* Helper to conditionally encode a string field if non-empty
|
|
61464
|
+
*
|
|
61465
|
+
* @internal
|
|
61466
|
+
*/
|
|
61467
|
+
const optionalStringField = (fieldNumber, value) => value !== void 0 && value !== "" ? stringField(fieldNumber, value) : new Uint8Array(0);
|
|
61468
|
+
//#endregion
|
|
61469
|
+
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/unstable/observability/internal/otlpProtobuf.js
|
|
61470
|
+
/**
|
|
61471
|
+
* OTLP Protobuf encoding for traces, metrics, and logs.
|
|
61472
|
+
*
|
|
61473
|
+
* Implements the protobuf wire format according to:
|
|
61474
|
+
* https://github.com/open-telemetry/opentelemetry-proto
|
|
61475
|
+
*/
|
|
61476
|
+
/**
|
|
61477
|
+
* Encodes an AnyValue message.
|
|
61478
|
+
*
|
|
61479
|
+
* message AnyValue {
|
|
61480
|
+
* oneof value {
|
|
61481
|
+
* string string_value = 1;
|
|
61482
|
+
* bool bool_value = 2;
|
|
61483
|
+
* int64 int_value = 3;
|
|
61484
|
+
* double double_value = 4;
|
|
61485
|
+
* ArrayValue array_value = 5;
|
|
61486
|
+
* KeyValueList kvlist_value = 6;
|
|
61487
|
+
* bytes bytes_value = 7;
|
|
61488
|
+
* }
|
|
61489
|
+
* }
|
|
61490
|
+
*
|
|
61491
|
+
* @internal
|
|
61492
|
+
*/
|
|
61493
|
+
const encodeAnyValue = (value) => {
|
|
61494
|
+
if (value.stringValue !== void 0 && value.stringValue !== null) return stringField(1, value.stringValue);
|
|
61495
|
+
if (value.boolValue !== void 0 && value.boolValue !== null) return boolField(2, value.boolValue);
|
|
61496
|
+
if (value.intValue !== void 0 && value.intValue !== null) return varintField(3, BigInt(value.intValue));
|
|
61497
|
+
if (value.doubleValue !== void 0 && value.doubleValue !== null) return doubleField(4, value.doubleValue);
|
|
61498
|
+
if (value.arrayValue !== void 0) return messageField(5, encodeArrayValue(value.arrayValue));
|
|
61499
|
+
if (value.kvlistValue !== void 0) return messageField(6, encodeKeyValueList(value.kvlistValue));
|
|
61500
|
+
if (value.bytesValue !== void 0) return lengthDelimitedField(7, value.bytesValue);
|
|
61501
|
+
return new Uint8Array(0);
|
|
61502
|
+
};
|
|
61503
|
+
/**
|
|
61504
|
+
* Encodes an ArrayValue message.
|
|
61505
|
+
*
|
|
61506
|
+
* message ArrayValue {
|
|
61507
|
+
* repeated AnyValue values = 1;
|
|
61508
|
+
* }
|
|
61509
|
+
*
|
|
61510
|
+
* @internal
|
|
61511
|
+
*/
|
|
61512
|
+
const encodeArrayValue = (value) => repeatedField(1, value.values, encodeAnyValue);
|
|
61513
|
+
/**
|
|
61514
|
+
* Encodes a KeyValueList message.
|
|
61515
|
+
*
|
|
61516
|
+
* message KeyValueList {
|
|
61517
|
+
* repeated KeyValue values = 1;
|
|
61518
|
+
* }
|
|
61519
|
+
*
|
|
61520
|
+
* @internal
|
|
61521
|
+
*/
|
|
61522
|
+
const encodeKeyValueList = (value) => repeatedField(1, value.values, encodeKeyValue);
|
|
61523
|
+
/**
|
|
61524
|
+
* Encodes a KeyValue message.
|
|
61525
|
+
*
|
|
61526
|
+
* message KeyValue {
|
|
61527
|
+
* string key = 1;
|
|
61528
|
+
* AnyValue value = 2;
|
|
61529
|
+
* }
|
|
61530
|
+
*
|
|
61531
|
+
* @internal
|
|
61532
|
+
*/
|
|
61533
|
+
const encodeKeyValue = (kv) => concat(stringField(1, kv.key), messageField(2, encodeAnyValue(kv.value)));
|
|
61534
|
+
/**
|
|
61535
|
+
* Encodes an InstrumentationScope message.
|
|
61536
|
+
*
|
|
61537
|
+
* message InstrumentationScope {
|
|
61538
|
+
* string name = 1;
|
|
61539
|
+
* string version = 2;
|
|
61540
|
+
* repeated KeyValue attributes = 3;
|
|
61541
|
+
* uint32 dropped_attributes_count = 4;
|
|
61542
|
+
* }
|
|
61543
|
+
*
|
|
61544
|
+
* @internal
|
|
61545
|
+
*/
|
|
61546
|
+
const encodeInstrumentationScope = (scope) => concat(stringField(1, scope.name), optionalStringField(2, scope.version), scope.attributes ? repeatedField(3, scope.attributes, encodeKeyValue) : new Uint8Array(0), scope.droppedAttributesCount ? varintField(4, scope.droppedAttributesCount) : new Uint8Array(0));
|
|
61547
|
+
/**
|
|
61548
|
+
* Encodes a Resource message.
|
|
61549
|
+
*
|
|
61550
|
+
* message Resource {
|
|
61551
|
+
* repeated KeyValue attributes = 1;
|
|
61552
|
+
* uint32 dropped_attributes_count = 2;
|
|
61553
|
+
* }
|
|
61554
|
+
*
|
|
61555
|
+
* @internal
|
|
61556
|
+
*/
|
|
61557
|
+
const encodeResource = (resource) => concat(repeatedField(1, resource.attributes, encodeKeyValue), resource.droppedAttributesCount > 0 ? varintField(2, resource.droppedAttributesCount) : new Uint8Array(0));
|
|
61558
|
+
/**
|
|
61559
|
+
* Encodes a Status message.
|
|
61560
|
+
*
|
|
61561
|
+
* message Status {
|
|
61562
|
+
* string message = 2;
|
|
61563
|
+
* StatusCode code = 3;
|
|
61564
|
+
* }
|
|
61565
|
+
*
|
|
61566
|
+
* @internal
|
|
61567
|
+
*/
|
|
61568
|
+
const encodeStatus = (status) => concat(optionalStringField(2, status.message), varintField(3, status.code));
|
|
61569
|
+
/**
|
|
61570
|
+
* Encodes an Event message.
|
|
61571
|
+
*
|
|
61572
|
+
* message Event {
|
|
61573
|
+
* fixed64 time_unix_nano = 1;
|
|
61574
|
+
* string name = 2;
|
|
61575
|
+
* repeated KeyValue attributes = 3;
|
|
61576
|
+
* uint32 dropped_attributes_count = 4;
|
|
61577
|
+
* }
|
|
61578
|
+
*
|
|
61579
|
+
* @internal
|
|
61580
|
+
*/
|
|
61581
|
+
const encodeEvent = (event) => concat(fixed64Field(1, BigInt(event.timeUnixNano)), stringField(2, event.name), repeatedField(3, event.attributes, encodeKeyValue), event.droppedAttributesCount > 0 ? varintField(4, event.droppedAttributesCount) : new Uint8Array(0));
|
|
61582
|
+
/**
|
|
61583
|
+
* Encodes a Link message.
|
|
61584
|
+
*
|
|
61585
|
+
* message Link {
|
|
61586
|
+
* bytes trace_id = 1;
|
|
61587
|
+
* bytes span_id = 2;
|
|
61588
|
+
* string trace_state = 3;
|
|
61589
|
+
* repeated KeyValue attributes = 4;
|
|
61590
|
+
* uint32 dropped_attributes_count = 5;
|
|
61591
|
+
* fixed32 flags = 6;
|
|
61592
|
+
* }
|
|
61593
|
+
*
|
|
61594
|
+
* @internal
|
|
61595
|
+
*/
|
|
61596
|
+
const encodeLink = (link) => concat(bytesFieldFromHex(1, link.traceId), bytesFieldFromHex(2, link.spanId), optionalStringField(3, link.traceState), repeatedField(4, link.attributes, encodeKeyValue), link.droppedAttributesCount > 0 ? varintField(5, link.droppedAttributesCount) : new Uint8Array(0), link.flags !== void 0 ? fixed32Field(6, link.flags) : new Uint8Array(0));
|
|
61597
|
+
/**
|
|
61598
|
+
* Encodes a Span message.
|
|
61599
|
+
*
|
|
61600
|
+
* message Span {
|
|
61601
|
+
* bytes trace_id = 1;
|
|
61602
|
+
* bytes span_id = 2;
|
|
61603
|
+
* string trace_state = 3;
|
|
61604
|
+
* bytes parent_span_id = 4;
|
|
61605
|
+
* string name = 5;
|
|
61606
|
+
* SpanKind kind = 6;
|
|
61607
|
+
* fixed64 start_time_unix_nano = 7;
|
|
61608
|
+
* fixed64 end_time_unix_nano = 8;
|
|
61609
|
+
* repeated KeyValue attributes = 9;
|
|
61610
|
+
* uint32 dropped_attributes_count = 10;
|
|
61611
|
+
* repeated Event events = 11;
|
|
61612
|
+
* uint32 dropped_events_count = 12;
|
|
61613
|
+
* repeated Link links = 13;
|
|
61614
|
+
* uint32 dropped_links_count = 14;
|
|
61615
|
+
* Status status = 15;
|
|
61616
|
+
* fixed32 flags = 16;
|
|
61617
|
+
* }
|
|
61618
|
+
*
|
|
61619
|
+
* @internal
|
|
61620
|
+
*/
|
|
61621
|
+
const encodeSpan = (span) => concat(bytesFieldFromHex(1, span.traceId), bytesFieldFromHex(2, span.spanId), optionalStringField(3, span.traceState), span.parentSpanId !== void 0 ? bytesFieldFromHex(4, span.parentSpanId) : new Uint8Array(0), stringField(5, span.name), varintField(6, span.kind), fixed64Field(7, BigInt(span.startTimeUnixNano)), fixed64Field(8, BigInt(span.endTimeUnixNano)), repeatedField(9, span.attributes, encodeKeyValue), span.droppedAttributesCount > 0 ? varintField(10, span.droppedAttributesCount) : new Uint8Array(0), repeatedField(11, span.events, encodeEvent), span.droppedEventsCount > 0 ? varintField(12, span.droppedEventsCount) : new Uint8Array(0), repeatedField(13, span.links, encodeLink), span.droppedLinksCount > 0 ? varintField(14, span.droppedLinksCount) : new Uint8Array(0), messageField(15, encodeStatus(span.status)), span.flags !== void 0 ? fixed32Field(16, span.flags) : new Uint8Array(0));
|
|
61622
|
+
/**
|
|
61623
|
+
* Encodes a ScopeSpans message.
|
|
61624
|
+
*
|
|
61625
|
+
* message ScopeSpans {
|
|
61626
|
+
* InstrumentationScope scope = 1;
|
|
61627
|
+
* repeated Span spans = 2;
|
|
61628
|
+
* string schema_url = 3;
|
|
61629
|
+
* }
|
|
61630
|
+
*
|
|
61631
|
+
* @internal
|
|
61632
|
+
*/
|
|
61633
|
+
const encodeScopeSpans = (scopeSpans) => concat(messageField(1, encodeInstrumentationScope(scopeSpans.scope)), repeatedField(2, scopeSpans.spans, encodeSpan), optionalStringField(3, scopeSpans.schemaUrl));
|
|
61634
|
+
/**
|
|
61635
|
+
* Encodes a ResourceSpans message.
|
|
61636
|
+
*
|
|
61637
|
+
* message ResourceSpans {
|
|
61638
|
+
* Resource resource = 1;
|
|
61639
|
+
* repeated ScopeSpans scope_spans = 2;
|
|
61640
|
+
* string schema_url = 3;
|
|
61641
|
+
* }
|
|
61642
|
+
*
|
|
61643
|
+
* @internal
|
|
61644
|
+
*/
|
|
61645
|
+
const encodeResourceSpans = (resourceSpans) => concat(messageField(1, encodeResource(resourceSpans.resource)), repeatedField(2, resourceSpans.scopeSpans, encodeScopeSpans), optionalStringField(3, resourceSpans.schemaUrl));
|
|
61646
|
+
/**
|
|
61647
|
+
* Encodes a TracesData message (top-level export request).
|
|
61648
|
+
*
|
|
61649
|
+
* message TracesData {
|
|
61650
|
+
* repeated ResourceSpans resource_spans = 1;
|
|
61651
|
+
* }
|
|
61652
|
+
*
|
|
61653
|
+
* @internal
|
|
61654
|
+
*/
|
|
61655
|
+
const encodeTracesData = (tracesData) => repeatedField(1, tracesData.resourceSpans, encodeResourceSpans);
|
|
61656
|
+
/**
|
|
61657
|
+
* Encodes a NumberDataPoint message.
|
|
61658
|
+
*
|
|
61659
|
+
* message NumberDataPoint {
|
|
61660
|
+
* repeated KeyValue attributes = 7;
|
|
61661
|
+
* fixed64 start_time_unix_nano = 2;
|
|
61662
|
+
* fixed64 time_unix_nano = 3;
|
|
61663
|
+
* oneof value {
|
|
61664
|
+
* double as_double = 4;
|
|
61665
|
+
* sfixed64 as_int = 6;
|
|
61666
|
+
* }
|
|
61667
|
+
* repeated Exemplar exemplars = 5;
|
|
61668
|
+
* uint32 flags = 8;
|
|
61669
|
+
* }
|
|
61670
|
+
*
|
|
61671
|
+
* @internal
|
|
61672
|
+
*/
|
|
61673
|
+
const encodeNumberDataPoint = (point) => concat(fixed64Field(2, BigInt(point.startTimeUnixNano)), fixed64Field(3, BigInt(point.timeUnixNano)), point.asDouble !== void 0 ? doubleField(4, point.asDouble) : new Uint8Array(0), point.asInt !== void 0 ? fixed64Field(6, BigInt(point.asInt)) : new Uint8Array(0), repeatedField(7, point.attributes, encodeKeyValue), point.flags !== void 0 ? varintField(8, point.flags) : new Uint8Array(0));
|
|
61674
|
+
/**
|
|
61675
|
+
* Encodes a HistogramDataPoint message.
|
|
61676
|
+
*
|
|
61677
|
+
* message HistogramDataPoint {
|
|
61678
|
+
* repeated KeyValue attributes = 9;
|
|
61679
|
+
* fixed64 start_time_unix_nano = 2;
|
|
61680
|
+
* fixed64 time_unix_nano = 3;
|
|
61681
|
+
* fixed64 count = 4;
|
|
61682
|
+
* optional double sum = 5;
|
|
61683
|
+
* repeated fixed64 bucket_counts = 6;
|
|
61684
|
+
* repeated double explicit_bounds = 7;
|
|
61685
|
+
* optional double min = 11;
|
|
61686
|
+
* optional double max = 12;
|
|
61687
|
+
* uint32 flags = 10;
|
|
61688
|
+
* }
|
|
61689
|
+
*
|
|
61690
|
+
* @internal
|
|
61691
|
+
*/
|
|
61692
|
+
const encodeHistogramDataPoint = (point) => {
|
|
61693
|
+
const bucketCountsEncoded = concat(...point.bucketCounts.map((count) => fixed64Field(6, BigInt(count))));
|
|
61694
|
+
const explicitBoundsEncoded = concat(...point.explicitBounds.map((bound) => doubleField(7, bound)));
|
|
61695
|
+
return concat(fixed64Field(2, BigInt(point.startTimeUnixNano)), fixed64Field(3, BigInt(point.timeUnixNano)), fixed64Field(4, BigInt(point.count)), point.sum !== void 0 ? doubleField(5, point.sum) : new Uint8Array(0), bucketCountsEncoded, explicitBoundsEncoded, repeatedField(9, point.attributes, encodeKeyValue), point.flags !== void 0 ? varintField(10, point.flags) : new Uint8Array(0), point.min !== void 0 ? doubleField(11, point.min) : new Uint8Array(0), point.max !== void 0 ? doubleField(12, point.max) : new Uint8Array(0));
|
|
61696
|
+
};
|
|
61697
|
+
/**
|
|
61698
|
+
* Encodes a Gauge message.
|
|
61699
|
+
*
|
|
61700
|
+
* message Gauge {
|
|
61701
|
+
* repeated NumberDataPoint data_points = 1;
|
|
61702
|
+
* }
|
|
61703
|
+
*
|
|
61704
|
+
* @internal
|
|
61705
|
+
*/
|
|
61706
|
+
const encodeGauge = (gauge) => repeatedField(1, gauge.dataPoints, encodeNumberDataPoint);
|
|
61707
|
+
/**
|
|
61708
|
+
* Encodes a Sum message.
|
|
61709
|
+
*
|
|
61710
|
+
* message Sum {
|
|
61711
|
+
* repeated NumberDataPoint data_points = 1;
|
|
61712
|
+
* AggregationTemporality aggregation_temporality = 2;
|
|
61713
|
+
* bool is_monotonic = 3;
|
|
61714
|
+
* }
|
|
61715
|
+
*
|
|
61716
|
+
* @internal
|
|
61717
|
+
*/
|
|
61718
|
+
const encodeSum = (sum) => concat(repeatedField(1, sum.dataPoints, encodeNumberDataPoint), varintField(2, sum.aggregationTemporality), boolField(3, sum.isMonotonic));
|
|
61719
|
+
/**
|
|
61720
|
+
* Encodes a Histogram message.
|
|
61721
|
+
*
|
|
61722
|
+
* message Histogram {
|
|
61723
|
+
* repeated HistogramDataPoint data_points = 1;
|
|
61724
|
+
* AggregationTemporality aggregation_temporality = 2;
|
|
61725
|
+
* }
|
|
61726
|
+
*
|
|
61727
|
+
* @internal
|
|
61728
|
+
*/
|
|
61729
|
+
const encodeHistogram = (histogram) => concat(repeatedField(1, histogram.dataPoints, encodeHistogramDataPoint), varintField(2, histogram.aggregationTemporality));
|
|
61730
|
+
/**
|
|
61731
|
+
* Encodes a Metric message.
|
|
61732
|
+
*
|
|
61733
|
+
* message Metric {
|
|
61734
|
+
* string name = 1;
|
|
61735
|
+
* string description = 2;
|
|
61736
|
+
* string unit = 3;
|
|
61737
|
+
* oneof data {
|
|
61738
|
+
* Gauge gauge = 5;
|
|
61739
|
+
* Sum sum = 7;
|
|
61740
|
+
* Histogram histogram = 9;
|
|
61741
|
+
* ExponentialHistogram exponential_histogram = 10;
|
|
61742
|
+
* Summary summary = 11;
|
|
61743
|
+
* }
|
|
61744
|
+
* }
|
|
61745
|
+
*
|
|
61746
|
+
* @internal
|
|
61747
|
+
*/
|
|
61748
|
+
const encodeMetric = (metric) => concat(stringField(1, metric.name), optionalStringField(2, metric.description), optionalStringField(3, metric.unit), metric.gauge !== void 0 ? messageField(5, encodeGauge(metric.gauge)) : new Uint8Array(0), metric.sum !== void 0 ? messageField(7, encodeSum(metric.sum)) : new Uint8Array(0), metric.histogram !== void 0 ? messageField(9, encodeHistogram(metric.histogram)) : new Uint8Array(0));
|
|
61749
|
+
/**
|
|
61750
|
+
* Encodes a ScopeMetrics message.
|
|
61751
|
+
*
|
|
61752
|
+
* message ScopeMetrics {
|
|
61753
|
+
* InstrumentationScope scope = 1;
|
|
61754
|
+
* repeated Metric metrics = 2;
|
|
61755
|
+
* string schema_url = 3;
|
|
61756
|
+
* }
|
|
61757
|
+
*
|
|
61758
|
+
* @internal
|
|
61759
|
+
*/
|
|
61760
|
+
const encodeScopeMetrics = (scopeMetrics) => concat(messageField(1, encodeInstrumentationScope(scopeMetrics.scope)), repeatedField(2, scopeMetrics.metrics, encodeMetric), optionalStringField(3, scopeMetrics.schemaUrl));
|
|
61761
|
+
/**
|
|
61762
|
+
* Encodes a ResourceMetrics message.
|
|
61763
|
+
*
|
|
61764
|
+
* message ResourceMetrics {
|
|
61765
|
+
* Resource resource = 1;
|
|
61766
|
+
* repeated ScopeMetrics scope_metrics = 2;
|
|
61767
|
+
* string schema_url = 3;
|
|
61768
|
+
* }
|
|
61769
|
+
*
|
|
61770
|
+
* @internal
|
|
61771
|
+
*/
|
|
61772
|
+
const encodeResourceMetrics = (resourceMetrics) => concat(messageField(1, encodeResource(resourceMetrics.resource)), repeatedField(2, resourceMetrics.scopeMetrics, encodeScopeMetrics), optionalStringField(3, resourceMetrics.schemaUrl));
|
|
61773
|
+
/**
|
|
61774
|
+
* Encodes a MetricsData message (top-level export request).
|
|
61775
|
+
*
|
|
61776
|
+
* message MetricsData {
|
|
61777
|
+
* repeated ResourceMetrics resource_metrics = 1;
|
|
61778
|
+
* }
|
|
61779
|
+
*
|
|
61780
|
+
* @internal
|
|
61781
|
+
*/
|
|
61782
|
+
const encodeMetricsData = (metricsData) => repeatedField(1, metricsData.resourceMetrics, encodeResourceMetrics);
|
|
61783
|
+
/**
|
|
61784
|
+
* Encodes a LogRecord message.
|
|
61785
|
+
*
|
|
61786
|
+
* message LogRecord {
|
|
61787
|
+
* fixed64 time_unix_nano = 1;
|
|
61788
|
+
* fixed64 observed_time_unix_nano = 11;
|
|
61789
|
+
* SeverityNumber severity_number = 2;
|
|
61790
|
+
* string severity_text = 3;
|
|
61791
|
+
* AnyValue body = 5;
|
|
61792
|
+
* repeated KeyValue attributes = 6;
|
|
61793
|
+
* uint32 dropped_attributes_count = 7;
|
|
61794
|
+
* fixed32 flags = 8;
|
|
61795
|
+
* bytes trace_id = 9;
|
|
61796
|
+
* bytes span_id = 10;
|
|
61797
|
+
* }
|
|
61798
|
+
*
|
|
61799
|
+
* @internal
|
|
61800
|
+
*/
|
|
61801
|
+
const encodeLogRecord = (record) => concat(fixed64Field(1, BigInt(record.timeUnixNano)), record.severityNumber !== void 0 ? varintField(2, record.severityNumber) : new Uint8Array(0), optionalStringField(3, record.severityText), record.body !== void 0 ? messageField(5, encodeAnyValue(record.body)) : new Uint8Array(0), repeatedField(6, record.attributes, encodeKeyValue), record.droppedAttributesCount !== void 0 && record.droppedAttributesCount > 0 ? varintField(7, record.droppedAttributesCount) : new Uint8Array(0), record.flags !== void 0 ? fixed32Field(8, record.flags) : new Uint8Array(0), record.traceId !== void 0 && record.traceId !== "" ? bytesFieldFromHex(9, record.traceId) : new Uint8Array(0), record.spanId !== void 0 && record.spanId !== "" ? bytesFieldFromHex(10, record.spanId) : new Uint8Array(0), record.observedTimeUnixNano !== void 0 ? fixed64Field(11, BigInt(record.observedTimeUnixNano)) : new Uint8Array(0));
|
|
61802
|
+
/**
|
|
61803
|
+
* Encodes a ScopeLogs message.
|
|
61804
|
+
*
|
|
61805
|
+
* message ScopeLogs {
|
|
61806
|
+
* InstrumentationScope scope = 1;
|
|
61807
|
+
* repeated LogRecord log_records = 2;
|
|
61808
|
+
* string schema_url = 3;
|
|
61809
|
+
* }
|
|
61810
|
+
*
|
|
61811
|
+
* @internal
|
|
61812
|
+
*/
|
|
61813
|
+
const encodeScopeLogs = (scopeLogs) => concat(messageField(1, encodeInstrumentationScope(scopeLogs.scope)), repeatedField(2, scopeLogs.logRecords, encodeLogRecord), optionalStringField(3, scopeLogs.schemaUrl));
|
|
61814
|
+
/**
|
|
61815
|
+
* Encodes a ResourceLogs message.
|
|
61816
|
+
*
|
|
61817
|
+
* message ResourceLogs {
|
|
61818
|
+
* Resource resource = 1;
|
|
61819
|
+
* repeated ScopeLogs scope_logs = 2;
|
|
61820
|
+
* string schema_url = 3;
|
|
61821
|
+
* }
|
|
61822
|
+
*
|
|
61823
|
+
* @internal
|
|
61824
|
+
*/
|
|
61825
|
+
const encodeResourceLogs = (resourceLogs) => concat(messageField(1, encodeResource(resourceLogs.resource)), repeatedField(2, resourceLogs.scopeLogs, encodeScopeLogs), optionalStringField(3, resourceLogs.schemaUrl));
|
|
61826
|
+
/**
|
|
61827
|
+
* Encodes a LogsData message (top-level export request).
|
|
61828
|
+
*
|
|
61829
|
+
* message LogsData {
|
|
61830
|
+
* repeated ResourceLogs resource_logs = 1;
|
|
61831
|
+
* }
|
|
61832
|
+
*
|
|
61833
|
+
* @internal
|
|
61834
|
+
*/
|
|
61835
|
+
const encodeLogsData = (logsData) => repeatedField(1, logsData.resourceLogs, encodeResourceLogs);
|
|
61836
|
+
//#endregion
|
|
60778
61837
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/unstable/observability/OtlpSerialization.js
|
|
60779
61838
|
/**
|
|
60780
61839
|
* Serializes OTLP payloads into HTTP request bodies.
|
|
@@ -60804,6 +61863,18 @@ const layerJson$1 = /* @__PURE__ */ succeed$3(OtlpSerialization, {
|
|
|
60804
61863
|
metrics: (metrics) => jsonUnsafe(metrics),
|
|
60805
61864
|
logs: (logs) => jsonUnsafe(logs)
|
|
60806
61865
|
});
|
|
61866
|
+
/**
|
|
61867
|
+
* Provides `OtlpSerialization` using protobuf-encoded OTLP bodies with the
|
|
61868
|
+
* `application/x-protobuf` content type.
|
|
61869
|
+
*
|
|
61870
|
+
* @category layers
|
|
61871
|
+
* @since 4.0.0
|
|
61872
|
+
*/
|
|
61873
|
+
const layerProtobuf = /* @__PURE__ */ succeed$3(OtlpSerialization, {
|
|
61874
|
+
traces: (spans) => uint8Array(encodeTracesData(spans), "application/x-protobuf"),
|
|
61875
|
+
metrics: (metrics) => uint8Array(encodeMetricsData(metrics), "application/x-protobuf"),
|
|
61876
|
+
logs: (logs) => uint8Array(encodeLogsData(logs), "application/x-protobuf")
|
|
61877
|
+
});
|
|
60807
61878
|
//#endregion
|
|
60808
61879
|
//#region ../../node_modules/.pnpm/effect@4.0.0-beta.102/node_modules/effect/dist/unstable/observability/OtlpLogger.js
|
|
60809
61880
|
/**
|
|
@@ -61763,7 +62834,7 @@ const TypeId$1 = "~effect/Cache";
|
|
|
61763
62834
|
*/
|
|
61764
62835
|
const makeWith = (lookup, options) => contextWith$1((context) => {
|
|
61765
62836
|
const self = Object.create(Proto$1);
|
|
61766
|
-
self.lookup = (key) => updateContext$1(lookup(key), (input) => merge$
|
|
62837
|
+
self.lookup = (key) => updateContext$1(lookup(key), (input) => merge$4(context, input));
|
|
61767
62838
|
self.map = make$20();
|
|
61768
62839
|
self.capacity = options.capacity;
|
|
61769
62840
|
self.timeToLive = options.timeToLive ? (exit, key) => fromInputUnsafe(options.timeToLive(exit, key)) : defaultTimeToLive;
|
|
@@ -63847,6 +64918,12 @@ const REACT_ROUTER_CAPABILITY_THRESHOLDS = [
|
|
|
63847
64918
|
}
|
|
63848
64919
|
];
|
|
63849
64920
|
const SCORE_API_URL = "https://www.react.doctor/api/score";
|
|
64921
|
+
const AXIOM_DEFAULT_DOMAIN = "https://api.axiom.co";
|
|
64922
|
+
const AXIOM_TRACES_PATH = "/v1/traces";
|
|
64923
|
+
const AXIOM_METRICS_PATH = "/v1/metrics";
|
|
64924
|
+
const AXIOM_DATASET_HEADER = "X-Axiom-Dataset";
|
|
64925
|
+
const AXIOM_METRICS_DATASET_HEADER = "x-axiom-metrics-dataset";
|
|
64926
|
+
const TELEMETRY_SHUTDOWN_TIMEOUT_MS = 1e3;
|
|
63850
64927
|
const ENTERPRISE_CONTACT_URL = "https://react.doctor/enterprise";
|
|
63851
64928
|
const SHARE_BASE_URL = "https://react.doctor/share";
|
|
63852
64929
|
const CI_URL = "https://react.doctor/ci";
|
|
@@ -64121,7 +65198,7 @@ const SOCKET_FREE_USER_AGENT = "react-doctor-supply-chain";
|
|
|
64121
65198
|
const FILE_LINT_CACHE_FILENAME = "file-lint-cache.json";
|
|
64122
65199
|
const FILE_LINT_CACHE_MAX_FILE_COUNT = 5e4;
|
|
64123
65200
|
const SIDECAR_LINT_CACHE_FILENAME = "sidecar-lint-cache.json";
|
|
64124
|
-
const CORE_PACKAGE_VERSION = "0.9.
|
|
65201
|
+
const CORE_PACKAGE_VERSION = "0.9.9";
|
|
64125
65202
|
const DEAD_CODE_CACHE_FILENAME = "dead-code-cache.json";
|
|
64126
65203
|
const DEAD_CODE_SUMMARY_CACHE_FILENAME = "dead-code-summaries.json";
|
|
64127
65204
|
const SUPPLY_CHAIN_PLUGIN = "socket";
|
|
@@ -68354,11 +69431,304 @@ const restoreLegacyThrow = (effect) => effect.pipe(catchReasons("ReactDoctorErro
|
|
|
68354
69431
|
ProjectNotFound: (reason) => die(new ProjectNotFoundError(reason.directory)),
|
|
68355
69432
|
AmbiguousProject: (reason) => die(new AmbiguousProjectError(reason.directory, [...reason.candidates]))
|
|
68356
69433
|
}, (_reason, error) => die(error)));
|
|
69434
|
+
const REDACTED_PLACEHOLDER = "<redacted>";
|
|
69435
|
+
const KEEP_PREFIX = `$1${REDACTED_PLACEHOLDER}`;
|
|
69436
|
+
const KNOWN_SECRET_RULES = [
|
|
69437
|
+
{
|
|
69438
|
+
pattern: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,
|
|
69439
|
+
replacement: REDACTED_PLACEHOLDER
|
|
69440
|
+
},
|
|
69441
|
+
{
|
|
69442
|
+
pattern: /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,
|
|
69443
|
+
replacement: REDACTED_PLACEHOLDER
|
|
69444
|
+
},
|
|
69445
|
+
{
|
|
69446
|
+
pattern: /(?<=:\/\/)[^\s/:@]+:[^\s/@]+(?=@)/g,
|
|
69447
|
+
replacement: REDACTED_PLACEHOLDER
|
|
69448
|
+
},
|
|
69449
|
+
{
|
|
69450
|
+
pattern: /\b(AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA|A3T[A-Z0-9])[0-9A-Z]{16,}/g,
|
|
69451
|
+
replacement: KEEP_PREFIX
|
|
69452
|
+
},
|
|
69453
|
+
{
|
|
69454
|
+
pattern: /\b(gh[pousr]_)[A-Za-z0-9]{36,}/g,
|
|
69455
|
+
replacement: KEEP_PREFIX
|
|
69456
|
+
},
|
|
69457
|
+
{
|
|
69458
|
+
pattern: /\b(github_pat_)[A-Za-z0-9_]{22,}/g,
|
|
69459
|
+
replacement: KEEP_PREFIX
|
|
69460
|
+
},
|
|
69461
|
+
{
|
|
69462
|
+
pattern: /\b(glpat-)[A-Za-z0-9_-]{20,}/g,
|
|
69463
|
+
replacement: KEEP_PREFIX
|
|
69464
|
+
},
|
|
69465
|
+
{
|
|
69466
|
+
pattern: /\b(xox[baprs]-)[A-Za-z0-9-]{10,}/g,
|
|
69467
|
+
replacement: KEEP_PREFIX
|
|
69468
|
+
},
|
|
69469
|
+
{
|
|
69470
|
+
pattern: /(?<=hooks\.slack\.com\/services\/)[A-Za-z0-9/+_-]{20,}/g,
|
|
69471
|
+
replacement: REDACTED_PLACEHOLDER
|
|
69472
|
+
},
|
|
69473
|
+
{
|
|
69474
|
+
pattern: /\b((?:sk|rk)_(?:live|test)_)[0-9A-Za-z]{10,}/g,
|
|
69475
|
+
replacement: KEEP_PREFIX
|
|
69476
|
+
},
|
|
69477
|
+
{
|
|
69478
|
+
pattern: /\b(sk-(?:proj-|ant-)?)[A-Za-z0-9_-]{20,}/g,
|
|
69479
|
+
replacement: KEEP_PREFIX
|
|
69480
|
+
},
|
|
69481
|
+
{
|
|
69482
|
+
pattern: /\b(AIza)[0-9A-Za-z_-]{35,}/g,
|
|
69483
|
+
replacement: KEEP_PREFIX
|
|
69484
|
+
},
|
|
69485
|
+
{
|
|
69486
|
+
pattern: /\b(ya29\.)[0-9A-Za-z_-]{20,}/g,
|
|
69487
|
+
replacement: KEEP_PREFIX
|
|
69488
|
+
},
|
|
69489
|
+
{
|
|
69490
|
+
pattern: /\b(npm_)[A-Za-z0-9]{36,}/g,
|
|
69491
|
+
replacement: KEEP_PREFIX
|
|
69492
|
+
},
|
|
69493
|
+
{
|
|
69494
|
+
pattern: /\b(SG\.)[A-Za-z0-9_-]{22,}\.[A-Za-z0-9_-]{43,}/g,
|
|
69495
|
+
replacement: KEEP_PREFIX
|
|
69496
|
+
},
|
|
69497
|
+
{
|
|
69498
|
+
pattern: /\b(SK)[0-9a-fA-F]{32,}/g,
|
|
69499
|
+
replacement: KEEP_PREFIX
|
|
69500
|
+
},
|
|
69501
|
+
{
|
|
69502
|
+
pattern: /\b(dop_v1_)[a-f0-9]{64,}/g,
|
|
69503
|
+
replacement: KEEP_PREFIX
|
|
69504
|
+
},
|
|
69505
|
+
{
|
|
69506
|
+
pattern: /\b(shp(?:at|ca|pa|ss)_)[a-fA-F0-9]{32,}/g,
|
|
69507
|
+
replacement: KEEP_PREFIX
|
|
69508
|
+
},
|
|
69509
|
+
{
|
|
69510
|
+
pattern: /\b(sq0[a-z]{3}-)[0-9A-Za-z_-]{22,}/g,
|
|
69511
|
+
replacement: KEEP_PREFIX
|
|
69512
|
+
},
|
|
69513
|
+
{
|
|
69514
|
+
pattern: /\b([0-9]{8,10}:AA)[0-9A-Za-z_-]{32,}/g,
|
|
69515
|
+
replacement: KEEP_PREFIX
|
|
69516
|
+
},
|
|
69517
|
+
{
|
|
69518
|
+
pattern: /(?<=\bBearer\s)[A-Za-z0-9._~+/=-]{16,}/g,
|
|
69519
|
+
replacement: REDACTED_PLACEHOLDER
|
|
69520
|
+
},
|
|
69521
|
+
{
|
|
69522
|
+
pattern: /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,
|
|
69523
|
+
replacement: REDACTED_PLACEHOLDER
|
|
69524
|
+
}
|
|
69525
|
+
];
|
|
69526
|
+
const CANDIDATE_TOKEN_PATTERN = /[A-Za-z0-9_][A-Za-z0-9_-]*/g;
|
|
69527
|
+
const HEX_DIGEST_PATTERN = /^(?:[0-9a-f]{32}|[0-9a-f]{40}|[0-9a-f]{64})$/;
|
|
69528
|
+
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
69529
|
+
const HAS_LETTER_PATTERN = /[A-Za-z]/;
|
|
69530
|
+
const HAS_DIGIT_PATTERN = /[0-9]/;
|
|
69531
|
+
const shannonEntropyBits = (value) => {
|
|
69532
|
+
const counts = /* @__PURE__ */ new Map();
|
|
69533
|
+
for (const char of value) counts.set(char, (counts.get(char) ?? 0) + 1);
|
|
69534
|
+
let bits = 0;
|
|
69535
|
+
for (const count of counts.values()) {
|
|
69536
|
+
const probability = count / value.length;
|
|
69537
|
+
bits -= probability * Math.log2(probability);
|
|
69538
|
+
}
|
|
69539
|
+
return bits;
|
|
69540
|
+
};
|
|
69541
|
+
const looksLikeHighEntropySecret = (token) => {
|
|
69542
|
+
if (token.length < 32) return false;
|
|
69543
|
+
if (!HAS_LETTER_PATTERN.test(token) || !HAS_DIGIT_PATTERN.test(token)) return false;
|
|
69544
|
+
if (HEX_DIGEST_PATTERN.test(token) || UUID_PATTERN.test(token)) return false;
|
|
69545
|
+
return shannonEntropyBits(token) >= 3;
|
|
69546
|
+
};
|
|
69547
|
+
const redactHighEntropyTokens = (text) => text.replace(CANDIDATE_TOKEN_PATTERN, (token) => looksLikeHighEntropySecret(token) ? REDACTED_PLACEHOLDER : token);
|
|
69548
|
+
/**
|
|
69549
|
+
* Masks API keys, tokens, private keys, credentialed URLs, and emails
|
|
69550
|
+
* found anywhere inside a free-text string, returning the scrubbed text.
|
|
69551
|
+
* Applied to every diagnostic's `message` / `help` at construction time
|
|
69552
|
+
* so secrets never reach the terminal, the JSON report, or the score
|
|
69553
|
+
* API — react-doctor must never echo or transmit a user's secrets.
|
|
69554
|
+
*
|
|
69555
|
+
* Provider tokens keep their non-secret, type-identifying prefix (e.g.
|
|
69556
|
+
* `sk_live_<redacted>`, `ghp_<redacted>`, `AKIA<redacted>`) so the leaked
|
|
69557
|
+
* credential's type stays visible; structural or unknown-format secrets
|
|
69558
|
+
* with no meaningful prefix are masked whole.
|
|
69559
|
+
*
|
|
69560
|
+
* Runs the high-precision known-shape detectors first, then a generic
|
|
69561
|
+
* entropy-gated sweep for unknown-format secrets. Idempotent: the inert
|
|
69562
|
+
* `<redacted>` placeholder matches none of the detectors and is too
|
|
69563
|
+
* short for the generic sweep, so re-running leaves the text unchanged.
|
|
69564
|
+
*
|
|
69565
|
+
* Accepts `unknown` on purpose: callers feed it diagnostic `message` /
|
|
69566
|
+
* `help` that originate from oxlint JSON, which is only shape-checked at
|
|
69567
|
+
* the top level (the per-field `string` types are assumed, not validated).
|
|
69568
|
+
* A malformed non-string value returns `""` instead of throwing on
|
|
69569
|
+
* `.replace`, so one bad diagnostic can't abort parsing the whole batch.
|
|
69570
|
+
*/
|
|
69571
|
+
const redactSensitiveText = (text) => {
|
|
69572
|
+
if (typeof text !== "string" || text === "") return "";
|
|
69573
|
+
let redacted = text;
|
|
69574
|
+
for (const rule of KNOWN_SECRET_RULES) redacted = redacted.replace(rule.pattern, rule.replacement);
|
|
69575
|
+
return redactHighEntropyTokens(redacted);
|
|
69576
|
+
};
|
|
69577
|
+
const HOME_DIRECTORY = os.homedir();
|
|
69578
|
+
const USER_HOME_PATTERNS = [/[A-Za-z]:[\\/]Users[\\/][^\\/]+/gi, /(?:\/Users\/|\/home\/)[^/\\]+/gi];
|
|
69579
|
+
const scrubSensitivePaths = (text) => {
|
|
69580
|
+
let scrubbed = text;
|
|
69581
|
+
if (HOME_DIRECTORY.length > 1) scrubbed = scrubbed.split(HOME_DIRECTORY).join("~");
|
|
69582
|
+
for (const pattern of USER_HOME_PATTERNS) scrubbed = scrubbed.replace(pattern, "~");
|
|
69583
|
+
return scrubbed;
|
|
69584
|
+
};
|
|
69585
|
+
/**
|
|
69586
|
+
* Free-text fields can carry both a home-directory path (the OS username) and a
|
|
69587
|
+
* secret/email echoed from user code, so run both scrubbers: strip the username
|
|
69588
|
+
* from paths, then mask any known credential/PII shape. Shared by the Sentry
|
|
69589
|
+
* event scrubber ({@link scrubSentryEvent}), the metric emitter, and the
|
|
69590
|
+
* scrubbing tracer that guards everything bound for OTLP.
|
|
69591
|
+
*/
|
|
69592
|
+
const anonymizeText = (text) => redactSensitiveText(scrubSensitivePaths(text));
|
|
69593
|
+
/**
|
|
69594
|
+
* Recursively rewrites every string within an arbitrary value (object / array /
|
|
69595
|
+
* primitive) through {@link anonymizeText}, mutating in place. Used to sweep the
|
|
69596
|
+
* unstructured corners of a Sentry payload (event contexts/extra/tags, breadcrumb
|
|
69597
|
+
* data, span attributes, metric attributes) where a path or secret could hide.
|
|
69598
|
+
*/
|
|
69599
|
+
const anonymizeInPlace = (value) => {
|
|
69600
|
+
if (Array.isArray(value)) {
|
|
69601
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
69602
|
+
const item = value[index];
|
|
69603
|
+
if (typeof item === "string") value[index] = anonymizeText(item);
|
|
69604
|
+
else anonymizeInPlace(item);
|
|
69605
|
+
}
|
|
69606
|
+
return;
|
|
69607
|
+
}
|
|
69608
|
+
if (!isPlainObject(value)) return;
|
|
69609
|
+
for (const key of Object.keys(value)) {
|
|
69610
|
+
const inner = value[key];
|
|
69611
|
+
if (typeof inner === "string") value[key] = anonymizeText(inner);
|
|
69612
|
+
else anonymizeInPlace(inner);
|
|
69613
|
+
}
|
|
69614
|
+
};
|
|
69615
|
+
const scrubValue = (value) => typeof value === "string" ? anonymizeText(value) : value;
|
|
69616
|
+
/**
|
|
69617
|
+
* Anonymizes the failure a span ended with.
|
|
69618
|
+
*
|
|
69619
|
+
* The OTLP tracer runs `Cause.prettyErrors` over the exit and exports each
|
|
69620
|
+
* result as `exception.type` / `exception.message` / `exception.stacktrace`.
|
|
69621
|
+
* Stack traces are full of absolute paths, so a failing scan would ship the
|
|
69622
|
+
* user's home directory even though every attribute and event is scrubbed —
|
|
69623
|
+
* this is the one route into the payload that doesn't go through
|
|
69624
|
+
* `span.attribute`.
|
|
69625
|
+
*
|
|
69626
|
+
* Interrupt-only causes are left alone: the exporter emits a fixed
|
|
69627
|
+
* "Interrupted" label for them and never touches the error text.
|
|
69628
|
+
*/
|
|
69629
|
+
const scrubExit = (exit) => {
|
|
69630
|
+
if (isSuccess(exit) || hasInterruptsOnly(exit.cause)) return exit;
|
|
69631
|
+
const errors = prettyErrors(exit.cause);
|
|
69632
|
+
if (errors.length === 0) return exit;
|
|
69633
|
+
return failCause$3(errors.map((error) => {
|
|
69634
|
+
const anonymized = new Error(anonymizeText(error.message));
|
|
69635
|
+
anonymized.name = anonymizeText(error.name);
|
|
69636
|
+
anonymized.stack = error.stack === void 0 ? void 0 : anonymizeText(error.stack);
|
|
69637
|
+
return fail$6(anonymized);
|
|
69638
|
+
}).reduce((left, right) => combine(left, right)));
|
|
69639
|
+
};
|
|
69640
|
+
const scrubAttributes = (attributes) => {
|
|
69641
|
+
if (!attributes) return attributes;
|
|
69642
|
+
const scrubbed = {};
|
|
69643
|
+
for (const [key, value] of Object.entries(attributes)) scrubbed[key] = scrubValue(value);
|
|
69644
|
+
return scrubbed;
|
|
69645
|
+
};
|
|
69646
|
+
/**
|
|
69647
|
+
* Wraps a {@link Tracer.Span} so every value that reaches the exporter has been
|
|
69648
|
+
* run through {@link anonymizeText} first.
|
|
69649
|
+
*
|
|
69650
|
+
* Delegation is explicit rather than prototype-based: the wrapper forwards each
|
|
69651
|
+
* method to the real span, so the exporter keeps tracking the span it created
|
|
69652
|
+
* and no call depends on `this` binding surviving the indirection.
|
|
69653
|
+
*/
|
|
69654
|
+
const wrapSpan = (span) => ({
|
|
69655
|
+
_tag: "Span",
|
|
69656
|
+
get name() {
|
|
69657
|
+
return span.name;
|
|
69658
|
+
},
|
|
69659
|
+
get spanId() {
|
|
69660
|
+
return span.spanId;
|
|
69661
|
+
},
|
|
69662
|
+
get traceId() {
|
|
69663
|
+
return span.traceId;
|
|
69664
|
+
},
|
|
69665
|
+
get parent() {
|
|
69666
|
+
return span.parent;
|
|
69667
|
+
},
|
|
69668
|
+
get annotations() {
|
|
69669
|
+
return span.annotations;
|
|
69670
|
+
},
|
|
69671
|
+
get status() {
|
|
69672
|
+
return span.status;
|
|
69673
|
+
},
|
|
69674
|
+
get attributes() {
|
|
69675
|
+
return span.attributes;
|
|
69676
|
+
},
|
|
69677
|
+
get links() {
|
|
69678
|
+
return span.links;
|
|
69679
|
+
},
|
|
69680
|
+
get sampled() {
|
|
69681
|
+
return span.sampled;
|
|
69682
|
+
},
|
|
69683
|
+
get kind() {
|
|
69684
|
+
return span.kind;
|
|
69685
|
+
},
|
|
69686
|
+
end: (endTime, exit) => {
|
|
69687
|
+
span.end(endTime, scrubExit(exit));
|
|
69688
|
+
},
|
|
69689
|
+
attribute: (key, value) => {
|
|
69690
|
+
span.attribute(key, scrubValue(value));
|
|
69691
|
+
},
|
|
69692
|
+
event: (name, startTime, attributes) => {
|
|
69693
|
+
span.event(anonymizeText(name), startTime, scrubAttributes(attributes));
|
|
69694
|
+
},
|
|
69695
|
+
addLinks: (links) => {
|
|
69696
|
+
span.addLinks(links);
|
|
69697
|
+
}
|
|
69698
|
+
});
|
|
69699
|
+
/**
|
|
69700
|
+
* Wraps a tracer so span names, attributes, and event payloads are anonymized
|
|
69701
|
+
* on the way to the exporter.
|
|
69702
|
+
*
|
|
69703
|
+
* This is the OTLP replacement for Sentry's `beforeSendTransaction` hook. OTLP
|
|
69704
|
+
* exporters have no equivalent interception point, so without this the only
|
|
69705
|
+
* thing standing between a raw filesystem path and the wire would be every
|
|
69706
|
+
* individual call site remembering to scrub — which is exactly the guarantee
|
|
69707
|
+
* the Sentry scrubber existed to stop relying on. Call sites should still scrub
|
|
69708
|
+
* at the source; this is the backstop for the ones that don't, including any
|
|
69709
|
+
* added later.
|
|
69710
|
+
*/
|
|
69711
|
+
const makeScrubbingTracer = (underlying) => make$33({
|
|
69712
|
+
span: (options) => wrapSpan(underlying.span({
|
|
69713
|
+
...options,
|
|
69714
|
+
name: anonymizeText(options.name)
|
|
69715
|
+
})),
|
|
69716
|
+
...underlying.context ? { context: underlying.context } : {}
|
|
69717
|
+
});
|
|
68357
69718
|
const TRACER_PROJECT_NAME = "react-doctor";
|
|
69719
|
+
/**
|
|
69720
|
+
* Replaces an exporter layer's `Tracer` with a scrubbing wrapper around it.
|
|
69721
|
+
*
|
|
69722
|
+
* OTLP has no `beforeSend`-style interception point, so this is the one place
|
|
69723
|
+
* every exported span is guaranteed to pass through. Applied to the telemetry
|
|
69724
|
+
* layers rather than to individual call sites so an attribute added later can't
|
|
69725
|
+
* quietly bypass it.
|
|
69726
|
+
*/
|
|
69727
|
+
const withScrubbedSpans = (exporter) => effect(Tracer, map$3(service(Tracer), makeScrubbingTracer)).pipe(provideMerge(exporter));
|
|
68358
69728
|
const OTEL_ENDPOINT = string("REACT_DOCTOR_OTLP_ENDPOINT").pipe(option);
|
|
68359
69729
|
const OTEL_AUTH_HEADER = redacted("REACT_DOCTOR_OTLP_AUTH_HEADER").pipe(option);
|
|
68360
69730
|
/**
|
|
68361
|
-
*
|
|
69731
|
+
* Bring-your-own OpenTelemetry layer. The default `Effect.fn(...)` spans
|
|
68362
69732
|
* already populate the in-process tracer; this layer plugs an OTLP
|
|
68363
69733
|
* HTTP exporter into the runtime when the user opts in via:
|
|
68364
69734
|
*
|
|
@@ -68374,7 +69744,7 @@ const OTEL_AUTH_HEADER = redacted("REACT_DOCTOR_OTLP_AUTH_HEADER").pipe(option);
|
|
|
68374
69744
|
* inspect / diagnose orchestrators always run, this layer just
|
|
68375
69745
|
* dictates whether the spans they emit get shipped to a backend.
|
|
68376
69746
|
*/
|
|
68377
|
-
const
|
|
69747
|
+
const layerUserOtlp = unwrap$3(gen(function* () {
|
|
68378
69748
|
const endpoint = yield* OTEL_ENDPOINT;
|
|
68379
69749
|
const authHeader = yield* OTEL_AUTH_HEADER;
|
|
68380
69750
|
if (endpoint._tag === "None" || authHeader._tag === "None") return empty$7;
|
|
@@ -68386,6 +69756,85 @@ const layerOtlp = unwrap$3(gen(function* () {
|
|
|
68386
69756
|
}).pipe(provide$2(layer$8));
|
|
68387
69757
|
}).pipe(orDie));
|
|
68388
69758
|
/**
|
|
69759
|
+
* First-party telemetry export to Axiom.
|
|
69760
|
+
*
|
|
69761
|
+
* Composes the tracer and metrics exporters by hand rather than using
|
|
69762
|
+
* `Otlp.layer`, because Axiom routes each signal to a different dataset via a
|
|
69763
|
+
* different header (see `AXIOM_DATASET_HEADER` / `AXIOM_METRICS_DATASET_HEADER`)
|
|
69764
|
+
* and `Otlp.layer` passes one `headers` object to every signal. Logs are
|
|
69765
|
+
* deliberately not wired up — nothing in the engine emits `Effect.log` as
|
|
69766
|
+
* telemetry today.
|
|
69767
|
+
*
|
|
69768
|
+
* Serialization is protobuf, not JSON: Axiom's `/v1/metrics` accepts
|
|
69769
|
+
* `application/x-protobuf` only. `layerProtobuf` ships with Effect and pulls in
|
|
69770
|
+
* no extra dependency.
|
|
69771
|
+
*
|
|
69772
|
+
* Traces and metrics are exposed as separate layers so each signal's exporter
|
|
69773
|
+
* can be reasoned about on its own, and `layerObservability` merges them for the
|
|
69774
|
+
* normal case. Whichever you use, build it **exactly once per process**:
|
|
69775
|
+
* Effect's delta-temporality bookkeeping lives on the metrics exporter
|
|
69776
|
+
* instance, so a second one starts with no previous state and re-reports every
|
|
69777
|
+
* counter's full value as its delta — double-counting everything.
|
|
69778
|
+
*/
|
|
69779
|
+
const buildResource = (options) => ({
|
|
69780
|
+
serviceName: TRACER_PROJECT_NAME,
|
|
69781
|
+
serviceVersion: options.serviceVersion
|
|
69782
|
+
});
|
|
69783
|
+
const buildAuthorization = (options) => `Bearer ${value(options.token)}`;
|
|
69784
|
+
const normalizeDomain = (domain) => {
|
|
69785
|
+
let end = domain.length;
|
|
69786
|
+
while (end > 0 && domain.charCodeAt(end - 1) === 47) end -= 1;
|
|
69787
|
+
return domain.slice(0, end);
|
|
69788
|
+
};
|
|
69789
|
+
const layerAxiomTraces = (options) => layer$4({
|
|
69790
|
+
url: `${normalizeDomain(options.domain)}${AXIOM_TRACES_PATH}`,
|
|
69791
|
+
resource: buildResource(options),
|
|
69792
|
+
headers: {
|
|
69793
|
+
Authorization: buildAuthorization(options),
|
|
69794
|
+
[AXIOM_DATASET_HEADER]: options.tracesDataset
|
|
69795
|
+
},
|
|
69796
|
+
exportInterval: options.exportIntervalMs ?? 6e5,
|
|
69797
|
+
shutdownTimeout: TELEMETRY_SHUTDOWN_TIMEOUT_MS
|
|
69798
|
+
}).pipe(provide$2(layerProtobuf), provide$2(layer$8), withScrubbedSpans);
|
|
69799
|
+
/**
|
|
69800
|
+
* Metrics exporter. Instantiate **once per process** — see the double-counting
|
|
69801
|
+
* note above. Delta temporality is still the right choice for a short-lived CLI:
|
|
69802
|
+
* cumulative reports totals since a fixed start time, which for a process that
|
|
69803
|
+
* lives a few seconds is just the run total reported against a meaningless
|
|
69804
|
+
* window.
|
|
69805
|
+
*/
|
|
69806
|
+
const layerAxiomMetrics = (options) => layer$5({
|
|
69807
|
+
url: `${normalizeDomain(options.domain)}${AXIOM_METRICS_PATH}`,
|
|
69808
|
+
resource: buildResource(options),
|
|
69809
|
+
headers: {
|
|
69810
|
+
Authorization: buildAuthorization(options),
|
|
69811
|
+
[AXIOM_METRICS_DATASET_HEADER]: options.metricsDataset
|
|
69812
|
+
},
|
|
69813
|
+
exportInterval: options.exportIntervalMs ?? 6e5,
|
|
69814
|
+
shutdownTimeout: TELEMETRY_SHUTDOWN_TIMEOUT_MS,
|
|
69815
|
+
temporality: "delta"
|
|
69816
|
+
}).pipe(provide$2(layerProtobuf), provide$2(layer$8));
|
|
69817
|
+
/**
|
|
69818
|
+
* The first-party telemetry layer: spans and metrics together.
|
|
69819
|
+
*
|
|
69820
|
+
* A user-configured OTLP endpoint wins over first-party Axiom: Effect has one
|
|
69821
|
+
* `Tracer` reference, so the two are mutually exclusive, and someone who went to
|
|
69822
|
+
* the trouble of pointing React Doctor at their own collector meant it.
|
|
69823
|
+
* Passing `null` (or omitting options) disables first-party export entirely,
|
|
69824
|
+
* which is how `--no-telemetry` and every library consumer stay silent.
|
|
69825
|
+
*
|
|
69826
|
+
* Build this **once per process** and share the resulting context — see
|
|
69827
|
+
* `telemetry-runtime.ts`. Effect keeps delta-temporality state on the metrics
|
|
69828
|
+
* exporter instance, so a second build starts with no previous snapshot and
|
|
69829
|
+
* re-reports every counter's full value, doubling every metric.
|
|
69830
|
+
*/
|
|
69831
|
+
const layerObservability = (options = null) => unwrap$3(gen(function* () {
|
|
69832
|
+
const endpoint = yield* OTEL_ENDPOINT;
|
|
69833
|
+
const authHeader = yield* OTEL_AUTH_HEADER;
|
|
69834
|
+
if (endpoint._tag !== "None" && authHeader._tag !== "None") return layerUserOtlp;
|
|
69835
|
+
return options === null ? empty$7 : merge$3(layerAxiomTraces(options), layerAxiomMetrics(options));
|
|
69836
|
+
}).pipe(orDie));
|
|
69837
|
+
/**
|
|
68389
69838
|
* Read a positive-millisecond timeout from an env var, falling back to
|
|
68390
69839
|
* `defaultMs` when the var is unset, non-finite, or not strictly positive.
|
|
68391
69840
|
*/
|
|
@@ -73828,149 +75277,6 @@ const mapPreparedSourceLabels = (labels, preparedSourceMap) => {
|
|
|
73828
75277
|
}
|
|
73829
75278
|
return mappedLabels;
|
|
73830
75279
|
};
|
|
73831
|
-
const REDACTED_PLACEHOLDER = "<redacted>";
|
|
73832
|
-
const KEEP_PREFIX = `$1${REDACTED_PLACEHOLDER}`;
|
|
73833
|
-
const KNOWN_SECRET_RULES = [
|
|
73834
|
-
{
|
|
73835
|
-
pattern: /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?-----END [A-Z ]*PRIVATE KEY-----/g,
|
|
73836
|
-
replacement: REDACTED_PLACEHOLDER
|
|
73837
|
-
},
|
|
73838
|
-
{
|
|
73839
|
-
pattern: /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,
|
|
73840
|
-
replacement: REDACTED_PLACEHOLDER
|
|
73841
|
-
},
|
|
73842
|
-
{
|
|
73843
|
-
pattern: /(?<=:\/\/)[^\s/:@]+:[^\s/@]+(?=@)/g,
|
|
73844
|
-
replacement: REDACTED_PLACEHOLDER
|
|
73845
|
-
},
|
|
73846
|
-
{
|
|
73847
|
-
pattern: /\b(AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA|A3T[A-Z0-9])[0-9A-Z]{16,}/g,
|
|
73848
|
-
replacement: KEEP_PREFIX
|
|
73849
|
-
},
|
|
73850
|
-
{
|
|
73851
|
-
pattern: /\b(gh[pousr]_)[A-Za-z0-9]{36,}/g,
|
|
73852
|
-
replacement: KEEP_PREFIX
|
|
73853
|
-
},
|
|
73854
|
-
{
|
|
73855
|
-
pattern: /\b(github_pat_)[A-Za-z0-9_]{22,}/g,
|
|
73856
|
-
replacement: KEEP_PREFIX
|
|
73857
|
-
},
|
|
73858
|
-
{
|
|
73859
|
-
pattern: /\b(glpat-)[A-Za-z0-9_-]{20,}/g,
|
|
73860
|
-
replacement: KEEP_PREFIX
|
|
73861
|
-
},
|
|
73862
|
-
{
|
|
73863
|
-
pattern: /\b(xox[baprs]-)[A-Za-z0-9-]{10,}/g,
|
|
73864
|
-
replacement: KEEP_PREFIX
|
|
73865
|
-
},
|
|
73866
|
-
{
|
|
73867
|
-
pattern: /(?<=hooks\.slack\.com\/services\/)[A-Za-z0-9/+_-]{20,}/g,
|
|
73868
|
-
replacement: REDACTED_PLACEHOLDER
|
|
73869
|
-
},
|
|
73870
|
-
{
|
|
73871
|
-
pattern: /\b((?:sk|rk)_(?:live|test)_)[0-9A-Za-z]{10,}/g,
|
|
73872
|
-
replacement: KEEP_PREFIX
|
|
73873
|
-
},
|
|
73874
|
-
{
|
|
73875
|
-
pattern: /\b(sk-(?:proj-|ant-)?)[A-Za-z0-9_-]{20,}/g,
|
|
73876
|
-
replacement: KEEP_PREFIX
|
|
73877
|
-
},
|
|
73878
|
-
{
|
|
73879
|
-
pattern: /\b(AIza)[0-9A-Za-z_-]{35,}/g,
|
|
73880
|
-
replacement: KEEP_PREFIX
|
|
73881
|
-
},
|
|
73882
|
-
{
|
|
73883
|
-
pattern: /\b(ya29\.)[0-9A-Za-z_-]{20,}/g,
|
|
73884
|
-
replacement: KEEP_PREFIX
|
|
73885
|
-
},
|
|
73886
|
-
{
|
|
73887
|
-
pattern: /\b(npm_)[A-Za-z0-9]{36,}/g,
|
|
73888
|
-
replacement: KEEP_PREFIX
|
|
73889
|
-
},
|
|
73890
|
-
{
|
|
73891
|
-
pattern: /\b(SG\.)[A-Za-z0-9_-]{22,}\.[A-Za-z0-9_-]{43,}/g,
|
|
73892
|
-
replacement: KEEP_PREFIX
|
|
73893
|
-
},
|
|
73894
|
-
{
|
|
73895
|
-
pattern: /\b(SK)[0-9a-fA-F]{32,}/g,
|
|
73896
|
-
replacement: KEEP_PREFIX
|
|
73897
|
-
},
|
|
73898
|
-
{
|
|
73899
|
-
pattern: /\b(dop_v1_)[a-f0-9]{64,}/g,
|
|
73900
|
-
replacement: KEEP_PREFIX
|
|
73901
|
-
},
|
|
73902
|
-
{
|
|
73903
|
-
pattern: /\b(shp(?:at|ca|pa|ss)_)[a-fA-F0-9]{32,}/g,
|
|
73904
|
-
replacement: KEEP_PREFIX
|
|
73905
|
-
},
|
|
73906
|
-
{
|
|
73907
|
-
pattern: /\b(sq0[a-z]{3}-)[0-9A-Za-z_-]{22,}/g,
|
|
73908
|
-
replacement: KEEP_PREFIX
|
|
73909
|
-
},
|
|
73910
|
-
{
|
|
73911
|
-
pattern: /\b([0-9]{8,10}:AA)[0-9A-Za-z_-]{32,}/g,
|
|
73912
|
-
replacement: KEEP_PREFIX
|
|
73913
|
-
},
|
|
73914
|
-
{
|
|
73915
|
-
pattern: /(?<=\bBearer\s)[A-Za-z0-9._~+/=-]{16,}/g,
|
|
73916
|
-
replacement: REDACTED_PLACEHOLDER
|
|
73917
|
-
},
|
|
73918
|
-
{
|
|
73919
|
-
pattern: /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,
|
|
73920
|
-
replacement: REDACTED_PLACEHOLDER
|
|
73921
|
-
}
|
|
73922
|
-
];
|
|
73923
|
-
const CANDIDATE_TOKEN_PATTERN = /[A-Za-z0-9_][A-Za-z0-9_-]*/g;
|
|
73924
|
-
const HEX_DIGEST_PATTERN = /^(?:[0-9a-f]{32}|[0-9a-f]{40}|[0-9a-f]{64})$/;
|
|
73925
|
-
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
73926
|
-
const HAS_LETTER_PATTERN = /[A-Za-z]/;
|
|
73927
|
-
const HAS_DIGIT_PATTERN = /[0-9]/;
|
|
73928
|
-
const shannonEntropyBits = (value) => {
|
|
73929
|
-
const counts = /* @__PURE__ */ new Map();
|
|
73930
|
-
for (const char of value) counts.set(char, (counts.get(char) ?? 0) + 1);
|
|
73931
|
-
let bits = 0;
|
|
73932
|
-
for (const count of counts.values()) {
|
|
73933
|
-
const probability = count / value.length;
|
|
73934
|
-
bits -= probability * Math.log2(probability);
|
|
73935
|
-
}
|
|
73936
|
-
return bits;
|
|
73937
|
-
};
|
|
73938
|
-
const looksLikeHighEntropySecret = (token) => {
|
|
73939
|
-
if (token.length < 32) return false;
|
|
73940
|
-
if (!HAS_LETTER_PATTERN.test(token) || !HAS_DIGIT_PATTERN.test(token)) return false;
|
|
73941
|
-
if (HEX_DIGEST_PATTERN.test(token) || UUID_PATTERN.test(token)) return false;
|
|
73942
|
-
return shannonEntropyBits(token) >= 3;
|
|
73943
|
-
};
|
|
73944
|
-
const redactHighEntropyTokens = (text) => text.replace(CANDIDATE_TOKEN_PATTERN, (token) => looksLikeHighEntropySecret(token) ? REDACTED_PLACEHOLDER : token);
|
|
73945
|
-
/**
|
|
73946
|
-
* Masks API keys, tokens, private keys, credentialed URLs, and emails
|
|
73947
|
-
* found anywhere inside a free-text string, returning the scrubbed text.
|
|
73948
|
-
* Applied to every diagnostic's `message` / `help` at construction time
|
|
73949
|
-
* so secrets never reach the terminal, the JSON report, or the score
|
|
73950
|
-
* API — react-doctor must never echo or transmit a user's secrets.
|
|
73951
|
-
*
|
|
73952
|
-
* Provider tokens keep their non-secret, type-identifying prefix (e.g.
|
|
73953
|
-
* `sk_live_<redacted>`, `ghp_<redacted>`, `AKIA<redacted>`) so the leaked
|
|
73954
|
-
* credential's type stays visible; structural or unknown-format secrets
|
|
73955
|
-
* with no meaningful prefix are masked whole.
|
|
73956
|
-
*
|
|
73957
|
-
* Runs the high-precision known-shape detectors first, then a generic
|
|
73958
|
-
* entropy-gated sweep for unknown-format secrets. Idempotent: the inert
|
|
73959
|
-
* `<redacted>` placeholder matches none of the detectors and is too
|
|
73960
|
-
* short for the generic sweep, so re-running leaves the text unchanged.
|
|
73961
|
-
*
|
|
73962
|
-
* Accepts `unknown` on purpose: callers feed it diagnostic `message` /
|
|
73963
|
-
* `help` that originate from oxlint JSON, which is only shape-checked at
|
|
73964
|
-
* the top level (the per-field `string` types are assumed, not validated).
|
|
73965
|
-
* A malformed non-string value returns `""` instead of throwing on
|
|
73966
|
-
* `.replace`, so one bad diagnostic can't abort parsing the whole batch.
|
|
73967
|
-
*/
|
|
73968
|
-
const redactSensitiveText = (text) => {
|
|
73969
|
-
if (typeof text !== "string" || text === "") return "";
|
|
73970
|
-
let redacted = text;
|
|
73971
|
-
for (const rule of KNOWN_SECRET_RULES) redacted = redacted.replace(rule.pattern, rule.replacement);
|
|
73972
|
-
return redactHighEntropyTokens(redacted);
|
|
73973
|
-
};
|
|
73974
75280
|
const REACT_MODULE_SOURCE = "react";
|
|
73975
75281
|
const REQUIRE_IDENTIFIER = "require";
|
|
73976
75282
|
const USE_IDENTIFIER = "use";
|
|
@@ -76050,7 +77356,7 @@ var Linter = class Linter extends Service()("react-doctor/Linter") {
|
|
|
76050
77356
|
static layerComposite = (backends) => succeed$3(Linter, Linter.of({ run: (input) => {
|
|
76051
77357
|
if (backends.length === 0) return empty$4;
|
|
76052
77358
|
let diagnostics = backends[0].run(input);
|
|
76053
|
-
for (let index = 1; index < backends.length; index++) diagnostics = diagnostics.pipe(concat(backends[index].run(input)));
|
|
77359
|
+
for (let index = 1; index < backends.length; index++) diagnostics = diagnostics.pipe(concat$1(backends[index].run(input)));
|
|
76054
77360
|
return diagnostics;
|
|
76055
77361
|
} }));
|
|
76056
77362
|
};
|
|
@@ -76164,14 +77470,6 @@ var Reporter = class Reporter extends Service()("react-doctor/Reporter") {
|
|
|
76164
77470
|
});
|
|
76165
77471
|
}));
|
|
76166
77472
|
};
|
|
76167
|
-
const HOME_DIRECTORY = os.homedir();
|
|
76168
|
-
const USER_HOME_PATTERNS = [/[A-Za-z]:[\\/]Users[\\/][^\\/]+/gi, /(?:\/Users\/|\/home\/)[^/\\]+/gi];
|
|
76169
|
-
const scrubSensitivePaths = (text) => {
|
|
76170
|
-
let scrubbed = text;
|
|
76171
|
-
if (HOME_DIRECTORY.length > 1) scrubbed = scrubbed.split(HOME_DIRECTORY).join("~");
|
|
76172
|
-
for (const pattern of USER_HOME_PATTERNS) scrubbed = scrubbed.replace(pattern, "~");
|
|
76173
|
-
return scrubbed;
|
|
76174
|
-
};
|
|
76175
77473
|
const ScoreApiResponseSchema = Struct({
|
|
76176
77474
|
score: Number$1,
|
|
76177
77475
|
label: String$1,
|
|
@@ -77133,7 +78431,7 @@ const runInspect = (input, hooks = {}) => gen(function* () {
|
|
|
77133
78431
|
suppressedRuleCounts: transform.summarizeSuppressions()
|
|
77134
78432
|
};
|
|
77135
78433
|
}).pipe(withSpan("runInspect", { attributes: {
|
|
77136
|
-
"inspect.directory": input.directory,
|
|
78434
|
+
"inspect.directory": scrubSensitivePaths(input.directory),
|
|
77137
78435
|
"inspect.includePathCount": input.includePaths.length,
|
|
77138
78436
|
"inspect.runDeadCode": input.runDeadCode,
|
|
77139
78437
|
"inspect.isCi": input.isCi,
|
|
@@ -78080,9 +79378,32 @@ const CI_TRUST_COMPANIES = "PayPal, Rippling, and Alibaba";
|
|
|
78080
79378
|
const MINIMUM_VTE_VERSION_FOR_HYPERLINKS = 5e3;
|
|
78081
79379
|
const INTERNAL_ERROR_JSON_FALLBACK = "{\"schemaVersion\":3,\"version\":\"unknown\",\"ok\":false,\"directory\":\"\",\"mode\":\"full\",\"diff\":null,\"projects\":[],\"diagnostics\":[],\"summary\":{\"errorCount\":0,\"warningCount\":0,\"affectedFileCount\":0,\"totalDiagnosticCount\":0,\"score\":null,\"scoreLabel\":null},\"elapsedMilliseconds\":0,\"error\":{\"message\":\"Internal error\",\"name\":\"Error\",\"chain\":[]}}\n";
|
|
78082
79380
|
const SENTRY_DSN = "https://f253d570240a59b8dbd77b7a548ef133@o4510226365743104.ingest.us.sentry.io/4511487817809920";
|
|
79381
|
+
const AXIOM_INGEST_TOKEN = "xaat-31b59107-855d-4917-8fab-6dc29fb459ce";
|
|
79382
|
+
const NANOSECONDS_PER_MILLISECOND = 1000000n;
|
|
79383
|
+
const AXIOM_TRACES_DATASET = "react-doctor";
|
|
79384
|
+
const AXIOM_METRICS_DATASET = "react-doctor-metrics";
|
|
78083
79385
|
const SENTRY_RELEASE_PREFIX = "react-doctor";
|
|
78084
79386
|
const SENTRY_FLUSH_TIMEOUT_MS = 2e3;
|
|
78085
|
-
const
|
|
79387
|
+
const METRIC_DISTRIBUTION_BOUNDARIES = [
|
|
79388
|
+
0,
|
|
79389
|
+
1,
|
|
79390
|
+
2,
|
|
79391
|
+
5,
|
|
79392
|
+
10,
|
|
79393
|
+
25,
|
|
79394
|
+
50,
|
|
79395
|
+
100,
|
|
79396
|
+
250,
|
|
79397
|
+
500,
|
|
79398
|
+
1e3,
|
|
79399
|
+
2500,
|
|
79400
|
+
5e3,
|
|
79401
|
+
1e4,
|
|
79402
|
+
3e4,
|
|
79403
|
+
6e4,
|
|
79404
|
+
3e5,
|
|
79405
|
+
6e5
|
|
79406
|
+
];
|
|
78086
79407
|
const METRIC = {
|
|
78087
79408
|
cliInvoked: "cli.invoked",
|
|
78088
79409
|
cliError: "cli.error",
|
|
@@ -78182,7 +79503,7 @@ const makeNoopConsole = () => ({
|
|
|
78182
79503
|
});
|
|
78183
79504
|
//#endregion
|
|
78184
79505
|
//#region src/cli/utils/version.ts
|
|
78185
|
-
const VERSION = "0.9.
|
|
79506
|
+
const VERSION = "0.9.9-dev.e69faca";
|
|
78186
79507
|
//#endregion
|
|
78187
79508
|
//#region src/cli/utils/json-mode.ts
|
|
78188
79509
|
let context = null;
|
|
@@ -78274,10 +79595,12 @@ const getRunId = () => {
|
|
|
78274
79595
|
};
|
|
78275
79596
|
//#endregion
|
|
78276
79597
|
//#region src/cli/utils/build-run-context.ts
|
|
79598
|
+
const LSP_COMMAND = "experimental-lsp";
|
|
78277
79599
|
const ROOT_SUBCOMMANDS = new Set([
|
|
78278
79600
|
"design",
|
|
78279
79601
|
"install",
|
|
78280
|
-
"setup"
|
|
79602
|
+
"setup",
|
|
79603
|
+
LSP_COMMAND
|
|
78281
79604
|
]);
|
|
78282
79605
|
const detectInvokedVia = () => {
|
|
78283
79606
|
const userAgent = process.env.npm_config_user_agent;
|
|
@@ -78288,7 +79611,8 @@ const detectNodeMajor = () => {
|
|
|
78288
79611
|
const major = Number.parseInt(process.versions.node.split(".", 1)[0] ?? "", 10);
|
|
78289
79612
|
return Number.isNaN(major) ? 0 : major;
|
|
78290
79613
|
};
|
|
78291
|
-
const detectOrigin = () => {
|
|
79614
|
+
const detectOrigin = (userArguments) => {
|
|
79615
|
+
if (detectCommand(userArguments) === LSP_COMMAND) return "lsp";
|
|
78292
79616
|
if (isGitHookEnvironment()) return "git-hook";
|
|
78293
79617
|
if (isCodingAgentEnvironment()) return "agent";
|
|
78294
79618
|
if (isCiEnvironment()) return "ci";
|
|
@@ -78315,7 +79639,7 @@ const buildRunContext = () => {
|
|
|
78315
79639
|
return {
|
|
78316
79640
|
version: VERSION,
|
|
78317
79641
|
runId: getRunId(),
|
|
78318
|
-
origin: detectOrigin(),
|
|
79642
|
+
origin: detectOrigin(userArguments),
|
|
78319
79643
|
command: detectCommand(userArguments),
|
|
78320
79644
|
argv: scrubSensitivePaths(userArguments.join(" ")),
|
|
78321
79645
|
cwd: scrubSensitivePaths(process.cwd()),
|
|
@@ -78424,6 +79748,31 @@ const buildSentryScope = (runContext = buildRunContext()) => {
|
|
|
78424
79748
|
};
|
|
78425
79749
|
};
|
|
78426
79750
|
//#endregion
|
|
79751
|
+
//#region src/cli/utils/is-env-flag-enabled.ts
|
|
79752
|
+
const isEnvFlagEnabled = (value) => value === "1" || value?.toLowerCase() === "true";
|
|
79753
|
+
//#endregion
|
|
79754
|
+
//#region src/cli/utils/is-telemetry-enabled.ts
|
|
79755
|
+
/**
|
|
79756
|
+
* Whether this process may emit telemetry of any kind — Sentry crash reports and
|
|
79757
|
+
* Axiom traces/metrics alike.
|
|
79758
|
+
*
|
|
79759
|
+
* Reads raw `process.argv` rather than parsed Commander options because the
|
|
79760
|
+
* decision is needed before the CLI parses its arguments (Sentry initializes as
|
|
79761
|
+
* the first statement of `cli/index.ts`).
|
|
79762
|
+
*
|
|
79763
|
+
* `REACT_DOCTOR_NO_TELEMETRY` was previously honored only by the language
|
|
79764
|
+
* server. It applies to the CLI too, which is what lets this repo's own tooling
|
|
79765
|
+
* — the benchmark harness and the delta-audit runner — keep their scans out of
|
|
79766
|
+
* production telemetry now that disabling Sentry alone no longer silences
|
|
79767
|
+
* everything.
|
|
79768
|
+
*/
|
|
79769
|
+
const isTelemetryEnabled = () => {
|
|
79770
|
+
if (process.argv.includes("--no-score") || process.argv.includes("--no-telemetry")) return false;
|
|
79771
|
+
if (isEnvFlagEnabled(process.env.REACT_DOCTOR_NO_TELEMETRY)) return false;
|
|
79772
|
+
if (process.env.VITEST || process.env.NODE_ENV === "test") return false;
|
|
79773
|
+
return true;
|
|
79774
|
+
};
|
|
79775
|
+
//#endregion
|
|
78427
79776
|
//#region src/cli/utils/to-span-attributes.ts
|
|
78428
79777
|
/**
|
|
78429
79778
|
* Converts a Sentry tag map (which permits `null`/`undefined` to denote an
|
|
@@ -78438,38 +79787,48 @@ const toSpanAttributes = (tags) => {
|
|
|
78438
79787
|
};
|
|
78439
79788
|
//#endregion
|
|
78440
79789
|
//#region src/cli/utils/record-metric.ts
|
|
78441
|
-
const withRunAttributes = (attributes) =>
|
|
78442
|
-
|
|
78443
|
-
|
|
78444
|
-
})
|
|
79790
|
+
const withRunAttributes = (attributes) => {
|
|
79791
|
+
const merged = {
|
|
79792
|
+
...toSpanAttributes(buildSentryScope().tags),
|
|
79793
|
+
...toSpanAttributes(attributes ?? {})
|
|
79794
|
+
};
|
|
79795
|
+
const stringified = {};
|
|
79796
|
+
for (const [key, value] of Object.entries(merged)) stringified[key] = typeof value === "string" ? anonymizeText(value) : String(value);
|
|
79797
|
+
return stringified;
|
|
79798
|
+
};
|
|
78445
79799
|
/**
|
|
78446
|
-
* Emits a
|
|
78447
|
-
*
|
|
78448
|
-
*
|
|
78449
|
-
*
|
|
78450
|
-
*
|
|
79800
|
+
* Emits a counter into Effect's metric registry, where the OTLP exporter picks
|
|
79801
|
+
* it up at flush time.
|
|
79802
|
+
*
|
|
79803
|
+
* A guarded, swallow-on-throw no-op unless telemetry is enabled, so it's inert
|
|
79804
|
+
* under `--no-score` / `--no-telemetry`, in tests, and for the programmatic
|
|
79805
|
+
* `@react-doctor/api` library. Counters are independent of trace sampling, so
|
|
79806
|
+
* they are still recorded when tracing is off.
|
|
78451
79807
|
*/
|
|
78452
79808
|
const recordCount = (name, value = 1, attributes) => {
|
|
78453
|
-
if (!
|
|
79809
|
+
if (!isTelemetryEnabled()) return;
|
|
78454
79810
|
try {
|
|
78455
|
-
|
|
79811
|
+
counter(name).pipe(withAttributes(withRunAttributes(attributes))).updateUnsafe(value, empty$8());
|
|
78456
79812
|
} catch {}
|
|
78457
79813
|
};
|
|
78458
79814
|
/**
|
|
78459
|
-
* Emits a
|
|
78460
|
-
*
|
|
79815
|
+
* Emits a distribution (value ranges — durations, sizes, scores). Same gating
|
|
79816
|
+
* and run-attribute handling as {@link recordCount}.
|
|
79817
|
+
*
|
|
79818
|
+
* `unit` is recorded as an attribute rather than as OTLP metric metadata:
|
|
79819
|
+
* Effect's histogram carries no unit field, and keeping the millisecond/count
|
|
79820
|
+
* distinction queryable matters more than where it is stored.
|
|
78461
79821
|
*/
|
|
78462
79822
|
const recordDistribution = (name, value, options = {}) => {
|
|
78463
|
-
if (!
|
|
79823
|
+
if (!isTelemetryEnabled()) return;
|
|
78464
79824
|
try {
|
|
78465
|
-
|
|
78466
|
-
|
|
78467
|
-
|
|
78468
|
-
});
|
|
79825
|
+
const attributes = withRunAttributes(options.attributes);
|
|
79826
|
+
if (options.unit) attributes.unit = options.unit;
|
|
79827
|
+
histogram(name, { boundaries: METRIC_DISTRIBUTION_BOUNDARIES }).pipe(withAttributes(attributes)).updateUnsafe(value, empty$8());
|
|
78469
79828
|
} catch {}
|
|
78470
79829
|
};
|
|
78471
79830
|
//#endregion
|
|
78472
|
-
export {
|
|
79831
|
+
export { CONFIG_SCHEMA_URL as $, orElseSucceed as $n, getCategoryImpact as $t, SCAN_RESULT_CACHE_MAX_HASHED_FILE_SIZE_BYTES as A, resolveReactDoctorCacheDir as An, anonymizeInPlace as At, isGitHookEnvironment as B, validateConfigTypes as Bn, computeConfigFingerprint as Bt, GH_DEFAULT_BRANCH_PROBE_TIMEOUT_MS as C, mapWithConcurrency as Cn, SHARE_BASE_URL as Ct, REACT_DOCTOR_CONFIG_PROJECT_NAME as D, remainingDeadlineBudgetMs as Dn, SidecarLintCacheEnabled as Dt, NANOSECONDS_PER_MILLISECOND as E, messageFromUnknown as En, Score as Et, STAGED_SNAPSHOT_ADDITIONAL_CONFIG_FILENAMES as F, scrubSensitivePaths as Fn, buildSkippedChecks as Ft, isCiOrCodingAgentEnvironment as G, log as Gn, discoverReactSubprojects as Gt, ACTION_INPUT_ENVIRONMENT_VARIABLES as H, Console as Hn, createNodeReadFileLinesSync as Ht, TUI_REPORT_COMPACT_MAX_ROWS as I, setColorEnabled as In, calculateScore as It, CANONICAL_DISCORD_URL as J, decodeUnknownSync as Jn, filterSourceFiles as Jt, isCodingAgentEnvironment as K, warn$1 as Kn, filterDiagnosticsForSurface as Kt, TUI_REPORT_DETAIL_WIDTH_FRACTION as L, summarizeDiagnostics as Ln, canonicalizeUserRuleKey as Lt, SENTRY_FLUSH_TIMEOUT_MS as M, resolveScanTarget as Mn, atomicWriteJson as Mt, SENTRY_RELEASE_PREFIX as N, restoreLegacyThrow as Nn, buildJsonReport as Nt, RUN_GIT_MAX_BUFFER_BYTES as O, resolveGithubActionsScoreMetadata as On, StagedFiles as Ot, STAGED_FILES_TEMP_DIR_PREFIX as P, runInspect as Pn, buildRuleDocsUrl as Pt, COMPILER_CLEANUP_RULE_KEYS as Q, map$3 as Qn, getBaselineDiffPlan as Qt, CliInputError as R, toCanonicalPath as Rn, clearConfigCache as Rt, CI_TRUST_COMPANIES as S, loadConfigWithSource as Sn, Reporter as St, MINIMUM_VTE_VERSION_FOR_HYPERLINKS as T, mergeReactDoctorConfigs as Tn, STAGED_FILES_PROJECT_CONFIG_FILENAMES as Tt, detectRunnerOs as U, error as Un, createOxlintSpawnSlots as Ut, isDebugFlagEnabled as V, yieldToEventLoop as Vn, computeDiagnosticDelta as Vt, isCiEnvironment as W, info as Wn, detectAiTrainingEnvironment as Wt, CI_URL as X, gen as Xn, formatErrorChain as Xt, CANONICAL_GITHUB_URL as Y, make$30 as Yn, findLegacyConfig as Yt, COMPILER_CLEANUP_BUCKET as Z, makeSpan$1 as Zn, formatReactDoctorError as Zt, makeNoopConsole as _, isSameRuleKey as _n, ParentSpan as _r, OxlintConcurrency as _t, isEnvFlagEnabled as a, hasPublishedFixRecipe as an, runSync as ar, Files as at, AXIOM_TRACES_DATASET as b, listSourceFiles as bn, Progress as bt, setSentryProjectInfo as c, highlighter as cn, void_ as cr, Git as ct, isJsonModeActive as d, isFile as dn, provide$2 as dr, LEGACY_CONFIG_FILENAME as dt, getChangedLineRanges as en, promise as er, Config as et, setJsonReportDirectory as f, isMonorepoRoot as fn, succeed$3 as fr, LintPartialFailures as ft, VERSION as g, isReactDoctorError as gn, void_$1 as gr, OXLINT_NODE_REQUIREMENT as gt, writeJsonReport as h, isProjectDiscoveryError as hn, fail$5 as hr, NodeResolver as ht, isTelemetryEnabled as i, groupBy as in, runPromise as ir, ENTERPRISE_CONTACT_URL as it, SENTRY_DSN as j, resolveScanConcurrency as jn, anonymizeText as jt, SCAN_RESULT_CACHE_FILENAME as k, resolveLintBatchOrdering as kn, SupplyChain as kt, getRunId as l, isDirectory as ln, buildWithScope as lr, HTML_FILE_PATTERN as lt, writeJsonErrorReport as m, isPlainObject as mn, makeUnsafe$5 as mr, MILLISECONDS_PER_SECOND as mt, recordDistribution as n, getDiffInfo as nn, provideContext as nr, DOCS_URL as nt, buildSentryScope as o, hasReactRuntime as on, sync as or, GITHUB_ACTIONS_SETUP_URL as ot, setJsonReportMode as p, isPathInsideDirectory as pn, close as pr, Linter as pt, AXIOM_DEFAULT_DOMAIN as q, Diagnostic as qn, filterPathsOutsideDirectories as qt, toSpanAttributes as r, getEquivalentRuleKeys as rn, provideService$2 as rr, DeadCode as rt, buildSentryProjectContext as s, hashFileContents as sn, try_ as sr, GIT_SHOW_MAX_BUFFER_BYTES as st, recordCount as t, getDiagnosticRuleIdentity as tn, provide as tr, DIAGNOSTIC_CATEGORY_BUCKETS as tt, enableJsonMode as u, isErrnoException as un, mergeAll$1 as ur, JSX_FILE_PATTERN as ut, AXIOM_INGEST_TOKEN as v, isScanComplete as vn, OxlintSpawnSlots as vt, METRIC as w, materializeSourceTree as wn, SKILL_NAME as wt, BASELINE_FILES_TEMP_DIR_PREFIX as x, listWorkspacePackages as xn, Project as xt, AXIOM_METRICS_DATASET as y, layerObservability as yn, PerFileLintCacheEnabled as yt, isNonInteractiveEnvironment as z, toRelativePath as zn, collectSourceFileCountsByDirectory as zt };
|
|
78473
79832
|
|
|
78474
|
-
//# sourceMappingURL=record-metric-
|
|
78475
|
-
//# debugId=
|
|
79833
|
+
//# sourceMappingURL=record-metric-BE4W9NsY.js.map
|
|
79834
|
+
//# debugId=11709fb0-7eca-5c5d-bdbd-68701ac41afd
|