@glasstrace/sdk 1.3.5 → 1.3.7

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 (55) hide show
  1. package/README.md +23 -18
  2. package/dist/{chunk-QJVAKVQJ.js → chunk-4WUHMLMM.js} +2 -2
  3. package/dist/{chunk-BQKPRFLF.js → chunk-DBKG6SRI.js} +2 -2
  4. package/dist/{chunk-WKOQJCFN.js → chunk-FKBCEOJ5.js} +2 -2
  5. package/dist/{chunk-EK6MYHR2.js → chunk-LW7474ZA.js} +29 -22
  6. package/dist/{chunk-EK6MYHR2.js.map → chunk-LW7474ZA.js.map} +1 -1
  7. package/dist/{chunk-E62DL2H4.js → chunk-TUFUV43S.js} +3 -3
  8. package/dist/{chunk-P4OYPFQ5.js → chunk-TZMYGEMB.js} +2 -2
  9. package/dist/chunk-TZMYGEMB.js.map +1 -0
  10. package/dist/{chunk-LQKJ27LO.js → chunk-V2S7BSV4.js} +2 -2
  11. package/dist/{chunk-M4ZI7J3N.js → chunk-XS5W3SPL.js} +1 -1
  12. package/dist/{chunk-M4ZI7J3N.js.map → chunk-XS5W3SPL.js.map} +1 -1
  13. package/dist/{chunk-3HWBR7XM.js → chunk-YSBGMBI5.js} +3 -3
  14. package/dist/cli/init.cjs +3 -3
  15. package/dist/cli/init.cjs.map +1 -1
  16. package/dist/cli/init.js +8 -8
  17. package/dist/cli/init.js.map +1 -1
  18. package/dist/cli/mcp-add.cjs +1 -1
  19. package/dist/cli/mcp-add.cjs.map +1 -1
  20. package/dist/cli/mcp-add.js +3 -3
  21. package/dist/cli/uninit.js +3 -3
  22. package/dist/cli/validate.cjs.map +1 -1
  23. package/dist/cli/validate.js +2 -2
  24. package/dist/{edge-entry-shCc8_Y1.d.ts → edge-entry-BSKA1l_0.d.ts} +1 -1
  25. package/dist/{edge-entry-DT9OhPTC.d.cts → edge-entry-DyMWa6JK.d.cts} +1 -1
  26. package/dist/edge-entry.cjs.map +1 -1
  27. package/dist/edge-entry.d.cts +2 -2
  28. package/dist/edge-entry.d.ts +2 -2
  29. package/dist/edge-entry.js +2 -2
  30. package/dist/index.cjs +24 -17
  31. package/dist/index.cjs.map +1 -1
  32. package/dist/{index.d-DiI6uVEW.d.cts → index.d-Bo_Rxund.d.cts} +4 -1
  33. package/dist/{index.d-DiI6uVEW.d.ts → index.d-Bo_Rxund.d.ts} +4 -1
  34. package/dist/index.d.cts +4 -4
  35. package/dist/index.d.ts +4 -4
  36. package/dist/index.js +5 -5
  37. package/dist/node-entry.cjs +26 -19
  38. package/dist/node-entry.cjs.map +1 -1
  39. package/dist/node-entry.d.cts +2 -2
  40. package/dist/node-entry.d.ts +2 -2
  41. package/dist/node-entry.js +7 -7
  42. package/dist/node-subpath.cjs.map +1 -1
  43. package/dist/node-subpath.d.cts +1 -1
  44. package/dist/node-subpath.d.ts +1 -1
  45. package/dist/node-subpath.js +3 -3
  46. package/dist/{source-map-uploader-JAD3XM4F.js → source-map-uploader-FSTHCYDR.js} +3 -3
  47. package/package.json +1 -1
  48. package/dist/chunk-P4OYPFQ5.js.map +0 -1
  49. /package/dist/{chunk-QJVAKVQJ.js.map → chunk-4WUHMLMM.js.map} +0 -0
  50. /package/dist/{chunk-BQKPRFLF.js.map → chunk-DBKG6SRI.js.map} +0 -0
  51. /package/dist/{chunk-WKOQJCFN.js.map → chunk-FKBCEOJ5.js.map} +0 -0
  52. /package/dist/{chunk-E62DL2H4.js.map → chunk-TUFUV43S.js.map} +0 -0
  53. /package/dist/{chunk-LQKJ27LO.js.map → chunk-V2S7BSV4.js.map} +0 -0
  54. /package/dist/{chunk-3HWBR7XM.js.map → chunk-YSBGMBI5.js.map} +0 -0
  55. /package/dist/{source-map-uploader-JAD3XM4F.js.map → source-map-uploader-FSTHCYDR.js.map} +0 -0
