braintrust 3.32.0 → 3.33.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 (60) hide show
  1. package/README.md +0 -43
  2. package/dev/dist/index.d.mts +31 -0
  3. package/dev/dist/index.d.ts +31 -0
  4. package/dev/dist/index.js +2275 -920
  5. package/dev/dist/index.mjs +1610 -255
  6. package/dist/apply-auto-instrumentation.js +263 -224
  7. package/dist/apply-auto-instrumentation.mjs +45 -6
  8. package/dist/auto-instrumentations/bundler/esbuild.cjs +78 -5
  9. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  10. package/dist/auto-instrumentations/bundler/next.cjs +78 -5
  11. package/dist/auto-instrumentations/bundler/next.mjs +3 -3
  12. package/dist/auto-instrumentations/bundler/rollup.cjs +78 -5
  13. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  14. package/dist/auto-instrumentations/bundler/vite.cjs +78 -5
  15. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  16. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +78 -5
  17. package/dist/auto-instrumentations/bundler/webpack.cjs +78 -5
  18. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
  19. package/dist/auto-instrumentations/{chunk-AFND2U7E.mjs → chunk-T2DMPWFI.mjs} +75 -5
  20. package/dist/auto-instrumentations/{chunk-RI4Y55ZF.mjs → chunk-UHJ2DNYJ.mjs} +6 -1
  21. package/dist/auto-instrumentations/{chunk-QEEPRBIS.mjs → chunk-W5QNG3PV.mjs} +1 -1
  22. package/dist/auto-instrumentations/hook.mjs +86 -7
  23. package/dist/auto-instrumentations/index.cjs +76 -5
  24. package/dist/auto-instrumentations/index.d.mts +3 -1
  25. package/dist/auto-instrumentations/index.d.ts +3 -1
  26. package/dist/auto-instrumentations/index.mjs +3 -1
  27. package/dist/browser.d.mts +202 -342
  28. package/dist/browser.d.ts +202 -342
  29. package/dist/browser.js +2586 -623
  30. package/dist/browser.mjs +2586 -623
  31. package/dist/chunk-7P6ASYW6.mjs +9 -0
  32. package/dist/{chunk-BTRLPQG5.js → chunk-AXJTOUOC.js} +2250 -1172
  33. package/dist/{chunk-AW4QECG5.js → chunk-G3VHOHRC.js} +40 -9
  34. package/dist/chunk-MLKGABMK.js +9 -0
  35. package/dist/{chunk-4QSAHP7D.mjs → chunk-MZLBAFVJ.mjs} +1236 -158
  36. package/dist/{chunk-WV6QZI2W.mjs → chunk-TZVZN2JJ.mjs} +39 -8
  37. package/dist/cli.js +1695 -293
  38. package/dist/custom-views.d.mts +112 -0
  39. package/dist/custom-views.d.ts +112 -0
  40. package/dist/custom-views.js +13 -0
  41. package/dist/custom-views.mjs +13 -0
  42. package/dist/edge-light.d.mts +1 -1
  43. package/dist/edge-light.d.ts +1 -1
  44. package/dist/edge-light.js +2586 -623
  45. package/dist/edge-light.mjs +2586 -623
  46. package/dist/index.d.mts +202 -342
  47. package/dist/index.d.ts +202 -342
  48. package/dist/index.js +1842 -986
  49. package/dist/index.mjs +1310 -454
  50. package/dist/instrumentation/index.d.mts +5 -245
  51. package/dist/instrumentation/index.d.ts +5 -245
  52. package/dist/instrumentation/index.js +1694 -254
  53. package/dist/instrumentation/index.mjs +1694 -254
  54. package/dist/vitest-evals-reporter.js +17 -16
  55. package/dist/vitest-evals-reporter.mjs +3 -2
  56. package/dist/workerd.d.mts +1 -1
  57. package/dist/workerd.d.ts +1 -1
  58. package/dist/workerd.js +2586 -623
  59. package/dist/workerd.mjs +2586 -623
  60. package/package.json +10 -2
