@glasstrace/sdk 1.3.1 → 1.3.2

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.
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  registerGlasstrace,
13
13
  waitForReady,
14
14
  withGlasstraceConfig
15
- } from "./chunk-5PFPEA4C.js";
15
+ } from "./chunk-DQGNUENK.js";
16
16
  import {
17
17
  GlasstraceSpanProcessor,
18
18
  SdkError,
@@ -27,7 +27,7 @@ import {
27
27
  performInit,
28
28
  saveCachedConfig,
29
29
  sendInitRequest
30
- } from "./chunk-X4IK6KES.js";
30
+ } from "./chunk-REEU6CNO.js";
31
31
  import {
32
32
  isAnonymousMode,
33
33
  isProductionDisabled,
@@ -37,7 +37,7 @@ import {
37
37
  import {
38
38
  getOrCreateAnonKey,
39
39
  readAnonKey
40
- } from "./chunk-DW2UJUNB.js";
40
+ } from "./chunk-UFZEISZB.js";
41
41
  import {
42
42
  deriveSessionId
43
43
  } from "./chunk-MQHLWSIX.js";
@@ -17698,6 +17698,14 @@ function fsyncParentDirSyncWithFs(targetPath, fs4) {
17698
17698
  }
17699
17699
  }
17700
17700
  }
17701
+ function isSyncFsAvailable() {
17702
+ try {
17703
+ loadFsSync();
17704
+ return true;
17705
+ } catch {
17706
+ return false;
17707
+ }
17708
+ }
17701
17709
 
17702
17710
  // src/mcp-runtime.ts
17703
17711
  var MCP_ENDPOINT = "https://api.glasstrace.dev/mcp";
@@ -22502,6 +22510,10 @@ var _debounceTimer = null;
22502
22510
  var _started = false;
22503
22511
  function startRuntimeStateWriter(options) {
22504
22512
  if (_started) return;
22513
+ if (!isSyncFsAvailable()) {
22514
+ _started = true;
22515
+ return;
22516
+ }
22505
22517
  _started = true;
22506
22518
  _projectRoot = options.projectRoot;
22507
22519
  _sdkVersion = options.sdkVersion;
@@ -22587,7 +22599,7 @@ function registerGlasstrace(options) {
22587
22599
  setCoreState(CoreState.REGISTERING);
22588
22600
  startRuntimeStateWriter({
22589
22601
  projectRoot: process.cwd(),
22590
- sdkVersion: "1.3.1"
22602
+ sdkVersion: "1.3.2"
22591
22603
  });
22592
22604
  const config2 = resolveConfig(options);
22593
22605
  if (config2.verbose) {
@@ -22753,8 +22765,8 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
22753
22765
  if (config2.verbose) {
22754
22766
  console.info("[glasstrace] Background init firing.");
22755
22767
  }
22756
- const healthReport = collectHealthReport("1.3.1");
22757
- const initResult = await performInit(config2, anonKeyForInit, "1.3.1", healthReport);
22768
+ const healthReport = collectHealthReport("1.3.2");
22769
+ const initResult = await performInit(config2, anonKeyForInit, "1.3.2", healthReport);
22758
22770
  if (generation !== registrationGeneration) return;
22759
22771
  const currentState = getCoreState();
22760
22772
  if (currentState === CoreState.SHUTTING_DOWN || currentState === CoreState.SHUTDOWN) {
@@ -22777,7 +22789,7 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
22777
22789
  }
22778
22790
  maybeInstallConsoleCapture();
22779
22791
  if (didLastInitSucceed()) {
22780
- startHeartbeat(config2, anonKeyForInit, "1.3.1", generation, (newApiKey, accountId) => {
22792
+ startHeartbeat(config2, anonKeyForInit, "1.3.2", generation, (newApiKey, accountId) => {
22781
22793
  setAuthState(AuthState.CLAIMING);
22782
22794
  emitLifecycleEvent("auth:claim_started", { accountId });
22783
22795
  setResolvedApiKey(newApiKey);