@brizz/sdk 0.1.48 → 0.1.50

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.
Files changed (25) hide show
  1. package/README.md +9 -0
  2. package/dist/{chunk-3OMB2F7B.js → chunk-7PRTTYWM.js} +1 -1
  3. package/dist/{chunk-FVVRWMPV.js → chunk-GUKWVI53.js} +7 -1
  4. package/dist/{chunk-ELLCNMLI.cjs → chunk-O2IBZJOJ.cjs} +4 -4
  5. package/dist/{chunk-GMZQ6N77.cjs → chunk-RV7JIIDG.cjs} +7 -1
  6. package/dist/{chunk-L4P4RJT5.js → chunk-STM7QUQP.js} +2 -2
  7. package/dist/{chunk-JDJLJ2V2.cjs → chunk-VH5N6E54.cjs} +8 -8
  8. package/dist/index.cjs +226 -156
  9. package/dist/index.js +80 -10
  10. package/dist/interrupt-BYLSBXTV.cjs +12 -0
  11. package/dist/{interrupt-YO3ID433.js → interrupt-UKJK5WOA.js} +2 -2
  12. package/dist/{mcp-3E34LCRM.cjs → mcp-3URJU7OY.cjs} +12 -12
  13. package/dist/{mcp-RLTZLXHY.js → mcp-AOBKXJND.js} +2 -2
  14. package/dist/types/cjs/internal/instrumentation/langgraph/attributes.d.ts +1 -0
  15. package/dist/types/cjs/internal/instrumentation/langgraph/index.d.ts +1 -1
  16. package/dist/types/cjs/internal/instrumentation/langgraph/instrumentation.d.ts +1 -0
  17. package/dist/types/cjs/internal/semantic-conventions.d.ts +3 -0
  18. package/dist/types/cjs/internal/trace/session.d.ts +1 -0
  19. package/dist/types/esm/internal/instrumentation/langgraph/attributes.d.ts +1 -0
  20. package/dist/types/esm/internal/instrumentation/langgraph/index.d.ts +1 -1
  21. package/dist/types/esm/internal/instrumentation/langgraph/instrumentation.d.ts +1 -0
  22. package/dist/types/esm/internal/semantic-conventions.d.ts +3 -0
  23. package/dist/types/esm/internal/trace/session.d.ts +1 -0
  24. package/package.json +3 -2
  25. package/dist/interrupt-YQHEXVES.cjs +0 -12
package/dist/index.cjs CHANGED
@@ -5,7 +5,7 @@ var _chunkUNLNNKZ7cjs = require('./chunk-UNLNNKZ7.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunkJDJLJ2V2cjs = require('./chunk-JDJLJ2V2.cjs');
8
+ var _chunkVH5N6E54cjs = require('./chunk-VH5N6E54.cjs');
9
9
 
10
10
 
11
11
 
@@ -16,7 +16,7 @@ var _chunkJDJLJ2V2cjs = require('./chunk-JDJLJ2V2.cjs');
16
16
  var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
17
17
 
18
18
 
19
- var _chunkELLCNMLIcjs = require('./chunk-ELLCNMLI.cjs');
19
+ var _chunkO2IBZJOJcjs = require('./chunk-O2IBZJOJ.cjs');
20
20
 
21
21
 
22
22
 
@@ -74,7 +74,10 @@ var _chunkELLCNMLIcjs = require('./chunk-ELLCNMLI.cjs');
74
74
 
75
75
 
76
76
 
77
- var _chunkGMZQ6N77cjs = require('./chunk-GMZQ6N77.cjs');
77
+
78
+
79
+
80
+ var _chunkRV7JIIDGcjs = require('./chunk-RV7JIIDG.cjs');
78
81
 
79
82
 
80
83
  var _chunkOBGZSXTJcjs = require('./chunk-OBGZSXTJ.cjs');
@@ -92,6 +95,7 @@ var _instrumentationqdrant = require('@traceloop/instrumentation-qdrant');
92
95
  var _instrumentationtogether = require('@traceloop/instrumentation-together');
93
96
 
94
97
  // src/internal/instrumentation/langgraph/instrumentation.ts
98
+ var _module = require('module');
95
99
  var _api = require('@opentelemetry/api');
96
100
 
97
101
 
@@ -100,9 +104,16 @@ var _api = require('@opentelemetry/api');
100
104
 
101
105
  // src/internal/instrumentation/langgraph/attributes.ts
102
106
  var INSTRUMENTATION_NAME = "@brizz/sdk/langgraph";
103
- var INSTRUMENTATION_VERSION = _chunkJDJLJ2V2cjs.getSDKVersion.call(void 0, );
107
+ var INSTRUMENTATION_VERSION = _chunkVH5N6E54cjs.getSDKVersion.call(void 0, );
104
108
  var MODULE_NAME = "@langchain/langgraph";
105
109
  var SUPPORTED_VERSIONS = [">=0.2.0 <2"];
110
+ function isSupportedVersion(version) {
111
+ const [major, minor] = version.split(".").map(Number);
112
+ if (major === void 0 || minor === void 0 || Number.isNaN(major) || Number.isNaN(minor)) {
113
+ return false;
114
+ }
115
+ return major === 1 || major === 0 && minor >= 2;
116
+ }
106
117
  var CHECKPOINT_SPAN_NAME = "brizz.langgraph.checkpoint";
107
118
  var ATTR_CHECKPOINT_PARENT_ID = "brizz.checkpoint_parent_id";
108
119
  var ATTR_CHECKPOINT_ID = "brizz.checkpoint_id";
@@ -181,7 +192,8 @@ var LangGraphInstrumentation = class extends _instrumentation.InstrumentationBas
181
192
  * Patch a LangGraph module the caller already imported.
182
193
  *
183
194
  * The module-load hook above only fires for CommonJS requires, so an ESM or
184
- * bundled consumer reaches the instrumentation through here — via
195
+ * bundled consumer reaches the instrumentation through here — from
196
+ * `patchInstalledLangGraph`, or from
185
197
  * `Brizz.initialize({ instrumentModules: { langgraph } })`. Accepts either
186
198
  * the package root or its `pregel` subpath.
187
199
  */
@@ -199,6 +211,43 @@ var LangGraphInstrumentation = class extends _instrumentation.InstrumentationBas
199
211
  }
200
212
  }
201
213
  };
