@brizz/sdk 0.1.58 → 0.2.0

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.
Files changed (35) hide show
  1. package/README.md +41 -3
  2. package/dist/{chunk-XGD5HD5W.cjs → chunk-4QNEI7VZ.cjs} +119 -119
  3. package/dist/{chunk-LXRU77IM.js → chunk-5HCG3JKU.js} +2 -2
  4. package/dist/{chunk-O2IBZJOJ.cjs → chunk-6QXPHZEO.cjs} +4 -4
  5. package/dist/{chunk-JGATEWJB.cjs → chunk-CNVK5RA3.cjs} +8 -8
  6. package/dist/{chunk-MXKQQ6AU.js → chunk-EZCNPWKM.js} +1 -1
  7. package/dist/{chunk-7PRTTYWM.js → chunk-GABRGNAU.js} +1 -1
  8. package/dist/{chunk-GUKWVI53.js → chunk-GISL4K6Z.js} +27 -1
  9. package/dist/{chunk-RV7JIIDG.cjs → chunk-NF52RMLW.cjs} +27 -1
  10. package/dist/index.cjs +284 -106
  11. package/dist/index.js +214 -36
  12. package/dist/interrupt-36U5562Z.cjs +12 -0
  13. package/dist/{interrupt-UKJK5WOA.js → interrupt-6BSXUK3O.js} +2 -2
  14. package/dist/{mcp-YNOK6OX5.cjs → mcp-5ERVMLSA.cjs} +19 -18
  15. package/dist/{mcp-2JWY4GGY.js → mcp-EJAJTGIC.js} +4 -3
  16. package/dist/session.cjs +3 -3
  17. package/dist/session.js +2 -2
  18. package/dist/types/cjs/index.d.ts +2 -2
  19. package/dist/types/cjs/internal/error-type.d.ts +1 -0
  20. package/dist/types/cjs/internal/instrumentation/mcp/semantic-conventions.d.ts +1 -1
  21. package/dist/types/cjs/internal/instrumentation/typesafe.d.ts +0 -8
  22. package/dist/types/cjs/internal/semantic-conventions.d.ts +13 -0
  23. package/dist/types/cjs/internal/serialization.d.ts +2 -0
  24. package/dist/types/cjs/internal/trace/decision-call.d.ts +24 -0
  25. package/dist/types/cjs/internal/trace/index.d.ts +2 -0
  26. package/dist/types/esm/index.d.ts +2 -2
  27. package/dist/types/esm/internal/error-type.d.ts +1 -0
  28. package/dist/types/esm/internal/instrumentation/mcp/semantic-conventions.d.ts +1 -1
  29. package/dist/types/esm/internal/instrumentation/typesafe.d.ts +0 -8
  30. package/dist/types/esm/internal/semantic-conventions.d.ts +13 -0
  31. package/dist/types/esm/internal/serialization.d.ts +2 -0
  32. package/dist/types/esm/internal/trace/decision-call.d.ts +24 -0
  33. package/dist/types/esm/internal/trace/index.d.ts +2 -0
  34. package/package.json +26 -26
  35. package/dist/interrupt-BYLSBXTV.cjs +0 -12
