@glasstrace/sdk 1.15.1 → 1.17.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 (75) hide show
  1. package/README.md +118 -11
  2. package/dist/async-context/index.cjs +21 -2
  3. package/dist/async-context/index.cjs.map +1 -1
  4. package/dist/async-context/index.js +2 -2
  5. package/dist/{capture-error-03qDnC5v.d.cts → capture-error-B0txjNut.d.cts} +2 -2
  6. package/dist/{capture-error-CAfFUyIU.d.ts → capture-error-Dc01rYNR.d.ts} +2 -2
  7. package/dist/{chunk-ZIYT2Y4B.js → chunk-BJOZBAP7.js} +3 -3
  8. package/dist/{chunk-VMK2G6QR.js → chunk-CN5EP25B.js} +2 -2
  9. package/dist/{chunk-HMEHYSTS.js → chunk-EVX6D2TX.js} +2 -2
  10. package/dist/{chunk-T4ETJJSK.js → chunk-F2IPBTDJ.js} +133 -11
  11. package/dist/{chunk-T4ETJJSK.js.map → chunk-F2IPBTDJ.js.map} +1 -1
  12. package/dist/{chunk-XMD5OYD6.js → chunk-M3QGJUEI.js} +2 -2
  13. package/dist/{chunk-7LE2O4ZJ.js → chunk-MKT54VEH.js} +55 -6
  14. package/dist/{chunk-7LE2O4ZJ.js.map → chunk-MKT54VEH.js.map} +1 -1
  15. package/dist/{chunk-MP3QNDXQ.js → chunk-O7IJP2TQ.js} +2 -2
  16. package/dist/{chunk-F7A3QXCT.js → chunk-UOAG72NR.js} +2 -2
  17. package/dist/{chunk-6ST4QV7T.js → chunk-VEQX2YSQ.js} +3 -3
  18. package/dist/{chunk-LQZRGBN5.js → chunk-YKE6HJLW.js} +2 -2
  19. package/dist/cli/init.cjs +18 -5
  20. package/dist/cli/init.cjs.map +1 -1
  21. package/dist/cli/init.js +7 -7
  22. package/dist/cli/mcp-add.cjs +15 -2
  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 +14 -1
  29. package/dist/cli/validate.cjs.map +1 -1
  30. package/dist/cli/validate.js +2 -2
  31. package/dist/{correlation-id-YcfcqOru.d.ts → correlation-id-B9YYmoZw.d.ts} +1 -1
  32. package/dist/{correlation-id-CZ2bstzA.d.cts → correlation-id-CelUvw7j.d.cts} +1 -1
  33. package/dist/edge-entry.cjs +21 -2
  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/import-graph-DBLGNjcI.d.cts +238 -0
  39. package/dist/import-graph-Dka_Fm7j.d.ts +238 -0
  40. package/dist/index.cjs +203 -12
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/{index.d-BQIJ5Dvc.d.cts → index.d-3-cJoY8y.d.cts} +10 -2
  43. package/dist/{index.d-BQIJ5Dvc.d.ts → index.d-3-cJoY8y.d.ts} +10 -2
  44. package/dist/index.d.cts +102 -5
  45. package/dist/index.d.ts +102 -5
  46. package/dist/index.js +30 -5
  47. package/dist/index.js.map +1 -1
  48. package/dist/middleware/index.cjs +21 -2
  49. package/dist/middleware/index.cjs.map +1 -1
  50. package/dist/middleware/index.js +2 -2
  51. package/dist/node-entry.cjs +28 -8
  52. package/dist/node-entry.cjs.map +1 -1
  53. package/dist/node-entry.d.cts +4 -4
  54. package/dist/node-entry.d.ts +4 -4
  55. package/dist/node-entry.js +7 -7
  56. package/dist/node-subpath.cjs +27 -1
  57. package/dist/node-subpath.cjs.map +1 -1
  58. package/dist/node-subpath.d.cts +51 -235
  59. package/dist/node-subpath.d.ts +51 -235
  60. package/dist/node-subpath.js +16 -3
  61. package/dist/node-subpath.js.map +1 -1
  62. package/dist/{source-map-uploader-NUONOEJG.js → source-map-uploader-U7SLSKIZ.js} +3 -3
  63. package/dist/trpc/index.cjs +21 -2
  64. package/dist/trpc/index.cjs.map +1 -1
  65. package/dist/trpc/index.js +1 -1
  66. package/package.json +1 -1
  67. /package/dist/{chunk-ZIYT2Y4B.js.map → chunk-BJOZBAP7.js.map} +0 -0
  68. /package/dist/{chunk-VMK2G6QR.js.map → chunk-CN5EP25B.js.map} +0 -0
  69. /package/dist/{chunk-HMEHYSTS.js.map → chunk-EVX6D2TX.js.map} +0 -0
  70. /package/dist/{chunk-XMD5OYD6.js.map → chunk-M3QGJUEI.js.map} +0 -0
  71. /package/dist/{chunk-MP3QNDXQ.js.map → chunk-O7IJP2TQ.js.map} +0 -0
  72. /package/dist/{chunk-F7A3QXCT.js.map → chunk-UOAG72NR.js.map} +0 -0
  73. /package/dist/{chunk-6ST4QV7T.js.map → chunk-VEQX2YSQ.js.map} +0 -0
  74. /package/dist/{chunk-LQZRGBN5.js.map → chunk-YKE6HJLW.js.map} +0 -0
  75. /package/dist/{source-map-uploader-NUONOEJG.js.map → source-map-uploader-U7SLSKIZ.js.map} +0 -0
