@glasstrace/sdk 1.11.0 → 1.12.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 (74) hide show
  1. package/README.md +20 -3
  2. package/dist/async-context/index.cjs +1189 -440
  3. package/dist/async-context/index.cjs.map +1 -1
  4. package/dist/async-context/index.js +2 -2
  5. package/dist/{capture-error-BeuEXXJO.d.cts → capture-error-CRQSqKgd.d.cts} +2 -2
  6. package/dist/{capture-error-D02pzB7q.d.ts → capture-error-CqCbjoMq.d.ts} +2 -2
  7. package/dist/{chunk-OXM2BZMF.js → chunk-4YRYR32D.js} +2 -2
  8. package/dist/{chunk-XG6WR2KS.js → chunk-6NKMAKMI.js} +3 -3
  9. package/dist/{chunk-6RKS3DNA.js → chunk-BN5DVIUO.js} +1176 -424
  10. package/dist/chunk-BN5DVIUO.js.map +1 -0
  11. package/dist/{chunk-DQFGNX3H.js → chunk-CZQN6G4I.js} +21 -20
  12. package/dist/chunk-CZQN6G4I.js.map +1 -0
  13. package/dist/{chunk-D54FMQHF.js → chunk-FFNGE5RR.js} +2 -2
  14. package/dist/{chunk-RL43PU2X.js → chunk-J3ZCVE67.js} +2 -2
  15. package/dist/{chunk-BSVWJSVX.js → chunk-KBHGPQZ2.js} +2 -2
  16. package/dist/{chunk-M5GO2SSO.js → chunk-M3ZTG4P5.js} +2 -2
  17. package/dist/{chunk-FQ4SEG6Y.js → chunk-V75ZB4G4.js} +3 -3
  18. package/dist/{chunk-QVTONMVZ.js → chunk-ZIL2IY4C.js} +2 -2
  19. package/dist/cli/init.cjs +1266 -497
  20. package/dist/cli/init.cjs.map +1 -1
  21. package/dist/cli/init.js +7 -7
  22. package/dist/cli/mcp-add.cjs +1171 -425
  23. package/dist/cli/mcp-add.cjs.map +1 -1
  24. package/dist/cli/mcp-add.js +3 -3
  25. package/dist/cli/uninit.js +3 -3
  26. package/dist/cli/upgrade-instructions.cjs +1 -1
  27. package/dist/cli/upgrade-instructions.js +3 -3
  28. package/dist/cli/validate.cjs +1168 -422
  29. package/dist/cli/validate.cjs.map +1 -1
  30. package/dist/cli/validate.js +2 -2
  31. package/dist/{correlation-id-NAapJ5jn.d.cts → correlation-id-CFpyJsKv.d.cts} +1 -1
  32. package/dist/{correlation-id-B_K8adD6.d.ts → correlation-id-DPXyY9-3.d.ts} +1 -1
  33. package/dist/edge-entry.cjs +1197 -448
  34. package/dist/edge-entry.cjs.map +1 -1
  35. package/dist/edge-entry.d.cts +2 -2
  36. package/dist/edge-entry.d.ts +2 -2
  37. package/dist/edge-entry.js +4 -4
  38. package/dist/index.cjs +1335 -552
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/{index.d-CkTf_boH.d.ts → index.d-D-jdiIPU.d.cts} +1 -1
  41. package/dist/{index.d-CkTf_boH.d.cts → index.d-D-jdiIPU.d.ts} +1 -1
  42. package/dist/index.d.cts +4 -4
  43. package/dist/index.d.ts +4 -4
  44. package/dist/index.js +13 -6
  45. package/dist/index.js.map +1 -1
  46. package/dist/middleware/index.cjs +1192 -443
  47. package/dist/middleware/index.cjs.map +1 -1
  48. package/dist/middleware/index.js +2 -2
  49. package/dist/node-entry.cjs +1323 -550
  50. package/dist/node-entry.cjs.map +1 -1
  51. package/dist/node-entry.d.cts +3 -3
  52. package/dist/node-entry.d.ts +3 -3
  53. package/dist/node-entry.js +7 -7
  54. package/dist/node-subpath.cjs +1168 -422
  55. package/dist/node-subpath.cjs.map +1 -1
  56. package/dist/node-subpath.d.cts +1 -1
  57. package/dist/node-subpath.d.ts +1 -1
  58. package/dist/node-subpath.js +3 -3
  59. package/dist/{source-map-uploader-CLYCE2TZ.js → source-map-uploader-K67LTPBG.js} +3 -3
  60. package/dist/trpc/index.cjs +1187 -438
  61. package/dist/trpc/index.cjs.map +1 -1
  62. package/dist/trpc/index.js +1 -1
  63. package/package.json +2 -2
  64. package/dist/chunk-6RKS3DNA.js.map +0 -1
  65. package/dist/chunk-DQFGNX3H.js.map +0 -1
  66. /package/dist/{chunk-OXM2BZMF.js.map → chunk-4YRYR32D.js.map} +0 -0
  67. /package/dist/{chunk-XG6WR2KS.js.map → chunk-6NKMAKMI.js.map} +0 -0
  68. /package/dist/{chunk-D54FMQHF.js.map → chunk-FFNGE5RR.js.map} +0 -0
  69. /package/dist/{chunk-RL43PU2X.js.map → chunk-J3ZCVE67.js.map} +0 -0
  70. /package/dist/{chunk-BSVWJSVX.js.map → chunk-KBHGPQZ2.js.map} +0 -0
  71. /package/dist/{chunk-M5GO2SSO.js.map → chunk-M3ZTG4P5.js.map} +0 -0
  72. /package/dist/{chunk-FQ4SEG6Y.js.map → chunk-V75ZB4G4.js.map} +0 -0
  73. /package/dist/{chunk-QVTONMVZ.js.map → chunk-ZIL2IY4C.js.map} +0 -0
  74. /package/dist/{source-map-uploader-CLYCE2TZ.js.map → source-map-uploader-K67LTPBG.js.map} +0 -0