@@ -0,0 +1,2 @@
1
+ export declare function toJson(value: unknown): string | undefined;
2
+ export declare function text(value: unknown): string;
@@ -0,0 +1,24 @@
1
+ export interface IDecisionCallOptions {
2
+ provider: string;
3
+ model: string;
4
+ state: unknown;
5
+ questions: unknown;
6
+ requestModel?: string;
7
+ }
8
+ export interface IDecisionCallUsage {
9
+ inputTokens?: number;
10
+ outputTokens?: number;
11
+ }
12
+ export interface IDecisionCall {
13
+ setAnswers(answers: unknown): void;
14
+ setUsage(usage: IDecisionCallUsage): void;
15
+ setCost(costUsd: number): void;
16
+ }
17
+ export interface IDecisionCallRecord extends IDecisionCallOptions, IDecisionCallUsage {
18
+ answers?: unknown;
19
+ costUsd?: number;
20
+ startTime?: Date;
21
+ endTime?: Date;
22
+ }
23
+ export declare function decisionCall<T>(options: IDecisionCallOptions, callback: (call: IDecisionCall) => T): T;
24
+ export declare function recordDecisionCall(record: IDecisionCallRecord): void;
@@ -5,3 +5,5 @@ export { withSessionId, callWithSessionId, withProperties, callWithProperties, w
5
5
  export type { IMuteOptions } from './session.js';
6
6
  export { startAgent, withAgent, setAgent } from './agent.js';
7
7
  export type { AgentRef, IAgent, IAgentOptions } from './agent.js';
8
+ export { decisionCall, recordDecisionCall } from './decision-call.js';
9
+ export type { IDecisionCall, IDecisionCallOptions, IDecisionCallRecord, IDecisionCallUsage, } from './decision-call.js';
@@ -2,8 +2,8 @@ import './internal/instrumentation/auto-init.js';
2
2
  export { Brizz, type IBrizzInitializeOptions } from './internal/sdk.js';
3
3
  export { type IInstrumentModules, type IMCPManualModules, } from './internal/instrumentation/index.js';
4
4
  export { emitEvent, emitEventWithSessionId } from './internal/log/index.js';
5
- export { getSpanExporter, getSpanProcessor, getTracerProvider, withSessionId, callWithSessionId, withProperties, callWithProperties, withMute, callWithMute, setCurrentSpanCustomProperties, setUser, setOrganization, setMessageId, setSessionId, setServiceName, withServiceName, callWithServiceName, withUser, callWithUser, withOrganization, callWithOrganization, withMessageId, callWithMessageId, Session, SessionTitle, startAgent, withAgent, setAgent, startSession, startSessionTitle, getActiveSession, addExternalLink, recordFeedback, recordMetric, } from './internal/trace/index.js';
6
- export type { IMuteOptions, AgentRef, IAgent, IAgentOptions } from './internal/trace/index.js';
5
+ export { getSpanExporter, getSpanProcessor, getTracerProvider, withSessionId, callWithSessionId, withProperties, callWithProperties, withMute, callWithMute, setCurrentSpanCustomProperties, setUser, setOrganization, setMessageId, setSessionId, setServiceName, withServiceName, callWithServiceName, withUser, callWithUser, withOrganization, callWithOrganization, withMessageId, callWithMessageId, Session, SessionTitle, startAgent, withAgent, setAgent, startSession, startSessionTitle, getActiveSession, addExternalLink, recordFeedback, recordMetric, decisionCall, recordDecisionCall, } from './internal/trace/index.js';
6
+ export type { IMuteOptions, AgentRef, IAgent, IAgentOptions, IDecisionCall, IDecisionCallOptions, IDecisionCallRecord, IDecisionCallUsage, } from './internal/trace/index.js';
7
7
  export { getMetricsExporter, getMetricsReader } from './internal/metric/index.js';
8
8
  export type { IMaskingConfig, ISpanMaskingConfig, ILogMaskingConfig, IEventMaskingConfig, IEventMaskingRule, MaskingMode, IAttributesMaskingRule, } from './internal/masking/index.js';
9
9
  export { DEFAULT_PII_PATTERNS } from './internal/masking/patterns.js';
@@ -0,0 +1 @@
1
+ export declare function errorType(error: unknown): string;
@@ -22,7 +22,7 @@ export declare const GEN_AI_PROMPT_NAME = "gen_ai.prompt.name";
22
22
  export declare const GEN_AI_OPERATION_NAME = "gen_ai.operation.name";
23
23
  export declare const GEN_AI_OPERATION_EXECUTE_TOOL = "execute_tool";
24
24
  export declare const NETWORK_TRANSPORT = "network.transport";
25
- export declare const ERROR_TYPE = "error.type";
25
+ export { ERROR_TYPE } from '../../semantic-conventions.js';
26
26
  export declare const ERROR_TYPE_TOOL = "tool_error";
27
27
  export declare const ERROR_TYPE_TIMEOUT = "timeout";
28
28
  export declare const ERROR_TYPE_CANCELLED = "cancelled";
@@ -4,14 +4,6 @@ import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opent
4
4
  export declare const INSTRUMENTATION_NAME = "@brizz/sdk/typesafe";
5
5
  export declare const SPAN_NAME = "typesafe.system_one";
6
6
  export declare const PROVIDER_NAME = "typesafe";
7
- export declare const OPERATION_NAME = "classify";
8
- export declare const ATTR_OPERATION_NAME = "gen_ai.operation.name";
9
- export declare const ATTR_PROVIDER_NAME = "gen_ai.provider.name";
10
- export declare const ATTR_REQUEST_MODEL = "gen_ai.request.model";
11
- export declare const ATTR_RESPONSE_MODEL = "gen_ai.response.model";
12
- export declare const ATTR_INPUT_TOKENS = "gen_ai.usage.input_tokens";
13
- export declare const ATTR_OUTPUT_TOKENS = "gen_ai.usage.output_tokens";
14
- export declare const ATTR_INPUT_MESSAGES = "gen_ai.input.messages";
15
7
  export declare const ATTR_QUESTIONS = "typesafe.questions";
16
8
  export declare const ATTR_ANSWERS = "typesafe.answers";
17
9
  interface ISystemOneRequestLike {
@@ -61,3 +61,16 @@ export declare const METRIC_POLARITY_POSITIVE = "positive";
61
61
  export declare const METRIC_POLARITY_NEGATIVE = "negative";
62
62
  export declare const METRIC_SCOPE_SESSION = "session";
63
63
  export declare const METRIC_SCOPE_TRACE = "trace";
64
+ export declare const GEN_AI_OPERATION_NAME = "gen_ai.operation.name";
65
+ export declare const GEN_AI_OPERATION_CLASSIFY = "classify";
66
+ export declare const GEN_AI_PROVIDER_NAME = "gen_ai.provider.name";
67
+ export declare const GEN_AI_REQUEST_MODEL = "gen_ai.request.model";
68
+ export declare const GEN_AI_RESPONSE_MODEL = "gen_ai.response.model";
69
+ export declare const GEN_AI_USAGE_INPUT_TOKENS = "gen_ai.usage.input_tokens";
70
+ export declare const GEN_AI_USAGE_OUTPUT_TOKENS = "gen_ai.usage.output_tokens";
71
+ export declare const GEN_AI_INPUT_MESSAGES = "gen_ai.input.messages";
72
+ export declare const GEN_AI_OUTPUT_MESSAGES = "gen_ai.output.messages";
73
+ export declare const GEN_AI_OUTPUT_TYPE = "gen_ai.output.type";
74
+ export declare const GEN_AI_CONVERSATION_ID = "gen_ai.conversation.id";
75
+ export declare const GEN_AI_USAGE_COST_USD = "gen_ai.usage.cost_usd";
76
+ export declare const ERROR_TYPE = "error.type";
@@ -0,0 +1,2 @@
1
+ export declare function toJson(value: unknown): string | undefined;
2
+ export declare function text(value: unknown): string;
@@ -0,0 +1,24 @@
1
+ export interface IDecisionCallOptions {
2
+ provider: string;
3
+ model: string;
4
+ state: unknown;
5
+ questions: unknown;
6
+ requestModel?: string;
7
+ }
8
+ export interface IDecisionCallUsage {
9
+ inputTokens?: number;
10
+ outputTokens?: number;
11
+ }
12
+ export interface IDecisionCall {
13
+ setAnswers(answers: unknown): void;
14
+ setUsage(usage: IDecisionCallUsage): void;
15
+ setCost(costUsd: number): void;
16
+ }
17
+ export interface IDecisionCallRecord extends IDecisionCallOptions, IDecisionCallUsage {
18
+ answers?: unknown;
19
+ costUsd?: number;
20
+ startTime?: Date;
21
+ endTime?: Date;
22
+ }
23
+ export declare function decisionCall<T>(options: IDecisionCallOptions, callback: (call: IDecisionCall) => T): T;
24
+ export declare function recordDecisionCall(record: IDecisionCallRecord): void;
@@ -5,3 +5,5 @@ export { withSessionId, callWithSessionId, withProperties, callWithProperties, w
5
5
  export type { IMuteOptions } from './session.js';
6
6
  export { startAgent, withAgent, setAgent } from './agent.js';
7
7
  export type { AgentRef, IAgent, IAgentOptions } from './agent.js';
8
+ export { decisionCall, recordDecisionCall } from './decision-call.js';
9
+ export type { IDecisionCall, IDecisionCallOptions, IDecisionCallRecord, IDecisionCallUsage, } from './decision-call.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brizz/sdk",
3
- "version": "0.1.58",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "OpenTelemetry-based observability SDK for AI applications",
6
6
  "keywords": [
@@ -115,36 +115,36 @@
115
115
  "registry": "https://registry.npmjs.org/"
116
116
  },
117
117
  "devDependencies": {
118
- "@ai-sdk/anthropic": "^4.0.91",
119
- "@ai-sdk/openai": "^4.0.104",
120
- "@ai-sdk/otel": "^1.0.156",
118
+ "@ai-sdk/anthropic": "^4.0.99",
119
+ "@ai-sdk/openai": "^4.0.111",
120
+ "@ai-sdk/otel": "^1.0.165",
121
121
  "@arethetypeswrong/cli": "^0.18.5",
122
122
  "@arizeai/openinference-instrumentation-mcp": "^0.2.37",
123
- "@babel/core": "^8.0.9",
123
+ "@babel/core": "^8.1.0",
124
124
  "@babel/preset-env": "^8.0.7",
125
125
  "@babel/preset-typescript": "^8.0.7",
126
126
  "@changesets/changelog-github": "^1.0.1",
127
127
  "@changesets/cli": "^3.0.3",
128
- "@google/genai": "^2.31.0",
129
- "@langchain/core": "^1.3.1",
130
- "@langchain/langgraph": "^1.5.3",
128
+ "@google/genai": "^2.32.0",
129
+ "@langchain/core": "^1.3.5",
130
+ "@langchain/langgraph": "^1.7.2",
131
131
  "@modelcontextprotocol/sdk": "^1.32.2",
132
132
  "@traceloop/instrumentation-google-generativeai": "^0.27.0",
133
133
  "@traceloop/instrumentation-vertexai": "^0.27.0",
134
134
  "@types/jest": "^30.0.0",
135
135
  "@types/node": "^26.6.6",
136
136
  "@typesafe-ai/sdk": "^0.7.0",
137
- "ai": "^7.0.156",
137
+ "ai": "^7.0.165",
138
138
  "babel-jest": "^30.5.2",
139
139
  "babel-plugin-transform-import-meta": "^3.1.0",
140
140
  "jest": "^30.5.2",
141
141
  "jest-environment-jsdom": "^30.5.2",
142
- "openai": "^7.45.1",
143
- "oxlint": "^1.90.0",
142
+ "openai": "^7.53.0",
143
+ "oxlint": "^1.92.0",
144
144
  "prettier": "^3.9.10",
145
145
  "tsup": "^9.0.0",
146
146
  "typescript": "^7.0.2",
147
- "vitest": "^5.0.5",
147
+ "vitest": "^5.1.0",
148
148
  "zod": "^4.6.7"
149
149
  },
150
150
  "peerDependencies": {
@@ -195,18 +195,18 @@
195
195
  "@arizeai/openinference-instrumentation-langchain": "^4.1.5",
196
196
  "@arizeai/openinference-instrumentation-openai": "^2.3.1",
197
197
  "@opentelemetry/api": "^1.10.0",
198
- "@opentelemetry/context-async-hooks": "^3.0.0",
199
- "@opentelemetry/core": "^3.0.0",
200
- "@opentelemetry/exporter-logs-otlp-http": "^0.300.0",
201
- "@opentelemetry/exporter-metrics-otlp-http": "^0.300.0",
202
- "@opentelemetry/exporter-trace-otlp-http": "^0.300.0",
203
- "@opentelemetry/exporter-trace-otlp-proto": "^0.300.0",
204
- "@opentelemetry/instrumentation": "^0.300.0",
205
- "@opentelemetry/resources": "^3.0.0",
206
- "@opentelemetry/sdk-logs": "^3.0.0",
207
- "@opentelemetry/sdk-metrics": "^3.0.0",
208
- "@opentelemetry/sdk-trace": "^3.0.0",
209
- "@opentelemetry/semantic-conventions": "^1.44.0",
198
+ "@opentelemetry/context-async-hooks": "^3.1.0",
199
+ "@opentelemetry/core": "^3.1.0",
200
+ "@opentelemetry/exporter-logs-otlp-http": "^0.301.0",
201
+ "@opentelemetry/exporter-metrics-otlp-http": "^0.301.0",
202
+ "@opentelemetry/exporter-trace-otlp-http": "^0.301.0",
203
+ "@opentelemetry/exporter-trace-otlp-proto": "^0.301.0",
204
+ "@opentelemetry/instrumentation": "^0.301.0",
205
+ "@opentelemetry/resources": "^3.1.0",
206
+ "@opentelemetry/sdk-logs": "^3.1.0",
207
+ "@opentelemetry/sdk-metrics": "^3.1.0",
208
+ "@opentelemetry/sdk-trace": "^3.1.0",
209
+ "@opentelemetry/semantic-conventions": "^1.45.0",
210
210
  "@traceloop/ai-semantic-conventions": "^0.27.0",
211
211
  "@traceloop/instrumentation-anthropic": "^0.27.0",
212
212
  "@traceloop/instrumentation-bedrock": "^0.27.0",
@@ -218,12 +218,12 @@
218
218
  "@traceloop/instrumentation-together": "^0.27.0",
219
219
  "pino": "^10.4.0",
220
220
  "pino-pretty": "^13.2.0",
221
- "tslib": "^2.8.1"
221
+ "tslib": "^2.9.1"
222
222
  },
223
223
  "packageManager": "pnpm@10.17.0+sha512.fce8a3dd29a4ed2ec566fb53efbb04d8c44a0f05bc6f24a73046910fb9c3ce7afa35a0980500668fa3573345bd644644fa98338fa168235c80f4aa17aa17fbef",
224
224
  "pnpm": {
225
225
  "overrides": {
226
- "@babel/core": "^8.0.9",
226
+ "@babel/core": "^8.1.0",
227
227
  "@opentelemetry/core@<2.12.0": "^2.12.0"
228
228
  },
229
229
  "updateConfig": {
@@ -1,12 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
- var _chunkO2IBZJOJcjs = require('./chunk-O2IBZJOJ.cjs');
6
- require('./chunk-RV7JIIDG.cjs');
7
- require('./chunk-OBGZSXTJ.cjs');
8
-
9
-
10
-
11
-
12
- exports.InterruptPropagator = _chunkO2IBZJOJcjs.InterruptPropagator; exports._resetInterruptState = _chunkO2IBZJOJcjs._resetInterruptState; exports.createInterruptIntegration = _chunkO2IBZJOJcjs.createInterruptIntegration;