@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.
- package/dist/{chunk-Z35HKVSO.js → chunk-FGDS33I2.js} +10 -11
- package/dist/{chunk-Z35HKVSO.js.map → chunk-FGDS33I2.js.map} +1 -1
- package/dist/{chunk-C567H5EQ.js → chunk-JKI4OCFV.js} +4 -14
- package/dist/chunk-JKI4OCFV.js.map +1 -0
- package/dist/{chunk-UJ2JC7PZ.js → chunk-TWHCJKRS.js} +17 -16
- package/dist/chunk-TWHCJKRS.js.map +1 -0
- package/dist/{chunk-3LILTM3T.js → chunk-TWTWRJ25.js} +233 -9
- package/dist/chunk-TWTWRJ25.js.map +1 -0
- package/dist/cli/init.cjs +156 -17
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.js +4 -4
- package/dist/cli/mcp-add.cjs.map +1 -1
- package/dist/cli/mcp-add.js +1 -1
- package/dist/cli/uninit.cjs +113 -11
- package/dist/cli/uninit.cjs.map +1 -1
- package/dist/cli/uninit.js +2 -2
- package/dist/cli/validate.cjs.map +1 -1
- package/dist/cli/validate.js +1 -1
- package/dist/index.cjs +209 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -9
- package/dist/index.d.ts +12 -9
- package/dist/index.js +3 -3
- package/dist/node-entry.cjs +209 -27
- package/dist/node-entry.cjs.map +1 -1
- package/dist/node-entry.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-3LILTM3T.js.map +0 -1
- package/dist/chunk-C567H5EQ.js.map +0 -1
- package/dist/chunk-UJ2JC7PZ.js.map +0 -1
|
@@ -33,16 +33,17 @@ import {
|
|
|
33
33
|
performInit,
|
|
34
34
|
recordSpansDropped,
|
|
35
35
|
recordSpansExported
|
|
36
|
-
} from "./chunk-
|
|
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-
|
|
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 {
|
|
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
|
-
|
|
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.
|
|
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.
|
|
4324
|
-
const initResult = await performInit(config, anonKeyForInit, "1.1.
|
|
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.
|
|
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-
|
|
4695
|
+
//# sourceMappingURL=chunk-FGDS33I2.js.map
|