@@ -54,7 +54,7 @@ import {
54
54
  performInit,
55
55
  recordSpansDropped,
56
56
  recordSpansExported
57
- } from "./chunk-XG6WR2KS.js";
57
+ } from "./chunk-6NKMAKMI.js";
58
58
  import {
59
59
  isAnonymousMode,
60
60
  isProductionDisabled,
@@ -65,11 +65,11 @@ import {
65
65
  getOrCreateAnonKey,
66
66
  isSyncFsAvailable,
67
67
  readAnonKey
68
- } from "./chunk-RL43PU2X.js";
68
+ } from "./chunk-J3ZCVE67.js";
69
69
  import {
70
70
  GLASSTRACE_ATTRIBUTE_NAMES,
71
71
  deriveSessionId
72
- } from "./chunk-6RKS3DNA.js";
72
+ } from "./chunk-BN5DVIUO.js";
73
73
  import {
74
74
  isEndMarkerLine,
75
75
  parseStartMarkerLine
@@ -1393,7 +1393,7 @@ function getStringFromEnv(key) {
1393
1393
  }
1394
1394
 
1395
1395
  // ../../node_modules/@opentelemetry/core/build/esm/version.js
1396
- var VERSION = "2.7.0";
1396
+ var VERSION = "2.7.1";
1397
1397
 
1398
1398
  // ../../node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js
1399
1399
  var ATTR_EXCEPTION_MESSAGE = "exception.message";
@@ -2273,9 +2273,13 @@ var TraceIdRatioBasedSampler = class {
2273
2273
  }
2274
2274
  _accumulate(traceId) {
2275
2275
  let accumulation = 0;
2276
- for (let i = 0; i < traceId.length / 8; i++) {
2277
- const pos = i * 8;
2278
- const part = parseInt(traceId.slice(pos, pos + 8), 16);
2276
+ for (let i = 0; i < 32; i += 8) {
2277
+ let part = 0;
2278
+ for (let j = 0; j < 8; j++) {
2279
+ const c = traceId.charCodeAt(i + j);
2280
+ const v = c < 58 ? c - 48 : c < 71 ? c - 55 : c - 87;
2281
+ part = part << 4 | v;
2282
+ }
2279
2283
  accumulation = (accumulation ^ part) >>> 0;
2280
2284
  }
2281
2285
  return accumulation;
@@ -2635,7 +2639,7 @@ function samplingDecisionToString(decision) {
2635
2639
  }
2636
2640
 
2637
2641
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/version.js
2638
- var VERSION2 = "2.7.0";
2642
+ var VERSION2 = "2.7.1";
2639
2643
 
2640
2644
  // ../../node_modules/@opentelemetry/sdk-trace-base/build/esm/Tracer.js
2641
2645
  var Tracer = class {
@@ -3396,7 +3400,7 @@ function parseRetryAfterToMills(retryAfter) {
3396
3400
  }
3397
3401
 
3398
3402
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/version.js
3399
- var VERSION3 = "0.215.0";
3403
+ var VERSION3 = "0.218.0";
3400
3404
 
3401
3405
  // ../../node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/http-transport-utils.js
3402
3406
  var DEFAULT_USER_AGENT = `OTel-OTLP-Exporter-JavaScript/${VERSION3}`;
@@ -3410,14 +3414,11 @@ function sendWithHttp(request, url, headers, compression, userAgent, agent, data
3410
3414
  headers["User-Agent"] = DEFAULT_USER_AGENT;
3411
3415
  }
3412
3416
  const options = {
3413
- hostname: parsedUrl.hostname,
3414
- port: parsedUrl.port,
3415
- path: parsedUrl.pathname,
3416
3417
  method: "POST",
3417
3418
  headers,
3418
3419
  agent
3419
3420
  };
3420
- const req = request(options, (res) => {
3421
+ const req = request(parsedUrl, options, (res) => {
3421
3422
  const responseData = [];
3422
3423
  let responseSize = 0;
3423
3424
  res.on("data", (chunk) => {
@@ -4619,11 +4620,11 @@ function registerGlasstrace(options) {
4619
4620
  setCoreState(CoreState.REGISTERING);
4620
4621
  maybeWarnStaleAgentInstructions({
4621
4622
  projectRoot: process.cwd(),
4622
- sdkVersion: "1.11.0"
4623
+ sdkVersion: "1.12.0"
4623
4624
  });
4624
4625
  startRuntimeStateWriter({
4625
4626
  projectRoot: process.cwd(),
4626
- sdkVersion: "1.11.0"
4627
+ sdkVersion: "1.12.0"
4627
4628
  });
4628
4629
  const config = resolveConfig(options);
4629
4630
  if (config.verbose) {
@@ -4790,8 +4791,8 @@ async function backgroundInit(config, anonKeyForInit, generation) {
4790
4791
  if (config.verbose) {
4791
4792
  console.info("[glasstrace] Background init firing.");
4792
4793
  }
4793
- const healthReport = collectHealthReport("1.11.0");
4794
- const initResult = await performInit(config, anonKeyForInit, "1.11.0", healthReport);
4794
+ const healthReport = collectHealthReport("1.12.0");
4795
+ const initResult = await performInit(config, anonKeyForInit, "1.12.0", healthReport);
4795
4796
  if (generation !== registrationGeneration) return;
4796
4797
  const currentState = getCoreState();
4797
4798
  if (currentState === CoreState.SHUTTING_DOWN || currentState === CoreState.SHUTDOWN) {
@@ -4814,7 +4815,7 @@ async function backgroundInit(config, anonKeyForInit, generation) {
4814
4815
  }
4815
4816
  maybeInstallConsoleCapture();
4816
4817
  if (didLastInitSucceed()) {
4817
- startHeartbeat(config, anonKeyForInit, "1.11.0", generation, (newApiKey, accountId) => {
4818
+ startHeartbeat(config, anonKeyForInit, "1.12.0", generation, (newApiKey, accountId) => {
4818
4819
  setAuthState(AuthState.CLAIMING);
4819
4820
  emitLifecycleEvent("auth:claim_started", { accountId });
4820
4821
  setResolvedApiKey(newApiKey);
@@ -5111,7 +5112,7 @@ async function handleSourceMapUpload(distDir) {
5111
5112
  );
5112
5113
  return;
5113
5114
  }
5114
- const { discoverSourceMapFiles, computeBuildHash, uploadSourceMaps } = await import("./source-map-uploader-CLYCE2TZ.js");
5115
+ const { discoverSourceMapFiles, computeBuildHash, uploadSourceMaps } = await import("./source-map-uploader-K67LTPBG.js");
5115
5116
  const files = await discoverSourceMapFiles(distDir);
5116
5117
  if (files.length === 0) {
5117
5118
  console.info("[glasstrace] No source map files found. Skipping upload.");
@@ -5211,4 +5212,4 @@ export {
5211
5212
  withGlasstraceConfig,
5212
5213
  captureError
5213
5214
  };
5214
- //# sourceMappingURL=chunk-DQFGNX3H.js.map
5215
+ //# sourceMappingURL=chunk-CZQN6G4I.js.map