@brizz/sdk 0.1.30 → 0.1.33

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.
@@ -142,17 +142,11 @@ function getLogLevel() {
142
142
  return logger.getLevel();
143
143
  }
144
144
 
145
- // src/internal/version.ts
146
- function getSDKVersion() {
147
- return "0.1.30";
148
- }
149
-
150
145
  export {
151
146
  LogLevel,
152
147
  DEFAULT_LOG_LEVEL,
153
148
  parseLogLevel,
154
149
  logger,
155
150
  setLogLevel,
156
- getLogLevel,
157
- getSDKVersion
151
+ getLogLevel
158
152
  };
package/dist/eve.cjs ADDED
@@ -0,0 +1,88 @@
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
+
3
+ var _chunkUNLNNKZ7cjs = require('./chunk-UNLNNKZ7.cjs');
4
+
5
+
6
+ var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
7
+ require('./chunk-OBGZSXTJ.cjs');
8
+
9
+ // src/internal/trace/processors/eve-session-processor.ts
10
+ var EVE_SESSION_ID = "eve.session.id";
11
+ var EVE_SESSION_ID_NAMESPACED = "ai.settings.context.eve.session.id";
12
+ var BRIZZ_SESSION_ID = "brizz.session.id";
13
+ function createEveSessionProcessor() {
14
+ const sessionByTrace = /* @__PURE__ */ new Map();
15
+ const readEveSessionId = (span) => {
16
+ const value = _nullishCoalesce(span.attributes[EVE_SESSION_ID], () => ( span.attributes[EVE_SESSION_ID_NAMESPACED]));
17
+ return typeof value === "string" && value ? value : void 0;
18
+ };
19
+ return {
20
+ onStart(span, _parentContext) {
21
+ const traceId = span.spanContext().traceId;
22
+ const own = readEveSessionId(span);
23
+ if (own && !sessionByTrace.has(traceId)) {
24
+ sessionByTrace.set(traceId, own);
25
+ }
26
+ const sessionId = sessionByTrace.get(traceId);
27
+ const alreadyStamped = span.attributes[BRIZZ_SESSION_ID];
28
+ if (sessionId && !alreadyStamped) {
29
+ span.setAttribute(BRIZZ_SESSION_ID, sessionId);
30
+ }
31
+ },
32
+ onEnd(span) {
33
+ const carriesEveSession = span.attributes[EVE_SESSION_ID];
34
+ if (!_optionalChain([span, 'access', _ => _.parentSpanContext, 'optionalAccess', _2 => _2.spanId]) || carriesEveSession) {
35
+ sessionByTrace.delete(span.spanContext().traceId);
36
+ }
37
+ },
38
+ forceFlush() {
39
+ return Promise.resolve();
40
+ },
41
+ shutdown() {
42
+ sessionByTrace.clear();
43
+ return Promise.resolve();
44
+ }
45
+ };
46
+ }
47
+
48
+ // src/internal/trace/exporters/eve-trace-exporter.ts
49
+ var _exportertraceotlpproto = require('@opentelemetry/exporter-trace-otlp-proto');
50
+ var DEFAULT_BASE_URL = "https://telemetry.brizz.dev";
51
+ function resolveEveExporterConfig(options = {}) {
52
+ const dsn = _nullishCoalesce(options.dsn, () => ( process.env["BRIZZ_DSN"]));
53
+ let bearer;
54
+ let baseUrl;
55
+ if (dsn) {
56
+ const parsed = _chunkUNLNNKZ7cjs.parseDSN.call(void 0, dsn, { allowPlaceholderService: true });
57
+ if (parsed) {
58
+ bearer = parsed.bearer;
59
+ baseUrl = parsed.baseUrl;
60
+ } else {
61
+ _chunkWC573FCIcjs.logger.warn("BRIZZ_DSN did not parse; exporting to the default endpoint without auth");
62
+ baseUrl = DEFAULT_BASE_URL;
63
+ }
64
+ } else {
65
+ bearer = process.env["BRIZZ_API_KEY"];
66
+ baseUrl = process.env["BRIZZ_BASE_URL"] || DEFAULT_BASE_URL;
67
+ }
68
+ const headers = {};
69
+ if (bearer) {
70
+ headers["Authorization"] = `Bearer ${bearer}`;
71
+ }
72
+ return { url: baseUrl.replace(/\/$/, "") + "/v1/traces", headers };
73
+ }
74
+ function createEveTraceExporter(options = {}) {
75
+ return new (0, _exportertraceotlpproto.OTLPTraceExporter)(resolveEveExporterConfig(options));
76
+ }
77
+ function createEveOtelConfig(options = {}) {
78
+ return {
79
+ serviceName: options.serviceName,
80
+ traceExporter: createEveTraceExporter(options),
81
+ spanProcessors: [createEveSessionProcessor(), "auto"]
82
+ };
83
+ }
84
+
85
+
86
+
87
+
88
+ exports.createEveOtelConfig = createEveOtelConfig; exports.createEveSessionProcessor = createEveSessionProcessor; exports.createEveTraceExporter = createEveTraceExporter;
package/dist/eve.d.cts ADDED
@@ -0,0 +1,19 @@
1
+ import { SpanProcessor, SpanExporter } from '@opentelemetry/sdk-trace-base';
2
+
3
+ declare function createEveSessionProcessor(): SpanProcessor;
4
+
5
+ interface ICreateEveTraceExporterOptions {
6
+ dsn?: string;
7
+ }
8
+ interface ICreateEveOtelConfigOptions extends ICreateEveTraceExporterOptions {
9
+ serviceName?: string;
10
+ }
11
+ interface IEveOtelConfig {
12
+ serviceName?: string;
13
+ traceExporter: SpanExporter;
14
+ spanProcessors: Array<SpanProcessor | 'auto'>;
15
+ }
16
+ declare function createEveTraceExporter(options?: ICreateEveTraceExporterOptions): SpanExporter;
17
+ declare function createEveOtelConfig(options?: ICreateEveOtelConfigOptions): IEveOtelConfig;
18
+
19
+ export { createEveOtelConfig, createEveSessionProcessor, createEveTraceExporter };
package/dist/eve.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { SpanProcessor, SpanExporter } from '@opentelemetry/sdk-trace-base';
2
+
3
+ declare function createEveSessionProcessor(): SpanProcessor;
4
+
5
+ interface ICreateEveTraceExporterOptions {
6
+ dsn?: string;
7
+ }
8
+ interface ICreateEveOtelConfigOptions extends ICreateEveTraceExporterOptions {
9
+ serviceName?: string;
10
+ }
11
+ interface IEveOtelConfig {
12
+ serviceName?: string;
13
+ traceExporter: SpanExporter;
14
+ spanProcessors: Array<SpanProcessor | 'auto'>;
15
+ }
16
+ declare function createEveTraceExporter(options?: ICreateEveTraceExporterOptions): SpanExporter;
17
+ declare function createEveOtelConfig(options?: ICreateEveOtelConfigOptions): IEveOtelConfig;
18
+
19
+ export { createEveOtelConfig, createEveSessionProcessor, createEveTraceExporter };
package/dist/eve.js ADDED
@@ -0,0 +1,88 @@
1
+ import {
2
+ parseDSN
3
+ } from "./chunk-7SUF4VVI.js";
4
+ import {
5
+ logger
6
+ } from "./chunk-Y4HNUX3Q.js";
7
+ import "./chunk-3RG5ZIWI.js";
8
+
9
+ // src/internal/trace/processors/eve-session-processor.ts
10
+ var EVE_SESSION_ID = "eve.session.id";
11
+ var EVE_SESSION_ID_NAMESPACED = "ai.settings.context.eve.session.id";
12
+ var BRIZZ_SESSION_ID = "brizz.session.id";
13
+ function createEveSessionProcessor() {
14
+ const sessionByTrace = /* @__PURE__ */ new Map();
15
+ const readEveSessionId = (span) => {
16
+ const value = span.attributes[EVE_SESSION_ID] ?? span.attributes[EVE_SESSION_ID_NAMESPACED];
17
+ return typeof value === "string" && value ? value : void 0;
18
+ };
19
+ return {
20
+ onStart(span, _parentContext) {
21
+ const traceId = span.spanContext().traceId;
22
+ const own = readEveSessionId(span);
23
+ if (own && !sessionByTrace.has(traceId)) {
24
+ sessionByTrace.set(traceId, own);
25
+ }
26
+ const sessionId = sessionByTrace.get(traceId);
27
+ const alreadyStamped = span.attributes[BRIZZ_SESSION_ID];
28
+ if (sessionId && !alreadyStamped) {
29
+ span.setAttribute(BRIZZ_SESSION_ID, sessionId);
30
+ }
31
+ },
32
+ onEnd(span) {
33
+ const carriesEveSession = span.attributes[EVE_SESSION_ID];
34
+ if (!span.parentSpanContext?.spanId || carriesEveSession) {
35
+ sessionByTrace.delete(span.spanContext().traceId);
36
+ }
37
+ },
38
+ forceFlush() {
39
+ return Promise.resolve();
40
+ },
41
+ shutdown() {
42
+ sessionByTrace.clear();
43
+ return Promise.resolve();
44
+ }
45
+ };
46
+ }
47
+
48
+ // src/internal/trace/exporters/eve-trace-exporter.ts
49
+ import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto";
50
+ var DEFAULT_BASE_URL = "https://telemetry.brizz.dev";
51
+ function resolveEveExporterConfig(options = {}) {
52
+ const dsn = options.dsn ?? process.env["BRIZZ_DSN"];
53
+ let bearer;
54
+ let baseUrl;
55
+ if (dsn) {
56
+ const parsed = parseDSN(dsn, { allowPlaceholderService: true });
57
+ if (parsed) {
58
+ bearer = parsed.bearer;
59
+ baseUrl = parsed.baseUrl;
60
+ } else {
61
+ logger.warn("BRIZZ_DSN did not parse; exporting to the default endpoint without auth");
62
+ baseUrl = DEFAULT_BASE_URL;
63
+ }
64
+ } else {
65
+ bearer = process.env["BRIZZ_API_KEY"];
66
+ baseUrl = process.env["BRIZZ_BASE_URL"] || DEFAULT_BASE_URL;
67
+ }
68
+ const headers = {};
69
+ if (bearer) {
70
+ headers["Authorization"] = `Bearer ${bearer}`;
71
+ }
72
+ return { url: baseUrl.replace(/\/$/, "") + "/v1/traces", headers };
73
+ }
74
+ function createEveTraceExporter(options = {}) {
75
+ return new OTLPTraceExporter(resolveEveExporterConfig(options));
76
+ }
77
+ function createEveOtelConfig(options = {}) {
78
+ return {
79
+ serviceName: options.serviceName,
80
+ traceExporter: createEveTraceExporter(options),
81
+ spanProcessors: [createEveSessionProcessor(), "auto"]
82
+ };
83
+ }
84
+ export {
85
+ createEveOtelConfig,
86
+ createEveSessionProcessor,
87
+ createEveTraceExporter
88
+ };
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
4
 
