@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.
package/dist/index.cjs CHANGED
@@ -1,11 +1,10 @@
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(); } } 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; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7;
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(); } } 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; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6;
2
2
 
3
3
 
4
4
  var _chunkUNLNNKZ7cjs = require('./chunk-UNLNNKZ7.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunkDCXOK7PXcjs = require('./chunk-DCXOK7PX.cjs');
9
8
 
10
9
 
11
10
 
@@ -15,25 +14,6 @@ var _chunkDCXOK7PXcjs = require('./chunk-DCXOK7PX.cjs');
15
14
 
16
15
 
17
16
 
18
- var _chunkDC2MFO65cjs = require('./chunk-DC2MFO65.cjs');
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
- var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
27
-
28
-
29
- var _chunkO2IBZJOJcjs = require('./chunk-O2IBZJOJ.cjs');
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
17
 
38
18
 
39
19
 
@@ -59,9 +39,11 @@ var _chunkO2IBZJOJcjs = require('./chunk-O2IBZJOJ.cjs');
59
39
 
60
40
 
61
41
 
42
+ var _chunkXGD5HD5Wcjs = require('./chunk-XGD5HD5W.cjs');
62
43
 
63
44
 
64
45
 
46
+ var _chunkJGATEWJBcjs = require('./chunk-JGATEWJB.cjs');
65
47
 
66
48
 
67
49
 
@@ -69,6 +51,7 @@ var _chunkO2IBZJOJcjs = require('./chunk-O2IBZJOJ.cjs');
69
51
 
70
52
 
71
53
 
54
+ var _chunkDC2MFO65cjs = require('./chunk-DC2MFO65.cjs');
72
55
 
73
56
 
74
57
 
@@ -76,8 +59,10 @@ var _chunkO2IBZJOJcjs = require('./chunk-O2IBZJOJ.cjs');
76
59
 
77
60
 
78
61
 
62
+ var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
79
63
 
80
64
 
65
+ var _chunkO2IBZJOJcjs = require('./chunk-O2IBZJOJ.cjs');
81
66
 
82
67
 
83
68
 
@@ -113,7 +98,7 @@ var _api = require('@opentelemetry/api');
113
98
 
114
99
  // src/internal/instrumentation/langgraph/attributes.ts
115
100
  var INSTRUMENTATION_NAME = "@brizz/sdk/langgraph";
116
- var INSTRUMENTATION_VERSION = _chunkDCXOK7PXcjs.getSDKVersion.call(void 0, );
101
+ var INSTRUMENTATION_VERSION = _chunkJGATEWJBcjs.getSDKVersion.call(void 0, );
117
102
  var MODULE_NAME = "@langchain/langgraph";
118
103
  var SUPPORTED_VERSIONS = [">=0.2.0 <2"];
119
104
  function isSupportedVersion(version) {
@@ -469,7 +454,7 @@ var ATTR_ANSWERS = "typesafe.answers";
469
454
  var PATCHED_FLAG2 = /* @__PURE__ */ Symbol.for("brizz.typesafe.patched");
470
455
  var TypeSafeInstrumentation = class extends _instrumentation.InstrumentationBase {
471
456
  constructor(config = {}) {
472
- super(INSTRUMENTATION_NAME2, _chunkDCXOK7PXcjs.getSDKVersion.call(void 0, ), config);
457
+ super(INSTRUMENTATION_NAME2, _chunkJGATEWJBcjs.getSDKVersion.call(void 0, ), config);
473
458
  this.setTracerProvider(_chunkDC2MFO65cjs.brizzTracerProvider);
474
459
  }
475
460
  init() {
@@ -698,7 +683,7 @@ function loadGenAIInstrumentations() {
698
683
  function loadMCPInstrumentation() {
699
684
  void (async () => {
700
685
  try {
701
- const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-WHXEBLRI.cjs")));
686
+ const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-YNOK6OX5.cjs")));
702
687
  const mcp = new MCPInstrumentation({ exceptionLogger });
703
688
  _instrumentation.registerInstrumentations.call(void 0, { instrumentations: [mcp], tracerProvider: _chunkDC2MFO65cjs.brizzTracerProvider });
704
689
  _chunkWC573FCIcjs.logger.debug("Auto-loaded MCP instrumentation");
@@ -1309,7 +1294,7 @@ var InstrumentationRegistry = (_class = class _InstrumentationRegistry {construc
1309
1294
  const mcpModules = this.manualModules.mcp;
1310
1295
  void (async () => {
1311
1296
  try {
1312
- const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-WHXEBLRI.cjs")));
1297
+ const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-YNOK6OX5.cjs")));
1313
1298
  const instrumentation = new MCPInstrumentation({ exceptionLogger: exceptionLogger2 });
1314
1299
  instrumentation.manuallyInstrument(mcpModules);
1315
1300
  _chunkWC573FCIcjs.logger.debug("Manual instrumentation enabled for MCP");
@@ -1351,722 +1336,6 @@ var _exporterlogsotlphttp = require('@opentelemetry/exporter-logs-otlp-http');
1351
1336
 
1352
1337
  var _sdklogs = require('@opentelemetry/sdk-logs');
1353
1338
 
1354
- // src/internal/trace/session.ts
1355
-
1356
- var sessionTracer = _chunkDC2MFO65cjs.brizzTracerProvider.getTracer("@brizz/sdk");
1357
- function setCurrentSpanCustomProperties(properties) {
1358
- const current = _api.trace.getActiveSpan();
1359
- if (!current || !current.isRecording()) {
1360
- return;
1361
- }
1362
- for (const [key, value] of Object.entries(properties)) {
1363
- try {
1364
- current.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${key}`, value);
1365
- } catch (e5) {
1366
- }
1367
- }
1368
- }
1369
- function callWithProperties(properties, fn, thisArg, ...args) {
1370
- const base = _api.context.active();
1371
- const prev = base.getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1372
- const merged = prev ? { ...prev, ...properties } : properties;
1373
- const next = base.setValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY, merged);
1374
- return _api.context.with(next, fn, thisArg, ...args);
1375
- }
1376
- function withProperties(properties, fn, thisArg) {
1377
- return function wrapped(...args) {
1378
- return callWithProperties(
1379
- properties,
1380
- fn,
1381
- thisArg !== void 0 ? thisArg : this,
1382
- ...args
1383
- );
1384
- };
1385
- }
1386
- function propagatePropertiesImperatively(properties, base = _api.context.active()) {
1387
- try {
1388
- const manager = _api.context;
1389
- const mgr = _optionalChain([manager, 'access', _68 => _68._getContextManager, 'optionalCall', _69 => _69()]);
1390
- const store = _optionalChain([mgr, 'optionalAccess', _70 => _70._asyncLocalStorage]);
1391
- if (!store || typeof store.enterWith !== "function") {
1392
- return;
1393
- }
1394
- const prev = base.getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1395
- const merged = prev ? { ...prev, ...properties } : properties;
1396
- store.enterWith(base.setValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY, merged));
1397
- } catch (e6) {
1398
- }
1399
- }
1400
- function setUser(user) {
1401
- const properties = { [_chunkRV7JIIDGcjs.USER_ID]: user.id };
1402
- if (user.email !== void 0) {
1403
- properties[_chunkRV7JIIDGcjs.USER_EMAIL] = user.email;
1404
- }
1405
- if (user.name !== void 0) {
1406
- properties[_chunkRV7JIIDGcjs.USER_NAME] = user.name;
1407
- }
1408
- if (user.role !== void 0) {
1409
- properties[_chunkRV7JIIDGcjs.USER_ROLE] = user.role;
1410
- }
1411
- if (user.plan !== void 0) {
1412
- properties[_chunkRV7JIIDGcjs.USER_PLAN] = user.plan;
1413
- }
1414
- if (user.traits) {
1415
- for (const [key, value] of Object.entries(user.traits)) {
1416
- const k = `user.${key}`;
1417
- if (properties[k] === void 0) {
1418
- properties[k] = value;
1419
- }
1420
- }
1421
- }
1422
- setCurrentSpanCustomProperties(properties);
1423
- propagatePropertiesImperatively(properties);
1424
- }
1425
- function setOrganization(org) {
1426
- const properties = { [_chunkRV7JIIDGcjs.ORGANIZATION_ID]: org.id };
1427
- if (org.name !== void 0) {
1428
- properties[_chunkRV7JIIDGcjs.ORGANIZATION_NAME] = org.name;
1429
- }
1430
- if (org.plan !== void 0) {
1431
- properties[_chunkRV7JIIDGcjs.ORGANIZATION_PLAN] = org.plan;
1432
- }
1433
- if (org.domain !== void 0) {
1434
- properties[_chunkRV7JIIDGcjs.ORGANIZATION_DOMAIN] = org.domain;
1435
- }
1436
- if (org.traits) {
1437
- for (const [key, value] of Object.entries(org.traits)) {
1438
- const k = `organization.${key}`;
1439
- if (properties[k] === void 0) {
1440
- properties[k] = value;
1441
- }
1442
- }
1443
- }
1444
- setCurrentSpanCustomProperties(properties);
1445
- propagatePropertiesImperatively(properties);
1446
- }
1447
- function setMessageId(id) {
1448
- const properties = { [_chunkRV7JIIDGcjs.MESSAGE_ID]: id };
1449
- setCurrentSpanCustomProperties(properties);
1450
- propagatePropertiesImperatively(properties);
1451
- }
1452
- function setSessionId(id) {
1453
- const properties = { [_chunkRV7JIIDGcjs.SESSION_ID]: id };
1454
- setCurrentSpanCustomProperties(properties);
1455
- propagatePropertiesImperatively(properties);
1456
- }
1457
- var SERVICE_NAME_MAX_BYTES = 256;
1458
- function serviceNameProblem(name) {
1459
- if (typeof name !== "string" || name === "") {
1460
- return "must be a non-empty string";
1461
- }
1462
- if (/[\r\n\0]/.test(name)) {
1463
- return `${JSON.stringify(name)} contains CR, LF, or NUL`;
1464
- }
1465
- const byteLength = new globalThis.TextEncoder().encode(name).length;
1466
- if (byteLength > SERVICE_NAME_MAX_BYTES) {
1467
- return `is ${byteLength} bytes, over the ${SERVICE_NAME_MAX_BYTES}-byte limit`;
1468
- }
1469
- return void 0;
1470
- }
1471
- function serviceNameProperties(name) {
1472
- const problem = serviceNameProblem(name);
1473
- if (problem !== void 0) {
1474
- _chunkWC573FCIcjs.logger.warn(`Service name ${problem}; keeping the configured appName.`);
1475
- return {};
1476
- }
1477
- return { [_chunkRV7JIIDGcjs.SERVICE_NAME]: name };
1478
- }
1479
- function setServiceName(name) {
1480
- const properties = serviceNameProperties(name);
1481
- setCurrentSpanCustomProperties(properties);
1482
- propagatePropertiesImperatively(properties);
1483
- }
1484
- function callWithServiceName(name, fn, thisArg, ...args) {
1485
- return callWithProperties(serviceNameProperties(name), fn, thisArg, ...args);
1486
- }
1487
- function withServiceName(name, fn, thisArg) {
1488
- return withProperties(serviceNameProperties(name), fn, thisArg);
1489
- }
1490
- function resolveServiceNameFromContext() {
1491
- const props = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1492
- return _optionalChain([props, 'optionalAccess', _71 => _71[_chunkRV7JIIDGcjs.SERVICE_NAME]]);
1493
- }
1494
- function userProperties(user) {
1495
- const properties = { [_chunkRV7JIIDGcjs.USER_ID]: user.id };
1496
- if (user.email !== void 0) {
1497
- properties[_chunkRV7JIIDGcjs.USER_EMAIL] = user.email;
1498
- }
1499
- if (user.name !== void 0) {
1500
- properties[_chunkRV7JIIDGcjs.USER_NAME] = user.name;
1501
- }
1502
- if (user.role !== void 0) {
1503
- properties[_chunkRV7JIIDGcjs.USER_ROLE] = user.role;
1504
- }
1505
- if (user.plan !== void 0) {
1506
- properties[_chunkRV7JIIDGcjs.USER_PLAN] = user.plan;
1507
- }
1508
- if (user.traits) {
1509
- for (const [key, value] of Object.entries(user.traits)) {
1510
- const k = `user.${key}`;
1511
- if (properties[k] === void 0) {
1512
- properties[k] = value;
1513
- }
1514
- }
1515
- }
1516
- return properties;
1517
- }
1518
- function organizationProperties(org) {
1519
- const properties = { [_chunkRV7JIIDGcjs.ORGANIZATION_ID]: org.id };
1520
- if (org.name !== void 0) {
1521
- properties[_chunkRV7JIIDGcjs.ORGANIZATION_NAME] = org.name;
1522
- }
1523
- if (org.plan !== void 0) {
1524
- properties[_chunkRV7JIIDGcjs.ORGANIZATION_PLAN] = org.plan;
1525
- }
1526
- if (org.domain !== void 0) {
1527
- properties[_chunkRV7JIIDGcjs.ORGANIZATION_DOMAIN] = org.domain;
1528
- }
1529
- if (org.traits) {
1530
- for (const [key, value] of Object.entries(org.traits)) {
1531
- const k = `organization.${key}`;
1532
- if (properties[k] === void 0) {
1533
- properties[k] = value;
1534
- }
1535
- }
1536
- }
1537
- return properties;
1538
- }
1539
- function callWithUser(user, fn, thisArg, ...args) {
1540
- return callWithProperties(userProperties(user), fn, thisArg, ...args);
1541
- }
1542
- function withUser(user, fn, thisArg) {
1543
- return withProperties(userProperties(user), fn, thisArg);
1544
- }
1545
- function callWithOrganization(org, fn, thisArg, ...args) {
1546
- return callWithProperties(organizationProperties(org), fn, thisArg, ...args);
1547
- }
1548
- function withOrganization(org, fn, thisArg) {
1549
- return withProperties(organizationProperties(org), fn, thisArg);
1550
- }
1551
- function callWithMessageId(id, fn, thisArg, ...args) {
1552
- return callWithProperties({ [_chunkRV7JIIDGcjs.MESSAGE_ID]: id }, fn, thisArg, ...args);
1553
- }
1554
- function withMessageId(id, fn, thisArg) {
1555
- return withProperties({ [_chunkRV7JIIDGcjs.MESSAGE_ID]: id }, fn, thisArg);
1556
- }
1557
- function inheritedMuteTools() {
1558
- const properties = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1559
- return _optionalChain([properties, 'optionalAccess', _72 => _72[_chunkRV7JIIDGcjs.MUTE_TOOLS]]);
1560
- }
1561
- function muteProperties(options) {
1562
- const { input = true, output = true, tools = output } = options;
1563
- const properties = {};
1564
- if (input) {
1565
- properties[_chunkRV7JIIDGcjs.MUTE_INPUT] = "true";
1566
- }
1567
- if (output) {
1568
- properties[_chunkRV7JIIDGcjs.MUTE_OUTPUT] = "true";
1569
- }
1570
- if (tools !== output) {
1571
- properties[_chunkRV7JIIDGcjs.MUTE_TOOLS] = String(tools);
1572
- } else {
1573
- const inherited = inheritedMuteTools();
1574
- if (tools && inherited === "false") {
1575
- properties[_chunkRV7JIIDGcjs.MUTE_TOOLS] = "true";
1576
- } else if (options.tools === false && inherited === "true") {
1577
- properties[_chunkRV7JIIDGcjs.MUTE_TOOLS] = "false";
1578
- }
1579
- }
1580
- return properties;
1581
- }
1582
- function callWithMute(options, fn, thisArg, ...args) {
1583
- return callWithProperties(muteProperties(options), fn, thisArg, ...args);
1584
- }
1585
- function withMute(options, fn, thisArg) {
1586
- return withProperties(muteProperties(options), fn, thisArg);
1587
- }
1588
- function withSessionId(sessionId, fn, thisArg, extraProperties) {
1589
- const properties = { [_chunkRV7JIIDGcjs.SESSION_ID]: sessionId, ...extraProperties };
1590
- return withProperties(properties, fn, thisArg);
1591
- }
1592
- function callWithSessionId(sessionId, fn, thisArg, ...args) {
1593
- return callWithProperties({ [_chunkRV7JIIDGcjs.SESSION_ID]: sessionId }, fn, thisArg, ...args);
1594
- }
1595
- var Session = (_class2 = class {
1596
-
1597
- __init2() {this.inputs = []}
1598
- __init3() {this.outputs = []}
1599
- __init4() {this.inputContexts = []}
1600
- __init5() {this.outputContexts = []}
1601
-
1602
- constructor(sessionId, span) {;_class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this);_class2.prototype.__init5.call(this);
1603
- this.sessionId = sessionId;
1604
- this.span = span;
1605
- }
1606
- /**
1607
- * Append a user turn to session input tracking.
1608
- *
1609
- * Each call appends one element to `brizz.session.input` (the text) AND one
1610
- * element to `brizz.session.input.context` (the per-turn context bag). The
1611
- * two arrays stay index-aligned — the ingestion pipeline zips them together
1612
- * so the i-th context bag lands on the i-th user_display conversation item's
1613
- * `span_attributes` map.
1614
- *
1615
- * @param text - Text to append (null becomes a null/"hide marker")
1616
- * @param context - Optional per-turn context bag to attach to this turn
1617
- */
1618
- setInput(text2, context8) {
1619
- this.inputs.push(text2);
1620
- this.inputContexts.push(_nullishCoalesce(context8, () => ( {})));
1621
- this.span.setAttribute(_chunkRV7JIIDGcjs.SESSION_INPUT, JSON.stringify(this.inputs));
1622
- this.span.setAttribute(_chunkRV7JIIDGcjs.SESSION_INPUT_CONTEXT, JSON.stringify(this.inputContexts));
1623
- }
1624
- /**
1625
- * Append an assistant turn to session output tracking.
1626
- *
1627
- * Symmetric to {@link setInput} — appends one text element and one
1628
- * context-bag element to the index-aligned `brizz.session.output` /
1629
- * `brizz.session.output.context` arrays.
1630
- *
1631
- * @param text - Text to append (null becomes a null/"hide marker")
1632
- * @param context - Optional per-turn context bag to attach to this turn
1633
- */
1634
- setOutput(text2, context8) {
1635
- this.outputs.push(text2);
1636
- this.outputContexts.push(_nullishCoalesce(context8, () => ( {})));
1637
- this.span.setAttribute(_chunkRV7JIIDGcjs.SESSION_OUTPUT, JSON.stringify(this.outputs));
1638
- this.span.setAttribute(_chunkRV7JIIDGcjs.SESSION_OUTPUT_CONTEXT, JSON.stringify(this.outputContexts));
1639
- }
1640
- /**
1641
- * Set the session title on the span.
1642
- *
1643
- * @param title - The generated title string
1644
- */
1645
- setTitle(title) {
1646
- this.span.setAttribute(_chunkRV7JIIDGcjs.SESSION_TITLE, title);
1647
- }
1648
- /**
1649
- * Update custom properties on the session span.
1650
- * Properties are prefixed with 'brizz.'.
1651
- *
1652
- * @param properties - Key-value properties to set on the session
1653
- */
1654
- updateProperties(properties) {
1655
- for (const [key, value] of Object.entries(properties)) {
1656
- this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${key}`, value);
1657
- }
1658
- }
1659
- /**
1660
- * Set end-user identity on the session span: `brizz.user.id` and, when
1661
- * provided, `brizz.user.email` / `brizz.user.name`. Undefined fields are omitted.
1662
- *
1663
- * @param user - User identity (`id` required; `email` / `name` optional)
1664
- */
1665
- setUser(user) {
1666
- if (user.traits) {
1667
- for (const [key, value] of Object.entries(user.traits)) {
1668
- this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.user.${key}`, value);
1669
- }
1670
- }
1671
- this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.USER_ID}`, user.id);
1672
- if (user.email !== void 0) {
1673
- this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.USER_EMAIL}`, user.email);
1674
- }
1675
- if (user.name !== void 0) {
1676
- this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.USER_NAME}`, user.name);
1677
- }
1678
- if (user.role !== void 0) {
1679
- this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.USER_ROLE}`, user.role);
1680
- }
1681
- if (user.plan !== void 0) {
1682
- this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.USER_PLAN}`, user.plan);
1683
- }
1684
- }
1685
- /**
1686
- * Set organization identity on the session span: `brizz.organization.id` and,
1687
- * when provided, `brizz.organization.name`. Undefined fields are omitted.
1688
- *
1689
- * @param org - Organization identity (`id` required; `name` optional)
1690
- */
1691
- setOrganization(org) {
1692
- if (org.traits) {
1693
- for (const [key, value] of Object.entries(org.traits)) {
1694
- this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.organization.${key}`, value);
1695
- }
1696
- }
1697
- this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.ORGANIZATION_ID}`, org.id);
1698
- if (org.name !== void 0) {
1699
- this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.ORGANIZATION_NAME}`, org.name);
1700
- }
1701
- if (org.plan !== void 0) {
1702
- this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.ORGANIZATION_PLAN}`, org.plan);
1703
- }
1704
- if (org.domain !== void 0) {
1705
- this.span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.ORGANIZATION_DOMAIN}`, org.domain);
1706
- }
1707
- }
1708
- /**
1709
- * Attach an external link (URL) to this session.
1710
- *
1711
- * The link surfaces on the session's detail panel in Brizz — use it to
1712
- * correlate a session with an external record such as a Datadog trace,
1713
- * Sentry issue, or internal dashboard. Re-sending the same URL is idempotent;
1714
- * distinct URLs add separate links.
1715
- *
1716
- * @param url - The link target
1717
- * @param options - Optional `title` (defaults to the URL host) and `linkType`
1718
- * (free-form category, defaults to `'generic'`)
1719
- */
1720
- addExternalLink(url, options) {
1721
- emitExternalLink(this.sessionId, url, _optionalChain([options, 'optionalAccess', _73 => _73.title]), _optionalChain([options, 'optionalAccess', _74 => _74.linkType]));
1722
- }
1723
- }, _class2);
1724
- var SessionTitle = class {
1725
-
1726
- constructor(span) {
1727
- this.span = span;
1728
- }
1729
- /**
1730
- * Set the generated title on the wrapper span.
1731
- *
1732
- * @param title - The generated title string
1733
- */
1734
- setTitle(title) {
1735
- this.span.setAttribute(_chunkRV7JIIDGcjs.SESSION_TITLE, title);
1736
- }
1737
- };
1738
- function getActiveSession() {
1739
- return _api.context.active().getValue(_chunkRV7JIIDGcjs.SESSION_OBJECT_CONTEXT_KEY);
1740
- }
1741
- function resolveSessionIdFromContext() {
1742
- const active = getActiveSession();
1743
- if (active) {
1744
- return active.sessionId;
1745
- }
1746
- const props = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1747
- return _optionalChain([props, 'optionalAccess', _75 => _75[_chunkRV7JIIDGcjs.SESSION_ID]]);
1748
- }
1749
- function resolveMessageIdFromContext() {
1750
- const props = _api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1751
- return _optionalChain([props, 'optionalAccess', _76 => _76[_chunkRV7JIIDGcjs.MESSAGE_ID]]);
1752
- }
1753
- function emitExternalLink(sessionId, url, title, linkType) {
1754
- try {
1755
- emitEventWithSessionId(sessionId, _chunkRV7JIIDGcjs.EXTERNAL_LINK_EVENT_NAME, {
1756
- [_chunkRV7JIIDGcjs.EXTERNAL_LINK_URL]: url,
1757
- [_chunkRV7JIIDGcjs.EXTERNAL_LINK_TITLE]: _nullishCoalesce(title, () => ( "")),
1758
- [_chunkRV7JIIDGcjs.EXTERNAL_LINK_TYPE]: _nullishCoalesce(linkType, () => ( "generic"))
1759
- });
1760
- } catch (error) {
1761
- _chunkWC573FCIcjs.logger.warn("addExternalLink: failed to emit external link", error);
1762
- }
1763
- }
1764
- function addExternalLink(url, options) {
1765
- const sessionId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _77 => _77.sessionId]), () => ( resolveSessionIdFromContext()));
1766
- if (!sessionId) {
1767
- _chunkWC573FCIcjs.logger.warn(
1768
- "addExternalLink called without a resolvable session id; link dropped. Pass options.sessionId or call inside a startSession/callWithSessionId scope."
1769
- );
1770
- return;
1771
- }
1772
- emitExternalLink(sessionId, url, _optionalChain([options, 'optionalAccess', _78 => _78.title]), _optionalChain([options, 'optionalAccess', _79 => _79.linkType]));
1773
- }
1774
- function recordFeedback(type, options) {
1775
- const eventAttributes = { [_chunkRV7JIIDGcjs.FEEDBACK_TYPE]: type };
1776
- if (_optionalChain([options, 'optionalAccess', _80 => _80.score]) !== void 0) {
1777
- eventAttributes[_chunkRV7JIIDGcjs.FEEDBACK_SCORE] = options.score;
1778
- }
1779
- if (_optionalChain([options, 'optionalAccess', _81 => _81.reason]) !== void 0) {
1780
- eventAttributes[_chunkRV7JIIDGcjs.FEEDBACK_REASON] = options.reason;
1781
- }
1782
- if (_optionalChain([options, 'optionalAccess', _82 => _82.comment]) !== void 0) {
1783
- eventAttributes[_chunkRV7JIIDGcjs.FEEDBACK_COMMENT] = options.comment;
1784
- }
1785
- if (_optionalChain([options, 'optionalAccess', _83 => _83.source]) !== void 0) {
1786
- eventAttributes[_chunkRV7JIIDGcjs.FEEDBACK_SOURCE] = options.source;
1787
- }
1788
- if (_optionalChain([options, 'optionalAccess', _84 => _84.attributes])) {
1789
- for (const [key, value] of Object.entries(options.attributes)) {
1790
- const k = `${_chunkRV7JIIDGcjs.FEEDBACK_ATTR_PREFIX}${key}`;
1791
- if (eventAttributes[k] === void 0) {
1792
- eventAttributes[k] = value;
1793
- }
1794
- }
1795
- }
1796
- const messageId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _85 => _85.messageId]), () => ( resolveMessageIdFromContext()));
1797
- const sessionId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _86 => _86.sessionId]), () => ( resolveSessionIdFromContext()));
1798
- if (messageId === void 0 && sessionId === void 0) {
1799
- _chunkWC573FCIcjs.logger.warn(
1800
- "recordFeedback called with no resolvable message id or session id; the feedback cannot be attributed to a message or conversation. Pass options.messageId / options.sessionId or call inside a startSession/callWithMessageId scope."
1801
- );
1802
- }
1803
- const anchor = {};
1804
- if (messageId !== void 0) {
1805
- anchor[_chunkRV7JIIDGcjs.MESSAGE_ID] = messageId;
1806
- }
1807
- if (sessionId !== void 0) {
1808
- anchor[_chunkRV7JIIDGcjs.SESSION_ID] = sessionId;
1809
- }
1810
- try {
1811
- if (Object.keys(anchor).length === 0) {
1812
- emitEvent(_chunkRV7JIIDGcjs.FEEDBACK_EVENT_NAME, eventAttributes);
1813
- } else {
1814
- callWithProperties(anchor, () => emitEvent(_chunkRV7JIIDGcjs.FEEDBACK_EVENT_NAME, eventAttributes));
1815
- }
1816
- } catch (error) {
1817
- _chunkWC573FCIcjs.logger.warn("recordFeedback: failed to emit feedback event", error);
1818
- }
1819
- }
1820
- var METRIC_NAME_PATTERN = /^[a-z][a-z0-9_.-]{0,63}$/;
1821
- var METRIC_COMMENT_MAX_LEN = 4096;
1822
- var METRIC_ATTRIBUTES_MAX = 20;
1823
- var METRIC_ATTRIBUTE_VALUE_MAX_LEN = 256;
1824
- function recordMetric(options) {
1825
- try {
1826
- recordMetricImpl(options);
1827
- } catch (error) {
1828
- _chunkWC573FCIcjs.logger.warn(`recordMetric(${JSON.stringify(_optionalChain([options, 'optionalAccess', _87 => _87.name]))}) failed; metric dropped.`, error);
1829
- }
1830
- }
1831
- function recordMetricImpl(options) {
1832
- const name = typeof options.name === "string" ? options.name.toLowerCase() : "";
1833
- if (!METRIC_NAME_PATTERN.test(name)) {
1834
- _chunkWC573FCIcjs.logger.warn(
1835
- `recordMetric called with an invalid name ${JSON.stringify(options.name)}; metric dropped. Names must match ${METRIC_NAME_PATTERN.source} after lowercasing.`
1836
- );
1837
- return;
1838
- }
1839
- if (_chunkRV7JIIDGcjs.RESERVED_METRIC_NAMES.has(name)) {
1840
- _chunkWC573FCIcjs.logger.warn(
1841
- `recordMetric called with the reserved name ${JSON.stringify(name)}; metric dropped. Brizz computes this metric itself \u2014 pick a different name.`
1842
- );
1843
- return;
1844
- }
1845
- const { value } = options;
1846
- let numericValue;
1847
- if (typeof value === "boolean") {
1848
- numericValue = value ? 1 : 0;
1849
- } else if (typeof value === "number" && Number.isFinite(value)) {
1850
- numericValue = value;
1851
- } else {
1852
- _chunkWC573FCIcjs.logger.warn(
1853
- `recordMetric(${name}) called with a non-finite or non-numeric value ${JSON.stringify(value)}; metric dropped.`
1854
- );
1855
- return;
1856
- }
1857
- if (options.serviceName !== void 0) {
1858
- const problem = serviceNameProblem(options.serviceName);
1859
- if (problem !== void 0) {
1860
- _chunkWC573FCIcjs.logger.warn(`recordMetric(${name}) service name ${problem}; metric dropped.`);
1861
- return;
1862
- }
1863
- }
1864
- const scope = _nullishCoalesce(options.scope, () => ( _chunkRV7JIIDGcjs.METRIC_SCOPE_SESSION));
1865
- if (scope !== _chunkRV7JIIDGcjs.METRIC_SCOPE_SESSION && scope !== _chunkRV7JIIDGcjs.METRIC_SCOPE_TRACE) {
1866
- _chunkWC573FCIcjs.logger.warn(
1867
- `recordMetric(${name}) called with an invalid scope ${JSON.stringify(scope)}; expected '${_chunkRV7JIIDGcjs.METRIC_SCOPE_SESSION}' or '${_chunkRV7JIIDGcjs.METRIC_SCOPE_TRACE}'. Metric dropped.`
1868
- );
1869
- return;
1870
- }
1871
- const eventAttributes = {
1872
- [_chunkRV7JIIDGcjs.METRIC_NAME]: name,
1873
- [_chunkRV7JIIDGcjs.METRIC_VALUE]: numericValue
1874
- };
1875
- if (options.scope !== void 0) {
1876
- eventAttributes[_chunkRV7JIIDGcjs.METRIC_SCOPE] = scope;
1877
- }
1878
- if (options.unit !== void 0) {
1879
- eventAttributes[_chunkRV7JIIDGcjs.METRIC_UNIT] = options.unit;
1880
- }
1881
- if (options.minValue !== void 0) {
1882
- eventAttributes[_chunkRV7JIIDGcjs.METRIC_MIN] = options.minValue;
1883
- }
1884
- if (options.maxValue !== void 0) {
1885
- eventAttributes[_chunkRV7JIIDGcjs.METRIC_MAX] = options.maxValue;
1886
- }
1887
- if (options.comment !== void 0) {
1888
- let comment = options.comment;
1889
- if (comment.length > METRIC_COMMENT_MAX_LEN) {
1890
- _chunkWC573FCIcjs.logger.warn(
1891
- `recordMetric(${name}) comment exceeds ${METRIC_COMMENT_MAX_LEN} characters; truncated.`
1892
- );
1893
- comment = comment.slice(0, METRIC_COMMENT_MAX_LEN);
1894
- }
1895
- eventAttributes[_chunkRV7JIIDGcjs.METRIC_COMMENT] = comment;
1896
- }
1897
- if (options.polarity !== void 0) {
1898
- const polarity = options.polarity;
1899
- if (polarity === _chunkRV7JIIDGcjs.METRIC_POLARITY_POSITIVE || polarity === _chunkRV7JIIDGcjs.METRIC_POLARITY_NEGATIVE) {
1900
- eventAttributes[_chunkRV7JIIDGcjs.METRIC_POLARITY] = polarity;
1901
- } else {
1902
- _chunkWC573FCIcjs.logger.warn(
1903
- `recordMetric(${name}) called with an invalid polarity ${JSON.stringify(polarity)}; expected '${_chunkRV7JIIDGcjs.METRIC_POLARITY_POSITIVE}' or '${_chunkRV7JIIDGcjs.METRIC_POLARITY_NEGATIVE}'. Emitting the metric without it.`
1904
- );
1905
- }
1906
- }
1907
- if (options.timestamp !== void 0) {
1908
- if (Number.isFinite(options.timestamp.getTime())) {
1909
- eventAttributes[_chunkRV7JIIDGcjs.METRIC_TIMESTAMP] = options.timestamp.toISOString();
1910
- } else {
1911
- _chunkWC573FCIcjs.logger.warn(
1912
- `recordMetric(${name}) called with an invalid timestamp; emitting the metric without it.`
1913
- );
1914
- }
1915
- }
1916
- if (options.attributes) {
1917
- let accepted = 0;
1918
- for (const [key, attrValue] of Object.entries(options.attributes)) {
1919
- if (accepted >= METRIC_ATTRIBUTES_MAX) {
1920
- _chunkWC573FCIcjs.logger.warn(
1921
- `recordMetric(${name}) called with more than ${METRIC_ATTRIBUTES_MAX} attributes; the excess was dropped.`
1922
- );
1923
- break;
1924
- }
1925
- const normalizedKey = key.toLowerCase();
1926
- if (!METRIC_NAME_PATTERN.test(normalizedKey)) {
1927
- _chunkWC573FCIcjs.logger.warn(
1928
- `recordMetric(${name}) called with an invalid attribute key ${JSON.stringify(key)}; that attribute was dropped. Keys must match ${METRIC_NAME_PATTERN.source} after lowercasing.`
1929
- );
1930
- continue;
1931
- }
1932
- let text2 = typeof attrValue === "string" ? attrValue : String(attrValue);
1933
- if (text2.length > METRIC_ATTRIBUTE_VALUE_MAX_LEN) {
1934
- _chunkWC573FCIcjs.logger.warn(
1935
- `recordMetric(${name}) attribute ${JSON.stringify(normalizedKey)} exceeds ${METRIC_ATTRIBUTE_VALUE_MAX_LEN} characters; truncated.`
1936
- );
1937
- text2 = text2.slice(0, METRIC_ATTRIBUTE_VALUE_MAX_LEN);
1938
- }
1939
- eventAttributes[`${_chunkRV7JIIDGcjs.METRIC_ATTRIBUTE_PREFIX}${normalizedKey}`] = text2;
1940
- accepted += 1;
1941
- }
1942
- }
1943
- const traceId = typeof options.traceId === "string" && options.traceId !== "" ? options.traceId : void 0;
1944
- if (traceId !== void 0) {
1945
- eventAttributes[_chunkRV7JIIDGcjs.METRIC_TRACE_ID] = traceId;
1946
- }
1947
- if (scope === _chunkRV7JIIDGcjs.METRIC_SCOPE_TRACE && traceId === void 0) {
1948
- const spanContext = _optionalChain([_api.trace, 'access', _88 => _88.getActiveSpan, 'call', _89 => _89(), 'optionalAccess', _90 => _90.spanContext, 'call', _91 => _91()]);
1949
- if (!spanContext || !_api.isSpanContextValid.call(void 0, spanContext)) {
1950
- _chunkWC573FCIcjs.logger.warn(
1951
- `recordMetric(${name}) called with scope 'trace' but no trace; metric dropped. Pass options.traceId, or call inside the span of the trace being scored.`
1952
- );
1953
- return;
1954
- }
1955
- eventAttributes[_chunkRV7JIIDGcjs.METRIC_TRACE_ID] = spanContext.traceId;
1956
- }
1957
- const sessionId = _nullishCoalesce(options.sessionId, () => ( (traceId === void 0 ? resolveSessionIdFromContext() : void 0)));
1958
- if (sessionId === void 0 && traceId === void 0) {
1959
- _chunkWC573FCIcjs.logger.warn(
1960
- `recordMetric(${name}) called with no resolvable session id or trace id; the metric cannot be attributed to a conversation and is dropped. Pass options.sessionId or options.traceId, or call inside a startSession/callWithSessionId scope.`
1961
- );
1962
- return;
1963
- }
1964
- const base = _api.context.active();
1965
- const ambient = base.getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY);
1966
- const properties = { ...ambient };
1967
- if (sessionId === void 0) {
1968
- delete properties[_chunkRV7JIIDGcjs.SESSION_ID];
1969
- delete properties[_chunkRV7JIIDGcjs.MESSAGE_ID];
1970
- } else {
1971
- properties[_chunkRV7JIIDGcjs.SESSION_ID] = sessionId;
1972
- }
1973
- if (options.serviceName !== void 0) {
1974
- properties[_chunkRV7JIIDGcjs.SERVICE_NAME] = options.serviceName;
1975
- }
1976
- try {
1977
- _api.context.with(
1978
- base.setValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY, properties),
1979
- () => emitEvent(_chunkRV7JIIDGcjs.METRIC_EVENT_NAME, eventAttributes)
1980
- );
1981
- } catch (error) {
1982
- _chunkWC573FCIcjs.logger.warn("recordMetric: failed to emit metric event", error);
1983
- }
1984
- }
1985
- function startSession(sessionId, callback, extraProperties, options) {
1986
- const isTitle = _optionalChain([options, 'optionalAccess', _92 => _92.mode]) === "title";
1987
- const spanName = isTitle ? _chunkRV7JIIDGcjs.SESSION_TITLE_SPAN_NAME : _chunkRV7JIIDGcjs.SESSION_SPAN_NAME;
1988
- return sessionTracer.startActiveSpan(spanName, (span) => {
1989
- span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.SESSION_ID}`, sessionId);
1990
- if (extraProperties) {
1991
- for (const [key, value] of Object.entries(extraProperties)) {
1992
- span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${key}`, value);
1993
- }
1994
- }
1995
- const session = new Session(sessionId, span);
1996
- const contextProperties = { [_chunkRV7JIIDGcjs.SESSION_ID]: sessionId };
1997
- if (isTitle) {
1998
- contextProperties[_chunkRV7JIIDGcjs.SESSION_TITLE_GENERATION] = "true";
1999
- }
2000
- if (extraProperties) {
2001
- for (const [key, value] of Object.entries(extraProperties)) {
2002
- contextProperties[key] = String(value);
2003
- }
2004
- }
2005
- return callWithProperties(contextProperties, () => {
2006
- const sessionCtx = _api.context.active().setValue(_chunkRV7JIIDGcjs.SESSION_OBJECT_CONTEXT_KEY, session);
2007
- return _api.context.with(sessionCtx, () => {
2008
- try {
2009
- const result = callback(session);
2010
- if (result && typeof result.then === "function") {
2011
- return result.then((value) => {
2012
- span.end();
2013
- return value;
2014
- }).catch((error) => {
2015
- span.recordException(error);
2016
- span.setStatus({ code: _api.SpanStatusCode.ERROR });
2017
- span.end();
2018
- throw error;
2019
- });
2020
- }
2021
- span.end();
2022
- return result;
2023
- } catch (error) {
2024
- span.recordException(error);
2025
- span.setStatus({ code: _api.SpanStatusCode.ERROR });
2026
- span.end();
2027
- throw error;
2028
- }
2029
- });
2030
- });
2031
- });
2032
- }
2033
- function startSessionTitle(callback, options) {
2034
- const resolvedSessionId = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _93 => _93.sessionId]), () => ( _optionalChain([getActiveSession, 'call', _94 => _94(), 'optionalAccess', _95 => _95.sessionId])));
2035
- return sessionTracer.startActiveSpan(_chunkRV7JIIDGcjs.SESSION_TITLE_SPAN_NAME, (span) => {
2036
- if (resolvedSessionId) {
2037
- span.setAttribute(`${_chunkRV7JIIDGcjs.BRIZZ}.${_chunkRV7JIIDGcjs.SESSION_ID}`, resolvedSessionId);
2038
- }
2039
- const sessionTitle = new SessionTitle(span);
2040
- const properties = { [_chunkRV7JIIDGcjs.SESSION_TITLE_GENERATION]: "true" };
2041
- if (resolvedSessionId) {
2042
- properties[_chunkRV7JIIDGcjs.SESSION_ID] = resolvedSessionId;
2043
- }
2044
- return callWithProperties(properties, () => {
2045
- try {
2046
- const result = callback(sessionTitle);
2047
- if (result && typeof result.then === "function") {
2048
- return result.then((value) => {
2049
- span.end();
2050
- return value;
2051
- }).catch((error) => {
2052
- span.recordException(error);
2053
- span.setStatus({ code: _api.SpanStatusCode.ERROR });
2054
- span.end();
2055
- throw error;
2056
- });
2057
- }
2058
- span.end();
2059
- return result;
2060
- } catch (error) {
2061
- span.recordException(error);
2062
- span.setStatus({ code: _api.SpanStatusCode.ERROR });
2063
- span.end();
2064
- throw error;
2065
- }
2066
- });
2067
- });
2068
- }
2069
-
2070
1339
  // src/internal/log/processors/log-processor.ts
2071
1340
 
2072
1341
 
@@ -2504,7 +1773,7 @@ var BrizzSimpleLogRecordProcessor = class extends _sdklogs.SimpleLogRecordProces
2504
1773
  this.config = config;
2505
1774
  }
2506
1775
  onEmit(logRecord) {
2507
- const maskingConfig = _optionalChain([this, 'access', _96 => _96.config, 'access', _97 => _97.masking, 'optionalAccess', _98 => _98.eventMasking]);
1776
+ const maskingConfig = _optionalChain([this, 'access', _68 => _68.config, 'access', _69 => _69.masking, 'optionalAccess', _70 => _70.eventMasking]);
2508
1777
  if (maskingConfig) {
2509
1778
  maskLog(logRecord, maskingConfig);
2510
1779
  }
@@ -2524,7 +1793,7 @@ var BrizzBatchLogRecordProcessor = class extends _sdklogs.BatchLogRecordProcesso
2524
1793
  this.config = config;
2525
1794
  }
2526
1795
  onEmit(logRecord) {
2527
- const maskingConfig = _optionalChain([this, 'access', _99 => _99.config, 'access', _100 => _100.masking, 'optionalAccess', _101 => _101.eventMasking]);
1796
+ const maskingConfig = _optionalChain([this, 'access', _71 => _71.config, 'access', _72 => _72.masking, 'optionalAccess', _73 => _73.eventMasking]);
2528
1797
  if (maskingConfig) {
2529
1798
  maskLog(logRecord, maskingConfig);
2530
1799
  }
@@ -2580,7 +1849,7 @@ function maskLog(logRecord, config) {
2580
1849
  }
2581
1850
 
2582
1851
  // src/internal/log/logging.ts
2583
- var LoggingModule = (_class3 = class _LoggingModule {constructor() { _class3.prototype.__init6.call(this);_class3.prototype.__init7.call(this);_class3.prototype.__init8.call(this); }
1852
+ var LoggingModule = (_class2 = class _LoggingModule {constructor() { _class2.prototype.__init2.call(this);_class2.prototype.__init3.call(this);_class2.prototype.__init4.call(this); }
2584
1853
  static __initStatic() {this.instance = null}
2585
1854
  static getInstance() {
2586
1855
  if (!this.instance) {
@@ -2588,10 +1857,10 @@ var LoggingModule = (_class3 = class _LoggingModule {constructor() { _class3.pro
2588
1857
  }
2589
1858
  return this.instance;
2590
1859
  }
2591
- __init6() {this.config = null}
2592
- __init7() {this.loggerProvider = null}
1860
+ __init2() {this.config = null}
1861
+ __init3() {this.loggerProvider = null}
2593
1862
  /** Providers for scoped service names, keyed by service name. */
2594
- __init8() {this.scopedProviders = /* @__PURE__ */ new Map()}
1863
+ __init4() {this.scopedProviders = /* @__PURE__ */ new Map()}
2595
1864
  /**
2596
1865
  * Build the log exporter for a service. The service header is fixed per
2597
1866
  * exporter and the gateway rewrites service.name from it, so each service
@@ -2625,14 +1894,14 @@ var LoggingModule = (_class3 = class _LoggingModule {constructor() { _class3.pro
2625
1894
  _chunkWC573FCIcjs.logger.debug("Creating logger provider", {
2626
1895
  serviceName,
2627
1896
  disableBatch: config.disableBatch,
2628
- hasMasking: !!_optionalChain([config, 'access', _102 => _102.masking, 'optionalAccess', _103 => _103.eventMasking])
1897
+ hasMasking: !!_optionalChain([config, 'access', _74 => _74.masking, 'optionalAccess', _75 => _75.eventMasking])
2629
1898
  });
2630
1899
  const exporter = this.createLogExporter(config, serviceName);
2631
1900
  const processor = config.disableBatch ? new BrizzSimpleLogRecordProcessor(exporter, config) : new BrizzBatchLogRecordProcessor(exporter, config);
2632
1901
  const resourceAttributes = {
2633
1902
  ...config.resourceAttributes,
2634
1903
  "service.name": serviceName,
2635
- [BRIZZ_SDK_VERSION]: _chunkDCXOK7PXcjs.getSDKVersion.call(void 0, ),
1904
+ [BRIZZ_SDK_VERSION]: _chunkJGATEWJBcjs.getSDKVersion.call(void 0, ),
2636
1905
  [BRIZZ_SDK_LANGUAGE]: SDK_LANGUAGE
2637
1906
  };
2638
1907
  if (config.environment) {
@@ -2651,7 +1920,7 @@ var LoggingModule = (_class3 = class _LoggingModule {constructor() { _class3.pro
2651
1920
  * `callWithServiceName`, else the configured appName.
2652
1921
  */
2653
1922
  activeLoggerProvider() {
2654
- const serviceName = resolveServiceNameFromContext();
1923
+ const serviceName = _chunkXGD5HD5Wcjs.resolveServiceNameFromContext.call(void 0, );
2655
1924
  if (!serviceName || !this.config || serviceName === this.config.appName) {
2656
1925
  return this.loggerProvider;
2657
1926
  }
@@ -2674,6 +1943,7 @@ var LoggingModule = (_class3 = class _LoggingModule {constructor() { _class3.pro
2674
1943
  this.loggerProvider = this.createLoggerProvider(config, config.appName);
2675
1944
  }
2676
1945
  _LoggingModule.instance = this;
1946
+ _chunkXGD5HD5Wcjs.setEventSink.call(void 0, this);
2677
1947
  _chunkWC573FCIcjs.logger.info("Logging module setup completed");
2678
1948
  }
2679
1949
  /**
@@ -2733,7 +2003,7 @@ var LoggingModule = (_class3 = class _LoggingModule {constructor() { _class3.pro
2733
2003
  }
2734
2004
  async forceFlush() {
2735
2005
  await Promise.all(
2736
- [...this.scopedProviders.values(), this.loggerProvider].map(async (p) => _optionalChain([p, 'optionalAccess', _104 => _104.forceFlush, 'call', _105 => _105()]))
2006
+ [...this.scopedProviders.values(), this.loggerProvider].map(async (p) => _optionalChain([p, 'optionalAccess', _76 => _76.forceFlush, 'call', _77 => _77()]))
2737
2007
  );
2738
2008
  }
2739
2009
  /**
@@ -2751,22 +2021,15 @@ var LoggingModule = (_class3 = class _LoggingModule {constructor() { _class3.pro
2751
2021
  if (_LoggingModule.instance === this) {
2752
2022
  _LoggingModule.instance = null;
2753
2023
  }
2024
+ _chunkXGD5HD5Wcjs.clearEventSink.call(void 0, this);
2754
2025
  _chunkWC573FCIcjs.logger.debug("Logging module shutdown completed");
2755
2026
  }
2756
- }, _class3.__initStatic(), _class3);
2757
- function emitEvent(name, attributes, body, severityNumber = _api.SeverityNumber.INFO) {
2758
- return LoggingModule.getInstance().emitEvent(name, attributes, body, severityNumber);
2759
- }
2760
- function emitEventWithSessionId(sessionId, name, attributes, body, severityNumber = _api.SeverityNumber.INFO) {
2761
- return callWithSessionId(sessionId, () => {
2762
- LoggingModule.getInstance().emitEvent(name, attributes, body, severityNumber);
2763
- });
2764
- }
2027
+ }, _class2.__initStatic(), _class2);
2765
2028
 
2766
2029
  // src/internal/metric/metrics.ts
2767
2030
  var _exportermetricsotlphttp = require('@opentelemetry/exporter-metrics-otlp-http');
2768
2031
 
2769
- var MetricsModule = (_class4 = class _MetricsModule {constructor() { _class4.prototype.__init9.call(this);_class4.prototype.__init10.call(this); }
2032
+ var MetricsModule = (_class3 = class _MetricsModule {constructor() { _class3.prototype.__init5.call(this);_class3.prototype.__init6.call(this); }
2770
2033
  static __initStatic2() {this.instance = null}
2771
2034
  static getInstance() {
2772
2035
  if (!this.instance) {
@@ -2774,8 +2037,8 @@ var MetricsModule = (_class4 = class _MetricsModule {constructor() { _class4.pro
2774
2037
  }
2775
2038
  return this.instance;
2776
2039
  }
2777
- __init9() {this.metricsExporter = null}
2778
- __init10() {this.metricsReader = null}
2040
+ __init5() {this.metricsExporter = null}
2041
+ __init6() {this.metricsReader = null}
2779
2042
  /**
2780
2043
  * Initialize the metrics exporter
2781
2044
  */
@@ -2846,7 +2109,7 @@ var MetricsModule = (_class4 = class _MetricsModule {constructor() { _class4.pro
2846
2109
  return this.metricsReader;
2847
2110
  }
2848
2111
  async forceFlush() {
2849
- await _optionalChain([this, 'access', _106 => _106.metricsReader, 'optionalAccess', _107 => _107.forceFlush, 'call', _108 => _108()]);
2112
+ await _optionalChain([this, 'access', _78 => _78.metricsReader, 'optionalAccess', _79 => _79.forceFlush, 'call', _80 => _80()]);
2850
2113
  }
2851
2114
  /**
2852
2115
  * Shutdown the metrics module
@@ -2860,7 +2123,7 @@ var MetricsModule = (_class4 = class _MetricsModule {constructor() { _class4.pro
2860
2123
  }
2861
2124
  _chunkWC573FCIcjs.logger.debug("Metrics module shutdown completed");
2862
2125
  }
2863
- }, _class4.__initStatic2(), _class4);
2126
+ }, _class3.__initStatic2(), _class3);
2864
2127
  function getMetricsExporter() {
2865
2128
  return MetricsModule.getInstance().getMetricsExporter();
2866
2129
  }
@@ -2874,22 +2137,22 @@ var _exportertraceotlpproto = require('@opentelemetry/exporter-trace-otlp-proto'
2874
2137
  // src/internal/trace/exporters/span-exporter.ts
2875
2138
  var _core = require('@opentelemetry/core');
2876
2139
 
2877
- var BrizzSpanExporter = (_class5 = class {
2140
+ var BrizzSpanExporter = (_class4 = class {
2878
2141
 
2879
2142
 
2880
2143
 
2881
2144
 
2882
- __init11() {this._resources = /* @__PURE__ */ new Map()}
2883
- __init12() {this._delegates = /* @__PURE__ */ new Map()}
2145
+ __init7() {this._resources = /* @__PURE__ */ new Map()}
2146
+ __init8() {this._delegates = /* @__PURE__ */ new Map()}
2884
2147
 
2885
- constructor(delegate, config, factory) {;_class5.prototype.__init11.call(this);_class5.prototype.__init12.call(this);
2148
+ constructor(delegate, config, factory) {;_class4.prototype.__init7.call(this);_class4.prototype.__init8.call(this);
2886
2149
  this._delegate = delegate;
2887
2150
  this._delegateFactory = factory;
2888
2151
  this._defaultServiceName = config.appName;
2889
2152
  const resourceAttrs = {
2890
2153
  ...config.resourceAttributes,
2891
2154
  "service.name": config.appName,
2892
- [BRIZZ_SDK_VERSION]: _chunkDCXOK7PXcjs.getSDKVersion.call(void 0, ),
2155
+ [BRIZZ_SDK_VERSION]: _chunkJGATEWJBcjs.getSDKVersion.call(void 0, ),
2893
2156
  [BRIZZ_SDK_LANGUAGE]: SDK_LANGUAGE
2894
2157
  };
2895
2158
  if (config.environment) {
@@ -3016,11 +2279,11 @@ var BrizzSpanExporter = (_class5 = class {
3016
2279
  }
3017
2280
  async forceFlush() {
3018
2281
  await Promise.all([
3019
- _optionalChain([this, 'access', _109 => _109._delegate, 'access', _110 => _110.forceFlush, 'optionalCall', _111 => _111()]),
3020
- ...[...this._delegates.values()].map(async (delegate) => _optionalChain([delegate, 'access', _112 => _112.forceFlush, 'optionalCall', _113 => _113()]))
2282
+ _optionalChain([this, 'access', _81 => _81._delegate, 'access', _82 => _82.forceFlush, 'optionalCall', _83 => _83()]),
2283
+ ...[...this._delegates.values()].map(async (delegate) => _optionalChain([delegate, 'access', _84 => _84.forceFlush, 'optionalCall', _85 => _85()]))
3021
2284
  ]);
3022
2285
  }
3023
- }, _class5);
2286
+ }, _class4);
3024
2287
 
3025
2288
  // src/internal/trace/processors/span-processor.ts
3026
2289
 
@@ -3075,7 +2338,7 @@ var BrizzSimpleSpanProcessor = class extends _sdktrace.SimpleSpanProcessor {
3075
2338
  }
3076
2339
  onEnd(span) {
3077
2340
  restampLangChainSpan(span);
3078
- const maskingConfig = _optionalChain([this, 'access', _114 => _114.config, 'access', _115 => _115.masking, 'optionalAccess', _116 => _116.spanMasking]);
2341
+ const maskingConfig = _optionalChain([this, 'access', _86 => _86.config, 'access', _87 => _87.masking, 'optionalAccess', _88 => _88.spanMasking]);
3079
2342
  if (maskingConfig) {
3080
2343
  maskReadableSpan(span, maskingConfig);
3081
2344
  }
@@ -3094,7 +2357,7 @@ var BrizzBatchSpanProcessor = class extends _sdktrace.BatchSpanProcessor {
3094
2357
  }
3095
2358
  onEnd(span) {
3096
2359
  restampLangChainSpan(span);
3097
- const maskingConfig = _optionalChain([this, 'access', _117 => _117.config, 'access', _118 => _118.masking, 'optionalAccess', _119 => _119.spanMasking]);
2360
+ const maskingConfig = _optionalChain([this, 'access', _89 => _89.config, 'access', _90 => _90.masking, 'optionalAccess', _91 => _91.spanMasking]);
3098
2361
  if (maskingConfig) {
3099
2362
  maskReadableSpan(span, maskingConfig);
3100
2363
  }
@@ -3111,7 +2374,7 @@ function maskReadableSpan(span, config) {
3111
2374
  for (const [k, v] of Object.entries(attrs)) {
3112
2375
  masked[k] = v;
3113
2376
  }
3114
- if (_optionalChain([config, 'access', _120 => _120.rules, 'optionalAccess', _121 => _121.length])) {
2377
+ if (_optionalChain([config, 'access', _92 => _92.rules, 'optionalAccess', _93 => _93.length])) {
3115
2378
  masked = maskAttributes(masked, config.rules);
3116
2379
  }
3117
2380
  if (!config.disableDefaultRules) {
@@ -3130,7 +2393,7 @@ function maskReadableSpan(span, config) {
3130
2393
  }
3131
2394
 
3132
2395
  // src/internal/trace/tracing.ts
3133
- var TracingModule = (_class6 = class _TracingModule {constructor() { _class6.prototype.__init13.call(this);_class6.prototype.__init14.call(this); }
2396
+ var TracingModule = (_class5 = class _TracingModule {constructor() { _class5.prototype.__init9.call(this);_class5.prototype.__init10.call(this); }
3134
2397
  static __initStatic3() {this.instance = null}
3135
2398
  static getInstance() {
3136
2399
  if (!this.instance) {
@@ -3138,8 +2401,8 @@ var TracingModule = (_class6 = class _TracingModule {constructor() { _class6.pro
3138
2401
  }
3139
2402
  return this.instance;
3140
2403
  }
3141
- __init13() {this.spanExporter = null}
3142
- __init14() {this.spanProcessor = null}
2404
+ __init9() {this.spanExporter = null}
2405
+ __init10() {this.spanProcessor = null}
3143
2406
  /**
3144
2407
  * Initialize the span exporter
3145
2408
  */
@@ -3183,7 +2446,7 @@ var TracingModule = (_class6 = class _TracingModule {constructor() { _class6.pro
3183
2446
  }
3184
2447
  _chunkWC573FCIcjs.logger.debug("Initializing span processor", {
3185
2448
  disableBatch: config.disableBatch,
3186
- hasMasking: !!_optionalChain([config, 'access', _122 => _122.masking, 'optionalAccess', _123 => _123.spanMasking])
2449
+ hasMasking: !!_optionalChain([config, 'access', _94 => _94.masking, 'optionalAccess', _95 => _95.spanMasking])
3187
2450
  });
3188
2451
  const spanProcessor = config.disableBatch ? new BrizzSimpleSpanProcessor(this.spanExporter, config) : new BrizzBatchSpanProcessor(this.spanExporter, config);
3189
2452
  _chunkWC573FCIcjs.logger.debug("Span processor initialized successfully");
@@ -3227,7 +2490,7 @@ var TracingModule = (_class6 = class _TracingModule {constructor() { _class6.pro
3227
2490
  return this.spanProcessor;
3228
2491
  }
3229
2492
  async forceFlush() {
3230
- await _optionalChain([this, 'access', _124 => _124.spanProcessor, 'optionalAccess', _125 => _125.forceFlush, 'call', _126 => _126()]);
2493
+ await _optionalChain([this, 'access', _96 => _96.spanProcessor, 'optionalAccess', _97 => _97.forceFlush, 'call', _98 => _98()]);
3231
2494
  }
3232
2495
  async shutdown() {
3233
2496
  _chunkWC573FCIcjs.logger.debug("Shutting down tracing module");
@@ -3242,7 +2505,7 @@ var TracingModule = (_class6 = class _TracingModule {constructor() { _class6.pro
3242
2505
  _TracingModule.instance = null;
3243
2506
  _chunkWC573FCIcjs.logger.debug("Tracing module shutdown completed");
3244
2507
  }
3245
- }, _class6.__initStatic3(), _class6);
2508
+ }, _class5.__initStatic3(), _class5);
3246
2509
  function getSpanExporter() {
3247
2510
  return TracingModule.getInstance().getSpanExporter();
3248
2511
  }
@@ -3250,133 +2513,6 @@ function getSpanProcessor() {
3250
2513
  return TracingModule.getInstance().getSpanProcessor();
3251
2514
  }
3252
2515
 
3253
- // src/internal/trace/agent.ts
3254
- var _crypto = require('crypto');
3255
-
3256
- function newInstanceId() {
3257
- return _crypto.randomUUID.call(void 0, ).replaceAll("-", "").slice(0, 8);
3258
- }
3259
- function activeProperties() {
3260
- return _nullishCoalesce(_api.context.active().getValue(_chunkRV7JIIDGcjs.PROPERTIES_CONTEXT_KEY), () => ( {}));
3261
- }
3262
- function encodeToken(agent) {
3263
- const payload = {
3264
- id: agent.id,
3265
- parentId: agent.parentId,
3266
- name: agent.name,
3267
- traceparent: agent.traceparent,
3268
- sessionId: agent.sessionId
3269
- };
3270
- return Buffer.from(JSON.stringify(payload), "utf8").toString("base64url");
3271
- }
3272
- function currentTraceparent() {
3273
- const carrier = {};
3274
- try {
3275
- _chunkDC2MFO65cjs.injectTraceContext.call(void 0, _api.context.active(), carrier);
3276
- } catch (e7) {
3277
- }
3278
- return _nullishCoalesce(carrier["traceparent"], () => ( ""));
3279
- }
3280
- function agentHandle(id, parentId, name) {
3281
- const opened = {
3282
- id,
3283
- parentId,
3284
- name,
3285
- traceparent: currentTraceparent(),
3286
- sessionId: _nullishCoalesce(activeProperties()[_chunkRV7JIIDGcjs.SESSION_ID], () => ( ""))
3287
- };
3288
- return {
3289
- ...opened,
3290
- get token() {
3291
- return encodeToken(opened);
3292
- }
3293
- };
3294
- }
3295
- function decodeToken(token) {
3296
- try {
3297
- const payload = JSON.parse(Buffer.from(token, "base64url").toString("utf8"));
3298
- return payload.id ? payload : void 0;
3299
- } catch (e8) {
3300
- return void 0;
3301
- }
3302
- }
3303
- function unreadableAgent(agent) {
3304
- return {
3305
- id: "",
3306
- parentId: "",
3307
- name: "",
3308
- traceparent: "",
3309
- sessionId: "",
3310
- token: typeof agent === "string" ? "" : _nullishCoalesce(agent.token, () => ( ""))
3311
- };
3312
- }
3313
- function resolveAgent(agent) {
3314
- const options = typeof agent === "string" ? { name: agent } : agent;
3315
- let id;
3316
- let parentId;
3317
- let name;
3318
- let sessionId = "";
3319
- let parentContext = _api.context.active();
3320
- if (options.token === void 0) {
3321
- id = options.id || newInstanceId();
3322
- parentId = options.parentId || activeProperties()[_chunkRV7JIIDGcjs.AGENT_ID] || "";
3323
- name = _nullishCoalesce(options.name, () => ( ""));
3324
- } else {
3325
- const decoded = decodeToken(options.token);
3326
- if (!decoded) {
3327
- _chunkWC573FCIcjs.logger.warn("Brizz: ignoring an unreadable agent token");
3328
- return void 0;
3329
- }
3330
- id = decoded.id;
3331
- parentId = decoded.parentId;
3332
- name = decoded.name;
3333
- sessionId = decoded.sessionId;
3334
- if (decoded.traceparent) {
3335
- try {
3336
- parentContext = _chunkDC2MFO65cjs.extractTraceContext.call(void 0, parentContext, { traceparent: decoded.traceparent });
3337
- } catch (e9) {
3338
- }
3339
- }
3340
- }
3341
- const properties = { [_chunkRV7JIIDGcjs.AGENT_ID]: id, [_chunkRV7JIIDGcjs.AGENT_NAME]: name };
3342
- if (parentId) {
3343
- properties[_chunkRV7JIIDGcjs.AGENT_PARENT_ID] = parentId;
3344
- }
3345
- if (sessionId) {
3346
- properties[_chunkRV7JIIDGcjs.SESSION_ID] = sessionId;
3347
- }
3348
- return { id, parentId, name, properties, parentContext };
3349
- }
3350
- function startAgent(agent, callback) {
3351
- const resolved = resolveAgent(agent);
3352
- if (!resolved) {
3353
- return callback(unreadableAgent(agent));
3354
- }
3355
- const { id, parentId, name, properties, parentContext } = resolved;
3356
- return _api.context.with(
3357
- parentContext,
3358
- () => callWithProperties(properties, () => callback(agentHandle(id, parentId, name)))
3359
- );
3360
- }
3361
- function withAgent(agent, fn, thisArg) {
3362
- return function wrapped(...args) {
3363
- return startAgent(
3364
- agent,
3365
- () => fn.apply(thisArg !== void 0 ? thisArg : this, args)
3366
- );
3367
- };
3368
- }
3369
- function setAgent(agent) {
3370
- const resolved = resolveAgent(agent);
3371
- if (!resolved) {
3372
- return unreadableAgent(agent);
3373
- }
3374
- const { id, parentId, name, properties, parentContext } = resolved;
3375
- setCurrentSpanCustomProperties(properties);
3376
- propagatePropertiesImperatively(properties, parentContext);
3377
- return agentHandle(id, parentId, name);
3378
- }
3379
-
3380
2516
  // src/internal/sdk.ts
3381
2517
  function resolveMcpSessionTracking(configured) {
3382
2518
  const fromEnv = process.env["BRIZZ_MCP_SESSION_TRACKING"];
@@ -3391,7 +2527,7 @@ function globalTracerDelegate() {
3391
2527
  const global = _api.trace.getTracerProvider();
3392
2528
  return typeof global.getDelegate === "function" ? global.getDelegate() : global;
3393
2529
  }
3394
- var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init15.call(this);_class7.prototype.__init16.call(this);_class7.prototype.__init17.call(this); }
2530
+ var _Brizz = (_class6 = class __Brizz {constructor() { _class6.prototype.__init11.call(this);_class6.prototype.__init12.call(this);_class6.prototype.__init13.call(this); }
3395
2531
  static __initStatic4() {this.instance = null}
3396
2532
  static getInstance() {
3397
2533
  if (!this.instance) {
@@ -3400,18 +2536,18 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
3400
2536
  return this.instance;
3401
2537
  }
3402
2538
  /** Flag indicating if SDK initialization has completed successfully */
3403
- __init15() {this._initialized = false}
2539
+ __init11() {this._initialized = false}
3404
2540
  /** OpenTelemetry tracer provider */
3405
- __init16() {this._tracerProvider = null}
2541
+ __init12() {this._tracerProvider = null}
3406
2542
  /** OpenTelemetry meter provider */
3407
- __init17() {this._meterProvider = null}
2543
+ __init13() {this._meterProvider = null}
3408
2544
  /**
3409
2545
  * Set up instrumentation registry and configure manual modules.
3410
2546
  * @private
3411
2547
  */
3412
2548
  setupInstrumentation(options) {
3413
2549
  const registry = InstrumentationRegistry.getInstance();
3414
- _chunkDCXOK7PXcjs.configure.call(void 0, resolveMcpSessionTracking(options.mcpSessionTracking));
2550
+ _chunkJGATEWJBcjs.configure.call(void 0, resolveMcpSessionTracking(options.mcpSessionTracking));
3415
2551
  patchInstalledCallbackManager();
3416
2552
  patchInstalledLangGraph();
3417
2553
  patchInstalledTypeSafe();
@@ -3446,7 +2582,7 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
3446
2582
  const resourceAttributes = {
3447
2583
  ...resolvedConfig.resourceAttributes,
3448
2584
  "service.name": resolvedConfig.appName,
3449
- [BRIZZ_SDK_VERSION]: _chunkDCXOK7PXcjs.getSDKVersion.call(void 0, ),
2585
+ [BRIZZ_SDK_VERSION]: _chunkJGATEWJBcjs.getSDKVersion.call(void 0, ),
3450
2586
  [BRIZZ_SDK_LANGUAGE]: SDK_LANGUAGE
3451
2587
  };
3452
2588
  if (resolvedConfig.environment) {
@@ -3556,19 +2692,19 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
3556
2692
  try {
3557
2693
  const tracingModule = TracingModule.getInstance();
3558
2694
  await tracingModule.shutdown();
3559
- } catch (e10) {
2695
+ } catch (e5) {
3560
2696
  _chunkWC573FCIcjs.logger.debug("Tracing module already shut down or not initialized");
3561
2697
  }
3562
2698
  try {
3563
2699
  const metricsModule = MetricsModule.getInstance();
3564
2700
  metricsModule.shutdown();
3565
- } catch (e11) {
2701
+ } catch (e6) {
3566
2702
  _chunkWC573FCIcjs.logger.debug("Metrics module already shut down or not initialized");
3567
2703
  }
3568
2704
  try {
3569
2705
  const loggingModule = LoggingModule.getInstance();
3570
2706
  await loggingModule.shutdown();
3571
- } catch (e12) {
2707
+ } catch (e7) {
3572
2708
  _chunkWC573FCIcjs.logger.debug("Logging module already shut down or not initialized");
3573
2709
  }
3574
2710
  _chunkWC573FCIcjs.logger.info("All telemetry modules shut down successfully");
@@ -3690,10 +2826,10 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
3690
2826
  }
3691
2827
  try {
3692
2828
  await this.shutdownModules();
3693
- await _optionalChain([this, 'access', _127 => _127._tracerProvider, 'optionalAccess', _128 => _128.forceFlush, 'call', _129 => _129()]);
3694
- await _optionalChain([this, 'access', _130 => _130._tracerProvider, 'optionalAccess', _131 => _131.shutdown, 'call', _132 => _132()]);
3695
- await _optionalChain([this, 'access', _133 => _133._meterProvider, 'optionalAccess', _134 => _134.forceFlush, 'call', _135 => _135()]);
3696
- await _optionalChain([this, 'access', _136 => _136._meterProvider, 'optionalAccess', _137 => _137.shutdown, 'call', _138 => _138()]);
2829
+ await _optionalChain([this, 'access', _99 => _99._tracerProvider, 'optionalAccess', _100 => _100.forceFlush, 'call', _101 => _101()]);
2830
+ await _optionalChain([this, 'access', _102 => _102._tracerProvider, 'optionalAccess', _103 => _103.shutdown, 'call', _104 => _104()]);
2831
+ await _optionalChain([this, 'access', _105 => _105._meterProvider, 'optionalAccess', _106 => _106.forceFlush, 'call', _107 => _107()]);
2832
+ await _optionalChain([this, 'access', _108 => _108._meterProvider, 'optionalAccess', _109 => _109.shutdown, 'call', _110 => _110()]);
3697
2833
  this._initialized = false;
3698
2834
  this._tracerProvider = null;
3699
2835
  this._meterProvider = null;
@@ -3708,7 +2844,7 @@ var _Brizz = (_class7 = class __Brizz {constructor() { _class7.prototype.__init1
3708
2844
  }
3709
2845
  }
3710
2846
  }
3711
- }, _class7.__initStatic4(), _class7);
2847
+ }, _class6.__initStatic4(), _class6);
3712
2848
  var Brizz = new _Brizz();
3713
2849
 
3714
2850
  // src/index.ts
@@ -3761,4 +2897,4 @@ var Brizz = new _Brizz();
3761
2897
 
3762
2898
 
3763
2899
 
3764
- exports.Brizz = Brizz; exports.DEFAULT_PII_PATTERNS = DEFAULT_PII_PATTERNS; exports.LogLevel = _chunkWC573FCIcjs.LogLevel; exports.Session = Session; exports.SessionTitle = SessionTitle; exports.SeverityNumber = _api.SeverityNumber; exports.addExternalLink = addExternalLink; exports.callWithMessageId = callWithMessageId; exports.callWithMute = callWithMute; exports.callWithOrganization = callWithOrganization; exports.callWithProperties = callWithProperties; exports.callWithServiceName = callWithServiceName; exports.callWithSessionId = callWithSessionId; exports.callWithUser = callWithUser; exports.emitEvent = emitEvent; exports.emitEventWithSessionId = emitEventWithSessionId; exports.getActiveSession = getActiveSession; exports.getLogLevel = _chunkWC573FCIcjs.getLogLevel; exports.getMetricsExporter = getMetricsExporter; exports.getMetricsReader = getMetricsReader; exports.getSpanExporter = getSpanExporter; exports.getSpanProcessor = getSpanProcessor; exports.getTracerProvider = _chunkDC2MFO65cjs.getTracerProvider; exports.logger = _chunkWC573FCIcjs.logger; exports.maskAttributes = maskAttributes; exports.maskValue = maskValue; exports.recordFeedback = recordFeedback; exports.recordMetric = recordMetric; exports.setAgent = setAgent; exports.setCurrentSpanCustomProperties = setCurrentSpanCustomProperties; exports.setLogLevel = _chunkWC573FCIcjs.setLogLevel; exports.setMessageId = setMessageId; exports.setOrganization = setOrganization; exports.setServiceName = setServiceName; exports.setSessionId = setSessionId; exports.setUser = setUser; exports.startAgent = startAgent; exports.startSession = startSession; exports.startSessionTitle = startSessionTitle; exports.withAgent = withAgent; exports.withMessageId = withMessageId; exports.withMute = withMute; exports.withOrganization = withOrganization; exports.withProperties = withProperties; exports.withServiceName = withServiceName; exports.withSessionId = withSessionId; exports.withUser = withUser;
2900
+ exports.Brizz = Brizz; exports.DEFAULT_PII_PATTERNS = DEFAULT_PII_PATTERNS; exports.LogLevel = _chunkWC573FCIcjs.LogLevel; 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.getLogLevel = _chunkWC573FCIcjs.getLogLevel; exports.getMetricsExporter = getMetricsExporter; exports.getMetricsReader = getMetricsReader; exports.getSpanExporter = getSpanExporter; exports.getSpanProcessor = getSpanProcessor; exports.getTracerProvider = _chunkDC2MFO65cjs.getTracerProvider; exports.logger = _chunkWC573FCIcjs.logger; exports.maskAttributes = maskAttributes; exports.maskValue = maskValue; exports.recordFeedback = _chunkXGD5HD5Wcjs.recordFeedback; exports.recordMetric = _chunkXGD5HD5Wcjs.recordMetric; exports.setAgent = _chunkXGD5HD5Wcjs.setAgent; exports.setCurrentSpanCustomProperties = _chunkXGD5HD5Wcjs.setCurrentSpanCustomProperties; exports.setLogLevel = _chunkWC573FCIcjs.setLogLevel; 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;