@brizz/sdk 0.1.45 → 0.1.46
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 +8 -2
- package/dist/{chunk-BAQTZKGI.js → chunk-USYGGHMA.js} +7 -7
- package/dist/{chunk-CBEDIRVK.cjs → chunk-VFWTFL7E.cjs} +6 -6
- package/dist/index.cjs +364 -59
- package/dist/index.js +343 -38
- package/dist/{mcp-CCFYA5CI.cjs → mcp-M3WRCR7G.cjs} +11 -11
- package/dist/{mcp-FTYCIWL4.js → mcp-YHBVF7QU.js} +1 -1
- package/dist/types/cjs/internal/instrumentation/langgraph/attributes.d.ts +38 -0
- package/dist/types/cjs/internal/instrumentation/langgraph/index.d.ts +1 -0
- package/dist/types/cjs/internal/instrumentation/langgraph/instrumentation.d.ts +11 -0
- package/dist/types/cjs/internal/instrumentation/registry.d.ts +1 -0
- package/dist/types/esm/internal/instrumentation/langgraph/attributes.d.ts +38 -0
- package/dist/types/esm/internal/instrumentation/langgraph/index.d.ts +1 -0
- package/dist/types/esm/internal/instrumentation/langgraph/instrumentation.d.ts +11 -0
- package/dist/types/esm/internal/instrumentation/registry.d.ts +1 -0
- package/package.json +9 -3
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkVFWTFL7Ecjs = require('./chunk-VFWTFL7E.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
var _chunkWC573FCIcjs = require('./chunk-WC573FCI.cjs');
|
|
@@ -387,14 +387,14 @@ function wrapOnRequest(original, tracer) {
|
|
|
387
387
|
return original.apply(this, args);
|
|
388
388
|
}
|
|
389
389
|
const method = request.method;
|
|
390
|
-
if (method === METHOD_TOOLS_CALL &&
|
|
390
|
+
if (method === METHOD_TOOLS_CALL && _chunkVFWTFL7Ecjs.isSessionToolCall.call(void 0, request)) {
|
|
391
391
|
return answerSessionToolCall(this, request, tracer, args, original);
|
|
392
392
|
}
|
|
393
393
|
const handler = _nullishCoalesce(handlers.get(method), () => ( this.fallbackRequestHandler));
|
|
394
394
|
if (!handler) {
|
|
395
395
|
return original.apply(this, args);
|
|
396
396
|
}
|
|
397
|
-
const tracking =
|
|
397
|
+
const tracking = _chunkVFWTFL7Ecjs.isEnabled.call(void 0, ) && method === METHOD_TOOLS_CALL ? _chunkVFWTFL7Ecjs.popTrackingArguments.call(void 0, request) : {};
|
|
398
398
|
const started = safeStartServerSpan(tracer, request, this, tracking);
|
|
399
399
|
if (!started) {
|
|
400
400
|
return original.apply(this, args);
|
|
@@ -404,9 +404,9 @@ function wrapOnRequest(original, tracer) {
|
|
|
404
404
|
if (method === METHOD_TOOLS_LIST) {
|
|
405
405
|
hooks.onResult = (result) => {
|
|
406
406
|
let advertised = result;
|
|
407
|
-
if (
|
|
407
|
+
if (_chunkVFWTFL7Ecjs.isEnabled.call(void 0, )) {
|
|
408
408
|
try {
|
|
409
|
-
advertised =
|
|
409
|
+
advertised = _chunkVFWTFL7Ecjs.patchListToolsResult.call(void 0, result);
|
|
410
410
|
} catch (error) {
|
|
411
411
|
_chunkWC573FCIcjs.logger.warn(
|
|
412
412
|
`Brizz MCP: failed to patch tools/list schemas: ${String(error)}`
|
|
@@ -417,7 +417,7 @@ function wrapOnRequest(original, tracer) {
|
|
|
417
417
|
try {
|
|
418
418
|
emitSchemaSpansFromListResponse(
|
|
419
419
|
advertised,
|
|
420
|
-
|
|
420
|
+
_chunkVFWTFL7Ecjs.resolveTransportSessionId.call(void 0, this),
|
|
421
421
|
tracer
|
|
422
422
|
);
|
|
423
423
|
} catch (error) {
|
|
@@ -430,7 +430,7 @@ function wrapOnRequest(original, tracer) {
|
|
|
430
430
|
}
|
|
431
431
|
if (method !== METHOD_TOOLS_CALL) {
|
|
432
432
|
hooks.onError = () => {
|
|
433
|
-
|
|
433
|
+
_chunkVFWTFL7Ecjs.stampAndPropagateSession.call(void 0, span, _chunkVFWTFL7Ecjs.resolveSessionId.call(void 0, this, spanCtx), spanCtx);
|
|
434
434
|
};
|
|
435
435
|
}
|
|
436
436
|
const wrappedHandler = (req, extra) => _api.context.with(
|
|
@@ -464,7 +464,7 @@ function answerSessionToolCall(protocol, request, tracer, args, original) {
|
|
|
464
464
|
if (!handlers) {
|
|
465
465
|
return original.apply(protocol, args);
|
|
466
466
|
}
|
|
467
|
-
const { id, result } =
|
|
467
|
+
const { id, result } = _chunkVFWTFL7Ecjs.sessionToolResult.call(void 0, );
|
|
468
468
|
const started = safeStartServerSpan(tracer, request, protocol, { sessionId: id });
|
|
469
469
|
const handler = () => started ? _api.context.with(started.spanCtx, () => result) : result;
|
|
470
470
|
const hadEntry = handlers.has(METHOD_TOOLS_CALL);
|
|
@@ -554,8 +554,8 @@ function safeStartServerSpan(tracer, request, protocol, tracking = {}) {
|
|
|
554
554
|
parentCtx
|
|
555
555
|
);
|
|
556
556
|
applyServerRequestAttributes(span, request, protocol);
|
|
557
|
-
const resolved = request.method === METHOD_TOOLS_CALL ? _nullishCoalesce(tracking.sessionId, () => (
|
|
558
|
-
const { context: sessCtx } =
|
|
557
|
+
const resolved = request.method === METHOD_TOOLS_CALL ? _nullishCoalesce(tracking.sessionId, () => ( _chunkVFWTFL7Ecjs.resolveSessionId.call(void 0, protocol, parentCtx))) : void 0;
|
|
558
|
+
const { context: sessCtx } = _chunkVFWTFL7Ecjs.stampAndPropagateSession.call(void 0,
|
|
559
559
|
span,
|
|
560
560
|
resolved,
|
|
561
561
|
parentCtx,
|
|
@@ -611,7 +611,7 @@ function safeEnd(span) {
|
|
|
611
611
|
|
|
612
612
|
// src/internal/instrumentation/mcp/version.ts
|
|
613
613
|
var INSTRUMENTATION_NAME = "@brizz/sdk/mcp";
|
|
614
|
-
var INSTRUMENTATION_VERSION =
|
|
614
|
+
var INSTRUMENTATION_VERSION = _chunkVFWTFL7Ecjs.getSDKVersion.call(void 0, );
|
|
615
615
|
|
|
616
616
|
// src/internal/instrumentation/mcp/instrumentation.ts
|
|
617
617
|
var PROTOCOL_MODULE_NAME = "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const INSTRUMENTATION_NAME = "@brizz/sdk/langgraph";
|
|
2
|
+
export declare const INSTRUMENTATION_VERSION: string;
|
|
3
|
+
export declare const MODULE_NAME = "@langchain/langgraph";
|
|
4
|
+
export declare const SUPPORTED_VERSIONS: string[];
|
|
5
|
+
export declare const CHECKPOINT_SPAN_NAME = "brizz.langgraph.checkpoint";
|
|
6
|
+
export declare const ATTR_CHECKPOINT_PARENT_ID = "brizz.checkpoint_parent_id";
|
|
7
|
+
export declare const ATTR_CHECKPOINT_ID = "brizz.checkpoint_id";
|
|
8
|
+
export declare const ATTR_CHECKPOINT_NS = "brizz.checkpoint_ns";
|
|
9
|
+
export declare const ATTR_CHECKPOINT_THREAD_ID = "brizz.checkpoint_thread_id";
|
|
10
|
+
export interface ICheckpointConfigurable {
|
|
11
|
+
thread_id?: unknown;
|
|
12
|
+
checkpoint_id?: unknown;
|
|
13
|
+
checkpoint_ns?: unknown;
|
|
14
|
+
__pregel_checkpointer?: unknown;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface IRunnableConfigLike {
|
|
18
|
+
configurable?: ICheckpointConfigurable;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface ICheckpointLike {
|
|
22
|
+
id?: unknown;
|
|
23
|
+
}
|
|
24
|
+
export type CheckpointPut = (config: IRunnableConfigLike | undefined, checkpoint: ICheckpointLike | undefined, ...rest: unknown[]) => unknown;
|
|
25
|
+
export type ICheckpointSaverLike = Record<string, unknown> & {
|
|
26
|
+
put?: CheckpointPut;
|
|
27
|
+
};
|
|
28
|
+
export interface IPregelLike {
|
|
29
|
+
checkpointer?: unknown;
|
|
30
|
+
stream(input: unknown, options?: IRunnableConfigLike): Promise<unknown>;
|
|
31
|
+
getState(config: IRunnableConfigLike): Promise<unknown>;
|
|
32
|
+
}
|
|
33
|
+
export declare function readCheckpointId(config: IRunnableConfigLike | undefined): string | undefined;
|
|
34
|
+
export declare function readCheckpointNs(config: IRunnableConfigLike | undefined): string | undefined;
|
|
35
|
+
export declare function readThreadId(config: IRunnableConfigLike | undefined): string | undefined;
|
|
36
|
+
export declare function readWrittenCheckpointId(checkpoint: ICheckpointLike | undefined): string | undefined;
|
|
37
|
+
export declare function resolveCheckpointer(graph: Pick<IPregelLike, 'checkpointer'>, config: IRunnableConfigLike | undefined): ICheckpointSaverLike | undefined;
|
|
38
|
+
export declare function resolvePregelPrototype(module: unknown): IPregelLike | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LangGraphInstrumentation } from './instrumentation.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Tracer } from '@opentelemetry/api';
|
|
2
|
+
import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
3
|
+
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
4
|
+
import type { IPregelLike } from './attributes.js';
|
|
5
|
+
export declare class LangGraphInstrumentation extends InstrumentationBase<InstrumentationConfig> {
|
|
6
|
+
constructor(config?: InstrumentationConfig);
|
|
7
|
+
protected init(): InstrumentationNodeModuleDefinition[];
|
|
8
|
+
manuallyInstrument(moduleExports: unknown): void;
|
|
9
|
+
private applyPatch;
|
|
10
|
+
}
|
|
11
|
+
export declare function patchPregelStream(proto: IPregelLike, getTracer: () => Tracer): boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const INSTRUMENTATION_NAME = "@brizz/sdk/langgraph";
|
|
2
|
+
export declare const INSTRUMENTATION_VERSION: string;
|
|
3
|
+
export declare const MODULE_NAME = "@langchain/langgraph";
|
|
4
|
+
export declare const SUPPORTED_VERSIONS: string[];
|
|
5
|
+
export declare const CHECKPOINT_SPAN_NAME = "brizz.langgraph.checkpoint";
|
|
6
|
+
export declare const ATTR_CHECKPOINT_PARENT_ID = "brizz.checkpoint_parent_id";
|
|
7
|
+
export declare const ATTR_CHECKPOINT_ID = "brizz.checkpoint_id";
|
|
8
|
+
export declare const ATTR_CHECKPOINT_NS = "brizz.checkpoint_ns";
|
|
9
|
+
export declare const ATTR_CHECKPOINT_THREAD_ID = "brizz.checkpoint_thread_id";
|
|
10
|
+
export interface ICheckpointConfigurable {
|
|
11
|
+
thread_id?: unknown;
|
|
12
|
+
checkpoint_id?: unknown;
|
|
13
|
+
checkpoint_ns?: unknown;
|
|
14
|
+
__pregel_checkpointer?: unknown;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
export interface IRunnableConfigLike {
|
|
18
|
+
configurable?: ICheckpointConfigurable;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface ICheckpointLike {
|
|
22
|
+
id?: unknown;
|
|
23
|
+
}
|
|
24
|
+
export type CheckpointPut = (config: IRunnableConfigLike | undefined, checkpoint: ICheckpointLike | undefined, ...rest: unknown[]) => unknown;
|
|
25
|
+
export type ICheckpointSaverLike = Record<string, unknown> & {
|
|
26
|
+
put?: CheckpointPut;
|
|
27
|
+
};
|
|
28
|
+
export interface IPregelLike {
|
|
29
|
+
checkpointer?: unknown;
|
|
30
|
+
stream(input: unknown, options?: IRunnableConfigLike): Promise<unknown>;
|
|
31
|
+
getState(config: IRunnableConfigLike): Promise<unknown>;
|
|
32
|
+
}
|
|
33
|
+
export declare function readCheckpointId(config: IRunnableConfigLike | undefined): string | undefined;
|
|
34
|
+
export declare function readCheckpointNs(config: IRunnableConfigLike | undefined): string | undefined;
|
|
35
|
+
export declare function readThreadId(config: IRunnableConfigLike | undefined): string | undefined;
|
|
36
|
+
export declare function readWrittenCheckpointId(checkpoint: ICheckpointLike | undefined): string | undefined;
|
|
37
|
+
export declare function resolveCheckpointer(graph: Pick<IPregelLike, 'checkpointer'>, config: IRunnableConfigLike | undefined): ICheckpointSaverLike | undefined;
|
|
38
|
+
export declare function resolvePregelPrototype(module: unknown): IPregelLike | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LangGraphInstrumentation } from './instrumentation.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Tracer } from '@opentelemetry/api';
|
|
2
|
+
import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
|
|
3
|
+
import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
|
|
4
|
+
import type { IPregelLike } from './attributes.js';
|
|
5
|
+
export declare class LangGraphInstrumentation extends InstrumentationBase<InstrumentationConfig> {
|
|
6
|
+
constructor(config?: InstrumentationConfig);
|
|
7
|
+
protected init(): InstrumentationNodeModuleDefinition[];
|
|
8
|
+
manuallyInstrument(moduleExports: unknown): void;
|
|
9
|
+
private applyPatch;
|
|
10
|
+
}
|
|
11
|
+
export declare function patchPregelStream(proto: IPregelLike, getTracer: () => Tracer): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brizz/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenTelemetry-based observability SDK for AI applications",
|
|
6
6
|
"keywords": [
|
|
@@ -19,10 +19,11 @@
|
|
|
19
19
|
"telemetry"
|
|
20
20
|
],
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
|
+
"homepage": "https://www.brizz.ai",
|
|
22
23
|
"author": {
|
|
23
24
|
"name": "Brizz",
|
|
24
25
|
"email": "contact@brizz.ai",
|
|
25
|
-
"url": "https://brizz.ai"
|
|
26
|
+
"url": "https://www.brizz.ai"
|
|
26
27
|
},
|
|
27
28
|
"main": "./dist/index.cjs",
|
|
28
29
|
"module": "./dist/index.js",
|
|
@@ -112,7 +113,8 @@
|
|
|
112
113
|
"@changesets/changelog-github": "^1.0.1",
|
|
113
114
|
"@changesets/cli": "^3.0.2",
|
|
114
115
|
"@google/genai": "^2.21.0",
|
|
115
|
-
"@langchain/core": "^1.
|
|
116
|
+
"@langchain/core": "^1.2.11",
|
|
117
|
+
"@langchain/langgraph": "^1.4.15",
|
|
116
118
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
117
119
|
"@traceloop/instrumentation-google-generativeai": "^0.27.0",
|
|
118
120
|
"@traceloop/instrumentation-vertexai": "^0.27.0",
|
|
@@ -134,6 +136,7 @@
|
|
|
134
136
|
"@ai-sdk/otel": "^1",
|
|
135
137
|
"@arizeai/openinference-instrumentation-mcp": "^0.2.19",
|
|
136
138
|
"@langchain/core": "^0.3.0 || ^1.0.0",
|
|
139
|
+
"@langchain/langgraph": "^0.2.0 || ^1.0.0",
|
|
137
140
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
138
141
|
"@traceloop/instrumentation-google-generativeai": "^0.27.0",
|
|
139
142
|
"@traceloop/instrumentation-vertexai": "^0.27.0",
|
|
@@ -150,6 +153,9 @@
|
|
|
150
153
|
"@langchain/core": {
|
|
151
154
|
"optional": true
|
|
152
155
|
},
|
|
156
|
+
"@langchain/langgraph": {
|
|
157
|
+
"optional": true
|
|
158
|
+
},
|
|
153
159
|
"@modelcontextprotocol/sdk": {
|
|
154
160
|
"optional": true
|
|
155
161
|
},
|