@glasstrace/sdk 0.13.4 → 0.13.5

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
@@ -3815,24 +3815,10 @@ async function configureOtel(config, sessionManager) {
3815
3815
 
3816
3816
  // src/context-manager.ts
3817
3817
  init_esm_shims();
3818
- var AsyncLocalStorageCtor = null;
3819
- try {
3820
- const importFn = Function("id", "return import(id)");
3821
- importFn("node:async_hooks").then(
3822
- (mod) => {
3823
- AsyncLocalStorageCtor = mod.AsyncLocalStorage;
3824
- },
3825
- () => {
3826
- }
3827
- );
3828
- } catch {
3829
- }
3818
+ import { AsyncLocalStorage } from "async_hooks";
3830
3819
  function installContextManager() {
3831
- if (!AsyncLocalStorageCtor) {
3832
- return false;
3833
- }
3834
3820
  try {
3835
- const als = new AsyncLocalStorageCtor();
3821
+ const als = new AsyncLocalStorage();
3836
3822
  const contextManager = {
3837
3823
  active: () => als.getStore() ?? ROOT_CONTEXT,
3838
3824
  with: (context2, fn, thisArg, ...args) => als.run(context2, () => fn.apply(thisArg, args)),
@@ -4129,8 +4115,8 @@ async function backgroundInit(config, anonKeyForInit, generation) {
4129
4115
  if (config.verbose) {
4130
4116
  console.info("[glasstrace] Background init firing.");
4131
4117
  }
4132
- const healthReport = collectHealthReport("0.13.4");
4133
- const initResult = await performInit(config, anonKeyForInit, "0.13.4", healthReport);
4118
+ const healthReport = collectHealthReport("0.13.5");
4119
+ const initResult = await performInit(config, anonKeyForInit, "0.13.5", healthReport);
4134
4120
  if (generation !== registrationGeneration) return;
4135
4121
  if (initResult?.claimResult) {
4136
4122
  setResolvedApiKey(initResult.claimResult.newApiKey);
@@ -4138,7 +4124,7 @@ async function backgroundInit(config, anonKeyForInit, generation) {
4138
4124
  }
4139
4125
  maybeInstallConsoleCapture();
4140
4126
  if (didLastInitSucceed()) {
4141
- startHeartbeat(config, anonKeyForInit, "0.13.4", generation, (newApiKey) => {
4127
+ startHeartbeat(config, anonKeyForInit, "0.13.5", generation, (newApiKey) => {
4142
4128
  setResolvedApiKey(newApiKey);
4143
4129
  notifyApiKeyResolved();
4144
4130
  });