@brizz/sdk 0.2.0 → 0.2.1

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 (45) hide show
  1. package/CHANGELOG.md +430 -0
  2. package/LICENSE +194 -20
  3. package/README.md +36 -1
  4. package/dist/{chunk-B5IY6O4N.js → chunk-6OYS2GR3.js} +1 -1
  5. package/dist/{chunk-WC573FCI.cjs → chunk-C5OT6GAQ.cjs} +10 -2
  6. package/dist/{chunk-Y4HNUX3Q.js → chunk-CZDPIJTO.js} +8 -0
  7. package/dist/{chunk-EZCNPWKM.js → chunk-GITAPIVL.js} +9 -9
  8. package/dist/{chunk-NF52RMLW.cjs → chunk-IWSFMCHH.cjs} +5 -1
  9. package/dist/{chunk-GISL4K6Z.js → chunk-JMX23OHO.js} +4 -0
  10. package/dist/{chunk-5HCG3JKU.js → chunk-KJSZPKSN.js} +5 -5
  11. package/dist/{chunk-RD4XCYKT.cjs → chunk-P5OONZTF.cjs} +3 -3
  12. package/dist/{chunk-CNVK5RA3.cjs → chunk-QXHGMS5A.cjs} +13 -13
  13. package/dist/{chunk-4QNEI7VZ.cjs → chunk-UF4GMVEY.cjs} +142 -142
  14. package/dist/eve.cjs +2 -3
  15. package/dist/eve.js +1 -2
  16. package/dist/google-genai-6S5E7GZ4.cjs +10 -0
  17. package/dist/{google-genai-3ERJNC7Q.js → google-genai-H6TMOKRX.js} +2 -3
  18. package/dist/google-genai.cjs +3 -4
  19. package/dist/google-genai.js +2 -3
  20. package/dist/index.cjs +590 -299
  21. package/dist/index.js +371 -80
  22. package/dist/{mcp-5ERVMLSA.cjs → mcp-6LNVYVJQ.cjs} +39 -40
  23. package/dist/{mcp-EJAJTGIC.js → mcp-YTBE75NP.js} +5 -6
  24. package/dist/session.cjs +4 -5
  25. package/dist/session.js +3 -4
  26. package/dist/types/cjs/internal/instrumentation/auto-init.d.ts +0 -7
  27. package/dist/types/cjs/internal/instrumentation/registry.d.ts +2 -0
  28. package/dist/types/cjs/internal/instrumentation/vercel-ai/index.d.ts +28 -0
  29. package/dist/types/cjs/internal/instrumentation/vercel-ai/model-call-end.d.ts +1 -0
  30. package/dist/types/cjs/internal/sdk.d.ts +1 -0
  31. package/dist/types/cjs/internal/semantic-conventions.d.ts +2 -0
  32. package/dist/types/esm/internal/instrumentation/auto-init.d.ts +0 -7
  33. package/dist/types/esm/internal/instrumentation/registry.d.ts +2 -0
  34. package/dist/types/esm/internal/instrumentation/vercel-ai/index.d.ts +28 -0
  35. package/dist/types/esm/internal/instrumentation/vercel-ai/model-call-end.d.ts +1 -0
  36. package/dist/types/esm/internal/sdk.d.ts +1 -0
  37. package/dist/types/esm/internal/semantic-conventions.d.ts +2 -0
  38. package/package.json +28 -23
  39. package/dist/chunk-3RG5ZIWI.js +0 -10
  40. package/dist/chunk-6QXPHZEO.cjs +0 -130
  41. package/dist/chunk-GABRGNAU.js +0 -130
  42. package/dist/chunk-OBGZSXTJ.cjs +0 -10
  43. package/dist/google-genai-GVCKSJMR.cjs +0 -11
  44. package/dist/interrupt-36U5562Z.cjs +0 -12
  45. package/dist/interrupt-6BSXUK3O.js +0 -12
@@ -8,20 +8,19 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkCNVK5RA3cjs = require('./chunk-CNVK5RA3.cjs');
11
+ var _chunkQXHGMS5Acjs = require('./chunk-QXHGMS5A.cjs');
12
12
 
13
13
 
14
+ var _chunkIWSFMCHHcjs = require('./chunk-IWSFMCHH.cjs');
14
15
 
15
16
 
16
17
 
17
- var _chunkDC2MFO65cjs = require('./chunk-DC2MFO65.cjs');
18
18
 
19
19
 
20
- var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
20
+ var _chunkDC2MFO65cjs = require('./chunk-DC2MFO65.cjs');
21
21
 
22
22
 
23
- var _chunkNF52RMLWcjs = require('./chunk-NF52RMLW.cjs');
24
- require('./chunk-OBGZSXTJ.cjs');
23
+ var _chunkC5OT6GAQcjs = require('./chunk-C5OT6GAQ.cjs');
25
24
 
26
25
  // src/internal/instrumentation/mcp/instrumentation.ts
27
26
  var _openinferenceinstrumentationmcp = require('@arizeai/openinference-instrumentation-mcp');
@@ -109,7 +108,7 @@ function emitSchemaSpansFromListResponse(result, transportSessionId, tracer) {
109
108
  }
