@brizz/sdk 0.1.51 → 0.1.52

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.
@@ -9,7 +9,7 @@ var _chunkRV7JIIDGcjs = require('./chunk-RV7JIIDG.cjs');
9
9
 
10
10
  // src/internal/version.ts
11
11
  function getSDKVersion() {
12
- return "0.1.51";
12
+ return "0.1.52";
13
13
  }
14
14
 
15
15
  // src/internal/instrumentation/mcp/session.ts
@@ -9,7 +9,7 @@ import {
9
9
 
10
10
  // src/internal/version.ts
11
11
  function getSDKVersion() {
12
- return "0.1.51";
12
+ return "0.1.52";
13
13
  }
14
14
 
15
15
  // src/internal/instrumentation/mcp/session.ts
package/dist/index.cjs CHANGED
@@ -5,7 +5,7 @@ var _chunkUNLNNKZ7cjs = require('./chunk-UNLNNKZ7.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunkJSTTHMQ3cjs = require('./chunk-JSTTHMQ3.cjs');
8
+ var _chunk2T7OEV33cjs = require('./chunk-2T7OEV33.cjs');
9
9
 
10
10
 
11
11
 
@@ -104,7 +104,7 @@ var _api = require('@opentelemetry/api');
104
104
 
105
105
  // src/internal/instrumentation/langgraph/attributes.ts
106
106
  var INSTRUMENTATION_NAME = "@brizz/sdk/langgraph";
107
- var INSTRUMENTATION_VERSION = _chunkJSTTHMQ3cjs.getSDKVersion.call(void 0, );
107
+ var INSTRUMENTATION_VERSION = _chunk2T7OEV33cjs.getSDKVersion.call(void 0, );
108
108
  var MODULE_NAME = "@langchain/langgraph";
109
109
  var SUPPORTED_VERSIONS = [">=0.2.0 <2"];
110
110
  function isSupportedVersion(version) {
@@ -468,7 +468,7 @@ function loadGenAIInstrumentations() {
468
468
  function loadMCPInstrumentation() {
469
469
  void (async () => {
470
470
  try {
471
- const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-FCUYTDGN.cjs")));
471
+ const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-MVZSP5NE.cjs")));
472
472
  const mcp = new MCPInstrumentation({ exceptionLogger });
473
473
  _instrumentation.registerInstrumentations.call(void 0, { instrumentations: [mcp] });
474
474
  _chunkWC573FCIcjs.logger.debug("Auto-loaded MCP instrumentation");
@@ -753,6 +753,9 @@ var OMITTED_KEYS = /* @__PURE__ */ new Set([
753
753
  _chunkRV7JIIDGcjs.ORGANIZATION_NAME,
754
754
  _chunkRV7JIIDGcjs.ORGANIZATION_DOMAIN
755
755
  ]);
756
+ var TOOL_CALL_ID_METADATA_KEY = "brizz_tool_call_id";
757
+ var TOOL_ID = "tool.id";
758
+ var TOOL_CALL_ID_ARG = 7;
756
759
  function runMetadataFromContext() {
757
760
  const bag = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
758
761
  if (!bag) {
@@ -792,9 +795,32 @@ function patchCallbackManagerModule(module2) {
792
795
  }
793
796
  return manager;
794
797
  };
798
+ patchToolStart(statics["prototype"]);
795
799
  statics[PATCHED_MARKER] = true;
796
800
  return true;
797
801
  }
802
+ function patchToolStart(prototype) {
803
+ const proto = prototype;
804
+ const original = _optionalChain([proto, 'optionalAccess', _23 => _23["handleToolStart"]]);
805
+ if (!proto || typeof original !== "function") {
806
+ return;
807
+ }
808
+ const handleToolStart = original;
809
+ proto["handleToolStart"] = function(...args) {
810
+ try {
811
+ const toolCallId = args[TOOL_CALL_ID_ARG];
812
+ if (typeof toolCallId === "string" && toolCallId !== "") {
813
+ this.addMetadata({ [TOOL_CALL_ID_METADATA_KEY]: toolCallId }, false);
814
+ } else if (this.metadata && TOOL_CALL_ID_METADATA_KEY in this.metadata) {
815
+ const rest = { ...this.metadata };
816
+ delete rest[TOOL_CALL_ID_METADATA_KEY];
817
+ this.metadata = rest;
818
+ }
819
+ } catch (e3) {
820
+ }
821
+ return handleToolStart.apply(this, args);
822
+ };
823
+ }
798
824
  function patchInstalledCallbackManager() {
799
825
  void (async () => {
800
826
  try {
@@ -813,23 +839,28 @@ function patchInstalledCallbackManager() {
813
839
  function restampLangChainSpan(span) {
814
840
  try {
815
841
  const scope = span.instrumentationScope;
816
- if (_optionalChain([scope, 'optionalAccess', _23 => _23.name]) !== SCOPE_NAME) {
842
+ if (_optionalChain([scope, 'optionalAccess', _24 => _24.name]) !== SCOPE_NAME) {
817
843
  return;
818
844
  }
819
845
  const attrs = span.attributes;
820
846
  const metadata = attrs["metadata"];
821
- if (typeof metadata !== "string" || !metadata.includes(`"${_chunkRV7JIIDGcjs.BRIZZ}.`)) {
847
+ if (typeof metadata !== "string" || !metadata.includes(`"${_chunkRV7JIIDGcjs.BRIZZ}.`) && !metadata.includes(`"${TOOL_CALL_ID_METADATA_KEY}"`)) {
822
848
  return;
823
849
  }
824
850
  const parsed = JSON.parse(metadata);
825
851
  if (typeof parsed !== "object" || parsed === null) {
826
852
  return;
827
853
  }
828
- for (const [key, value] of Object.entries(parsed)) {
854
+ const entries = parsed;
855
+ for (const [key, value] of Object.entries(entries)) {
829
856
  if (key.startsWith(`${_chunkRV7JIIDGcjs.BRIZZ}.`) && value !== null && value !== void 0) {
830
857
  attrs[key] = String(value);
831
858
  }
832
859
  }
860
+ const toolCallId = entries[TOOL_CALL_ID_METADATA_KEY];
861
+ if (typeof toolCallId === "string" && toolCallId !== "" && attrs[TOOL_ID] === void 0) {
862
+ attrs[TOOL_ID] = toolCallId;
863
+ }
833
864
  } catch (error) {
834
865
  _chunkWC573FCIcjs.logger.debug("Skipped LangChain span re-stamp", { err: error });
835
866
  }
@@ -868,7 +899,7 @@ var InstrumentationRegistry = (_class = class _InstrumentationRegistry {construc
868
899
  * @private
869
900
  */
870
901
  loadManualInstrumentations(instrumentations, exceptionLogger2) {
871
- if (_optionalChain([this, 'access', _24 => _24.manualModules, 'optionalAccess', _25 => _25.openAI])) {
902
+ if (_optionalChain([this, 'access', _25 => _25.manualModules, 'optionalAccess', _26 => _26.openAI])) {
872
903
  try {
873
904
  const openAIInst = new (0, _openinferenceinstrumentationopenai.OpenAIInstrumentation)();
874
905
  openAIInst.manuallyInstrument(this.manualModules.openAI);
@@ -879,18 +910,18 @@ var InstrumentationRegistry = (_class = class _InstrumentationRegistry {construc
879
910
  }
880
911
  }
881
912
  const instrumentationConfigs = [
882
- { class: _instrumentationanthropic.AnthropicInstrumentation, name: "Anthropic", module: _optionalChain([this, 'access', _26 => _26.manualModules, 'optionalAccess', _27 => _27.anthropic]) },
883
- { class: _instrumentationcohere.CohereInstrumentation, name: "Cohere", module: _optionalChain([this, 'access', _28 => _28.manualModules, 'optionalAccess', _29 => _29.cohere]) },
884
- { class: _instrumentationbedrock.BedrockInstrumentation, name: "Bedrock", module: _optionalChain([this, 'access', _30 => _30.manualModules, 'optionalAccess', _31 => _31.bedrock]) },
885
- { class: _instrumentationpinecone.PineconeInstrumentation, name: "Pinecone", module: _optionalChain([this, 'access', _32 => _32.manualModules, 'optionalAccess', _33 => _33.pinecone]) },
913
+ { class: _instrumentationanthropic.AnthropicInstrumentation, name: "Anthropic", module: _optionalChain([this, 'access', _27 => _27.manualModules, 'optionalAccess', _28 => _28.anthropic]) },
914
+ { class: _instrumentationcohere.CohereInstrumentation, name: "Cohere", module: _optionalChain([this, 'access', _29 => _29.manualModules, 'optionalAccess', _30 => _30.cohere]) },
915
+ { class: _instrumentationbedrock.BedrockInstrumentation, name: "Bedrock", module: _optionalChain([this, 'access', _31 => _31.manualModules, 'optionalAccess', _32 => _32.bedrock]) },
916
+ { class: _instrumentationpinecone.PineconeInstrumentation, name: "Pinecone", module: _optionalChain([this, 'access', _33 => _33.manualModules, 'optionalAccess', _34 => _34.pinecone]) },
886
917
  {
887
918
  class: _instrumentationllamaindex.LlamaIndexInstrumentation,
888
919
  name: "LlamaIndex",
889
- module: _optionalChain([this, 'access', _34 => _34.manualModules, 'optionalAccess', _35 => _35.llamaindex])
920
+ module: _optionalChain([this, 'access', _35 => _35.manualModules, 'optionalAccess', _36 => _36.llamaindex])
890
921
  },
891
- { class: _instrumentationchromadb.ChromaDBInstrumentation, name: "ChromaDB", module: _optionalChain([this, 'access', _36 => _36.manualModules, 'optionalAccess', _37 => _37.chromadb]) },
892
- { class: _instrumentationqdrant.QdrantInstrumentation, name: "Qdrant", module: _optionalChain([this, 'access', _38 => _38.manualModules, 'optionalAccess', _39 => _39.qdrant]) },
893
- { class: _instrumentationtogether.TogetherInstrumentation, name: "Together", module: _optionalChain([this, 'access', _40 => _40.manualModules, 'optionalAccess', _41 => _41.together]) }
922
+ { class: _instrumentationchromadb.ChromaDBInstrumentation, name: "ChromaDB", module: _optionalChain([this, 'access', _37 => _37.manualModules, 'optionalAccess', _38 => _38.chromadb]) },
923
+ { class: _instrumentationqdrant.QdrantInstrumentation, name: "Qdrant", module: _optionalChain([this, 'access', _39 => _39.manualModules, 'optionalAccess', _40 => _40.qdrant]) },
924
+ { class: _instrumentationtogether.TogetherInstrumentation, name: "Together", module: _optionalChain([this, 'access', _41 => _41.manualModules, 'optionalAccess', _42 => _42.together]) }
894
925
  ];
895
926
  for (const config of instrumentationConfigs) {
896
927
  if (!config.module) {
@@ -906,7 +937,7 @@ var InstrumentationRegistry = (_class = class _InstrumentationRegistry {construc
906
937
  instrumentations.push(instrumentation);
907
938
  }
908
939
  }
909
- if (_optionalChain([this, 'access', _42 => _42.manualModules, 'optionalAccess', _43 => _43.langchain, 'optionalAccess', _44 => _44.callbackManagerModule])) {
940
+ if (_optionalChain([this, 'access', _43 => _43.manualModules, 'optionalAccess', _44 => _44.langchain, 'optionalAccess', _45 => _45.callbackManagerModule])) {
910
941
  const callbackManagerModule = this.manualModules.langchain.callbackManagerModule;
911
942
  void (async () => {
912
943
  try {
@@ -922,7 +953,7 @@ var InstrumentationRegistry = (_class = class _InstrumentationRegistry {construc
922
953
  }
923
954
  })();
924
955
  }
925
- if (_optionalChain([this, 'access', _45 => _45.manualModules, 'optionalAccess', _46 => _46.langgraph])) {
956
+ if (_optionalChain([this, 'access', _46 => _46.manualModules, 'optionalAccess', _47 => _47.langgraph])) {
926
957
  try {
927
958
  new LangGraphInstrumentation().manuallyInstrument(this.manualModules.langgraph);
928
959
  _chunkWC573FCIcjs.logger.debug("Manual instrumentation enabled for LangGraph");
@@ -930,7 +961,7 @@ var InstrumentationRegistry = (_class = class _InstrumentationRegistry {construc
930
961
  _chunkWC573FCIcjs.logger.error(`Failed to apply LangGraph instrumentation: ${String(error)}`);
931
962
  }
932
963
  }
933
- if (_optionalChain([this, 'access', _47 => _47.manualModules, 'optionalAccess', _48 => _48.google_vertexai])) {
964
+ if (_optionalChain([this, 'access', _48 => _48.manualModules, 'optionalAccess', _49 => _49.google_vertexai])) {
934
965
  const vertexModule = this.manualModules.google_vertexai;
935
966
  void (async () => {
936
967
  try {
@@ -945,7 +976,7 @@ var InstrumentationRegistry = (_class = class _InstrumentationRegistry {construc
945
976
  }
946
977
  })();
947
978
  }
948
- if (_optionalChain([this, 'access', _49 => _49.manualModules, 'optionalAccess', _50 => _50.google_genai])) {
979
+ if (_optionalChain([this, 'access', _50 => _50.manualModules, 'optionalAccess', _51 => _51.google_genai])) {
949
980
  const genaiModule = this.manualModules.google_genai;
950
981
  void (async () => {
951
982
  try {
@@ -960,11 +991,11 @@ var InstrumentationRegistry = (_class = class _InstrumentationRegistry {construc
960
991
  }
961
992
  })();
962
993
  }
963
- if (_optionalChain([this, 'access', _51 => _51.manualModules, 'optionalAccess', _52 => _52.mcp])) {
994
+ if (_optionalChain([this, 'access', _52 => _52.manualModules, 'optionalAccess', _53 => _53.mcp])) {
964
995
  const mcpModules = this.manualModules.mcp;
965
996
  void (async () => {
966
997
  try {
967
- const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-FCUYTDGN.cjs")));
998
+ const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-MVZSP5NE.cjs")));
968
999
  const instrumentation = new MCPInstrumentation({ exceptionLogger: exceptionLogger2 });
969
1000
  instrumentation.manuallyInstrument(mcpModules);
970
1001
  _chunkWC573FCIcjs.logger.debug("Manual instrumentation enabled for MCP");
@@ -1016,7 +1047,7 @@ function setCurrentSpanCustomProperties(properties) {
1016
1047
  for (const [key, value] of Object.entries(properties)) {
1017
1048
  try {
1018
1049
  current.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${key}`, value);
1019
- } catch (e3) {
1050
+ } catch (e4) {
1020
1051
  }
1021
1052
  }
1022
1053
  }
@@ -1040,15 +1071,15 @@ function withProperties(properties, fn, thisArg) {
1040
1071
  function propagatePropertiesImperatively(properties, base = _api.context.active()) {
1041
1072
  try {
1042
1073
  const manager = _api.context;
1043
- const mgr = _optionalChain([manager, 'access', _53 => _53._getContextManager, 'optionalCall', _54 => _54()]);
1044
- const store = _optionalChain([mgr, 'optionalAccess', _55 => _55._asyncLocalStorage]);
1074
+ const mgr = _optionalChain([manager, 'access', _54 => _54._getContextManager, 'optionalCall', _55 => _55()]);
1075
+ const store = _optionalChain([mgr, 'optionalAccess', _56 => _56._asyncLocalStorage]);
1045
1076
  if (!store || typeof store.enterWith !== "function") {
1046
1077
  return;
1047
1078
  }
1048
1079
  const prev = base.getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1049
1080
  const merged = prev ? { ...prev, ...properties } : properties;
1050
1081
  store.enterWith(base.setValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY, merged));
1051
- } catch (e4) {
1082
+ } catch (e5) {
1052
1083
  }
1053
1084
  }
1054
1085
  function setUser(user) {
@@ -1143,7 +1174,7 @@ function withServiceName(name, fn, thisArg) {
1143
1174
  }
1144
1175
  function resolveServiceNameFromContext() {
1145
1176
  const props = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1146
- return _optionalChain([props, 'optionalAccess', _56 => _56[_chunkRV7JIIDGcjs.SERVICE_NAME]]);
1177
+ return _optionalChain([props, 'optionalAccess', _57 => _57[_chunkRV7JIIDGcjs.SERVICE_NAME]]);
1147
1178
  }
1148
1179
  function userProperties(user) {
1149
1180
  const properties = { [_chunkRV7JIIDGcjs.USER_ID]: user.id };
@@ -1210,7 +1241,7 @@ function withMessageId(id, fn, thisArg) {
1210
1241
  }
1211
1242
  function inheritedMuteTools() {
1212
1243
  const properties = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1213
- return _optionalChain([properties, 'optionalAccess', _57 => _57[_chunkRV7JIIDGcjs.MUTE_TOOLS]]);
1244
+ return _optionalChain([properties, 'optionalAccess', _58 => _58[_chunkRV7JIIDGcjs.MUTE_TOOLS]]);
1214
1245
  }
1215
1246
  function muteProperties(options) {
1216
1247
  const { input = true, output = true, tools = output } = options;
@@ -1372,7 +1403,7 @@ var Session = (_class2 = class {
1372
1403
  * (free-form category, defaults to `'generic'`)
1373
1404
  */
1374
1405
  addExternalLink(url, options) {
1375
- emitExternalLink(this.sessionId, url, _optionalChain([options, 'optionalAccess', _58 => _58.title]), _optionalChain([options, 'optionalAccess', _59 => _59.linkType]));
1406
+ emitExternalLink(this.sessionId, url, _optionalChain([options, 'optionalAccess', _59 => _59.title]), _optionalChain([options, 'optionalAccess', _60 => _60.linkType]));
1376
1407
  }
1377
1408
  }, _class2);
1378
1409
  var SessionTitle = class {
@@ -1398,11 +1429,11 @@ function resolveSessionIdFromContext() {
1398
1429
  return active.sessionId;
1399
1430
  }
1400
1431
  const props = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1401
- return _optionalChain([props, 'optionalAccess', _60 => _60[_chunkRV7JIIDGcjs.SESSION_ID]]);
1432
+ return _optionalChain([props, 'optionalAccess', _61 => _61[_chunkRV7JIIDGcjs.SESSION_ID]]);
1402
1433
  }
1403
1434
  function resolveMessageIdFromContext() {
1404
1435
  const props = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1405
- return _optionalChain([props, 'optionalAccess', _61 => _61[_chunkRV7JIIDGcjs.MESSAGE_ID]]);
1436
+ return _optionalChain([props, 'optionalAccess', _62 => _62[_chunkRV7JIIDGcjs.MESSAGE_ID]]);
1406
1437
  }
1407
1438
  function emitExternalLink(sessionId, url, title, linkType) {
1408
1439
  try {
@@ -1416,30 +1447,30 @@ function emitExternalLink(sessionId, url, title, linkType) {
1416
1447
  }
1417
1448
  }
1418
1449
  function addExternalLink(url, options) {
1419
- const sessionId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _62 => _62.sessionId]), () => ( resolveSessionIdFromContext()));
1450
+ const sessionId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _63 => _63.sessionId]), () => ( resolveSessionIdFromContext()));
1420
1451
  if (!sessionId) {
1421
1452
  _chunkWC573FCIcjs.logger.warn(
1422
1453
  "addExternalLink called without a resolvable session id; link dropped. Pass options.sessionId or call inside a startSession/callWithSessionId scope."
1423
1454
  );
1424
1455
  return;
1425
1456
  }
1426
- emitExternalLink(sessionId, url, _optionalChain([options, 'optionalAccess', _63 => _63.title]), _optionalChain([options, 'optionalAccess', _64 => _64.linkType]));
1457
+ emitExternalLink(sessionId, url, _optionalChain([options, 'optionalAccess', _64 => _64.title]), _optionalChain([options, 'optionalAccess', _65 => _65.linkType]));
1427
1458
  }
1428
1459
  function recordFeedback(type, options) {
1429
1460
  const eventAttributes = { [_chunkRV7JIIDGcjs.FEEDBACK_TYPE]: type };
1430
- if (_optionalChain([options, 'optionalAccess', _65 => _65.score]) !== void 0) {
1461
+ if (_optionalChain([options, 'optionalAccess', _66 => _66.score]) !== void 0) {
1431
1462
  eventAttributes[_chunkRV7JIIDGcjs.FEEDBACK_SCORE] = options.score;
1432
1463
  }
1433
- if (_optionalChain([options, 'optionalAccess', _66 => _66.reason]) !== void 0) {
1464
+ if (_optionalChain([options, 'optionalAccess', _67 => _67.reason]) !== void 0) {
1434
1465
  eventAttributes[_chunkRV7JIIDGcjs.FEEDBACK_REASON] = options.reason;
1435
1466
  }
1436
- if (_optionalChain([options, 'optionalAccess', _67 => _67.comment]) !== void 0) {
1467
+ if (_optionalChain([options, 'optionalAccess', _68 => _68.comment]) !== void 0) {
1437
1468
  eventAttributes[_chunkRV7JIIDGcjs.FEEDBACK_COMMENT] = options.comment;
1438
1469
  }
1439
- if (_optionalChain([options, 'optionalAccess', _68 => _68.source]) !== void 0) {
1470
+ if (_optionalChain([options, 'optionalAccess', _69 => _69.source]) !== void 0) {
1440
1471
  eventAttributes[_chunkRV7JIIDGcjs.FEEDBACK_SOURCE] = options.source;
1441
1472
  }
1442
- if (_optionalChain([options, 'optionalAccess', _69 => _69.attributes])) {
1473
+ if (_optionalChain([options, 'optionalAccess', _70 => _70.attributes])) {
1443
1474
  for (const [key, value] of Object.entries(options.attributes)) {
1444
1475
  const k = `${_chunkRV7JIIDGcjs.FEEDBACK_ATTR_PREFIX}${key}`;
1445
1476
  if (eventAttributes[k] === void 0) {
@@ -1447,8 +1478,8 @@ function recordFeedback(type, options) {
1447
1478
  }
1448
1479
  }
1449
1480
  }
1450
- const messageId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _70 => _70.messageId]), () => ( resolveMessageIdFromContext()));
1451
- const sessionId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _71 => _71.sessionId]), () => ( resolveSessionIdFromContext()));
1481
+ const messageId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _71 => _71.messageId]), () => ( resolveMessageIdFromContext()));
1482
+ const sessionId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _72 => _72.sessionId]), () => ( resolveSessionIdFromContext()));
1452
1483
  if (messageId === void 0 && sessionId === void 0) {
1453
1484
  _chunkWC573FCIcjs.logger.warn(
1454
1485
  "recordFeedback called with no resolvable message id or session id; the feedback cannot be attributed to a message or conversation. Pass options.messageId / options.sessionId or call inside a startSession/callWithMessageId scope."
@@ -1479,7 +1510,7 @@ function recordMetric(options) {
1479
1510
  try {
1480
1511
  recordMetricImpl(options);
1481
1512
  } catch (error) {
1482
- _chunkWC573FCIcjs.logger.warn(`recordMetric(${JSON.stringify(_optionalChain([options, 'optionalAccess', _72 => _72.name]))}) failed; metric dropped.`, error);
1513
+ _chunkWC573FCIcjs.logger.warn(`recordMetric(${JSON.stringify(_optionalChain([options, 'optionalAccess', _73 => _73.name]))}) failed; metric dropped.`, error);
1483
1514
  }
1484
1515
  }
1485
1516
  function recordMetricImpl(options) {
@@ -1599,7 +1630,7 @@ function recordMetricImpl(options) {
1599
1630
  eventAttributes[_chunkRV7JIIDGcjs.METRIC_TRACE_ID] = traceId;
1600
1631
  }
1601
1632
  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()]);
1633
+ const spanContext = _optionalChain([_api.trace, 'access', _74 => _74.getActiveSpan, 'call', _75 => _75(), 'optionalAccess', _76 => _76.spanContext, 'call', _77 => _77()]);
1603
1634
  if (!spanContext || !_api.isSpanContextValid.call(void 0, spanContext)) {
1604
1635
  _chunkWC573FCIcjs.logger.warn(
1605
1636
  `recordMetric(${name}) called with scope 'trace' but no trace; metric dropped. Pass options.traceId, or call inside the span of the trace being scored.`
@@ -1637,7 +1668,7 @@ function recordMetricImpl(options) {
1637
1668
  }
1638
1669
  }
1639
1670
  function startSession(sessionId, callback, extraProperties, options) {
1640
- const isTitle = _optionalChain([options, 'optionalAccess', _77 => _77.mode]) === "title";
1671
+ const isTitle = _optionalChain([options, 'optionalAccess', _78 => _78.mode]) === "title";
1641
1672
  const spanName = isTitle ? _chunkRV7JIIDGcjs.SESSION_TITLE_SPAN_NAME : _chunkRV7JIIDGcjs.SESSION_SPAN_NAME;
1642
1673
  const tracer = _api.trace.getTracer("@brizz/sdk");
1643
1674
  return tracer.startActiveSpan(spanName, (span) => {
@@ -1686,7 +1717,7 @@ function startSession(sessionId, callback, extraProperties, options) {
1686
1717
  });
1687
1718
  }
1688
1719
  function startSessionTitle(callback, options) {
1689
- const resolvedSessionId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _78 => _78.sessionId]), () => ( _optionalChain([getActiveSession, 'call', _79 => _79(), 'optionalAccess', _80 => _80.sessionId])));
1720
+ const resolvedSessionId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _79 => _79.sessionId]), () => ( _optionalChain([getActiveSession, 'call', _80 => _80(), 'optionalAccess', _81 => _81.sessionId])));
1690
1721
  const tracer = _api.trace.getTracer("@brizz/sdk");
1691
1722
  return tracer.startActiveSpan(_chunkRV7JIIDGcjs.SESSION_TITLE_SPAN_NAME, (span) => {
1692
1723
  if (resolvedSessionId) {
@@ -2158,7 +2189,7 @@ var BrizzSimpleLogRecordProcessor = class extends _sdklogs.SimpleLogRecordProces
2158
2189
  this.config = config;
2159
2190
  }
2160
2191
  onEmit(logRecord) {
2161
- const maskingConfig = _optionalChain([this, 'access', _81 => _81.config, 'access', _82 => _82.masking, 'optionalAccess', _83 => _83.eventMasking]);
2192
+ const maskingConfig = _optionalChain([this, 'access', _82 => _82.config, 'access', _83 => _83.masking, 'optionalAccess', _84 => _84.eventMasking]);
2162
2193
  if (maskingConfig) {
2163
2194
  maskLog(logRecord, maskingConfig);
2164
2195
  }
@@ -2178,7 +2209,7 @@ var BrizzBatchLogRecordProcessor = class extends _sdklogs.BatchLogRecordProcesso
2178
2209
  this.config = config;
2179
2210
  }
2180
2211
  onEmit(logRecord) {
2181
- const maskingConfig = _optionalChain([this, 'access', _84 => _84.config, 'access', _85 => _85.masking, 'optionalAccess', _86 => _86.eventMasking]);
2212
+ const maskingConfig = _optionalChain([this, 'access', _85 => _85.config, 'access', _86 => _86.masking, 'optionalAccess', _87 => _87.eventMasking]);
2182
2213
  if (maskingConfig) {
2183
2214
  maskLog(logRecord, maskingConfig);
2184
2215
  }
@@ -2279,14 +2310,14 @@ var LoggingModule = (_class3 = class _LoggingModule {constructor() { _class3.pro
2279
2310
  _chunkWC573FCIcjs.logger.debug("Creating logger provider", {
2280
2311
  serviceName,
2281
2312
  disableBatch: config.disableBatch,
2282
- hasMasking: !!_optionalChain([config, 'access', _87 => _87.masking, 'optionalAccess', _88 => _88.eventMasking])
2313
+ hasMasking: !!_optionalChain([config, 'access', _88 => _88.masking, 'optionalAccess', _89 => _89.eventMasking])
2283
2314
  });
2284
2315
  const exporter = this.createLogExporter(config, serviceName);
2285
2316
  const processor = config.disableBatch ? new BrizzSimpleLogRecordProcessor(exporter, config) : new BrizzBatchLogRecordProcessor(exporter, config);
2286
2317
  const resourceAttributes = {
2287
2318
  ...config.resourceAttributes,
2288
2319
  "service.name": serviceName,
2289
- [BRIZZ_SDK_VERSION]: _chunkJSTTHMQ3cjs.getSDKVersion.call(void 0, ),
2320
+ [BRIZZ_SDK_VERSION]: _chunk2T7OEV33cjs.getSDKVersion.call(void 0, ),
2290
2321
  [BRIZZ_SDK_LANGUAGE]: SDK_LANGUAGE
2291
2322
  };
2292
2323
  if (config.environment) {
@@ -2535,7 +2566,7 @@ var BrizzSpanExporter = (_class5 = class {
2535
2566
  const resourceAttrs = {
2536
2567
  ...config.resourceAttributes,
2537
2568
  "service.name": config.appName,
2538
- [BRIZZ_SDK_VERSION]: _chunkJSTTHMQ3cjs.getSDKVersion.call(void 0, ),
2569
+ [BRIZZ_SDK_VERSION]: _chunk2T7OEV33cjs.getSDKVersion.call(void 0, ),
2539
2570
  [BRIZZ_SDK_LANGUAGE]: SDK_LANGUAGE
2540
2571
  };
2541
2572
  if (config.environment) {
@@ -2662,8 +2693,8 @@ var BrizzSpanExporter = (_class5 = class {
2662
2693
  }
2663
2694
  async forceFlush() {
2664
2695
  await Promise.all([
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()]))
2696
+ _optionalChain([this, 'access', _90 => _90._delegate, 'access', _91 => _91.forceFlush, 'optionalCall', _92 => _92()]),
2697
+ ...[...this._delegates.values()].map(async (delegate) => _optionalChain([delegate, 'access', _93 => _93.forceFlush, 'optionalCall', _94 => _94()]))
2667
2698
  ]);
2668
2699
  }
2669
2700
  }, _class5);
@@ -2718,7 +2749,7 @@ var BrizzSimpleSpanProcessor = class extends _sdktracebase.SimpleSpanProcessor {
2718
2749
  }
2719
2750
  onEnd(span) {
2720
2751
  restampLangChainSpan(span);
2721
- const maskingConfig = _optionalChain([this, 'access', _94 => _94.config, 'access', _95 => _95.masking, 'optionalAccess', _96 => _96.spanMasking]);
2752
+ const maskingConfig = _optionalChain([this, 'access', _95 => _95.config, 'access', _96 => _96.masking, 'optionalAccess', _97 => _97.spanMasking]);
2722
2753
  if (maskingConfig) {
2723
2754
  maskReadableSpan(span, maskingConfig);
2724
2755
  }
@@ -2737,7 +2768,7 @@ var BrizzBatchSpanProcessor = class extends _sdktracebase.BatchSpanProcessor {
2737
2768
  }
2738
2769
  onEnd(span) {
2739
2770
  restampLangChainSpan(span);
2740
- const maskingConfig = _optionalChain([this, 'access', _97 => _97.config, 'access', _98 => _98.masking, 'optionalAccess', _99 => _99.spanMasking]);
2771
+ const maskingConfig = _optionalChain([this, 'access', _98 => _98.config, 'access', _99 => _99.masking, 'optionalAccess', _100 => _100.spanMasking]);
2741
2772
  if (maskingConfig) {
2742
2773
  maskReadableSpan(span, maskingConfig);
2743
2774
  }
@@ -2754,7 +2785,7 @@ function maskReadableSpan(span, config) {
2754
2785
  for (const [k, v] of Object.entries(attrs)) {
2755
2786
  masked[k] = v;
2756
2787
  }
2757
- if (_optionalChain([config, 'access', _100 => _100.rules, 'optionalAccess', _101 => _101.length])) {
2788
+ if (_optionalChain([config, 'access', _101 => _101.rules, 'optionalAccess', _102 => _102.length])) {
2758
2789
  masked = maskAttributes(masked, config.rules);
2759
2790
  }
2760
2791
  if (!config.disableDefaultRules) {
@@ -2826,7 +2857,7 @@ var TracingModule = (_class6 = class _TracingModule {constructor() { _class6.pro
2826
2857
  }
2827
2858
  _chunkWC573FCIcjs.logger.debug("Initializing span processor", {
2828
2859
  disableBatch: config.disableBatch,
2829
- hasMasking: !!_optionalChain([config, 'access', _102 => _102.masking, 'optionalAccess', _103 => _103.spanMasking])
2860
+ hasMasking: !!_optionalChain([config, 'access', _103 => _103.masking, 'optionalAccess', _104 => _104.spanMasking])
2830
2861
  });
2831
2862
  const spanProcessor = config.disableBatch ? new BrizzSimpleSpanProcessor(this.spanExporter, config) : new BrizzBatchSpanProcessor(this.spanExporter, config);
2832
2863
  _chunkWC573FCIcjs.logger.debug("Span processor initialized successfully");
@@ -2913,7 +2944,7 @@ function currentTraceparent() {
2913
2944
  const carrier = {};
2914
2945
  try {
2915
2946
  _api.propagation.inject(_api.context.active(), carrier);
2916
- } catch (e5) {
2947
+ } catch (e6) {
2917
2948
  }
2918
2949
  return _nullishCoalesce(carrier["traceparent"], () => ( ""));
2919
2950
  }
@@ -2936,7 +2967,7 @@ function decodeToken(token) {
2936
2967
  try {
2937
2968
  const payload = JSON.parse(Buffer.from(token, "base64url").toString("utf8"));
2938
2969
  return payload.id ? payload : void 0;
2939
- } catch (e6) {
2970
+ } catch (e7) {
2940
2971
  return void 0;
2941
2972
  }
2942
2973
  }
@@ -2974,7 +3005,7 @@ function resolveAgent(agent) {
2974
3005
  if (decoded.traceparent) {
2975
3006
  try {
2976
3007
  parentContext = _api.propagation.extract(parentContext, { traceparent: decoded.traceparent });
2977
- } catch (e7) {
3008
+ } catch (e8) {
2978
3009
  }
2979
3010
  }
2980
3011
  }
@@ -3046,7 +3077,7 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
3046
3077
  */
3047
3078
  setupInstrumentation(options) {
3048
3079
  const registry = InstrumentationRegistry.getInstance();
3049
- _chunkJSTTHMQ3cjs.configure.call(void 0, resolveMcpSessionTracking(options.mcpSessionTracking));
3080
+ _chunk2T7OEV33cjs.configure.call(void 0, resolveMcpSessionTracking(options.mcpSessionTracking));
3050
3081
  patchInstalledCallbackManager();
3051
3082
  patchInstalledLangGraph();
3052
3083
  if (options.instrumentModules && Object.keys(options.instrumentModules).length > 0) {
@@ -3071,7 +3102,7 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
3071
3102
  const resourceAttributes = {
3072
3103
  ...resolvedConfig.resourceAttributes,
3073
3104
  "service.name": resolvedConfig.appName,
3074
- [BRIZZ_SDK_VERSION]: _chunkJSTTHMQ3cjs.getSDKVersion.call(void 0, ),
3105
+ [BRIZZ_SDK_VERSION]: _chunk2T7OEV33cjs.getSDKVersion.call(void 0, ),
3075
3106
  [BRIZZ_SDK_LANGUAGE]: SDK_LANGUAGE
3076
3107
  };
3077
3108
  if (resolvedConfig.environment) {
@@ -3141,19 +3172,19 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
3141
3172
  try {
3142
3173
  const tracingModule = TracingModule.getInstance();
3143
3174
  await tracingModule.shutdown();
3144
- } catch (e8) {
3175
+ } catch (e9) {
3145
3176
  _chunkWC573FCIcjs.logger.debug("Tracing module already shut down or not initialized");
3146
3177
  }
3147
3178
  try {
3148
3179
  const metricsModule = MetricsModule.getInstance();
3149
3180
  metricsModule.shutdown();
3150
- } catch (e9) {
3181
+ } catch (e10) {
3151
3182
  _chunkWC573FCIcjs.logger.debug("Metrics module already shut down or not initialized");
3152
3183
  }
3153
3184
  try {
3154
3185
  const loggingModule = LoggingModule.getInstance();
3155
3186
  await loggingModule.shutdown();
3156
- } catch (e10) {
3187
+ } catch (e11) {
3157
3188
  _chunkWC573FCIcjs.logger.debug("Logging module already shut down or not initialized");
3158
3189
  }
3159
3190
  _chunkWC573FCIcjs.logger.info("All telemetry modules shut down successfully");
@@ -3219,10 +3250,10 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
3219
3250
  }
3220
3251
  try {
3221
3252
  await this.shutdownModules();
3222
- await _optionalChain([this, 'access', _104 => _104._tracerProvider, 'optionalAccess', _105 => _105.forceFlush, 'call', _106 => _106()]);
3223
- await _optionalChain([this, 'access', _107 => _107._tracerProvider, 'optionalAccess', _108 => _108.shutdown, 'call', _109 => _109()]);
3224
- await _optionalChain([this, 'access', _110 => _110._meterProvider, 'optionalAccess', _111 => _111.forceFlush, 'call', _112 => _112()]);
3225
- await _optionalChain([this, 'access', _113 => _113._meterProvider, 'optionalAccess', _114 => _114.shutdown, 'call', _115 => _115()]);
3253
+ await _optionalChain([this, 'access', _105 => _105._tracerProvider, 'optionalAccess', _106 => _106.forceFlush, 'call', _107 => _107()]);
3254
+ await _optionalChain([this, 'access', _108 => _108._tracerProvider, 'optionalAccess', _109 => _109.shutdown, 'call', _110 => _110()]);
3255
+ await _optionalChain([this, 'access', _111 => _111._meterProvider, 'optionalAccess', _112 => _112.forceFlush, 'call', _113 => _113()]);
3256
+ await _optionalChain([this, 'access', _114 => _114._meterProvider, 'optionalAccess', _115 => _115.shutdown, 'call', _116 => _116()]);
3226
3257
  this._initialized = false;
3227
3258
  this._tracerProvider = null;
3228
3259
  this._meterProvider = null;
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  configure,
7
7
  getSDKVersion
8
- } from "./chunk-G6GTIFEQ.js";
8
+ } from "./chunk-W7VSQ4KQ.js";
9
9
  import {
10
10
  DEFAULT_LOG_LEVEL,
11
11
  LogLevel,
@@ -468,7 +468,7 @@ function loadGenAIInstrumentations() {
468
468
  function loadMCPInstrumentation() {
469
469
  void (async () => {
470
470
  try {
471
- const { MCPInstrumentation } = await import("./mcp-2ZFV5BK5.js");
471
+ const { MCPInstrumentation } = await import("./mcp-TOZFTC5Y.js");
472
472
  const mcp = new MCPInstrumentation({ exceptionLogger });
473
473
  registerInstrumentations({ instrumentations: [mcp] });
474
474
  logger.debug("Auto-loaded MCP instrumentation");
@@ -753,6 +753,9 @@ var OMITTED_KEYS = /* @__PURE__ */ new Set([
753
753
  ORGANIZATION_NAME,
754
754
  ORGANIZATION_DOMAIN
755
755
  ]);
756
+ var TOOL_CALL_ID_METADATA_KEY = "brizz_tool_call_id";
757
+ var TOOL_ID = "tool.id";
758
+ var TOOL_CALL_ID_ARG = 7;
756
759
  function runMetadataFromContext() {
757
760
  const bag = context2.active().getValue(PROPERTIES_CONTEXT_KEY);
758
761
  if (!bag) {
@@ -792,9 +795,32 @@ function patchCallbackManagerModule(module2) {
792
795
  }
793
796
  return manager;
794
797
  };
798
+ patchToolStart(statics["prototype"]);
795
799
  statics[PATCHED_MARKER] = true;
796
800
  return true;
797
801
  }
802
+ function patchToolStart(prototype) {
803
+ const proto = prototype;
804
+ const original = proto?.["handleToolStart"];
805
+ if (!proto || typeof original !== "function") {
806
+ return;
807
+ }
808
+ const handleToolStart = original;
809
+ proto["handleToolStart"] = function(...args) {
810
+ try {
811
+ const toolCallId = args[TOOL_CALL_ID_ARG];
812
+ if (typeof toolCallId === "string" && toolCallId !== "") {
813
+ this.addMetadata({ [TOOL_CALL_ID_METADATA_KEY]: toolCallId }, false);
814
+ } else if (this.metadata && TOOL_CALL_ID_METADATA_KEY in this.metadata) {
815
+ const rest = { ...this.metadata };
816
+ delete rest[TOOL_CALL_ID_METADATA_KEY];
817
+ this.metadata = rest;
818
+ }
819
+ } catch {
820
+ }
821
+ return handleToolStart.apply(this, args);
822
+ };
823
+ }
798
824
  function patchInstalledCallbackManager() {
799
825
  void (async () => {
800
826
  try {
@@ -818,18 +844,23 @@ function restampLangChainSpan(span) {
818
844
  }
819
845
  const attrs = span.attributes;
820
846
  const metadata = attrs["metadata"];
821
- if (typeof metadata !== "string" || !metadata.includes(`"${BRIZZ}.`)) {
847
+ if (typeof metadata !== "string" || !metadata.includes(`"${BRIZZ}.`) && !metadata.includes(`"${TOOL_CALL_ID_METADATA_KEY}"`)) {
822
848
  return;
823
849
  }
824
850
  const parsed = JSON.parse(metadata);
825
851
  if (typeof parsed !== "object" || parsed === null) {
826
852
  return;
827
853
  }
828
- for (const [key, value] of Object.entries(parsed)) {
854
+ const entries = parsed;
855
+ for (const [key, value] of Object.entries(entries)) {
829
856
  if (key.startsWith(`${BRIZZ}.`) && value !== null && value !== void 0) {
830
857
  attrs[key] = String(value);
831
858
  }
832
859
  }
860
+ const toolCallId = entries[TOOL_CALL_ID_METADATA_KEY];
861
+ if (typeof toolCallId === "string" && toolCallId !== "" && attrs[TOOL_ID] === void 0) {
862
+ attrs[TOOL_ID] = toolCallId;
863
+ }
833
864
  } catch (error) {
834
865
  logger.debug("Skipped LangChain span re-stamp", { err: error });
835
866
  }
@@ -964,7 +995,7 @@ var InstrumentationRegistry = class _InstrumentationRegistry {
964
995
  const mcpModules = this.manualModules.mcp;
965
996
  void (async () => {
966
997
  try {
967
- const { MCPInstrumentation } = await import("./mcp-2ZFV5BK5.js");
998
+ const { MCPInstrumentation } = await import("./mcp-TOZFTC5Y.js");
968
999
  const instrumentation = new MCPInstrumentation({ exceptionLogger: exceptionLogger2 });
969
1000
  instrumentation.manuallyInstrument(mcpModules);
970
1001
  logger.debug("Manual instrumentation enabled for MCP");
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkJSTTHMQ3cjs = require('./chunk-JSTTHMQ3.cjs');
11
+ var _chunk2T7OEV33cjs = require('./chunk-2T7OEV33.cjs');
12
12
 
13
13
 
14
14
  var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
@@ -387,14 +387,14 @@ function wrapOnRequest(original, tracer) {
387
387
  return original.apply(this, args);
388
388
  }
389
389
  const method = request.method;
390
- if (method === METHOD_TOOLS_CALL && _chunkJSTTHMQ3cjs.isSessionToolCall.call(void 0, request)) {
390
+ if (method === METHOD_TOOLS_CALL && _chunk2T7OEV33cjs.isSessionToolCall.call(void 0, request)) {
391
391
  return answerSessionToolCall(this, request, tracer, args, original);
392
392
  }
393
393
  const handler = _nullishCoalesce(handlers.get(method), () => ( this.fallbackRequestHandler));
394
394
  if (!handler) {
395
395
  return original.apply(this, args);
396
396
  }
397
- const tracking = _chunkJSTTHMQ3cjs.isEnabled.call(void 0, ) && method === METHOD_TOOLS_CALL ? _chunkJSTTHMQ3cjs.popTrackingArguments.call(void 0, request) : {};
397
+ const tracking = _chunk2T7OEV33cjs.isEnabled.call(void 0, ) && method === METHOD_TOOLS_CALL ? _chunk2T7OEV33cjs.popTrackingArguments.call(void 0, request) : {};
398
398
  const started = safeStartServerSpan(tracer, request, this, tracking);
399
399
  if (!started) {
400
400
  return original.apply(this, args);
@@ -404,9 +404,9 @@ function wrapOnRequest(original, tracer) {
404
404
  if (method === METHOD_TOOLS_LIST) {
405
405
  hooks.onResult = (result) => {
406
406
  let advertised = result;
407
- if (_chunkJSTTHMQ3cjs.isEnabled.call(void 0, )) {
407
+ if (_chunk2T7OEV33cjs.isEnabled.call(void 0, )) {
408
408
  try {
409
- advertised = _chunkJSTTHMQ3cjs.patchListToolsResult.call(void 0, result);
409
+ advertised = _chunk2T7OEV33cjs.patchListToolsResult.call(void 0, result);
410
410
  } catch (error) {
411
411
  _chunkWC573FCIcjs.logger.warn(
412
412
  `Brizz MCP: failed to patch tools/list schemas: ${String(error)}`
@@ -417,7 +417,7 @@ function wrapOnRequest(original, tracer) {
417
417
  try {
418
418
  emitSchemaSpansFromListResponse(
419
419
  advertised,
420
- _chunkJSTTHMQ3cjs.resolveTransportSessionId.call(void 0, this),
420
+ _chunk2T7OEV33cjs.resolveTransportSessionId.call(void 0, this),
421
421
  tracer
422
422
  );
423
423
  } catch (error) {
@@ -430,7 +430,7 @@ function wrapOnRequest(original, tracer) {
430
430
  }
431
431
  if (method !== METHOD_TOOLS_CALL) {
432
432
  hooks.onError = () => {
433
- _chunkJSTTHMQ3cjs.stampAndPropagateSession.call(void 0, span, _chunkJSTTHMQ3cjs.resolveSessionId.call(void 0, this, spanCtx), spanCtx);
433
+ _chunk2T7OEV33cjs.stampAndPropagateSession.call(void 0, span, _chunk2T7OEV33cjs.resolveSessionId.call(void 0, this, spanCtx), spanCtx);
434
434
  };
435
435
  }
436
436
  const wrappedHandler = (req, extra) => _api.context.with(
@@ -464,7 +464,7 @@ function answerSessionToolCall(protocol, request, tracer, args, original) {
464
464
  if (!handlers) {
465
465
  return original.apply(protocol, args);
466
466
  }
467
- const { id, result } = _chunkJSTTHMQ3cjs.sessionToolResult.call(void 0, );
467
+ const { id, result } = _chunk2T7OEV33cjs.sessionToolResult.call(void 0, );
468
468
  const started = safeStartServerSpan(tracer, request, protocol, { sessionId: id });
469
469
  const handler = () => started ? _api.context.with(started.spanCtx, () => result) : result;
470
470
  const hadEntry = handlers.has(METHOD_TOOLS_CALL);
@@ -554,8 +554,8 @@ function safeStartServerSpan(tracer, request, protocol, tracking = {}) {
554
554
  parentCtx
555
555
  );
556
556
  applyServerRequestAttributes(span, request, protocol);
557
- const resolved = request.method === METHOD_TOOLS_CALL ? _nullishCoalesce(tracking.sessionId, () => ( _chunkJSTTHMQ3cjs.resolveSessionId.call(void 0, protocol, parentCtx))) : void 0;
558
- const { context: sessCtx } = _chunkJSTTHMQ3cjs.stampAndPropagateSession.call(void 0,
557
+ const resolved = request.method === METHOD_TOOLS_CALL ? _nullishCoalesce(tracking.sessionId, () => ( _chunk2T7OEV33cjs.resolveSessionId.call(void 0, protocol, parentCtx))) : void 0;
558
+ const { context: sessCtx } = _chunk2T7OEV33cjs.stampAndPropagateSession.call(void 0,
559
559
  span,
560
560
  resolved,
561
561
  parentCtx,
@@ -611,7 +611,7 @@ function safeEnd(span) {
611
611
 
612
612
  // src/internal/instrumentation/mcp/version.ts
613
613
  var INSTRUMENTATION_NAME = "@brizz/sdk/mcp";
614
- var INSTRUMENTATION_VERSION = _chunkJSTTHMQ3cjs.getSDKVersion.call(void 0, );
614
+ var INSTRUMENTATION_VERSION = _chunk2T7OEV33cjs.getSDKVersion.call(void 0, );
615
615
 
616
616
  // src/internal/instrumentation/mcp/instrumentation.ts
617
617
  var PROTOCOL_MODULE_NAME = "@modelcontextprotocol/sdk/shared/protocol.js";
@@ -8,7 +8,7 @@ import {
8
8
  resolveTransportSessionId,
9
9
  sessionToolResult,
10
10
  stampAndPropagateSession
11
- } from "./chunk-G6GTIFEQ.js";
11
+ } from "./chunk-W7VSQ4KQ.js";
12
12
  import {
13
13
  logger
14
14
  } from "./chunk-Y4HNUX3Q.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brizz/sdk",
3
- "version": "0.1.51",
3
+ "version": "0.1.52",
4
4
  "type": "module",
5
5
  "description": "OpenTelemetry-based observability SDK for AI applications",
6
6
  "keywords": [
@@ -103,35 +103,35 @@
103
103
  "registry": "https://registry.npmjs.org/"
104
104
  },
105
105
  "devDependencies": {
106
- "@ai-sdk/anthropic": "^4.0.58",
107
- "@ai-sdk/openai": "^4.0.71",
108
- "@ai-sdk/otel": "^1.0.107",
106
+ "@ai-sdk/anthropic": "^4.0.78",
107
+ "@ai-sdk/openai": "^4.0.91",
108
+ "@ai-sdk/otel": "^1.0.137",
109
109
  "@arethetypeswrong/cli": "^0.18.5",
110
- "@arizeai/openinference-instrumentation-mcp": "^0.2.33",
111
- "@babel/core": "^8.0.6",
112
- "@babel/preset-env": "^8.0.6",
113
- "@babel/preset-typescript": "^8.0.1",
110
+ "@arizeai/openinference-instrumentation-mcp": "^0.2.36",
111
+ "@babel/core": "^8.0.7",
112
+ "@babel/preset-env": "^8.0.7",
113
+ "@babel/preset-typescript": "^8.0.7",
114
114
  "@changesets/changelog-github": "^1.0.1",
115
115
  "@changesets/cli": "^3.0.3",
116
- "@google/genai": "^2.23.0",
117
- "@langchain/core": "^1.2.11",
118
- "@langchain/langgraph": "^1.4.15",
119
- "@modelcontextprotocol/sdk": "^1.30.0",
116
+ "@google/genai": "^2.28.0",
117
+ "@langchain/core": "^1.2.17",
118
+ "@langchain/langgraph": "^1.4.21",
119
+ "@modelcontextprotocol/sdk": "^1.32.1",
120
120
  "@traceloop/instrumentation-google-generativeai": "^0.27.0",
121
121
  "@traceloop/instrumentation-vertexai": "^0.27.0",
122
122
  "@types/jest": "^30.0.0",
123
- "@types/node": "^26.6.2",
124
- "ai": "^7.0.107",
123
+ "@types/node": "^26.6.5",
124
+ "ai": "^7.0.137",
125
125
  "babel-jest": "^30.5.2",
126
126
  "babel-plugin-transform-import-meta": "^3.0.0",
127
127
  "jest": "^30.5.2",
128
128
  "jest-environment-jsdom": "^30.5.2",
129
- "openai": "^7.20.0",
130
- "oxlint": "^1.83.0",
131
- "prettier": "^3.9.8",
129
+ "openai": "^7.32.0",
130
+ "oxlint": "^1.87.0",
131
+ "prettier": "^3.9.10",
132
132
  "tsup": "^8.5.1",
133
133
  "typescript": "^7.0.2",
134
- "vitest": "^5.0.1",
134
+ "vitest": "^5.0.3",
135
135
  "zod": "^4.6.5"
136
136
  },
137
137
  "peerDependencies": {
@@ -175,21 +175,21 @@
175
175
  }
176
176
  },
177
177
  "dependencies": {
178
- "@arizeai/openinference-instrumentation-langchain": "^4.1.1",
178
+ "@arizeai/openinference-instrumentation-langchain": "^4.1.4",
179
179
  "@arizeai/openinference-instrumentation-openai": "^2.3.1",
180
180
  "@opentelemetry/api": "^1.9.0",
181
- "@opentelemetry/api-logs": "^0.222.0",
182
- "@opentelemetry/core": "^2.11.0",
183
- "@opentelemetry/exporter-logs-otlp-http": "^0.222.0",
184
- "@opentelemetry/exporter-metrics-otlp-http": "^0.222.0",
185
- "@opentelemetry/exporter-trace-otlp-http": "^0.222.0",
186
- "@opentelemetry/exporter-trace-otlp-proto": "^0.222.0",
187
- "@opentelemetry/instrumentation": "^0.222.0",
188
- "@opentelemetry/resources": "^2.11.0",
189
- "@opentelemetry/sdk-logs": "^0.222.0",
190
- "@opentelemetry/sdk-metrics": "^2.11.0",
191
- "@opentelemetry/sdk-trace-base": "^2.11.0",
192
- "@opentelemetry/sdk-trace-node": "^2.11.0",
181
+ "@opentelemetry/api-logs": "^0.223.0",
182
+ "@opentelemetry/core": "^2.12.0",
183
+ "@opentelemetry/exporter-logs-otlp-http": "^0.223.0",
184
+ "@opentelemetry/exporter-metrics-otlp-http": "^0.223.0",
185
+ "@opentelemetry/exporter-trace-otlp-http": "^0.223.0",
186
+ "@opentelemetry/exporter-trace-otlp-proto": "^0.223.0",
187
+ "@opentelemetry/instrumentation": "^0.223.0",
188
+ "@opentelemetry/resources": "^2.12.0",
189
+ "@opentelemetry/sdk-logs": "^0.223.0",
190
+ "@opentelemetry/sdk-metrics": "^2.12.0",
191
+ "@opentelemetry/sdk-trace-base": "^2.12.0",
192
+ "@opentelemetry/sdk-trace-node": "^2.12.0",
193
193
  "@opentelemetry/semantic-conventions": "^1.43.0",
194
194
  "@traceloop/ai-semantic-conventions": "^0.27.0",
195
195
  "@traceloop/instrumentation-anthropic": "^0.27.0",
@@ -200,15 +200,15 @@
200
200
  "@traceloop/instrumentation-pinecone": "^0.27.0",
201
201
  "@traceloop/instrumentation-qdrant": "^0.27.0",
202
202
  "@traceloop/instrumentation-together": "^0.27.0",
203
- "pino": "^10.3.1",
204
- "pino-pretty": "^13.1.3",
203
+ "pino": "^10.4.0",
204
+ "pino-pretty": "^13.2.0",
205
205
  "tslib": "^2.8.1"
206
206
  },
207
207
  "packageManager": "pnpm@10.17.0+sha512.fce8a3dd29a4ed2ec566fb53efbb04d8c44a0f05bc6f24a73046910fb9c3ce7afa35a0980500668fa3573345bd644644fa98338fa168235c80f4aa17aa17fbef",
208
208
  "pnpm": {
209
209
  "overrides": {
210
- "@babel/core": "^8.0.1",
211
- "@opentelemetry/core": "^2.11.0"
210
+ "@babel/core": "^8.0.7",
211
+ "@opentelemetry/core": "^2.12.0"
212
212
  },
213
213
  "updateConfig": {
214
214
  "ignoreDependencies": [