@glasstrace/sdk 1.1.2 → 1.1.3

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.
@@ -33,16 +33,17 @@ import {
33
33
  performInit,
34
34
  recordSpansDropped,
35
35
  recordSpansExported
36
- } from "./chunk-C567H5EQ.js";
36
+ } from "./chunk-JKI4OCFV.js";
37
37
  import {
38
38
  isAnonymousMode,
39
39
  isProductionDisabled,
40
40
  resolveConfig
41
41
  } from "./chunk-VUZCLMIX.js";
42
42
  import {
43
+ atomicWriteFileSync,
43
44
  getOrCreateAnonKey,
44
45
  readAnonKey
45
- } from "./chunk-3LILTM3T.js";
46
+ } from "./chunk-TWTWRJ25.js";
46
47
  import {
47
48
  GLASSTRACE_ATTRIBUTE_NAMES,
48
49
  deriveSessionId
@@ -4058,7 +4059,7 @@ function registerHeartbeatShutdownHook(config, anonKey, sdkVersion) {
4058
4059
  }
4059
4060
 
4060
4061
  // src/runtime-state.ts
4061
- import { writeFileSync, renameSync, mkdirSync } from "node:fs";
4062
+ import { mkdirSync } from "node:fs";
4062
4063
  import { join } from "node:path";
4063
4064
  var _projectRoot = null;
4064
4065
  var _sdkVersion = "unknown";
@@ -4110,12 +4111,10 @@ function writeStateNow() {
4110
4111
  };
4111
4112
  const dir = join(_projectRoot, ".glasstrace");
4112
4113
  const filePath = join(dir, "runtime-state.json");
4113
- const tmpPath = join(dir, "runtime-state.json.tmp");
4114
4114
  mkdirSync(dir, { recursive: true, mode: 448 });
4115
- writeFileSync(tmpPath, JSON.stringify(runtimeState, null, 2) + "\n", {
4115
+ atomicWriteFileSync(filePath, JSON.stringify(runtimeState, null, 2) + "\n", {
4116
4116
  mode: 384
4117
4117
  });
4118
- renameSync(tmpPath, filePath);
4119
4118
  } catch (err) {
4120
4119
  sdkLog(
4121
4120
  "warn",
@@ -4154,7 +4153,7 @@ function registerGlasstrace(options) {
4154
4153
  setCoreState(CoreState.REGISTERING);
4155
4154
  startRuntimeStateWriter({
4156
4155
  projectRoot: process.cwd(),
4157
- sdkVersion: "1.1.2"
4156
+ sdkVersion: "1.1.3"
4158
4157
  });
4159
4158
  const config = resolveConfig(options);
4160
4159
  if (config.verbose) {
@@ -4320,8 +4319,8 @@ async function backgroundInit(config, anonKeyForInit, generation) {
4320
4319
  if (config.verbose) {
4321
4320
  console.info("[glasstrace] Background init firing.");
4322
4321
  }
4323
- const healthReport = collectHealthReport("1.1.2");
4324
- const initResult = await performInit(config, anonKeyForInit, "1.1.2", healthReport);
4322
+ const healthReport = collectHealthReport("1.1.3");
4323
+ const initResult = await performInit(config, anonKeyForInit, "1.1.3", healthReport);
4325
4324
  if (generation !== registrationGeneration) return;
4326
4325
  const currentState = getCoreState();
4327
4326
  if (currentState === CoreState.SHUTTING_DOWN || currentState === CoreState.SHUTDOWN) {
@@ -4344,7 +4343,7 @@ async function backgroundInit(config, anonKeyForInit, generation) {
4344
4343
  }
4345
4344
  maybeInstallConsoleCapture();
4346
4345
  if (didLastInitSucceed()) {
4347
- startHeartbeat(config, anonKeyForInit, "1.1.2", generation, (newApiKey, accountId) => {
4346
+ startHeartbeat(config, anonKeyForInit, "1.1.3", generation, (newApiKey, accountId) => {
4348
4347
  setAuthState(AuthState.CLAIMING);
4349
4348
  emitLifecycleEvent("auth:claim_started", { accountId });
4350
4349
  setResolvedApiKey(newApiKey);
@@ -4693,4 +4692,4 @@ export {
4693
4692
  withGlasstraceConfig,
4694
4693
  captureError
4695
4694
  };
4696
- //# sourceMappingURL=chunk-Z35HKVSO.js.map
4695
+ //# sourceMappingURL=chunk-FGDS33I2.js.map