110
109
  function stampSchemaAttributes(span, toolName, transportSessionId, tool) {
111
110
  if (!span.isRecording()) {
112
- _chunkWC573FCIcjs.logger.warn(
111
+ _chunkC5OT6GAQcjs.logger.warn(
113
112
  `Brizz MCP: schema span is not recording; dropping attributes for ${toolName}`
114
113
  );
115
114
  return;
@@ -242,7 +241,7 @@ function applyResultAttributes(span, method, result) {
242
241
  const content = _nullishCoalesce(_optionalChain([obj, 'optionalAccess', _8 => _8["content"]]), () => ( result));
243
242
  span.setAttribute(MCP_TOOL_RESULT, serializeForAttribute(content));
244
243
  if (obj && obj["isError"] === true) {
245
- span.setAttribute(_chunkNF52RMLWcjs.ERROR_TYPE, ERROR_TYPE_TOOL);
244
+ span.setAttribute(_chunkIWSFMCHHcjs.ERROR_TYPE, ERROR_TYPE_TOOL);
246
245
  const message = extractToolErrorMessage(obj);
247
246
  span.setStatus({ code: _api.SpanStatusCode.ERROR, message });
248
247
  }
@@ -252,13 +251,13 @@ function applyErrorAttributes(span, err) {
252
251
  const code = _optionalChain([error, 'optionalAccess', _9 => _9.code]);
253
252
  if (typeof code === "number") {
254
253
  span.setAttribute(RPC_RESPONSE_STATUS_CODE, code);
255
- span.setAttribute(_chunkNF52RMLWcjs.ERROR_TYPE, String(code));
254
+ span.setAttribute(_chunkIWSFMCHHcjs.ERROR_TYPE, String(code));
256
255
  } else if (_optionalChain([error, 'optionalAccess', _10 => _10.name]) === "AbortError") {
257
- span.setAttribute(_chunkNF52RMLWcjs.ERROR_TYPE, "cancelled");
256
+ span.setAttribute(_chunkIWSFMCHHcjs.ERROR_TYPE, "cancelled");
258
257
  } else if (_optionalChain([error, 'optionalAccess', _11 => _11.name]) === "TimeoutError") {
259
- span.setAttribute(_chunkNF52RMLWcjs.ERROR_TYPE, "timeout");
258
+ span.setAttribute(_chunkIWSFMCHHcjs.ERROR_TYPE, "timeout");
260
259
  } else {
261
- span.setAttribute(_chunkNF52RMLWcjs.ERROR_TYPE, _optionalChain([error, 'optionalAccess', _12 => _12.constructor, 'optionalAccess', _13 => _13.name]) || _optionalChain([error, 'optionalAccess', _14 => _14.name]) || "Error");
260
+ span.setAttribute(_chunkIWSFMCHHcjs.ERROR_TYPE, _optionalChain([error, 'optionalAccess', _12 => _12.constructor, 'optionalAccess', _13 => _13.name]) || _optionalChain([error, 'optionalAccess', _14 => _14.name]) || "Error");
262
261
  }
263
262
  try {
264
263
  span.recordException(error);
@@ -337,7 +336,7 @@ function patchProtocolPrototype(prototype, tracer) {
337
336
  }
338
337
  const proto = prototype;
339
338
  if (Object.hasOwn(proto, PATCHED_FLAG)) {
340
- _chunkWC573FCIcjs.logger.debug("Brizz MCP: Protocol.prototype already patched, skipping");
339
+ _chunkC5OT6GAQcjs.logger.debug("Brizz MCP: Protocol.prototype already patched, skipping");
341
340
  return false;
342
341
  }
343
342
  const originalRequest = proto["request"];
@@ -345,7 +344,7 @@ function patchProtocolPrototype(prototype, tracer) {
345
344
  if (typeof originalRequest === "function") {
346
345
  proto["request"] = wrapRequest(originalRequest, tracer);
347
346
  } else {
348
- _chunkWC573FCIcjs.logger.debug(
347
+ _chunkC5OT6GAQcjs.logger.debug(
349
348
  "Brizz MCP: Protocol.prototype.request missing \u2014 skipping CLIENT patch"
350
349
  );
351
350
  }
@@ -355,7 +354,7 @@ function patchProtocolPrototype(prototype, tracer) {
355
354
  tracer
356
355
  );
357
356
  } else {
358
- _chunkWC573FCIcjs.logger.debug(
357
+ _chunkC5OT6GAQcjs.logger.debug(
359
358
  "Brizz MCP: Protocol.prototype._onrequest missing \u2014 skipping SERVER patch"
360
359
  );
361
360
  }
@@ -396,7 +395,7 @@ function injectMetaTraceContext(request, ctx) {
396
395
  _chunkDC2MFO65cjs.injectTraceContext.call(void 0, ctx, request.params._meta);
397
396
  }
398
397
  } catch (error) {
399
- _chunkWC573FCIcjs.logger.debug(`Brizz MCP: failed to inject trace context into _meta: ${String(error)}`);
398
+ _chunkC5OT6GAQcjs.logger.debug(`Brizz MCP: failed to inject trace context into _meta: ${String(error)}`);
400
399
  }
401
400
  }
402
401
  function wrapOnRequest(original, tracer) {
@@ -410,14 +409,14 @@ function wrapOnRequest(original, tracer) {
410
409
  return original.apply(this, args);
411
410
  }
412
411
  const method = request.method;
413
- if (method === METHOD_TOOLS_CALL && _chunkCNVK5RA3cjs.isSessionToolCall.call(void 0, request)) {
412
+ if (method === METHOD_TOOLS_CALL && _chunkQXHGMS5Acjs.isSessionToolCall.call(void 0, request)) {
414
413
  return answerSessionToolCall(this, request, tracer, args, original);
415
414
  }
416
415
  const handler = _nullishCoalesce(handlers.get(method), () => ( this.fallbackRequestHandler));
417
416
  if (!handler) {
418
417
  return original.apply(this, args);
419
418
  }
420
- const tracking = _chunkCNVK5RA3cjs.isEnabled.call(void 0, ) && method === METHOD_TOOLS_CALL ? _chunkCNVK5RA3cjs.popTrackingArguments.call(void 0, request) : {};
419
+ const tracking = _chunkQXHGMS5Acjs.isEnabled.call(void 0, ) && method === METHOD_TOOLS_CALL ? _chunkQXHGMS5Acjs.popTrackingArguments.call(void 0, request) : {};
421
420
  const started = safeStartServerSpan(tracer, request, this, tracking);
422
421
  if (!started) {
423
422
  return original.apply(this, args);
@@ -427,11 +426,11 @@ function wrapOnRequest(original, tracer) {
427
426
  if (method === METHOD_TOOLS_LIST) {
428
427
  hooks.onResult = (result) => {
429
428
  let advertised = result;
430
- if (_chunkCNVK5RA3cjs.isEnabled.call(void 0, )) {
429
+ if (_chunkQXHGMS5Acjs.isEnabled.call(void 0, )) {
431
430
  try {
432
- advertised = _chunkCNVK5RA3cjs.patchListToolsResult.call(void 0, result);
431
+ advertised = _chunkQXHGMS5Acjs.patchListToolsResult.call(void 0, result);
433
432
  } catch (error) {
434
- _chunkWC573FCIcjs.logger.warn(
433
+ _chunkC5OT6GAQcjs.logger.warn(
435
434
  `Brizz MCP: failed to patch tools/list schemas: ${String(error)}`
436
435
  );
437
436
  advertised = result;
@@ -440,11 +439,11 @@ function wrapOnRequest(original, tracer) {
440
439
  try {
441
440
  emitSchemaSpansFromListResponse(
442
441
  advertised,
443
- _chunkCNVK5RA3cjs.resolveTransportSessionId.call(void 0, this),
442
+ _chunkQXHGMS5Acjs.resolveTransportSessionId.call(void 0, this),
444
443
  tracer
445
444
  );
446
445
  } catch (error) {
447
- _chunkWC573FCIcjs.logger.warn(
446
+ _chunkC5OT6GAQcjs.logger.warn(
448
447
  `Brizz MCP: failed to emit tools/list schema spans: ${String(error)}`
449
448
  );
450
449
  }
@@ -453,7 +452,7 @@ function wrapOnRequest(original, tracer) {
453
452
  }
454
453
  if (method !== METHOD_TOOLS_CALL) {
455
454
  hooks.onError = () => {
456
- _chunkCNVK5RA3cjs.stampAndPropagateSession.call(void 0, span, _chunkCNVK5RA3cjs.resolveSessionId.call(void 0, this, spanCtx), spanCtx);
455
+ _chunkQXHGMS5Acjs.stampAndPropagateSession.call(void 0, span, _chunkQXHGMS5Acjs.resolveSessionId.call(void 0, this, spanCtx), spanCtx);
457
456
  };
458
457
  }
459
458
  const wrappedHandler = (req, extra) => _api.context.with(
@@ -487,7 +486,7 @@ function answerSessionToolCall(protocol, request, tracer, args, original) {
487
486
  if (!handlers) {
488
487
  return original.apply(protocol, args);
489
488
  }
490
- const { id, result } = _chunkCNVK5RA3cjs.sessionToolResult.call(void 0, );
489
+ const { id, result } = _chunkQXHGMS5Acjs.sessionToolResult.call(void 0, );
491
490
  const started = safeStartServerSpan(tracer, request, protocol, { sessionId: id });
492
491
  const handler = () => started ? _api.context.with(started.spanCtx, () => result) : result;
493
492
  const hadEntry = handlers.has(METHOD_TOOLS_CALL);
@@ -548,7 +547,7 @@ function applyResultHook(hooks, value) {
548
547
  const replaced = hooks.onResult(value);
549
548
  return replaced === void 0 ? value : replaced;
550
549
  } catch (error) {
551
- _chunkWC573FCIcjs.logger.debug(`Brizz MCP: result hook failed: ${String(error)}`);
550
+ _chunkC5OT6GAQcjs.logger.debug(`Brizz MCP: result hook failed: ${String(error)}`);
552
551
  return value;
553
552
  }
554
553
  }
@@ -563,7 +562,7 @@ function safeStartClientSpan(tracer, request, protocol) {
563
562
  );
564
563
  return span;
565
564
  } catch (error) {
566
- _chunkWC573FCIcjs.logger.debug(`Brizz MCP: failed to open CLIENT span: ${String(error)}`);
565
+ _chunkC5OT6GAQcjs.logger.debug(`Brizz MCP: failed to open CLIENT span: ${String(error)}`);
567
566
  return null;
568
567
  }
569
568
  }
@@ -577,8 +576,8 @@ function safeStartServerSpan(tracer, request, protocol, tracking = {}) {
577
576
  parentCtx
578
577
  );
579
578
  applyServerRequestAttributes(span, request, protocol);
580
- const resolved = request.method === METHOD_TOOLS_CALL ? _nullishCoalesce(tracking.sessionId, () => ( _chunkCNVK5RA3cjs.resolveSessionId.call(void 0, protocol, parentCtx))) : void 0;
581
- const { context: sessCtx } = _chunkCNVK5RA3cjs.stampAndPropagateSession.call(void 0,
579
+ const resolved = request.method === METHOD_TOOLS_CALL ? _nullishCoalesce(tracking.sessionId, () => ( _chunkQXHGMS5Acjs.resolveSessionId.call(void 0, protocol, parentCtx))) : void 0;
580
+ const { context: sessCtx } = _chunkQXHGMS5Acjs.stampAndPropagateSession.call(void 0,
582
581
  span,
583
582
  resolved,
584
583
  parentCtx,
@@ -586,7 +585,7 @@ function safeStartServerSpan(tracer, request, protocol, tracking = {}) {
586
585
  );
587
586
  return { span, spanCtx: _api.trace.setSpan(sessCtx, span) };
588
587
  } catch (error) {
589
- _chunkWC573FCIcjs.logger.debug(`Brizz MCP: failed to open SERVER span: ${String(error)}`);
588
+ _chunkC5OT6GAQcjs.logger.debug(`Brizz MCP: failed to open SERVER span: ${String(error)}`);
590
589
  return null;
591
590
  }
592
591
  }
@@ -597,7 +596,7 @@ function extractParentContext(request) {
597
596
  return _chunkDC2MFO65cjs.extractTraceContext.call(void 0, _api.context.active(), meta);
598
597
  }
599
598
  } catch (error) {
600
- _chunkWC573FCIcjs.logger.debug(
599
+ _chunkC5OT6GAQcjs.logger.debug(
601
600
  `Brizz MCP: failed to extract parent context from _meta: ${String(error)}`
602
601
  );
603
602
  }
@@ -610,7 +609,7 @@ function safeApplyResultAttributes(span, method, value) {
610
609
  try {
611
610
  applyResultAttributes(span, method, value);
612
611
  } catch (error) {
613
- _chunkWC573FCIcjs.logger.debug(
612
+ _chunkC5OT6GAQcjs.logger.debug(
614
613
  `Brizz MCP: failed to apply result attributes: ${String(error)}`
615
614
  );
616
615
  }
@@ -619,7 +618,7 @@ function safeApplyErrorAttributes(span, err) {
619
618
  try {
620
619
  applyErrorAttributes(span, err);
621
620
  } catch (error) {
622
- _chunkWC573FCIcjs.logger.debug(
621
+ _chunkC5OT6GAQcjs.logger.debug(
623
622
  `Brizz MCP: failed to apply error attributes: ${String(error)}`
624
623
  );
625
624
  }
@@ -628,13 +627,13 @@ function safeEnd(span) {
628
627
  try {
629
628
  span.end();
630
629
  } catch (error) {
631
- _chunkWC573FCIcjs.logger.debug(`Brizz MCP: failed to end span: ${String(error)}`);
630
+ _chunkC5OT6GAQcjs.logger.debug(`Brizz MCP: failed to end span: ${String(error)}`);
632
631
  }
633
632
  }
634
633
 
635
634
  // src/internal/instrumentation/mcp/version.ts
636
635
  var INSTRUMENTATION_NAME = "@brizz/sdk/mcp";
637
- var INSTRUMENTATION_VERSION = _chunkCNVK5RA3cjs.getSDKVersion.call(void 0, );
636
+ var INSTRUMENTATION_VERSION = _chunkQXHGMS5Acjs.getSDKVersion.call(void 0, );
638
637
 
639
638
  // src/internal/instrumentation/mcp/instrumentation.ts
640
639
  var PROTOCOL_MODULE_NAME = "@modelcontextprotocol/sdk/shared/protocol.js";
@@ -665,14 +664,14 @@ var MCPInstrumentation = class extends _openinferenceinstrumentationmcp.MCPInstr
665
664
  patchProtocolModule(module) {
666
665
  const proto = _optionalChain([module, 'optionalAccess', _27 => _27.Protocol, 'optionalAccess', _28 => _28.prototype]);
667
666
  if (!proto) {
668
- _chunkWC573FCIcjs.logger.debug(
667
+ _chunkC5OT6GAQcjs.logger.debug(
669
668
  "Brizz MCP: module does not expose Protocol.prototype \u2014 skipping protocol patches"
670
669
  );
671
670
  return;
672
671
  }
673
672
  const ok = patchProtocolPrototype(proto, this.brizzTracer);
674
673
  if (ok) {
675
- _chunkWC573FCIcjs.logger.debug("Brizz MCP: patched Protocol.prototype for SERVER+CLIENT spans");
674
+ _chunkC5OT6GAQcjs.logger.debug("Brizz MCP: patched Protocol.prototype for SERVER+CLIENT spans");
676
675
  }
677
676
  }
678
677
  /**
@@ -685,7 +684,7 @@ var MCPInstrumentation = class extends _openinferenceinstrumentationmcp.MCPInstr
685
684
  * at runtime, and a process reload is the canonical way to detach.
686
685
  */
687
686
  unpatchProtocolModule(_module) {
688
- _chunkWC573FCIcjs.logger.debug(
687
+ _chunkC5OT6GAQcjs.logger.debug(
689
688
  "Brizz MCP: unpatch is a no-op \u2014 reload the process to cleanly detach"
690
689
  );
691
690
  }
@@ -708,7 +707,7 @@ var MCPInstrumentation = class extends _openinferenceinstrumentationmcp.MCPInstr
708
707
  try {
709
708
  base = _nullishCoalesce(super.init(), () => ( []));
710
709
  } catch (error) {
711
- _chunkWC573FCIcjs.logger.warn(
710
+ _chunkC5OT6GAQcjs.logger.warn(
712
711
  `Brizz MCP: base Arize init() failed \u2014 transport context propagation disabled: ${String(error)}`
713
712
  );
714
713
  base = [];
@@ -758,13 +757,13 @@ var MCPInstrumentation = class extends _openinferenceinstrumentationmcp.MCPInstr
758
757
  serverStreamableHTTPModule
759
758
  });
760
759
  } catch (error) {
761
- _chunkWC573FCIcjs.logger.warn(`Brizz MCP: Arize manuallyInstrument(...) failed: ${String(error)}`);
760
+ _chunkC5OT6GAQcjs.logger.warn(`Brizz MCP: Arize manuallyInstrument(...) failed: ${String(error)}`);
762
761
  }
763
762
  if (protocolModule) {
764
763
  try {
765
764
  this.patchProtocolModule(protocolModule);
766
765
  } catch (error) {
767
- _chunkWC573FCIcjs.logger.warn(
766
+ _chunkC5OT6GAQcjs.logger.warn(
768
767
  `Brizz MCP: failed to manually patch Protocol module: ${String(error)}`
769
768
  );
770
769
  }
@@ -8,7 +8,10 @@ import {
8
8
  resolveTransportSessionId,
9
9
  sessionToolResult,
10
10
  stampAndPropagateSession
11
- } from "./chunk-5HCG3JKU.js";
11
+ } from "./chunk-KJSZPKSN.js";
12
+ import {
13
+ ERROR_TYPE
14
+ } from "./chunk-JMX23OHO.js";
12
15
  import {
13
16
  brizzTracerProvider,
14
17
  extractTraceContext,
@@ -17,11 +20,7 @@ import {
17
20
  } from "./chunk-TDPQDITP.js";
18
21
  import {
19
22
  logger
20
- } from "./chunk-Y4HNUX3Q.js";
21
- import {
22
- ERROR_TYPE
23
- } from "./chunk-GISL4K6Z.js";
24
- import "./chunk-3RG5ZIWI.js";
23
+ } from "./chunk-CZDPIJTO.js";
25
24
 
26
25
  // src/internal/instrumentation/mcp/instrumentation.ts
27
26
  import { MCPInstrumentation as BaseMCPInstrumentation } from "@arizeai/openinference-instrumentation-mcp";
package/dist/session.cjs CHANGED
@@ -32,11 +32,10 @@
32
32
 
33
33
 
34
34
 
35
- var _chunk4QNEI7VZcjs = require('./chunk-4QNEI7VZ.cjs');
35
+ var _chunkUF4GMVEYcjs = require('./chunk-UF4GMVEY.cjs');
36
+ require('./chunk-IWSFMCHH.cjs');
36
37
  require('./chunk-DC2MFO65.cjs');
37
- require('./chunk-WC573FCI.cjs');
38
- require('./chunk-NF52RMLW.cjs');
39
- require('./chunk-OBGZSXTJ.cjs');
38
+ require('./chunk-C5OT6GAQ.cjs');
40
39
 
41
40
  // src/session.ts
42
41
  var _api = require('@opentelemetry/api');
@@ -75,4 +74,4 @@ var _api = require('@opentelemetry/api');
75
74
 
76
75
 
77
76
 
78
- exports.Session = _chunk4QNEI7VZcjs.Session; exports.SessionTitle = _chunk4QNEI7VZcjs.SessionTitle; exports.SeverityNumber = _api.SeverityNumber; exports.addExternalLink = _chunk4QNEI7VZcjs.addExternalLink; exports.callWithMessageId = _chunk4QNEI7VZcjs.callWithMessageId; exports.callWithMute = _chunk4QNEI7VZcjs.callWithMute; exports.callWithOrganization = _chunk4QNEI7VZcjs.callWithOrganization; exports.callWithProperties = _chunk4QNEI7VZcjs.callWithProperties; exports.callWithServiceName = _chunk4QNEI7VZcjs.callWithServiceName; exports.callWithSessionId = _chunk4QNEI7VZcjs.callWithSessionId; exports.callWithUser = _chunk4QNEI7VZcjs.callWithUser; exports.emitEvent = _chunk4QNEI7VZcjs.emitEvent; exports.emitEventWithSessionId = _chunk4QNEI7VZcjs.emitEventWithSessionId; exports.getActiveSession = _chunk4QNEI7VZcjs.getActiveSession; exports.recordFeedback = _chunk4QNEI7VZcjs.recordFeedback; exports.recordMetric = _chunk4QNEI7VZcjs.recordMetric; exports.setAgent = _chunk4QNEI7VZcjs.setAgent; exports.setCurrentSpanCustomProperties = _chunk4QNEI7VZcjs.setCurrentSpanCustomProperties; exports.setMessageId = _chunk4QNEI7VZcjs.setMessageId; exports.setOrganization = _chunk4QNEI7VZcjs.setOrganization; exports.setServiceName = _chunk4QNEI7VZcjs.setServiceName; exports.setSessionId = _chunk4QNEI7VZcjs.setSessionId; exports.setUser = _chunk4QNEI7VZcjs.setUser; exports.startAgent = _chunk4QNEI7VZcjs.startAgent; exports.startSession = _chunk4QNEI7VZcjs.startSession; exports.startSessionTitle = _chunk4QNEI7VZcjs.startSessionTitle; exports.withAgent = _chunk4QNEI7VZcjs.withAgent; exports.withMessageId = _chunk4QNEI7VZcjs.withMessageId; exports.withMute = _chunk4QNEI7VZcjs.withMute; exports.withOrganization = _chunk4QNEI7VZcjs.withOrganization; exports.withProperties = _chunk4QNEI7VZcjs.withProperties; exports.withServiceName = _chunk4QNEI7VZcjs.withServiceName; exports.withSessionId = _chunk4QNEI7VZcjs.withSessionId; exports.withUser = _chunk4QNEI7VZcjs.withUser;
77
+ exports.Session = _chunkUF4GMVEYcjs.Session; exports.SessionTitle = _chunkUF4GMVEYcjs.SessionTitle; exports.SeverityNumber = _api.SeverityNumber; exports.addExternalLink = _chunkUF4GMVEYcjs.addExternalLink; exports.callWithMessageId = _chunkUF4GMVEYcjs.callWithMessageId; exports.callWithMute = _chunkUF4GMVEYcjs.callWithMute; exports.callWithOrganization = _chunkUF4GMVEYcjs.callWithOrganization; exports.callWithProperties = _chunkUF4GMVEYcjs.callWithProperties; exports.callWithServiceName = _chunkUF4GMVEYcjs.callWithServiceName; exports.callWithSessionId = _chunkUF4GMVEYcjs.callWithSessionId; exports.callWithUser = _chunkUF4GMVEYcjs.callWithUser; exports.emitEvent = _chunkUF4GMVEYcjs.emitEvent; exports.emitEventWithSessionId = _chunkUF4GMVEYcjs.emitEventWithSessionId; exports.getActiveSession = _chunkUF4GMVEYcjs.getActiveSession; exports.recordFeedback = _chunkUF4GMVEYcjs.recordFeedback; exports.recordMetric = _chunkUF4GMVEYcjs.recordMetric; exports.setAgent = _chunkUF4GMVEYcjs.setAgent; exports.setCurrentSpanCustomProperties = _chunkUF4GMVEYcjs.setCurrentSpanCustomProperties; exports.setMessageId = _chunkUF4GMVEYcjs.setMessageId; exports.setOrganization = _chunkUF4GMVEYcjs.setOrganization; exports.setServiceName = _chunkUF4GMVEYcjs.setServiceName; exports.setSessionId = _chunkUF4GMVEYcjs.setSessionId; exports.setUser = _chunkUF4GMVEYcjs.setUser; exports.startAgent = _chunkUF4GMVEYcjs.startAgent; exports.startSession = _chunkUF4GMVEYcjs.startSession; exports.startSessionTitle = _chunkUF4GMVEYcjs.startSessionTitle; exports.withAgent = _chunkUF4GMVEYcjs.withAgent; exports.withMessageId = _chunkUF4GMVEYcjs.withMessageId; exports.withMute = _chunkUF4GMVEYcjs.withMute; exports.withOrganization = _chunkUF4GMVEYcjs.withOrganization; exports.withProperties = _chunkUF4GMVEYcjs.withProperties; exports.withServiceName = _chunkUF4GMVEYcjs.withServiceName; exports.withSessionId = _chunkUF4GMVEYcjs.withSessionId; exports.withUser = _chunkUF4GMVEYcjs.withUser;
package/dist/session.js CHANGED
@@ -32,11 +32,10 @@ import {
32
32
  withServiceName,
33
33
  withSessionId,
34
34
  withUser
35
- } from "./chunk-EZCNPWKM.js";
35
+ } from "./chunk-GITAPIVL.js";
36
+ import "./chunk-JMX23OHO.js";
36
37
  import "./chunk-TDPQDITP.js";
37
- import "./chunk-Y4HNUX3Q.js";
38
- import "./chunk-GISL4K6Z.js";
39
- import "./chunk-3RG5ZIWI.js";
38
+ import "./chunk-CZDPIJTO.js";
40
39
 
41
40
  // src/session.ts
42
41
  import { SeverityNumber } from "@opentelemetry/api";
@@ -1,8 +1 @@
1
- type TelemetryRegister = (...integrations: unknown[]) => void;
2
- interface AISdkTelemetryModule {
3
- registerTelemetry?: TelemetryRegister;
4
- registerTelemetryIntegration?: TelemetryRegister;
5
- }
6
- export declare function selectTelemetryRegister(ai: AISdkTelemetryModule): TelemetryRegister | undefined;
7
1
  export declare const autoInstrumentationsLoaded: boolean;
8
- export {};
@@ -1,6 +1,8 @@
1
1
  import type { Instrumentation } from '@opentelemetry/instrumentation';
2
2
  import type { IMCPManualModules } from './mcp/types.js';
3
3
  export interface IInstrumentModules {
4
+ ai?: unknown;
5
+ aiOtel?: unknown;
4
6
  openAI?: unknown;
5
7
  anthropic?: unknown;
6
8
  cohere?: unknown;
@@ -0,0 +1,28 @@
1
+ import type { Tracer } from '@opentelemetry/api';
2
+ type Register = (...integrations: unknown[]) => void;
3
+ type OpenTelemetryClass = new (options: {
4
+ tracer: Tracer;
5
+ experimental_decision: boolean;
6
+ providerMetadata: boolean;
7
+ }) => object;
8
+ export interface IAISdkModule {
9
+ registerTelemetry?: Register;
10
+ registerTelemetryIntegration?: Register;
11
+ }
12
+ export interface IAISdkOtelModule {
13
+ OpenTelemetry?: OpenTelemetryClass;
14
+ }
15
+ export interface IAISdkLoaders {
16
+ ai: () => Promise<IAISdkModule | undefined>;
17
+ otel: () => Promise<IAISdkOtelModule | undefined>;
18
+ }
19
+ export interface IAISdkModules {
20
+ ai?: unknown;
21
+ aiOtel?: unknown;
22
+ }
23
+ export declare function registerAISdkTelemetry({ collector, modules }: {
24
+ collector: boolean;
25
+ modules?: IAISdkModules;
26
+ }, load?: IAISdkLoaders): void | Promise<void>;
27
+ export declare function _resetAISdkRegistration(): void;
28
+ export {};
@@ -0,0 +1 @@
1
+ export declare function endUnreportedModelCalls<T extends object>(collector: T): T;
@@ -21,6 +21,7 @@ export interface IBrizzInitializeOptions {
21
21
  instrumentModules?: IInstrumentModules;
22
22
  disableNodeSdk?: boolean;
23
23
  setGlobalTracerProvider?: boolean;
24
+ disableAiSdkCollector?: boolean;
24
25
  customSpanExporter?: SpanExporter;
25
26
  customLogExporter?: LogRecordExporter;
26
27
  customMetricReader?: MetricReader;
@@ -30,6 +30,8 @@ export declare const AGENT_ID = "internal.agent.id";
30
30
  export declare const AGENT_PARENT_ID = "internal.agent.parent_id";
31
31
  export declare const AGENT_NAME = "internal.agent.name";
32
32
  export declare const INTERRUPT_TOOLS = "brizz.internal.interrupt";
33
+ export declare const APPROVALS = "brizz.internal.approvals";
34
+ export declare const AI_SDK_OTEL_SCOPE = "gen_ai";
33
35
  export declare const INTERNAL_EVENT_PREFIX = "brizz.internal.";
34
36
  export declare const EXTERNAL_LINK_EVENT_NAME = "brizz.internal.external_link";
35
37
  export declare const EXTERNAL_LINK_URL = "brizz.internal.external_link.url";
@@ -1,8 +1 @@
1
- type TelemetryRegister = (...integrations: unknown[]) => void;
2
- interface AISdkTelemetryModule {
3
- registerTelemetry?: TelemetryRegister;
4
- registerTelemetryIntegration?: TelemetryRegister;
5
- }
6
- export declare function selectTelemetryRegister(ai: AISdkTelemetryModule): TelemetryRegister | undefined;
7
1
  export declare const autoInstrumentationsLoaded: boolean;
8
- export {};
@@ -1,6 +1,8 @@
1
1
  import type { Instrumentation } from '@opentelemetry/instrumentation';
2
2
  import type { IMCPManualModules } from './mcp/types.js';
3
3
  export interface IInstrumentModules {
4
+ ai?: unknown;
5
+ aiOtel?: unknown;
4
6
  openAI?: unknown;
5
7
  anthropic?: unknown;
6
8
  cohere?: unknown;
@@ -0,0 +1,28 @@
1
+ import type { Tracer } from '@opentelemetry/api';
2
+ type Register = (...integrations: unknown[]) => void;
3
+ type OpenTelemetryClass = new (options: {
4
+ tracer: Tracer;
5
+ experimental_decision: boolean;
6
+ providerMetadata: boolean;
7
+ }) => object;
8
+ export interface IAISdkModule {
9
+ registerTelemetry?: Register;
10
+ registerTelemetryIntegration?: Register;
11
+ }
12
+ export interface IAISdkOtelModule {
13
+ OpenTelemetry?: OpenTelemetryClass;
14
+ }
15
+ export interface IAISdkLoaders {
16
+ ai: () => Promise<IAISdkModule | undefined>;
17
+ otel: () => Promise<IAISdkOtelModule | undefined>;
18
+ }
19
+ export interface IAISdkModules {
20
+ ai?: unknown;
21
+ aiOtel?: unknown;
22
+ }
23
+ export declare function registerAISdkTelemetry({ collector, modules }: {
24
+ collector: boolean;
25
+ modules?: IAISdkModules;
26
+ }, load?: IAISdkLoaders): void | Promise<void>;
27
+ export declare function _resetAISdkRegistration(): void;
28
+ export {};
@@ -0,0 +1 @@
1
+ export declare function endUnreportedModelCalls<T extends object>(collector: T): T;
@@ -21,6 +21,7 @@ export interface IBrizzInitializeOptions {
21
21
  instrumentModules?: IInstrumentModules;
22
22
  disableNodeSdk?: boolean;
23
23
  setGlobalTracerProvider?: boolean;
24
+ disableAiSdkCollector?: boolean;
24
25
  customSpanExporter?: SpanExporter;
25
26
  customLogExporter?: LogRecordExporter;
26
27
  customMetricReader?: MetricReader;
@@ -30,6 +30,8 @@ export declare const AGENT_ID = "internal.agent.id";
30
30
  export declare const AGENT_PARENT_ID = "internal.agent.parent_id";
31
31
  export declare const AGENT_NAME = "internal.agent.name";
32
32
  export declare const INTERRUPT_TOOLS = "brizz.internal.interrupt";
33
+ export declare const APPROVALS = "brizz.internal.approvals";
34
+ export declare const AI_SDK_OTEL_SCOPE = "gen_ai";
33
35
  export declare const INTERNAL_EVENT_PREFIX = "brizz.internal.";
34
36
  export declare const EXTERNAL_LINK_EVENT_NAME = "brizz.internal.external_link";
35
37
  export declare const EXTERNAL_LINK_URL = "brizz.internal.external_link.url";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brizz/sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "OpenTelemetry-based observability SDK for AI applications",
6
6
  "keywords": [
@@ -20,6 +20,11 @@
20
20
  ],
21
21
  "license": "Apache-2.0",
22
22
  "homepage": "https://www.brizz.ai",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/brizzai/brizz-js.git",
26
+ "directory": "typescript"
27
+ },
23
28
  "author": {
24
29
  "name": "Brizz",
25
30
  "email": "contact@brizz.ai",
@@ -31,7 +36,8 @@
31
36
  "files": [
32
37
  "dist",
33
38
  "LICENSE",
34
- "README.md"
39
+ "README.md",
40
+ "CHANGELOG.md"
35
41
  ],
36
42
  "scripts": {
37
43
  "build": "pnpm run clean && tsup && tsc -p tsconfig.dts.json && node scripts/emit-cjs-dts.mjs",
@@ -52,7 +58,7 @@
52
58
  "quality": "pnpm run lint && pnpm run format && pnpm run type-check && pnpm run test",
53
59
  "pack": "pnpm run build && pnpm pack",
54
60
  "changeset": "changeset",
55
- "changeset:version": "changeset version && pnpm install --lockfile-only",
61
+ "changeset:version": "changeset version && pnpm install --lockfile-only && node ../../dashboard/scripts/generate-sdk-changelogs.mjs",
56
62
  "changeset:publish": "pnpm build && changeset publish",
57
63
  "changeset:status": "changeset status --verbose",
58
64
  "prerelease:enter": "changeset pre enter",
@@ -115,32 +121,31 @@
115
121
  "registry": "https://registry.npmjs.org/"
116
122
  },
117
123
  "devDependencies": {
118
- "@ai-sdk/anthropic": "^4.0.99",
119
- "@ai-sdk/openai": "^4.0.111",
120
- "@ai-sdk/otel": "^1.0.165",
124
+ "@ai-sdk/anthropic": "^4.0.102",
125
+ "@ai-sdk/openai": "^4.0.114",
126
+ "@ai-sdk/otel": "^1.0.169",
121
127
  "@arethetypeswrong/cli": "^0.18.5",
122
128
  "@arizeai/openinference-instrumentation-mcp": "^0.2.37",
123
129
  "@babel/core": "^8.1.0",
124
130
  "@babel/preset-env": "^8.0.7",
125
131
  "@babel/preset-typescript": "^8.0.7",
126
- "@changesets/changelog-github": "^1.0.1",
127
132
  "@changesets/cli": "^3.0.3",
128
133
  "@google/genai": "^2.32.0",
129
- "@langchain/core": "^1.3.5",
130
- "@langchain/langgraph": "^1.7.2",
134
+ "@langchain/core": "^1.3.7",
135
+ "@langchain/langgraph": "^1.7.3",
131
136
  "@modelcontextprotocol/sdk": "^1.32.2",
132
137
  "@traceloop/instrumentation-google-generativeai": "^0.27.0",
133
138
  "@traceloop/instrumentation-vertexai": "^0.27.0",
134
139
  "@types/jest": "^30.0.0",
135
140
  "@types/node": "^26.6.6",
136
141
  "@typesafe-ai/sdk": "^0.7.0",
137
- "ai": "^7.0.165",
142
+ "ai": "^7.0.169",
138
143
  "babel-jest": "^30.5.2",
139
144
  "babel-plugin-transform-import-meta": "^3.1.0",
140
145
  "jest": "^30.5.2",
141
146
  "jest-environment-jsdom": "^30.5.2",
142
- "openai": "^7.53.0",
143
- "oxlint": "^1.92.0",
147
+ "openai": "^7.55.0",
148
+ "oxlint": "^1.93.0",
144
149
  "prettier": "^3.9.10",
145
150
  "tsup": "^9.0.0",
146
151
  "typescript": "^7.0.2",
@@ -195,17 +200,17 @@
195
200
  "@arizeai/openinference-instrumentation-langchain": "^4.1.5",
196
201
  "@arizeai/openinference-instrumentation-openai": "^2.3.1",
197
202
  "@opentelemetry/api": "^1.10.0",
198
- "@opentelemetry/context-async-hooks": "^3.1.0",
199
- "@opentelemetry/core": "^3.1.0",
200
- "@opentelemetry/exporter-logs-otlp-http": "^0.301.0",
201
- "@opentelemetry/exporter-metrics-otlp-http": "^0.301.0",
202
- "@opentelemetry/exporter-trace-otlp-http": "^0.301.0",
203
- "@opentelemetry/exporter-trace-otlp-proto": "^0.301.0",
204
- "@opentelemetry/instrumentation": "^0.301.0",
205
- "@opentelemetry/resources": "^3.1.0",
206
- "@opentelemetry/sdk-logs": "^3.1.0",
207
- "@opentelemetry/sdk-metrics": "^3.1.0",
208
- "@opentelemetry/sdk-trace": "^3.1.0",
203
+ "@opentelemetry/context-async-hooks": "^3.1.1",
204
+ "@opentelemetry/core": "^3.1.1",
205
+ "@opentelemetry/exporter-logs-otlp-http": "^0.301.1",
206
+ "@opentelemetry/exporter-metrics-otlp-http": "^0.301.1",
207
+ "@opentelemetry/exporter-trace-otlp-http": "^0.301.1",
208
+ "@opentelemetry/exporter-trace-otlp-proto": "^0.301.1",
209
+ "@opentelemetry/instrumentation": "^0.301.1",
210
+ "@opentelemetry/resources": "^3.1.1",
211
+ "@opentelemetry/sdk-logs": "^3.1.1",
212
+ "@opentelemetry/sdk-metrics": "^3.1.1",
213
+ "@opentelemetry/sdk-trace": "^3.1.1",
209
214
  "@opentelemetry/semantic-conventions": "^1.45.0",
210
215
  "@traceloop/ai-semantic-conventions": "^0.27.0",
211
216
  "@traceloop/instrumentation-anthropic": "^0.27.0",
@@ -1,10 +0,0 @@
1
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
- }) : x)(function(x) {
4
- if (typeof require !== "undefined") return require.apply(this, arguments);
5
- throw Error('Dynamic require of "' + x + '" is not supported');
6
- });
7
-
8
- export {
9
- __require
10
- };