@glasstrace/sdk 1.2.0 → 1.2.1

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 (42) hide show
  1. package/dist/{chunk-6RNBUUBR.js → chunk-2GCN27SI.js} +2 -2
  2. package/dist/{chunk-4EZ6JTDG.js → chunk-47B2G3FE.js} +2 -2
  3. package/dist/{chunk-6RIH6SFM.js → chunk-CTJO7PUZ.js} +23 -17
  4. package/dist/chunk-CTJO7PUZ.js.map +1 -0
  5. package/dist/{chunk-X5MAXP5T.js → chunk-EBYISKQP.js} +5 -3
  6. package/dist/{chunk-X5MAXP5T.js.map → chunk-EBYISKQP.js.map} +1 -1
  7. package/dist/{chunk-JKI4OCFV.js → chunk-HV5ID2WJ.js} +3 -3
  8. package/dist/{chunk-TWTWRJ25.js → chunk-MD5XPCTQ.js} +2 -2
  9. package/dist/{chunk-TWHCJKRS.js → chunk-NFPDYME5.js} +3 -3
  10. package/dist/{chunk-DST4UBXU.js → chunk-YMLMZCPR.js} +2 -2
  11. package/dist/cli/init.cjs +5 -3
  12. package/dist/cli/init.cjs.map +1 -1
  13. package/dist/cli/init.js +6 -6
  14. package/dist/cli/mcp-add.cjs +4 -2
  15. package/dist/cli/mcp-add.cjs.map +1 -1
  16. package/dist/cli/mcp-add.js +2 -2
  17. package/dist/cli/uninit.js +3 -3
  18. package/dist/cli/validate.cjs +4 -2
  19. package/dist/cli/validate.cjs.map +1 -1
  20. package/dist/cli/validate.js +2 -2
  21. package/dist/edge-entry.cjs +4 -2
  22. package/dist/edge-entry.cjs.map +1 -1
  23. package/dist/edge-entry.js +2 -2
  24. package/dist/index.cjs +22 -14
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.js +5 -5
  27. package/dist/node-entry.cjs +22 -14
  28. package/dist/node-entry.cjs.map +1 -1
  29. package/dist/node-entry.js +7 -7
  30. package/dist/node-subpath.cjs +4 -2
  31. package/dist/node-subpath.cjs.map +1 -1
  32. package/dist/node-subpath.js +3 -3
  33. package/dist/{source-map-uploader-DPUUCLNW.js → source-map-uploader-RA4Z7TWA.js} +3 -3
  34. package/package.json +1 -1
  35. package/dist/chunk-6RIH6SFM.js.map +0 -1
  36. /package/dist/{chunk-6RNBUUBR.js.map → chunk-2GCN27SI.js.map} +0 -0
  37. /package/dist/{chunk-4EZ6JTDG.js.map → chunk-47B2G3FE.js.map} +0 -0
  38. /package/dist/{chunk-JKI4OCFV.js.map → chunk-HV5ID2WJ.js.map} +0 -0
  39. /package/dist/{chunk-TWTWRJ25.js.map → chunk-MD5XPCTQ.js.map} +0 -0
  40. /package/dist/{chunk-TWHCJKRS.js.map → chunk-NFPDYME5.js.map} +0 -0
  41. /package/dist/{chunk-DST4UBXU.js.map → chunk-YMLMZCPR.js.map} +0 -0
  42. /package/dist/{source-map-uploader-DPUUCLNW.js.map → source-map-uploader-RA4Z7TWA.js.map} +0 -0
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-DQ25VOKK.js";
4
4
  import {
5
5
  GLASSTRACE_ATTRIBUTE_NAMES
6
- } from "./chunk-X5MAXP5T.js";
6
+ } from "./chunk-EBYISKQP.js";
7
7
 
8
8
  // src/errors.ts
9
9
  var SdkError = class extends Error {
@@ -102,4 +102,4 @@ export {
102
102
  GlasstraceSpanProcessor,
103
103
  captureCorrelationId
104
104
  };
105
- //# sourceMappingURL=chunk-6RNBUUBR.js.map
105
+ //# sourceMappingURL=chunk-2GCN27SI.js.map
@@ -5,7 +5,7 @@ import {
5
5
  PresignedUploadResponseSchema,
6
6
  SourceMapManifestResponseSchema,
7
7
  SourceMapUploadResponseSchema
8
- } from "./chunk-X5MAXP5T.js";
8
+ } from "./chunk-EBYISKQP.js";
9
9
 
10
10
  // src/source-map-uploader.ts
11
11
  import * as fs from "node:fs/promises";
@@ -331,4 +331,4 @@ export {
331
331
  uploadSourceMapsPresigned,
332
332
  uploadSourceMapsAuto
333
333
  };
334
- //# sourceMappingURL=chunk-4EZ6JTDG.js.map
334
+ //# sourceMappingURL=chunk-47B2G3FE.js.map
@@ -33,7 +33,7 @@ import {
33
33
  performInit,
34
34
  recordSpansDropped,
35
35
  recordSpansExported
36
- } from "./chunk-JKI4OCFV.js";
36
+ } from "./chunk-HV5ID2WJ.js";
37
37
  import {
38
38
  isAnonymousMode,
39
39
  isProductionDisabled,
@@ -43,11 +43,11 @@ import {
43
43
  atomicWriteFileSync,
44
44
  getOrCreateAnonKey,
45
45
  readAnonKey
46
- } from "./chunk-TWTWRJ25.js";
46
+ } from "./chunk-MD5XPCTQ.js";
47
47
  import {
48
48
  GLASSTRACE_ATTRIBUTE_NAMES,
49
49
  deriveSessionId
50
- } from "./chunk-X5MAXP5T.js";
50
+ } from "./chunk-EBYISKQP.js";
51
51
  import {
52
52
  __require
53
53
  } from "./chunk-NSBPE2FW.js";