214
+ function patchInstalledLangGraph() {
215
+ let requireFromSdk;
216
+ let version;
217
+ try {
218
+ requireFromSdk = _module.createRequire.call(void 0, __filename);
219
+ version = requireFromSdk(`${MODULE_NAME}/package.json`).version;
220
+ } catch (error) {
221
+ _chunkWC573FCIcjs.logger.debug(`LangGraph not resolved, not patched: ${String(error)}`);
222
+ return;
223
+ }
224
+ if (!isSupportedVersion(version)) {
225
+ _chunkWC573FCIcjs.logger.debug(`LangGraph ${version} is outside ${SUPPORTED_VERSIONS.join(" ")}, not patched`);
226
+ return;
227
+ }
228
+ let instrumentation;
229
+ try {
230
+ instrumentation = new LangGraphInstrumentation({ enabled: false });
231
+ } catch (error) {
232
+ _chunkWC573FCIcjs.logger.debug(`LangGraph instrumentation not constructed: ${String(error)}`);
233
+ return;
234
+ }
235
+ try {
236
+ const loaded = requireFromSdk.cache[requireFromSdk.resolve(MODULE_NAME)];
237
+ if (loaded) {
238
+ instrumentation.manuallyInstrument(loaded.exports);
239
+ }
240
+ } catch (error) {
241
+ _chunkWC573FCIcjs.logger.debug(`LangGraph CJS build not patched: ${String(error)}`);
242
+ }
243
+ void (async () => {
244
+ try {
245
+ instrumentation.manuallyInstrument(await Promise.resolve().then(() => _interopRequireWildcard(require("@langchain/langgraph"))));
246
+ } catch (error) {
247
+ _chunkWC573FCIcjs.logger.debug(`LangGraph not patched: ${String(error)}`);
248
+ }
249
+ })();
250
+ }
202
251
  function patchPregelStream(proto, getTracer) {
203
252
  const target = proto;
204
253
  if (target[PATCHED_FLAG]) {
@@ -419,7 +468,7 @@ function loadGenAIInstrumentations() {
419
468
  function loadMCPInstrumentation() {
420
469
  void (async () => {
421
470
  try {
422
- const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-3E34LCRM.cjs")));
471
+ const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-3URJU7OY.cjs")));
423
472
  const mcp = new MCPInstrumentation({ exceptionLogger });
424
473
  _instrumentation.registerInstrumentations.call(void 0, { instrumentations: [mcp] });
425
474
  _chunkWC573FCIcjs.logger.debug("Auto-loaded MCP instrumentation");
@@ -483,7 +532,7 @@ function loadVercelAITelemetry() {
483
532
  }
484
533
  const isV7 = typeof ai.registerTelemetry === "function";
485
534
  const integrations = [];
486
- const { createInterruptIntegration } = await Promise.resolve().then(() => _interopRequireWildcard(require("./interrupt-YQHEXVES.cjs")));
535
+ const { createInterruptIntegration } = await Promise.resolve().then(() => _interopRequireWildcard(require("./interrupt-BYLSBXTV.cjs")));
487
536
  integrations.push(createInterruptIntegration());
488
537
  let otelCollectorLoaded = false;
489
538
  try {
@@ -694,25 +743,25 @@ var SDK_LANGUAGE = "typescript";
694
743
 
695
744
 
696
745
  // src/internal/instrumentation/langchain.ts
697
- var _module = require('module');
746
+
698
747
 
699
748
  var SCOPE_NAME = "@arizeai/openinference-instrumentation-langchain";
700
749
  var PATCHED_MARKER = /* @__PURE__ */ Symbol.for("brizz.langchain.callbackManagerPatched");
701
750
  var OMITTED_KEYS = /* @__PURE__ */ new Set([
702
- _chunkGMZQ6N77cjs.USER_EMAIL,
703
- _chunkGMZQ6N77cjs.USER_NAME,
704
- _chunkGMZQ6N77cjs.ORGANIZATION_NAME,
705
- _chunkGMZQ6N77cjs.ORGANIZATION_DOMAIN
751
+ _chunkRV7JIIDGcjs.USER_EMAIL,
752
+ _chunkRV7JIIDGcjs.USER_NAME,
753
+ _chunkRV7JIIDGcjs.ORGANIZATION_NAME,
754
+ _chunkRV7JIIDGcjs.ORGANIZATION_DOMAIN
706
755
  ]);
707
756
  function runMetadataFromContext() {
708
- const bag = _api.context.active().getValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY);
757
+ const bag = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
709
758
  if (!bag) {
710
759
  return void 0;
711
760
  }
712
761
  const metadata = {};
713
762
  for (const [name, value] of Object.entries(bag)) {
714
763
  if (!OMITTED_KEYS.has(name)) {
715
- metadata[`${_chunkGMZQ6N77cjs.BRIZZ}.${name}`] = String(value);
764
+ metadata[`${_chunkRV7JIIDGcjs.BRIZZ}.${name}`] = String(value);
716
765
  }
717
766
  }
718
767
  return Object.keys(metadata).length > 0 ? metadata : void 0;
@@ -769,7 +818,7 @@ function restampLangChainSpan(span) {
769
818
  }
770
819
  const attrs = span.attributes;
771
820
  const metadata = attrs["metadata"];
772
- if (typeof metadata !== "string" || !metadata.includes(`"${_chunkGMZQ6N77cjs.BRIZZ}.`)) {
821
+ if (typeof metadata !== "string" || !metadata.includes(`"${_chunkRV7JIIDGcjs.BRIZZ}.`)) {
773
822
  return;
774
823
  }
775
824
  const parsed = JSON.parse(metadata);
@@ -777,7 +826,7 @@ function restampLangChainSpan(span) {
777
826
  return;
778
827
  }
779
828
  for (const [key, value] of Object.entries(parsed)) {
780
- if (key.startsWith(`${_chunkGMZQ6N77cjs.BRIZZ}.`) && value !== null && value !== void 0) {
829
+ if (key.startsWith(`${_chunkRV7JIIDGcjs.BRIZZ}.`) && value !== null && value !== void 0) {
781
830
  attrs[key] = String(value);
782
831
  }
783
832
  }
@@ -915,7 +964,7 @@ var InstrumentationRegistry = (_class = class _InstrumentationRegistry {construc
915
964
  const mcpModules = this.manualModules.mcp;
916
965
  void (async () => {
917
966
  try {
918
- const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-3E34LCRM.cjs")));
967
+ const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-3URJU7OY.cjs")));
919
968
  const instrumentation = new MCPInstrumentation({ exceptionLogger: exceptionLogger2 });
920
969
  instrumentation.manuallyInstrument(mcpModules);
921
970
  _chunkWC573FCIcjs.logger.debug("Manual instrumentation enabled for MCP");
@@ -966,16 +1015,16 @@ function setCurrentSpanCustomProperties(properties) {
966
1015
  }
967
1016
  for (const [key, value] of Object.entries(properties)) {
968
1017
  try {
969
- current.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${key}`, value);
1018
+ current.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${key}`, value);
970
1019
  } catch (e3) {
971
1020
  }
972
1021
  }
973
1022
  }
974
1023
  function callWithProperties(properties, fn, thisArg, ...args) {
975
1024
  const base = _api.context.active();
976
- const prev = base.getValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY);
1025
+ const prev = base.getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
977
1026
  const merged = prev ? { ...prev, ...properties } : properties;
978
- const next = base.setValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY, merged);
1027
+ const next = base.setValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY, merged);
979
1028
  return _api.context.with(next, fn, thisArg, ...args);
980
1029
  }
981
1030
  function withProperties(properties, fn, thisArg) {
@@ -996,25 +1045,25 @@ function propagatePropertiesImperatively(properties, base = _api.context.active(
996
1045
  if (!store || typeof store.enterWith !== "function") {
997
1046
  return;
998
1047
  }
999
- const prev = base.getValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY);
1048
+ const prev = base.getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1000
1049
  const merged = prev ? { ...prev, ...properties } : properties;
1001
- store.enterWith(base.setValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY, merged));
1050
+ store.enterWith(base.setValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY, merged));
1002
1051
  } catch (e4) {
1003
1052
  }
1004
1053
  }
1005
1054
  function setUser(user) {
1006
- const properties = { [_chunkGMZQ6N77cjs.USER_ID]: user.id };
1055
+ const properties = { [_chunkRV7JIIDGcjs.USER_ID]: user.id };
1007
1056
  if (user.email !== void 0) {
1008
- properties[_chunkGMZQ6N77cjs.USER_EMAIL] = user.email;
1057
+ properties[_chunkRV7JIIDGcjs.USER_EMAIL] = user.email;
1009
1058
  }
1010
1059
  if (user.name !== void 0) {
1011
- properties[_chunkGMZQ6N77cjs.USER_NAME] = user.name;
1060
+ properties[_chunkRV7JIIDGcjs.USER_NAME] = user.name;
1012
1061
  }
1013
1062
  if (user.role !== void 0) {
1014
- properties[_chunkGMZQ6N77cjs.USER_ROLE] = user.role;
1063
+ properties[_chunkRV7JIIDGcjs.USER_ROLE] = user.role;
1015
1064
  }
1016
1065
  if (user.plan !== void 0) {
1017
- properties[_chunkGMZQ6N77cjs.USER_PLAN] = user.plan;
1066
+ properties[_chunkRV7JIIDGcjs.USER_PLAN] = user.plan;
1018
1067
  }
1019
1068
  if (user.traits) {
1020
1069
  for (const [key, value] of Object.entries(user.traits)) {
@@ -1028,15 +1077,15 @@ function setUser(user) {
1028
1077
  propagatePropertiesImperatively(properties);
1029
1078
  }
1030
1079
  function setOrganization(org) {
1031
- const properties = { [_chunkGMZQ6N77cjs.ORGANIZATION_ID]: org.id };
1080
+ const properties = { [_chunkRV7JIIDGcjs.ORGANIZATION_ID]: org.id };
1032
1081
  if (org.name !== void 0) {
1033
- properties[_chunkGMZQ6N77cjs.ORGANIZATION_NAME] = org.name;
1082
+ properties[_chunkRV7JIIDGcjs.ORGANIZATION_NAME] = org.name;
1034
1083
  }
1035
1084
  if (org.plan !== void 0) {
1036
- properties[_chunkGMZQ6N77cjs.ORGANIZATION_PLAN] = org.plan;
1085
+ properties[_chunkRV7JIIDGcjs.ORGANIZATION_PLAN] = org.plan;
1037
1086
  }
1038
1087
  if (org.domain !== void 0) {
1039
- properties[_chunkGMZQ6N77cjs.ORGANIZATION_DOMAIN] = org.domain;
1088
+ properties[_chunkRV7JIIDGcjs.ORGANIZATION_DOMAIN] = org.domain;
1040
1089
  }
1041
1090
  if (org.traits) {
1042
1091
  for (const [key, value] of Object.entries(org.traits)) {
@@ -1050,12 +1099,12 @@ function setOrganization(org) {
1050
1099
  propagatePropertiesImperatively(properties);
1051
1100
  }
1052
1101
  function setMessageId(id) {
1053
- const properties = { [_chunkGMZQ6N77cjs.MESSAGE_ID]: id };
1102
+ const properties = { [_chunkRV7JIIDGcjs.MESSAGE_ID]: id };
1054
1103
  setCurrentSpanCustomProperties(properties);
1055
1104
  propagatePropertiesImperatively(properties);
1056
1105
  }
1057
1106
  function setSessionId(id) {
1058
- const properties = { [_chunkGMZQ6N77cjs.SESSION_ID]: id };
1107
+ const properties = { [_chunkRV7JIIDGcjs.SESSION_ID]: id };
1059
1108
  setCurrentSpanCustomProperties(properties);
1060
1109
  propagatePropertiesImperatively(properties);
1061
1110
  }
@@ -1079,7 +1128,7 @@ function serviceNameProperties(name) {
1079
1128
  _chunkWC573FCIcjs.logger.warn(`Service name ${problem}; keeping the configured appName.`);
1080
1129
  return {};
1081
1130
  }
1082
- return { [_chunkGMZQ6N77cjs.SERVICE_NAME]: name };
1131
+ return { [_chunkRV7JIIDGcjs.SERVICE_NAME]: name };
1083
1132
  }
1084
1133
  function setServiceName(name) {
1085
1134
  const properties = serviceNameProperties(name);
@@ -1093,22 +1142,22 @@ function withServiceName(name, fn, thisArg) {
1093
1142
  return withProperties(serviceNameProperties(name), fn, thisArg);
1094
1143
  }
1095
1144
  function resolveServiceNameFromContext() {
1096
- const props = _api.context.active().getValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY);
1097
- return _optionalChain([props, 'optionalAccess', _56 => _56[_chunkGMZQ6N77cjs.SERVICE_NAME]]);
1145
+ const props = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1146
+ return _optionalChain([props, 'optionalAccess', _56 => _56[_chunkRV7JIIDGcjs.SERVICE_NAME]]);
1098
1147
  }
1099
1148
  function userProperties(user) {
1100
- const properties = { [_chunkGMZQ6N77cjs.USER_ID]: user.id };
1149
+ const properties = { [_chunkRV7JIIDGcjs.USER_ID]: user.id };
1101
1150
  if (user.email !== void 0) {
1102
- properties[_chunkGMZQ6N77cjs.USER_EMAIL] = user.email;
1151
+ properties[_chunkRV7JIIDGcjs.USER_EMAIL] = user.email;
1103
1152
  }
1104
1153
  if (user.name !== void 0) {
1105
- properties[_chunkGMZQ6N77cjs.USER_NAME] = user.name;
1154
+ properties[_chunkRV7JIIDGcjs.USER_NAME] = user.name;
1106
1155
  }
1107
1156
  if (user.role !== void 0) {
1108
- properties[_chunkGMZQ6N77cjs.USER_ROLE] = user.role;
1157
+ properties[_chunkRV7JIIDGcjs.USER_ROLE] = user.role;
1109
1158
  }
1110
1159
  if (user.plan !== void 0) {
1111
- properties[_chunkGMZQ6N77cjs.USER_PLAN] = user.plan;
1160
+ properties[_chunkRV7JIIDGcjs.USER_PLAN] = user.plan;
1112
1161
  }
1113
1162
  if (user.traits) {
1114
1163
  for (const [key, value] of Object.entries(user.traits)) {
@@ -1121,15 +1170,15 @@ function userProperties(user) {
1121
1170
  return properties;
1122
1171
  }
1123
1172
  function organizationProperties(org) {
1124
- const properties = { [_chunkGMZQ6N77cjs.ORGANIZATION_ID]: org.id };
1173
+ const properties = { [_chunkRV7JIIDGcjs.ORGANIZATION_ID]: org.id };
1125
1174
  if (org.name !== void 0) {
1126
- properties[_chunkGMZQ6N77cjs.ORGANIZATION_NAME] = org.name;
1175
+ properties[_chunkRV7JIIDGcjs.ORGANIZATION_NAME] = org.name;
1127
1176
  }
1128
1177
  if (org.plan !== void 0) {
1129
- properties[_chunkGMZQ6N77cjs.ORGANIZATION_PLAN] = org.plan;
1178
+ properties[_chunkRV7JIIDGcjs.ORGANIZATION_PLAN] = org.plan;
1130
1179
  }
1131
1180
  if (org.domain !== void 0) {
1132
- properties[_chunkGMZQ6N77cjs.ORGANIZATION_DOMAIN] = org.domain;
1181
+ properties[_chunkRV7JIIDGcjs.ORGANIZATION_DOMAIN] = org.domain;
1133
1182
  }
1134
1183
  if (org.traits) {
1135
1184
  for (const [key, value] of Object.entries(org.traits)) {
@@ -1154,32 +1203,32 @@ function withOrganization(org, fn, thisArg) {
1154
1203
  return withProperties(organizationProperties(org), fn, thisArg);
1155
1204
  }
1156
1205
  function callWithMessageId(id, fn, thisArg, ...args) {
1157
- return callWithProperties({ [_chunkGMZQ6N77cjs.MESSAGE_ID]: id }, fn, thisArg, ...args);
1206
+ return callWithProperties({ [_chunkRV7JIIDGcjs.MESSAGE_ID]: id }, fn, thisArg, ...args);
1158
1207
  }
1159
1208
  function withMessageId(id, fn, thisArg) {
1160
- return withProperties({ [_chunkGMZQ6N77cjs.MESSAGE_ID]: id }, fn, thisArg);
1209
+ return withProperties({ [_chunkRV7JIIDGcjs.MESSAGE_ID]: id }, fn, thisArg);
1161
1210
  }
1162
1211
  function inheritedMuteTools() {
1163
- const properties = _api.context.active().getValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY);
1164
- return _optionalChain([properties, 'optionalAccess', _57 => _57[_chunkGMZQ6N77cjs.MUTE_TOOLS]]);
1212
+ const properties = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1213
+ return _optionalChain([properties, 'optionalAccess', _57 => _57[_chunkRV7JIIDGcjs.MUTE_TOOLS]]);
1165
1214
  }
1166
1215
  function muteProperties(options) {
1167
1216
  const { input = true, output = true, tools = output } = options;
1168
1217
  const properties = {};
1169
1218
  if (input) {
1170
- properties[_chunkGMZQ6N77cjs.MUTE_INPUT] = "true";
1219
+ properties[_chunkRV7JIIDGcjs.MUTE_INPUT] = "true";
1171
1220
  }
1172
1221
  if (output) {
1173
- properties[_chunkGMZQ6N77cjs.MUTE_OUTPUT] = "true";
1222
+ properties[_chunkRV7JIIDGcjs.MUTE_OUTPUT] = "true";
1174
1223
  }
1175
1224
  if (tools !== output) {
1176
- properties[_chunkGMZQ6N77cjs.MUTE_TOOLS] = String(tools);
1225
+ properties[_chunkRV7JIIDGcjs.MUTE_TOOLS] = String(tools);
1177
1226
  } else {
1178
1227
  const inherited = inheritedMuteTools();
1179
1228
  if (tools && inherited === "false") {
1180
- properties[_chunkGMZQ6N77cjs.MUTE_TOOLS] = "true";
1229
+ properties[_chunkRV7JIIDGcjs.MUTE_TOOLS] = "true";
1181
1230
  } else if (options.tools === false && inherited === "true") {
1182
- properties[_chunkGMZQ6N77cjs.MUTE_TOOLS] = "false";
1231
+ properties[_chunkRV7JIIDGcjs.MUTE_TOOLS] = "false";
1183
1232
  }
1184
1233
  }
1185
1234
  return properties;
@@ -1191,11 +1240,11 @@ function withMute(options, fn, thisArg) {
1191
1240
  return withProperties(muteProperties(options), fn, thisArg);
1192
1241
  }
1193
1242
  function withSessionId(sessionId, fn, thisArg, extraProperties) {
1194
- const properties = { [_chunkGMZQ6N77cjs.SESSION_ID]: sessionId, ...extraProperties };
1243
+ const properties = { [_chunkRV7JIIDGcjs.SESSION_ID]: sessionId, ...extraProperties };
1195
1244
  return withProperties(properties, fn, thisArg);
1196
1245
  }
1197
1246
  function callWithSessionId(sessionId, fn, thisArg, ...args) {
1198
- return callWithProperties({ [_chunkGMZQ6N77cjs.SESSION_ID]: sessionId }, fn, thisArg, ...args);
1247
+ return callWithProperties({ [_chunkRV7JIIDGcjs.SESSION_ID]: sessionId }, fn, thisArg, ...args);
1199
1248
  }
1200
1249
  var Session = (_class2 = class {
1201
1250
 
@@ -1223,8 +1272,8 @@ var Session = (_class2 = class {
1223
1272
  setInput(text, context7) {
1224
1273
  this.inputs.push(text);
1225
1274
  this.inputContexts.push(_nullishCoalesce(context7, () => ( {})));
1226
- this.span.setAttribute(_chunkGMZQ6N77cjs.SESSION_INPUT, JSON.stringify(this.inputs));
1227
- this.span.setAttribute(_chunkGMZQ6N77cjs.SESSION_INPUT_CONTEXT, JSON.stringify(this.inputContexts));
1275
+ this.span.setAttribute(_chunkRV7JIIDGcjs.SESSION_INPUT, JSON.stringify(this.inputs));
1276
+ this.span.setAttribute(_chunkRV7JIIDGcjs.SESSION_INPUT_CONTEXT, JSON.stringify(this.inputContexts));
1228
1277
  }
1229
1278
  /**
1230
1279
  * Append an assistant turn to session output tracking.
@@ -1239,8 +1288,8 @@ var Session = (_class2 = class {
1239
1288
  setOutput(text, context7) {
1240
1289
  this.outputs.push(text);
1241
1290
  this.outputContexts.push(_nullishCoalesce(context7, () => ( {})));
1242
- this.span.setAttribute(_chunkGMZQ6N77cjs.SESSION_OUTPUT, JSON.stringify(this.outputs));
1243
- this.span.setAttribute(_chunkGMZQ6N77cjs.SESSION_OUTPUT_CONTEXT, JSON.stringify(this.outputContexts));
1291
+ this.span.setAttribute(_chunkRV7JIIDGcjs.SESSION_OUTPUT, JSON.stringify(this.outputs));
1292
+ this.span.setAttribute(_chunkRV7JIIDGcjs.SESSION_OUTPUT_CONTEXT, JSON.stringify(this.outputContexts));
1244
1293
  }
1245
1294
  /**
1246
1295
  * Set the session title on the span.
@@ -1248,7 +1297,7 @@ var Session = (_class2 = class {
1248
1297
  * @param title - The generated title string
1249
1298
  */
1250
1299
  setTitle(title) {
1251
- this.span.setAttribute(_chunkGMZQ6N77cjs.SESSION_TITLE, title);
1300
+ this.span.setAttribute(_chunkRV7JIIDGcjs.SESSION_TITLE, title);
1252
1301
  }
1253
1302
  /**
1254
1303
  * Update custom properties on the session span.
@@ -1258,7 +1307,7 @@ var Session = (_class2 = class {
1258
1307
  */
1259
1308
  updateProperties(properties) {
1260
1309
  for (const [key, value] of Object.entries(properties)) {
1261
- this.span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${key}`, value);
1310
+ this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${key}`, value);
1262
1311
  }
1263
1312
  }
1264
1313
  /**
@@ -1270,21 +1319,21 @@ var Session = (_class2 = class {
1270
1319
  setUser(user) {
1271
1320
  if (user.traits) {
1272
1321
  for (const [key, value] of Object.entries(user.traits)) {
1273
- this.span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.user.${key}`, value);
1322
+ this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.user.${key}`, value);
1274
1323
  }
1275
1324
  }
1276
- this.span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${_chunkGMZQ6N77cjs.USER_ID}`, user.id);
1325
+ this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.USER_ID}`, user.id);
1277
1326
  if (user.email !== void 0) {
1278
- this.span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${_chunkGMZQ6N77cjs.USER_EMAIL}`, user.email);
1327
+ this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.USER_EMAIL}`, user.email);
1279
1328
  }
1280
1329
  if (user.name !== void 0) {
1281
- this.span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${_chunkGMZQ6N77cjs.USER_NAME}`, user.name);
1330
+ this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.USER_NAME}`, user.name);
1282
1331
  }
1283
1332
  if (user.role !== void 0) {
1284
- this.span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${_chunkGMZQ6N77cjs.USER_ROLE}`, user.role);
1333
+ this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.USER_ROLE}`, user.role);
1285
1334
  }
1286
1335
  if (user.plan !== void 0) {
1287
- this.span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${_chunkGMZQ6N77cjs.USER_PLAN}`, user.plan);
1336
+ this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.USER_PLAN}`, user.plan);
1288
1337
  }
1289
1338
  }
1290
1339
  /**
@@ -1296,18 +1345,18 @@ var Session = (_class2 = class {
1296
1345
  setOrganization(org) {
1297
1346
  if (org.traits) {
1298
1347
  for (const [key, value] of Object.entries(org.traits)) {
1299
- this.span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.organization.${key}`, value);
1348
+ this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.organization.${key}`, value);
1300
1349
  }
1301
1350
  }
1302
- this.span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${_chunkGMZQ6N77cjs.ORGANIZATION_ID}`, org.id);
1351
+ this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.ORGANIZATION_ID}`, org.id);
1303
1352
  if (org.name !== void 0) {
1304
- this.span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${_chunkGMZQ6N77cjs.ORGANIZATION_NAME}`, org.name);
1353
+ this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.ORGANIZATION_NAME}`, org.name);
1305
1354
  }
1306
1355
  if (org.plan !== void 0) {
1307
- this.span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${_chunkGMZQ6N77cjs.ORGANIZATION_PLAN}`, org.plan);
1356
+ this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.ORGANIZATION_PLAN}`, org.plan);
1308
1357
  }
1309
1358
  if (org.domain !== void 0) {
1310
- this.span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${_chunkGMZQ6N77cjs.ORGANIZATION_DOMAIN}`, org.domain);
1359
+ this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.ORGANIZATION_DOMAIN}`, org.domain);
1311
1360
  }
1312
1361
  }
1313
1362
  /**
@@ -1337,30 +1386,30 @@ var SessionTitle = class {
1337
1386
  * @param title - The generated title string
1338
1387
  */
1339
1388
  setTitle(title) {
1340
- this.span.setAttribute(_chunkGMZQ6N77cjs.SESSION_TITLE, title);
1389
+ this.span.setAttribute(_chunkRV7JIIDGcjs.SESSION_TITLE, title);
1341
1390
  }
1342
1391
  };
1343
1392
  function getActiveSession() {
1344
- return _api.context.active().getValue(_chunkGMZQ6N77cjs.SESSION_OBJECT_CONTEXT_KEY);
1393
+ return _api.context.active().getValue(_chunkRV7JIIDGcjs.SESSION_OBJECT_CONTEXT_KEY);
1345
1394
  }
1346
1395
  function resolveSessionIdFromContext() {
1347
1396
  const active = getActiveSession();
1348
1397
  if (active) {
1349
1398
  return active.sessionId;
1350
1399
  }
1351
- const props = _api.context.active().getValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY);
1352
- return _optionalChain([props, 'optionalAccess', _60 => _60[_chunkGMZQ6N77cjs.SESSION_ID]]);
1400
+ const props = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1401
+ return _optionalChain([props, 'optionalAccess', _60 => _60[_chunkRV7JIIDGcjs.SESSION_ID]]);
1353
1402
  }
1354
1403
  function resolveMessageIdFromContext() {
1355
- const props = _api.context.active().getValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY);
1356
- return _optionalChain([props, 'optionalAccess', _61 => _61[_chunkGMZQ6N77cjs.MESSAGE_ID]]);
1404
+ const props = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1405
+ return _optionalChain([props, 'optionalAccess', _61 => _61[_chunkRV7JIIDGcjs.MESSAGE_ID]]);
1357
1406
  }
1358
1407
  function emitExternalLink(sessionId, url, title, linkType) {
1359
1408
  try {
1360
- emitEventWithSessionId(sessionId, _chunkGMZQ6N77cjs.EXTERNAL_LINK_EVENT_NAME, {
1361
- [_chunkGMZQ6N77cjs.EXTERNAL_LINK_URL]: url,
1362
- [_chunkGMZQ6N77cjs.EXTERNAL_LINK_TITLE]: _nullishCoalesce(title, () => ( "")),
1363
- [_chunkGMZQ6N77cjs.EXTERNAL_LINK_TYPE]: _nullishCoalesce(linkType, () => ( "generic"))
1409
+ emitEventWithSessionId(sessionId, _chunkRV7JIIDGcjs.EXTERNAL_LINK_EVENT_NAME, {
1410
+ [_chunkRV7JIIDGcjs.EXTERNAL_LINK_URL]: url,
1411
+ [_chunkRV7JIIDGcjs.EXTERNAL_LINK_TITLE]: _nullishCoalesce(title, () => ( "")),
1412
+ [_chunkRV7JIIDGcjs.EXTERNAL_LINK_TYPE]: _nullishCoalesce(linkType, () => ( "generic"))
1364
1413
  });
1365
1414
  } catch (error) {
1366
1415
  _chunkWC573FCIcjs.logger.warn("addExternalLink: failed to emit external link", error);
@@ -1377,22 +1426,22 @@ function addExternalLink(url, options) {
1377
1426
  emitExternalLink(sessionId, url, _optionalChain([options, 'optionalAccess', _63 => _63.title]), _optionalChain([options, 'optionalAccess', _64 => _64.linkType]));
1378
1427
  }
1379
1428
  function recordFeedback(type, options) {
1380
- const eventAttributes = { [_chunkGMZQ6N77cjs.FEEDBACK_TYPE]: type };
1429
+ const eventAttributes = { [_chunkRV7JIIDGcjs.FEEDBACK_TYPE]: type };
1381
1430
  if (_optionalChain([options, 'optionalAccess', _65 => _65.score]) !== void 0) {
1382
- eventAttributes[_chunkGMZQ6N77cjs.FEEDBACK_SCORE] = options.score;
1431
+ eventAttributes[_chunkRV7JIIDGcjs.FEEDBACK_SCORE] = options.score;
1383
1432
  }
1384
1433
  if (_optionalChain([options, 'optionalAccess', _66 => _66.reason]) !== void 0) {
1385
- eventAttributes[_chunkGMZQ6N77cjs.FEEDBACK_REASON] = options.reason;
1434
+ eventAttributes[_chunkRV7JIIDGcjs.FEEDBACK_REASON] = options.reason;
1386
1435
  }
1387
1436
  if (_optionalChain([options, 'optionalAccess', _67 => _67.comment]) !== void 0) {
1388
- eventAttributes[_chunkGMZQ6N77cjs.FEEDBACK_COMMENT] = options.comment;
1437
+ eventAttributes[_chunkRV7JIIDGcjs.FEEDBACK_COMMENT] = options.comment;
1389
1438
  }
1390
1439
  if (_optionalChain([options, 'optionalAccess', _68 => _68.source]) !== void 0) {
1391
- eventAttributes[_chunkGMZQ6N77cjs.FEEDBACK_SOURCE] = options.source;
1440
+ eventAttributes[_chunkRV7JIIDGcjs.FEEDBACK_SOURCE] = options.source;
1392
1441
  }
1393
1442
  if (_optionalChain([options, 'optionalAccess', _69 => _69.attributes])) {
1394
1443
  for (const [key, value] of Object.entries(options.attributes)) {
1395
- const k = `${_chunkGMZQ6N77cjs.FEEDBACK_ATTR_PREFIX}${key}`;
1444
+ const k = `${_chunkRV7JIIDGcjs.FEEDBACK_ATTR_PREFIX}${key}`;
1396
1445
  if (eventAttributes[k] === void 0) {
1397
1446
  eventAttributes[k] = value;
1398
1447
  }
@@ -1407,16 +1456,16 @@ function recordFeedback(type, options) {
1407
1456
  }
1408
1457
  const anchor = {};
1409
1458
  if (messageId !== void 0) {
1410
- anchor[_chunkGMZQ6N77cjs.MESSAGE_ID] = messageId;
1459
+ anchor[_chunkRV7JIIDGcjs.MESSAGE_ID] = messageId;
1411
1460
  }
1412
1461
  if (sessionId !== void 0) {
1413
- anchor[_chunkGMZQ6N77cjs.SESSION_ID] = sessionId;
1462
+ anchor[_chunkRV7JIIDGcjs.SESSION_ID] = sessionId;
1414
1463
  }
1415
1464
  try {
1416
1465
  if (Object.keys(anchor).length === 0) {
1417
- emitEvent(_chunkGMZQ6N77cjs.FEEDBACK_EVENT_NAME, eventAttributes);
1466
+ emitEvent(_chunkRV7JIIDGcjs.FEEDBACK_EVENT_NAME, eventAttributes);
1418
1467
  } else {
1419
- callWithProperties(anchor, () => emitEvent(_chunkGMZQ6N77cjs.FEEDBACK_EVENT_NAME, eventAttributes));
1468
+ callWithProperties(anchor, () => emitEvent(_chunkRV7JIIDGcjs.FEEDBACK_EVENT_NAME, eventAttributes));
1420
1469
  }
1421
1470
  } catch (error) {
1422
1471
  _chunkWC573FCIcjs.logger.warn("recordFeedback: failed to emit feedback event", error);
@@ -1441,7 +1490,7 @@ function recordMetricImpl(options) {
1441
1490
  );
1442
1491
  return;
1443
1492
  }
1444
- if (_chunkGMZQ6N77cjs.RESERVED_METRIC_NAMES.has(name)) {
1493
+ if (_chunkRV7JIIDGcjs.RESERVED_METRIC_NAMES.has(name)) {
1445
1494
  _chunkWC573FCIcjs.logger.warn(
1446
1495
  `recordMetric called with the reserved name ${JSON.stringify(name)}; metric dropped. Brizz computes this metric itself \u2014 pick a different name.`
1447
1496
  );
@@ -1466,18 +1515,28 @@ function recordMetricImpl(options) {
1466
1515
  return;
1467
1516
  }
1468
1517
  }
1518
+ const scope = _nullishCoalesce(options.scope, () => ( _chunkRV7JIIDGcjs.METRIC_SCOPE_SESSION));
1519
+ if (scope !== _chunkRV7JIIDGcjs.METRIC_SCOPE_SESSION && scope !== _chunkRV7JIIDGcjs.METRIC_SCOPE_TRACE) {
1520
+ _chunkWC573FCIcjs.logger.warn(
1521
+ `recordMetric(${name}) called with an invalid scope ${JSON.stringify(scope)}; expected '${_chunkRV7JIIDGcjs.METRIC_SCOPE_SESSION}' or '${_chunkRV7JIIDGcjs.METRIC_SCOPE_TRACE}'. Metric dropped.`
1522
+ );
1523
+ return;
1524
+ }
1469
1525
  const eventAttributes = {
1470
- [_chunkGMZQ6N77cjs.METRIC_NAME]: name,
1471
- [_chunkGMZQ6N77cjs.METRIC_VALUE]: numericValue
1526
+ [_chunkRV7JIIDGcjs.METRIC_NAME]: name,
1527
+ [_chunkRV7JIIDGcjs.METRIC_VALUE]: numericValue
1472
1528
  };
1529
+ if (options.scope !== void 0) {
1530
+ eventAttributes[_chunkRV7JIIDGcjs.METRIC_SCOPE] = scope;
1531
+ }
1473
1532
  if (options.unit !== void 0) {
1474
- eventAttributes[_chunkGMZQ6N77cjs.METRIC_UNIT] = options.unit;
1533
+ eventAttributes[_chunkRV7JIIDGcjs.METRIC_UNIT] = options.unit;
1475
1534
  }
1476
1535
  if (options.minValue !== void 0) {
1477
- eventAttributes[_chunkGMZQ6N77cjs.METRIC_MIN] = options.minValue;
1536
+ eventAttributes[_chunkRV7JIIDGcjs.METRIC_MIN] = options.minValue;
1478
1537
  }
1479
1538
  if (options.maxValue !== void 0) {
1480
- eventAttributes[_chunkGMZQ6N77cjs.METRIC_MAX] = options.maxValue;
1539
+ eventAttributes[_chunkRV7JIIDGcjs.METRIC_MAX] = options.maxValue;
1481
1540
  }
1482
1541
  if (options.comment !== void 0) {
1483
1542
  let comment = options.comment;
@@ -1487,21 +1546,21 @@ function recordMetricImpl(options) {
1487
1546
  );
1488
1547
  comment = comment.slice(0, METRIC_COMMENT_MAX_LEN);
1489
1548
  }
1490
- eventAttributes[_chunkGMZQ6N77cjs.METRIC_COMMENT] = comment;
1549
+ eventAttributes[_chunkRV7JIIDGcjs.METRIC_COMMENT] = comment;
1491
1550
  }
1492
1551
  if (options.polarity !== void 0) {
1493
1552
  const polarity = options.polarity;
1494
- if (polarity === _chunkGMZQ6N77cjs.METRIC_POLARITY_POSITIVE || polarity === _chunkGMZQ6N77cjs.METRIC_POLARITY_NEGATIVE) {
1495
- eventAttributes[_chunkGMZQ6N77cjs.METRIC_POLARITY] = polarity;
1553
+ if (polarity === _chunkRV7JIIDGcjs.METRIC_POLARITY_POSITIVE || polarity === _chunkRV7JIIDGcjs.METRIC_POLARITY_NEGATIVE) {
1554
+ eventAttributes[_chunkRV7JIIDGcjs.METRIC_POLARITY] = polarity;
1496
1555
  } else {
1497
1556
  _chunkWC573FCIcjs.logger.warn(
1498
- `recordMetric(${name}) called with an invalid polarity ${JSON.stringify(polarity)}; expected '${_chunkGMZQ6N77cjs.METRIC_POLARITY_POSITIVE}' or '${_chunkGMZQ6N77cjs.METRIC_POLARITY_NEGATIVE}'. Emitting the metric without it.`
1557
+ `recordMetric(${name}) called with an invalid polarity ${JSON.stringify(polarity)}; expected '${_chunkRV7JIIDGcjs.METRIC_POLARITY_POSITIVE}' or '${_chunkRV7JIIDGcjs.METRIC_POLARITY_NEGATIVE}'. Emitting the metric without it.`
1499
1558
  );
1500
1559
  }
1501
1560
  }
1502
1561
  if (options.timestamp !== void 0) {
1503
1562
  if (Number.isFinite(options.timestamp.getTime())) {
1504
- eventAttributes[_chunkGMZQ6N77cjs.METRIC_TIMESTAMP] = options.timestamp.toISOString();
1563
+ eventAttributes[_chunkRV7JIIDGcjs.METRIC_TIMESTAMP] = options.timestamp.toISOString();
1505
1564
  } else {
1506
1565
  _chunkWC573FCIcjs.logger.warn(
1507
1566
  `recordMetric(${name}) called with an invalid timestamp; emitting the metric without it.`
@@ -1531,13 +1590,23 @@ function recordMetricImpl(options) {
1531
1590
  );
1532
1591
  text = text.slice(0, METRIC_ATTRIBUTE_VALUE_MAX_LEN);
1533
1592
  }
1534
- eventAttributes[`${_chunkGMZQ6N77cjs.METRIC_ATTRIBUTE_PREFIX}${normalizedKey}`] = text;
1593
+ eventAttributes[`${_chunkRV7JIIDGcjs.METRIC_ATTRIBUTE_PREFIX}${normalizedKey}`] = text;
1535
1594
  accepted += 1;
1536
1595
  }
1537
1596
  }
1538
1597
  const traceId = typeof options.traceId === "string" && options.traceId !== "" ? options.traceId : void 0;
1539
1598
  if (traceId !== void 0) {
1540
- eventAttributes[_chunkGMZQ6N77cjs.METRIC_TRACE_ID] = traceId;
1599
+ eventAttributes[_chunkRV7JIIDGcjs.METRIC_TRACE_ID] = traceId;
1600
+ }
1601
+ if (scope === _chunkRV7JIIDGcjs.METRIC_SCOPE_TRACE && traceId === void 0) {
1602
+ const spanContext = _optionalChain([_api.trace, 'access', _73 => _73.getActiveSpan, 'call', _74 => _74(), 'optionalAccess', _75 => _75.spanContext, 'call', _76 => _76()]);
1603
+ if (!spanContext || !_api.isSpanContextValid.call(void 0, spanContext)) {
1604
+ _chunkWC573FCIcjs.logger.warn(
1605
+ `recordMetric(${name}) called with scope 'trace' but no trace; metric dropped. Pass options.traceId, or call inside the span of the trace being scored.`
1606
+ );
1607
+ return;
1608
+ }
1609
+ eventAttributes[_chunkRV7JIIDGcjs.METRIC_TRACE_ID] = spanContext.traceId;
1541
1610
  }
1542
1611
  const sessionId = _nullishCoalesce(options.sessionId, () => ( (traceId === void 0 ? resolveSessionIdFromContext() : void 0)));
1543
1612
  if (sessionId === void 0 && traceId === void 0) {
@@ -1547,41 +1616,41 @@ function recordMetricImpl(options) {
1547
1616
  return;
1548
1617
  }
1549
1618
  const base = _api.context.active();
1550
- const ambient = base.getValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY);
1619
+ const ambient = base.getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1551
1620
  const properties = { ...ambient };
1552
1621
  if (sessionId === void 0) {
1553
- delete properties[_chunkGMZQ6N77cjs.SESSION_ID];
1554
- delete properties[_chunkGMZQ6N77cjs.MESSAGE_ID];
1622
+ delete properties[_chunkRV7JIIDGcjs.SESSION_ID];
1623
+ delete properties[_chunkRV7JIIDGcjs.MESSAGE_ID];
1555
1624
  } else {
1556
- properties[_chunkGMZQ6N77cjs.SESSION_ID] = sessionId;
1625
+ properties[_chunkRV7JIIDGcjs.SESSION_ID] = sessionId;
1557
1626
  }
1558
1627
  if (options.serviceName !== void 0) {
1559
- properties[_chunkGMZQ6N77cjs.SERVICE_NAME] = options.serviceName;
1628
+ properties[_chunkRV7JIIDGcjs.SERVICE_NAME] = options.serviceName;
1560
1629
  }
1561
1630
  try {
1562
1631
  _api.context.with(
1563
- base.setValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY, properties),
1564
- () => emitEvent(_chunkGMZQ6N77cjs.METRIC_EVENT_NAME, eventAttributes)
1632
+ base.setValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY, properties),
1633
+ () => emitEvent(_chunkRV7JIIDGcjs.METRIC_EVENT_NAME, eventAttributes)
1565
1634
  );
1566
1635
  } catch (error) {
1567
1636
  _chunkWC573FCIcjs.logger.warn("recordMetric: failed to emit metric event", error);
1568
1637
  }
1569
1638
  }
1570
1639
  function startSession(sessionId, callback, extraProperties, options) {
1571
- const isTitle = _optionalChain([options, 'optionalAccess', _73 => _73.mode]) === "title";
1572
- const spanName = isTitle ? _chunkGMZQ6N77cjs.SESSION_TITLE_SPAN_NAME : _chunkGMZQ6N77cjs.SESSION_SPAN_NAME;
1640
+ const isTitle = _optionalChain([options, 'optionalAccess', _77 => _77.mode]) === "title";
1641
+ const spanName = isTitle ? _chunkRV7JIIDGcjs.SESSION_TITLE_SPAN_NAME : _chunkRV7JIIDGcjs.SESSION_SPAN_NAME;
1573
1642
  const tracer = _api.trace.getTracer("@brizz/sdk");
1574
1643
  return tracer.startActiveSpan(spanName, (span) => {
1575
- span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${_chunkGMZQ6N77cjs.SESSION_ID}`, sessionId);
1644
+ span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.SESSION_ID}`, sessionId);
1576
1645
  if (extraProperties) {
1577
1646
  for (const [key, value] of Object.entries(extraProperties)) {
1578
- span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${key}`, value);
1647
+ span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${key}`, value);
1579
1648
  }
1580
1649
  }
1581
1650
  const session = new Session(sessionId, span);
1582
- const contextProperties = { [_chunkGMZQ6N77cjs.SESSION_ID]: sessionId };
1651
+ const contextProperties = { [_chunkRV7JIIDGcjs.SESSION_ID]: sessionId };
1583
1652
  if (isTitle) {
1584
- contextProperties[_chunkGMZQ6N77cjs.SESSION_TITLE_GENERATION] = "true";
1653
+ contextProperties[_chunkRV7JIIDGcjs.SESSION_TITLE_GENERATION] = "true";
1585
1654
  }
1586
1655
  if (extraProperties) {
1587
1656
  for (const [key, value] of Object.entries(extraProperties)) {
@@ -1589,7 +1658,7 @@ function startSession(sessionId, callback, extraProperties, options) {
1589
1658
  }
1590
1659
  }
1591
1660
  return callWithProperties(contextProperties, () => {
1592
- const sessionCtx = _api.context.active().setValue(_chunkGMZQ6N77cjs.SESSION_OBJECT_CONTEXT_KEY, session);
1661
+ const sessionCtx = _api.context.active().setValue(_chunkRV7JIIDGcjs.SESSION_OBJECT_CONTEXT_KEY, session);
1593
1662
  return _api.context.with(sessionCtx, () => {
1594
1663
  try {
1595
1664
  const result = callback(session);
@@ -1617,16 +1686,16 @@ function startSession(sessionId, callback, extraProperties, options) {
1617
1686
  });
1618
1687
  }
1619
1688
  function startSessionTitle(callback, options) {
1620
- const resolvedSessionId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _74 => _74.sessionId]), () => ( _optionalChain([getActiveSession, 'call', _75 => _75(), 'optionalAccess', _76 => _76.sessionId])));
1689
+ const resolvedSessionId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _78 => _78.sessionId]), () => ( _optionalChain([getActiveSession, 'call', _79 => _79(), 'optionalAccess', _80 => _80.sessionId])));
1621
1690
  const tracer = _api.trace.getTracer("@brizz/sdk");
1622
- return tracer.startActiveSpan(_chunkGMZQ6N77cjs.SESSION_TITLE_SPAN_NAME, (span) => {
1691
+ return tracer.startActiveSpan(_chunkRV7JIIDGcjs.SESSION_TITLE_SPAN_NAME, (span) => {
1623
1692
  if (resolvedSessionId) {
1624
- span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${_chunkGMZQ6N77cjs.SESSION_ID}`, resolvedSessionId);
1693
+ span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.SESSION_ID}`, resolvedSessionId);
1625
1694
  }
1626
1695
  const sessionTitle = new SessionTitle(span);
1627
- const properties = { [_chunkGMZQ6N77cjs.SESSION_TITLE_GENERATION]: "true" };
1696
+ const properties = { [_chunkRV7JIIDGcjs.SESSION_TITLE_GENERATION]: "true" };
1628
1697
  if (resolvedSessionId) {
1629
- properties[_chunkGMZQ6N77cjs.SESSION_ID] = resolvedSessionId;
1698
+ properties[_chunkRV7JIIDGcjs.SESSION_ID] = resolvedSessionId;
1630
1699
  }
1631
1700
  return callWithProperties(properties, () => {
1632
1701
  try {
@@ -2089,14 +2158,14 @@ var BrizzSimpleLogRecordProcessor = class extends _sdklogs.SimpleLogRecordProces
2089
2158
  this.config = config;
2090
2159
  }
2091
2160
  onEmit(logRecord) {
2092
- const maskingConfig = _optionalChain([this, 'access', _77 => _77.config, 'access', _78 => _78.masking, 'optionalAccess', _79 => _79.eventMasking]);
2161
+ const maskingConfig = _optionalChain([this, 'access', _81 => _81.config, 'access', _82 => _82.masking, 'optionalAccess', _83 => _83.eventMasking]);
2093
2162
  if (maskingConfig) {
2094
2163
  maskLog(logRecord, maskingConfig);
2095
2164
  }
2096
- const associationProperties = _api.context.active().getValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY);
2165
+ const associationProperties = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
2097
2166
  if (associationProperties) {
2098
2167
  for (const [key, value] of Object.entries(associationProperties)) {
2099
- logRecord.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${key}`, value);
2168
+ logRecord.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${key}`, value);
2100
2169
  }
2101
2170
  }
2102
2171
  super.onEmit(logRecord);
@@ -2109,14 +2178,14 @@ var BrizzBatchLogRecordProcessor = class extends _sdklogs.BatchLogRecordProcesso
2109
2178
  this.config = config;
2110
2179
  }
2111
2180
  onEmit(logRecord) {
2112
- const maskingConfig = _optionalChain([this, 'access', _80 => _80.config, 'access', _81 => _81.masking, 'optionalAccess', _82 => _82.eventMasking]);
2181
+ const maskingConfig = _optionalChain([this, 'access', _84 => _84.config, 'access', _85 => _85.masking, 'optionalAccess', _86 => _86.eventMasking]);
2113
2182
  if (maskingConfig) {
2114
2183
  maskLog(logRecord, maskingConfig);
2115
2184
  }
2116
- const associationProperties = _api.context.active().getValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY);
2185
+ const associationProperties = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
2117
2186
  if (associationProperties) {
2118
2187
  for (const [key, value] of Object.entries(associationProperties)) {
2119
- logRecord.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${key}`, value);
2188
+ logRecord.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${key}`, value);
2120
2189
  }
2121
2190
  }
2122
2191
  super.onEmit(logRecord);
@@ -2143,7 +2212,7 @@ function maskLog(logRecord, config) {
2143
2212
  newAttributes[key] = value;
2144
2213
  }
2145
2214
  for (const [key, value] of Object.entries(logRecord.attributes)) {
2146
- if (key.startsWith(_chunkGMZQ6N77cjs.INTERNAL_EVENT_PREFIX)) {
2215
+ if (key.startsWith(_chunkRV7JIIDGcjs.INTERNAL_EVENT_PREFIX)) {
2147
2216
  newAttributes[key] = value;
2148
2217
  }
2149
2218
  }
@@ -2210,14 +2279,14 @@ var LoggingModule = (_class3 = class _LoggingModule {constructor() { _class3.pro
2210
2279
  _chunkWC573FCIcjs.logger.debug("Creating logger provider", {
2211
2280
  serviceName,
2212
2281
  disableBatch: config.disableBatch,
2213
- hasMasking: !!_optionalChain([config, 'access', _83 => _83.masking, 'optionalAccess', _84 => _84.eventMasking])
2282
+ hasMasking: !!_optionalChain([config, 'access', _87 => _87.masking, 'optionalAccess', _88 => _88.eventMasking])
2214
2283
  });
2215
2284
  const exporter = this.createLogExporter(config, serviceName);
2216
2285
  const processor = config.disableBatch ? new BrizzSimpleLogRecordProcessor(exporter, config) : new BrizzBatchLogRecordProcessor(exporter, config);
2217
2286
  const resourceAttributes = {
2218
2287
  ...config.resourceAttributes,
2219
2288
  "service.name": serviceName,
2220
- [BRIZZ_SDK_VERSION]: _chunkJDJLJ2V2cjs.getSDKVersion.call(void 0, ),
2289
+ [BRIZZ_SDK_VERSION]: _chunkVH5N6E54cjs.getSDKVersion.call(void 0, ),
2221
2290
  [BRIZZ_SDK_LANGUAGE]: SDK_LANGUAGE
2222
2291
  };
2223
2292
  if (config.environment) {
@@ -2466,7 +2535,7 @@ var BrizzSpanExporter = (_class5 = class {
2466
2535
  const resourceAttrs = {
2467
2536
  ...config.resourceAttributes,
2468
2537
  "service.name": config.appName,
2469
- [BRIZZ_SDK_VERSION]: _chunkJDJLJ2V2cjs.getSDKVersion.call(void 0, ),
2538
+ [BRIZZ_SDK_VERSION]: _chunkVH5N6E54cjs.getSDKVersion.call(void 0, ),
2470
2539
  [BRIZZ_SDK_LANGUAGE]: SDK_LANGUAGE
2471
2540
  };
2472
2541
  if (config.environment) {
@@ -2480,7 +2549,7 @@ var BrizzSpanExporter = (_class5 = class {
2480
2549
  }
2481
2550
  /** The service a span reports under: its scoped override, else the configured appName. */
2482
2551
  _serviceNameOf(span) {
2483
- const value = span.attributes[_chunkGMZQ6N77cjs.SERVICE_NAME_ATTRIBUTE];
2552
+ const value = span.attributes[_chunkRV7JIIDGcjs.SERVICE_NAME_ATTRIBUTE];
2484
2553
  return typeof value === "string" && value !== "" ? value : this._defaultServiceName;
2485
2554
  }
2486
2555
  _resourceFor(serviceName) {
@@ -2593,8 +2662,8 @@ var BrizzSpanExporter = (_class5 = class {
2593
2662
  }
2594
2663
  async forceFlush() {
2595
2664
  await Promise.all([
2596
- _optionalChain([this, 'access', _85 => _85._delegate, 'access', _86 => _86.forceFlush, 'optionalCall', _87 => _87()]),
2597
- ...[...this._delegates.values()].map(async (delegate) => _optionalChain([delegate, 'access', _88 => _88.forceFlush, 'optionalCall', _89 => _89()]))
2665
+ _optionalChain([this, 'access', _89 => _89._delegate, 'access', _90 => _90.forceFlush, 'optionalCall', _91 => _91()]),
2666
+ ...[...this._delegates.values()].map(async (delegate) => _optionalChain([delegate, 'access', _92 => _92.forceFlush, 'optionalCall', _93 => _93()]))
2598
2667
  ]);
2599
2668
  }
2600
2669
  }, _class5);
@@ -2606,10 +2675,10 @@ var BrizzSpanExporter = (_class5 = class {
2606
2675
 
2607
2676
  var _sdktracebase = require('@opentelemetry/sdk-trace-base');
2608
2677
  function applyContextAttributes(span) {
2609
- const sessionProperties = _api.context.active().getValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY);
2678
+ const sessionProperties = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
2610
2679
  if (sessionProperties) {
2611
2680
  for (const [key, value] of Object.entries(sessionProperties)) {
2612
- span.setAttribute(`${_chunkGMZQ6N77cjs.BRIZZ}.${key}`, value);
2681
+ span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${key}`, value);
2613
2682
  }
2614
2683
  }
2615
2684
  }
@@ -2631,7 +2700,7 @@ var BrizzSimpleSpanProcessor = class extends _sdktracebase.SimpleSpanProcessor {
2631
2700
  }
2632
2701
  onEnd(span) {
2633
2702
  restampLangChainSpan(span);
2634
- const maskingConfig = _optionalChain([this, 'access', _90 => _90.config, 'access', _91 => _91.masking, 'optionalAccess', _92 => _92.spanMasking]);
2703
+ const maskingConfig = _optionalChain([this, 'access', _94 => _94.config, 'access', _95 => _95.masking, 'optionalAccess', _96 => _96.spanMasking]);
2635
2704
  if (maskingConfig) {
2636
2705
  maskReadableSpan(span, maskingConfig);
2637
2706
  }
@@ -2650,7 +2719,7 @@ var BrizzBatchSpanProcessor = class extends _sdktracebase.BatchSpanProcessor {
2650
2719
  }
2651
2720
  onEnd(span) {
2652
2721
  restampLangChainSpan(span);
2653
- const maskingConfig = _optionalChain([this, 'access', _93 => _93.config, 'access', _94 => _94.masking, 'optionalAccess', _95 => _95.spanMasking]);
2722
+ const maskingConfig = _optionalChain([this, 'access', _97 => _97.config, 'access', _98 => _98.masking, 'optionalAccess', _99 => _99.spanMasking]);
2654
2723
  if (maskingConfig) {
2655
2724
  maskReadableSpan(span, maskingConfig);
2656
2725
  }
@@ -2737,7 +2806,7 @@ var TracingModule = (_class6 = class _TracingModule {constructor() { _class6.pro
2737
2806
  }
2738
2807
  _chunkWC573FCIcjs.logger.debug("Initializing span processor", {
2739
2808
  disableBatch: config.disableBatch,
2740
- hasMasking: !!_optionalChain([config, 'access', _96 => _96.masking, 'optionalAccess', _97 => _97.spanMasking])
2809
+ hasMasking: !!_optionalChain([config, 'access', _100 => _100.masking, 'optionalAccess', _101 => _101.spanMasking])
2741
2810
  });
2742
2811
  const spanProcessor = config.disableBatch ? new BrizzSimpleSpanProcessor(this.spanExporter, config) : new BrizzBatchSpanProcessor(this.spanExporter, config);
2743
2812
  _chunkWC573FCIcjs.logger.debug("Span processor initialized successfully");
@@ -2808,7 +2877,7 @@ function newInstanceId() {
2808
2877
  return _crypto.randomUUID.call(void 0, ).replaceAll("-", "").slice(0, 8);
2809
2878
  }
2810
2879
  function activeProperties() {
2811
- return _nullishCoalesce(_api.context.active().getValue(_chunkGMZQ6N77cjs.PROPERTIES_CONTEXT_KEY), () => ( {}));
2880
+ return _nullishCoalesce(_api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY), () => ( {}));
2812
2881
  }
2813
2882
  function encodeToken(agent) {
2814
2883
  const payload = {
@@ -2834,7 +2903,7 @@ function agentHandle(id, parentId, name) {
2834
2903
  parentId,
2835
2904
  name,
2836
2905
  traceparent: currentTraceparent(),
2837
- sessionId: _nullishCoalesce(activeProperties()[_chunkGMZQ6N77cjs.SESSION_ID], () => ( ""))
2906
+ sessionId: _nullishCoalesce(activeProperties()[_chunkRV7JIIDGcjs.SESSION_ID], () => ( ""))
2838
2907
  };
2839
2908
  return {
2840
2909
  ...opened,
@@ -2870,7 +2939,7 @@ function resolveAgent(agent) {
2870
2939
  let parentContext = _api.context.active();
2871
2940
  if (options.token === void 0) {
2872
2941
  id = options.id || newInstanceId();
2873
- parentId = options.parentId || activeProperties()[_chunkGMZQ6N77cjs.AGENT_ID] || "";
2942
+ parentId = options.parentId || activeProperties()[_chunkRV7JIIDGcjs.AGENT_ID] || "";
2874
2943
  name = _nullishCoalesce(options.name, () => ( ""));
2875
2944
  } else {
2876
2945
  const decoded = decodeToken(options.token);
@@ -2889,12 +2958,12 @@ function resolveAgent(agent) {
2889
2958
  }
2890
2959
  }
2891
2960
  }
2892
- const properties = { [_chunkGMZQ6N77cjs.AGENT_ID]: id, [_chunkGMZQ6N77cjs.AGENT_NAME]: name };
2961
+ const properties = { [_chunkRV7JIIDGcjs.AGENT_ID]: id, [_chunkRV7JIIDGcjs.AGENT_NAME]: name };
2893
2962
  if (parentId) {
2894
- properties[_chunkGMZQ6N77cjs.AGENT_PARENT_ID] = parentId;
2963
+ properties[_chunkRV7JIIDGcjs.AGENT_PARENT_ID] = parentId;
2895
2964
  }
2896
2965
  if (sessionId) {
2897
- properties[_chunkGMZQ6N77cjs.SESSION_ID] = sessionId;
2966
+ properties[_chunkRV7JIIDGcjs.SESSION_ID] = sessionId;
2898
2967
  }
2899
2968
  return { id, parentId, name, properties, parentContext };
2900
2969
  }
@@ -2957,8 +3026,9 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
2957
3026
  */
2958
3027
  setupInstrumentation(options) {
2959
3028
  const registry = InstrumentationRegistry.getInstance();
2960
- _chunkJDJLJ2V2cjs.configure.call(void 0, resolveMcpSessionTracking(options.mcpSessionTracking));
3029
+ _chunkVH5N6E54cjs.configure.call(void 0, resolveMcpSessionTracking(options.mcpSessionTracking));
2961
3030
  patchInstalledCallbackManager();
3031
+ patchInstalledLangGraph();
2962
3032
  if (options.instrumentModules && Object.keys(options.instrumentModules).length > 0) {
2963
3033
  registry.setManualModules(options.instrumentModules);
2964
3034
  }
@@ -2981,7 +3051,7 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
2981
3051
  const resourceAttributes = {
2982
3052
  ...resolvedConfig.resourceAttributes,
2983
3053
  "service.name": resolvedConfig.appName,
2984
- [BRIZZ_SDK_VERSION]: _chunkJDJLJ2V2cjs.getSDKVersion.call(void 0, ),
3054
+ [BRIZZ_SDK_VERSION]: _chunkVH5N6E54cjs.getSDKVersion.call(void 0, ),
2985
3055
  [BRIZZ_SDK_LANGUAGE]: SDK_LANGUAGE
2986
3056
  };
2987
3057
  if (resolvedConfig.environment) {
@@ -2993,7 +3063,7 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
2993
3063
  const resource = _resources2.defaultResource.call(void 0, ).merge(_resources2.detectResources.call(void 0, { detectors: [_resources2.envDetector, _resources2.hostDetector, _resources2.processDetector] })).merge(_resources2.resourceFromAttributes.call(void 0, resourceAttributes));
2994
3064
  this._tracerProvider = new (0, _sdktracenode.NodeTracerProvider)({
2995
3065
  resource,
2996
- spanProcessors: resolvedConfig.disableSpanExporter ? [] : [new (0, _chunkELLCNMLIcjs.InterruptPropagator)(), getSpanProcessor()]
3066
+ spanProcessors: resolvedConfig.disableSpanExporter ? [] : [new (0, _chunkO2IBZJOJcjs.InterruptPropagator)(), getSpanProcessor()]
2997
3067
  });
2998
3068
  this._tracerProvider.register();
2999
3069
  this._meterProvider = new (0, _sdkmetrics.MeterProvider)({ resource, readers: [getMetricsReader()] });
@@ -3129,10 +3199,10 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
3129
3199
  }
3130
3200
  try {
3131
3201
  await this.shutdownModules();
3132
- await _optionalChain([this, 'access', _98 => _98._tracerProvider, 'optionalAccess', _99 => _99.forceFlush, 'call', _100 => _100()]);
3133
- await _optionalChain([this, 'access', _101 => _101._tracerProvider, 'optionalAccess', _102 => _102.shutdown, 'call', _103 => _103()]);
3134
- await _optionalChain([this, 'access', _104 => _104._meterProvider, 'optionalAccess', _105 => _105.forceFlush, 'call', _106 => _106()]);
3135
- await _optionalChain([this, 'access', _107 => _107._meterProvider, 'optionalAccess', _108 => _108.shutdown, 'call', _109 => _109()]);
3202
+ await _optionalChain([this, 'access', _102 => _102._tracerProvider, 'optionalAccess', _103 => _103.forceFlush, 'call', _104 => _104()]);
3203
+ await _optionalChain([this, 'access', _105 => _105._tracerProvider, 'optionalAccess', _106 => _106.shutdown, 'call', _107 => _107()]);
3204
+ await _optionalChain([this, 'access', _108 => _108._meterProvider, 'optionalAccess', _109 => _109.forceFlush, 'call', _110 => _110()]);
3205
+ await _optionalChain([this, 'access', _111 => _111._meterProvider, 'optionalAccess', _112 => _112.shutdown, 'call', _113 => _113()]);
3136
3206
  this._initialized = false;
3137
3207
  this._tracerProvider = null;
3138
3208
  this._meterProvider = null;