@glasstrace/sdk 1.3.6 → 1.3.8

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 (57) hide show
  1. package/README.md +23 -18
  2. package/dist/{chunk-QJVAKVQJ.js → chunk-4WUHMLMM.js} +2 -2
  3. package/dist/{chunk-3HWBR7XM.js → chunk-ADUD4PEK.js} +3 -3
  4. package/dist/{chunk-BQKPRFLF.js → chunk-DBKG6SRI.js} +2 -2
  5. package/dist/{chunk-IY6A6EXS.js → chunk-E23HN24Z.js} +9 -9
  6. package/dist/{chunk-IY6A6EXS.js.map → chunk-E23HN24Z.js.map} +1 -1
  7. package/dist/{chunk-WKOQJCFN.js → chunk-FKBCEOJ5.js} +2 -2
  8. package/dist/{chunk-LQKJ27LO.js → chunk-GYTCZSAV.js} +48 -3
  9. package/dist/chunk-GYTCZSAV.js.map +1 -0
  10. package/dist/{chunk-E62DL2H4.js → chunk-LJMZXJ45.js} +3 -3
  11. package/dist/{chunk-TZMYGEMB.js → chunk-NKRD3MKG.js} +2 -1
  12. package/dist/chunk-NKRD3MKG.js.map +1 -0
  13. package/dist/{chunk-M4ZI7J3N.js → chunk-XS5W3SPL.js} +1 -1
  14. package/dist/{chunk-M4ZI7J3N.js.map → chunk-XS5W3SPL.js.map} +1 -1
  15. package/dist/cli/init.cjs +3 -2
  16. package/dist/cli/init.cjs.map +1 -1
  17. package/dist/cli/init.js +8 -8
  18. package/dist/cli/init.js.map +1 -1
  19. package/dist/cli/mcp-add.cjs +1 -0
  20. package/dist/cli/mcp-add.cjs.map +1 -1
  21. package/dist/cli/mcp-add.js +3 -3
  22. package/dist/cli/uninit.cjs.map +1 -1
  23. package/dist/cli/uninit.js +3 -3
  24. package/dist/cli/validate.cjs.map +1 -1
  25. package/dist/cli/validate.js +2 -2
  26. package/dist/{edge-entry-shCc8_Y1.d.ts → edge-entry-BSKA1l_0.d.ts} +1 -1
  27. package/dist/{edge-entry-DT9OhPTC.d.cts → edge-entry-DyMWa6JK.d.cts} +1 -1
  28. package/dist/edge-entry.cjs.map +1 -1
  29. package/dist/edge-entry.d.cts +2 -2
  30. package/dist/edge-entry.d.ts +2 -2
  31. package/dist/edge-entry.js +2 -2
  32. package/dist/index.cjs +50 -5
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/{index.d-DiI6uVEW.d.cts → index.d-Bo_Rxund.d.cts} +4 -1
  35. package/dist/{index.d-DiI6uVEW.d.ts → index.d-Bo_Rxund.d.ts} +4 -1
  36. package/dist/index.d.cts +4 -4
  37. package/dist/index.d.ts +4 -4
  38. package/dist/index.js +5 -5
  39. package/dist/node-entry.cjs +50 -5
  40. package/dist/node-entry.cjs.map +1 -1
  41. package/dist/node-entry.d.cts +2 -2
  42. package/dist/node-entry.d.ts +2 -2
  43. package/dist/node-entry.js +7 -7
  44. package/dist/node-subpath.cjs.map +1 -1
  45. package/dist/node-subpath.d.cts +1 -1
  46. package/dist/node-subpath.d.ts +1 -1
  47. package/dist/node-subpath.js +3 -3
  48. package/dist/{source-map-uploader-JAD3XM4F.js → source-map-uploader-FSTHCYDR.js} +3 -3
  49. package/package.json +1 -1
  50. package/dist/chunk-LQKJ27LO.js.map +0 -1
  51. package/dist/chunk-TZMYGEMB.js.map +0 -1
  52. /package/dist/{chunk-QJVAKVQJ.js.map → chunk-4WUHMLMM.js.map} +0 -0
  53. /package/dist/{chunk-3HWBR7XM.js.map → chunk-ADUD4PEK.js.map} +0 -0
  54. /package/dist/{chunk-BQKPRFLF.js.map → chunk-DBKG6SRI.js.map} +0 -0
  55. /package/dist/{chunk-WKOQJCFN.js.map → chunk-FKBCEOJ5.js.map} +0 -0
  56. /package/dist/{chunk-E62DL2H4.js.map → chunk-LJMZXJ45.js.map} +0 -0
  57. /package/dist/{source-map-uploader-JAD3XM4F.js.map → source-map-uploader-FSTHCYDR.js.map} +0 -0