@@ -144,16 +144,22 @@ var ERROR_RESPONSE_BODY_TRUNCATION_MARKER = "...[truncated]";
144
144
  var REDACTED = "[REDACTED]";
145
145
  var ERROR_STATUS_MIN = 400;
146
146
  var ERROR_STATUS_MAX = 599;
147
- function isHttpErrorStatus(status) {
147
+ function coerceHttpStatus(value) {
148
148
  let numeric;
149
- if (typeof status === "number") {
150
- numeric = status;
151
- } else if (typeof status === "string" && status.length > 0) {
152
- numeric = Number(status);
149
+ if (typeof value === "number") {
150
+ numeric = value;
151
+ } else if (typeof value === "string") {
152
+ const trimmed = value.trim();
153
+ if (trimmed.length === 0) return void 0;
154
+ numeric = Number(trimmed);
153
155
  } else {
154
- return false;
156
+ return void 0;
155
157
  }
156
- if (!Number.isFinite(numeric)) return false;
158
+ return Number.isFinite(numeric) ? numeric : void 0;
159
+ }
160
+ function isHttpErrorStatus(status) {
161
+ const numeric = coerceHttpStatus(status);
162
+ if (numeric === void 0) return false;
157
163
  return numeric >= ERROR_STATUS_MIN && numeric <= ERROR_STATUS_MAX;
158
164
  }
159
165
  var REDACTION_PATTERNS = [
@@ -413,7 +419,7 @@ var GlasstraceExporter = class {
413
419
  }
414
420
  }
415
421
  }
416
- const statusCode = attrs["http.status_code"] ?? attrs["http.response.status_code"];
422
+ const statusCode = coerceHttpStatus(attrs["http.status_code"]) ?? coerceHttpStatus(attrs["http.response.status_code"]);
417
423
  if (statusCode !== void 0) {
418
424
  extra[ATTR.HTTP_STATUS_CODE] = statusCode;
419
425
  }
@@ -4201,7 +4207,7 @@ function registerGlasstrace(options) {
4201
4207
  setCoreState(CoreState.REGISTERING);
4202
4208
  startRuntimeStateWriter({
4203
4209
  projectRoot: process.cwd(),
4204
- sdkVersion: "1.2.0"
4210
+ sdkVersion: "1.2.1"
4205
4211
  });
4206
4212
  const config = resolveConfig(options);
4207
4213
  if (config.verbose) {
@@ -4367,8 +4373,8 @@ async function backgroundInit(config, anonKeyForInit, generation) {
4367
4373
  if (config.verbose) {
4368
4374
  console.info("[glasstrace] Background init firing.");
4369
4375
  }
4370
- const healthReport = collectHealthReport("1.2.0");
4371
- const initResult = await performInit(config, anonKeyForInit, "1.2.0", healthReport);
4376
+ const healthReport = collectHealthReport("1.2.1");
4377
+ const initResult = await performInit(config, anonKeyForInit, "1.2.1", healthReport);
4372
4378
  if (generation !== registrationGeneration) return;
4373
4379
  const currentState = getCoreState();
4374
4380
  if (currentState === CoreState.SHUTTING_DOWN || currentState === CoreState.SHUTDOWN) {
@@ -4391,7 +4397,7 @@ async function backgroundInit(config, anonKeyForInit, generation) {
4391
4397
  }
4392
4398
  maybeInstallConsoleCapture();
4393
4399
  if (didLastInitSucceed()) {
4394
- startHeartbeat(config, anonKeyForInit, "1.2.0", generation, (newApiKey, accountId) => {
4400
+ startHeartbeat(config, anonKeyForInit, "1.2.1", generation, (newApiKey, accountId) => {
4395
4401
  setAuthState(AuthState.CLAIMING);
4396
4402
  emitLifecycleEvent("auth:claim_started", { accountId });
4397
4403
  setResolvedApiKey(newApiKey);
@@ -4686,7 +4692,7 @@ async function handleSourceMapUpload(distDir) {
4686
4692
  );
4687
4693
  return;
4688
4694
  }
4689
- const { discoverSourceMapFiles, computeBuildHash, uploadSourceMaps } = await import("./source-map-uploader-DPUUCLNW.js");
4695
+ const { discoverSourceMapFiles, computeBuildHash, uploadSourceMaps } = await import("./source-map-uploader-RA4Z7TWA.js");
4690
4696
  const files = await discoverSourceMapFiles(distDir);
4691
4697
  if (files.length === 0) {
4692
4698
  console.info("[glasstrace] No source map files found. Skipping upload.");
@@ -4740,4 +4746,4 @@ export {
4740
4746
  withGlasstraceConfig,
4741
4747
  captureError
4742
4748
  };
4743
- //# sourceMappingURL=chunk-6RIH6SFM.js.map
4749
+ //# sourceMappingURL=chunk-CTJO7PUZ.js.map