@brizz/sdk 0.1.30 → 0.1.32
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/README.md +64 -0
- package/dist/chunk-3RG5ZIWI.js +10 -0
- package/dist/chunk-6M3CBP2N.js +8 -0
- package/dist/chunk-7SUF4VVI.js +36 -0
- package/dist/{chunk-LTXMCGVQ.cjs → chunk-A3OOY5A2.cjs} +49 -9
- package/dist/{chunk-NUTJMVD4.cjs → chunk-IH7TSRRT.cjs} +175 -199
- package/dist/{chunk-MWX3GIJW.js → chunk-LTLONC6I.js} +48 -8
- package/dist/chunk-OBGZSXTJ.cjs +10 -0
- package/dist/chunk-OZCOXBB7.cjs +46 -0
- package/dist/chunk-SCYD7XCI.cjs +8 -0
- package/dist/{chunk-6UYAVA5T.js → chunk-U474AL6K.js} +16 -40
- package/dist/chunk-UNLNNKZ7.cjs +36 -0
- package/dist/{chunk-RORIBZEV.js → chunk-VGMJ3KUM.js} +0 -8
- package/dist/{chunk-JB6MA2RV.cjs → chunk-WC573FCI.cjs} +1 -7
- package/dist/{chunk-3OLW4TOG.js → chunk-Y4HNUX3Q.js} +1 -7
- package/dist/eve.cjs +88 -0
- package/dist/eve.d.cts +19 -0
- package/dist/eve.d.ts +19 -0
- package/dist/eve.js +88 -0
- package/dist/index.cjs +56 -28
- package/dist/index.js +41 -13
- package/dist/interrupt-6D6DA7R2.cjs +12 -0
- package/dist/{interrupt-HDNPDMYY.js → interrupt-VMUSMALH.js} +3 -2
- package/dist/{mcp-56TY4LZ5.js → mcp-3YERODPL.js} +6 -3
- package/dist/{mcp-6BDG4SWY.cjs → mcp-GXP22YAQ.cjs} +29 -26
- package/dist/preload.cjs +13 -10
- package/dist/preload.js +7 -4
- package/package.json +43 -28
- package/dist/chunk-GCORRK6B.cjs +0 -54
- package/dist/interrupt-HOP3XPQF.cjs +0 -11
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,18 @@
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkIH7TSRRTcjs = require('./chunk-IH7TSRRT.cjs');
|
|
27
|
+
require('./chunk-UNLNNKZ7.cjs');
|
|
28
|
+
require('./chunk-SCYD7XCI.cjs');
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
|
|
30
32
|
|
|
31
33
|
|
|
32
|
-
var
|
|
33
|
-
require('./chunk-
|
|
34
|
-
require('./chunk-
|
|
34
|
+
var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
|
|
35
|
+
require('./chunk-A3OOY5A2.cjs');
|
|
36
|
+
require('./chunk-OZCOXBB7.cjs');
|
|
37
|
+
require('./chunk-OBGZSXTJ.cjs');
|
|
35
38
|
|
|
36
39
|
// src/internal/instrumentation/auto-init.ts
|
|
37
40
|
var _instrumentation = require('@opentelemetry/instrumentation');
|
|
@@ -45,7 +48,7 @@ var _instrumentationpinecone = require('@traceloop/instrumentation-pinecone');
|
|
|
45
48
|
var _instrumentationqdrant = require('@traceloop/instrumentation-qdrant');
|
|
46
49
|
var _instrumentationtogether = require('@traceloop/instrumentation-together');
|
|
47
50
|
var exceptionLogger = (error) => {
|
|
48
|
-
|
|
51
|
+
_chunkWC573FCIcjs.logger.error(`Exception in instrumentation: ${String(error)}`);
|
|
49
52
|
};
|
|
50
53
|
function loadGenAIInstrumentations() {
|
|
51
54
|
const instrumentations = [];
|
|
@@ -64,28 +67,28 @@ function loadGenAIInstrumentations() {
|
|
|
64
67
|
try {
|
|
65
68
|
const instrumentation = new config.class({ exceptionLogger });
|
|
66
69
|
instrumentations.push(instrumentation);
|
|
67
|
-
|
|
70
|
+
_chunkWC573FCIcjs.logger.debug(`Auto-loaded ${config.name} instrumentation`);
|
|
68
71
|
} catch (error) {
|
|
69
|
-
|
|
72
|
+
_chunkWC573FCIcjs.logger.error(`Failed to auto-load ${config.name} instrumentation: ${String(error)}`);
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
try {
|
|
73
76
|
_instrumentation.registerInstrumentations.call(void 0, { instrumentations });
|
|
74
|
-
|
|
77
|
+
_chunkWC573FCIcjs.logger.info(`Auto-registered ${instrumentations.length} GenAI instrumentations`);
|
|
75
78
|
} catch (error) {
|
|
76
|
-
|
|
79
|
+
_chunkWC573FCIcjs.logger.error(`Failed to register GenAI instrumentations: ${String(error)}`);
|
|
77
80
|
}
|
|
78
81
|
return instrumentations;
|
|
79
82
|
}
|
|
80
83
|
function loadMCPInstrumentation() {
|
|
81
84
|
void (async () => {
|
|
82
85
|
try {
|
|
83
|
-
const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-
|
|
86
|
+
const { MCPInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("./mcp-GXP22YAQ.cjs")));
|
|
84
87
|
const mcp = new MCPInstrumentation({ exceptionLogger });
|
|
85
88
|
_instrumentation.registerInstrumentations.call(void 0, { instrumentations: [mcp] });
|
|
86
|
-
|
|
89
|
+
_chunkWC573FCIcjs.logger.debug("Auto-loaded MCP instrumentation");
|
|
87
90
|
} catch (error) {
|
|
88
|
-
|
|
91
|
+
_chunkWC573FCIcjs.logger.debug(
|
|
89
92
|
`MCP instrumentation not loaded (install @modelcontextprotocol/sdk and @arizeai/openinference-instrumentation-mcp if you want MCP support): ${String(error)}`
|
|
90
93
|
);
|
|
91
94
|
}
|
|
@@ -97,30 +100,55 @@ function loadVertexAIInstrumentation() {
|
|
|
97
100
|
const { VertexAIInstrumentation } = await Promise.resolve().then(() => _interopRequireWildcard(require("@traceloop/instrumentation-vertexai")));
|
|
98
101
|
const vertexAI = new VertexAIInstrumentation({ exceptionLogger });
|
|
99
102
|
_instrumentation.registerInstrumentations.call(void 0, { instrumentations: [vertexAI] });
|
|
100
|
-
|
|
103
|
+
_chunkWC573FCIcjs.logger.debug("Auto-loaded Vertex AI instrumentation");
|
|
101
104
|
} catch (error) {
|
|
102
|
-
|
|
105
|
+
_chunkWC573FCIcjs.logger.debug(
|
|
103
106
|
`Vertex AI instrumentation not loaded (install @traceloop/instrumentation-vertexai if you want Vertex AI support): ${String(error)}`
|
|
104
107
|
);
|
|
105
108
|
}
|
|
106
109
|
})();
|
|
107
110
|
}
|
|
108
|
-
function
|
|
111
|
+
function selectTelemetryRegister(ai) {
|
|
112
|
+
const register = _nullishCoalesce(ai.registerTelemetry, () => ( ai.registerTelemetryIntegration));
|
|
113
|
+
return typeof register === "function" ? register : void 0;
|
|
114
|
+
}
|
|
115
|
+
function loadVercelAITelemetry() {
|
|
109
116
|
void (async () => {
|
|
110
117
|
try {
|
|
111
118
|
const ai = await Promise.resolve().then(() => _interopRequireWildcard(require("ai")));
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
const register = selectTelemetryRegister(ai);
|
|
120
|
+
if (!register) {
|
|
121
|
+
_chunkWC573FCIcjs.logger.debug(
|
|
122
|
+
"AI SDK present but lacks a telemetry-registration hook (needs ai@>=6); skipping"
|
|
115
123
|
);
|
|
116
124
|
return;
|
|
117
125
|
}
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
const isV7 = typeof ai.registerTelemetry === "function";
|
|
127
|
+
const integrations = [];
|
|
128
|
+
const { createInterruptIntegration } = await Promise.resolve().then(() => _interopRequireWildcard(require("./interrupt-6D6DA7R2.cjs")));
|
|
129
|
+
integrations.push(createInterruptIntegration());
|
|
130
|
+
let otelCollectorLoaded = false;
|
|
131
|
+
try {
|
|
132
|
+
const otel = await Promise.resolve().then(() => _interopRequireWildcard(require("@ai-sdk/otel")));
|
|
133
|
+
if (typeof otel.LegacyOpenTelemetry === "function") {
|
|
134
|
+
integrations.push(new otel.LegacyOpenTelemetry());
|
|
135
|
+
otelCollectorLoaded = true;
|
|
136
|
+
}
|
|
137
|
+
} catch (e) {
|
|
138
|
+
}
|
|
139
|
+
if (!otelCollectorLoaded) {
|
|
140
|
+
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";
|
|
141
|
+
if (isV7) {
|
|
142
|
+
_chunkWC573FCIcjs.logger.warn(message);
|
|
143
|
+
} else {
|
|
144
|
+
_chunkWC573FCIcjs.logger.debug(message);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
register(...integrations);
|
|
148
|
+
_chunkWC573FCIcjs.logger.debug("Auto-loaded Vercel AI telemetry");
|
|
121
149
|
} catch (error) {
|
|
122
|
-
|
|
123
|
-
`Vercel AI
|
|
150
|
+
_chunkWC573FCIcjs.logger.debug(
|
|
151
|
+
`Vercel AI telemetry not loaded (install ai@>=6 to capture AI SDK telemetry): ${String(error)}`
|
|
124
152
|
);
|
|
125
153
|
}
|
|
126
154
|
})();
|
|
@@ -130,13 +158,13 @@ function autoInitializeInstrumentations() {
|
|
|
130
158
|
const genAIInstrumentations = loadGenAIInstrumentations();
|
|
131
159
|
loadMCPInstrumentation();
|
|
132
160
|
loadVertexAIInstrumentation();
|
|
133
|
-
|
|
134
|
-
|
|
161
|
+
loadVercelAITelemetry();
|
|
162
|
+
_chunkWC573FCIcjs.logger.info(
|
|
135
163
|
`Auto-initialization complete: ${genAIInstrumentations.length} GenAI instrumentations`
|
|
136
164
|
);
|
|
137
165
|
return true;
|
|
138
166
|
} catch (error) {
|
|
139
|
-
|
|
167
|
+
_chunkWC573FCIcjs.logger.error(`Auto-initialization failed: ${String(error)}`);
|
|
140
168
|
return false;
|
|
141
169
|
}
|
|
142
170
|
}
|
|
@@ -178,4 +206,4 @@ var init_exports = {};
|
|
|
178
206
|
|
|
179
207
|
|
|
180
208
|
|
|
181
|
-
exports.Brizz =
|
|
209
|
+
exports.Brizz = _chunkIH7TSRRTcjs.Brizz; exports.DEFAULT_PII_PATTERNS = _chunkIH7TSRRTcjs.DEFAULT_PII_PATTERNS; exports.LogLevel = _chunkWC573FCIcjs.LogLevel; exports.Session = _chunkIH7TSRRTcjs.Session; exports.SessionTitle = _chunkIH7TSRRTcjs.SessionTitle; exports.SeverityNumber = _apilogs.SeverityNumber; exports.addExternalLink = _chunkIH7TSRRTcjs.addExternalLink; exports.callWithMute = _chunkIH7TSRRTcjs.callWithMute; exports.callWithProperties = _chunkIH7TSRRTcjs.callWithProperties; exports.callWithSessionId = _chunkIH7TSRRTcjs.callWithSessionId; exports.detectRuntime = _chunkIH7TSRRTcjs.detectRuntime; exports.emitEvent = _chunkIH7TSRRTcjs.emitEvent; exports.emitEventWithSessionId = _chunkIH7TSRRTcjs.emitEventWithSessionId; exports.getActiveSession = _chunkIH7TSRRTcjs.getActiveSession; exports.getLogLevel = _chunkWC573FCIcjs.getLogLevel; exports.getMetricsExporter = _chunkIH7TSRRTcjs.getMetricsExporter; exports.getMetricsReader = _chunkIH7TSRRTcjs.getMetricsReader; exports.getSpanExporter = _chunkIH7TSRRTcjs.getSpanExporter; exports.getSpanProcessor = _chunkIH7TSRRTcjs.getSpanProcessor; exports.init = init_exports; exports.logger = _chunkWC573FCIcjs.logger; exports.maskAttributes = _chunkIH7TSRRTcjs.maskAttributes; exports.maskValue = _chunkIH7TSRRTcjs.maskValue; exports.setCurrentSpanCustomProperties = _chunkIH7TSRRTcjs.setCurrentSpanCustomProperties; exports.setLogLevel = _chunkWC573FCIcjs.setLogLevel; exports.startSession = _chunkIH7TSRRTcjs.startSession; exports.startSessionTitle = _chunkIH7TSRRTcjs.startSessionTitle; exports.withMute = _chunkIH7TSRRTcjs.withMute; exports.withProperties = _chunkIH7TSRRTcjs.withProperties; exports.withSessionId = _chunkIH7TSRRTcjs.withSessionId;
|
package/dist/index.js
CHANGED
|
@@ -23,15 +23,18 @@ import {
|
|
|
23
23
|
withMute,
|
|
24
24
|
withProperties,
|
|
25
25
|
withSessionId
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-U474AL6K.js";
|
|
27
|
+
import "./chunk-7SUF4VVI.js";
|
|
28
|
+
import "./chunk-6M3CBP2N.js";
|
|
27
29
|
import {
|
|
28
30
|
LogLevel,
|
|
29
31
|
getLogLevel,
|
|
30
32
|
logger,
|
|
31
33
|
setLogLevel
|
|
32
|
-
} from "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
34
|
+
} from "./chunk-Y4HNUX3Q.js";
|
|
35
|
+
import "./chunk-LTLONC6I.js";
|
|
36
|
+
import "./chunk-VGMJ3KUM.js";
|
|
37
|
+
import "./chunk-3RG5ZIWI.js";
|
|
35
38
|
|
|
36
39
|
// src/internal/instrumentation/auto-init.ts
|
|
37
40
|
import { registerInstrumentations } from "@opentelemetry/instrumentation";
|
|
@@ -80,7 +83,7 @@ function loadGenAIInstrumentations() {
|
|
|
80
83
|
function loadMCPInstrumentation() {
|
|
81
84
|
void (async () => {
|
|
82
85
|
try {
|
|
83
|
-
const { MCPInstrumentation } = await import("./mcp-
|
|
86
|
+
const { MCPInstrumentation } = await import("./mcp-3YERODPL.js");
|
|
84
87
|
const mcp = new MCPInstrumentation({ exceptionLogger });
|
|
85
88
|
registerInstrumentations({ instrumentations: [mcp] });
|
|
86
89
|
logger.debug("Auto-loaded MCP instrumentation");
|
|
@@ -105,22 +108,47 @@ function loadVertexAIInstrumentation() {
|
|
|
105
108
|
}
|
|
106
109
|
})();
|
|
107
110
|
}
|
|
108
|
-
function
|
|
111
|
+
function selectTelemetryRegister(ai) {
|
|
112
|
+
const register = ai.registerTelemetry ?? ai.registerTelemetryIntegration;
|
|
113
|
+
return typeof register === "function" ? register : void 0;
|
|
114
|
+
}
|
|
115
|
+
function loadVercelAITelemetry() {
|
|
109
116
|
void (async () => {
|
|
110
117
|
try {
|
|
111
118
|
const ai = await import("ai");
|
|
112
|
-
|
|
119
|
+
const register = selectTelemetryRegister(ai);
|
|
120
|
+
if (!register) {
|
|
113
121
|
logger.debug(
|
|
114
|
-
"AI SDK present but lacks
|
|
122
|
+
"AI SDK present but lacks a telemetry-registration hook (needs ai@>=6); skipping"
|
|
115
123
|
);
|
|
116
124
|
return;
|
|
117
125
|
}
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
126
|
+
const isV7 = typeof ai.registerTelemetry === "function";
|
|
127
|
+
const integrations = [];
|
|
128
|
+
const { createInterruptIntegration } = await import("./interrupt-VMUSMALH.js");
|
|
129
|
+
integrations.push(createInterruptIntegration());
|
|
130
|
+
let otelCollectorLoaded = false;
|
|
131
|
+
try {
|
|
132
|
+
const otel = await import("@ai-sdk/otel");
|
|
133
|
+
if (typeof otel.LegacyOpenTelemetry === "function") {
|
|
134
|
+
integrations.push(new otel.LegacyOpenTelemetry());
|
|
135
|
+
otelCollectorLoaded = true;
|
|
136
|
+
}
|
|
137
|
+
} catch {
|
|
138
|
+
}
|
|
139
|
+
if (!otelCollectorLoaded) {
|
|
140
|
+
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";
|
|
141
|
+
if (isV7) {
|
|
142
|
+
logger.warn(message);
|
|
143
|
+
} else {
|
|
144
|
+
logger.debug(message);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
register(...integrations);
|
|
148
|
+
logger.debug("Auto-loaded Vercel AI telemetry");
|
|
121
149
|
} catch (error) {
|
|
122
150
|
logger.debug(
|
|
123
|
-
`Vercel AI
|
|
151
|
+
`Vercel AI telemetry not loaded (install ai@>=6 to capture AI SDK telemetry): ${String(error)}`
|
|
124
152
|
);
|
|
125
153
|
}
|
|
126
154
|
})();
|
|
@@ -130,7 +158,7 @@ function autoInitializeInstrumentations() {
|
|
|
130
158
|
const genAIInstrumentations = loadGenAIInstrumentations();
|
|
131
159
|
loadMCPInstrumentation();
|
|
132
160
|
loadVertexAIInstrumentation();
|
|
133
|
-
|
|
161
|
+
loadVercelAITelemetry();
|
|
134
162
|
logger.info(
|
|
135
163
|
`Auto-initialization complete: ${genAIInstrumentations.length} GenAI instrumentations`
|
|
136
164
|
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkA3OOY5A2cjs = require('./chunk-A3OOY5A2.cjs');
|
|
6
|
+
require('./chunk-OZCOXBB7.cjs');
|
|
7
|
+
require('./chunk-OBGZSXTJ.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.InterruptPropagator = _chunkA3OOY5A2cjs.InterruptPropagator; exports._resetInterruptState = _chunkA3OOY5A2cjs._resetInterruptState; exports.createInterruptIntegration = _chunkA3OOY5A2cjs.createInterruptIntegration;
|
|
@@ -2,8 +2,9 @@ import {
|
|
|
2
2
|
InterruptPropagator,
|
|
3
3
|
_resetInterruptState,
|
|
4
4
|
createInterruptIntegration
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-LTLONC6I.js";
|
|
6
|
+
import "./chunk-VGMJ3KUM.js";
|
|
7
|
+
import "./chunk-3RG5ZIWI.js";
|
|
7
8
|
export {
|
|
8
9
|
InterruptPropagator,
|
|
9
10
|
_resetInterruptState,
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
|
-
getSDKVersion
|
|
2
|
+
getSDKVersion
|
|
3
|
+
} from "./chunk-6M3CBP2N.js";
|
|
4
|
+
import {
|
|
3
5
|
logger
|
|
4
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y4HNUX3Q.js";
|
|
5
7
|
import {
|
|
6
8
|
BRIZZ,
|
|
7
9
|
PROPERTIES_CONTEXT_KEY,
|
|
8
10
|
SESSION_ID
|
|
9
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VGMJ3KUM.js";
|
|
12
|
+
import "./chunk-3RG5ZIWI.js";
|
|
10
13
|
|
|
11
14
|
// src/internal/instrumentation/mcp/instrumentation.ts
|
|
12
15
|
import { MCPInstrumentation as BaseMCPInstrumentation } from "@arizeai/openinference-instrumentation-mcp";
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
+
var _chunkSCYD7XCIcjs = require('./chunk-SCYD7XCI.cjs');
|
|
3
4
|
|
|
4
|
-
var _chunkJB6MA2RVcjs = require('./chunk-JB6MA2RV.cjs');
|
|
5
5
|
|
|
6
|
+
var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
var _chunkOZCOXBB7cjs = require('./chunk-OZCOXBB7.cjs');
|
|
12
|
+
require('./chunk-OBGZSXTJ.cjs');
|
|
10
13
|
|
|
11
14
|
// src/internal/instrumentation/mcp/instrumentation.ts
|
|
12
15
|
var _openinferenceinstrumentationmcp = require('@arizeai/openinference-instrumentation-mcp');
|
|
@@ -99,7 +102,7 @@ function emitSchemaSpansFromListResponse(result, transportSessionId, tracer) {
|
|
|
99
102
|
}
|
|
100
103
|
function stampSchemaAttributes(span, toolName, transportSessionId, tool) {
|
|
101
104
|
if (!span.isRecording()) {
|
|
102
|
-
|
|
105
|
+
_chunkWC573FCIcjs.logger.warn(
|
|
103
106
|
`Brizz MCP: schema span is not recording; dropping attributes for ${toolName}`
|
|
104
107
|
);
|
|
105
108
|
return;
|
|
@@ -136,22 +139,22 @@ function stampAndPropagateSession(span, sessionId, baseContext = _api.context.ac
|
|
|
136
139
|
}
|
|
137
140
|
if (span.isRecording()) {
|
|
138
141
|
try {
|
|
139
|
-
span.setAttribute(`${
|
|
142
|
+
span.setAttribute(`${_chunkOZCOXBB7cjs.BRIZZ}.${_chunkOZCOXBB7cjs.SESSION_ID}`, sessionId);
|
|
140
143
|
} catch (error) {
|
|
141
|
-
|
|
144
|
+
_chunkWC573FCIcjs.logger.warn(
|
|
142
145
|
`Brizz MCP: failed to stamp session id on span: ${String(error)}`
|
|
143
146
|
);
|
|
144
147
|
}
|
|
145
148
|
}
|
|
146
149
|
try {
|
|
147
|
-
const prev = baseContext.getValue(
|
|
148
|
-
const merged = prev ? { ...prev, [
|
|
150
|
+
const prev = baseContext.getValue(_chunkOZCOXBB7cjs.PROPERTIES_CONTEXT_KEY);
|
|
151
|
+
const merged = prev ? { ...prev, [_chunkOZCOXBB7cjs.SESSION_ID]: sessionId } : { [_chunkOZCOXBB7cjs.SESSION_ID]: sessionId };
|
|
149
152
|
return {
|
|
150
|
-
context: baseContext.setValue(
|
|
153
|
+
context: baseContext.setValue(_chunkOZCOXBB7cjs.PROPERTIES_CONTEXT_KEY, merged),
|
|
151
154
|
sessionId
|
|
152
155
|
};
|
|
153
156
|
} catch (error) {
|
|
154
|
-
|
|
157
|
+
_chunkWC573FCIcjs.logger.warn(`Brizz MCP: failed to attach session context: ${String(error)}`);
|
|
155
158
|
return { context: baseContext, sessionId };
|
|
156
159
|
}
|
|
157
160
|
}
|
|
@@ -353,7 +356,7 @@ function patchProtocolPrototype(prototype, tracer) {
|
|
|
353
356
|
}
|
|
354
357
|
const proto = prototype;
|
|
355
358
|
if (Object.hasOwn(proto, PATCHED_FLAG)) {
|
|
356
|
-
|
|
359
|
+
_chunkWC573FCIcjs.logger.debug("Brizz MCP: Protocol.prototype already patched, skipping");
|
|
357
360
|
return false;
|
|
358
361
|
}
|
|
359
362
|
const originalRequest = proto["request"];
|
|
@@ -361,7 +364,7 @@ function patchProtocolPrototype(prototype, tracer) {
|
|
|
361
364
|
if (typeof originalRequest === "function") {
|
|
362
365
|
proto["request"] = wrapRequest(originalRequest, tracer);
|
|
363
366
|
} else {
|
|
364
|
-
|
|
367
|
+
_chunkWC573FCIcjs.logger.debug(
|
|
365
368
|
"Brizz MCP: Protocol.prototype.request missing \u2014 skipping CLIENT patch"
|
|
366
369
|
);
|
|
367
370
|
}
|
|
@@ -371,7 +374,7 @@ function patchProtocolPrototype(prototype, tracer) {
|
|
|
371
374
|
tracer
|
|
372
375
|
);
|
|
373
376
|
} else {
|
|
374
|
-
|
|
377
|
+
_chunkWC573FCIcjs.logger.debug(
|
|
375
378
|
"Brizz MCP: Protocol.prototype._onrequest missing \u2014 skipping SERVER patch"
|
|
376
379
|
);
|
|
377
380
|
}
|
|
@@ -423,7 +426,7 @@ function wrapOnRequest(original, tracer) {
|
|
|
423
426
|
try {
|
|
424
427
|
emitSchemaSpansFromListResponse(result, transportSessionId, tracer);
|
|
425
428
|
} catch (error) {
|
|
426
|
-
|
|
429
|
+
_chunkWC573FCIcjs.logger.warn(
|
|
427
430
|
`Brizz MCP: failed to emit tools/list schema spans: ${String(error)}`
|
|
428
431
|
);
|
|
429
432
|
}
|
|
@@ -501,7 +504,7 @@ function safeStartClientSpan(tracer, request, protocol) {
|
|
|
501
504
|
);
|
|
502
505
|
return span;
|
|
503
506
|
} catch (error) {
|
|
504
|
-
|
|
507
|
+
_chunkWC573FCIcjs.logger.debug(`Brizz MCP: failed to open CLIENT span: ${String(error)}`);
|
|
505
508
|
return null;
|
|
506
509
|
}
|
|
507
510
|
}
|
|
@@ -519,7 +522,7 @@ function safeStartServerSpan(tracer, request, protocol) {
|
|
|
519
522
|
const { context: sessCtx } = stampAndPropagateSession(span, sessionId, parentCtx);
|
|
520
523
|
return { span, spanCtx: _api.trace.setSpan(sessCtx, span) };
|
|
521
524
|
} catch (error) {
|
|
522
|
-
|
|
525
|
+
_chunkWC573FCIcjs.logger.debug(`Brizz MCP: failed to open SERVER span: ${String(error)}`);
|
|
523
526
|
return null;
|
|
524
527
|
}
|
|
525
528
|
}
|
|
@@ -530,7 +533,7 @@ function extractParentContext(request) {
|
|
|
530
533
|
return _api.propagation.extract(_api.context.active(), meta);
|
|
531
534
|
}
|
|
532
535
|
} catch (error) {
|
|
533
|
-
|
|
536
|
+
_chunkWC573FCIcjs.logger.debug(
|
|
534
537
|
`Brizz MCP: failed to extract parent context from _meta: ${String(error)}`
|
|
535
538
|
);
|
|
536
539
|
}
|
|
@@ -543,7 +546,7 @@ function safeApplyResultAttributes(span, method, value) {
|
|
|
543
546
|
try {
|
|
544
547
|
applyResultAttributes(span, method, value);
|
|
545
548
|
} catch (error) {
|
|
546
|
-
|
|
549
|
+
_chunkWC573FCIcjs.logger.debug(
|
|
547
550
|
`Brizz MCP: failed to apply result attributes: ${String(error)}`
|
|
548
551
|
);
|
|
549
552
|
}
|
|
@@ -552,7 +555,7 @@ function safeApplyErrorAttributes(span, err) {
|
|
|
552
555
|
try {
|
|
553
556
|
applyErrorAttributes(span, err);
|
|
554
557
|
} catch (error) {
|
|
555
|
-
|
|
558
|
+
_chunkWC573FCIcjs.logger.debug(
|
|
556
559
|
`Brizz MCP: failed to apply error attributes: ${String(error)}`
|
|
557
560
|
);
|
|
558
561
|
}
|
|
@@ -561,13 +564,13 @@ function safeEnd(span) {
|
|
|
561
564
|
try {
|
|
562
565
|
span.end();
|
|
563
566
|
} catch (error) {
|
|
564
|
-
|
|
567
|
+
_chunkWC573FCIcjs.logger.debug(`Brizz MCP: failed to end span: ${String(error)}`);
|
|
565
568
|
}
|
|
566
569
|
}
|
|
567
570
|
|
|
568
571
|
// src/internal/instrumentation/mcp/version.ts
|
|
569
572
|
var INSTRUMENTATION_NAME = "@brizz/sdk/mcp";
|
|
570
|
-
var INSTRUMENTATION_VERSION =
|
|
573
|
+
var INSTRUMENTATION_VERSION = _chunkSCYD7XCIcjs.getSDKVersion.call(void 0, );
|
|
571
574
|
|
|
572
575
|
// src/internal/instrumentation/mcp/instrumentation.ts
|
|
573
576
|
var PROTOCOL_MODULE_NAME = "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
@@ -597,14 +600,14 @@ var MCPInstrumentation = class extends _openinferenceinstrumentationmcp.MCPInstr
|
|
|
597
600
|
patchProtocolModule(module) {
|
|
598
601
|
const proto = _optionalChain([module, 'optionalAccess', _26 => _26.Protocol, 'optionalAccess', _27 => _27.prototype]);
|
|
599
602
|
if (!proto) {
|
|
600
|
-
|
|
603
|
+
_chunkWC573FCIcjs.logger.debug(
|
|
601
604
|
"Brizz MCP: module does not expose Protocol.prototype \u2014 skipping protocol patches"
|
|
602
605
|
);
|
|
603
606
|
return;
|
|
604
607
|
}
|
|
605
608
|
const ok = patchProtocolPrototype(proto, this.brizzTracer);
|
|
606
609
|
if (ok) {
|
|
607
|
-
|
|
610
|
+
_chunkWC573FCIcjs.logger.debug("Brizz MCP: patched Protocol.prototype for SERVER+CLIENT spans");
|
|
608
611
|
}
|
|
609
612
|
}
|
|
610
613
|
/**
|
|
@@ -617,7 +620,7 @@ var MCPInstrumentation = class extends _openinferenceinstrumentationmcp.MCPInstr
|
|
|
617
620
|
* at runtime, and a process reload is the canonical way to detach.
|
|
618
621
|
*/
|
|
619
622
|
unpatchProtocolModule(_module) {
|
|
620
|
-
|
|
623
|
+
_chunkWC573FCIcjs.logger.debug(
|
|
621
624
|
"Brizz MCP: unpatch is a no-op \u2014 reload the process to cleanly detach"
|
|
622
625
|
);
|
|
623
626
|
}
|
|
@@ -640,7 +643,7 @@ var MCPInstrumentation = class extends _openinferenceinstrumentationmcp.MCPInstr
|
|
|
640
643
|
try {
|
|
641
644
|
base = _nullishCoalesce(super.init(), () => ( []));
|
|
642
645
|
} catch (error) {
|
|
643
|
-
|
|
646
|
+
_chunkWC573FCIcjs.logger.warn(
|
|
644
647
|
`Brizz MCP: base Arize init() failed \u2014 transport context propagation disabled: ${String(error)}`
|
|
645
648
|
);
|
|
646
649
|
base = [];
|
|
@@ -690,13 +693,13 @@ var MCPInstrumentation = class extends _openinferenceinstrumentationmcp.MCPInstr
|
|
|
690
693
|
serverStreamableHTTPModule
|
|
691
694
|
});
|
|
692
695
|
} catch (error) {
|
|
693
|
-
|
|
696
|
+
_chunkWC573FCIcjs.logger.warn(`Brizz MCP: Arize manuallyInstrument(...) failed: ${String(error)}`);
|
|
694
697
|
}
|
|
695
698
|
if (protocolModule) {
|
|
696
699
|
try {
|
|
697
700
|
this.patchProtocolModule(protocolModule);
|
|
698
701
|
} catch (error) {
|
|
699
|
-
|
|
702
|
+
_chunkWC573FCIcjs.logger.warn(
|
|
700
703
|
`Brizz MCP: failed to manually patch Protocol module: ${String(error)}`
|
|
701
704
|
);
|
|
702
705
|
}
|
package/dist/preload.cjs
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkIH7TSRRTcjs = require('./chunk-IH7TSRRT.cjs');
|
|
5
|
+
require('./chunk-UNLNNKZ7.cjs');
|
|
6
|
+
require('./chunk-SCYD7XCI.cjs');
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
10
|
+
var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
|
|
11
|
+
require('./chunk-A3OOY5A2.cjs');
|
|
12
|
+
require('./chunk-OZCOXBB7.cjs');
|
|
13
|
+
require('./chunk-OBGZSXTJ.cjs');
|
|
11
14
|
|
|
12
15
|
// src/node/loader.ts
|
|
13
16
|
var _module = require('module'); var _module2 = _interopRequireDefault(_module);
|
|
@@ -93,16 +96,16 @@ if (globalThis[LOADER_REGISTERED_KEY] !== true) {
|
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
// src/preload.ts
|
|
96
|
-
var runtime =
|
|
99
|
+
var runtime = _chunkIH7TSRRTcjs.detectRuntime.call(void 0, );
|
|
97
100
|
if (runtime.isESM && runtime.supportsLoaderAPI) {
|
|
98
101
|
maybeRegisterESMLoader();
|
|
99
102
|
}
|
|
100
103
|
try {
|
|
101
|
-
const logLevel = process.env["BRIZZ_LOG_LEVEL"] ||
|
|
104
|
+
const logLevel = process.env["BRIZZ_LOG_LEVEL"] || _chunkWC573FCIcjs.DEFAULT_LOG_LEVEL.toString();
|
|
102
105
|
if (process.env["BRIZZ_DSN"]) {
|
|
103
|
-
|
|
106
|
+
_chunkIH7TSRRTcjs.Brizz.initialize({ logLevel, disableNodeSdk: false });
|
|
104
107
|
} else {
|
|
105
|
-
|
|
108
|
+
_chunkIH7TSRRTcjs.Brizz.initialize({
|
|
106
109
|
apiKey: process.env["BRIZZ_API_KEY"],
|
|
107
110
|
baseUrl: process.env["BRIZZ_BASE_URL"],
|
|
108
111
|
appName: process.env["BRIZZ_APP_NAME"] || process.env["OTEL_SERVICE_NAME"],
|
|
@@ -110,7 +113,7 @@ try {
|
|
|
110
113
|
disableNodeSdk: false
|
|
111
114
|
});
|
|
112
115
|
}
|
|
113
|
-
|
|
116
|
+
_chunkWC573FCIcjs.logger.info(`SDK auto-initialized for ${runtime.isESM ? "ESM" : "CJS"} runtime`);
|
|
114
117
|
} catch (error) {
|
|
115
|
-
|
|
118
|
+
_chunkWC573FCIcjs.logger.warn("Failed to auto-initialize SDK:", { error });
|
|
116
119
|
}
|
package/dist/preload.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Brizz,
|
|
3
3
|
detectRuntime
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-U474AL6K.js";
|
|
5
|
+
import "./chunk-7SUF4VVI.js";
|
|
6
|
+
import "./chunk-6M3CBP2N.js";
|
|
5
7
|
import {
|
|
6
8
|
DEFAULT_LOG_LEVEL,
|
|
7
9
|
logger
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-Y4HNUX3Q.js";
|
|
11
|
+
import "./chunk-LTLONC6I.js";
|
|
12
|
+
import "./chunk-VGMJ3KUM.js";
|
|
13
|
+
import "./chunk-3RG5ZIWI.js";
|
|
11
14
|
|
|
12
15
|
// src/node/loader.ts
|
|
13
16
|
import module from "module";
|