@brizz/sdk 0.1.42 → 0.1.43
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/chunk-5SWAZUC5.js +240 -0
- package/dist/chunk-WTQTF57J.cjs +240 -0
- package/dist/index.cjs +16 -6
- package/dist/index.js +13 -3
- package/dist/{mcp-5BFXKN63.js → mcp-6R6KZ5U3.js} +83 -86
- package/dist/{mcp-GVGTOWHP.cjs → mcp-UJD6KF7G.cjs} +97 -100
- package/dist/types/cjs/internal/instrumentation/mcp/client-session.d.ts +24 -0
- package/dist/types/cjs/internal/instrumentation/mcp/session.d.ts +3 -1
- package/dist/types/cjs/internal/sdk.d.ts +2 -0
- package/dist/types/esm/internal/instrumentation/mcp/client-session.d.ts +24 -0
- package/dist/types/esm/internal/instrumentation/mcp/session.d.ts +3 -1
- package/dist/types/esm/internal/sdk.d.ts +2 -0
- package/package.json +1 -1
- package/dist/chunk-K3NPYISB.cjs +0 -8
- package/dist/chunk-KVOGOKOB.js +0 -8
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const DEFAULT_SESSION_PARAM = "brizz_mcp_session_id";
|
|
2
|
+
export declare const DEFAULT_SESSION_TOOL_NAME = "brizz_start_session";
|
|
3
|
+
export declare const INTENT_PARAM = "brizz_intent";
|
|
4
|
+
export interface IMCPSessionTrackingConfig {
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
intent?: boolean;
|
|
7
|
+
sessionParamName?: string;
|
|
8
|
+
sessionToolName?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function configure(config: IMCPSessionTrackingConfig | boolean | undefined): void;
|
|
11
|
+
export declare function isEnabled(): boolean;
|
|
12
|
+
export declare function sessionParam(): string;
|
|
13
|
+
export declare function sessionToolNameValue(): string;
|
|
14
|
+
export interface ITrackingArguments {
|
|
15
|
+
sessionId?: string;
|
|
16
|
+
intent?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function isSessionToolCall(request: unknown): boolean;
|
|
19
|
+
export declare function sessionToolResult(): {
|
|
20
|
+
id: string;
|
|
21
|
+
result: unknown;
|
|
22
|
+
};
|
|
23
|
+
export declare function patchListToolsResult(result: unknown): unknown;
|
|
24
|
+
export declare function popTrackingArguments(request: unknown): ITrackingArguments;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Context, Span } from '@opentelemetry/api';
|
|
2
|
+
export declare const INTENT_PROPERTY = "internal.intent";
|
|
2
3
|
export interface ISessionAttachResult {
|
|
3
4
|
context: Context;
|
|
4
5
|
sessionId: string | null;
|
|
5
6
|
}
|
|
7
|
+
export declare function generateSessionId(): string;
|
|
6
8
|
export declare function resolveTransportSessionId(protocol: unknown): string | undefined;
|
|
7
9
|
export declare function resolveSessionId(protocol: unknown, baseContext: Context): string | undefined;
|
|
8
|
-
export declare function stampAndPropagateSession(span: Span, sessionId: string | null | undefined, baseContext?: Context): ISessionAttachResult;
|
|
10
|
+
export declare function stampAndPropagateSession(span: Span, sessionId: string | null | undefined, baseContext?: Context, intent?: string): ISessionAttachResult;
|
|
@@ -3,6 +3,7 @@ import type { LogRecordExporter } from '@opentelemetry/sdk-logs';
|
|
|
3
3
|
import type { MetricReader } from '@opentelemetry/sdk-metrics';
|
|
4
4
|
import type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
5
5
|
import { type IInstrumentModules } from './instrumentation/index.js';
|
|
6
|
+
import { type IMCPSessionTrackingConfig } from './instrumentation/mcp/client-session.js';
|
|
6
7
|
import type { LogLevel } from './logger.js';
|
|
7
8
|
import { type IMaskingConfig } from './masking/index.js';
|
|
8
9
|
export interface IBrizzInitializeOptions {
|
|
@@ -13,6 +14,7 @@ export interface IBrizzInitializeOptions {
|
|
|
13
14
|
dsn?: string;
|
|
14
15
|
headers?: Record<string, string>;
|
|
15
16
|
disableBatch?: boolean;
|
|
17
|
+
mcpSessionTracking?: IMCPSessionTrackingConfig | boolean;
|
|
16
18
|
environment?: string;
|
|
17
19
|
masking?: boolean | IMaskingConfig;
|
|
18
20
|
logLevel?: LogLevel | string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const DEFAULT_SESSION_PARAM = "brizz_mcp_session_id";
|
|
2
|
+
export declare const DEFAULT_SESSION_TOOL_NAME = "brizz_start_session";
|
|
3
|
+
export declare const INTENT_PARAM = "brizz_intent";
|
|
4
|
+
export interface IMCPSessionTrackingConfig {
|
|
5
|
+
enabled?: boolean;
|
|
6
|
+
intent?: boolean;
|
|
7
|
+
sessionParamName?: string;
|
|
8
|
+
sessionToolName?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function configure(config: IMCPSessionTrackingConfig | boolean | undefined): void;
|
|
11
|
+
export declare function isEnabled(): boolean;
|
|
12
|
+
export declare function sessionParam(): string;
|
|
13
|
+
export declare function sessionToolNameValue(): string;
|
|
14
|
+
export interface ITrackingArguments {
|
|
15
|
+
sessionId?: string;
|
|
16
|
+
intent?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function isSessionToolCall(request: unknown): boolean;
|
|
19
|
+
export declare function sessionToolResult(): {
|
|
20
|
+
id: string;
|
|
21
|
+
result: unknown;
|
|
22
|
+
};
|
|
23
|
+
export declare function patchListToolsResult(result: unknown): unknown;
|
|
24
|
+
export declare function popTrackingArguments(request: unknown): ITrackingArguments;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Context, Span } from '@opentelemetry/api';
|
|
2
|
+
export declare const INTENT_PROPERTY = "internal.intent";
|
|
2
3
|
export interface ISessionAttachResult {
|
|
3
4
|
context: Context;
|
|
4
5
|
sessionId: string | null;
|
|
5
6
|
}
|
|
7
|
+
export declare function generateSessionId(): string;
|
|
6
8
|
export declare function resolveTransportSessionId(protocol: unknown): string | undefined;
|
|
7
9
|
export declare function resolveSessionId(protocol: unknown, baseContext: Context): string | undefined;
|
|
8
|
-
export declare function stampAndPropagateSession(span: Span, sessionId: string | null | undefined, baseContext?: Context): ISessionAttachResult;
|
|
10
|
+
export declare function stampAndPropagateSession(span: Span, sessionId: string | null | undefined, baseContext?: Context, intent?: string): ISessionAttachResult;
|
|
@@ -3,6 +3,7 @@ import type { LogRecordExporter } from '@opentelemetry/sdk-logs';
|
|
|
3
3
|
import type { MetricReader } from '@opentelemetry/sdk-metrics';
|
|
4
4
|
import type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
5
5
|
import { type IInstrumentModules } from './instrumentation/index.js';
|
|
6
|
+
import { type IMCPSessionTrackingConfig } from './instrumentation/mcp/client-session.js';
|
|
6
7
|
import type { LogLevel } from './logger.js';
|
|
7
8
|
import { type IMaskingConfig } from './masking/index.js';
|
|
8
9
|
export interface IBrizzInitializeOptions {
|
|
@@ -13,6 +14,7 @@ export interface IBrizzInitializeOptions {
|
|
|
13
14
|
dsn?: string;
|
|
14
15
|
headers?: Record<string, string>;
|
|
15
16
|
disableBatch?: boolean;
|
|
17
|
+
mcpSessionTracking?: IMCPSessionTrackingConfig | boolean;
|
|
16
18
|
environment?: string;
|
|
17
19
|
masking?: boolean | IMaskingConfig;
|
|
18
20
|
logLevel?: LogLevel | string;
|
package/package.json
CHANGED
package/dist/chunk-K3NPYISB.cjs
DELETED