@glasstrace/sdk 0.14.2 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +84 -1
  2. package/dist/adapters/drizzle.js +2 -5
  3. package/dist/adapters/drizzle.js.map +1 -1
  4. package/dist/{chunk-PD2SKFQQ.js → chunk-55FBXXER.js} +4 -8
  5. package/dist/{chunk-PD2SKFQQ.js.map → chunk-55FBXXER.js.map} +1 -1
  6. package/dist/chunk-5C2TJFLB.js +851 -0
  7. package/dist/chunk-5C2TJFLB.js.map +1 -0
  8. package/dist/{chunk-YMEXDDTA.js → chunk-7JBKXSBU.js} +3 -99
  9. package/dist/chunk-7JBKXSBU.js.map +1 -0
  10. package/dist/{chunk-2LDBR3F3.js → chunk-BANTDXUT.js} +15 -74
  11. package/dist/chunk-BANTDXUT.js.map +1 -0
  12. package/dist/{chunk-WV3NIPWJ.js → chunk-CTJI2YKA.js} +23 -288
  13. package/dist/chunk-CTJI2YKA.js.map +1 -0
  14. package/dist/{chunk-WK7MPK2T.js → chunk-DQ25VOKK.js} +1 -89
  15. package/dist/chunk-DQ25VOKK.js.map +1 -0
  16. package/dist/{chunk-BL3YDC6V.js → chunk-DXRZKKSO.js} +1 -6
  17. package/dist/{chunk-BL3YDC6V.js.map → chunk-DXRZKKSO.js.map} +1 -1
  18. package/dist/{chunk-BGZ7J74D.js → chunk-NSBPE2FW.js} +2 -16
  19. package/dist/chunk-O63DJKIJ.js +460 -0
  20. package/dist/chunk-O63DJKIJ.js.map +1 -0
  21. package/dist/{chunk-ECEN724Y.js → chunk-TM5NKZTO.js} +4 -8
  22. package/dist/{chunk-ECEN724Y.js.map → chunk-TM5NKZTO.js.map} +1 -1
  23. package/dist/chunk-VUZCLMIX.js +57 -0
  24. package/dist/chunk-VUZCLMIX.js.map +1 -0
  25. package/dist/{chunk-OSXIUKD5.js → chunk-WZXVS2EO.js} +1 -6
  26. package/dist/{chunk-OSXIUKD5.js.map → chunk-WZXVS2EO.js.map} +1 -1
  27. package/dist/{chunk-ARAOZCZT.js → chunk-XNDHQN4S.js} +122 -24
  28. package/dist/chunk-XNDHQN4S.js.map +1 -0
  29. package/dist/cli/init.cjs +1110 -255
  30. package/dist/cli/init.cjs.map +1 -1
  31. package/dist/cli/init.d.cts +86 -1
  32. package/dist/cli/init.d.ts +86 -1
  33. package/dist/cli/init.js +277 -66
  34. package/dist/cli/init.js.map +1 -1
  35. package/dist/cli/mcp-add.cjs +16 -16
  36. package/dist/cli/mcp-add.cjs.map +1 -1
  37. package/dist/cli/mcp-add.js +12 -13
  38. package/dist/cli/mcp-add.js.map +1 -1
  39. package/dist/cli/status.cjs +2 -2
  40. package/dist/cli/status.js +4 -7
  41. package/dist/cli/status.js.map +1 -1
  42. package/dist/cli/uninit.cjs +138 -20
  43. package/dist/cli/uninit.cjs.map +1 -1
  44. package/dist/cli/uninit.d.cts +38 -8
  45. package/dist/cli/uninit.d.ts +38 -8
  46. package/dist/cli/uninit.js +8 -5
  47. package/dist/cli/validate.cjs +135 -0
  48. package/dist/cli/validate.cjs.map +1 -0
  49. package/dist/cli/validate.d.cts +60 -0
  50. package/dist/cli/validate.d.ts +60 -0
  51. package/dist/cli/validate.js +100 -0
  52. package/dist/cli/validate.js.map +1 -0
  53. package/dist/{esm-MDK7CZID.js → esm-KBPHCVB4.js} +3 -3
  54. package/dist/{getMachineId-bsd-4NIRBWME.js → getMachineId-bsd-345PYXFX.js} +4 -7
  55. package/dist/{getMachineId-bsd-4NIRBWME.js.map → getMachineId-bsd-345PYXFX.js.map} +1 -1
  56. package/dist/{getMachineId-darwin-2XNOCCJQ.js → getMachineId-darwin-5L2D25AD.js} +4 -7
  57. package/dist/{getMachineId-darwin-2XNOCCJQ.js.map → getMachineId-darwin-5L2D25AD.js.map} +1 -1
  58. package/dist/{getMachineId-linux-V6YSQEY7.js → getMachineId-linux-KJR4P5HN.js} +3 -6
  59. package/dist/{getMachineId-linux-V6YSQEY7.js.map → getMachineId-linux-KJR4P5HN.js.map} +1 -1
  60. package/dist/{getMachineId-unsupported-4FKBJNVO.js → getMachineId-unsupported-NDNXDYDY.js} +3 -6
  61. package/dist/{getMachineId-unsupported-4FKBJNVO.js.map → getMachineId-unsupported-NDNXDYDY.js.map} +1 -1
  62. package/dist/{getMachineId-win-WLRZBKVG.js → getMachineId-win-T7PJNJXG.js} +4 -7
  63. package/dist/{getMachineId-win-WLRZBKVG.js.map → getMachineId-win-T7PJNJXG.js.map} +1 -1
  64. package/dist/index.cjs +519 -494
  65. package/dist/index.cjs.map +1 -1
  66. package/dist/index.d.cts +47 -6
  67. package/dist/index.d.ts +47 -6
  68. package/dist/index.js +250 -719
  69. package/dist/index.js.map +1 -1
  70. package/dist/{monorepo-YILKGQXQ.js → monorepo-N5Z63XP7.js} +4 -4
  71. package/dist/{source-map-uploader-3GWUQDTS.js → source-map-uploader-MUZPI2S5.js} +5 -4
  72. package/dist/source-map-uploader-MUZPI2S5.js.map +1 -0
  73. package/package.json +6 -4
  74. package/dist/chunk-2LDBR3F3.js.map +0 -1
  75. package/dist/chunk-ARAOZCZT.js.map +0 -1
  76. package/dist/chunk-BGZ7J74D.js.map +0 -1
  77. package/dist/chunk-UPS5BGER.js +0 -182
  78. package/dist/chunk-UPS5BGER.js.map +0 -1
  79. package/dist/chunk-WK7MPK2T.js.map +0 -1
  80. package/dist/chunk-WV3NIPWJ.js.map +0 -1
  81. package/dist/chunk-YMEXDDTA.js.map +0 -1
  82. /package/dist/{esm-MDK7CZID.js.map → chunk-NSBPE2FW.js.map} +0 -0
  83. /package/dist/{monorepo-YILKGQXQ.js.map → esm-KBPHCVB4.js.map} +0 -0
  84. /package/dist/{source-map-uploader-3GWUQDTS.js.map → monorepo-N5Z63XP7.js.map} +0 -0
package/dist/index.cjs CHANGED
@@ -30,13 +30,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // ../../node_modules/tsup/assets/cjs_shims.js
34
- var init_cjs_shims = __esm({
35
- "../../node_modules/tsup/assets/cjs_shims.js"() {
36
- "use strict";
37
- }
38
- });
39
-
40
33
  // src/env-detection.ts