@@ -1,7 +1,7 @@
1
- export { C as CorrelationIdRequest, G as GlasstraceSpanProcessor, S as SdkError, a as SessionManager, c as captureCorrelationId, g as getDateString, b as getOrigin } from './correlation-id-CZ2bstzA.cjs';
2
- export { F as FetchTarget, G as GlasstraceExporter, a as GlasstraceExporterOptions, I as InitClaimResult, R as ResolvedConfig, c as captureError, b as classifyFetchTarget, d as createGlasstraceSpanProcessor, g as getActiveConfig, e as getDiscoveryHandler, f as getLinkedAccountId, h as getOrCreateAnonKey, i as getStatus, j as isAnonymousMode, k as isProductionDisabled, l as isReady, m as loadCachedConfig, p as performInit, r as readAnonKey, n as readEnvVars, o as registerGlasstrace, q as resolveConfig, s as saveCachedConfig, t as sendInitRequest, w as waitForReady, u as withGlasstraceConfig } from './capture-error-03qDnC5v.cjs';
3
- export { AutoUploadOptions, BlobUploader, PRESIGNED_THRESHOLD_BYTES, SourceMapEntry, SourceMapFileInfo, buildImportGraph, collectSourceMaps, computeBuildHash, discoverSourceMapFiles, discoverTestFiles, extractImports, uploadSourceMaps, uploadSourceMapsAuto, uploadSourceMapsPresigned } from './node-subpath.cjs';
4
- export { d as deriveSessionId } from './index.d-BQIJ5Dvc.cjs';
1
+ export { C as CorrelationIdRequest, G as GlasstraceSpanProcessor, S as SdkError, a as SessionManager, c as captureCorrelationId, g as getDateString, b as getOrigin } from './correlation-id-CelUvw7j.cjs';
2
+ export { F as FetchTarget, G as GlasstraceExporter, a as GlasstraceExporterOptions, I as InitClaimResult, R as ResolvedConfig, c as captureError, b as classifyFetchTarget, d as createGlasstraceSpanProcessor, g as getActiveConfig, e as getDiscoveryHandler, f as getLinkedAccountId, h as getOrCreateAnonKey, i as getStatus, j as isAnonymousMode, k as isProductionDisabled, l as isReady, m as loadCachedConfig, p as performInit, r as readAnonKey, n as readEnvVars, o as registerGlasstrace, q as resolveConfig, s as saveCachedConfig, t as sendInitRequest, w as waitForReady, u as withGlasstraceConfig } from './capture-error-B0txjNut.cjs';
3
+ export { A as AutoUploadOptions, B as BlobUploader, P as PRESIGNED_THRESHOLD_BYTES, S as SourceMapEntry, a as SourceMapFileInfo, b as buildImportGraph, c as collectSourceMaps, d as computeBuildHash, e as discoverSourceMapFiles, f as discoverTestFiles, g as extractImports, u as uploadSourceMaps, h as uploadSourceMapsAuto, i as uploadSourceMapsPresigned } from './import-graph-DBLGNjcI.cjs';
4
+ export { d as deriveSessionId } from './index.d-3-cJoY8y.cjs';
5
5
  import './export/ReadableSpan';
6
6
  import './Span';
7
7
  import './SpanProcessor';