@@ -23,15 +23,28 @@
23
23
 
24
24
 
25
25
 
26
- var _chunkNUTJMVD4cjs = require('./chunk-NUTJMVD4.cjs');
27
26
 
28
27
 
29
28
 
30
29
 
31
30
 
32
- var _chunkJB6MA2RVcjs = require('./chunk-JB6MA2RV.cjs');
33
- require('./chunk-LTXMCGVQ.cjs');
34
- require('./chunk-GCORRK6B.cjs');
31
+
32
+
33
+
34
+
35
+
36
+ var _chunkWXHBHJRJcjs = require('./chunk-WXHBHJRJ.cjs');
37
+ require('./chunk-UNLNNKZ7.cjs');
38
+ require('./chunk-3ITCDKTJ.cjs');
39
+
40
+
41
+
42
+
43
+
44
+ var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
45
+ require('./chunk-LFLYWZ6D.cjs');
46
+ require('./chunk-LIFLVFK6.cjs');
47
+ require('./chunk-OBGZSXTJ.cjs');
35
48
 
36
49
  // src/internal/instrumentation/auto-init.ts
37
50
  var _instrumentation = require('@opentelemetry/instrumentation');
@@ -45,7 +58,7 @@ var _instrumentationpinecone = require('@traceloop/instrumentation-pinecone');
45
58
  var _instrumentationqdrant = require('@traceloop/instrumentation-qdrant');