41
34
  function readEnvVars() {
42
35
  return {
@@ -89,7 +82,6 @@ var DEFAULT_ENDPOINT;
89
82
  var init_env_detection = __esm({
90
83
  "src/env-detection.ts"() {
91
84
  "use strict";
92
- init_cjs_shims();
93
85
  DEFAULT_ENDPOINT = "https://api.glasstrace.dev";
94
86
  }
95
87
  });
@@ -156,7 +148,6 @@ var NEVER, $brand, $ZodAsyncError, $ZodEncodeError, globalConfig;
156
148
  var init_core = __esm({
157
149
  "../../node_modules/zod/v4/core/core.js"() {
158
150
  "use strict";
159
- init_cjs_shims();
160
151
  NEVER = Object.freeze({
161
152
  status: "aborted"
162
153
  });
@@ -782,7 +773,6 @@ var EVALUATING, captureStackTrace, allowsEval, getParsedType, propertyKeyTypes,
782
773
  var init_util = __esm({
783
774
  "../../node_modules/zod/v4/core/util.js"() {
784
775
  "use strict";
785
- init_cjs_shims();
786
776
  EVALUATING = /* @__PURE__ */ Symbol("evaluating");
787
777
  captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
788
778
  };
@@ -983,7 +973,6 @@ var initializer, $ZodError, $ZodRealError;
983
973
  var init_errors = __esm({
984
974
  "../../node_modules/zod/v4/core/errors.js"() {
985
975
  "use strict";
986
- init_cjs_shims();
987
976
  init_core();
988
977
  init_util();
989
978
  initializer = (inst, def) => {
@@ -1012,7 +1001,6 @@ var _parse, parse, _parseAsync, parseAsync, _safeParse, safeParse, _safeParseAsy
1012
1001
  var init_parse = __esm({
1013
1002
  "../../node_modules/zod/v4/core/parse.js"() {
1014
1003
  "use strict";
1015
- init_cjs_shims();
1016
1004
  init_core();
1017
1005
  init_errors();
1018
1006
  init_util();
@@ -1198,7 +1186,6 @@ var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, extendedDuration, guid, uui
1198
1186
  var init_regexes = __esm({
1199
1187
  "../../node_modules/zod/v4/core/regexes.js"() {
1200
1188
  "use strict";
1201
- init_cjs_shims();
1202
1189
  init_util();
1203
1190
  cuid = /^[cC][^\s-]{8,}$/;
1204
1191
  cuid2 = /^[0-9a-z]+$/;
@@ -1280,7 +1267,6 @@ var $ZodCheck, numericOriginMap, $ZodCheckLessThan, $ZodCheckGreaterThan, $ZodCh
1280
1267
  var init_checks = __esm({
1281
1268
  "../../node_modules/zod/v4/core/checks.js"() {
1282
1269
  "use strict";
1283
- init_cjs_shims();
1284
1270
  init_core();
1285
1271
  init_regexes();
1286
1272
  init_util();
@@ -1833,7 +1819,6 @@ var Doc;
1833
1819
  var init_doc = __esm({
1834
1820
  "../../node_modules/zod/v4/core/doc.js"() {
1835
1821
  "use strict";
1836
- init_cjs_shims();
1837
1822
  Doc = class {
1838
1823
  constructor(args = []) {
1839
1824
  this.content = [];
@@ -1876,7 +1861,6 @@ var version;
1876
1861
  var init_versions = __esm({
1877
1862
  "../../node_modules/zod/v4/core/versions.js"() {
1878
1863
  "use strict";
1879
- init_cjs_shims();
1880
1864
  version = {
1881
1865
  major: 4,
1882
1866
  minor: 3,
@@ -2247,7 +2231,6 @@ var $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodU
2247
2231
  var init_schemas = __esm({
2248
2232
  "../../node_modules/zod/v4/core/schemas.js"() {
2249
2233
  "use strict";
2250
- init_cjs_shims();
2251
2234
  init_checks();
2252
2235
  init_core();
2253
2236
  init_doc();
@@ -3881,7 +3864,6 @@ var error;
3881
3864
  var init_ar = __esm({
3882
3865
  "../../node_modules/zod/v4/locales/ar.js"() {
3883
3866
  "use strict";
3884
- init_cjs_shims();
3885
3867
  init_util();
3886
3868
  error = () => {
3887
3869
  const Sizable = {
@@ -3996,7 +3978,6 @@ var error2;
3996
3978
  var init_az = __esm({
3997
3979
  "../../node_modules/zod/v4/locales/az.js"() {
3998
3980
  "use strict";
3999
- init_cjs_shims();
4000
3981
  init_util();
4001
3982
  error2 = () => {
4002
3983
  const Sizable = {
@@ -4125,7 +4106,6 @@ var error3;
4125
4106
  var init_be = __esm({
4126
4107
  "../../node_modules/zod/v4/locales/be.js"() {
4127
4108
  "use strict";
4128
- init_cjs_shims();
4129
4109
  init_util();
4130
4110
  error3 = () => {
4131
4111
  const Sizable = {
@@ -4275,7 +4255,6 @@ var error4;
4275
4255
  var init_bg = __esm({
4276
4256
  "../../node_modules/zod/v4/locales/bg.js"() {
4277
4257
  "use strict";
4278
- init_cjs_shims();
4279
4258
  init_util();
4280
4259
  error4 = () => {
4281
4260
  const Sizable = {
@@ -4404,7 +4383,6 @@ var error5;
4404
4383
  var init_ca = __esm({
4405
4384
  "../../node_modules/zod/v4/locales/ca.js"() {
4406
4385
  "use strict";
4407
- init_cjs_shims();
4408
4386
  init_util();
4409
4387
  error5 = () => {
4410
4388
  const Sizable = {
@@ -4521,7 +4499,6 @@ var error6;
4521
4499
  var init_cs = __esm({
4522
4500
  "../../node_modules/zod/v4/locales/cs.js"() {
4523
4501
  "use strict";
4524
- init_cjs_shims();
4525
4502
  init_util();
4526
4503
  error6 = () => {
4527
4504
  const Sizable = {
@@ -4641,7 +4618,6 @@ var error7;
4641
4618
  var init_da = __esm({
4642
4619
  "../../node_modules/zod/v4/locales/da.js"() {
4643
4620
  "use strict";
4644
- init_cjs_shims();
4645
4621
  init_util();
4646
4622
  error7 = () => {
4647
4623
  const Sizable = {
@@ -4765,7 +4741,6 @@ var error8;
4765
4741
  var init_de = __esm({
4766
4742
  "../../node_modules/zod/v4/locales/de.js"() {
4767
4743
  "use strict";
4768
- init_cjs_shims();
4769
4744
  init_util();
4770
4745
  error8 = () => {
4771
4746
  const Sizable = {
@@ -4882,7 +4857,6 @@ var error9;
4882
4857
  var init_en = __esm({
4883
4858
  "../../node_modules/zod/v4/locales/en.js"() {
4884
4859
  "use strict";
4885
- init_cjs_shims();
4886
4860
  init_util();
4887
4861
  error9 = () => {
4888
4862
  const Sizable = {
@@ -4999,7 +4973,6 @@ var error10;
4999
4973
  var init_eo = __esm({
5000
4974
  "../../node_modules/zod/v4/locales/eo.js"() {
5001
4975
  "use strict";
5002
- init_cjs_shims();
5003
4976
  init_util();
5004
4977
  error10 = () => {
5005
4978
  const Sizable = {
@@ -5117,7 +5090,6 @@ var error11;
5117
5090
  var init_es = __esm({
5118
5091
  "../../node_modules/zod/v4/locales/es.js"() {
5119
5092
  "use strict";
5120
- init_cjs_shims();
5121
5093
  init_util();
5122
5094
  error11 = () => {
5123
5095
  const Sizable = {
@@ -5258,7 +5230,6 @@ var error12;
5258
5230
  var init_fa = __esm({
5259
5231
  "../../node_modules/zod/v4/locales/fa.js"() {
5260
5232
  "use strict";
5261
- init_cjs_shims();
5262
5233
  init_util();
5263
5234
  error12 = () => {
5264
5235
  const Sizable = {
@@ -5381,7 +5352,6 @@ var error13;
5381
5352
  var init_fi = __esm({
5382
5353
  "../../node_modules/zod/v4/locales/fi.js"() {
5383
5354
  "use strict";
5384
- init_cjs_shims();
5385
5355
  init_util();
5386
5356
  error13 = () => {
5387
5357
  const Sizable = {
@@ -5502,7 +5472,6 @@ var error14;
5502
5472
  var init_fr = __esm({
5503
5473
  "../../node_modules/zod/v4/locales/fr.js"() {
5504
5474
  "use strict";
5505
- init_cjs_shims();
5506
5475
  init_util();
5507
5476
  error14 = () => {
5508
5477
  const Sizable = {
@@ -5619,7 +5588,6 @@ var error15;
5619
5588
  var init_fr_CA = __esm({
5620
5589
  "../../node_modules/zod/v4/locales/fr-CA.js"() {
5621
5590
  "use strict";
5622
- init_cjs_shims();
5623
5591
  init_util();
5624
5592
  error15 = () => {
5625
5593
  const Sizable = {
@@ -5735,7 +5703,6 @@ var error16;
5735
5703
  var init_he = __esm({
5736
5704
  "../../node_modules/zod/v4/locales/he.js"() {
5737
5705
  "use strict";
5738
- init_cjs_shims();
5739
5706
  init_util();
5740
5707
  error16 = () => {
5741
5708
  const TypeNames = {
@@ -5938,7 +5905,6 @@ var error17;
5938
5905
  var init_hu = __esm({
5939
5906
  "../../node_modules/zod/v4/locales/hu.js"() {
5940
5907
  "use strict";
5941
- init_cjs_shims();
5942
5908
  init_util();
5943
5909
  error17 = () => {
5944
5910
  const Sizable = {
@@ -6065,7 +6031,6 @@ var error18;
6065
6031
  var init_hy = __esm({
6066
6032
  "../../node_modules/zod/v4/locales/hy.js"() {
6067
6033
  "use strict";
6068
- init_cjs_shims();
6069
6034
  init_util();
6070
6035
  error18 = () => {
6071
6036
  const Sizable = {
@@ -6211,7 +6176,6 @@ var error19;
6211
6176
  var init_id = __esm({
6212
6177
  "../../node_modules/zod/v4/locales/id.js"() {
6213
6178
  "use strict";
6214
- init_cjs_shims();
6215
6179
  init_util();
6216
6180
  error19 = () => {
6217
6181
  const Sizable = {
@@ -6326,7 +6290,6 @@ var error20;
6326
6290
  var init_is = __esm({
6327
6291
  "../../node_modules/zod/v4/locales/is.js"() {
6328
6292
  "use strict";
6329
- init_cjs_shims();
6330
6293
  init_util();
6331
6294
  error20 = () => {
6332
6295
  const Sizable = {
@@ -6444,7 +6407,6 @@ var error21;
6444
6407
  var init_it = __esm({
6445
6408
  "../../node_modules/zod/v4/locales/it.js"() {
6446
6409
  "use strict";
6447
- init_cjs_shims();
6448
6410
  init_util();
6449
6411
  error21 = () => {
6450
6412
  const Sizable = {
@@ -6561,7 +6523,6 @@ var error22;
6561
6523
  var init_ja = __esm({
6562
6524
  "../../node_modules/zod/v4/locales/ja.js"() {
6563
6525
  "use strict";
6564
- init_cjs_shims();
6565
6526
  init_util();
6566
6527
  error22 = () => {
6567
6528
  const Sizable = {
@@ -6677,7 +6638,6 @@ var error23;
6677
6638
  var init_ka = __esm({
6678
6639
  "../../node_modules/zod/v4/locales/ka.js"() {
6679
6640
  "use strict";
6680
- init_cjs_shims();
6681
6641
  init_util();
6682
6642
  error23 = () => {
6683
6643
  const Sizable = {
@@ -6798,7 +6758,6 @@ var error24;
6798
6758
  var init_km = __esm({
6799
6759
  "../../node_modules/zod/v4/locales/km.js"() {
6800
6760
  "use strict";
6801
- init_cjs_shims();
6802
6761
  init_util();
6803
6762
  error24 = () => {
6804
6763
  const Sizable = {
@@ -6914,7 +6873,6 @@ function kh_default() {
6914
6873
  var init_kh = __esm({
6915
6874
  "../../node_modules/zod/v4/locales/kh.js"() {
6916
6875
  "use strict";
6917
- init_cjs_shims();
6918
6876
  init_km();
6919
6877
  }
6920
6878
  });
@@ -6929,7 +6887,6 @@ var error25;
6929
6887
  var init_ko = __esm({
6930
6888
  "../../node_modules/zod/v4/locales/ko.js"() {
6931
6889
  "use strict";
6932
- init_cjs_shims();
6933
6890
  init_util();
6934
6891
  error25 = () => {
6935
6892
  const Sizable = {
@@ -7059,7 +7016,6 @@ var capitalizeFirstCharacter, error26;
7059
7016
  var init_lt = __esm({
7060
7017
  "../../node_modules/zod/v4/locales/lt.js"() {
7061
7018
  "use strict";
7062
- init_cjs_shims();
7063
7019
  init_util();
7064
7020
  capitalizeFirstCharacter = (text) => {
7065
7021
  return text.charAt(0).toUpperCase() + text.slice(1);
@@ -7261,7 +7217,6 @@ var error27;
7261
7217
  var init_mk = __esm({
7262
7218
  "../../node_modules/zod/v4/locales/mk.js"() {
7263
7219
  "use strict";
7264
- init_cjs_shims();
7265
7220
  init_util();
7266
7221
  error27 = () => {
7267
7222
  const Sizable = {
@@ -7379,7 +7334,6 @@ var error28;
7379
7334
  var init_ms = __esm({
7380
7335
  "../../node_modules/zod/v4/locales/ms.js"() {
7381
7336
  "use strict";
7382
- init_cjs_shims();
7383
7337
  init_util();
7384
7338
  error28 = () => {
7385
7339
  const Sizable = {
@@ -7495,7 +7449,6 @@ var error29;
7495
7449
  var init_nl = __esm({
7496
7450
  "../../node_modules/zod/v4/locales/nl.js"() {
7497
7451
  "use strict";
7498
- init_cjs_shims();
7499
7452
  init_util();
7500
7453
  error29 = () => {
7501
7454
  const Sizable = {
@@ -7614,7 +7567,6 @@ var error30;
7614
7567
  var init_no = __esm({
7615
7568
  "../../node_modules/zod/v4/locales/no.js"() {
7616
7569
  "use strict";
7617
- init_cjs_shims();
7618
7570
  init_util();
7619
7571
  error30 = () => {
7620
7572
  const Sizable = {
@@ -7731,7 +7683,6 @@ var error31;
7731
7683
  var init_ota = __esm({
7732
7684
  "../../node_modules/zod/v4/locales/ota.js"() {
7733
7685
  "use strict";
7734
- init_cjs_shims();
7735
7686
  init_util();
7736
7687
  error31 = () => {
7737
7688
  const Sizable = {
@@ -7849,7 +7800,6 @@ var error32;
7849
7800
  var init_ps = __esm({
7850
7801
  "../../node_modules/zod/v4/locales/ps.js"() {
7851
7802
  "use strict";
7852
- init_cjs_shims();
7853
7803
  init_util();
7854
7804
  error32 = () => {
7855
7805
  const Sizable = {
@@ -7972,7 +7922,6 @@ var error33;
7972
7922
  var init_pl = __esm({
7973
7923
  "../../node_modules/zod/v4/locales/pl.js"() {
7974
7924
  "use strict";
7975
- init_cjs_shims();
7976
7925
  init_util();
7977
7926
  error33 = () => {
7978
7927
  const Sizable = {
@@ -8090,7 +8039,6 @@ var error34;
8090
8039
  var init_pt = __esm({
8091
8040
  "../../node_modules/zod/v4/locales/pt.js"() {
8092
8041
  "use strict";
8093
- init_cjs_shims();
8094
8042
  init_util();
8095
8043
  error34 = () => {
8096
8044
  const Sizable = {
@@ -8222,7 +8170,6 @@ var error35;
8222
8170
  var init_ru = __esm({
8223
8171
  "../../node_modules/zod/v4/locales/ru.js"() {
8224
8172
  "use strict";
8225
- init_cjs_shims();
8226
8173
  init_util();
8227
8174
  error35 = () => {
8228
8175
  const Sizable = {
@@ -8372,7 +8319,6 @@ var error36;
8372
8319
  var init_sl = __esm({
8373
8320
  "../../node_modules/zod/v4/locales/sl.js"() {
8374
8321
  "use strict";
8375
- init_cjs_shims();
8376
8322
  init_util();
8377
8323
  error36 = () => {
8378
8324
  const Sizable = {
@@ -8490,7 +8436,6 @@ var error37;
8490
8436
  var init_sv = __esm({
8491
8437
  "../../node_modules/zod/v4/locales/sv.js"() {
8492
8438
  "use strict";
8493
- init_cjs_shims();
8494
8439
  init_util();
8495
8440
  error37 = () => {
8496
8441
  const Sizable = {
@@ -8609,7 +8554,6 @@ var error38;
8609
8554
  var init_ta = __esm({
8610
8555
  "../../node_modules/zod/v4/locales/ta.js"() {
8611
8556
  "use strict";
8612
- init_cjs_shims();
8613
8557
  init_util();
8614
8558
  error38 = () => {
8615
8559
  const Sizable = {
@@ -8728,7 +8672,6 @@ var error39;
8728
8672
  var init_th = __esm({
8729
8673
  "../../node_modules/zod/v4/locales/th.js"() {
8730
8674
  "use strict";
8731
- init_cjs_shims();
8732
8675
  init_util();
8733
8676
  error39 = () => {
8734
8677
  const Sizable = {
@@ -8847,7 +8790,6 @@ var error40;
8847
8790
  var init_tr = __esm({
8848
8791
  "../../node_modules/zod/v4/locales/tr.js"() {
8849
8792
  "use strict";
8850
- init_cjs_shims();
8851
8793
  init_util();
8852
8794
  error40 = () => {
8853
8795
  const Sizable = {
@@ -8961,7 +8903,6 @@ var error41;
8961
8903
  var init_uk = __esm({
8962
8904
  "../../node_modules/zod/v4/locales/uk.js"() {
8963
8905
  "use strict";
8964
- init_cjs_shims();
8965
8906
  init_util();
8966
8907
  error41 = () => {
8967
8908
  const Sizable = {
@@ -9075,7 +9016,6 @@ function ua_default() {
9075
9016
  var init_ua = __esm({
9076
9017
  "../../node_modules/zod/v4/locales/ua.js"() {
9077
9018
  "use strict";
9078
- init_cjs_shims();
9079
9019
  init_uk();
9080
9020
  }
9081
9021
  });
@@ -9090,7 +9030,6 @@ var error42;
9090
9030
  var init_ur = __esm({
9091
9031
  "../../node_modules/zod/v4/locales/ur.js"() {
9092
9032
  "use strict";
9093
- init_cjs_shims();
9094
9033
  init_util();
9095
9034
  error42 = () => {
9096
9035
  const Sizable = {
@@ -9209,7 +9148,6 @@ var error43;
9209
9148
  var init_uz = __esm({
9210
9149
  "../../node_modules/zod/v4/locales/uz.js"() {
9211
9150
  "use strict";
9212
- init_cjs_shims();
9213
9151
  init_util();
9214
9152
  error43 = () => {
9215
9153
  const Sizable = {
@@ -9327,7 +9265,6 @@ var error44;
9327
9265
  var init_vi = __esm({
9328
9266
  "../../node_modules/zod/v4/locales/vi.js"() {
9329
9267
  "use strict";
9330
- init_cjs_shims();
9331
9268
  init_util();
9332
9269
  error44 = () => {
9333
9270
  const Sizable = {
@@ -9444,7 +9381,6 @@ var error45;
9444
9381
  var init_zh_CN = __esm({
9445
9382
  "../../node_modules/zod/v4/locales/zh-CN.js"() {
9446
9383
  "use strict";
9447
- init_cjs_shims();
9448
9384
  init_util();
9449
9385
  error45 = () => {
9450
9386
  const Sizable = {
@@ -9562,7 +9498,6 @@ var error46;
9562
9498
  var init_zh_TW = __esm({
9563
9499
  "../../node_modules/zod/v4/locales/zh-TW.js"() {
9564
9500
  "use strict";
9565
- init_cjs_shims();
9566
9501
  init_util();
9567
9502
  error46 = () => {
9568
9503
  const Sizable = {
@@ -9678,7 +9613,6 @@ var error47;
9678
9613
  var init_yo = __esm({
9679
9614
  "../../node_modules/zod/v4/locales/yo.js"() {
9680
9615
  "use strict";
9681
- init_cjs_shims();
9682
9616
  init_util();
9683
9617
  error47 = () => {
9684
9618
  const Sizable = {
@@ -9840,7 +9774,6 @@ __export(locales_exports, {
9840
9774
  var init_locales = __esm({
9841
9775
  "../../node_modules/zod/v4/locales/index.js"() {
9842
9776
  "use strict";
9843
- init_cjs_shims();
9844
9777
  init_ar();
9845
9778
  init_az();
9846
9779
  init_be();
@@ -9901,7 +9834,6 @@ var _a, $output, $input, $ZodRegistry, globalRegistry;
9901
9834
  var init_registries = __esm({
9902
9835
  "../../node_modules/zod/v4/core/registries.js"() {
9903
9836
  "use strict";
9904
- init_cjs_shims();
9905
9837
  $output = /* @__PURE__ */ Symbol("ZodOutput");
9906
9838
  $input = /* @__PURE__ */ Symbol("ZodInput");
9907
9839
  $ZodRegistry = class {
@@ -10984,7 +10916,6 @@ var TimePrecision;
10984
10916
  var init_api = __esm({
10985
10917
  "../../node_modules/zod/v4/core/api.js"() {
10986
10918
  "use strict";
10987
- init_cjs_shims();
10988
10919
  init_checks();
10989
10920
  init_registries();
10990
10921
  init_schemas();
@@ -11341,7 +11272,6 @@ var createToJSONSchemaMethod, createStandardJSONSchemaMethod;
11341
11272
  var init_to_json_schema = __esm({
11342
11273
  "../../node_modules/zod/v4/core/to-json-schema.js"() {
11343
11274
  "use strict";
11344
- init_cjs_shims();
11345
11275
  init_registries();
11346
11276
  createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
11347
11277
  const ctx = initializeContext({ ...params, processors });
@@ -11398,7 +11328,6 @@ var formatMap, stringProcessor, numberProcessor, booleanProcessor, bigintProcess
11398
11328
  var init_json_schema_processors = __esm({
11399
11329
  "../../node_modules/zod/v4/core/json-schema-processors.js"() {
11400
11330
  "use strict";
11401
- init_cjs_shims();
11402
11331
  init_to_json_schema();
11403
11332
  init_util();
11404
11333
  formatMap = {
@@ -11924,7 +11853,6 @@ var JSONSchemaGenerator;
11924
11853
  var init_json_schema_generator = __esm({
11925
11854
  "../../node_modules/zod/v4/core/json-schema-generator.js"() {
11926
11855
  "use strict";
11927
- init_cjs_shims();
11928
11856
  init_json_schema_processors();
11929
11857
  init_to_json_schema();
11930
11858
  JSONSchemaGenerator = class {
@@ -12008,7 +11936,6 @@ var json_schema_exports = {};
12008
11936
  var init_json_schema = __esm({
12009
11937
  "../../node_modules/zod/v4/core/json-schema.js"() {
12010
11938
  "use strict";
12011
- init_cjs_shims();
12012
11939
  }
12013
11940
  });
12014
11941
 
@@ -12292,7 +12219,6 @@ __export(core_exports2, {
12292
12219
  var init_core2 = __esm({
12293
12220
  "../../node_modules/zod/v4/core/index.js"() {
12294
12221
  "use strict";
12295
- init_cjs_shims();
12296
12222
  init_core();
12297
12223
  init_parse();
12298
12224
  init_errors();
@@ -12348,7 +12274,6 @@ __export(checks_exports2, {
12348
12274
  var init_checks2 = __esm({
12349
12275
  "../../node_modules/zod/v4/classic/checks.js"() {
12350
12276
  "use strict";
12351
- init_cjs_shims();
12352
12277
  init_core2();
12353
12278
  }
12354
12279
  });
@@ -12381,7 +12306,6 @@ var ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration;
12381
12306
  var init_iso = __esm({
12382
12307
  "../../node_modules/zod/v4/classic/iso.js"() {
12383
12308
  "use strict";
12384
- init_cjs_shims();
12385
12309
  init_core2();
12386
12310
  init_schemas2();
12387
12311
  ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
@@ -12408,7 +12332,6 @@ var initializer2, ZodError, ZodRealError;
12408
12332
  var init_errors2 = __esm({
12409
12333
  "../../node_modules/zod/v4/classic/errors.js"() {
12410
12334
  "use strict";
12411
- init_cjs_shims();
12412
12335
  init_core2();
12413
12336
  init_core2();
12414
12337
  init_util();
@@ -12458,7 +12381,6 @@ var parse2, parseAsync2, safeParse2, safeParseAsync2, encode2, decode2, encodeAs
12458
12381
  var init_parse2 = __esm({
12459
12382
  "../../node_modules/zod/v4/classic/parse.js"() {
12460
12383
  "use strict";
12461
- init_cjs_shims();
12462
12384
  init_core2();
12463
12385
  init_errors2();
12464
12386
  parse2 = /* @__PURE__ */ _parse(ZodRealError);
@@ -13102,7 +13024,6 @@ var ZodType, _ZodString, ZodString, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID,
13102
13024
  var init_schemas2 = __esm({
13103
13025
  "../../node_modules/zod/v4/classic/schemas.js"() {
13104
13026
  "use strict";
13105
- init_cjs_shims();
13106
13027
  init_core2();
13107
13028
  init_core2();
13108
13029
  init_json_schema_processors();
@@ -13749,7 +13670,6 @@ var ZodIssueCode, ZodFirstPartyTypeKind;
13749
13670
  var init_compat = __esm({
13750
13671
  "../../node_modules/zod/v4/classic/compat.js"() {
13751
13672
  "use strict";
13752
- init_cjs_shims();
13753
13673
  init_core2();
13754
13674
  init_core2();
13755
13675
  ZodIssueCode = {
@@ -14171,7 +14091,6 @@ var z, RECOGNIZED_KEYS;
14171
14091
  var init_from_json_schema = __esm({
14172
14092
  "../../node_modules/zod/v4/classic/from-json-schema.js"() {
14173
14093
  "use strict";
14174
- init_cjs_shims();
14175
14094
  init_registries();
14176
14095
  init_checks2();
14177
14096
  init_iso();
@@ -14282,7 +14201,6 @@ function date4(params) {
14282
14201
  var init_coerce = __esm({
14283
14202
  "../../node_modules/zod/v4/classic/coerce.js"() {
14284
14203
  "use strict";
14285
- init_cjs_shims();
14286
14204
  init_core2();
14287
14205
  init_schemas2();
14288
14206
  }
@@ -14531,7 +14449,6 @@ __export(external_exports, {
14531
14449
  var init_external = __esm({
14532
14450
  "../../node_modules/zod/v4/classic/external.js"() {
14533
14451
  "use strict";
14534
- init_cjs_shims();
14535
14452
  init_core2();
14536
14453
  init_schemas2();
14537
14454
  init_checks2();
@@ -14555,7 +14472,6 @@ var init_external = __esm({
14555
14472
  var init_zod = __esm({
14556
14473
  "../../node_modules/zod/index.js"() {
14557
14474
  "use strict";
14558
- init_cjs_shims();
14559
14475
  init_external();
14560
14476
  init_external();
14561
14477
  }
@@ -14577,7 +14493,6 @@ var DevApiKeySchema, AnonApiKeySchema, SessionIdSchema, BuildHashSchema, SdkDiag
14577
14493
  var init_dist = __esm({
14578
14494
  "../protocol/dist/index.js"() {
14579
14495
  "use strict";
14580
- init_cjs_shims();
14581
14496
  init_zod();
14582
14497
  init_zod();
14583
14498
  init_zod();
@@ -14760,7 +14675,6 @@ var VERSION;
14760
14675
  var init_version = __esm({
14761
14676
  "../../node_modules/@opentelemetry/api/build/esm/version.js"() {
14762
14677
  "use strict";
14763
- init_cjs_shims();
14764
14678
  VERSION = "1.9.1";
14765
14679
  }
14766
14680
  });
@@ -14831,7 +14745,6 @@ var re, isCompatible;
14831
14745
  var init_semver = __esm({
14832
14746
  "../../node_modules/@opentelemetry/api/build/esm/internal/semver.js"() {
14833
14747
  "use strict";
14834
- init_cjs_shims();
14835
14748
  init_version();
14836
14749
  re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
14837
14750
  isCompatible = _makeCompatibilityCheck(VERSION);
@@ -14877,7 +14790,6 @@ var major, GLOBAL_OPENTELEMETRY_API_KEY, _global;
14877
14790
  var init_global_utils = __esm({
14878
14791
  "../../node_modules/@opentelemetry/api/build/esm/internal/global-utils.js"() {
14879
14792
  "use strict";
14880
- init_cjs_shims();
14881
14793
  init_version();
14882
14794
  init_semver();
14883
14795
  major = VERSION.split(".")[0];
@@ -14898,7 +14810,6 @@ var DiagComponentLogger;
14898
14810
  var init_ComponentLogger = __esm({
14899
14811
  "../../node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js"() {
14900
14812
  "use strict";
14901
- init_cjs_shims();
14902
14813
  init_global_utils();
14903
14814
  DiagComponentLogger = class {
14904
14815
  constructor(props) {
@@ -14928,7 +14839,6 @@ var DiagLogLevel;
14928
14839
  var init_types = __esm({
14929
14840
  "../../node_modules/@opentelemetry/api/build/esm/diag/types.js"() {
14930
14841
  "use strict";
14931
- init_cjs_shims();
14932
14842
  (function(DiagLogLevel2) {
14933
14843
  DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE";
14934
14844
  DiagLogLevel2[DiagLogLevel2["ERROR"] = 30] = "ERROR";
@@ -14968,7 +14878,6 @@ function createLogLevelDiagLogger(maxLevel, logger) {
14968
14878
  var init_logLevelLogger = __esm({
14969
14879
  "../../node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js"() {
14970
14880
  "use strict";
14971
- init_cjs_shims();
14972
14881
  init_types();
14973
14882
  }
14974
14883
  });
@@ -14978,7 +14887,6 @@ var API_NAME, DiagAPI;
14978
14887
  var init_diag = __esm({
14979
14888
  "../../node_modules/@opentelemetry/api/build/esm/api/diag.js"() {
14980
14889
  "use strict";
14981
- init_cjs_shims();
14982
14890
  init_ComponentLogger();
14983
14891
  init_logLevelLogger();
14984
14892
  init_types();
@@ -15049,7 +14957,6 @@ var BaggageImpl;
15049
14957
  var init_baggage_impl = __esm({
15050
14958
  "../../node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js"() {
15051
14959
  "use strict";
15052
- init_cjs_shims();
15053
14960
  BaggageImpl = class _BaggageImpl {
15054
14961
  constructor(entries) {
15055
14962
  this._entries = entries ? new Map(entries) : /* @__PURE__ */ new Map();
@@ -15093,7 +15000,6 @@ var baggageEntryMetadataSymbol;
15093
15000
  var init_symbol = __esm({
15094
15001
  "../../node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js"() {
15095
15002
  "use strict";
15096
- init_cjs_shims();
15097
15003
  baggageEntryMetadataSymbol = /* @__PURE__ */ Symbol("BaggageEntryMetadata");
15098
15004
  }
15099
15005
  });
@@ -15118,7 +15024,6 @@ var diag;
15118
15024
  var init_utils = __esm({
15119
15025
  "../../node_modules/@opentelemetry/api/build/esm/baggage/utils.js"() {
15120
15026
  "use strict";
15121
- init_cjs_shims();
15122
15027
  init_diag();
15123
15028
  init_baggage_impl();
15124
15029
  init_symbol();
@@ -15134,7 +15039,6 @@ var BaseContext, ROOT_CONTEXT;
15134
15039
  var init_context = __esm({
15135
15040
  "../../node_modules/@opentelemetry/api/build/esm/context/context.js"() {
15136
15041
  "use strict";
15137
- init_cjs_shims();
15138
15042
  BaseContext = class _BaseContext {
15139
15043
  /**
15140
15044
  * Construct a new context which inherits values from an optional parent context.
@@ -15166,7 +15070,6 @@ var consoleMap, _originalConsoleMethods, DiagConsoleLogger;
15166
15070
  var init_consoleLogger = __esm({
15167
15071
  "../../node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js"() {
15168
15072
  "use strict";
15169
- init_cjs_shims();
15170
15073
  consoleMap = [
15171
15074
  { n: "error", c: "error" },
15172
15075
  { n: "warn", c: "warn" },
@@ -15225,7 +15128,6 @@ var NoopMeter, NoopMetric, NoopCounterMetric, NoopUpDownCounterMetric, NoopGauge
15225
15128
  var init_NoopMeter = __esm({
15226
15129
  "../../node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js"() {
15227
15130
  "use strict";
15228
- init_cjs_shims();
15229
15131
  NoopMeter = class {
15230
15132
  constructor() {
15231
15133
  }
@@ -15328,7 +15230,6 @@ var ValueType;
15328
15230
  var init_Metric = __esm({
15329
15231
  "../../node_modules/@opentelemetry/api/build/esm/metrics/Metric.js"() {
15330
15232
  "use strict";
15331
- init_cjs_shims();
15332
15233
  (function(ValueType2) {
15333
15234
  ValueType2[ValueType2["INT"] = 0] = "INT";
15334
15235
  ValueType2[ValueType2["DOUBLE"] = 1] = "DOUBLE";
@@ -15341,7 +15242,6 @@ var defaultTextMapGetter, defaultTextMapSetter;
15341
15242
  var init_TextMapPropagator = __esm({
15342
15243
  "../../node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js"() {
15343
15244
  "use strict";
15344
- init_cjs_shims();
15345
15245
  defaultTextMapGetter = {
15346
15246
  get(carrier, key) {
15347
15247
  if (carrier == null) {
@@ -15372,7 +15272,6 @@ var NoopContextManager;
15372
15272
  var init_NoopContextManager = __esm({
15373
15273
  "../../node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js"() {
15374
15274
  "use strict";
15375
- init_cjs_shims();
15376
15275
  init_context();
15377
15276
  NoopContextManager = class {
15378
15277
  active() {
@@ -15399,7 +15298,6 @@ var API_NAME2, NOOP_CONTEXT_MANAGER, ContextAPI;
15399
15298
  var init_context2 = __esm({
15400
15299
  "../../node_modules/@opentelemetry/api/build/esm/api/context.js"() {
15401
15300
  "use strict";
15402
- init_cjs_shims();
15403
15301
  init_NoopContextManager();
15404
15302
  init_global_utils();
15405
15303
  init_diag();
@@ -15467,7 +15365,6 @@ var TraceFlags;
15467
15365
  var init_trace_flags = __esm({
15468
15366
  "../../node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js"() {
15469
15367
  "use strict";
15470
- init_cjs_shims();
15471
15368
  (function(TraceFlags2) {
15472
15369
  TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE";
15473
15370
  TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED";
@@ -15480,7 +15377,6 @@ var INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT;
15480
15377
  var init_invalid_span_constants = __esm({
15481
15378
  "../../node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js"() {
15482
15379
  "use strict";
15483
- init_cjs_shims();
15484
15380
  init_trace_flags();
15485
15381
  INVALID_SPANID = "0000000000000000";
15486
15382
  INVALID_TRACEID = "00000000000000000000000000000000";
@@ -15497,7 +15393,6 @@ var NonRecordingSpan;
15497
15393
  var init_NonRecordingSpan = __esm({
15498
15394
  "../../node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js"() {
15499
15395
  "use strict";
15500
- init_cjs_shims();
15501
15396
  init_invalid_span_constants();
15502
15397
  NonRecordingSpan = class {
15503
15398
  constructor(spanContext = INVALID_SPAN_CONTEXT) {
@@ -15571,7 +15466,6 @@ var SPAN_KEY;
15571
15466
  var init_context_utils = __esm({
15572
15467
  "../../node_modules/@opentelemetry/api/build/esm/trace/context-utils.js"() {
15573
15468
  "use strict";
15574
- init_cjs_shims();
15575
15469
  init_context();
15576
15470
  init_NonRecordingSpan();
15577
15471
  init_context2();
@@ -15605,7 +15499,6 @@ var isHex;
15605
15499
  var init_spancontext_utils = __esm({
15606
15500
  "../../node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js"() {
15607
15501
  "use strict";
15608
- init_cjs_shims();
15609
15502
  init_invalid_span_constants();
15610
15503
  init_NonRecordingSpan();
15611
15504
  isHex = new Uint8Array([
@@ -15724,7 +15617,6 @@ var contextApi, NoopTracer;
15724
15617
  var init_NoopTracer = __esm({
15725
15618
  "../../node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js"() {
15726
15619
  "use strict";
15727
- init_cjs_shims();
15728
15620
  init_context2();
15729
15621
  init_context_utils();
15730
15622
  init_NonRecordingSpan();
@@ -15774,7 +15666,6 @@ var NOOP_TRACER, ProxyTracer;
15774
15666
  var init_ProxyTracer = __esm({
15775
15667
  "../../node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js"() {
15776
15668
  "use strict";
15777
- init_cjs_shims();
15778
15669
  init_NoopTracer();
15779
15670
  NOOP_TRACER = new NoopTracer();
15780
15671
  ProxyTracer = class {
@@ -15815,7 +15706,6 @@ var NoopTracerProvider;
15815
15706
  var init_NoopTracerProvider = __esm({
15816
15707
  "../../node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js"() {
15817
15708
  "use strict";
15818
- init_cjs_shims();
15819
15709
  init_NoopTracer();
15820
15710
  NoopTracerProvider = class {
15821
15711
  getTracer(_name, _version, _options) {
@@ -15830,7 +15720,6 @@ var NOOP_TRACER_PROVIDER, ProxyTracerProvider;
15830
15720
  var init_ProxyTracerProvider = __esm({
15831
15721
  "../../node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js"() {
15832
15722
  "use strict";
15833
- init_cjs_shims();
15834
15723
  init_ProxyTracer();
15835
15724
  init_NoopTracerProvider();
15836
15725
  NOOP_TRACER_PROVIDER = new NoopTracerProvider();
@@ -15865,7 +15754,6 @@ var SamplingDecision;
15865
15754
  var init_SamplingResult = __esm({
15866
15755
  "../../node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js"() {
15867
15756
  "use strict";
15868
- init_cjs_shims();
15869
15757
  (function(SamplingDecision3) {
15870
15758
  SamplingDecision3[SamplingDecision3["NOT_RECORD"] = 0] = "NOT_RECORD";
15871
15759
  SamplingDecision3[SamplingDecision3["RECORD"] = 1] = "RECORD";
@@ -15879,7 +15767,6 @@ var SpanKind;
15879
15767
  var init_span_kind = __esm({
15880
15768
  "../../node_modules/@opentelemetry/api/build/esm/trace/span_kind.js"() {
15881
15769
  "use strict";
15882
- init_cjs_shims();
15883
15770
  (function(SpanKind2) {
15884
15771
  SpanKind2[SpanKind2["INTERNAL"] = 0] = "INTERNAL";
15885
15772
  SpanKind2[SpanKind2["SERVER"] = 1] = "SERVER";
@@ -15895,7 +15782,6 @@ var SpanStatusCode;
15895
15782
  var init_status = __esm({
15896
15783
  "../../node_modules/@opentelemetry/api/build/esm/trace/status.js"() {
15897
15784
  "use strict";
15898
- init_cjs_shims();
15899
15785
  (function(SpanStatusCode2) {
15900
15786
  SpanStatusCode2[SpanStatusCode2["UNSET"] = 0] = "UNSET";
15901
15787
  SpanStatusCode2[SpanStatusCode2["OK"] = 1] = "OK";
@@ -15915,7 +15801,6 @@ var VALID_KEY_CHAR_RANGE, VALID_KEY, VALID_VENDOR_KEY, VALID_KEY_REGEX, VALID_VA
15915
15801
  var init_tracestate_validators = __esm({
15916
15802
  "../../node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-validators.js"() {
15917
15803
  "use strict";
15918
- init_cjs_shims();
15919
15804
  VALID_KEY_CHAR_RANGE = "[_0-9a-z-*/]";
15920
15805
  VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;
15921
15806
  VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;
@@ -15930,7 +15815,6 @@ var MAX_TRACE_STATE_ITEMS, MAX_TRACE_STATE_LEN, LIST_MEMBERS_SEPARATOR, LIST_MEM
15930
15815
  var init_tracestate_impl = __esm({
15931
15816
  "../../node_modules/@opentelemetry/api/build/esm/trace/internal/tracestate-impl.js"() {
15932
15817
  "use strict";
15933
- init_cjs_shims();
15934
15818
  init_tracestate_validators();
15935
15819
  MAX_TRACE_STATE_ITEMS = 32;
15936
15820
  MAX_TRACE_STATE_LEN = 512;
@@ -16004,7 +15888,6 @@ function createTraceState(rawTraceState) {
16004
15888
  var init_utils2 = __esm({
16005
15889
  "../../node_modules/@opentelemetry/api/build/esm/trace/internal/utils.js"() {
16006
15890
  "use strict";
16007
- init_cjs_shims();
16008
15891
  init_tracestate_impl();
16009
15892
  }
16010
15893
  });
@@ -16014,7 +15897,6 @@ var context;
16014
15897
  var init_context_api = __esm({
16015
15898
  "../../node_modules/@opentelemetry/api/build/esm/context-api.js"() {
16016
15899
  "use strict";
16017
- init_cjs_shims();
16018
15900
  init_context2();
16019
15901
  context = ContextAPI.getInstance();
16020
15902
  }
@@ -16025,7 +15907,6 @@ var diag2;
16025
15907
  var init_diag_api = __esm({
16026
15908
  "../../node_modules/@opentelemetry/api/build/esm/diag-api.js"() {
16027
15909
  "use strict";
16028
- init_cjs_shims();
16029
15910
  init_diag();
16030
15911
  diag2 = DiagAPI.instance();
16031
15912
  }
@@ -16036,7 +15917,6 @@ var NoopMeterProvider, NOOP_METER_PROVIDER;
16036
15917
  var init_NoopMeterProvider = __esm({
16037
15918
  "../../node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js"() {
16038
15919
  "use strict";
16039
- init_cjs_shims();
16040
15920
  init_NoopMeter();
16041
15921
  NoopMeterProvider = class {
16042
15922
  getMeter(_name, _version, _options) {
@@ -16052,7 +15932,6 @@ var API_NAME3, MetricsAPI;
16052
15932
  var init_metrics = __esm({
16053
15933
  "../../node_modules/@opentelemetry/api/build/esm/api/metrics.js"() {
16054
15934
  "use strict";
16055
- init_cjs_shims();
16056
15935
  init_NoopMeterProvider();
16057
15936
  init_global_utils();
16058
15937
  init_diag();
@@ -16100,7 +15979,6 @@ var metrics;
16100
15979
  var init_metrics_api = __esm({
16101
15980
  "../../node_modules/@opentelemetry/api/build/esm/metrics-api.js"() {
16102
15981
  "use strict";
16103
- init_cjs_shims();
16104
15982
  init_metrics();
16105
15983
  metrics = MetricsAPI.getInstance();
16106
15984
  }
@@ -16111,7 +15989,6 @@ var NoopTextMapPropagator;
16111
15989
  var init_NoopTextMapPropagator = __esm({
16112
15990
  "../../node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js"() {
16113
15991
  "use strict";
16114
- init_cjs_shims();
16115
15992
  NoopTextMapPropagator = class {
16116
15993
  /** Noop inject function does nothing */
16117
15994
  inject(_context, _carrier) {
@@ -16144,7 +16021,6 @@ var BAGGAGE_KEY;
16144
16021
  var init_context_helpers = __esm({
16145
16022
  "../../node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js"() {
16146
16023
  "use strict";
16147
- init_cjs_shims();
16148
16024
  init_context2();
16149
16025
  init_context();
16150
16026
  BAGGAGE_KEY = createContextKey("OpenTelemetry Baggage Key");
@@ -16156,7 +16032,6 @@ var API_NAME4, NOOP_TEXT_MAP_PROPAGATOR, PropagationAPI;
16156
16032
  var init_propagation = __esm({
16157
16033
  "../../node_modules/@opentelemetry/api/build/esm/api/propagation.js"() {
16158
16034
  "use strict";
16159
- init_cjs_shims();
16160
16035
  init_global_utils();
16161
16036
  init_NoopTextMapPropagator();
16162
16037
  init_TextMapPropagator();
@@ -16231,7 +16106,6 @@ var propagation;
16231
16106
  var init_propagation_api = __esm({
16232
16107
  "../../node_modules/@opentelemetry/api/build/esm/propagation-api.js"() {
16233
16108
  "use strict";
16234
- init_cjs_shims();
16235
16109
  init_propagation();
16236
16110
  propagation = PropagationAPI.getInstance();
16237
16111
  }
@@ -16242,7 +16116,6 @@ var API_NAME5, TraceAPI;
16242
16116
  var init_trace = __esm({
16243
16117
  "../../node_modules/@opentelemetry/api/build/esm/api/trace.js"() {
16244
16118
  "use strict";
16245
- init_cjs_shims();
16246
16119
  init_global_utils();
16247
16120
  init_ProxyTracerProvider();
16248
16121
  init_spancontext_utils();
@@ -16307,7 +16180,6 @@ var trace;
16307
16180
  var init_trace_api = __esm({
16308
16181
  "../../node_modules/@opentelemetry/api/build/esm/trace-api.js"() {
16309
16182
  "use strict";
16310
- init_cjs_shims();
16311
16183
  init_trace();
16312
16184
  trace = TraceAPI.getInstance();
16313
16185
  }
@@ -16349,7 +16221,6 @@ var esm_default;
16349
16221
  var init_esm = __esm({
16350
16222
  "../../node_modules/@opentelemetry/api/build/esm/index.js"() {
16351
16223
  "use strict";
16352
- init_cjs_shims();
16353
16224
  init_utils();
16354
16225
  init_context();
16355
16226
  init_consoleLogger();
@@ -16387,8 +16258,8 @@ function sanitize(input) {
16387
16258
  }
16388
16259
  function markerFileExists() {
16389
16260
  try {
16390
- const fs4 = require("fs");
16391
- const path4 = require("path");
16261
+ const fs4 = require("node:fs");
16262
+ const path4 = require("node:path");
16392
16263
  const markerPath = path4.join(process.cwd(), ".glasstrace", "mcp-connected");
16393
16264
  return fs4.existsSync(markerPath);
16394
16265
  } catch {
@@ -16421,7 +16292,6 @@ var hasFired;
16421
16292
  var init_error_nudge = __esm({
16422
16293
  "src/nudge/error-nudge.ts"() {
16423
16294
  "use strict";
16424
- init_cjs_shims();
16425
16295
  init_env_detection();
16426
16296
  hasFired = false;
16427
16297
  }
@@ -16494,7 +16364,6 @@ var isGlasstraceLog, originalError, originalWarn, installed, otelApi;
16494
16364
  var init_console_capture = __esm({
16495
16365
  "src/console-capture.ts"() {
16496
16366
  "use strict";
16497
- init_cjs_shims();
16498
16367
  init_error_nudge();
16499
16368
  isGlasstraceLog = false;
16500
16369
  originalError = null;
@@ -16825,11 +16694,10 @@ var fs2, path2, crypto2, import_node_child_process, LARGE_FILE_WARNING_BYTES, PR
16825
16694
  var init_source_map_uploader = __esm({
16826
16695
  "src/source-map-uploader.ts"() {
16827
16696
  "use strict";
16828
- init_cjs_shims();
16829
- fs2 = __toESM(require("fs/promises"), 1);
16830
- path2 = __toESM(require("path"), 1);
16831
- crypto2 = __toESM(require("crypto"), 1);
16832
- import_node_child_process = require("child_process");
16697
+ fs2 = __toESM(require("node:fs/promises"), 1);
16698
+ path2 = __toESM(require("node:path"), 1);
16699
+ crypto2 = __toESM(require("node:crypto"), 1);
16700
+ import_node_child_process = require("node:child_process");
16833
16701
  init_console_capture();
16834
16702
  init_dist();
16835
16703
  LARGE_FILE_WARNING_BYTES = 50 * 1024 * 1024;
@@ -16882,10 +16750,8 @@ __export(src_exports, {
16882
16750
  withGlasstraceConfig: () => withGlasstraceConfig
16883
16751
  });
16884
16752
  module.exports = __toCommonJS(src_exports);
16885
- init_cjs_shims();
16886
16753
 
16887
16754
  // src/errors.ts
16888
- init_cjs_shims();
16889
16755
  var SdkError = class extends Error {
16890
16756
  code;
16891
16757
  constructor(code, message, cause) {
@@ -16899,7 +16765,6 @@ var SdkError = class extends Error {
16899
16765
  init_env_detection();
16900
16766
 
16901
16767
  // src/session.ts
16902
- init_cjs_shims();
16903
16768
  init_dist();
16904
16769
  var FOUR_HOURS_MS = 4 * 60 * 60 * 1e3;
16905
16770
  var hashFn = null;
@@ -16915,7 +16780,7 @@ function fnv1aHash(input) {
16915
16780
  function getHashFn() {
16916
16781
  if (hashFn) return hashFn;
16917
16782
  try {
16918
- const { createHash: createHash3 } = require("crypto");
16783
+ const { createHash: createHash3 } = require("node:crypto");
16919
16784
  hashFn = (input) => createHash3("sha256").update(input).digest("hex").slice(0, 16);
16920
16785
  } catch {
16921
16786
  hashFn = (input) => {
@@ -16991,7 +16856,6 @@ var SessionManager = class {
16991
16856
  };
16992
16857
 
16993
16858
  // src/fetch-classifier.ts
16994
- init_cjs_shims();
16995
16859
  var cachedPort2 = process.env.PORT ?? "3000";
16996
16860
  function classifyFetchTarget(url2) {
16997
16861
  let parsed;
@@ -17017,7 +16881,6 @@ function classifyFetchTarget(url2) {
17017
16881
  }
17018
16882
 
17019
16883
  // src/anon-key.ts
17020
- init_cjs_shims();
17021
16884
  init_dist();
17022
16885
  var GLASSTRACE_DIR = ".glasstrace";
17023
16886
  var ANON_KEY_FILE = "anon_key";
@@ -17026,8 +16889,8 @@ async function loadFsPath() {
17026
16889
  if (fsPathCache !== void 0) return fsPathCache;
17027
16890
  try {
17028
16891
  const [fs4, path4] = await Promise.all([
17029
- import("fs/promises"),
17030
- import("path")
16892
+ import("node:fs/promises"),
16893
+ import("node:path")
17031
16894
  ]);
17032
16895
  fsPathCache = { fs: fs4, path: path4 };
17033
16896
  return fsPathCache;
@@ -17107,11 +16970,9 @@ async function getOrCreateAnonKey(projectRoot) {
17107
16970
  }
17108
16971
 
17109
16972
  // src/init-client.ts
17110
- init_cjs_shims();
17111
16973
  init_dist();
17112
16974
 
17113
16975
  // src/health-collector.ts
17114
- init_cjs_shims();
17115
16976
  var tracesExported = 0;
17116
16977
  var tracesDropped = 0;
17117
16978
  var initFailures = 0;
@@ -17163,6 +17024,238 @@ function acknowledgeHealthReport(report) {
17163
17024
  initFailures = Number.isFinite(failVal) ? Math.max(0, failVal) : initFailures;
17164
17025
  }
17165
17026
 
17027
+ // src/https-transport.ts
17028
+ var import_node_https = require("node:https");
17029
+ var import_node_http = require("node:http");
17030
+ var import_node_url = require("node:url");
17031
+ var HttpsTransportError = class extends Error {
17032
+ kind = "transport";
17033
+ cause;
17034
+ constructor(message, cause) {
17035
+ super(message);
17036
+ this.name = "HttpsTransportError";
17037
+ this.cause = cause;
17038
+ }
17039
+ };
17040
+ var HttpsStatusError = class extends Error {
17041
+ kind = "status";
17042
+ status;
17043
+ /** Raw response body text (may be truncated by caller if large). */
17044
+ body;
17045
+ constructor(status, body) {
17046
+ super(`Server returned HTTP ${status}`);
17047
+ this.name = "HttpsStatusError";
17048
+ this.status = status;
17049
+ this.body = body;
17050
+ }
17051
+ };
17052
+ var HttpsBodyParseError = class extends Error {
17053
+ kind = "parse";
17054
+ status;
17055
+ cause;
17056
+ constructor(status, cause) {
17057
+ super(`Server returned malformed response (HTTP ${status})`);
17058
+ this.name = "HttpsBodyParseError";
17059
+ this.status = status;
17060
+ this.cause = cause;
17061
+ }
17062
+ };
17063
+ var DEFAULT_TIMEOUT_MS = 1e4;
17064
+ var DEFAULT_RETRY_DELAYS_MS = [500, 1500];
17065
+ var DEFAULT_TOTAL_DEADLINE_MS = 2e4;
17066
+ async function httpsPostJson(url2, jsonBody, options) {
17067
+ const parsed = new import_node_url.URL(url2);
17068
+ const isHttps = parsed.protocol === "https:";
17069
+ const isHttp = parsed.protocol === "http:";
17070
+ if (!isHttps && !isHttp) {
17071
+ throw new HttpsTransportError(
17072
+ `Unsupported protocol: ${parsed.protocol} (expected http: or https:)`
17073
+ );
17074
+ }
17075
+ const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
17076
+ const maxAttempts = options.maxAttempts ?? 3;
17077
+ const retryDelaysMs = options.retryDelaysMs ?? DEFAULT_RETRY_DELAYS_MS;
17078
+ const totalDeadlineMs = options.totalDeadlineMs ?? DEFAULT_TOTAL_DEADLINE_MS;
17079
+ const scheduler = options.scheduler ?? ((fn, ms) => setTimeout(fn, ms));
17080
+ const requestImpl = isHttps ? options.requestImpl ?? import_node_https.request : options.httpRequestImpl ?? import_node_http.request;
17081
+ let payload;
17082
+ try {
17083
+ payload = JSON.stringify(jsonBody);
17084
+ } catch (err) {
17085
+ throw new HttpsTransportError(
17086
+ `Failed to serialize request body: ${err instanceof Error ? err.message : String(err)}`,
17087
+ err
17088
+ );
17089
+ }
17090
+ const payloadBuffer = Buffer.from(payload, "utf-8");
17091
+ const startedAt = Date.now();
17092
+ let lastError;
17093
+ for (let attempt = 0; attempt < maxAttempts; attempt += 1) {
17094
+ if (options.signal?.aborted) {
17095
+ throw new HttpsTransportError("Request aborted");
17096
+ }
17097
+ const elapsed = Date.now() - startedAt;
17098
+ if (elapsed >= totalDeadlineMs) {
17099
+ break;
17100
+ }
17101
+ const remainingBudget = totalDeadlineMs - elapsed;
17102
+ const attemptTimeoutMs = Math.min(timeoutMs, remainingBudget);
17103
+ try {
17104
+ return await sendSingleRequest(
17105
+ parsed,
17106
+ payloadBuffer,
17107
+ options.headers,
17108
+ attemptTimeoutMs,
17109
+ options.signal,
17110
+ requestImpl
17111
+ );
17112
+ } catch (err) {
17113
+ lastError = err;
17114
+ if (err instanceof HttpsStatusError || err instanceof HttpsBodyParseError) {
17115
+ throw err;
17116
+ }
17117
+ const isLast = attempt === maxAttempts - 1;
17118
+ if (isLast) break;
17119
+ const delayMs = retryDelaysMs[attempt] ?? retryDelaysMs[retryDelaysMs.length - 1] ?? 0;
17120
+ const elapsedBeforeSleep = Date.now() - startedAt;
17121
+ const remaining = totalDeadlineMs - elapsedBeforeSleep;
17122
+ if (remaining <= 0) break;
17123
+ const actualDelayMs = Math.min(delayMs, remaining);
17124
+ await sleep(actualDelayMs, scheduler, options.signal);
17125
+ }
17126
+ }
17127
+ if (lastError instanceof HttpsTransportError) throw lastError;
17128
+ throw new HttpsTransportError(
17129
+ lastError instanceof Error ? lastError.message : "Request failed",
17130
+ lastError
17131
+ );
17132
+ }
17133
+ function sendSingleRequest(url2, payload, headers, timeoutMs, signal, requestImpl) {
17134
+ return new Promise((resolve3, reject) => {
17135
+ const finalHeaders = {
17136
+ ...headers,
17137
+ "Content-Length": payload.byteLength
17138
+ };
17139
+ const reqOptions = {
17140
+ method: "POST",
17141
+ hostname: url2.hostname,
17142
+ port: url2.port === "" ? void 0 : Number(url2.port),
17143
+ path: `${url2.pathname}${url2.search}`,
17144
+ headers: finalHeaders,
17145
+ // Explicit timeout at the socket level. Still complemented by a
17146
+ // manual timer below because `timeout` only fires when the socket
17147
+ // is idle — it does not cover "TLS handshake hangs forever".
17148
+ timeout: timeoutMs
17149
+ };
17150
+ let settled = false;
17151
+ let cleanup = () => {
17152
+ };
17153
+ const settle = (fn) => {
17154
+ if (settled) return;
17155
+ settled = true;
17156
+ cleanup();
17157
+ fn();
17158
+ };
17159
+ const req = requestImpl(reqOptions, (res) => {
17160
+ const chunks = [];
17161
+ res.on("data", (chunk) => {
17162
+ chunks.push(typeof chunk === "string" ? Buffer.from(chunk, "utf-8") : chunk);
17163
+ });
17164
+ res.on("end", () => {
17165
+ const raw = Buffer.concat(chunks).toString("utf-8");
17166
+ const status = res.statusCode ?? 0;
17167
+ if (status < 200 || status >= 300) {
17168
+ settle(() => reject(new HttpsStatusError(status, raw)));
17169
+ return;
17170
+ }
17171
+ if (status === 204 || raw.length === 0) {
17172
+ settle(() => resolve3({ status, body: void 0, raw }));
17173
+ return;
17174
+ }
17175
+ try {
17176
+ const parsed = JSON.parse(raw);
17177
+ settle(() => resolve3({ status, body: parsed, raw }));
17178
+ } catch (err) {
17179
+ settle(() => reject(new HttpsBodyParseError(status, err)));
17180
+ }
17181
+ });
17182
+ res.on("error", (err) => {
17183
+ settle(() => reject(new HttpsTransportError(`Response stream error: ${err.message}`, err)));
17184
+ });
17185
+ });
17186
+ const timer = setTimeout(() => {
17187
+ settle(() => {
17188
+ req.destroy(new Error("Request timed out"));
17189
+ reject(new HttpsTransportError(`Request timed out after ${timeoutMs}ms`));
17190
+ });
17191
+ }, timeoutMs);
17192
+ if (typeof timer.unref === "function") timer.unref();
17193
+ const onAbort = () => {
17194
+ settle(() => {
17195
+ req.destroy(new Error("Aborted"));
17196
+ reject(new HttpsTransportError("Request aborted"));
17197
+ });
17198
+ };
17199
+ cleanup = () => {
17200
+ clearTimeout(timer);
17201
+ if (signal !== void 0) {
17202
+ signal.removeEventListener("abort", onAbort);
17203
+ }
17204
+ };
17205
+ req.on("error", (err) => {
17206
+ settle(() => reject(new HttpsTransportError(`fetch failed: ${err.message}`, err)));
17207
+ });
17208
+ req.on("timeout", () => {
17209
+ settle(() => {
17210
+ req.destroy(new Error("Request timed out"));
17211
+ reject(new HttpsTransportError(`Request timed out after ${timeoutMs}ms`));
17212
+ });
17213
+ });
17214
+ if (signal !== void 0) {
17215
+ if (signal.aborted) {
17216
+ req.destroy(new Error("Aborted"));
17217
+ settle(() => reject(new HttpsTransportError("Request aborted")));
17218
+ return;
17219
+ }
17220
+ signal.addEventListener("abort", onAbort, { once: true });
17221
+ }
17222
+ req.end(payload);
17223
+ });
17224
+ }
17225
+ function sleep(ms, scheduler, signal) {
17226
+ return new Promise((resolve3, reject) => {
17227
+ let settled = false;
17228
+ let cleanup = () => {
17229
+ };
17230
+ const settle = (fn) => {
17231
+ if (settled) return;
17232
+ settled = true;
17233
+ cleanup();
17234
+ fn();
17235
+ };
17236
+ const onAbort = () => {
17237
+ settle(() => reject(new HttpsTransportError("Request aborted")));
17238
+ };
17239
+ const timer = scheduler(() => {
17240
+ settle(resolve3);
17241
+ }, ms);
17242
+ if (typeof timer.unref === "function") timer.unref();
17243
+ cleanup = () => {
17244
+ clearTimeout(timer);
17245
+ if (signal !== void 0) {
17246
+ signal.removeEventListener("abort", onAbort);
17247
+ }
17248
+ };
17249
+ if (signal !== void 0) {
17250
+ if (signal.aborted) {
17251
+ onAbort();
17252
+ return;
17253
+ }
17254
+ signal.addEventListener("abort", onAbort, { once: true });
17255
+ }
17256
+ });
17257
+ }
17258
+
17166
17259
  // src/init-client.ts
17167
17260
  var GLASSTRACE_DIR2 = ".glasstrace";
17168
17261
  var CONFIG_FILE = "config";
@@ -17173,8 +17266,8 @@ async function loadFsPathAsync() {
17173
17266
  if (fsPathAsyncCache !== void 0) return fsPathAsyncCache;
17174
17267
  try {
17175
17268
  const [fs4, path4] = await Promise.all([
17176
- import("fs/promises"),
17177
- import("path")
17269
+ import("node:fs/promises"),
17270
+ import("node:path")
17178
17271
  ]);
17179
17272
  fsPathAsyncCache = { fs: fs4, path: path4 };
17180
17273
  return fsPathAsyncCache;
@@ -17185,13 +17278,14 @@ async function loadFsPathAsync() {
17185
17278
  }
17186
17279
  function loadFsSyncOrNull() {
17187
17280
  try {
17188
- const fs4 = require("fs");
17189
- const path4 = require("path");
17281
+ const fs4 = require("node:fs");
17282
+ const path4 = require("node:path");
17190
17283
  return { readFileSync: fs4.readFileSync, join: path4.join };
17191
17284
  } catch {
17192
17285
  return null;
17193
17286
  }
17194
17287
  }
17288
+ var transportOverride = null;
17195
17289
  var currentConfig = null;
17196
17290
  var configCacheChecked = false;
17197
17291
  var rateLimitBackoff = false;
@@ -17228,6 +17322,7 @@ async function saveCachedConfig(response, projectRoot) {
17228
17322
  const root = projectRoot ?? process.cwd();
17229
17323
  const dirPath = modules.path.join(root, GLASSTRACE_DIR2);
17230
17324
  const configPath = modules.path.join(dirPath, CONFIG_FILE);
17325
+ const tmpPath = `${configPath}.tmp`;
17231
17326
  try {
17232
17327
  await modules.fs.mkdir(dirPath, { recursive: true, mode: 448 });
17233
17328
  await modules.fs.chmod(dirPath, 448);
@@ -17235,7 +17330,20 @@ async function saveCachedConfig(response, projectRoot) {
17235
17330
  response,
17236
17331
  cachedAt: Date.now()
17237
17332
  };
17238
- await modules.fs.writeFile(configPath, JSON.stringify(cached2), { encoding: "utf-8", mode: 384 });
17333
+ await modules.fs.writeFile(tmpPath, JSON.stringify(cached2), {
17334
+ encoding: "utf-8",
17335
+ mode: 384
17336
+ });
17337
+ try {
17338
+ await modules.fs.chmod(tmpPath, 384);
17339
+ await modules.fs.rename(tmpPath, configPath);
17340
+ } catch (renameErr) {
17341
+ try {
17342
+ await modules.fs.unlink(tmpPath);
17343
+ } catch {
17344
+ }
17345
+ throw renameErr;
17346
+ }
17239
17347
  await modules.fs.chmod(configPath, 384);
17240
17348
  } catch (err) {
17241
17349
  console.warn(
@@ -17267,26 +17375,34 @@ async function sendInitRequest(config2, anonKey, sdkVersion, importGraph, health
17267
17375
  payload.diagnostics = diagnostics;
17268
17376
  }
17269
17377
  const url2 = `${config2.endpoint}/v1/sdk/init`;
17270
- const response = await fetch(url2, {
17271
- method: "POST",
17272
- headers: {
17273
- "Content-Type": "application/json",
17274
- Authorization: `Bearer ${effectiveKey}`
17275
- },
17276
- body: JSON.stringify(payload),
17277
- signal
17278
- });
17279
- if (!response.ok) {
17280
- try {
17281
- await response.text();
17282
- } catch {
17378
+ const transport = transportOverride ?? httpsPostJson;
17379
+ let result;
17380
+ try {
17381
+ result = await transport(url2, payload, {
17382
+ headers: {
17383
+ "Content-Type": "application/json",
17384
+ Authorization: `Bearer ${effectiveKey}`
17385
+ },
17386
+ timeoutMs: INIT_TIMEOUT_MS,
17387
+ signal
17388
+ });
17389
+ } catch (err) {
17390
+ if (err instanceof HttpsStatusError) {
17391
+ const error48 = new Error(`Init request failed with status ${err.status}`);
17392
+ error48.status = err.status;
17393
+ throw error48;
17394
+ }
17395
+ if (err instanceof HttpsBodyParseError) {
17396
+ const cause = err.cause;
17397
+ if (cause instanceof SyntaxError) throw cause;
17398
+ throw err;
17283
17399
  }
17284
- const error48 = new Error(`Init request failed with status ${response.status}`);
17285
- error48.status = response.status;
17286
- throw error48;
17400
+ if (err instanceof HttpsTransportError) {
17401
+ throw err;
17402
+ }
17403
+ throw err;
17287
17404
  }
17288
- const body = await response.json();
17289
- return SdkInitResponseSchema.parse(body);
17405
+ return SdkInitResponseSchema.parse(result.body);
17290
17406
  }
17291
17407
  async function writeClaimedKey(newApiKey, projectRoot) {
17292
17408
  const modules = await loadFsPathAsync();
@@ -17375,8 +17491,6 @@ async function performInit(config2, anonKey, sdkVersion, healthReport) {
17375
17491
  console.warn("[glasstrace] No API key available for init request.");
17376
17492
  return null;
17377
17493
  }
17378
- const controller = new AbortController();
17379
- const timeoutId = setTimeout(() => controller.abort(), INIT_TIMEOUT_MS);
17380
17494
  try {
17381
17495
  const result = await sendInitRequest(
17382
17496
  config2,
@@ -17384,10 +17498,8 @@ async function performInit(config2, anonKey, sdkVersion, healthReport) {
17384
17498
  sdkVersion,
17385
17499
  void 0,
17386
17500
  healthReport ?? void 0,
17387
- void 0,
17388
- controller.signal
17501
+ void 0
17389
17502
  );
17390
- clearTimeout(timeoutId);
17391
17503
  currentConfig = result;
17392
17504
  recordConfigSync(Date.now());
17393
17505
  if (healthReport) {
@@ -17404,10 +17516,13 @@ async function performInit(config2, anonKey, sdkVersion, healthReport) {
17404
17516
  }
17405
17517
  return null;
17406
17518
  } catch (err) {
17407
- clearTimeout(timeoutId);
17408
17519
  recordInitFailure();
17409
- if (err instanceof DOMException && err.name === "AbortError") {
17410
- console.warn("[glasstrace] ingestion_unreachable: Init request timed out.");
17520
+ if (err instanceof HttpsTransportError) {
17521
+ if (/timed out|aborted/i.test(err.message)) {
17522
+ console.warn("[glasstrace] ingestion_unreachable: Init request timed out.");
17523
+ } else {
17524
+ console.warn(`[glasstrace] ingestion_unreachable: ${err.message}`);
17525
+ }
17411
17526
  return null;
17412
17527
  }
17413
17528
  const status = err.status;
@@ -17481,7 +17596,6 @@ function didLastInitSucceed() {
17481
17596
  }
17482
17597
 
17483
17598
  // src/span-processor.ts
17484
- init_cjs_shims();
17485
17599
  var GlasstraceSpanProcessor = class {
17486
17600
  wrappedProcessor;
17487
17601
  /* eslint-disable @typescript-eslint/no-unused-vars -- backward compat signature */
@@ -17503,7 +17617,6 @@ var GlasstraceSpanProcessor = class {
17503
17617
  };
17504
17618
 
17505
17619
  // src/enriching-exporter.ts
17506
- init_cjs_shims();
17507
17620
  init_esm();
17508
17621
  init_dist();
17509
17622
  init_console_capture();
@@ -17885,7 +17998,6 @@ function deriveErrorCategory(errorType) {
17885
17998
  }
17886
17999
 
17887
18000
  // src/discovery-endpoint.ts
17888
- init_cjs_shims();
17889
18001
  function isAllowedOrigin(origin) {
17890
18002
  if (origin === null) return true;
17891
18003
  if (origin.startsWith("chrome-extension://")) return true;
@@ -17975,29 +18087,9 @@ function createDiscoveryHandler(getAnonKey, getSessionId, getClaimState) {
17975
18087
  }
17976
18088
 
17977
18089
  // src/register.ts
17978
- init_cjs_shims();
17979
18090
  init_env_detection();
17980
18091
 
17981
- // src/otel-config.ts
17982
- init_cjs_shims();
17983
-
17984
- // ../../node_modules/@opentelemetry/exporter-trace-otlp-http/build/esm/index.js
17985
- init_cjs_shims();
17986
-
17987
- // ../../node_modules/@opentelemetry/exporter-trace-otlp-http/build/esm/platform/index.js
17988
- init_cjs_shims();
17989
-
17990
- // ../../node_modules/@opentelemetry/exporter-trace-otlp-http/build/esm/platform/node/index.js
17991
- init_cjs_shims();
17992
-
17993
- // ../../node_modules/@opentelemetry/exporter-trace-otlp-http/build/esm/platform/node/OTLPTraceExporter.js
17994
- init_cjs_shims();
17995
-
17996
- // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/index.js
17997
- init_cjs_shims();
17998
-
17999
18092
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/OTLPExporterBase.js
18000
- init_cjs_shims();
18001
18093
  var OTLPExporterBase = class {
18002
18094
  _delegate;
18003
18095
  constructor(delegate) {
@@ -18020,7 +18112,6 @@ var OTLPExporterBase = class {
18020
18112
  };
18021
18113
 
18022
18114
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/types.js
18023
- init_cjs_shims();
18024
18115
  var OTLPExporterError = class extends Error {
18025
18116
  code;
18026
18117
  name = "OTLPExporterError";
@@ -18033,7 +18124,6 @@ var OTLPExporterError = class extends Error {
18033
18124
  };
18034
18125
 
18035
18126
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-configuration.js
18036
- init_cjs_shims();
18037
18127
  function validateTimeoutMillis(timeoutMillis) {
18038
18128
  if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) {
18039
18129
  return timeoutMillis;
@@ -18062,7 +18152,6 @@ function getSharedConfigurationDefaults() {
18062
18152
  }
18063
18153
 
18064
18154
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/bounded-queue-export-promise-handler.js
18065
- init_cjs_shims();
18066
18155
  var BoundedQueueExportPromiseHandler = class {
18067
18156
  _concurrencyLimit;
18068
18157
  _sendingPromises = [];
@@ -18094,14 +18183,7 @@ function createBoundedQueueExportPromiseHandler(options) {
18094
18183
  return new BoundedQueueExportPromiseHandler(options.concurrencyLimit);
18095
18184
  }
18096
18185
 
18097
- // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-export-delegate.js
18098
- init_cjs_shims();
18099
-
18100
- // ../../node_modules/@opentelemetry/core/build/esm/index.js
18101
- init_cjs_shims();
18102
-
18103
18186
  // ../../node_modules/@opentelemetry/core/build/esm/trace/suppress-tracing.js
18104
- init_cjs_shims();
18105
18187
  init_esm();
18106
18188
  var SUPPRESS_TRACING_KEY = createContextKey("OpenTelemetry SDK Context Key SUPPRESS_TRACING");
18107
18189
  function suppressTracing(context2) {
@@ -18112,13 +18194,11 @@ function isTracingSuppressed(context2) {
18112
18194
  }
18113
18195
 
18114
18196
  // ../../node_modules/@opentelemetry/core/build/esm/baggage/constants.js
18115
- init_cjs_shims();
18116
18197
  var BAGGAGE_KEY_PAIR_SEPARATOR = "=";
18117
18198
  var BAGGAGE_PROPERTIES_SEPARATOR = ";";
18118
18199
  var BAGGAGE_ITEMS_SEPARATOR = ",";
18119
18200
 
18120
18201
  // ../../node_modules/@opentelemetry/core/build/esm/baggage/utils.js
18121
- init_cjs_shims();
18122
18202
  init_esm();
18123
18203
  function parsePairKeyValue(entry) {
18124
18204
  if (!entry)
@@ -18161,7 +18241,6 @@ function parseKeyPairsIntoRecord(value) {
18161
18241
  }
18162
18242
 
18163
18243
  // ../../node_modules/@opentelemetry/core/build/esm/common/attributes.js
18164
- init_cjs_shims();
18165
18244
  init_esm();
18166
18245
  function sanitizeAttributes(attributes) {
18167
18246
  const out = {};
@@ -18231,11 +18310,7 @@ function isValidPrimitiveAttributeValueType(valType) {
18231
18310
  return false;
18232
18311
  }
18233
18312
 
18234
- // ../../node_modules/@opentelemetry/core/build/esm/common/global-error-handler.js
18235
- init_cjs_shims();
18236
-
18237
18313
  // ../../node_modules/@opentelemetry/core/build/esm/common/logging-error-handler.js
18238
- init_cjs_shims();
18239
18314
  init_esm();
18240
18315
  function loggingErrorHandler() {
18241
18316
  return (ex) => {
@@ -18275,17 +18350,7 @@ function globalErrorHandler(ex) {
18275
18350
  }
18276
18351
  }
18277
18352
 
18278
- // ../../node_modules/@opentelemetry/core/build/esm/common/time.js
18279
- init_cjs_shims();
18280
-
18281
- // ../../node_modules/@opentelemetry/core/build/esm/platform/index.js
18282
- init_cjs_shims();
18283
-
18284
- // ../../node_modules/@opentelemetry/core/build/esm/platform/node/index.js
18285
- init_cjs_shims();
18286
-
18287
18353
  // ../../node_modules/@opentelemetry/core/build/esm/platform/node/environment.js
18288
- init_cjs_shims();
18289
18354
  init_esm();
18290
18355
  var import_util3 = require("util");
18291
18356
  function getNumberFromEnv(key) {
@@ -18308,15 +18373,10 @@ function getStringFromEnv(key) {
18308
18373
  return raw;
18309
18374
  }
18310
18375
 
18311
- // ../../node_modules/@opentelemetry/core/build/esm/platform/node/sdk-info.js
18312
- init_cjs_shims();
18313
-
18314
18376
  // ../../node_modules/@opentelemetry/core/build/esm/version.js
18315
- init_cjs_shims();
18316
18377
  var VERSION2 = "2.6.1";
18317
18378
 
18318
18379
  // ../../node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js
18319
- init_cjs_shims();
18320
18380
  var ATTR_EXCEPTION_MESSAGE = "exception.message";
18321
18381
  var ATTR_EXCEPTION_STACKTRACE = "exception.stacktrace";
18322
18382
  var ATTR_EXCEPTION_TYPE = "exception.type";
@@ -18327,7 +18387,6 @@ var ATTR_TELEMETRY_SDK_NAME = "telemetry.sdk.name";
18327
18387
  var ATTR_TELEMETRY_SDK_VERSION = "telemetry.sdk.version";
18328
18388
 
18329
18389
  // ../../node_modules/@opentelemetry/core/build/esm/semconv.js
18330
- init_cjs_shims();
18331
18390
  var ATTR_PROCESS_RUNTIME_NAME = "process.runtime.name";
18332
18391
 
18333
18392
  // ../../node_modules/@opentelemetry/core/build/esm/platform/node/sdk-info.js
@@ -18385,18 +18444,13 @@ function addHrTimes(time1, time22) {
18385
18444
  }
18386
18445
 
18387
18446
  // ../../node_modules/@opentelemetry/core/build/esm/ExportResult.js
18388
- init_cjs_shims();
18389
18447
  var ExportResultCode;
18390
18448
  (function(ExportResultCode2) {
18391
18449
  ExportResultCode2[ExportResultCode2["SUCCESS"] = 0] = "SUCCESS";
18392
18450
  ExportResultCode2[ExportResultCode2["FAILED"] = 1] = "FAILED";
18393
18451
  })(ExportResultCode || (ExportResultCode = {}));
18394
18452
 
18395
- // ../../node_modules/@opentelemetry/core/build/esm/utils/merge.js
18396
- init_cjs_shims();
18397
-
18398
18453
  // ../../node_modules/@opentelemetry/core/build/esm/utils/lodash.merge.js
18399
- init_cjs_shims();
18400
18454
  var objectTag = "[object Object]";
18401
18455
  var nullTag = "[object Null]";
18402
18456
  var undefinedTag = "[object Undefined]";
@@ -18556,11 +18610,7 @@ function shouldMerge(one, two) {
18556
18610
  return true;
18557
18611
  }
18558
18612
 
18559
- // ../../node_modules/@opentelemetry/core/build/esm/utils/callback.js
18560
- init_cjs_shims();
18561
-
18562
18613
  // ../../node_modules/@opentelemetry/core/build/esm/utils/promise.js
18563
- init_cjs_shims();
18564
18614
  var Deferred = class {
18565
18615
  _promise;
18566
18616
  _resolve;
@@ -18612,7 +18662,6 @@ var BindOnceFuture = class {
18612
18662
  };
18613
18663
 
18614
18664
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/logging-response-handler.js
18615
- init_cjs_shims();
18616
18665
  init_esm();
18617
18666
  function isPartialSuccessResponse(response) {
18618
18667
  return Object.prototype.hasOwnProperty.call(response, "partialSuccess");
@@ -18712,11 +18761,7 @@ function createOtlpExportDelegate(components, settings) {
18712
18761
  return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, settings.timeout);
18713
18762
  }
18714
18763
 
18715
- // ../../node_modules/@opentelemetry/otlp-transformer/build/esm/index.js
18716
- init_cjs_shims();
18717
-
18718
18764
  // ../../node_modules/@opentelemetry/otlp-transformer/build/esm/common/internal.js
18719
- init_cjs_shims();
18720
18765
  function createResource(resource, encoder) {
18721
18766
  const result = {
18722
18767
  attributes: toAttributes(resource.attributes, encoder),
@@ -18777,7 +18822,6 @@ function toAnyValue(value, encoder) {
18777
18822
  }
18778
18823
 
18779
18824
  // ../../node_modules/@opentelemetry/otlp-transformer/build/esm/common/utils.js
18780
- init_cjs_shims();
18781
18825
  function hrTimeToNanos(hrTime2) {
18782
18826
  const NANOSECONDS = BigInt(1e9);
18783
18827
  return BigInt(Math.trunc(hrTime2[0])) * NANOSECONDS + BigInt(Math.trunc(hrTime2[1]));
@@ -18806,15 +18850,10 @@ var JSON_ENCODER = {
18806
18850
  }
18807
18851
  };
18808
18852
 
18809
- // ../../node_modules/@opentelemetry/resources/build/esm/index.js
18810
- init_cjs_shims();
18811
-
18812
18853
  // ../../node_modules/@opentelemetry/resources/build/esm/ResourceImpl.js
18813
- init_cjs_shims();
18814
18854
  init_esm();
18815
18855
 
18816
18856
  // ../../node_modules/@opentelemetry/resources/build/esm/default-service-name.js
18817
- init_cjs_shims();
18818
18857
  var serviceName;
18819
18858
  function defaultServiceName() {
18820
18859
  if (serviceName === void 0) {
@@ -18829,7 +18868,6 @@ function defaultServiceName() {
18829
18868
  }
18830
18869
 
18831
18870
  // ../../node_modules/@opentelemetry/resources/build/esm/utils.js
18832
- init_cjs_shims();
18833
18871
  var isPromiseLike = (val) => {
18834
18872
  return val !== null && typeof val === "object" && typeof val.then === "function";
18835
18873
  };
@@ -18957,7 +18995,6 @@ function mergeSchemaUrl(old, updating) {
18957
18995
  }
18958
18996
 
18959
18997
  // ../../node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js
18960
- init_cjs_shims();
18961
18998
  var SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 256;
18962
18999
  var SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 512;
18963
19000
  function buildSpanFlagsFrom(traceFlags, isRemote) {
@@ -19070,11 +19107,7 @@ function spanRecordsToResourceSpans(readableSpans, encoder) {
19070
19107
  return out;
19071
19108
  }
19072
19109
 
19073
- // ../../node_modules/@opentelemetry/otlp-transformer/build/esm/trace/json/index.js
19074
- init_cjs_shims();
19075
-
19076
19110
  // ../../node_modules/@opentelemetry/otlp-transformer/build/esm/trace/json/trace.js
19077
- init_cjs_shims();
19078
19111
  var JsonTraceSerializer = {
19079
19112
  serializeRequest: (arg) => {
19080
19113
  const request = createExportTraceServiceRequest(arg, JSON_ENCODER);
@@ -19090,17 +19123,7 @@ var JsonTraceSerializer = {
19090
19123
  }
19091
19124
  };
19092
19125
 
19093
- // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/index-node-http.js
19094
- init_cjs_shims();
19095
-
19096
- // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-configuration.js
19097
- init_cjs_shims();
19098
-
19099
- // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-http-configuration.js
19100
- init_cjs_shims();
19101
-
19102
19126
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/util.js
19103
- init_cjs_shims();
19104
19127
  init_esm();
19105
19128
  function validateAndNormalizeHeaders(partialHeaders) {
19106
19129
  const headers = {};
@@ -19183,19 +19206,11 @@ function getNodeHttpConfigurationDefaults(requiredHeaders, signalResourcePath) {
19183
19206
  };
19184
19207
  }
19185
19208
 
19186
- // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-http-export-delegate.js
19187
- init_cjs_shims();
19188
-
19189
- // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-exporter-transport.js
19190
- init_cjs_shims();
19191
-
19192
19209
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-transport-utils.js
19193
- init_cjs_shims();
19194
19210
  var zlib = __toESM(require("zlib"));
19195
19211
  var import_stream = require("stream");
19196
19212
 
19197
19213
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/is-export-retryable.js
19198
- init_cjs_shims();
19199
19214
  function isExportHTTPErrorRetryable(statusCode) {
19200
19215
  return statusCode === 429 || statusCode === 502 || statusCode === 503 || statusCode === 504;
19201
19216
  }
@@ -19215,7 +19230,6 @@ function parseRetryAfterToMills(retryAfter) {
19215
19230
  }
19216
19231
 
19217
19232
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/version.js
19218
- init_cjs_shims();
19219
19233
  var VERSION3 = "0.214.0";
19220
19234
 
19221
19235
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-transport-utils.js
@@ -19373,7 +19387,6 @@ function createHttpExporterTransport(parameters) {
19373
19387
  }
19374
19388
 
19375
19389
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/retrying-transport.js
19376
- init_cjs_shims();
19377
19390
  init_esm();
19378
19391
  var MAX_ATTEMPTS = 5;
19379
19392
  var INITIAL_BACKOFF = 1e3;
@@ -19442,7 +19455,6 @@ function createOtlpHttpExportDelegate(options, serializer) {
19442
19455
  }
19443
19456
 
19444
19457
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-env-configuration.js
19445
- init_cjs_shims();
19446
19458
  init_esm();
19447
19459
  function parseAndValidateTimeoutFromEnv(timeoutEnvVar) {
19448
19460
  const envTimeout = getNumberFromEnv(timeoutEnvVar);
@@ -19480,11 +19492,9 @@ function getSharedConfigurationFromEnvironment(signalIdentifier) {
19480
19492
  }
19481
19493
 
19482
19494
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-node-http-options.js
19483
- init_cjs_shims();
19484
19495
  init_esm();
19485
19496
 
19486
19497
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-node-http-env-configuration.js
19487
- init_cjs_shims();
19488
19498
  var fs = __toESM(require("fs"));
19489
19499
  var path = __toESM(require("path"));
19490
19500
  init_esm();
@@ -19579,7 +19589,6 @@ function getNodeHttpConfigurationFromEnvironment(signalIdentifier, signalResourc
19579
19589
  }
19580
19590
 
19581
19591
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-http-options.js
19582
- init_cjs_shims();
19583
19592
  function convertLegacyHeaders(config2) {
19584
19593
  if (typeof config2.headers === "function") {
19585
19594
  return config2.headers;
@@ -19626,22 +19635,13 @@ var OTLPTraceExporter = class extends OTLPExporterBase {
19626
19635
  }
19627
19636
  };
19628
19637
 
19629
- // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/index.js
19630
- init_cjs_shims();
19631
-
19632
- // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/BasicTracerProvider.js
19633
- init_cjs_shims();
19634
-
19635
19638
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/Tracer.js
19636
- init_cjs_shims();
19637
19639
  init_esm();
19638
19640
 
19639
19641
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/Span.js
19640
- init_cjs_shims();
19641
19642
  init_esm();
19642
19643
 
19643
19644
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/enums.js
19644
- init_cjs_shims();
19645
19645
  var ExceptionEventName = "exception";
19646
19646
 
19647
19647
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/Span.js
@@ -19993,18 +19993,10 @@ var SpanImpl = class {
19993
19993
  }
19994
19994
  };
19995
19995
 
19996
- // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/utility.js
19997
- init_cjs_shims();
19998
-
19999
19996
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/config.js
20000
- init_cjs_shims();
20001
19997
  init_esm();
20002
19998
 
20003
- // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/AlwaysOffSampler.js
20004
- init_cjs_shims();
20005
-
20006
19999
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/Sampler.js
20007
- init_cjs_shims();
20008
20000
  var SamplingDecision2;
20009
20001
  (function(SamplingDecision3) {
20010
20002
  SamplingDecision3[SamplingDecision3["NOT_RECORD"] = 0] = "NOT_RECORD";
@@ -20025,7 +20017,6 @@ var AlwaysOffSampler = class {
20025
20017
  };
20026
20018
 
20027
20019
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/AlwaysOnSampler.js
20028
- init_cjs_shims();
20029
20020
  var AlwaysOnSampler = class {
20030
20021
  shouldSample() {
20031
20022
  return {
@@ -20038,7 +20029,6 @@ var AlwaysOnSampler = class {
20038
20029
  };
20039
20030
 
20040
20031
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/ParentBasedSampler.js
20041
- init_cjs_shims();
20042
20032
  init_esm();
20043
20033
  var ParentBasedSampler = class {
20044
20034
  _root;
@@ -20079,7 +20069,6 @@ var ParentBasedSampler = class {
20079
20069
  };
20080
20070
 
20081
20071
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/TraceIdRatioBasedSampler.js
20082
- init_cjs_shims();
20083
20072
  init_esm();
20084
20073
  var TraceIdRatioBasedSampler = class {
20085
20074
  _ratio;
@@ -20202,17 +20191,7 @@ function reconfigureLimits(userConfig) {
20202
20191
  return Object.assign({}, userConfig, { spanLimits });
20203
20192
  }
20204
20193
 
20205
- // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/index.js
20206
- init_cjs_shims();
20207
-
20208
- // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/node/index.js
20209
- init_cjs_shims();
20210
-
20211
- // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/node/export/BatchSpanProcessor.js
20212
- init_cjs_shims();
20213
-
20214
20194
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/export/BatchSpanProcessorBase.js
20215
- init_cjs_shims();
20216
20195
  init_esm();
20217
20196
  var BatchSpanProcessorBase = class {
20218
20197
  _maxExportBatchSize;
@@ -20385,7 +20364,6 @@ var BatchSpanProcessor = class extends BatchSpanProcessorBase {
20385
20364
  };
20386
20365
 
20387
20366
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/node/RandomIdGenerator.js
20388
- init_cjs_shims();
20389
20367
  var SPAN_ID_BYTES = 8;
20390
20368
  var TRACE_ID_BYTES = 16;
20391
20369
  var RandomIdGenerator = class {
@@ -20417,11 +20395,7 @@ function getIdGenerator(bytes) {
20417
20395
  };
20418
20396
  }
20419
20397
 
20420
- // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/TracerMetrics.js
20421
- init_cjs_shims();
20422
-
20423
20398
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/semconv.js
20424
- init_cjs_shims();
20425
20399
  var ATTR_OTEL_SPAN_PARENT_ORIGIN = "otel.span.parent.origin";
20426
20400
  var ATTR_OTEL_SPAN_SAMPLING_RESULT = "otel.span.sampling_result";
20427
20401
  var METRIC_OTEL_SDK_SPAN_LIVE = "otel.sdk.span.live";
@@ -20481,7 +20455,6 @@ function samplingDecisionToString(decision) {
20481
20455
  }
20482
20456
 
20483
20457
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/version.js
20484
- init_cjs_shims();
20485
20458
  var VERSION4 = "2.6.1";
20486
20459
 
20487
20460
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/Tracer.js
@@ -20603,7 +20576,6 @@ var Tracer = class {
20603
20576
  };
20604
20577
 
20605
20578
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/MultiSpanProcessor.js
20606
- init_cjs_shims();
20607
20579
  var MultiSpanProcessor = class {
20608
20580
  _spanProcessors;
20609
20581
  constructor(spanProcessors) {
@@ -20728,8 +20700,7 @@ init_esm();
20728
20700
  init_console_capture();
20729
20701
 
20730
20702
  // src/lifecycle.ts
20731
- init_cjs_shims();
20732
- var import_node_events = require("events");
20703
+ var import_node_events = require("node:events");
20733
20704
  var CoreState = {
20734
20705
  IDLE: "IDLE",
20735
20706
  REGISTERING: "REGISTERING",
@@ -21074,9 +21045,9 @@ function registerBeforeExitTrigger() {
21074
21045
  }
21075
21046
 
21076
21047
  // src/coexistence.ts
21077
- init_cjs_shims();
21078
21048
  init_env_detection();
21079
21049
  init_console_capture();
21050
+ var GLASSTRACE_EXPORTER_BRAND = /* @__PURE__ */ Symbol.for("glasstrace.exporter");
21080
21051
  function createGlasstraceSpanProcessor(options) {
21081
21052
  const config2 = resolveConfig(options);
21082
21053
  const exporterUrl = `${config2.endpoint}/v1/traces`;
@@ -21087,13 +21058,64 @@ function createGlasstraceSpanProcessor(options) {
21087
21058
  getConfig: () => getActiveConfig(),
21088
21059
  environment: config2.environment,
21089
21060
  endpointUrl: exporterUrl,
21090
- createDelegate: createOtlpExporter
21061
+ createDelegate: createOtlpExporter,
21062
+ // Propagate verbose so exporter-level enrichment and export logs
21063
+ // stay observable whether the processor is built automatically by
21064
+ // the coexistence path or wired manually by the developer.
21065
+ verbose: config2.verbose
21091
21066
  });
21092
21067
  registerExporterForKeyNotification(exporter);
21093
21068
  return new BatchSpanProcessor(exporter, {
21094
21069
  scheduledDelayMillis: 1e3
21095
21070
  });
21096
21071
  }
21072
+ function isGlasstraceProcessorPresent(tracerProvider) {
21073
+ try {
21074
+ const proxy = tracerProvider;
21075
+ const delegate = typeof proxy.getDelegate === "function" ? proxy.getDelegate() : tracerProvider;
21076
+ const v2 = delegate;
21077
+ const v2Processors = v2._activeSpanProcessor?._spanProcessors;
21078
+ if (Array.isArray(v2Processors) && hasBrandedProcessor(v2Processors)) {
21079
+ return true;
21080
+ }
21081
+ const v1 = delegate;
21082
+ if (typeof v1.getActiveSpanProcessor === "function") {
21083
+ const active = v1.getActiveSpanProcessor();
21084
+ const processors = active?._spanProcessors;
21085
+ if (Array.isArray(processors) && hasBrandedProcessor(processors)) {
21086
+ return true;
21087
+ }
21088
+ }
21089
+ return false;
21090
+ } catch {
21091
+ return false;
21092
+ }
21093
+ }
21094
+ function tryAutoAttachGlasstraceProcessor(tracerProvider, options) {
21095
+ try {
21096
+ if (isGlasstraceProcessorPresent(tracerProvider)) {
21097
+ return "already_present";
21098
+ }
21099
+ const proxy = tracerProvider;
21100
+ const delegate = typeof proxy.getDelegate === "function" ? proxy.getDelegate() : tracerProvider;
21101
+ const withAdd = delegate;
21102
+ if (typeof withAdd.addSpanProcessor === "function") {
21103
+ const processor2 = createGlasstraceSpanProcessor(options);
21104
+ withAdd.addSpanProcessor(processor2);
21105
+ return { method: "v1_public", processor: processor2 };
21106
+ }
21107
+ const v2 = delegate;
21108
+ const multiProcessor = v2._activeSpanProcessor;
21109
+ if (!multiProcessor || !Array.isArray(multiProcessor._spanProcessors)) {
21110
+ return null;
21111
+ }
21112
+ const processor = createGlasstraceSpanProcessor(options);
21113
+ multiProcessor._spanProcessors.push(processor);
21114
+ return { method: "v2_private", processor };
21115
+ } catch {
21116
+ return null;
21117
+ }
21118
+ }
21097
21119
  function emitNudgeMessage() {
21098
21120
  const isSentry = detectSentry();
21099
21121
  if (isSentry) {
@@ -21162,6 +21184,12 @@ Add Glasstrace to your provider configuration:
21162
21184
  );
21163
21185
  }
21164
21186
  }
21187
+ function hasBrandedProcessor(processors) {
21188
+ return processors.some((p) => {
21189
+ const exporter = p._exporter;
21190
+ return exporter?.[GLASSTRACE_EXPORTER_BRAND] === true;
21191
+ });
21192
+ }
21165
21193
  function detectSentry() {
21166
21194
  try {
21167
21195
  require.resolve("@sentry/node");
@@ -21203,65 +21231,75 @@ async function tryImport(moduleId) {
21203
21231
  return null;
21204
21232
  }
21205
21233
  }
21206
- function tryInjectProcessor(tracerProvider, glasstraceExporter) {
21207
- try {
21208
- const proxy = tracerProvider;
21209
- const delegate = typeof proxy.getDelegate === "function" ? proxy.getDelegate() : tracerProvider;
21210
- const withAdd = delegate;
21211
- if (typeof withAdd.addSpanProcessor === "function") {
21212
- if (typeof withAdd.getActiveSpanProcessor === "function") {
21213
- const active = withAdd.getActiveSpanProcessor();
21214
- const brand = /* @__PURE__ */ Symbol.for("glasstrace.exporter");
21215
- const processors = active?._spanProcessors;
21216
- if (Array.isArray(processors) && processors.some((p) => {
21217
- const exp = p._exporter;
21218
- return exp?.[brand] === true;
21219
- })) {
21220
- return "already_present";
21221
- }
21222
- }
21223
- const processor2 = new BatchSpanProcessor(glasstraceExporter, {
21224
- scheduledDelayMillis: 1e3
21225
- });
21226
- withAdd.addSpanProcessor(processor2);
21227
- _injectedProcessor = processor2;
21228
- return "v1_public";
21229
- }
21230
- const provider = delegate;
21231
- const multiProcessor = provider._activeSpanProcessor;
21232
- if (!multiProcessor || !Array.isArray(multiProcessor._spanProcessors)) {
21233
- return null;
21234
+ async function configureOtel(config2, sessionManager) {
21235
+ setOtelState(OtelState.CONFIGURING);
21236
+ await new Promise((resolve3) => {
21237
+ if (typeof setImmediate === "function") {
21238
+ setImmediate(resolve3);
21239
+ } else {
21240
+ setTimeout(resolve3, 0);
21234
21241
  }
21235
- const processor = new BatchSpanProcessor(glasstraceExporter, {
21236
- scheduledDelayMillis: 1e3
21237
- });
21238
- multiProcessor._spanProcessors.push(processor);
21239
- _injectedProcessor = processor;
21240
- return "v2_private";
21241
- } catch {
21242
- return null;
21242
+ });
21243
+ const existingProvider = trace.getTracerProvider();
21244
+ const probeTracer = existingProvider.getTracer("glasstrace-probe");
21245
+ const anotherProviderRegistered = probeTracer.constructor.name !== "ProxyTracer";
21246
+ if (anotherProviderRegistered) {
21247
+ await runCoexistencePath(existingProvider, config2);
21248
+ return;
21243
21249
  }
21250
+ await runRegistrationPath(config2, sessionManager);
21244
21251
  }
21245
- function isGlasstraceProcessorPresent(tracerProvider) {
21246
- try {
21247
- const proxy = tracerProvider;
21248
- const delegate = typeof proxy.getDelegate === "function" ? proxy.getDelegate() : tracerProvider;
21249
- const provider = delegate;
21250
- const processors = provider._activeSpanProcessor?._spanProcessors;
21251
- if (!Array.isArray(processors)) {
21252
- return false;
21252
+ async function runCoexistencePath(existingProvider, config2) {
21253
+ const result = tryAutoAttachGlasstraceProcessor(existingProvider, {
21254
+ endpoint: config2.endpoint,
21255
+ verbose: config2.verbose
21256
+ });
21257
+ if (result === "already_present") {
21258
+ if (config2.verbose) {
21259
+ sdkLog("info", "[glasstrace] Existing provider detected \u2014 Glasstrace processor already present.");
21253
21260
  }
21254
- const brand = /* @__PURE__ */ Symbol.for("glasstrace.exporter");
21255
- return processors.some((p) => {
21256
- const exporter = p._exporter;
21257
- return exporter?.[brand] === true;
21261
+ setOtelState(OtelState.PROCESSOR_PRESENT);
21262
+ emitLifecycleEvent("otel:configured", { state: OtelState.PROCESSOR_PRESENT, scenario: "B-clean" });
21263
+ return;
21264
+ }
21265
+ if (result !== null) {
21266
+ _injectedProcessor = result.processor;
21267
+ if (config2.verbose) {
21268
+ sdkLog(
21269
+ "info",
21270
+ "[glasstrace] Existing provider detected \u2014 auto-attached Glasstrace span processor."
21271
+ );
21272
+ }
21273
+ registerShutdownHook({
21274
+ name: "coexistence-flush",
21275
+ priority: 5,
21276
+ fn: async () => {
21277
+ if (_injectedProcessor) {
21278
+ await _injectedProcessor.forceFlush();
21279
+ }
21280
+ }
21258
21281
  });
21259
- } catch {
21260
- return false;
21282
+ registerBeforeExitTrigger();
21283
+ const scenario = result.method === "v1_public" ? "D1" : "B-auto";
21284
+ setOtelState(OtelState.AUTO_ATTACHED);
21285
+ emitLifecycleEvent("otel:configured", { state: OtelState.AUTO_ATTACHED, scenario });
21286
+ emitLifecycleEvent("otel:injection_succeeded", { method: result.method });
21287
+ emitNudgeMessage();
21288
+ return;
21289
+ }
21290
+ if (config2.verbose) {
21291
+ sdkLog("info", "[glasstrace] Existing provider detected \u2014 could not auto-attach.");
21292
+ }
21293
+ emitGuidanceMessage();
21294
+ setOtelState(OtelState.COEXISTENCE_FAILED);
21295
+ emitLifecycleEvent("otel:configured", { state: OtelState.COEXISTENCE_FAILED, scenario: "C/F" });
21296
+ emitLifecycleEvent("otel:injection_failed", { reason: "provider internals inaccessible" });
21297
+ const coreState = getCoreState();
21298
+ if (coreState === CoreState.ACTIVE || coreState === CoreState.KEY_RESOLVED) {
21299
+ setCoreState(CoreState.ACTIVE_DEGRADED);
21261
21300
  }
21262
21301
  }
21263
- async function configureOtel(config2, sessionManager) {
21264
- setOtelState(OtelState.CONFIGURING);
21302
+ async function runRegistrationPath(config2, sessionManager) {
21265
21303
  const exporterUrl = `${config2.endpoint}/v1/traces`;
21266
21304
  const createOtlpExporter = (url2, headers) => new OTLPTraceExporter({ url: url2, headers });
21267
21305
  const glasstraceExporter = new GlasstraceExporter({
@@ -21274,71 +21312,6 @@ async function configureOtel(config2, sessionManager) {
21274
21312
  verbose: config2.verbose
21275
21313
  });
21276
21314
  _activeExporter = glasstraceExporter;
21277
- await new Promise((resolve3) => {
21278
- if (typeof setImmediate === "function") {
21279
- setImmediate(resolve3);
21280
- } else {
21281
- setTimeout(resolve3, 0);
21282
- }
21283
- });
21284
- const existingProvider = trace.getTracerProvider();
21285
- const probeTracer = existingProvider.getTracer("glasstrace-probe");
21286
- const anotherProviderRegistered = probeTracer.constructor.name !== "ProxyTracer";
21287
- if (anotherProviderRegistered) {
21288
- if (isGlasstraceProcessorPresent(existingProvider)) {
21289
- if (config2.verbose) {
21290
- sdkLog("info", "[glasstrace] Existing provider detected \u2014 Glasstrace processor already present.");
21291
- }
21292
- _activeExporter = null;
21293
- setOtelState(OtelState.PROCESSOR_PRESENT);
21294
- emitLifecycleEvent("otel:configured", { state: OtelState.PROCESSOR_PRESENT, scenario: "B-clean" });
21295
- return;
21296
- }
21297
- const injectionMethod = tryInjectProcessor(existingProvider, glasstraceExporter);
21298
- if (injectionMethod === "already_present") {
21299
- if (config2.verbose) {
21300
- sdkLog("info", "[glasstrace] Existing provider detected \u2014 Glasstrace processor already present (v1 check).");
21301
- }
21302
- _activeExporter = null;
21303
- setOtelState(OtelState.PROCESSOR_PRESENT);
21304
- emitLifecycleEvent("otel:configured", { state: OtelState.PROCESSOR_PRESENT, scenario: "B-clean" });
21305
- return;
21306
- }
21307
- if (injectionMethod) {
21308
- if (config2.verbose) {
21309
- sdkLog("info", "[glasstrace] Existing provider detected \u2014 auto-attaching Glasstrace processor.");
21310
- }
21311
- registerShutdownHook({
21312
- name: "coexistence-flush",
21313
- priority: 5,
21314
- fn: async () => {
21315
- if (_injectedProcessor) {
21316
- await _injectedProcessor.forceFlush();
21317
- }
21318
- }
21319
- });
21320
- registerBeforeExitTrigger();
21321
- const scenario = injectionMethod === "v1_public" ? "D1" : "B-auto";
21322
- setOtelState(OtelState.AUTO_ATTACHED);
21323
- emitLifecycleEvent("otel:configured", { state: OtelState.AUTO_ATTACHED, scenario });
21324
- emitLifecycleEvent("otel:injection_succeeded", { method: injectionMethod });
21325
- emitNudgeMessage();
21326
- return;
21327
- }
21328
- if (config2.verbose) {
21329
- sdkLog("info", "[glasstrace] Existing provider detected \u2014 could not auto-attach.");
21330
- }
21331
- emitGuidanceMessage();
21332
- _activeExporter = null;
21333
- setOtelState(OtelState.COEXISTENCE_FAILED);
21334
- emitLifecycleEvent("otel:configured", { state: OtelState.COEXISTENCE_FAILED, scenario: "C/F" });
21335
- emitLifecycleEvent("otel:injection_failed", { reason: "provider internals inaccessible" });
21336
- const coreState = getCoreState();
21337
- if (coreState === CoreState.ACTIVE || coreState === CoreState.KEY_RESOLVED) {
21338
- setCoreState(CoreState.ACTIVE_DEGRADED);
21339
- }
21340
- return;
21341
- }
21342
21315
  const vercelOtel = await tryImport("@vercel/otel");
21343
21316
  if (vercelOtel && typeof vercelOtel.registerOTel === "function") {
21344
21317
  const otelConfig = {
@@ -21383,7 +21356,6 @@ async function configureOtel(config2, sessionManager) {
21383
21356
  await provider.shutdown();
21384
21357
  }
21385
21358
  });
21386
- registerSignalHandlers();
21387
21359
  registerBeforeExitTrigger();
21388
21360
  const prismaModule = await tryImport("@prisma/instrumentation");
21389
21361
  if (prismaModule) {
@@ -21402,8 +21374,7 @@ async function configureOtel(config2, sessionManager) {
21402
21374
  }
21403
21375
 
21404
21376
  // src/context-manager.ts
21405
- init_cjs_shims();
21406
- var import_node_async_hooks = require("async_hooks");
21377
+ var import_node_async_hooks = require("node:async_hooks");
21407
21378
  init_esm();
21408
21379
  function installContextManager() {
21409
21380
  try {
@@ -21438,18 +21409,20 @@ init_esm();
21438
21409
  init_console_capture();
21439
21410
 
21440
21411
  // src/heartbeat.ts
21441
- init_cjs_shims();
21442
21412
  init_console_capture();
21443
21413
  var HEARTBEAT_INTERVAL_MS = 5 * 60 * 1e3;
21444
21414
  var BACKOFF_BASE_MS = HEARTBEAT_INTERVAL_MS;
21445
21415
  var BACKOFF_MAX_MS = 30 * 60 * 1e3;
21446
21416
  var BACKOFF_JITTER = 0.2;
21417
+ var HEARTBEAT_SHUTDOWN_PRIORITY = 10;
21418
+ var SHUTDOWN_MARKER_RELPATH = ".glasstrace/shutdown-requested";
21447
21419
  var heartbeatTimer = null;
21448
21420
  var heartbeatGeneration = 0;
21449
21421
  var backoffAttempts = 0;
21450
21422
  var backoffUntil = 0;
21451
21423
  var tickInProgress = false;
21452
- var _shutdownHandler = null;
21424
+ var shutdownHookRegistered = false;
21425
+ var shutdownFired = false;
21453
21426
  function startHeartbeat(config2, anonKey, sdkVersion, generation, onClaimTransition) {
21454
21427
  if (heartbeatTimer !== null) return;
21455
21428
  heartbeatGeneration = generation;
@@ -21457,7 +21430,7 @@ function startHeartbeat(config2, anonKey, sdkVersion, generation, onClaimTransit
21457
21430
  void heartbeatTick(config2, anonKey, sdkVersion, generation, onClaimTransition);
21458
21431
  }, HEARTBEAT_INTERVAL_MS);
21459
21432
  heartbeatTimer.unref();
21460
- registerShutdownHandlers(config2, anonKey, sdkVersion);
21433
+ registerHeartbeatShutdownHook(config2, anonKey, sdkVersion);
21461
21434
  if (config2.verbose) {
21462
21435
  sdkLog("info", "[glasstrace] Heartbeat started (5-minute interval).");
21463
21436
  }
@@ -21467,7 +21440,26 @@ function stopHeartbeat() {
21467
21440
  clearInterval(heartbeatTimer);
21468
21441
  heartbeatTimer = null;
21469
21442
  }
21470
- removeShutdownHandlers();
21443
+ }
21444
+ function checkShutdownMarker(projectRoot) {
21445
+ let fsSync2 = null;
21446
+ let pathSync = null;
21447
+ try {
21448
+ fsSync2 = require("node:fs");
21449
+ pathSync = require("node:path");
21450
+ } catch {
21451
+ return { triggered: false };
21452
+ }
21453
+ const root = projectRoot ?? (typeof process !== "undefined" ? process.cwd() : ".");
21454
+ const markerPath = pathSync.join(root, SHUTDOWN_MARKER_RELPATH);
21455
+ if (!fsSync2.existsSync(markerPath)) return { triggered: false };
21456
+ try {
21457
+ fsSync2.unlinkSync(markerPath);
21458
+ } catch {
21459
+ }
21460
+ const shutdown = executeShutdown().catch(() => {
21461
+ });
21462
+ return { triggered: true, shutdown };
21471
21463
  }
21472
21464
  async function heartbeatTick(config2, anonKey, sdkVersion, generation, onClaimTransition) {
21473
21465
  if (tickInProgress) return;
@@ -21477,6 +21469,14 @@ async function heartbeatTick(config2, anonKey, sdkVersion, generation, onClaimTr
21477
21469
  stopHeartbeat();
21478
21470
  return;
21479
21471
  }
21472
+ const markerResult = checkShutdownMarker();
21473
+ if (markerResult.triggered) {
21474
+ stopHeartbeat();
21475
+ if (markerResult.shutdown) {
21476
+ await markerResult.shutdown;
21477
+ }
21478
+ return;
21479
+ }
21480
21480
  if (Date.now() < backoffUntil) {
21481
21481
  if (config2.verbose) {
21482
21482
  sdkLog("info", "[glasstrace] Heartbeat skipped (rate-limit backoff).");
@@ -21511,41 +21511,31 @@ async function heartbeatTick(config2, anonKey, sdkVersion, generation, onClaimTr
21511
21511
  tickInProgress = false;
21512
21512
  }
21513
21513
  }
21514
- function registerShutdownHandlers(config2, anonKey, sdkVersion) {
21515
- if (typeof process === "undefined" || typeof process.once !== "function") {
21516
- return;
21517
- }
21518
- let shutdownFired = false;
21519
- const handler = (signal) => {
21520
- if (shutdownFired) return;
21521
- shutdownFired = true;
21522
- if (heartbeatTimer !== null) {
21523
- clearInterval(heartbeatTimer);
21524
- heartbeatTimer = null;
21514
+ function registerHeartbeatShutdownHook(config2, anonKey, sdkVersion) {
21515
+ if (shutdownHookRegistered) return;
21516
+ shutdownHookRegistered = true;
21517
+ registerShutdownHook({
21518
+ name: "heartbeat-final-report",
21519
+ priority: HEARTBEAT_SHUTDOWN_PRIORITY,
21520
+ fn: async () => {
21521
+ if (shutdownFired) return;
21522
+ shutdownFired = true;
21523
+ if (heartbeatTimer !== null) {
21524
+ clearInterval(heartbeatTimer);
21525
+ heartbeatTimer = null;
21526
+ }
21527
+ try {
21528
+ const healthReport = collectHealthReport(sdkVersion);
21529
+ await performInit(config2, anonKey, sdkVersion, healthReport);
21530
+ } catch {
21531
+ }
21525
21532
  }
21526
- const healthReport = collectHealthReport(sdkVersion);
21527
- void performInit(config2, anonKey, sdkVersion, healthReport).catch(() => {
21528
- }).finally(() => {
21529
- removeShutdownHandlers();
21530
- process.kill(process.pid, signal);
21531
- });
21532
- };
21533
- _shutdownHandler = handler;
21534
- process.once("SIGTERM", _shutdownHandler);
21535
- process.once("SIGINT", _shutdownHandler);
21536
- }
21537
- function removeShutdownHandlers() {
21538
- if (_shutdownHandler && typeof process !== "undefined") {
21539
- process.removeListener("SIGTERM", _shutdownHandler);
21540
- process.removeListener("SIGINT", _shutdownHandler);
21541
- _shutdownHandler = null;
21542
- }
21533
+ });
21543
21534
  }
21544
21535
 
21545
21536
  // src/runtime-state.ts
21546
- init_cjs_shims();
21547
- var import_node_fs = require("fs");
21548
- var import_node_path = require("path");
21537
+ var import_node_fs = require("node:fs");
21538
+ var import_node_path = require("node:path");
21549
21539
  init_console_capture();
21550
21540
  var _projectRoot = null;
21551
21541
  var _sdkVersion = "unknown";
@@ -21641,7 +21631,7 @@ function registerGlasstrace(options) {
21641
21631
  setCoreState(CoreState.REGISTERING);
21642
21632
  startRuntimeStateWriter({
21643
21633
  projectRoot: process.cwd(),
21644
- sdkVersion: "0.14.2"
21634
+ sdkVersion: "0.16.0"
21645
21635
  });
21646
21636
  const config2 = resolveConfig(options);
21647
21637
  if (config2.verbose) {
@@ -21657,6 +21647,11 @@ function registerGlasstrace(options) {
21657
21647
  if (config2.verbose) {
21658
21648
  console.info("[glasstrace] Not production-disabled.");
21659
21649
  }
21650
+ const existingProbe = trace.getTracerProvider().getTracer("glasstrace-probe");
21651
+ const anotherProviderRegistered = existingProbe.constructor.name !== "ProxyTracer";
21652
+ if (!anotherProviderRegistered) {
21653
+ registerSignalHandlers();
21654
+ }
21660
21655
  const anonymous = isAnonymousMode(config2);
21661
21656
  let effectiveKey = config2.apiKey;
21662
21657
  initAuthState(anonymous ? AuthState.ANONYMOUS : AuthState.AUTHENTICATED);
@@ -21687,8 +21682,6 @@ function registerGlasstrace(options) {
21687
21682
  }
21688
21683
  setCoreState(CoreState.KEY_PENDING);
21689
21684
  const currentGeneration = registrationGeneration;
21690
- const existingProbe = trace.getTracerProvider().getTracer("glasstrace-probe");
21691
- const anotherProviderRegistered = existingProbe.constructor.name !== "ProxyTracer";
21692
21685
  if (anotherProviderRegistered) {
21693
21686
  if (config2.verbose) {
21694
21687
  console.info("[glasstrace] Another OTel provider detected \u2014 using existing context manager.");
@@ -21803,8 +21796,8 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
21803
21796
  if (config2.verbose) {
21804
21797
  console.info("[glasstrace] Background init firing.");
21805
21798
  }
21806
- const healthReport = collectHealthReport("0.14.2");
21807
- const initResult = await performInit(config2, anonKeyForInit, "0.14.2", healthReport);
21799
+ const healthReport = collectHealthReport("0.16.0");
21800
+ const initResult = await performInit(config2, anonKeyForInit, "0.16.0", healthReport);
21808
21801
  if (generation !== registrationGeneration) return;
21809
21802
  const currentState = getCoreState();
21810
21803
  if (currentState === CoreState.SHUTTING_DOWN || currentState === CoreState.SHUTDOWN) {
@@ -21827,7 +21820,7 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
21827
21820
  }
21828
21821
  maybeInstallConsoleCapture();
21829
21822
  if (didLastInitSucceed()) {
21830
- startHeartbeat(config2, anonKeyForInit, "0.14.2", generation, (newApiKey, accountId) => {
21823
+ startHeartbeat(config2, anonKeyForInit, "0.16.0", generation, (newApiKey, accountId) => {
21831
21824
  setAuthState(AuthState.CLAIMING);
21832
21825
  emitLifecycleEvent("auth:claim_started", { accountId });
21833
21826
  setResolvedApiKey(newApiKey);
@@ -21857,7 +21850,7 @@ function isDiscoveryEnabled(config2) {
21857
21850
  }
21858
21851
 
21859
21852
  // src/config-wrapper.ts
21860
- init_cjs_shims();
21853
+ var import_node_module = require("node:module");
21861
21854
  function isTurbopackBuild() {
21862
21855
  if (typeof process === "undefined") return false;
21863
21856
  const argv = Array.isArray(process.argv) ? process.argv : [];
@@ -21866,6 +21859,36 @@ function isTurbopackBuild() {
21866
21859
  if (process.env?.TURBOPACK === "1") return true;
21867
21860
  return false;
21868
21861
  }
21862
+ var SDK_PACKAGE_NAME = "@glasstrace/sdk";
21863
+ function appendNodeSchemeExternal(webpackConfig) {
21864
+ const nodeBuiltinExternal = (data, callback) => {
21865
+ const request = data.request;
21866
+ if (typeof request === "string" && (0, import_node_module.isBuiltin)(request)) {
21867
+ callback(null, "commonjs " + request);
21868
+ return;
21869
+ }
21870
+ callback(null);
21871
+ };
21872
+ const existing = webpackConfig.externals;
21873
+ if (Array.isArray(existing)) {
21874
+ webpackConfig.externals = [...existing, nodeBuiltinExternal];
21875
+ } else if (existing == null) {
21876
+ webpackConfig.externals = [nodeBuiltinExternal];
21877
+ } else {
21878
+ webpackConfig.externals = [existing, nodeBuiltinExternal];
21879
+ }
21880
+ }
21881
+ function ensureServerExternal(config2) {
21882
+ const existingStable = config2.serverExternalPackages;
21883
+ const stable = Array.isArray(existingStable) ? (
21884
+ // Clone so we never mutate a caller-owned array in place.
21885
+ existingStable.filter((entry) => typeof entry === "string")
21886
+ ) : [];
21887
+ if (!stable.includes(SDK_PACKAGE_NAME)) {
21888
+ stable.push(SDK_PACKAGE_NAME);
21889
+ }
21890
+ config2.serverExternalPackages = stable;
21891
+ }
21869
21892
  function withGlasstraceConfig(nextConfig) {
21870
21893
  if (typeof process === "undefined" || typeof process.versions?.node !== "string") {
21871
21894
  return nextConfig != null ? { ...nextConfig } : {};
@@ -21877,6 +21900,7 @@ function withGlasstraceConfig(nextConfig) {
21877
21900
  ...existingExperimental,
21878
21901
  serverSourceMaps: true
21879
21902
  };
21903
+ ensureServerExternal(bag);
21880
21904
  if (bag.turbopack == null) {
21881
21905
  bag.turbopack = {};
21882
21906
  }
@@ -21891,6 +21915,9 @@ function withGlasstraceConfig(nextConfig) {
21891
21915
  result = existingWebpack(webpackConfig, context2);
21892
21916
  }
21893
21917
  const webpackContext = context2;
21918
+ if (webpackContext.isServer) {
21919
+ appendNodeSchemeExternal(result);
21920
+ }
21894
21921
  if (!webpackContext.isServer && webpackContext.dev === false) {
21895
21922
  const plugins = result.plugins ?? [];
21896
21923
  plugins.push({
@@ -21953,7 +21980,6 @@ async function handleSourceMapUpload(distDir) {
21953
21980
  init_source_map_uploader();
21954
21981
 
21955
21982
  // src/capture-error.ts
21956
- init_cjs_shims();
21957
21983
  init_esm();
21958
21984
  init_error_nudge();
21959
21985
  function captureError(error48) {
@@ -21976,11 +22002,10 @@ function captureError(error48) {
21976
22002
  }
21977
22003
 
21978
22004
  // src/import-graph.ts
21979
- init_cjs_shims();
21980
- var fs3 = __toESM(require("fs/promises"), 1);
21981
- var fsSync = __toESM(require("fs"), 1);
21982
- var path3 = __toESM(require("path"), 1);
21983
- var crypto3 = __toESM(require("crypto"), 1);
22005
+ var fs3 = __toESM(require("node:fs/promises"), 1);
22006
+ var fsSync = __toESM(require("node:fs"), 1);
22007
+ var path3 = __toESM(require("node:path"), 1);
22008
+ var crypto3 = __toESM(require("node:crypto"), 1);
21984
22009
  init_dist();
21985
22010
  var MAX_TEST_FILES = 5e3;
21986
22011
  var EXCLUDED_DIRS = /* @__PURE__ */ new Set(["node_modules", ".next", ".git", "dist", ".turbo"]);