package/README.md CHANGED
@@ -250,8 +250,8 @@ const provider = new BasicTracerProvider({
250
250
  branded exporter the auto-attach path uses, so duplicate
251
251
  `registerGlasstrace()` calls remain idempotent. `registerGlasstrace()`
252
252
  is still required when wiring the processor manually — it handles the
253
- init handshake, anonymous-key resolution, session management, and
254
- discovery endpoint, none of which are owned by the span processor.
253
+ init handshake, anonymous-key resolution, and session management, none
254
+ of which are owned by the span processor.
255
255
 
256
256
  A future SDK release may extend the auto-attach detection to recognize
257
257
  additional Next 16 provider shapes; until that ships, the manual path
@@ -380,21 +380,22 @@ mapped frames.
380
380
 
381
381
  ## Browser-extension discovery
382
382
 
383
- `glasstrace init` writes a small static file at
384
- `public/.well-known/glasstrace.json` (or `static/.well-known/glasstrace.json`
385
- on SvelteKit) so the Glasstrace browser extension can discover your
386
- project's anonymous key without a runtime HTTP handler. The file
387
- contains only a schema version and the project's anonymous key it
388
- is public metadata, not a secret, and should be committed to source
383
+ The supported discovery contract is the static file
384
+ `public/.well-known/glasstrace.json` (or
385
+ `static/.well-known/glasstrace.json` on SvelteKit). The Glasstrace
386
+ browser extension reads this file directly. `glasstrace init` writes
387
+ it for you; you do not need to add any HTTP routing for discovery. The
388
+ file contains only a schema version and the project's anonymous key
389
+ it is public metadata, not a secret, and should be committed to source
389
390
  control alongside the rest of your project.
390
391
 
391
- The SDK no longer requires `createDiscoveryHandler` to be wired into
392
- your server. If you previously registered the handler (for example,
393
- inside `middleware.ts` or `proxy.ts` on Next.js), you can remove the
394
- handler code and the extension will read the static file instead.
395
-
396
392
  ### Migration: removing the runtime discovery handler
397
393
 
394
+ If you previously wired `createDiscoveryHandler` yourself (for example
395
+ on `@glasstrace/sdk@<1.0.0`), the migration below shows how to remove
396
+ it on upgrade. Users starting fresh on `@glasstrace/sdk@>=1.0.0` do
397
+ not need this section.
398
+
398
399
  **Next.js 15 and earlier (`middleware.ts`):**
399
400
 
400
401
  ```ts
@@ -451,11 +452,15 @@ export function proxy(_req: Request) {
451
452
 
452
453
  If `proxy.ts` no longer does anything else, you can delete it entirely.
453
454
 
454
- `createDiscoveryHandler` was removed from the public API in `v1.0.0`.
455
- The runtime handler is installed automatically in anonymous + development
456
- mode — there is nothing to wire up yourself. Run `npx glasstrace init`
457
- after upgrading to generate the static file; the extension reads the
458
- file directly and no longer needs the runtime handler.
455
+ **The supported discovery contract is `public/.well-known/glasstrace.json`.**
456
+ `createDiscoveryHandler` was removed from the public API in `v1.0.0` and
457
+ is no longer exported from `@glasstrace/sdk`. The SDK retains an
458
+ internal runtime handler at `/__glasstrace/config` for backwards
459
+ compatibility with older consumer integrations during local
460
+ development. The internal handler is **not part of the supported
461
+ discovery contract** — it is not documented for use, not covered by
462
+ validation expectations, and may be removed in a future release
463
+ without a deprecation cycle. Rely on the static file.
459
464
 
460
465
  ## Subpath exports
461
466
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createBuildHash
3
- } from "./chunk-M4ZI7J3N.js";
3
+ } from "./chunk-XS5W3SPL.js";
4
4
 
5
5
  // src/import-graph.ts
6
6
  import * as fs from "node:fs/promises";
@@ -175,4 +175,4 @@ export {
175
175
  extractImports,
176
176
  buildImportGraph
177
177
  };
178
- //# sourceMappingURL=chunk-QJVAKVQJ.js.map
178
+ //# sourceMappingURL=chunk-4WUHMLMM.js.map
@@ -2,12 +2,12 @@ import {
2
2
  atomicWriteFile,
3
3
  refreshGenericMcpConfigAtRuntime,
4
4
  resolveEffectiveMcpCredential
5
- } from "./chunk-LQKJ27LO.js";
5
+ } from "./chunk-GYTCZSAV.js";
6
6
  import {
7
7
  DEFAULT_CAPTURE_CONFIG,
8
8
  SdkCachedConfigSchema,
9
9
  SdkInitResponseSchema
10
- } from "./chunk-M4ZI7J3N.js";
10
+ } from "./chunk-XS5W3SPL.js";
11
11
  import {
12
12
  __require
13
13
  } from "./chunk-NSBPE2FW.js";
@@ -692,4 +692,4 @@ export {
692
692
  didLastInitSucceed,
693
693
  verifyInitReachable
694
694
  };
695
- //# sourceMappingURL=chunk-3HWBR7XM.js.map
695
+ //# sourceMappingURL=chunk-ADUD4PEK.js.map
@@ -5,7 +5,7 @@ import {
5
5
  PresignedUploadResponseSchema,
6
6
  SourceMapManifestResponseSchema,
7
7
  SourceMapUploadResponseSchema
8
- } from "./chunk-M4ZI7J3N.js";
8
+ } from "./chunk-XS5W3SPL.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-BQKPRFLF.js.map
334
+ //# sourceMappingURL=chunk-DBKG6SRI.js.map
@@ -33,7 +33,7 @@ import {
33
33
  performInit,
34
34
  recordSpansDropped,
35
35
  recordSpansExported
36
- } from "./chunk-3HWBR7XM.js";
36
+ } from "./chunk-ADUD4PEK.js";
37
37
  import {
38
38
  isAnonymousMode,
39
39
  isProductionDisabled,
@@ -44,11 +44,11 @@ import {
44
44
  getOrCreateAnonKey,
45
45
  isSyncFsAvailable,
46
46
  readAnonKey
47
- } from "./chunk-LQKJ27LO.js";
47
+ } from "./chunk-GYTCZSAV.js";
48
48
  import {
49
49
  GLASSTRACE_ATTRIBUTE_NAMES,
50
50
  deriveSessionId
51
- } from "./chunk-M4ZI7J3N.js";
51
+ } from "./chunk-XS5W3SPL.js";
52
52
  import {
53
53
  __require
54
54
  } from "./chunk-NSBPE2FW.js";
@@ -4297,7 +4297,7 @@ function registerGlasstrace(options) {
4297
4297
  setCoreState(CoreState.REGISTERING);
4298
4298
  startRuntimeStateWriter({
4299
4299
  projectRoot: process.cwd(),
4300
- sdkVersion: "1.3.6"
4300
+ sdkVersion: "1.3.8"
4301
4301
  });
4302
4302
  const config = resolveConfig(options);
4303
4303
  if (config.verbose) {
@@ -4464,8 +4464,8 @@ async function backgroundInit(config, anonKeyForInit, generation) {
4464
4464
  if (config.verbose) {
4465
4465
  console.info("[glasstrace] Background init firing.");
4466
4466
  }
4467
- const healthReport = collectHealthReport("1.3.6");
4468
- const initResult = await performInit(config, anonKeyForInit, "1.3.6", healthReport);
4467
+ const healthReport = collectHealthReport("1.3.8");
4468
+ const initResult = await performInit(config, anonKeyForInit, "1.3.8", healthReport);
4469
4469
  if (generation !== registrationGeneration) return;
4470
4470
  const currentState = getCoreState();
4471
4471
  if (currentState === CoreState.SHUTTING_DOWN || currentState === CoreState.SHUTDOWN) {
@@ -4488,7 +4488,7 @@ async function backgroundInit(config, anonKeyForInit, generation) {
4488
4488
  }
4489
4489
  maybeInstallConsoleCapture();
4490
4490
  if (didLastInitSucceed()) {
4491
- startHeartbeat(config, anonKeyForInit, "1.3.6", generation, (newApiKey, accountId) => {
4491
+ startHeartbeat(config, anonKeyForInit, "1.3.8", generation, (newApiKey, accountId) => {
4492
4492
  setAuthState(AuthState.CLAIMING);
4493
4493
  emitLifecycleEvent("auth:claim_started", { accountId });
4494
4494
  setResolvedApiKey(newApiKey);
@@ -4785,7 +4785,7 @@ async function handleSourceMapUpload(distDir) {
4785
4785
  );
4786
4786
  return;
4787
4787
  }
4788
- const { discoverSourceMapFiles, computeBuildHash, uploadSourceMaps } = await import("./source-map-uploader-JAD3XM4F.js");
4788
+ const { discoverSourceMapFiles, computeBuildHash, uploadSourceMaps } = await import("./source-map-uploader-FSTHCYDR.js");
4789
4789
  const files = await discoverSourceMapFiles(distDir);
4790
4790
  if (files.length === 0) {
4791
4791
  console.info("[glasstrace] No source map files found. Skipping upload.");
@@ -4888,4 +4888,4 @@ export {
4888
4888
  withGlasstraceConfig,
4889
4889
  captureError
4890
4890
  };
4891
- //# sourceMappingURL=chunk-IY6A6EXS.js.map
4891
+ //# sourceMappingURL=chunk-E23HN24Z.js.map