@@ -1,7 +1,7 @@
1
- export { C as CorrelationIdRequest, G as GlasstraceSpanProcessor, S as SdkError, a as SessionManager, c as captureCorrelationId, g as getDateString, b as getOrigin } from './correlation-id-YcfcqOru.js';
2
- export { F as FetchTarget, G as GlasstraceExporter, a as GlasstraceExporterOptions, I as InitClaimResult, R as ResolvedConfig, c as captureError, b as classifyFetchTarget, d as createGlasstraceSpanProcessor, g as getActiveConfig, e as getDiscoveryHandler, f as getLinkedAccountId, h as getOrCreateAnonKey, i as getStatus, j as isAnonymousMode, k as isProductionDisabled, l as isReady, m as loadCachedConfig, p as performInit, r as readAnonKey, n as readEnvVars, o as registerGlasstrace, q as resolveConfig, s as saveCachedConfig, t as sendInitRequest, w as waitForReady, u as withGlasstraceConfig } from './capture-error-CAfFUyIU.js';
3
- export { AutoUploadOptions, BlobUploader, PRESIGNED_THRESHOLD_BYTES, SourceMapEntry, SourceMapFileInfo, buildImportGraph, collectSourceMaps, computeBuildHash, discoverSourceMapFiles, discoverTestFiles, extractImports, uploadSourceMaps, uploadSourceMapsAuto, uploadSourceMapsPresigned } from './node-subpath.js';
4
- export { d as deriveSessionId } from './index.d-BQIJ5Dvc.js';
1
+ export { C as CorrelationIdRequest, G as GlasstraceSpanProcessor, S as SdkError, a as SessionManager, c as captureCorrelationId, g as getDateString, b as getOrigin } from './correlation-id-B9YYmoZw.js';
2
+ export { F as FetchTarget, G as GlasstraceExporter, a as GlasstraceExporterOptions, I as InitClaimResult, R as ResolvedConfig, c as captureError, b as classifyFetchTarget, d as createGlasstraceSpanProcessor, g as getActiveConfig, e as getDiscoveryHandler, f as getLinkedAccountId, h as getOrCreateAnonKey, i as getStatus, j as isAnonymousMode, k as isProductionDisabled, l as isReady, m as loadCachedConfig, p as performInit, r as readAnonKey, n as readEnvVars, o as registerGlasstrace, q as resolveConfig, s as saveCachedConfig, t as sendInitRequest, w as waitForReady, u as withGlasstraceConfig } from './capture-error-Dc01rYNR.js';
3
+ export { A as AutoUploadOptions, B as BlobUploader, P as PRESIGNED_THRESHOLD_BYTES, S as SourceMapEntry, a as SourceMapFileInfo, b as buildImportGraph, c as collectSourceMaps, d as computeBuildHash, e as discoverSourceMapFiles, f as discoverTestFiles, g as extractImports, u as uploadSourceMaps, h as uploadSourceMapsAuto, i as uploadSourceMapsPresigned } from './import-graph-Dka_Fm7j.js';
4
+ export { d as deriveSessionId } from './index.d-3-cJoY8y.js';
5
5
  import './export/ReadableSpan';
6
6
  import './Span';
7
7
  import './SpanProcessor';
@@ -9,7 +9,7 @@ import {
9
9
  getOrigin,
10
10
  registerGlasstrace,
11
11
  withGlasstraceConfig
12
- } from "./chunk-T4ETJJSK.js";
12
+ } from "./chunk-F2IPBTDJ.js";
13
13
  import {
14
14
  getStatus,
15
15
  isReady,
@@ -19,7 +19,7 @@ import {
19
19
  GlasstraceSpanProcessor,
20
20
  SdkError,
21
21
  captureCorrelationId
22
- } from "./chunk-HMEHYSTS.js";
22
+ } from "./chunk-EVX6D2TX.js";
23
23
  import "./chunk-CL3OVHPO.js";
24
24
  import "./chunk-DQ25VOKK.js";
25
25
  import {
@@ -30,7 +30,7 @@ import {
30
30
  uploadSourceMaps,
31
31
  uploadSourceMapsAuto,
32
32
  uploadSourceMapsPresigned
33
- } from "./chunk-MP3QNDXQ.js";
33
+ } from "./chunk-O7IJP2TQ.js";
34
34
  import "./chunk-YG3X7TUI.js";