@@ -1,5 +1,5 @@
1
- export { C as CorrelationIdRequest, G as GlasstraceSpanProcessor, S as SdkError, c as captureCorrelationId } from './edge-entry-DT9OhPTC.cjs';
2
- import './index.d-DiI6uVEW.cjs';
1
+ export { C as CorrelationIdRequest, G as GlasstraceSpanProcessor, S as SdkError, c as captureCorrelationId } from './edge-entry-DyMWa6JK.cjs';
2
+ import './index.d-Bo_Rxund.cjs';
3
3
  import './v4/classic/external.cjs';
4
4
  import './export/ReadableSpan';
5
5
  import './Span';
@@ -1,5 +1,5 @@
1
- export { C as CorrelationIdRequest, G as GlasstraceSpanProcessor, S as SdkError, c as captureCorrelationId } from './edge-entry-shCc8_Y1.js';
2
- import './index.d-DiI6uVEW.js';
1
+ export { C as CorrelationIdRequest, G as GlasstraceSpanProcessor, S as SdkError, c as captureCorrelationId } from './edge-entry-BSKA1l_0.js';
2
+ import './index.d-Bo_Rxund.js';
3
3
  import './v4/classic/external.cjs';
4
4
  import './export/ReadableSpan';
5
5
  import './Span';
@@ -2,9 +2,9 @@ import {
2
2
  GlasstraceSpanProcessor,
3
3
  SdkError,
4
4
  captureCorrelationId
5
- } from "./chunk-WKOQJCFN.js";
5
+ } from "./chunk-FKBCEOJ5.js";
6
6
  import "./chunk-DQ25VOKK.js";
7
- import "./chunk-M4ZI7J3N.js";
7
+ import "./chunk-XS5W3SPL.js";
8
8
  import "./chunk-NSBPE2FW.js";
9
9
  export {
10
10
  GlasstraceSpanProcessor,
package/dist/index.cjs CHANGED
@@ -22426,19 +22426,19 @@ function stopHeartbeat() {
22426
22426
  }
22427
22427
  }