46
59
  var _instrumentationtogether = require('@traceloop/instrumentation-together');
47
60
  var exceptionLogger = (error) => {
48
- _chunkJB6MA2RVcjs.logger.error(`Exception in instrumentation: ${String(error)}`);
61
+ _chunkWC573FCIcjs.logger.error(`Exception in instrumentation: ${String(error)}`);
49
62
  };
50
63
  function loadGenAIInstrumentations() {
51
64
  const instrumentations = [];
@@ -64,28 +77,28 @@ function loadGenAIInstrumentations() {
64
77
  try {
65
78
  const instrumentation = new config.class({ exceptionLogger });
66
79
  instrumentations.push(instrumentation);
67
- _chunkJB6MA2RVcjs.logger.debug(`Auto-loaded ${config.name} instrumentation`);
80
+ _chunkWC573FCIcjs.logger.debug(`Auto-loaded ${config.name} instrumentation`);
68
81
  } catch (error) {
69
- _chunkJB6MA2RVcjs.logger.error(`Failed to auto-load ${config.name} instrumentation: ${String(error)}`);
82
+ _chunkWC573FCIcjs.logger.error(`Failed to auto-load ${config.name} instrumentation: ${String(error)}`);
70
83
  }
71
84
  }
72
85
  try {
73
86
  _instrumentation.registerInstrumentations.call(void 0, { instrumentations });
74
- _chunkJB6MA2RVcjs.logger.info(`Auto-registered ${instrumentations.length} GenAI instrumentations`);
87
+ _chunkWC573FCIcjs.logger.info(`Auto-registered ${instrumentations.length} GenAI instrumentations`);
75
88
  } catch (error) {
76
- _chunkJB6MA2RVcjs.logger.error(`Failed to register GenAI instrumentations: ${String(error)}`);
89
+ _chunkWC573FCIcjs.logger.error(`Failed to register GenAI instrumentations: ${String(error)}`);
77
90
  }
78
91
  return instrumentations;
79
92
  }