35
35
  import {
36
36
  getActiveConfig,
@@ -39,12 +39,12 @@ import {
39
39
  performInit,
40
40
  saveCachedConfig,
41
41
  sendInitRequest
42
- } from "./chunk-6ST4QV7T.js";
42
+ } from "./chunk-VEQX2YSQ.js";
43
43
  import {
44
44
  buildImportGraph,
45
45
  discoverTestFiles,
46
46
  extractImports
47
- } from "./chunk-XMD5OYD6.js";
47
+ } from "./chunk-M3QGJUEI.js";
48
48
  import {
49
49
  isAnonymousMode,
50
50
  isProductionDisabled,
@@ -54,10 +54,10 @@ import {
54
54
  import {
55
55
  getOrCreateAnonKey,
56
56
  readAnonKey
57
- } from "./chunk-F7A3QXCT.js";
57
+ } from "./chunk-UOAG72NR.js";
58
58
  import {
59
59
  deriveSessionId
60
- } from "./chunk-7LE2O4ZJ.js";
60
+ } from "./chunk-MKT54VEH.js";
61
61
  import "./chunk-YIEXKQYP.js";
62
62
  import "./chunk-NSBPE2FW.js";
63
63
  export {
@@ -37,6 +37,7 @@ __export(node_subpath_exports, {
37
37
  discoverSourceMapFiles: () => discoverSourceMapFiles,
38
38
  discoverTestFiles: () => discoverTestFiles,
39
39
  extractImports: () => extractImports,
40
+ hashId: () => hashId,
40
41
  uploadSourceMaps: () => uploadSourceMaps,
41
42
  uploadSourceMapsAuto: () => uploadSourceMapsAuto,
42
43
  uploadSourceMapsPresigned: () => uploadSourceMapsPresigned
@@ -14609,7 +14610,20 @@ var CaptureConfigSchema = external_exports.object({
14609
14610
  * client-side allowlist enforcement layered with the product's
14610
14611
  * storage-time filter as defense-in-depth.
14611
14612
  */
14612
- sideEffectEvidence: external_exports.boolean().optional().default(false)
14613
+ sideEffectEvidence: external_exports.boolean().optional().default(false),
14614
+ /**
14615
+ * Per-account value-fidelity capture posture (server-pushed).
14616
+ *
14617
+ * `strict` (default) is fail-closed: the SDK rejects raw wall-clock
14618
+ * timestamps and unhashed identifiers from the `scalar.*` channel at
14619
+ * emit time. `full` relaxes those rejections so raw magnitudes can be
14620
+ * surfaced — but only in conjunction with an explicit producer opt-in
14621
+ * (so a `full`-configured account still emits strict-shaped scalars
14622
+ * unless the producer also opts in). The operator owns this flag; it
14623
+ * is never derived from producer or request input. Absent on the wire
14624
+ * ⇒ `strict`.
14625
+ */
14626
+ captureFidelity: external_exports.enum(["strict", "full"]).optional().default("strict")
14613
14627
  });
14614
14628
  var SdkCachedConfigSchema = external_exports.object({
14615
14629
  response: external_exports.record(external_exports.string(), external_exports.unknown()),
@@ -14819,6 +14833,8 @@ var K = new Uint32Array([
14819
14833
  3204031479,
14820
14834
  3329325298
14821
14835
  ]);
14836
+ var SIDE_EFFECT_HASHED_ID_PREFIX = "gthid_";
14837
+ var SIDE_EFFECT_HASHED_ID_HEX_LENGTH = 32;
14822
14838
 
14823
14839
  // src/source-map-uploader.ts
14824
14840
  var LARGE_FILE_WARNING_BYTES = 50 * 1024 * 1024;
@@ -15287,6 +15303,15 @@ async function buildImportGraph(projectRoot) {
15287
15303
  const buildHash = createBuildHash(hashHex);
15288
15304
  return { buildHash, graph };
15289
15305
  }
15306
+
15307
+ // src/side-effect/hash-id.ts
15308
+ var import_node_crypto = require("node:crypto");
15309
+ function hashId(raw, key) {
15310
+ if (typeof raw !== "string" || raw.length === 0) return null;
15311
+ if (typeof key !== "string" || key.length === 0) return null;
15312
+ const digest = (0, import_node_crypto.createHmac)("sha256", key).update(raw).digest("hex").slice(0, SIDE_EFFECT_HASHED_ID_HEX_LENGTH);
15313
+ return `${SIDE_EFFECT_HASHED_ID_PREFIX}${digest}`;
15314
+ }
15290
15315
  // Annotate the CommonJS export names for ESM import in node:
15291
15316
  0 && (module.exports = {
15292
15317
  PRESIGNED_THRESHOLD_BYTES,
@@ -15296,6 +15321,7 @@ async function buildImportGraph(projectRoot) {
15296
15321
  discoverSourceMapFiles,
15297
15322
  discoverTestFiles,
15298
15323
  extractImports,
15324
+ hashId,
15299
15325
  uploadSourceMaps,
15300
15326
  uploadSourceMapsAuto,
15301
15327
  uploadSourceMapsPresigned