22428
22428
  function checkShutdownMarker(projectRoot) {
22429
- let fsSync = null;
22430
- let pathSync = null;
22429
+ let fsSync2 = null;
22430
+ let pathSync2 = null;
22431
22431
  try {
22432
- fsSync = require("node:fs");
22433
- pathSync = require("node:path");
22432
+ fsSync2 = require("node:fs");
22433
+ pathSync2 = require("node:path");
22434
22434
  } catch {
22435
22435
  return { triggered: false };
22436
22436
  }
22437
22437
  const root = projectRoot ?? (typeof process !== "undefined" ? process.cwd() : ".");
22438
- const markerPath = pathSync.join(root, SHUTDOWN_MARKER_RELPATH);
22439
- if (!fsSync.existsSync(markerPath)) return { triggered: false };
22438
+ const markerPath = pathSync2.join(root, SHUTDOWN_MARKER_RELPATH);
22439
+ if (!fsSync2.existsSync(markerPath)) return { triggered: false };
22440
22440
  try {
22441
- fsSync.unlinkSync(markerPath);
22441
+ fsSync2.unlinkSync(markerPath);
22442
22442
  } catch {
22443
22443
  }
22444
22444
  const shutdown = executeShutdown().catch(() => {
@@ -22518,9 +22518,16 @@ function registerHeartbeatShutdownHook(config2, anonKey, sdkVersion) {
22518
22518
  }
22519
22519
 
22520
22520
  // src/runtime-state.ts
22521
- var import_node_fs = require("node:fs");
22522
- var import_node_path = require("node:path");
22523
22521
  init_console_capture();
22522
+ var fsSync = null;
22523
+ var pathSync = null;
22524
+ try {
22525
+ fsSync = require("node:fs");
22526
+ pathSync = require("node:path");
22527
+ } catch {
22528
+ fsSync = null;
22529
+ pathSync = null;
22530
+ }
22524
22531
  var _projectRoot = null;
22525
22532
  var _sdkVersion = "unknown";
22526
22533
  var _lastScenario;
@@ -22529,7 +22536,7 @@ var _debounceTimer = null;
22529
22536
  var _started = false;
22530
22537
  function startRuntimeStateWriter(options) {
22531
22538
  if (_started) return;
22532
- if (!isSyncFsAvailable()) {
22539
+ if (!isSyncFsAvailable() || fsSync === null || pathSync === null) {
22533
22540
  _started = true;
22534
22541
  return;
22535
22542
  }
@@ -22581,9 +22588,9 @@ function writeStateNow() {
22581
22588
  if (_lastError) {
22582
22589
  runtimeState.lastError = _lastError;
22583
22590
  }
22584
- const dir = (0, import_node_path.join)(_projectRoot, ".glasstrace");
22585
- const filePath = (0, import_node_path.join)(dir, "runtime-state.json");
22586
- (0, import_node_fs.mkdirSync)(dir, { recursive: true, mode: 448 });
22591
+ const dir = pathSync.join(_projectRoot, ".glasstrace");
22592
+ const filePath = pathSync.join(dir, "runtime-state.json");
22593
+ fsSync.mkdirSync(dir, { recursive: true, mode: 448 });
22587
22594
  atomicWriteFileSync(filePath, JSON.stringify(runtimeState, null, 2) + "\n", {
22588
22595
  mode: 384
22589
22596
  });
@@ -22625,7 +22632,7 @@ function registerGlasstrace(options) {
22625
22632
  setCoreState(CoreState.REGISTERING);
22626
22633
  startRuntimeStateWriter({
22627
22634
  projectRoot: process.cwd(),
22628
- sdkVersion: "1.3.5"
22635
+ sdkVersion: "1.3.7"
22629
22636
  });
22630
22637
  const config2 = resolveConfig(options);
22631
22638
  if (config2.verbose) {
@@ -22792,8 +22799,8 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
22792
22799
  if (config2.verbose) {
22793
22800
  console.info("[glasstrace] Background init firing.");
22794
22801
  }
22795
- const healthReport = collectHealthReport("1.3.5");
22796
- const initResult = await performInit(config2, anonKeyForInit, "1.3.5", healthReport);
22802
+ const healthReport = collectHealthReport("1.3.7");
22803
+ const initResult = await performInit(config2, anonKeyForInit, "1.3.7", healthReport);
22797
22804
  if (generation !== registrationGeneration) return;
22798
22805
  const currentState = getCoreState();
22799
22806
  if (currentState === CoreState.SHUTTING_DOWN || currentState === CoreState.SHUTDOWN) {
@@ -22816,7 +22823,7 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
22816
22823
  }
22817
22824
  maybeInstallConsoleCapture();
22818
22825
  if (didLastInitSucceed()) {
22819
- startHeartbeat(config2, anonKeyForInit, "1.3.5", generation, (newApiKey, accountId) => {
22826
+ startHeartbeat(config2, anonKeyForInit, "1.3.7", generation, (newApiKey, accountId) => {
22820
22827
  setAuthState(AuthState.CLAIMING);
22821
22828
  emitLifecycleEvent("auth:claim_started", { accountId });
22822
22829
  setResolvedApiKey(newApiKey);