80
93
  function loadMCPInstrumentation() {
81
94
  void (async () => {
82
95
  try {
83
- const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-6BDG4SWY.cjs")));
96
+ const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-OKSS2R56.cjs")));
84
97
  const mcp = new MCPInstrumentation({ exceptionLogger });
85
98
  _instrumentation.registerInstrumentations.call(void 0, { instrumentations: [mcp] });
86
- _chunkJB6MA2RVcjs.logger.debug("Auto-loaded MCP instrumentation");
99
+ _chunkWC573FCIcjs.logger.debug("Auto-loaded MCP instrumentation");
87
100
  } catch (error) {
88
- _chunkJB6MA2RVcjs.logger.debug(
101
+ _chunkWC573FCIcjs.logger.debug(
89
102
  `MCP instrumentation not loaded (install @modelcontextprotocol/sdk and @arizeai/openinference-instrumentation-mcp if you want MCP support): ${String(error)}`
90
103
  );
91
104
  }
@@ -97,30 +110,55 @@ function loadVertexAIInstrumentation() {
97
110
  const { VertexAIInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("@traceloop/instrumentation-vertexai")));
98
111
  const vertexAI = new VertexAIInstrumentation({ exceptionLogger });
99
112
  _instrumentation.registerInstrumentations.call(void 0, { instrumentations: [vertexAI] });
100
- _chunkJB6MA2RVcjs.logger.debug("Auto-loaded Vertex AI instrumentation");
113
+ _chunkWC573FCIcjs.logger.debug("Auto-loaded Vertex AI instrumentation");
101
114
  } catch (error) {
102
- _chunkJB6MA2RVcjs.logger.debug(
115
+ _chunkWC573FCIcjs.logger.debug(
103
116
  `Vertex AI instrumentation not loaded (install @traceloop/instrumentation-vertexai if you want Vertex AI support): ${String(error)}`
104
117
  );
105
118
  }
106
119
  })();
107
120
  }
108
- function loadVercelAIInterruptIntegration() {
121
+ function selectTelemetryRegister(ai) {
122
+ const register = _nullishCoalesce(ai.registerTelemetry, () => ( ai.registerTelemetryIntegration));
123
+ return typeof register === "function" ? register : void 0;
124
+ }
125
+ function loadVercelAITelemetry() {
109
126
  void (async () => {
110
127
  try {
111
128
  const ai = await Promise.resolve().then(() => _interopRequireWildcard(require("ai")));
112
- if (typeof ai.registerTelemetryIntegration !== "function") {
113
- _chunkJB6MA2RVcjs.logger.debug(
114
- "AI SDK present but lacks registerTelemetryIntegration (needs ai@>=6); skipping interrupt bridge"
129
+ const register = selectTelemetryRegister(ai);
130
+ if (!register) {
131
+ _chunkWC573FCIcjs.logger.debug(
132
+ "AI SDK present but lacks a telemetry-registration hook (needs ai@>=6); skipping"
115
133
  );
116
134
  return;
117
135
  }
118
- const { createInterruptIntegration } = await Promise.resolve().then(() => _interopRequireWildcard(require("./interrupt-HOP3XPQF.cjs")));
119
- ai.registerTelemetryIntegration(createInterruptIntegration());
120
- _chunkJB6MA2RVcjs.logger.debug("Auto-loaded Vercel AI interrupt bridge");
136
+ const isV7 = typeof ai.registerTelemetry === "function";
137
+ const integrations = [];
138
+ const { createInterruptIntegration } = await Promise.resolve().then(() => _interopRequireWildcard(require("./interrupt-EMUUN3ER.cjs")));
139
+ integrations.push(createInterruptIntegration());
140
+ let otelCollectorLoaded = false;
141
+ try {
142
+ const otel = await Promise.resolve().then(() => _interopRequireWildcard(require("@ai-sdk/otel")));
143
+ if (typeof otel.LegacyOpenTelemetry === "function") {
144
+ integrations.push(new otel.LegacyOpenTelemetry());
145
+ otelCollectorLoaded = true;
146
+ }
147
+ } catch (e) {
148
+ }
149
+ if (!otelCollectorLoaded) {
150
+ const message = "AI SDK present but @ai-sdk/otel is missing or unusable; install it (npm install @ai-sdk/otel) to capture AI SDK spans on ai@>=7";
151
+ if (isV7) {
152
+ _chunkWC573FCIcjs.logger.warn(message);
153
+ } else {
154
+ _chunkWC573FCIcjs.logger.debug(message);
155
+ }
156
+ }
157
+ register(...integrations);
158
+ _chunkWC573FCIcjs.logger.debug("Auto-loaded Vercel AI telemetry");
121
159
  } catch (error) {
122
- _chunkJB6MA2RVcjs.logger.debug(
123
- `Vercel AI interrupt bridge not loaded (install ai@>=6 if you want HITL attribution): ${String(error)}`
160
+ _chunkWC573FCIcjs.logger.debug(
161
+ `Vercel AI telemetry not loaded (install ai@>=6 to capture AI SDK telemetry): ${String(error)}`
124
162
  );
125
163
  }
126
164
  })();
@@ -130,13 +168,13 @@ function autoInitializeInstrumentations() {
130
168
  const genAIInstrumentations = loadGenAIInstrumentations();
131
169
  loadMCPInstrumentation();
132
170
  loadVertexAIInstrumentation();
133
- loadVercelAIInterruptIntegration();
134
- _chunkJB6MA2RVcjs.logger.info(
171
+ loadVercelAITelemetry();
172
+ _chunkWC573FCIcjs.logger.info(
135
173
  `Auto-initialization complete: ${genAIInstrumentations.length} GenAI instrumentations`
136
174
  );
137
175
  return true;
138
176
  } catch (error) {
139
- _chunkJB6MA2RVcjs.logger.error(`Auto-initialization failed: ${String(error)}`);
177
+ _chunkWC573FCIcjs.logger.error(`Auto-initialization failed: ${String(error)}`);
140
178
  return false;
141
179
  }
142
180
  }
@@ -178,4 +216,14 @@ var init_exports = {};
178
216
 
179
217
 
180
218
 
181
- exports.Brizz = _chunkNUTJMVD4cjs.Brizz; exports.DEFAULT_PII_PATTERNS = _chunkNUTJMVD4cjs.DEFAULT_PII_PATTERNS; exports.LogLevel = _chunkJB6MA2RVcjs.LogLevel; exports.Session = _chunkNUTJMVD4cjs.Session; exports.SessionTitle = _chunkNUTJMVD4cjs.SessionTitle; exports.SeverityNumber = _apilogs.SeverityNumber; exports.addExternalLink = _chunkNUTJMVD4cjs.addExternalLink; exports.callWithMute = _chunkNUTJMVD4cjs.callWithMute; exports.callWithProperties = _chunkNUTJMVD4cjs.callWithProperties; exports.callWithSessionId = _chunkNUTJMVD4cjs.callWithSessionId; exports.detectRuntime = _chunkNUTJMVD4cjs.detectRuntime; exports.emitEvent = _chunkNUTJMVD4cjs.emitEvent; exports.emitEventWithSessionId = _chunkNUTJMVD4cjs.emitEventWithSessionId; exports.getActiveSession = _chunkNUTJMVD4cjs.getActiveSession; exports.getLogLevel = _chunkJB6MA2RVcjs.getLogLevel; exports.getMetricsExporter = _chunkNUTJMVD4cjs.getMetricsExporter; exports.getMetricsReader = _chunkNUTJMVD4cjs.getMetricsReader; exports.getSpanExporter = _chunkNUTJMVD4cjs.getSpanExporter; exports.getSpanProcessor = _chunkNUTJMVD4cjs.getSpanProcessor; exports.init = init_exports; exports.logger = _chunkJB6MA2RVcjs.logger; exports.maskAttributes = _chunkNUTJMVD4cjs.maskAttributes; exports.maskValue = _chunkNUTJMVD4cjs.maskValue; exports.setCurrentSpanCustomProperties = _chunkNUTJMVD4cjs.setCurrentSpanCustomProperties; exports.setLogLevel = _chunkJB6MA2RVcjs.setLogLevel; exports.startSession = _chunkNUTJMVD4cjs.startSession; exports.startSessionTitle = _chunkNUTJMVD4cjs.startSessionTitle; exports.withMute = _chunkNUTJMVD4cjs.withMute; exports.withProperties = _chunkNUTJMVD4cjs.withProperties; exports.withSessionId = _chunkNUTJMVD4cjs.withSessionId;
219
+
220
+
221
+
222
+
223
+
224
+
225
+
226
+
227
+
228
+
229
+ exports.Brizz = _chunkWXHBHJRJcjs.Brizz; exports.DEFAULT_PII_PATTERNS = _chunkWXHBHJRJcjs.DEFAULT_PII_PATTERNS; exports.LogLevel = _chunkWC573FCIcjs.LogLevel; exports.Session = _chunkWXHBHJRJcjs.Session; exports.SessionTitle = _chunkWXHBHJRJcjs.SessionTitle; exports.SeverityNumber = _apilogs.SeverityNumber; exports.addExternalLink = _chunkWXHBHJRJcjs.addExternalLink; exports.callWithMessageId = _chunkWXHBHJRJcjs.callWithMessageId; exports.callWithMute = _chunkWXHBHJRJcjs.callWithMute; exports.callWithOrganization = _chunkWXHBHJRJcjs.callWithOrganization; exports.callWithProperties = _chunkWXHBHJRJcjs.callWithProperties; exports.callWithSessionId = _chunkWXHBHJRJcjs.callWithSessionId; exports.callWithUser = _chunkWXHBHJRJcjs.callWithUser; exports.detectRuntime = _chunkWXHBHJRJcjs.detectRuntime; exports.emitEvent = _chunkWXHBHJRJcjs.emitEvent; exports.emitEventWithSessionId = _chunkWXHBHJRJcjs.emitEventWithSessionId; exports.getActiveSession = _chunkWXHBHJRJcjs.getActiveSession; exports.getLogLevel = _chunkWC573FCIcjs.getLogLevel; exports.getMetricsExporter = _chunkWXHBHJRJcjs.getMetricsExporter; exports.getMetricsReader = _chunkWXHBHJRJcjs.getMetricsReader; exports.getSpanExporter = _chunkWXHBHJRJcjs.getSpanExporter; exports.getSpanProcessor = _chunkWXHBHJRJcjs.getSpanProcessor; exports.init = init_exports; exports.logger = _chunkWC573FCIcjs.logger; exports.maskAttributes = _chunkWXHBHJRJcjs.maskAttributes; exports.maskValue = _chunkWXHBHJRJcjs.maskValue; exports.recordFeedback = _chunkWXHBHJRJcjs.recordFeedback; exports.setCurrentSpanCustomProperties = _chunkWXHBHJRJcjs.setCurrentSpanCustomProperties; exports.setLogLevel = _chunkWC573FCIcjs.setLogLevel; exports.setMessageId = _chunkWXHBHJRJcjs.setMessageId; exports.setOrganization = _chunkWXHBHJRJcjs.setOrganization; exports.setUser = _chunkWXHBHJRJcjs.setUser; exports.startSession = _chunkWXHBHJRJcjs.startSession; exports.startSessionTitle = _chunkWXHBHJRJcjs.startSessionTitle; exports.withMessageId = _chunkWXHBHJRJcjs.withMessageId; exports.withMute = _chunkWXHBHJRJcjs.withMute; exports.withOrganization = _chunkWXHBHJRJcjs.withOrganization; exports.withProperties = _chunkWXHBHJRJcjs.withProperties; exports.withSessionId = _chunkWXHBHJRJcjs.withSessionId; exports.withUser = _chunkWXHBHJRJcjs.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,15 @@ 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
+ traits?: Record<string, string>;
253
+ }): void;
182
254
  declare function startSession<T>(sessionId: string, callback: (session: Session) => T, extraProperties?: Record<string, AttributeValue>, options?: {
183
255
  mode?: 'default' | 'title';
184
256
  }): T;
@@ -202,4 +274,4 @@ declare namespace init {
202
274
  export { };
203
275
  }
204
276
 
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 };
277
+ 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, 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,15 @@ 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
+ traits?: Record<string, string>;
253
+ }): void;
182
254
  declare function startSession<T>(sessionId: string, callback: (session: Session) => T, extraProperties?: Record<string, AttributeValue>, options?: {
183
255
  mode?: 'default' | 'title';
184
256
  }): T;
@@ -202,4 +274,4 @@ declare namespace init {
202
274
  export { };
203
275
  }
204
276
 
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 };
277
+ 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, setCurrentSpanCustomProperties, setLogLevel, setMessageId, setOrganization, setUser, startSession, startSessionTitle, withMessageId, withMute, withOrganization, withProperties, withSessionId, withUser };