@@ -1220,6 +1220,9 @@ var envIntegrationAliases = {
1220
1220
  "langchain-js": "langchain",
1221
1221
  "@langchain": "langchain",
1222
1222
  langgraph: "langgraph",
1223
+ langgraphsdk: "langgraphSDK",
1224
+ "langgraph-sdk": "langgraphSDK",
1225
+ "@langchain/langgraph-sdk": "langgraphSDK",
1223
1226
  langsmith: "langsmith",
1224
1227
  voyage: "voyageai",
1225
1228
  "voyage-ai": "voyageai",
@@ -1369,6 +1372,7 @@ var INSTRUMENTATION_NAMES = {
1369
1372
  LANGSMITH: "langsmith",
1370
1373
  MASTRA: "mastra",
1371
1374
  MISTRAL: "mistral",
1375
+ LANGGRAPH_SDK: "langgraph-sdk",
1372
1376
  OLLAMA: "ollama",
1373
1377
  OPENAI: "openai",
1374
1378
  OPENAI_AGENTS: "openai-agents",
@@ -1486,8 +1490,8 @@ var harnessAgentChannels = defineChannels(
1486
1490
  // src/auto-instrumentations/configs/ai-sdk.ts
1487
1491
  var aiSDKConfigs = [
1488
1492
  // HarnessAgent turn methods are published only from the package's ESM
1489
- // `./agent` entrypoint. The compiled class expression is anonymous, so match
1490
- // the first async method with each public name instead of a class name.
1493
+ // `./agent` entrypoint. Target the class binding so similarly named getters
1494
+ // on stream result classes are not mistaken for agent turn methods.
1491
1495
  ...[
1492
1496
  ["createSession", harnessAgentChannels.createSession.channelName],
1493
1497
  ["generate", harnessAgentChannels.generate.channelName],
@@ -1502,6 +1506,7 @@ var aiSDKConfigs = [
1502
1506
  filePath: "dist/agent/index.js"
1503
1507
  },
1504
1508
  functionQuery: {
1509
+ className: "HarnessAgent",
1505
1510
  methodName,
1506
1511
  kind: "Async",
1507
1512
  index: 0
@@ -1935,9 +1940,9 @@ var anthropicChannels = defineChannels(
1935
1940
  // src/auto-instrumentations/configs/anthropic.ts
1936
1941
  var anthropicConfigs = [
1937
1942
  // Each logical target is listed for both published module formats:
1938
- // `.mjs` covers ESM imports, while `.js` covers CJS requires. The Bedrock
1939
- // SDK delegates CJS `messages.create` calls through these Anthropic SDK
1940
- // `.js` resource files.
1943
+ // `.mjs` covers ESM imports, while `.js` covers CJS requires. Both
1944
+ // @anthropic-ai/bedrock-sdk and @anthropic-ai/vertex-sdk instantiate these
1945
+ // shared Anthropic resources, so they use the same targets and channels.
1941
1946
  // Messages API - create in older SDK layouts (supports streaming via stream=true parameter)
1942
1947
  {
1943
1948
  channelName: anthropicChannels.messagesCreate.channelName,
@@ -3298,6 +3303,10 @@ var googleGenAIChannels = defineChannels(
3298
3303
  channelName: "models.embedContent",
3299
3304
  kind: "async"
3300
3305
  }),
3306
+ httpResponseJson: channel({
3307
+ channelName: "httpResponse.json",
3308
+ kind: "async"
3309
+ }),
3301
3310
  interactionsCreate: channel({
3302
3311
  channelName: "interactions.create",
3303
3312
  kind: "async"
@@ -3367,6 +3376,21 @@ var googleGenAIConfigs = [
3367
3376
  kind: "Async"
3368
3377
  }
3369
3378
  },
3379
+ // The SDK's embedding response converter drops usageMetadata. Observe the
3380
+ // parsed HTTP response before conversion; the plugin scopes this to embeddings.
3381
+ {
3382
+ channelName: googleGenAIChannels.httpResponseJson.channelName,
3383
+ module: {
3384
+ name: "@google/genai",
3385
+ versionRange: ">=1.0.0",
3386
+ filePath: "dist/node/index.mjs"
3387
+ },
3388
+ functionQuery: {
3389
+ className: "HttpResponse",
3390
+ methodName: "json",
3391
+ kind: "Async"
3392
+ }
3393
+ },
3370
3394
  // BaseInteractions.create - Interactions API entry point
3371
3395
  {
3372
3396
  channelName: googleGenAIChannels.interactionsCreate.channelName,
@@ -4222,6 +4246,42 @@ var mistralConfigs = [
4222
4246
  }
4223
4247
  ];
4224
4248
 
4249
+ // src/instrumentation/plugins/langgraph-sdk-channels.ts
4250
+ var langGraphSDKChannels = defineChannels(
4251
+ "@langchain/langgraph-sdk",
4252
+ {
4253
+ wait: channel({
4254
+ channelName: "runs.wait",
4255
+ kind: "async"
4256
+ }),
4257
+ stream: channel({
4258
+ channelName: "runs.stream",
4259
+ kind: "sync-stream"
4260
+ })
4261
+ },
4262
+ { instrumentationName: INSTRUMENTATION_NAMES.LANGGRAPH_SDK }
4263
+ );
4264
+
4265
+ // src/auto-instrumentations/configs/langgraph-sdk.ts
4266
+ var langGraphSDKConfigs = [
4267
+ "js",
4268
+ "cjs"
4269
+ ].flatMap(
4270
+ (extension) => ["wait", "stream"].map((methodName) => ({
4271
+ channelName: langGraphSDKChannels[methodName].channelName,
4272
+ module: {
4273
+ name: "@langchain/langgraph-sdk",
4274
+ versionRange: ">=1.9.25 <2.0.0",
4275
+ filePath: `dist/client/runs/index.${extension}`
4276
+ },
4277
+ functionQuery: {
4278
+ className: "RunsClient",
4279
+ methodName,
4280
+ kind: methodName === "stream" ? "Sync" : "Async"
4281
+ }
4282
+ }))
4283
+ );
4284
+
4225
4285
  // src/instrumentation/plugins/ollama-channels.ts
4226
4286
  var ollamaChannels = defineChannels(
4227
4287
  "ollama",
@@ -4320,6 +4380,18 @@ var openAIAgentsCoreConfigs = lifecycleMethods.flatMap(
4320
4380
  var openAIChannels = defineChannels(
4321
4381
  "openai",
4322
4382
  {
4383
+ agentsTraceStart: channel({
4384
+ channelName: "agents.trace.start",
4385
+ kind: "async"
4386
+ }),
4387
+ agentsTraceCapture: channel({
4388
+ channelName: "agents.trace.capture",
4389
+ kind: "async"
4390
+ }),
4391
+ agentsTraceFail: channel({
4392
+ channelName: "agents.trace.fail",
4393
+ kind: "async"
4394
+ }),
4323
4395
  filesCreateTraced: channel({
4324
4396
  channelName: "files.create-traced",
4325
4397
  kind: "async"
@@ -5031,6 +5103,7 @@ var defaultInstrumentationConfigGroups = [
5031
5103
  configs: openRouterAgentConfigs
5032
5104
  },
5033
5105
  { integrations: ["mistral"], configs: mistralConfigs },
5106
+ { integrations: ["langgraphSDK"], configs: langGraphSDKConfigs },
5034
5107
  { integrations: ["ollama"], configs: ollamaConfigs },
5035
5108
  { integrations: ["googleADK"], configs: googleADKConfigs },
5036
5109
  { integrations: ["cohere"], configs: cohereConfigs },
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  unplugin
3
- } from "../chunk-RI4Y55ZF.mjs";
4
- import "../chunk-AFND2U7E.mjs";
3
+ } from "../chunk-UHJ2DNYJ.mjs";
4
+ import "../chunk-T2DMPWFI.mjs";
5
5
  import "../chunk-I55G56ZL.mjs";
6
6
  import "../chunk-JPUFNW7X.mjs";
7
7
  import "../chunk-P5YLNB2A.mjs";
@@ -1203,6 +1203,9 @@ var envIntegrationAliases = {
1203
1203
  "langchain-js": "langchain",
1204
1204
  "@langchain": "langchain",
1205
1205
  langgraph: "langgraph",
1206
+ langgraphsdk: "langgraphSDK",
1207
+ "langgraph-sdk": "langgraphSDK",
1208
+ "@langchain/langgraph-sdk": "langgraphSDK",
1206
1209
  langsmith: "langsmith",
1207
1210
  voyage: "voyageai",
1208
1211
  "voyage-ai": "voyageai",
@@ -1352,6 +1355,7 @@ var INSTRUMENTATION_NAMES = {
1352
1355
  LANGSMITH: "langsmith",
1353
1356
  MASTRA: "mastra",
1354
1357
  MISTRAL: "mistral",
1358
+ LANGGRAPH_SDK: "langgraph-sdk",
1355
1359
  OLLAMA: "ollama",
1356
1360
  OPENAI: "openai",
1357
1361
  OPENAI_AGENTS: "openai-agents",
@@ -1469,8 +1473,8 @@ var harnessAgentChannels = defineChannels(
1469
1473
  // src/auto-instrumentations/configs/ai-sdk.ts
1470
1474
  var aiSDKConfigs = [
1471
1475
  // HarnessAgent turn methods are published only from the package's ESM
1472
- // `./agent` entrypoint. The compiled class expression is anonymous, so match
1473
- // the first async method with each public name instead of a class name.
1476
+ // `./agent` entrypoint. Target the class binding so similarly named getters
1477
+ // on stream result classes are not mistaken for agent turn methods.
1474
1478
  ...[
1475
1479
  ["createSession", harnessAgentChannels.createSession.channelName],
1476
1480
  ["generate", harnessAgentChannels.generate.channelName],
@@ -1485,6 +1489,7 @@ var aiSDKConfigs = [
1485
1489
  filePath: "dist/agent/index.js"
1486
1490
  },
1487
1491
  functionQuery: {
1492
+ className: "HarnessAgent",
1488
1493
  methodName,
1489
1494
  kind: "Async",
1490
1495
  index: 0
@@ -1918,9 +1923,9 @@ var anthropicChannels = defineChannels(
1918
1923
  // src/auto-instrumentations/configs/anthropic.ts
1919
1924
  var anthropicConfigs = [
1920
1925
  // Each logical target is listed for both published module formats:
1921
- // `.mjs` covers ESM imports, while `.js` covers CJS requires. The Bedrock
1922
- // SDK delegates CJS `messages.create` calls through these Anthropic SDK
1923
- // `.js` resource files.
1926
+ // `.mjs` covers ESM imports, while `.js` covers CJS requires. Both
1927
+ // @anthropic-ai/bedrock-sdk and @anthropic-ai/vertex-sdk instantiate these
1928
+ // shared Anthropic resources, so they use the same targets and channels.
1924
1929
  // Messages API - create in older SDK layouts (supports streaming via stream=true parameter)
1925
1930
  {
1926
1931
  channelName: anthropicChannels.messagesCreate.channelName,
@@ -3281,6 +3286,10 @@ var googleGenAIChannels = defineChannels(
3281
3286
  channelName: "models.embedContent",
3282
3287
  kind: "async"
3283
3288
  }),
3289
+ httpResponseJson: channel({
3290
+ channelName: "httpResponse.json",
3291
+ kind: "async"
3292
+ }),
3284
3293
  interactionsCreate: channel({
3285
3294
  channelName: "interactions.create",
3286
3295
  kind: "async"
@@ -3350,6 +3359,21 @@ var googleGenAIConfigs = [
3350
3359
  kind: "Async"
3351
3360
  }
3352
3361
  },
3362
+ // The SDK's embedding response converter drops usageMetadata. Observe the
3363
+ // parsed HTTP response before conversion; the plugin scopes this to embeddings.
3364
+ {
3365
+ channelName: googleGenAIChannels.httpResponseJson.channelName,
3366
+ module: {
3367
+ name: "@google/genai",
3368
+ versionRange: ">=1.0.0",
3369
+ filePath: "dist/node/index.mjs"
3370
+ },
3371
+ functionQuery: {
3372
+ className: "HttpResponse",
3373
+ methodName: "json",
3374
+ kind: "Async"
3375
+ }
3376
+ },
3353
3377
  // BaseInteractions.create - Interactions API entry point
3354
3378
  {
3355
3379
  channelName: googleGenAIChannels.interactionsCreate.channelName,
@@ -4205,6 +4229,42 @@ var mistralConfigs = [
4205
4229
  }
4206
4230
  ];
4207
4231
 
4232
+ // src/instrumentation/plugins/langgraph-sdk-channels.ts
4233
+ var langGraphSDKChannels = defineChannels(
4234
+ "@langchain/langgraph-sdk",
4235
+ {
4236
+ wait: channel({
4237
+ channelName: "runs.wait",
4238
+ kind: "async"
4239
+ }),
4240
+ stream: channel({
4241
+ channelName: "runs.stream",
4242
+ kind: "sync-stream"
4243
+ })
4244
+ },
4245
+ { instrumentationName: INSTRUMENTATION_NAMES.LANGGRAPH_SDK }
4246
+ );
4247
+
4248
+ // src/auto-instrumentations/configs/langgraph-sdk.ts
4249
+ var langGraphSDKConfigs = [
4250
+ "js",
4251
+ "cjs"
4252
+ ].flatMap(
4253
+ (extension) => ["wait", "stream"].map((methodName) => ({
4254
+ channelName: langGraphSDKChannels[methodName].channelName,
4255
+ module: {
4256
+ name: "@langchain/langgraph-sdk",
4257
+ versionRange: ">=1.9.25 <2.0.0",
4258
+ filePath: `dist/client/runs/index.${extension}`
4259
+ },
4260
+ functionQuery: {
4261
+ className: "RunsClient",
4262
+ methodName,
4263
+ kind: methodName === "stream" ? "Sync" : "Async"
4264
+ }
4265
+ }))
4266
+ );
4267
+
4208
4268
  // src/instrumentation/plugins/ollama-channels.ts
4209
4269
  var ollamaChannels = defineChannels(
4210
4270
  "ollama",
@@ -4303,6 +4363,18 @@ var openAIAgentsCoreConfigs = lifecycleMethods.flatMap(
4303
4363
  var openAIChannels = defineChannels(
4304
4364
  "openai",
4305
4365
  {
4366
+ agentsTraceStart: channel({
4367
+ channelName: "agents.trace.start",
4368
+ kind: "async"
4369
+ }),
4370
+ agentsTraceCapture: channel({
4371
+ channelName: "agents.trace.capture",
4372
+ kind: "async"
4373
+ }),
4374
+ agentsTraceFail: channel({
4375
+ channelName: "agents.trace.fail",
4376
+ kind: "async"
4377
+ }),
4306
4378
  filesCreateTraced: channel({
4307
4379
  channelName: "files.create-traced",
4308
4380
  kind: "async"
@@ -5014,6 +5086,7 @@ var defaultInstrumentationConfigGroups = [
5014
5086
  configs: openRouterAgentConfigs
5015
5087
  },
5016
5088
  { integrations: ["mistral"], configs: mistralConfigs },
5089
+ { integrations: ["langgraphSDK"], configs: langGraphSDKConfigs },
5017
5090
  { integrations: ["ollama"], configs: ollamaConfigs },
5018
5091
  { integrations: ["googleADK"], configs: googleADKConfigs },
5019
5092
  { integrations: ["cohere"], configs: cohereConfigs },
@@ -1220,6 +1220,9 @@ var envIntegrationAliases = {
1220
1220
  "langchain-js": "langchain",
1221
1221
  "@langchain": "langchain",
1222
1222
  langgraph: "langgraph",
1223
+ langgraphsdk: "langgraphSDK",
1224
+ "langgraph-sdk": "langgraphSDK",
1225
+ "@langchain/langgraph-sdk": "langgraphSDK",
1223
1226
  langsmith: "langsmith",
1224
1227
  voyage: "voyageai",
1225
1228
  "voyage-ai": "voyageai",
@@ -1369,6 +1372,7 @@ var INSTRUMENTATION_NAMES = {
1369
1372
  LANGSMITH: "langsmith",
1370
1373
  MASTRA: "mastra",
1371
1374
  MISTRAL: "mistral",
1375
+ LANGGRAPH_SDK: "langgraph-sdk",
1372
1376
  OLLAMA: "ollama",
1373
1377
  OPENAI: "openai",
1374
1378
  OPENAI_AGENTS: "openai-agents",
@@ -1486,8 +1490,8 @@ var harnessAgentChannels = defineChannels(
1486
1490
  // src/auto-instrumentations/configs/ai-sdk.ts
1487
1491
  var aiSDKConfigs = [
1488
1492
  // HarnessAgent turn methods are published only from the package's ESM
1489
- // `./agent` entrypoint. The compiled class expression is anonymous, so match
1490
- // the first async method with each public name instead of a class name.
1493
+ // `./agent` entrypoint. Target the class binding so similarly named getters
1494
+ // on stream result classes are not mistaken for agent turn methods.
1491
1495
  ...[
1492
1496
  ["createSession", harnessAgentChannels.createSession.channelName],
1493
1497
  ["generate", harnessAgentChannels.generate.channelName],
@@ -1502,6 +1506,7 @@ var aiSDKConfigs = [
1502
1506
  filePath: "dist/agent/index.js"
1503
1507
  },
1504
1508
  functionQuery: {
1509
+ className: "HarnessAgent",
1505
1510
  methodName,
1506
1511
  kind: "Async",
1507
1512
  index: 0
@@ -1935,9 +1940,9 @@ var anthropicChannels = defineChannels(
1935
1940
  // src/auto-instrumentations/configs/anthropic.ts
1936
1941
  var anthropicConfigs = [
1937
1942
  // Each logical target is listed for both published module formats:
1938
- // `.mjs` covers ESM imports, while `.js` covers CJS requires. The Bedrock
1939
- // SDK delegates CJS `messages.create` calls through these Anthropic SDK
1940
- // `.js` resource files.
1943
+ // `.mjs` covers ESM imports, while `.js` covers CJS requires. Both
1944
+ // @anthropic-ai/bedrock-sdk and @anthropic-ai/vertex-sdk instantiate these
1945
+ // shared Anthropic resources, so they use the same targets and channels.
1941
1946
  // Messages API - create in older SDK layouts (supports streaming via stream=true parameter)
1942
1947
  {
1943
1948
  channelName: anthropicChannels.messagesCreate.channelName,
@@ -3298,6 +3303,10 @@ var googleGenAIChannels = defineChannels(
3298
3303
  channelName: "models.embedContent",
3299
3304
  kind: "async"
3300
3305
  }),
3306
+ httpResponseJson: channel({
3307
+ channelName: "httpResponse.json",
3308
+ kind: "async"
3309
+ }),
3301
3310
  interactionsCreate: channel({
3302
3311
  channelName: "interactions.create",
3303
3312
  kind: "async"
@@ -3367,6 +3376,21 @@ var googleGenAIConfigs = [
3367
3376
  kind: "Async"
3368
3377
  }
3369
3378
  },
3379
+ // The SDK's embedding response converter drops usageMetadata. Observe the
3380
+ // parsed HTTP response before conversion; the plugin scopes this to embeddings.
3381
+ {
3382
+ channelName: googleGenAIChannels.httpResponseJson.channelName,
3383
+ module: {
3384
+ name: "@google/genai",
3385
+ versionRange: ">=1.0.0",
3386
+ filePath: "dist/node/index.mjs"
3387
+ },
3388
+ functionQuery: {
3389
+ className: "HttpResponse",
3390
+ methodName: "json",
3391
+ kind: "Async"
3392
+ }
3393
+ },
3370
3394
  // BaseInteractions.create - Interactions API entry point
3371
3395
  {
3372
3396
  channelName: googleGenAIChannels.interactionsCreate.channelName,
@@ -4222,6 +4246,42 @@ var mistralConfigs = [
4222
4246
  }
4223
4247
  ];
4224
4248
 
4249
+ // src/instrumentation/plugins/langgraph-sdk-channels.ts
4250
+ var langGraphSDKChannels = defineChannels(
4251
+ "@langchain/langgraph-sdk",
4252
+ {
4253
+ wait: channel({
4254
+ channelName: "runs.wait",
4255
+ kind: "async"
4256
+ }),
4257
+ stream: channel({
4258
+ channelName: "runs.stream",
4259
+ kind: "sync-stream"
4260
+ })
4261
+ },
4262
+ { instrumentationName: INSTRUMENTATION_NAMES.LANGGRAPH_SDK }
4263
+ );
4264
+
4265
+ // src/auto-instrumentations/configs/langgraph-sdk.ts
4266
+ var langGraphSDKConfigs = [
4267
+ "js",
4268
+ "cjs"
4269
+ ].flatMap(
4270
+ (extension) => ["wait", "stream"].map((methodName) => ({
4271
+ channelName: langGraphSDKChannels[methodName].channelName,
4272
+ module: {
4273
+ name: "@langchain/langgraph-sdk",
4274
+ versionRange: ">=1.9.25 <2.0.0",
4275
+ filePath: `dist/client/runs/index.${extension}`
4276
+ },
4277
+ functionQuery: {
4278
+ className: "RunsClient",
4279
+ methodName,
4280
+ kind: methodName === "stream" ? "Sync" : "Async"
4281
+ }
4282
+ }))
4283
+ );
4284
+
4225
4285
  // src/instrumentation/plugins/ollama-channels.ts
4226
4286
  var ollamaChannels = defineChannels(
4227
4287
  "ollama",
@@ -4320,6 +4380,18 @@ var openAIAgentsCoreConfigs = lifecycleMethods.flatMap(
4320
4380
  var openAIChannels = defineChannels(
4321
4381
  "openai",
4322
4382
  {
4383
+ agentsTraceStart: channel({
4384
+ channelName: "agents.trace.start",
4385
+ kind: "async"
4386
+ }),
4387
+ agentsTraceCapture: channel({
4388
+ channelName: "agents.trace.capture",
4389
+ kind: "async"
4390
+ }),
4391
+ agentsTraceFail: channel({
4392
+ channelName: "agents.trace.fail",
4393
+ kind: "async"
4394
+ }),
4323
4395
  filesCreateTraced: channel({
4324
4396
  channelName: "files.create-traced",
4325
4397
  kind: "async"
@@ -5031,6 +5103,7 @@ var defaultInstrumentationConfigGroups = [
5031
5103
  configs: openRouterAgentConfigs
5032
5104
  },
5033
5105
  { integrations: ["mistral"], configs: mistralConfigs },
5106
+ { integrations: ["langgraphSDK"], configs: langGraphSDKConfigs },
5034
5107
  { integrations: ["ollama"], configs: ollamaConfigs },
5035
5108
  { integrations: ["googleADK"], configs: googleADKConfigs },
5036
5109
  { integrations: ["cohere"], configs: cohereConfigs },
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  braintrustWebpackPlugin,
3
3
  webpackPlugin
4
- } from "../chunk-QEEPRBIS.mjs";
5
- import "../chunk-RI4Y55ZF.mjs";
6
- import "../chunk-AFND2U7E.mjs";
4
+ } from "../chunk-W5QNG3PV.mjs";
5
+ import "../chunk-UHJ2DNYJ.mjs";
6
+ import "../chunk-T2DMPWFI.mjs";
7
7
  import "../chunk-I55G56ZL.mjs";
8
8
  import "../chunk-JPUFNW7X.mjs";
9
9
  import "../chunk-P5YLNB2A.mjs";
@@ -127,6 +127,7 @@ var INSTRUMENTATION_NAMES = {
127
127
  LANGSMITH: "langsmith",
128
128
  MASTRA: "mastra",
129
129
  MISTRAL: "mistral",
130
+ LANGGRAPH_SDK: "langgraph-sdk",
130
131
  OLLAMA: "ollama",
131
132
  OPENAI: "openai",
132
133
  OPENAI_AGENTS: "openai-agents",
@@ -143,6 +144,18 @@ var INSTRUMENTATION_NAMES = {
143
144
  var openAIChannels = defineChannels(
144
145
  "openai",
145
146
  {
147
+ agentsTraceStart: channel({
148
+ channelName: "agents.trace.start",
149
+ kind: "async"
150
+ }),
151
+ agentsTraceCapture: channel({
152
+ channelName: "agents.trace.capture",
153
+ kind: "async"
154
+ }),
155
+ agentsTraceFail: channel({
156
+ channelName: "agents.trace.fail",
157
+ kind: "async"
158
+ }),
146
159
  filesCreateTraced: channel({
147
160
  channelName: "files.create-traced",
148
161
  kind: "async"
@@ -452,9 +465,9 @@ var anthropicChannels = defineChannels(
452
465
  // src/auto-instrumentations/configs/anthropic.ts
453
466
  var anthropicConfigs = [
454
467
  // Each logical target is listed for both published module formats:
455
- // `.mjs` covers ESM imports, while `.js` covers CJS requires. The Bedrock
456
- // SDK delegates CJS `messages.create` calls through these Anthropic SDK
457
- // `.js` resource files.
468
+ // `.mjs` covers ESM imports, while `.js` covers CJS requires. Both
469
+ // @anthropic-ai/bedrock-sdk and @anthropic-ai/vertex-sdk instantiate these
470
+ // shared Anthropic resources, so they use the same targets and channels.
458
471
  // Messages API - create in older SDK layouts (supports streaming via stream=true parameter)
459
472
  {
460
473
  channelName: anthropicChannels.messagesCreate.channelName,
@@ -786,8 +799,8 @@ var harnessAgentChannels = defineChannels(
786
799
  // src/auto-instrumentations/configs/ai-sdk.ts
787
800
  var aiSDKConfigs = [
788
801
  // HarnessAgent turn methods are published only from the package's ESM
789
- // `./agent` entrypoint. The compiled class expression is anonymous, so match
790
- // the first async method with each public name instead of a class name.
802
+ // `./agent` entrypoint. Target the class binding so similarly named getters
803
+ // on stream result classes are not mistaken for agent turn methods.
791
804
  ...[
792
805
  ["createSession", harnessAgentChannels.createSession.channelName],
793
806
  ["generate", harnessAgentChannels.generate.channelName],
@@ -802,6 +815,7 @@ var aiSDKConfigs = [
802
815
  filePath: "dist/agent/index.js"
803
816
  },
804
817
  functionQuery: {
818
+ className: "HarnessAgent",
805
819
  methodName,
806
820
  kind: "Async",
807
821
  index: 0
@@ -1475,6 +1489,10 @@ var googleGenAIChannels = defineChannels(
1475
1489
  channelName: "models.embedContent",
1476
1490
  kind: "async"
1477
1491
  }),
1492
+ httpResponseJson: channel({
1493
+ channelName: "httpResponse.json",
1494
+ kind: "async"
1495
+ }),
1478
1496
  interactionsCreate: channel({
1479
1497
  channelName: "interactions.create",
1480
1498
  kind: "async"
@@ -1544,6 +1562,21 @@ var googleGenAIConfigs = [
1544
1562
  kind: "Async"
1545
1563
  }
1546
1564
  },
1565
+ // The SDK's embedding response converter drops usageMetadata. Observe the
1566
+ // parsed HTTP response before conversion; the plugin scopes this to embeddings.
1567
+ {
1568
+ channelName: googleGenAIChannels.httpResponseJson.channelName,
1569
+ module: {
1570
+ name: "@google/genai",
1571
+ versionRange: ">=1.0.0",
1572
+ filePath: "dist/node/index.mjs"
1573
+ },
1574
+ functionQuery: {
1575
+ className: "HttpResponse",
1576
+ methodName: "json",
1577
+ kind: "Async"
1578
+ }
1579
+ },
1547
1580
  // BaseInteractions.create - Interactions API entry point
1548
1581
  {
1549
1582
  channelName: googleGenAIChannels.interactionsCreate.channelName,
@@ -2328,6 +2361,42 @@ var mistralConfigs = [
2328
2361
  }
2329
2362
  ];
2330
2363
 
2364
+ // src/instrumentation/plugins/langgraph-sdk-channels.ts
2365
+ var langGraphSDKChannels = defineChannels(
2366
+ "@langchain/langgraph-sdk",
2367
+ {
2368
+ wait: channel({
2369
+ channelName: "runs.wait",
2370
+ kind: "async"
2371
+ }),
2372
+ stream: channel({
2373
+ channelName: "runs.stream",
2374
+ kind: "sync-stream"
2375
+ })
2376
+ },
2377
+ { instrumentationName: INSTRUMENTATION_NAMES.LANGGRAPH_SDK }
2378
+ );
2379
+
2380
+ // src/auto-instrumentations/configs/langgraph-sdk.ts
2381
+ var langGraphSDKConfigs = [
2382
+ "js",
2383
+ "cjs"
2384
+ ].flatMap(
2385
+ (extension) => ["wait", "stream"].map((methodName) => ({
2386
+ channelName: langGraphSDKChannels[methodName].channelName,
2387
+ module: {
2388
+ name: "@langchain/langgraph-sdk",
2389
+ versionRange: ">=1.9.25 <2.0.0",
2390
+ filePath: `dist/client/runs/index.${extension}`
2391
+ },
2392
+ functionQuery: {
2393
+ className: "RunsClient",
2394
+ methodName,
2395
+ kind: methodName === "stream" ? "Sync" : "Async"
2396
+ }
2397
+ }))
2398
+ );
2399
+
2331
2400
  // src/instrumentation/plugins/ollama-channels.ts
2332
2401
  var ollamaChannels = defineChannels(
2333
2402
  "ollama",
@@ -3454,6 +3523,7 @@ export {
3454
3523
  openRouterAgentConfigs,
3455
3524
  openRouterConfigs,
3456
3525
  mistralConfigs,
3526
+ langGraphSDKConfigs,
3457
3527
  ollamaConfigs,
3458
3528
  googleADKConfigs,
3459
3529
  cloudflareAIChatConfigs,
@@ -18,6 +18,7 @@ import {
18
18
  googleGenerativeAIConfigs,
19
19
  groqConfigs,
20
20
  huggingFaceConfigs,
21
+ langGraphSDKConfigs,
21
22
  langSmithConfigs,
22
23
  langchainConfigs,
23
24
  mistralConfigs,
@@ -28,7 +29,7 @@ import {
28
29
  openRouterConfigs,
29
30
  openaiConfigs,
30
31
  piCodingAgentConfigs
31
- } from "./chunk-AFND2U7E.mjs";
32
+ } from "./chunk-T2DMPWFI.mjs";
32
33
  import {
33
34
  applySpecialCasePatch,
34
35
  create
@@ -118,6 +119,9 @@ var envIntegrationAliases = {
118
119
  "langchain-js": "langchain",
119
120
  "@langchain": "langchain",
120
121
  langgraph: "langgraph",
122
+ langgraphsdk: "langgraphSDK",
123
+ "langgraph-sdk": "langgraphSDK",
124
+ "@langchain/langgraph-sdk": "langgraphSDK",
121
125
  langsmith: "langsmith",
122
126
  voyage: "voyageai",
123
127
  "voyage-ai": "voyageai",
@@ -497,6 +501,7 @@ var defaultInstrumentationConfigGroups = [
497
501
  configs: openRouterAgentConfigs
498
502
  },
499
503
  { integrations: ["mistral"], configs: mistralConfigs },
504
+ { integrations: ["langgraphSDK"], configs: langGraphSDKConfigs },
500
505
  { integrations: ["ollama"], configs: ollamaConfigs },
501
506
  { integrations: ["googleADK"], configs: googleADKConfigs },
502
507
  { integrations: ["cohere"], configs: cohereConfigs },
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  unplugin
3
- } from "./chunk-RI4Y55ZF.mjs";
3
+ } from "./chunk-UHJ2DNYJ.mjs";
4
4
 
5
5
  // src/auto-instrumentations/bundler/webpack.ts
6
6
  function braintrustWebpackPlugin(options = {}) {