@brizz/sdk 0.1.32 → 0.1.34

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.
@@ -0,0 +1,117 @@
1
+ // src/internal/semantic-conventions.ts
2
+ import { createContextKey } from "@opentelemetry/api";
3
+ var BRIZZ = "brizz";
4
+ var PROPERTIES = "properties";
5
+ var SESSION_ID = "session.id";
6
+ var PROPERTIES_CONTEXT_KEY = createContextKey(PROPERTIES);
7
+ var SESSION_OBJECT_CONTEXT_KEY = createContextKey("brizz.session.object");
8
+ var SESSION_INPUT = "brizz.session.input";
9
+ var SESSION_OUTPUT = "brizz.session.output";
10
+ var SESSION_INPUT_CONTEXT = "brizz.session.input.context";
11
+ var SESSION_OUTPUT_CONTEXT = "brizz.session.output.context";
12
+ var SESSION_SPAN_NAME = "brizz.start_session";
13
+ var MUTE_INPUT = "mute.input";
14
+ var MUTE_OUTPUT = "mute.output";
15
+ var USER_ID = "user.id";
16
+ var USER_EMAIL = "user.email";
17
+ var USER_NAME = "user.name";
18
+ var USER_ROLE = "user.role";
19
+ var USER_PLAN = "user.plan";
20
+ var ORGANIZATION_ID = "organization.id";
21
+ var ORGANIZATION_NAME = "organization.name";
22
+ var ORGANIZATION_PLAN = "organization.plan";
23
+ var ORGANIZATION_DOMAIN = "organization.domain";
24
+ var MESSAGE_ID = "message.id";
25
+ var SESSION_TITLE_SPAN_NAME = "brizz.session_title";
26
+ var SESSION_TITLE_GENERATION = "session.title_generation";
27
+ var SESSION_TITLE = "brizz.session.title";
28
+ var INTERRUPT_TOOLS = "brizz.internal.interrupt";
29
+ var INTERNAL_EVENT_PREFIX = "brizz.internal.";
30
+ var EXTERNAL_LINK_EVENT_NAME = "brizz.internal.external_link";
31
+ var EXTERNAL_LINK_URL = "brizz.internal.external_link.url";
32
+ var EXTERNAL_LINK_TITLE = "brizz.internal.external_link.title";
33
+ var EXTERNAL_LINK_TYPE = "brizz.internal.external_link.type";
34
+ var FEEDBACK_EVENT_NAME = "brizz.feedback";
35
+ var FEEDBACK_TYPE = "brizz.feedback.type";
36
+ var FEEDBACK_SCORE = "brizz.feedback.score";
37
+ var FEEDBACK_REASON = "brizz.feedback.reason";
38
+ var FEEDBACK_COMMENT = "brizz.feedback.comment";
39
+ var FEEDBACK_SOURCE = "brizz.feedback.source";
40
+ var FEEDBACK_ATTR_PREFIX = "brizz.feedback.";
41
+ var METRIC_EVENT_NAME = "brizz.internal.metric";
42
+ var METRIC_NAME = "brizz.internal.metric.name";
43
+ var METRIC_VALUE = "brizz.internal.metric.value";
44
+ var METRIC_UNIT = "brizz.internal.metric.unit";
45
+ var METRIC_COMMENT = "brizz.internal.metric.comment";
46
+ var METRIC_POLARITY = "brizz.internal.metric.polarity";
47
+ var METRIC_MIN = "brizz.internal.metric.min";
48
+ var METRIC_MAX = "brizz.internal.metric.max";
49
+ var METRIC_TIMESTAMP = "brizz.internal.metric.timestamp";
50
+ var METRIC_ATTRIBUTE_PREFIX = "brizz.internal.metric.attribute.";
51
+ var RESERVED_METRIC_NAMES = /* @__PURE__ */ new Set([
52
+ "faithfulness",
53
+ "answer_relevancy",
54
+ "toxicity",
55
+ "task_completion_v2",
56
+ "prompt_alignment",
57
+ "user_frustration",
58
+ "user_satisfaction_v2",
59
+ "repetitiveness",
60
+ "session_outcome",
61
+ "response_time"
62
+ ]);
63
+ var METRIC_POLARITY_POSITIVE = "positive";
64
+ var METRIC_POLARITY_NEGATIVE = "negative";
65
+
66
+ export {
67
+ BRIZZ,
68
+ SESSION_ID,
69
+ PROPERTIES_CONTEXT_KEY,
70
+ SESSION_OBJECT_CONTEXT_KEY,
71
+ SESSION_INPUT,
72
+ SESSION_OUTPUT,
73
+ SESSION_INPUT_CONTEXT,
74
+ SESSION_OUTPUT_CONTEXT,
75
+ SESSION_SPAN_NAME,
76
+ MUTE_INPUT,
77
+ MUTE_OUTPUT,
78
+ USER_ID,
79
+ USER_EMAIL,
80
+ USER_NAME,
81
+ USER_ROLE,
82
+ USER_PLAN,
83
+ ORGANIZATION_ID,
84
+ ORGANIZATION_NAME,
85
+ ORGANIZATION_PLAN,
86
+ ORGANIZATION_DOMAIN,
87
+ MESSAGE_ID,
88
+ SESSION_TITLE_SPAN_NAME,
89
+ SESSION_TITLE_GENERATION,
90
+ SESSION_TITLE,
91
+ INTERRUPT_TOOLS,
92
+ INTERNAL_EVENT_PREFIX,
93
+ EXTERNAL_LINK_EVENT_NAME,
94
+ EXTERNAL_LINK_URL,
95
+ EXTERNAL_LINK_TITLE,
96
+ EXTERNAL_LINK_TYPE,
97
+ FEEDBACK_EVENT_NAME,
98
+ FEEDBACK_TYPE,
99
+ FEEDBACK_SCORE,
100
+ FEEDBACK_REASON,
101
+ FEEDBACK_COMMENT,
102
+ FEEDBACK_SOURCE,
103
+ FEEDBACK_ATTR_PREFIX,
104
+ METRIC_EVENT_NAME,
105
+ METRIC_NAME,
106
+ METRIC_VALUE,
107
+ METRIC_UNIT,
108
+ METRIC_COMMENT,
109
+ METRIC_POLARITY,
110
+ METRIC_MIN,
111
+ METRIC_MAX,
112
+ METRIC_TIMESTAMP,
113
+ METRIC_ATTRIBUTE_PREFIX,
114
+ RESERVED_METRIC_NAMES,
115
+ METRIC_POLARITY_POSITIVE,
116
+ METRIC_POLARITY_NEGATIVE
117
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/internal/version.ts
2
2
  function getSDKVersion() {
3
- return "0.1.32";
3
+ return "0.1.34";
4
4
  }
5
5
 
6
6
 
package/dist/index.cjs CHANGED
@@ -23,17 +23,28 @@
23
23
 
24
24
 
25
25
 
26
- var _chunkIH7TSRRTcjs = require('./chunk-IH7TSRRT.cjs');
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+ var _chunk3LR22M4Ecjs = require('./chunk-3LR22M4E.cjs');
27
38
  require('./chunk-UNLNNKZ7.cjs');
28
- require('./chunk-SCYD7XCI.cjs');
39
+ require('./chunk-VU5YDLUD.cjs');
29
40
 
30
41
 
31
42
 
32
43
 
33
44
 
34
45
  var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
35
- require('./chunk-A3OOY5A2.cjs');
36
- require('./chunk-OZCOXBB7.cjs');
46
+ require('./chunk-M3UGFLH7.cjs');
47
+ require('./chunk-NEF2O7HF.cjs');
37
48
  require('./chunk-OBGZSXTJ.cjs');
38
49
 
39
50
  // src/internal/instrumentation/auto-init.ts
@@ -83,7 +94,7 @@ function loadGenAIInstrumentations() {
83
94
  function loadMCPInstrumentation() {
84
95
  void (async () => {
85
96
  try {
86
- const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-GXP22YAQ.cjs")));
97
+ const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-WCMY6ED6.cjs")));
87
98
  const mcp = new MCPInstrumentation({ exceptionLogger });
88
99
  _instrumentation.registerInstrumentations.call(void 0, { instrumentations: [mcp] });
89
100
  _chunkWC573FCIcjs.logger.debug("Auto-loaded MCP instrumentation");
@@ -125,7 +136,7 @@ function loadVercelAITelemetry() {
125
136
  }
126
137
  const isV7 = typeof ai.registerTelemetry === "function";
127
138
  const integrations = [];
128
- const { createInterruptIntegration } = await Promise.resolve().then(() => _interopRequireWildcard(require("./interrupt-6D6DA7R2.cjs")));
139
+ const { createInterruptIntegration } = await Promise.resolve().then(() => _interopRequireWildcard(require("./interrupt-7MWQCOY3.cjs")));
129
140
  integrations.push(createInterruptIntegration());
130
141
  let otelCollectorLoaded = false;
131
142
  try {
@@ -206,4 +217,15 @@ var init_exports = {};
206
217
 
207
218
 
208
219
 
209
- exports.Brizz = _chunkIH7TSRRTcjs.Brizz; exports.DEFAULT_PII_PATTERNS = _chunkIH7TSRRTcjs.DEFAULT_PII_PATTERNS; exports.LogLevel = _chunkWC573FCIcjs.LogLevel; exports.Session = _chunkIH7TSRRTcjs.Session; exports.SessionTitle = _chunkIH7TSRRTcjs.SessionTitle; exports.SeverityNumber = _apilogs.SeverityNumber; exports.addExternalLink = _chunkIH7TSRRTcjs.addExternalLink; exports.callWithMute = _chunkIH7TSRRTcjs.callWithMute; exports.callWithProperties = _chunkIH7TSRRTcjs.callWithProperties; exports.callWithSessionId = _chunkIH7TSRRTcjs.callWithSessionId; exports.detectRuntime = _chunkIH7TSRRTcjs.detectRuntime; exports.emitEvent = _chunkIH7TSRRTcjs.emitEvent; exports.emitEventWithSessionId = _chunkIH7TSRRTcjs.emitEventWithSessionId; exports.getActiveSession = _chunkIH7TSRRTcjs.getActiveSession; exports.getLogLevel = _chunkWC573FCIcjs.getLogLevel; exports.getMetricsExporter = _chunkIH7TSRRTcjs.getMetricsExporter; exports.getMetricsReader = _chunkIH7TSRRTcjs.getMetricsReader; exports.getSpanExporter = _chunkIH7TSRRTcjs.getSpanExporter; exports.getSpanProcessor = _chunkIH7TSRRTcjs.getSpanProcessor; exports.init = init_exports; exports.logger = _chunkWC573FCIcjs.logger; exports.maskAttributes = _chunkIH7TSRRTcjs.maskAttributes; exports.maskValue = _chunkIH7TSRRTcjs.maskValue; exports.setCurrentSpanCustomProperties = _chunkIH7TSRRTcjs.setCurrentSpanCustomProperties; exports.setLogLevel = _chunkWC573FCIcjs.setLogLevel; exports.startSession = _chunkIH7TSRRTcjs.startSession; exports.startSessionTitle = _chunkIH7TSRRTcjs.startSessionTitle; exports.withMute = _chunkIH7TSRRTcjs.withMute; exports.withProperties = _chunkIH7TSRRTcjs.withProperties; exports.withSessionId = _chunkIH7TSRRTcjs.withSessionId;
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+ exports.Brizz = _chunk3LR22M4Ecjs.Brizz; exports.DEFAULT_PII_PATTERNS = _chunk3LR22M4Ecjs.DEFAULT_PII_PATTERNS; exports.LogLevel = _chunkWC573FCIcjs.LogLevel; exports.Session = _chunk3LR22M4Ecjs.Session; exports.SessionTitle = _chunk3LR22M4Ecjs.SessionTitle; exports.SeverityNumber = _apilogs.SeverityNumber; exports.addExternalLink = _chunk3LR22M4Ecjs.addExternalLink; exports.callWithMessageId = _chunk3LR22M4Ecjs.callWithMessageId; exports.callWithMute = _chunk3LR22M4Ecjs.callWithMute; exports.callWithOrganization = _chunk3LR22M4Ecjs.callWithOrganization; exports.callWithProperties = _chunk3LR22M4Ecjs.callWithProperties; exports.callWithSessionId = _chunk3LR22M4Ecjs.callWithSessionId; exports.callWithUser = _chunk3LR22M4Ecjs.callWithUser; exports.detectRuntime = _chunk3LR22M4Ecjs.detectRuntime; exports.emitEvent = _chunk3LR22M4Ecjs.emitEvent; exports.emitEventWithSessionId = _chunk3LR22M4Ecjs.emitEventWithSessionId; exports.getActiveSession = _chunk3LR22M4Ecjs.getActiveSession; exports.getLogLevel = _chunkWC573FCIcjs.getLogLevel; exports.getMetricsExporter = _chunk3LR22M4Ecjs.getMetricsExporter; exports.getMetricsReader = _chunk3LR22M4Ecjs.getMetricsReader; exports.getSpanExporter = _chunk3LR22M4Ecjs.getSpanExporter; exports.getSpanProcessor = _chunk3LR22M4Ecjs.getSpanProcessor; exports.init = init_exports; exports.logger = _chunkWC573FCIcjs.logger; exports.maskAttributes = _chunk3LR22M4Ecjs.maskAttributes; exports.maskValue = _chunk3LR22M4Ecjs.maskValue; exports.recordFeedback = _chunk3LR22M4Ecjs.recordFeedback; exports.recordMetric = _chunk3LR22M4Ecjs.recordMetric; exports.setCurrentSpanCustomProperties = _chunk3LR22M4Ecjs.setCurrentSpanCustomProperties; exports.setLogLevel = _chunkWC573FCIcjs.setLogLevel; exports.setMessageId = _chunk3LR22M4Ecjs.setMessageId; exports.setOrganization = _chunk3LR22M4Ecjs.setOrganization; exports.setUser = _chunk3LR22M4Ecjs.setUser; exports.startSession = _chunk3LR22M4Ecjs.startSession; exports.startSessionTitle = _chunk3LR22M4Ecjs.startSessionTitle; exports.withMessageId = _chunk3LR22M4Ecjs.withMessageId; exports.withMute = _chunk3LR22M4Ecjs.withMute; exports.withOrganization = _chunk3LR22M4Ecjs.withOrganization; exports.withProperties = _chunk3LR22M4Ecjs.withProperties; exports.withSessionId = _chunk3LR22M4Ecjs.withSessionId; exports.withUser = _chunk3LR22M4Ecjs.withUser;
package/dist/index.d.cts CHANGED
@@ -143,6 +143,54 @@ declare function callWithProperties<A extends unknown[], F extends (...args: A)
143
143
  declare function withProperties<F extends (this: any, ...args: any[]) => any>(properties: {
144
144
  [name: string]: string;
145
145
  }, fn: F, thisArg?: ThisParameterType<F>): F;
146
+ declare function setUser(user: {
147
+ id: string;
148
+ email?: string;
149
+ name?: string;
150
+ role?: string;
151
+ plan?: string;
152
+ traits?: Record<string, string>;
153
+ }): void;
154
+ declare function setOrganization(org: {
155
+ id: string;
156
+ name?: string;
157
+ plan?: string;
158
+ domain?: string;
159
+ traits?: Record<string, string>;
160
+ }): void;
161
+ declare function setMessageId(id: string): void;
162
+ declare function callWithUser<A extends unknown[], F extends (...args: A) => ReturnType<F>>(user: {
163
+ id: string;
164
+ email?: string;
165
+ name?: string;
166
+ role?: string;
167
+ plan?: string;
168
+ traits?: Record<string, string>;
169
+ }, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
170
+ declare function withUser<F extends (this: any, ...args: any[]) => any>(user: {
171
+ id: string;
172
+ email?: string;
173
+ name?: string;
174
+ role?: string;
175
+ plan?: string;
176
+ traits?: Record<string, string>;
177
+ }, fn: F, thisArg?: ThisParameterType<F>): F;
178
+ declare function callWithOrganization<A extends unknown[], F extends (...args: A) => ReturnType<F>>(org: {
179
+ id: string;
180
+ name?: string;
181
+ plan?: string;
182
+ domain?: string;
183
+ traits?: Record<string, string>;
184
+ }, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
185
+ declare function withOrganization<F extends (this: any, ...args: any[]) => any>(org: {
186
+ id: string;
187
+ name?: string;
188
+ plan?: string;
189
+ domain?: string;
190
+ traits?: Record<string, string>;
191
+ }, fn: F, thisArg?: ThisParameterType<F>): F;
192
+ declare function callWithMessageId<A extends unknown[], F extends (...args: A) => ReturnType<F>>(id: string, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
193
+ declare function withMessageId<F extends (this: any, ...args: any[]) => any>(id: string, fn: F, thisArg?: ThisParameterType<F>): F;
146
194
  interface IMuteOptions {
147
195
  input?: boolean;
148
196
  output?: boolean;
@@ -163,6 +211,21 @@ declare class Session {
163
211
  setOutput(text: string | null, context?: Record<string, AttributeValue>): void;
164
212
  setTitle(title: string): void;
165
213
  updateProperties(properties: Record<string, AttributeValue>): void;
214
+ setUser(user: {
215
+ id: string;
216
+ email?: string;
217
+ name?: string;
218
+ role?: string;
219
+ plan?: string;
220
+ traits?: Record<string, string>;
221
+ }): void;
222
+ setOrganization(org: {
223
+ id: string;
224
+ name?: string;
225
+ plan?: string;
226
+ domain?: string;
227
+ traits?: Record<string, string>;
228
+ }): void;
166
229
  addExternalLink(url: string, options?: {
167
230
  title?: string;
168
231
  linkType?: string;
@@ -179,6 +242,27 @@ declare function addExternalLink(url: string, options?: {
179
242
  title?: string;
180
243
  linkType?: string;
181
244
  }): void;
245
+ declare function recordFeedback(type: string, options?: {
246
+ score?: number;
247
+ reason?: string;
248
+ comment?: string;
249
+ source?: string;
250
+ messageId?: string;
251
+ sessionId?: string;
252
+ attributes?: Record<string, string>;
253
+ }): void;
254
+ declare function recordMetric(options: {
255
+ name: string;
256
+ value: number | boolean;
257
+ unit?: string;
258
+ comment?: string;
259
+ attributes?: Record<string, string>;
260
+ polarity?: 'positive' | 'negative';
261
+ minValue?: number;
262
+ maxValue?: number;
263
+ timestamp?: Date;
264
+ sessionId?: string;
265
+ }): void;
182
266
  declare function startSession<T>(sessionId: string, callback: (session: Session) => T, extraProperties?: Record<string, AttributeValue>, options?: {
183
267
  mode?: 'default' | 'title';
184
268
  }): T;
@@ -202,4 +286,4 @@ declare namespace init {
202
286
  export { };
203
287
  }
204
288
 
205
- export { Brizz, DEFAULT_PII_PATTERNS, type IAttributesMaskingRule, type IBrizzInitializeOptions, type IEventMaskingConfig, type IEventMaskingRule, type IInstrumentModules, type ILogMaskingConfig, type ILogger, type IMCPManualModules, type IMaskingConfig, type IMuteOptions, type ISpanMaskingConfig, LogLevel, type MaskingMode, type RuntimeInfo, Session, SessionTitle, addExternalLink, callWithMute, callWithProperties, callWithSessionId, detectRuntime, emitEvent, emitEventWithSessionId, getActiveSession, getLogLevel, getMetricsExporter, getMetricsReader, getSpanExporter, getSpanProcessor, init, logger, maskAttributes, maskValue, setCurrentSpanCustomProperties, setLogLevel, startSession, startSessionTitle, withMute, withProperties, withSessionId };
289
+ export { Brizz, DEFAULT_PII_PATTERNS, type IAttributesMaskingRule, type IBrizzInitializeOptions, type IEventMaskingConfig, type IEventMaskingRule, type IInstrumentModules, type ILogMaskingConfig, type ILogger, type IMCPManualModules, type IMaskingConfig, type IMuteOptions, type ISpanMaskingConfig, LogLevel, type MaskingMode, type RuntimeInfo, Session, SessionTitle, addExternalLink, callWithMessageId, callWithMute, callWithOrganization, callWithProperties, callWithSessionId, callWithUser, detectRuntime, emitEvent, emitEventWithSessionId, getActiveSession, getLogLevel, getMetricsExporter, getMetricsReader, getSpanExporter, getSpanProcessor, init, logger, maskAttributes, maskValue, recordFeedback, recordMetric, setCurrentSpanCustomProperties, setLogLevel, setMessageId, setOrganization, setUser, startSession, startSessionTitle, withMessageId, withMute, withOrganization, withProperties, withSessionId, withUser };
package/dist/index.d.ts CHANGED
@@ -143,6 +143,54 @@ declare function callWithProperties<A extends unknown[], F extends (...args: A)
143
143
  declare function withProperties<F extends (this: any, ...args: any[]) => any>(properties: {
144
144
  [name: string]: string;
145
145
  }, fn: F, thisArg?: ThisParameterType<F>): F;
146
+ declare function setUser(user: {
147
+ id: string;
148
+ email?: string;
149
+ name?: string;
150
+ role?: string;
151
+ plan?: string;
152
+ traits?: Record<string, string>;
153
+ }): void;
154
+ declare function setOrganization(org: {
155
+ id: string;
156
+ name?: string;
157
+ plan?: string;
158
+ domain?: string;
159
+ traits?: Record<string, string>;
160
+ }): void;
161
+ declare function setMessageId(id: string): void;
162
+ declare function callWithUser<A extends unknown[], F extends (...args: A) => ReturnType<F>>(user: {
163
+ id: string;
164
+ email?: string;
165
+ name?: string;
166
+ role?: string;
167
+ plan?: string;
168
+ traits?: Record<string, string>;
169
+ }, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
170
+ declare function withUser<F extends (this: any, ...args: any[]) => any>(user: {
171
+ id: string;
172
+ email?: string;
173
+ name?: string;
174
+ role?: string;
175
+ plan?: string;
176
+ traits?: Record<string, string>;
177
+ }, fn: F, thisArg?: ThisParameterType<F>): F;
178
+ declare function callWithOrganization<A extends unknown[], F extends (...args: A) => ReturnType<F>>(org: {
179
+ id: string;
180
+ name?: string;
181
+ plan?: string;
182
+ domain?: string;
183
+ traits?: Record<string, string>;
184
+ }, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
185
+ declare function withOrganization<F extends (this: any, ...args: any[]) => any>(org: {
186
+ id: string;
187
+ name?: string;
188
+ plan?: string;
189
+ domain?: string;
190
+ traits?: Record<string, string>;
191
+ }, fn: F, thisArg?: ThisParameterType<F>): F;
192
+ declare function callWithMessageId<A extends unknown[], F extends (...args: A) => ReturnType<F>>(id: string, fn: F, thisArg?: ThisParameterType<F>, ...args: A): ReturnType<F>;
193
+ declare function withMessageId<F extends (this: any, ...args: any[]) => any>(id: string, fn: F, thisArg?: ThisParameterType<F>): F;
146
194
  interface IMuteOptions {
147
195
  input?: boolean;
148
196
  output?: boolean;
@@ -163,6 +211,21 @@ declare class Session {
163
211
  setOutput(text: string | null, context?: Record<string, AttributeValue>): void;
164
212
  setTitle(title: string): void;
165
213
  updateProperties(properties: Record<string, AttributeValue>): void;
214
+ setUser(user: {
215
+ id: string;
216
+ email?: string;
217
+ name?: string;
218
+ role?: string;
219
+ plan?: string;
220
+ traits?: Record<string, string>;
221
+ }): void;
222
+ setOrganization(org: {
223
+ id: string;
224
+ name?: string;
225
+ plan?: string;
226
+ domain?: string;
227
+ traits?: Record<string, string>;
228
+ }): void;
166
229
  addExternalLink(url: string, options?: {
167
230
  title?: string;
168
231
  linkType?: string;
@@ -179,6 +242,27 @@ declare function addExternalLink(url: string, options?: {
179
242
  title?: string;
180
243
  linkType?: string;
181
244
  }): void;
245
+ declare function recordFeedback(type: string, options?: {
246
+ score?: number;
247
+ reason?: string;
248
+ comment?: string;
249
+ source?: string;
250
+ messageId?: string;
251
+ sessionId?: string;
252
+ attributes?: Record<string, string>;
253
+ }): void;
254
+ declare function recordMetric(options: {
255
+ name: string;
256
+ value: number | boolean;
257
+ unit?: string;
258
+ comment?: string;
259
+ attributes?: Record<string, string>;
260
+ polarity?: 'positive' | 'negative';
261
+ minValue?: number;
262
+ maxValue?: number;
263
+ timestamp?: Date;
264
+ sessionId?: string;
265
+ }): void;
182
266
  declare function startSession<T>(sessionId: string, callback: (session: Session) => T, extraProperties?: Record<string, AttributeValue>, options?: {
183
267
  mode?: 'default' | 'title';
184
268
  }): T;
@@ -202,4 +286,4 @@ declare namespace init {
202
286
  export { };
203
287
  }
204
288
 
205
- export { Brizz, DEFAULT_PII_PATTERNS, type IAttributesMaskingRule, type IBrizzInitializeOptions, type IEventMaskingConfig, type IEventMaskingRule, type IInstrumentModules, type ILogMaskingConfig, type ILogger, type IMCPManualModules, type IMaskingConfig, type IMuteOptions, type ISpanMaskingConfig, LogLevel, type MaskingMode, type RuntimeInfo, Session, SessionTitle, addExternalLink, callWithMute, callWithProperties, callWithSessionId, detectRuntime, emitEvent, emitEventWithSessionId, getActiveSession, getLogLevel, getMetricsExporter, getMetricsReader, getSpanExporter, getSpanProcessor, init, logger, maskAttributes, maskValue, setCurrentSpanCustomProperties, setLogLevel, startSession, startSessionTitle, withMute, withProperties, withSessionId };
289
+ export { Brizz, DEFAULT_PII_PATTERNS, type IAttributesMaskingRule, type IBrizzInitializeOptions, type IEventMaskingConfig, type IEventMaskingRule, type IInstrumentModules, type ILogMaskingConfig, type ILogger, type IMCPManualModules, type IMaskingConfig, type IMuteOptions, type ISpanMaskingConfig, LogLevel, type MaskingMode, type RuntimeInfo, Session, SessionTitle, addExternalLink, callWithMessageId, callWithMute, callWithOrganization, callWithProperties, callWithSessionId, callWithUser, detectRuntime, emitEvent, emitEventWithSessionId, getActiveSession, getLogLevel, getMetricsExporter, getMetricsReader, getSpanExporter, getSpanProcessor, init, logger, maskAttributes, maskValue, recordFeedback, recordMetric, setCurrentSpanCustomProperties, setLogLevel, setMessageId, setOrganization, setUser, startSession, startSessionTitle, withMessageId, withMute, withOrganization, withProperties, withSessionId, withUser };
package/dist/index.js CHANGED
@@ -4,9 +4,12 @@ import {
4
4
  Session,
5
5
  SessionTitle,
6
6
  addExternalLink,
7
+ callWithMessageId,
7
8
  callWithMute,
9
+ callWithOrganization,
8
10
  callWithProperties,
9
11
  callWithSessionId,
12
+ callWithUser,
10
13
  detectRuntime,
11
14
  emitEvent,
12
15
  emitEventWithSessionId,
@@ -17,23 +20,31 @@ import {
17
20
  getSpanProcessor,
18
21
  maskAttributes,
19
22
  maskValue,
23
+ recordFeedback,
24
+ recordMetric,
20
25
  setCurrentSpanCustomProperties,
26
+ setMessageId,
27
+ setOrganization,
28
+ setUser,
21
29
  startSession,
22
30
  startSessionTitle,
31
+ withMessageId,
23
32
  withMute,
33
+ withOrganization,
24
34
  withProperties,
25
- withSessionId
26
- } from "./chunk-U474AL6K.js";
35
+ withSessionId,
36
+ withUser
37
+ } from "./chunk-F3O3MTQ4.js";
27
38
  import "./chunk-7SUF4VVI.js";
28
- import "./chunk-6M3CBP2N.js";
39
+ import "./chunk-64STNQKL.js";
29
40
  import {
30
41
  LogLevel,
31
42
  getLogLevel,
32
43
  logger,
33
44
  setLogLevel
34
45
  } from "./chunk-Y4HNUX3Q.js";
35
- import "./chunk-LTLONC6I.js";
36
- import "./chunk-VGMJ3KUM.js";
46
+ import "./chunk-24CEDVD2.js";
47
+ import "./chunk-QY4VADPP.js";
37
48
  import "./chunk-3RG5ZIWI.js";
38
49
 
39
50
  // src/internal/instrumentation/auto-init.ts
@@ -83,7 +94,7 @@ function loadGenAIInstrumentations() {
83
94
  function loadMCPInstrumentation() {
84
95
  void (async () => {
85
96
  try {
86
- const { MCPInstrumentation } = await import("./mcp-3YERODPL.js");
97
+ const { MCPInstrumentation } = await import("./mcp-ZP6AY3FE.js");
87
98
  const mcp = new MCPInstrumentation({ exceptionLogger });
88
99
  registerInstrumentations({ instrumentations: [mcp] });
89
100
  logger.debug("Auto-loaded MCP instrumentation");
@@ -125,7 +136,7 @@ function loadVercelAITelemetry() {
125
136
  }
126
137
  const isV7 = typeof ai.registerTelemetry === "function";
127
138
  const integrations = [];
128
- const { createInterruptIntegration } = await import("./interrupt-VMUSMALH.js");
139
+ const { createInterruptIntegration } = await import("./interrupt-KADNA6WK.js");
129
140
  integrations.push(createInterruptIntegration());
130
141
  let otelCollectorLoaded = false;
131
142
  try {
@@ -183,9 +194,12 @@ export {
183
194
  SessionTitle,
184
195
  SeverityNumber,
185
196
  addExternalLink,
197
+ callWithMessageId,
186
198
  callWithMute,
199
+ callWithOrganization,
187
200
  callWithProperties,
188
201
  callWithSessionId,
202
+ callWithUser,
189
203
  detectRuntime,
190
204
  emitEvent,
191
205
  emitEventWithSessionId,
@@ -199,11 +213,19 @@ export {
199
213
  logger,
200
214
  maskAttributes,
201
215
  maskValue,
216
+ recordFeedback,
217
+ recordMetric,
202
218
  setCurrentSpanCustomProperties,
203
219
  setLogLevel,
220
+ setMessageId,
221
+ setOrganization,
222
+ setUser,
204
223
  startSession,
205
224
  startSessionTitle,
225
+ withMessageId,
206
226
  withMute,
227
+ withOrganization,
207
228
  withProperties,
208
- withSessionId
229
+ withSessionId,
230
+ withUser
209
231
  };
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+ var _chunkM3UGFLH7cjs = require('./chunk-M3UGFLH7.cjs');
6
+ require('./chunk-NEF2O7HF.cjs');
7
+ require('./chunk-OBGZSXTJ.cjs');
8
+
9
+
10
+
11
+
12
+ exports.InterruptPropagator = _chunkM3UGFLH7cjs.InterruptPropagator; exports._resetInterruptState = _chunkM3UGFLH7cjs._resetInterruptState; exports.createInterruptIntegration = _chunkM3UGFLH7cjs.createInterruptIntegration;
@@ -2,8 +2,8 @@ import {
2
2
  InterruptPropagator,
3
3
  _resetInterruptState,
4
4
  createInterruptIntegration
5
- } from "./chunk-LTLONC6I.js";
6
- import "./chunk-VGMJ3KUM.js";
5
+ } from "./chunk-24CEDVD2.js";
6
+ import "./chunk-QY4VADPP.js";
7
7
  import "./chunk-3RG5ZIWI.js";
8
8
  export {
9
9
  InterruptPropagator,
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkSCYD7XCIcjs = require('./chunk-SCYD7XCI.cjs');
3
+ var _chunkVU5YDLUDcjs = require('./chunk-VU5YDLUD.cjs');
4
4
 
5
5
 
6
6
  var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
@@ -8,7 +8,7 @@ var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkOZCOXBB7cjs = require('./chunk-OZCOXBB7.cjs');
11
+ var _chunkNEF2O7HFcjs = require('./chunk-NEF2O7HF.cjs');
12
12
  require('./chunk-OBGZSXTJ.cjs');
13
13
 
14
14
  // src/internal/instrumentation/mcp/instrumentation.ts
@@ -139,7 +139,7 @@ function stampAndPropagateSession(span, sessionId, baseContext = _api.context.ac
139
139
  }
140
140
  if (span.isRecording()) {
141
141
  try {
142
- span.setAttribute(`${_chunkOZCOXBB7cjs.BRIZZ}.${_chunkOZCOXBB7cjs.SESSION_ID}`, sessionId);
142
+ span.setAttribute(`${_chunkNEF2O7HFcjs.BRIZZ}.${_chunkNEF2O7HFcjs.SESSION_ID}`, sessionId);
143
143
  } catch (error) {
144
144
  _chunkWC573FCIcjs.logger.warn(
145
145
  `Brizz MCP: failed to stamp session id on span: ${String(error)}`
@@ -147,10 +147,10 @@ function stampAndPropagateSession(span, sessionId, baseContext = _api.context.ac
147
147
  }
148
148
  }
149
149
  try {
150
- const prev = baseContext.getValue(_chunkOZCOXBB7cjs.PROPERTIES_CONTEXT_KEY);
151
- const merged = prev ? { ...prev, [_chunkOZCOXBB7cjs.SESSION_ID]: sessionId } : { [_chunkOZCOXBB7cjs.SESSION_ID]: sessionId };
150
+ const prev = baseContext.getValue(_chunkNEF2O7HFcjs.PROPERTIES_CONTEXT_KEY);
151
+ const merged = prev ? { ...prev, [_chunkNEF2O7HFcjs.SESSION_ID]: sessionId } : { [_chunkNEF2O7HFcjs.SESSION_ID]: sessionId };
152
152
  return {
153
- context: baseContext.setValue(_chunkOZCOXBB7cjs.PROPERTIES_CONTEXT_KEY, merged),
153
+ context: baseContext.setValue(_chunkNEF2O7HFcjs.PROPERTIES_CONTEXT_KEY, merged),
154
154
  sessionId
155
155
  };
156
156
  } catch (error) {
@@ -570,7 +570,7 @@ function safeEnd(span) {
570
570
 
571
571
  // src/internal/instrumentation/mcp/version.ts
572
572
  var INSTRUMENTATION_NAME = "@brizz/sdk/mcp";
573
- var INSTRUMENTATION_VERSION = _chunkSCYD7XCIcjs.getSDKVersion.call(void 0, );
573
+ var INSTRUMENTATION_VERSION = _chunkVU5YDLUDcjs.getSDKVersion.call(void 0, );
574
574
 
575
575
  // src/internal/instrumentation/mcp/instrumentation.ts
576
576
  var PROTOCOL_MODULE_NAME = "@modelcontextprotocol/sdk/shared/protocol.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getSDKVersion
3
- } from "./chunk-6M3CBP2N.js";
3
+ } from "./chunk-64STNQKL.js";
4
4
  import {
5
5
  logger
6
6
  } from "./chunk-Y4HNUX3Q.js";
@@ -8,7 +8,7 @@ import {
8
8
  BRIZZ,
9
9
  PROPERTIES_CONTEXT_KEY,
10
10
  SESSION_ID
11
- } from "./chunk-VGMJ3KUM.js";
11
+ } from "./chunk-QY4VADPP.js";
12
12
  import "./chunk-3RG5ZIWI.js";
13
13
 
14
14
  // src/internal/instrumentation/mcp/instrumentation.ts
package/dist/preload.cjs CHANGED
@@ -1,15 +1,15 @@
1
1
  "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
3
 
4
- var _chunkIH7TSRRTcjs = require('./chunk-IH7TSRRT.cjs');
4
+ var _chunk3LR22M4Ecjs = require('./chunk-3LR22M4E.cjs');
5
5
  require('./chunk-UNLNNKZ7.cjs');
6
- require('./chunk-SCYD7XCI.cjs');
6
+ require('./chunk-VU5YDLUD.cjs');
7
7
 
8
8
 
9
9
 
10
10
  var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
11
- require('./chunk-A3OOY5A2.cjs');
12
- require('./chunk-OZCOXBB7.cjs');
11
+ require('./chunk-M3UGFLH7.cjs');
12
+ require('./chunk-NEF2O7HF.cjs');
13
13
  require('./chunk-OBGZSXTJ.cjs');
14
14
 
15
15
  // src/node/loader.ts
@@ -96,16 +96,16 @@ if (globalThis[LOADER_REGISTERED_KEY] !== true) {
96
96
  }
97
97
 
98
98
  // src/preload.ts
99
- var runtime = _chunkIH7TSRRTcjs.detectRuntime.call(void 0, );
99
+ var runtime = _chunk3LR22M4Ecjs.detectRuntime.call(void 0, );
100
100
  if (runtime.isESM && runtime.supportsLoaderAPI) {
101
101
  maybeRegisterESMLoader();
102
102
  }
103
103
  try {
104
104
  const logLevel = process.env["BRIZZ_LOG_LEVEL"] || _chunkWC573FCIcjs.DEFAULT_LOG_LEVEL.toString();
105
105
  if (process.env["BRIZZ_DSN"]) {
106
- _chunkIH7TSRRTcjs.Brizz.initialize({ logLevel, disableNodeSdk: false });
106
+ _chunk3LR22M4Ecjs.Brizz.initialize({ logLevel, disableNodeSdk: false });
107
107
  } else {
108
- _chunkIH7TSRRTcjs.Brizz.initialize({
108
+ _chunk3LR22M4Ecjs.Brizz.initialize({
109
109
  apiKey: process.env["BRIZZ_API_KEY"],
110
110
  baseUrl: process.env["BRIZZ_BASE_URL"],
111
111
  appName: process.env["BRIZZ_APP_NAME"] || process.env["OTEL_SERVICE_NAME"],
package/dist/preload.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  Brizz,
3
3
  detectRuntime
4
- } from "./chunk-U474AL6K.js";
4
+ } from "./chunk-F3O3MTQ4.js";
5
5
  import "./chunk-7SUF4VVI.js";
6
- import "./chunk-6M3CBP2N.js";
6
+ import "./chunk-64STNQKL.js";
7
7
  import {
8
8
  DEFAULT_LOG_LEVEL,
9
9
  logger
10
10
  } from "./chunk-Y4HNUX3Q.js";
11
- import "./chunk-LTLONC6I.js";
12
- import "./chunk-VGMJ3KUM.js";
11
+ import "./chunk-24CEDVD2.js";
12
+ import "./chunk-QY4VADPP.js";
13
13
  import "./chunk-3RG5ZIWI.js";
14
14
 
15
15
  // src/node/loader.ts