@glasstrace/sdk 1.3.5 → 1.3.6
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-EK6MYHR2.js → chunk-IY6A6EXS.js} +25 -18
- package/dist/{chunk-EK6MYHR2.js.map → chunk-IY6A6EXS.js.map} +1 -1
- package/dist/{chunk-P4OYPFQ5.js → chunk-TZMYGEMB.js} +2 -2
- package/dist/chunk-TZMYGEMB.js.map +1 -0
- package/dist/cli/init.cjs +2 -2
- package/dist/cli/init.cjs.map +1 -1
- package/dist/cli/init.js +2 -2
- package/dist/cli/mcp-add.cjs +1 -1
- package/dist/cli/mcp-add.cjs.map +1 -1
- package/dist/cli/mcp-add.js +1 -1
- package/dist/index.cjs +24 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/node-entry.cjs +26 -19
- package/dist/node-entry.cjs.map +1 -1
- package/dist/node-entry.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-P4OYPFQ5.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/node-entry.cjs
CHANGED
|
@@ -22502,19 +22502,19 @@ function stopHeartbeat() {
|
|
|
22502
22502
|
}
|
|
22503
22503
|
}
|
|
22504
22504
|
function checkShutdownMarker(projectRoot) {
|
|
22505
|
-
let
|
|
22506
|
-
let
|
|
22505
|
+
let fsSync3 = null;
|
|
22506
|
+
let pathSync2 = null;
|
|
22507
22507
|
try {
|
|
22508
|
-
|
|
22509
|
-
|
|
22508
|
+
fsSync3 = require("node:fs");
|
|
22509
|
+
pathSync2 = require("node:path");
|
|
22510
22510
|
} catch {
|
|
22511
22511
|
return { triggered: false };
|
|
22512
22512
|
}
|
|
22513
22513
|
const root = projectRoot ?? (typeof process !== "undefined" ? process.cwd() : ".");
|
|
22514
|
-
const markerPath =
|
|
22515
|
-
if (!
|
|
22514
|
+
const markerPath = pathSync2.join(root, SHUTDOWN_MARKER_RELPATH);
|
|
22515
|
+
if (!fsSync3.existsSync(markerPath)) return { triggered: false };
|
|
22516
22516
|
try {
|
|
22517
|
-
|
|
22517
|
+
fsSync3.unlinkSync(markerPath);
|
|
22518
22518
|
} catch {
|
|
22519
22519
|
}
|
|
22520
22520
|
const shutdown = executeShutdown().catch(() => {
|
|
@@ -22594,9 +22594,16 @@ function registerHeartbeatShutdownHook(config2, anonKey, sdkVersion) {
|
|
|
22594
22594
|
}
|
|
22595
22595
|
|
|
22596
22596
|
// src/runtime-state.ts
|
|
22597
|
-
var import_node_fs = require("node:fs");
|
|
22598
|
-
var import_node_path = require("node:path");
|
|
22599
22597
|
init_console_capture();
|
|
22598
|
+
var fsSync = null;
|
|
22599
|
+
var pathSync = null;
|
|
22600
|
+
try {
|
|
22601
|
+
fsSync = require("node:fs");
|
|
22602
|
+
pathSync = require("node:path");
|
|
22603
|
+
} catch {
|
|
22604
|
+
fsSync = null;
|
|
22605
|
+
pathSync = null;
|
|
22606
|
+
}
|
|
22600
22607
|
var _projectRoot = null;
|
|
22601
22608
|
var _sdkVersion = "unknown";
|
|
22602
22609
|
var _lastScenario;
|
|
@@ -22605,7 +22612,7 @@ var _debounceTimer = null;
|
|
|
22605
22612
|
var _started = false;
|
|
22606
22613
|
function startRuntimeStateWriter(options) {
|
|
22607
22614
|
if (_started) return;
|
|
22608
|
-
if (!isSyncFsAvailable()) {
|
|
22615
|
+
if (!isSyncFsAvailable() || fsSync === null || pathSync === null) {
|
|
22609
22616
|
_started = true;
|
|
22610
22617
|
return;
|
|
22611
22618
|
}
|
|
@@ -22657,9 +22664,9 @@ function writeStateNow() {
|
|
|
22657
22664
|
if (_lastError) {
|
|
22658
22665
|
runtimeState.lastError = _lastError;
|
|
22659
22666
|
}
|
|
22660
|
-
const dir =
|
|
22661
|
-
const filePath =
|
|
22662
|
-
|
|
22667
|
+
const dir = pathSync.join(_projectRoot, ".glasstrace");
|
|
22668
|
+
const filePath = pathSync.join(dir, "runtime-state.json");
|
|
22669
|
+
fsSync.mkdirSync(dir, { recursive: true, mode: 448 });
|
|
22663
22670
|
atomicWriteFileSync(filePath, JSON.stringify(runtimeState, null, 2) + "\n", {
|
|
22664
22671
|
mode: 384
|
|
22665
22672
|
});
|
|
@@ -22701,7 +22708,7 @@ function registerGlasstrace(options) {
|
|
|
22701
22708
|
setCoreState(CoreState.REGISTERING);
|
|
22702
22709
|
startRuntimeStateWriter({
|
|
22703
22710
|
projectRoot: process.cwd(),
|
|
22704
|
-
sdkVersion: "1.3.
|
|
22711
|
+
sdkVersion: "1.3.6"
|
|
22705
22712
|
});
|
|
22706
22713
|
const config2 = resolveConfig(options);
|
|
22707
22714
|
if (config2.verbose) {
|
|
@@ -22868,8 +22875,8 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
|
|
|
22868
22875
|
if (config2.verbose) {
|
|
22869
22876
|
console.info("[glasstrace] Background init firing.");
|
|
22870
22877
|
}
|
|
22871
|
-
const healthReport = collectHealthReport("1.3.
|
|
22872
|
-
const initResult = await performInit(config2, anonKeyForInit, "1.3.
|
|
22878
|
+
const healthReport = collectHealthReport("1.3.6");
|
|
22879
|
+
const initResult = await performInit(config2, anonKeyForInit, "1.3.6", healthReport);
|
|
22873
22880
|
if (generation !== registrationGeneration) return;
|
|
22874
22881
|
const currentState = getCoreState();
|
|
22875
22882
|
if (currentState === CoreState.SHUTTING_DOWN || currentState === CoreState.SHUTDOWN) {
|
|
@@ -22892,7 +22899,7 @@ async function backgroundInit(config2, anonKeyForInit, generation) {
|
|
|
22892
22899
|
}
|
|
22893
22900
|
maybeInstallConsoleCapture();
|
|
22894
22901
|
if (didLastInitSucceed()) {
|
|
22895
|
-
startHeartbeat(config2, anonKeyForInit, "1.3.
|
|
22902
|
+
startHeartbeat(config2, anonKeyForInit, "1.3.6", generation, (newApiKey, accountId) => {
|
|
22896
22903
|
setAuthState(AuthState.CLAIMING);
|
|
22897
22904
|
emitLifecycleEvent("auth:claim_started", { accountId });
|
|
22898
22905
|
setResolvedApiKey(newApiKey);
|
|
@@ -23127,7 +23134,7 @@ init_source_map_uploader();
|
|
|
23127
23134
|
|
|
23128
23135
|
// src/import-graph.ts
|
|
23129
23136
|
var fs3 = __toESM(require("node:fs/promises"), 1);
|
|
23130
|
-
var
|
|
23137
|
+
var fsSync2 = __toESM(require("node:fs"), 1);
|
|
23131
23138
|
var path3 = __toESM(require("node:path"), 1);
|
|
23132
23139
|
var crypto3 = __toESM(require("node:crypto"), 1);
|
|
23133
23140
|
init_dist();
|
|
@@ -23161,7 +23168,7 @@ function loadCustomTestPatterns(projectRoot) {
|
|
|
23161
23168
|
const configPath = path3.join(projectRoot, name);
|
|
23162
23169
|
let content;
|
|
23163
23170
|
try {
|
|
23164
|
-
content =
|
|
23171
|
+
content = fsSync2.readFileSync(configPath, "utf-8");
|
|
23165
23172
|
} catch {
|
|
23166
23173
|
continue;
|
|
23167
23174
|
}
|