@brizz/sdk 0.1.57 → 0.1.58

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.
@@ -8,7 +8,7 @@ import {
8
8
  resolveTransportSessionId,
9
9
  sessionToolResult,
10
10
  stampAndPropagateSession
11
- } from "./chunk-42KYS2LU.js";
11
+ } from "./chunk-LXRU77IM.js";
12
12
  import {
13
13
  brizzTracerProvider,
14
14
  extractTraceContext,
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkDCXOK7PXcjs = require('./chunk-DCXOK7PX.cjs');
11
+ var _chunkJGATEWJBcjs = require('./chunk-JGATEWJB.cjs');
12
12
 
13
13
 
14
14
 
@@ -409,14 +409,14 @@ function wrapOnRequest(original, tracer) {
409
409
  return original.apply(this, args);
410
410
  }
411
411
  const method = request.method;
412
- if (method === METHOD_TOOLS_CALL && _chunkDCXOK7PXcjs.isSessionToolCall.call(void 0, request)) {
412
+ if (method === METHOD_TOOLS_CALL && _chunkJGATEWJBcjs.isSessionToolCall.call(void 0, request)) {
413
413
  return answerSessionToolCall(this, request, tracer, args, original);
414
414
  }
415
415
  const handler = _nullishCoalesce(handlers.get(method), () => ( this.fallbackRequestHandler));
416
416
  if (!handler) {
417
417
  return original.apply(this, args);
418
418
  }
419
- const tracking = _chunkDCXOK7PXcjs.isEnabled.call(void 0, ) && method === METHOD_TOOLS_CALL ? _chunkDCXOK7PXcjs.popTrackingArguments.call(void 0, request) : {};
419
+ const tracking = _chunkJGATEWJBcjs.isEnabled.call(void 0, ) && method === METHOD_TOOLS_CALL ? _chunkJGATEWJBcjs.popTrackingArguments.call(void 0, request) : {};
420
420
  const started = safeStartServerSpan(tracer, request, this, tracking);
421
421
  if (!started) {
422
422
  return original.apply(this, args);
@@ -426,9 +426,9 @@ function wrapOnRequest(original, tracer) {
426
426
  if (method === METHOD_TOOLS_LIST) {
427
427
  hooks.onResult = (result) => {
428
428
  let advertised = result;
429
- if (_chunkDCXOK7PXcjs.isEnabled.call(void 0, )) {
429
+ if (_chunkJGATEWJBcjs.isEnabled.call(void 0, )) {
430
430
  try {
431
- advertised = _chunkDCXOK7PXcjs.patchListToolsResult.call(void 0, result);
431
+ advertised = _chunkJGATEWJBcjs.patchListToolsResult.call(void 0, result);
432
432
  } catch (error) {
433
433
  _chunkWC573FCIcjs.logger.warn(
434
434
  `Brizz MCP: failed to patch tools/list schemas: ${String(error)}`
@@ -439,7 +439,7 @@ function wrapOnRequest(original, tracer) {
439
439
  try {
440
440
  emitSchemaSpansFromListResponse(
441
441
  advertised,
442
- _chunkDCXOK7PXcjs.resolveTransportSessionId.call(void 0, this),
442
+ _chunkJGATEWJBcjs.resolveTransportSessionId.call(void 0, this),
443
443
  tracer
444
444
  );
445
445
  } catch (error) {
@@ -452,7 +452,7 @@ function wrapOnRequest(original, tracer) {
452
452
  }
453
453
  if (method !== METHOD_TOOLS_CALL) {
454
454
  hooks.onError = () => {
455
- _chunkDCXOK7PXcjs.stampAndPropagateSession.call(void 0, span, _chunkDCXOK7PXcjs.resolveSessionId.call(void 0, this, spanCtx), spanCtx);
455
+ _chunkJGATEWJBcjs.stampAndPropagateSession.call(void 0, span, _chunkJGATEWJBcjs.resolveSessionId.call(void 0, this, spanCtx), spanCtx);
456
456
  };
457
457
  }
458
458
  const wrappedHandler = (req, extra) => _api.context.with(
@@ -486,7 +486,7 @@ function answerSessionToolCall(protocol, request, tracer, args, original) {
486
486
  if (!handlers) {
487
487
  return original.apply(protocol, args);
488
488
  }
489
- const { id, result } = _chunkDCXOK7PXcjs.sessionToolResult.call(void 0, );
489
+ const { id, result } = _chunkJGATEWJBcjs.sessionToolResult.call(void 0, );
490
490
  const started = safeStartServerSpan(tracer, request, protocol, { sessionId: id });
491
491
  const handler = () => started ? _api.context.with(started.spanCtx, () => result) : result;
492
492
  const hadEntry = handlers.has(METHOD_TOOLS_CALL);
@@ -576,8 +576,8 @@ function safeStartServerSpan(tracer, request, protocol, tracking = {}) {
576
576
  parentCtx
577
577
  );
578
578
  applyServerRequestAttributes(span, request, protocol);
579
- const resolved = request.method === METHOD_TOOLS_CALL ? _nullishCoalesce(tracking.sessionId, () => ( _chunkDCXOK7PXcjs.resolveSessionId.call(void 0, protocol, parentCtx))) : void 0;
580
- const { context: sessCtx } = _chunkDCXOK7PXcjs.stampAndPropagateSession.call(void 0,
579
+ const resolved = request.method === METHOD_TOOLS_CALL ? _nullishCoalesce(tracking.sessionId, () => ( _chunkJGATEWJBcjs.resolveSessionId.call(void 0, protocol, parentCtx))) : void 0;
580
+ const { context: sessCtx } = _chunkJGATEWJBcjs.stampAndPropagateSession.call(void 0,
581
581
  span,
582
582
  resolved,
583
583
  parentCtx,
@@ -633,7 +633,7 @@ function safeEnd(span) {
633
633
 
634
634
  // src/internal/instrumentation/mcp/version.ts
635
635
  var INSTRUMENTATION_NAME = "@brizz/sdk/mcp";
636
- var INSTRUMENTATION_VERSION = _chunkDCXOK7PXcjs.getSDKVersion.call(void 0, );
636
+ var INSTRUMENTATION_VERSION = _chunkJGATEWJBcjs.getSDKVersion.call(void 0, );
637
637
 
638
638
  // src/internal/instrumentation/mcp/instrumentation.ts
639
639
  var PROTOCOL_MODULE_NAME = "@modelcontextprotocol/sdk/shared/protocol.js";
@@ -0,0 +1,78 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+ var _chunkXGD5HD5Wcjs = require('./chunk-XGD5HD5W.cjs');
36
+ require('./chunk-DC2MFO65.cjs');
37
+ require('./chunk-WC573FCI.cjs');
38
+ require('./chunk-RV7JIIDG.cjs');
39
+ require('./chunk-OBGZSXTJ.cjs');
40
+
41
+ // src/session.ts
42
+ var _api = require('@opentelemetry/api');
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+ exports.Session = _chunkXGD5HD5Wcjs.Session; exports.SessionTitle = _chunkXGD5HD5Wcjs.SessionTitle; exports.SeverityNumber = _api.SeverityNumber; exports.addExternalLink = _chunkXGD5HD5Wcjs.addExternalLink; exports.callWithMessageId = _chunkXGD5HD5Wcjs.callWithMessageId; exports.callWithMute = _chunkXGD5HD5Wcjs.callWithMute; exports.callWithOrganization = _chunkXGD5HD5Wcjs.callWithOrganization; exports.callWithProperties = _chunkXGD5HD5Wcjs.callWithProperties; exports.callWithServiceName = _chunkXGD5HD5Wcjs.callWithServiceName; exports.callWithSessionId = _chunkXGD5HD5Wcjs.callWithSessionId; exports.callWithUser = _chunkXGD5HD5Wcjs.callWithUser; exports.emitEvent = _chunkXGD5HD5Wcjs.emitEvent; exports.emitEventWithSessionId = _chunkXGD5HD5Wcjs.emitEventWithSessionId; exports.getActiveSession = _chunkXGD5HD5Wcjs.getActiveSession; exports.recordFeedback = _chunkXGD5HD5Wcjs.recordFeedback; exports.recordMetric = _chunkXGD5HD5Wcjs.recordMetric; exports.setAgent = _chunkXGD5HD5Wcjs.setAgent; exports.setCurrentSpanCustomProperties = _chunkXGD5HD5Wcjs.setCurrentSpanCustomProperties; exports.setMessageId = _chunkXGD5HD5Wcjs.setMessageId; exports.setOrganization = _chunkXGD5HD5Wcjs.setOrganization; exports.setServiceName = _chunkXGD5HD5Wcjs.setServiceName; exports.setSessionId = _chunkXGD5HD5Wcjs.setSessionId; exports.setUser = _chunkXGD5HD5Wcjs.setUser; exports.startAgent = _chunkXGD5HD5Wcjs.startAgent; exports.startSession = _chunkXGD5HD5Wcjs.startSession; exports.startSessionTitle = _chunkXGD5HD5Wcjs.startSessionTitle; exports.withAgent = _chunkXGD5HD5Wcjs.withAgent; exports.withMessageId = _chunkXGD5HD5Wcjs.withMessageId; exports.withMute = _chunkXGD5HD5Wcjs.withMute; exports.withOrganization = _chunkXGD5HD5Wcjs.withOrganization; exports.withProperties = _chunkXGD5HD5Wcjs.withProperties; exports.withServiceName = _chunkXGD5HD5Wcjs.withServiceName; exports.withSessionId = _chunkXGD5HD5Wcjs.withSessionId; exports.withUser = _chunkXGD5HD5Wcjs.withUser;
@@ -0,0 +1,78 @@
1
+ import {
2
+ Session,
3
+ SessionTitle,
4
+ addExternalLink,
5
+ callWithMessageId,
6
+ callWithMute,
7
+ callWithOrganization,
8
+ callWithProperties,
9
+ callWithServiceName,
10
+ callWithSessionId,
11
+ callWithUser,
12
+ emitEvent,
13
+ emitEventWithSessionId,
14
+ getActiveSession,
15
+ recordFeedback,
16
+ recordMetric,
17
+ setAgent,
18
+ setCurrentSpanCustomProperties,
19
+ setMessageId,
20
+ setOrganization,
21
+ setServiceName,
22
+ setSessionId,
23
+ setUser,
24
+ startAgent,
25
+ startSession,
26
+ startSessionTitle,
27
+ withAgent,
28
+ withMessageId,
29
+ withMute,
30
+ withOrganization,
31
+ withProperties,
32
+ withServiceName,
33
+ withSessionId,
34
+ withUser
35
+ } from "./chunk-MXKQQ6AU.js";
36
+ import "./chunk-TDPQDITP.js";
37
+ import "./chunk-Y4HNUX3Q.js";
38
+ import "./chunk-GUKWVI53.js";
39
+ import "./chunk-3RG5ZIWI.js";
40
+
41
+ // src/session.ts
42
+ import { SeverityNumber } from "@opentelemetry/api";
43
+ export {
44
+ Session,
45
+ SessionTitle,
46
+ SeverityNumber,
47
+ addExternalLink,
48
+ callWithMessageId,
49
+ callWithMute,
50
+ callWithOrganization,
51
+ callWithProperties,
52
+ callWithServiceName,
53
+ callWithSessionId,
54
+ callWithUser,
55
+ emitEvent,
56
+ emitEventWithSessionId,
57
+ getActiveSession,
58
+ recordFeedback,
59
+ recordMetric,
60
+ setAgent,
61
+ setCurrentSpanCustomProperties,
62
+ setMessageId,
63
+ setOrganization,
64
+ setServiceName,
65
+ setSessionId,
66
+ setUser,
67
+ startAgent,
68
+ startSession,
69
+ startSessionTitle,
70
+ withAgent,
71
+ withMessageId,
72
+ withMute,
73
+ withOrganization,
74
+ withProperties,
75
+ withServiceName,
76
+ withSessionId,
77
+ withUser
78
+ };
@@ -0,0 +1,8 @@
1
+ import type { AnyValue } from '@opentelemetry/api';
2
+ import { SeverityNumber } from '@opentelemetry/api';
3
+ export interface IEventSink {
4
+ emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
5
+ }
6
+ export declare function setEventSink(sink: IEventSink): void;
7
+ export declare function clearEventSink(sink: IEventSink): void;
8
+ export declare function emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
@@ -2,6 +2,8 @@ import type { AnyValue } from '@opentelemetry/api';
2
2
  import { SeverityNumber } from '@opentelemetry/api';
3
3
  import { LoggerProvider } from '@opentelemetry/sdk-logs';
4
4
  import type { IResolvedBrizzConfig } from '../config.js';
5
+ export { emitEvent } from './emit.js';
6
+ export { emitEventWithSessionId } from '../trace/session.js';
5
7
  export declare class LoggingModule {
6
8
  private static instance;
7
9
  static getInstance(): LoggingModule;
@@ -18,5 +20,3 @@ export declare class LoggingModule {
18
20
  forceFlush(): Promise<void>;
19
21
  shutdown(): Promise<void>;
20
22
  }
21
- export declare function emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
22
- export declare function emitEventWithSessionId(sessionId: string, name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
@@ -1,4 +1,4 @@
1
- import type { Context, Span, AttributeValue } from '@opentelemetry/api';
1
+ import type { AnyValue, Context, Span, AttributeValue, SeverityNumber } from '@opentelemetry/api';
2
2
  export declare function setCurrentSpanCustomProperties(properties: Record<string, AttributeValue>): void;
3
3
  export declare function callWithProperties<A extends unknown[], F extends (...args: A) => ReturnType<F>>(properties: {
4
4
  [name: string]: string;
@@ -107,6 +107,7 @@ export declare class SessionTitle {
107
107
  setTitle(title: string): void;
108
108
  }
109
109
  export declare function getActiveSession(): Session | undefined;
110
+ export declare function emitEventWithSessionId(sessionId: string, name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
110
111
  export declare function addExternalLink(url: string, options?: {
111
112
  sessionId?: string;
112
113
  title?: string;
@@ -0,0 +1,6 @@
1
+ export { emitEvent } from './internal/log/emit.js';
2
+ export { emitEventWithSessionId, withSessionId, callWithSessionId, withProperties, callWithProperties, withMute, callWithMute, setCurrentSpanCustomProperties, setUser, setOrganization, setMessageId, setSessionId, setServiceName, withServiceName, callWithServiceName, withUser, callWithUser, withOrganization, callWithOrganization, withMessageId, callWithMessageId, Session, SessionTitle, startSession, startSessionTitle, getActiveSession, addExternalLink, recordFeedback, recordMetric, } from './internal/trace/session.js';
3
+ export type { IMuteOptions } from './internal/trace/session.js';
4
+ export { startAgent, withAgent, setAgent } from './internal/trace/agent.js';
5
+ export type { AgentRef, IAgent, IAgentOptions } from './internal/trace/agent.js';
6
+ export { SeverityNumber } from '@opentelemetry/api';
@@ -0,0 +1,8 @@
1
+ import type { AnyValue } from '@opentelemetry/api';
2
+ import { SeverityNumber } from '@opentelemetry/api';
3
+ export interface IEventSink {
4
+ emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
5
+ }
6
+ export declare function setEventSink(sink: IEventSink): void;
7
+ export declare function clearEventSink(sink: IEventSink): void;
8
+ export declare function emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
@@ -2,6 +2,8 @@ import type { AnyValue } from '@opentelemetry/api';
2
2
  import { SeverityNumber } from '@opentelemetry/api';
3
3
  import { LoggerProvider } from '@opentelemetry/sdk-logs';
4
4
  import type { IResolvedBrizzConfig } from '../config.js';
5
+ export { emitEvent } from './emit.js';
6
+ export { emitEventWithSessionId } from '../trace/session.js';
5
7
  export declare class LoggingModule {
6
8
  private static instance;
7
9
  static getInstance(): LoggingModule;
@@ -18,5 +20,3 @@ export declare class LoggingModule {
18
20
  forceFlush(): Promise<void>;
19
21
  shutdown(): Promise<void>;
20
22
  }
21
- export declare function emitEvent(name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
22
- export declare function emitEventWithSessionId(sessionId: string, name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
@@ -1,4 +1,4 @@
1
- import type { Context, Span, AttributeValue } from '@opentelemetry/api';
1
+ import type { AnyValue, Context, Span, AttributeValue, SeverityNumber } from '@opentelemetry/api';
2
2
  export declare function setCurrentSpanCustomProperties(properties: Record<string, AttributeValue>): void;
3
3
  export declare function callWithProperties<A extends unknown[], F extends (...args: A) => ReturnType<F>>(properties: {
4
4
  [name: string]: string;
@@ -107,6 +107,7 @@ export declare class SessionTitle {
107
107
  setTitle(title: string): void;
108
108
  }
109
109
  export declare function getActiveSession(): Session | undefined;
110
+ export declare function emitEventWithSessionId(sessionId: string, name: string, attributes?: Record<string, string | number | boolean>, body?: AnyValue, severityNumber?: SeverityNumber): void;
110
111
  export declare function addExternalLink(url: string, options?: {
111
112
  sessionId?: string;
112
113
  title?: string;
@@ -0,0 +1,6 @@
1
+ export { emitEvent } from './internal/log/emit.js';
2
+ export { emitEventWithSessionId, withSessionId, callWithSessionId, withProperties, callWithProperties, withMute, callWithMute, setCurrentSpanCustomProperties, setUser, setOrganization, setMessageId, setSessionId, setServiceName, withServiceName, callWithServiceName, withUser, callWithUser, withOrganization, callWithOrganization, withMessageId, callWithMessageId, Session, SessionTitle, startSession, startSessionTitle, getActiveSession, addExternalLink, recordFeedback, recordMetric, } from './internal/trace/session.js';
3
+ export type { IMuteOptions } from './internal/trace/session.js';
4
+ export { startAgent, withAgent, setAgent } from './internal/trace/agent.js';
5
+ export type { AgentRef, IAgent, IAgentOptions } from './internal/trace/agent.js';
6
+ export { SeverityNumber } from '@opentelemetry/api';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brizz/sdk",
3
- "version": "0.1.57",
3
+ "version": "0.1.58",
4
4
  "type": "module",
5
5
  "description": "OpenTelemetry-based observability SDK for AI applications",
6
6
  "keywords": [
@@ -57,11 +57,12 @@
57
57
  "changeset:status": "changeset status --verbose",
58
58
  "prerelease:enter": "changeset pre enter",
59
59
  "prerelease:exit": "changeset pre exit",
60
- "check:types-package": "attw --pack . --entrypoints . eve google-genai --ignore-rules no-resolution",
60
+ "check:types-package": "attw --pack . --entrypoints . eve session google-genai --ignore-rules no-resolution",
61
61
  "check:types-consumer": "node scripts/check-consumer-types.mjs",
62
62
  "check:types": "pnpm run check:types-package && pnpm run check:types-consumer",
63
63
  "check:esm-langgraph": "node scripts/check-esm-langgraph.mjs",
64
- "check:typesafe": "node scripts/check-typesafe.mjs"
64
+ "check:typesafe": "node scripts/check-typesafe.mjs",
65
+ "check:session-entry": "node scripts/check-session-entry.mjs"
65
66
  },
66
67
  "exports": {
67
68
  ".": {
@@ -84,6 +85,16 @@
84
85
  "default": "./dist/eve.cjs"
85
86
  }
86
87
  },
88
+ "./session": {
89
+ "import": {
90
+ "types": "./dist/types/esm/session.d.ts",
91
+ "default": "./dist/session.js"
92
+ },
93
+ "require": {
94
+ "types": "./dist/types/cjs/session.d.ts",
95
+ "default": "./dist/session.cjs"
96
+ }
97
+ },
87
98
  "./google-genai": {
88
99
  "import": {
89
100
  "types": "./dist/types/esm/google-genai.d.ts",
@@ -104,9 +115,9 @@
104
115
  "registry": "https://registry.npmjs.org/"
105
116
  },
106
117
  "devDependencies": {
107
- "@ai-sdk/anthropic": "^4.0.88",
108
- "@ai-sdk/openai": "^4.0.102",
109
- "@ai-sdk/otel": "^1.0.153",
118
+ "@ai-sdk/anthropic": "^4.0.91",
119
+ "@ai-sdk/openai": "^4.0.104",
120
+ "@ai-sdk/otel": "^1.0.156",
110
121
  "@arethetypeswrong/cli": "^0.18.5",
111
122
  "@arizeai/openinference-instrumentation-mcp": "^0.2.37",
112
123
  "@babel/core": "^8.0.9",
@@ -115,21 +126,21 @@
115
126
  "@changesets/changelog-github": "^1.0.1",
116
127
  "@changesets/cli": "^3.0.3",
117
128
  "@google/genai": "^2.31.0",
118
- "@langchain/core": "^1.3.0",
119
- "@langchain/langgraph": "^1.5.2",
129
+ "@langchain/core": "^1.3.1",
130
+ "@langchain/langgraph": "^1.5.3",
120
131
  "@modelcontextprotocol/sdk": "^1.32.2",
121
132
  "@traceloop/instrumentation-google-generativeai": "^0.27.0",
122
133
  "@traceloop/instrumentation-vertexai": "^0.27.0",
123
134
  "@types/jest": "^30.0.0",
124
- "@types/node": "^26.6.5",
135
+ "@types/node": "^26.6.6",
125
136
  "@typesafe-ai/sdk": "^0.7.0",
126
- "ai": "^7.0.153",
137
+ "ai": "^7.0.156",
127
138
  "babel-jest": "^30.5.2",
128
139
  "babel-plugin-transform-import-meta": "^3.1.0",
129
140
  "jest": "^30.5.2",
130
141
  "jest-environment-jsdom": "^30.5.2",
131
- "openai": "^7.43.0",
132
- "oxlint": "^1.89.0",
142
+ "openai": "^7.45.1",
143
+ "oxlint": "^1.90.0",
133
144
  "prettier": "^3.9.10",
134
145
  "tsup": "^9.0.0",
135
146
  "typescript": "^7.0.2",
@@ -195,7 +206,7 @@
195
206
  "@opentelemetry/sdk-logs": "^3.0.0",
196
207
  "@opentelemetry/sdk-metrics": "^3.0.0",
197
208
  "@opentelemetry/sdk-trace": "^3.0.0",
198
- "@opentelemetry/semantic-conventions": "^1.43.0",
209
+ "@opentelemetry/semantic-conventions": "^1.44.0",
199
210
  "@traceloop/ai-semantic-conventions": "^0.27.0",
200
211
  "@traceloop/instrumentation-anthropic": "^0.27.0",
201
212
  "@traceloop/instrumentation-bedrock": "^0.27.0",