braintrust 3.24.0 → 3.25.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 (47) hide show
  1. package/dev/dist/index.d.mts +5 -0
  2. package/dev/dist/index.d.ts +5 -0
  3. package/dev/dist/index.js +2614 -1567
  4. package/dev/dist/index.mjs +2037 -990
  5. package/dist/apply-auto-instrumentation.js +200 -199
  6. package/dist/apply-auto-instrumentation.mjs +8 -7
  7. package/dist/auto-instrumentations/bundler/esbuild.cjs +596 -462
  8. package/dist/auto-instrumentations/bundler/esbuild.mjs +2 -2
  9. package/dist/auto-instrumentations/bundler/next.cjs +596 -462
  10. package/dist/auto-instrumentations/bundler/next.mjs +3 -3
  11. package/dist/auto-instrumentations/bundler/rollup.cjs +596 -462
  12. package/dist/auto-instrumentations/bundler/rollup.mjs +2 -2
  13. package/dist/auto-instrumentations/bundler/vite.cjs +596 -462
  14. package/dist/auto-instrumentations/bundler/vite.mjs +2 -2
  15. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +596 -462
  16. package/dist/auto-instrumentations/bundler/webpack.cjs +596 -462
  17. package/dist/auto-instrumentations/bundler/webpack.mjs +3 -3
  18. package/dist/auto-instrumentations/{chunk-BURMPO7L.mjs → chunk-7P6563SW.mjs} +1 -1
  19. package/dist/auto-instrumentations/{chunk-F43DNLPD.mjs → chunk-CZ24KNHT.mjs} +569 -442
  20. package/dist/auto-instrumentations/{chunk-GSZHTAQW.mjs → chunk-JPVCUKTY.mjs} +30 -21
  21. package/dist/auto-instrumentations/hook.mjs +648 -476
  22. package/dist/auto-instrumentations/index.cjs +568 -442
  23. package/dist/auto-instrumentations/index.mjs +1 -1
  24. package/dist/browser.d.mts +7 -0
  25. package/dist/browser.d.ts +7 -0
  26. package/dist/browser.js +2022 -971
  27. package/dist/browser.mjs +2022 -971
  28. package/dist/{chunk-XE5FS7QY.mjs → chunk-2SANLSWX.mjs} +1375 -597
  29. package/dist/{chunk-7F6GCRHH.mjs → chunk-ABR2QWDP.mjs} +702 -456
  30. package/dist/{chunk-SU6EHKJV.js → chunk-GSIDVFE6.js} +2176 -1398
  31. package/dist/{chunk-7AUY2XWX.js → chunk-P25IOOU4.js} +704 -458
  32. package/dist/cli.js +2005 -958
  33. package/dist/edge-light.js +2022 -971
  34. package/dist/edge-light.mjs +2022 -971
  35. package/dist/index.d.mts +7 -0
  36. package/dist/index.d.ts +7 -0
  37. package/dist/index.js +447 -402
  38. package/dist/index.mjs +72 -27
  39. package/dist/instrumentation/index.d.mts +5 -0
  40. package/dist/instrumentation/index.d.ts +5 -0
  41. package/dist/instrumentation/index.js +1990 -981
  42. package/dist/instrumentation/index.mjs +1990 -981
  43. package/dist/vitest-evals-reporter.js +16 -16
  44. package/dist/vitest-evals-reporter.mjs +2 -2
  45. package/dist/workerd.js +2022 -971
  46. package/dist/workerd.mjs +2022 -971
  47. package/package.json +2 -2
@@ -101,7 +101,8 @@ var isomorph_default = iso;
101
101
  function channel(spec) {
102
102
  return spec;
103
103
  }
104
- function defineChannels(pkg, channels) {
104
+ function defineChannels(pkg, channels, options) {
105
+ const { instrumentationName } = options;
105
106
  return Object.fromEntries(
106
107
  Object.entries(channels).map(([key, spec]) => {
107
108
  const fullChannelName = `orchestrion:${pkg}:${spec.channelName}`;
@@ -114,6 +115,7 @@ function defineChannels(pkg, channels) {
114
115
  key,
115
116
  {
116
117
  ...asyncSpec,
118
+ instrumentationName,
117
119
  tracingChannel: tracingChannel2,
118
120
  tracePromise: (fn, context) => tracingChannel2().tracePromise(
119
121
  fn,
@@ -131,6 +133,7 @@ function defineChannels(pkg, channels) {
131
133
  key,
132
134
  {
133
135
  ...syncSpec,
136
+ instrumentationName,
134
137
  tracingChannel,
135
138
  traceSync: (fn, context) => tracingChannel().traceSync(
136
139
  fn,
@@ -143,45 +146,79 @@ function defineChannels(pkg, channels) {
143
146
  );
144
147
  }
145
148
 
149
+ // src/span-origin.ts
150
+ var INSTRUMENTATION_NAMES = {
151
+ AI_SDK: "ai-sdk",
152
+ ANTHROPIC: "anthropic",
153
+ BEDROCK_RUNTIME: "bedrock-runtime",
154
+ BRAINTRUST_JS_LOGGER: "braintrust-js-logger",
155
+ CLAUDE_AGENT_SDK: "claude-agent-sdk",
156
+ COHERE: "cohere",
157
+ CURSOR_SDK: "cursor-sdk",
158
+ EVE: "eve",
159
+ FLUE: "flue",
160
+ GENKIT: "genkit",
161
+ GITHUB_COPILOT: "github-copilot",
162
+ GOOGLE_ADK: "google-adk",
163
+ GOOGLE_GENAI: "google-genai",
164
+ GROQ: "groq",
165
+ HUGGINGFACE: "huggingface",
166
+ LANGCHAIN: "langchain",
167
+ LANGSMITH: "langsmith",
168
+ MASTRA: "mastra",
169
+ MISTRAL: "mistral",
170
+ OPENAI: "openai",
171
+ OPENAI_AGENTS: "openai-agents",
172
+ OPENAI_CODEX: "openai-codex",
173
+ OPENROUTER: "openrouter",
174
+ OPENROUTER_AGENT: "openrouter-agent",
175
+ PI_CODING_AGENT: "pi-coding-agent",
176
+ STRANDS_AGENT_SDK: "strands-agent-sdk"
177
+ };
178
+
146
179
  // src/instrumentation/plugins/openai-channels.ts
147
- var openAIChannels = defineChannels("openai", {
148
- chatCompletionsCreate: channel({
149
- channelName: "chat.completions.create",
150
- kind: "async"
151
- }),
152
- embeddingsCreate: channel({
153
- channelName: "embeddings.create",
154
- kind: "async"
155
- }),
156
- betaChatCompletionsParse: channel({
157
- channelName: "beta.chat.completions.parse",
158
- kind: "async"
159
- }),
160
- betaChatCompletionsStream: channel({
161
- channelName: "beta.chat.completions.stream",
162
- kind: "sync-stream"
163
- }),
164
- moderationsCreate: channel({
165
- channelName: "moderations.create",
166
- kind: "async"
167
- }),
168
- responsesCreate: channel({
169
- channelName: "responses.create",
170
- kind: "async"
171
- }),
172
- responsesStream: channel({
173
- channelName: "responses.stream",
174
- kind: "sync-stream"
175
- }),
176
- responsesParse: channel({
177
- channelName: "responses.parse",
178
- kind: "async"
179
- }),
180
- responsesCompact: channel({
181
- channelName: "responses.compact",
182
- kind: "async"
183
- })
184
- });
180
+ var openAIChannels = defineChannels(
181
+ "openai",
182
+ {
183
+ chatCompletionsCreate: channel({
184
+ channelName: "chat.completions.create",
185
+ kind: "async"
186
+ }),
187
+ embeddingsCreate: channel({
188
+ channelName: "embeddings.create",
189
+ kind: "async"
190
+ }),
191
+ betaChatCompletionsParse: channel({
192
+ channelName: "beta.chat.completions.parse",
193
+ kind: "async"
194
+ }),
195
+ betaChatCompletionsStream: channel({
196
+ channelName: "beta.chat.completions.stream",
197
+ kind: "sync-stream"
198
+ }),
199
+ moderationsCreate: channel({
200
+ channelName: "moderations.create",
201
+ kind: "async"
202
+ }),
203
+ responsesCreate: channel({
204
+ channelName: "responses.create",
205
+ kind: "async"
206
+ }),
207
+ responsesStream: channel({
208
+ channelName: "responses.stream",
209
+ kind: "sync-stream"
210
+ }),
211
+ responsesParse: channel({
212
+ channelName: "responses.parse",
213
+ kind: "async"
214
+ }),
215
+ responsesCompact: channel({
216
+ channelName: "responses.compact",
217
+ kind: "async"
218
+ })
219
+ },
220
+ { instrumentationName: INSTRUMENTATION_NAMES.OPENAI }
221
+ );
185
222
 
186
223
  // src/auto-instrumentations/configs/openai.ts
187
224
  var openaiConfigs = [
@@ -363,16 +400,20 @@ var openaiConfigs = [
363
400
  ];
364
401
 
365
402
  // src/instrumentation/plugins/openai-codex-channels.ts
366
- var openAICodexChannels = defineChannels("@openai/codex-sdk", {
367
- run: channel({
368
- channelName: "Thread.run",
369
- kind: "async"
370
- }),
371
- runStreamed: channel({
372
- channelName: "Thread.runStreamed",
373
- kind: "async"
374
- })
375
- });
403
+ var openAICodexChannels = defineChannels(
404
+ "@openai/codex-sdk",
405
+ {
406
+ run: channel({
407
+ channelName: "Thread.run",
408
+ kind: "async"
409
+ }),
410
+ runStreamed: channel({
411
+ channelName: "Thread.runStreamed",
412
+ kind: "async"
413
+ })
414
+ },
415
+ { instrumentationName: INSTRUMENTATION_NAMES.OPENAI_CODEX }
416
+ );
376
417
 
377
418
  // src/auto-instrumentations/configs/openai-codex.ts
378
419
  var openAICodexVersionRange = ">=0.128.0 <1.0.0";
@@ -406,20 +447,24 @@ var openAICodexConfigs = [
406
447
  ];
407
448
 
408
449
  // src/instrumentation/plugins/anthropic-channels.ts
409
- var anthropicChannels = defineChannels("@anthropic-ai/sdk", {
410
- messagesCreate: channel({
411
- channelName: "messages.create",
412
- kind: "async"
413
- }),
414
- betaMessagesCreate: channel({
415
- channelName: "beta.messages.create",
416
- kind: "async"
417
- }),
418
- betaMessagesToolRunner: channel({
419
- channelName: "beta.messages.toolRunner",
420
- kind: "sync-stream"
421
- })
422
- });
450
+ var anthropicChannels = defineChannels(
451
+ "@anthropic-ai/sdk",
452
+ {
453
+ messagesCreate: channel({
454
+ channelName: "messages.create",
455
+ kind: "async"
456
+ }),
457
+ betaMessagesCreate: channel({
458
+ channelName: "beta.messages.create",
459
+ kind: "async"
460
+ }),
461
+ betaMessagesToolRunner: channel({
462
+ channelName: "beta.messages.toolRunner",
463
+ kind: "sync-stream"
464
+ })
465
+ },
466
+ { instrumentationName: INSTRUMENTATION_NAMES.ANTHROPIC }
467
+ );
423
468
 
424
469
  // src/auto-instrumentations/configs/anthropic.ts
425
470
  var anthropicConfigs = [
@@ -542,15 +587,27 @@ var clientSendChannel = channel({
542
587
  channelName: "client.send",
543
588
  kind: "async"
544
589
  });
545
- var bedrockRuntimeChannels = defineChannels("aws-bedrock-runtime", {
546
- clientSend: clientSendChannel
547
- });
548
- var smithyCoreChannels = defineChannels("@smithy/core", {
549
- clientSend: clientSendChannel
550
- });
551
- var smithyClientChannels = defineChannels("@smithy/smithy-client", {
552
- clientSend: clientSendChannel
553
- });
590
+ var bedrockRuntimeChannels = defineChannels(
591
+ "aws-bedrock-runtime",
592
+ {
593
+ clientSend: clientSendChannel
594
+ },
595
+ { instrumentationName: INSTRUMENTATION_NAMES.BEDROCK_RUNTIME }
596
+ );
597
+ var smithyCoreChannels = defineChannels(
598
+ "@smithy/core",
599
+ {
600
+ clientSend: clientSendChannel
601
+ },
602
+ { instrumentationName: INSTRUMENTATION_NAMES.BEDROCK_RUNTIME }
603
+ );
604
+ var smithyClientChannels = defineChannels(
605
+ "@smithy/smithy-client",
606
+ {
607
+ clientSend: clientSendChannel
608
+ },
609
+ { instrumentationName: INSTRUMENTATION_NAMES.BEDROCK_RUNTIME }
610
+ );
554
611
 
555
612
  // src/auto-instrumentations/configs/bedrock-runtime.ts
556
613
  var bedrockRuntimeConfigs = [
@@ -609,92 +666,102 @@ var bedrockRuntimeConfigs = [
609
666
  ];
610
667
 
611
668
  // src/instrumentation/plugins/ai-sdk-channels.ts
612
- var aiSDKChannels = defineChannels("ai", {
613
- generateText: channel({
614
- channelName: "generateText",
615
- kind: "async"
616
- }),
617
- streamText: channel({
618
- channelName: "streamText",
619
- kind: "async"
620
- }),
621
- streamTextSync: channel({
622
- channelName: "streamText.sync",
623
- kind: "sync-stream"
624
- }),
625
- generateObject: channel({
626
- channelName: "generateObject",
627
- kind: "async"
628
- }),
629
- streamObject: channel({
630
- channelName: "streamObject",
631
- kind: "async"
632
- }),
633
- streamObjectSync: channel({
634
- channelName: "streamObject.sync",
635
- kind: "sync-stream"
636
- }),
637
- embed: channel(
638
- {
669
+ var aiSDKChannels = defineChannels(
670
+ "ai",
671
+ {
672
+ generateText: channel({
673
+ channelName: "generateText",
674
+ kind: "async"
675
+ }),
676
+ streamText: channel({
677
+ channelName: "streamText",
678
+ kind: "async"
679
+ }),
680
+ streamTextSync: channel({
681
+ channelName: "streamText.sync",
682
+ kind: "sync-stream"
683
+ }),
684
+ generateObject: channel({
685
+ channelName: "generateObject",
686
+ kind: "async"
687
+ }),
688
+ streamObject: channel({
689
+ channelName: "streamObject",
690
+ kind: "async"
691
+ }),
692
+ streamObjectSync: channel({
693
+ channelName: "streamObject.sync",
694
+ kind: "sync-stream"
695
+ }),
696
+ embed: channel({
639
697
  channelName: "embed",
640
698
  kind: "async"
641
- }
642
- ),
643
- embedMany: channel({
644
- channelName: "embedMany",
645
- kind: "async"
646
- }),
647
- rerank: channel({
648
- channelName: "rerank",
649
- kind: "async"
650
- }),
651
- agentGenerate: channel({
652
- channelName: "Agent.generate",
653
- kind: "async"
654
- }),
655
- agentStream: channel({
656
- channelName: "Agent.stream",
657
- kind: "async"
658
- }),
659
- agentStreamSync: channel({
660
- channelName: "Agent.stream.sync",
661
- kind: "sync-stream"
662
- }),
663
- toolLoopAgentGenerate: channel({
664
- channelName: "ToolLoopAgent.generate",
665
- kind: "async"
666
- }),
667
- toolLoopAgentStream: channel({
668
- channelName: "ToolLoopAgent.stream",
669
- kind: "async"
670
- }),
671
- workflowAgentStream: channel({
672
- channelName: "WorkflowAgent.stream",
673
- kind: "async"
674
- }),
675
- v7CreateTelemetryDispatcher: channel({
676
- channelName: "createTelemetryDispatcher",
677
- kind: "sync-stream"
678
- })
679
- });
680
- var harnessAgentChannels = defineChannels("@ai-sdk/harness", {
681
- generate: channel({
682
- channelName: "HarnessAgent.generate",
683
- kind: "async"
684
- }),
685
- stream: channel({
686
- channelName: "HarnessAgent.stream",
687
- kind: "async"
688
- }),
689
- continueGenerate: channel({
690
- channelName: "HarnessAgent.continueGenerate",
691
- kind: "async"
692
- }),
693
- continueStream: channel({
694
- channelName: "HarnessAgent.continueStream",
695
- kind: "async"
696
- })
697
- });
699
+ }),
700
+ embedMany: channel({
701
+ channelName: "embedMany",
702
+ kind: "async"
703
+ }),
704
+ rerank: channel({
705
+ channelName: "rerank",
706
+ kind: "async"
707
+ }),
708
+ agentGenerate: channel({
709
+ channelName: "Agent.generate",
710
+ kind: "async"
711
+ }),
712
+ agentStream: channel({
713
+ channelName: "Agent.stream",
714
+ kind: "async"
715
+ }),
716
+ agentStreamSync: channel({
717
+ channelName: "Agent.stream.sync",
718
+ kind: "sync-stream"
719
+ }),
720
+ toolLoopAgentGenerate: channel({
721
+ channelName: "ToolLoopAgent.generate",
722
+ kind: "async"
723
+ }),
724
+ toolLoopAgentStream: channel({
725
+ channelName: "ToolLoopAgent.stream",
726
+ kind: "async"
727
+ }),
728
+ workflowAgentStream: channel({
729
+ channelName: "WorkflowAgent.stream",
730
+ kind: "async"
731
+ }),
732
+ v7CreateTelemetryDispatcher: channel({
733
+ channelName: "createTelemetryDispatcher",
734
+ kind: "sync-stream"
735
+ })
736
+ },
737
+ { instrumentationName: INSTRUMENTATION_NAMES.AI_SDK }
738
+ );
739
+ var harnessAgentChannels = defineChannels(
740
+ "@ai-sdk/harness",
741
+ {
742
+ createSession: channel({
743
+ channelName: "HarnessAgent.createSession",
744
+ kind: "async"
745
+ }),
746
+ generate: channel({
747
+ channelName: "HarnessAgent.generate",
748
+ kind: "async"
749
+ }),
750
+ stream: channel({
751
+ channelName: "HarnessAgent.stream",
752
+ kind: "async"
753
+ }),
754
+ continueGenerate: channel({
755
+ channelName: "HarnessAgent.continueGenerate",
756
+ kind: "async"
757
+ }),
758
+ continueStream: channel({
759
+ channelName: "HarnessAgent.continueStream",
760
+ kind: "async"
761
+ })
762
+ },
763
+ { instrumentationName: INSTRUMENTATION_NAMES.AI_SDK }
764
+ );
698
765
 
699
766
  // src/auto-instrumentations/configs/ai-sdk.ts
700
767
  var aiSDKConfigs = [
@@ -702,6 +769,7 @@ var aiSDKConfigs = [
702
769
  // `./agent` entrypoint. The compiled class expression is anonymous, so match
703
770
  // the first async method with each public name instead of a class name.
704
771
  ...[
772
+ ["createSession", harnessAgentChannels.createSession.channelName],
705
773
  ["generate", harnessAgentChannels.generate.channelName],
706
774
  ["stream", harnessAgentChannels.stream.channelName],
707
775
  ["continueGenerate", harnessAgentChannels.continueGenerate.channelName],
@@ -1097,7 +1165,8 @@ var claudeAgentSDKChannels = defineChannels(
1097
1165
  channelName: "query",
1098
1166
  kind: "sync-stream"
1099
1167
  })
1100
- }
1168
+ },
1169
+ { instrumentationName: INSTRUMENTATION_NAMES.CLAUDE_AGENT_SDK }
1101
1170
  );
1102
1171
 
1103
1172
  // src/auto-instrumentations/configs/claude-agent-sdk.ts
@@ -1132,24 +1201,28 @@ var claudeAgentSDKConfigs = [
1132
1201
  ];
1133
1202
 
1134
1203
  // src/instrumentation/plugins/cursor-sdk-channels.ts
1135
- var cursorSDKChannels = defineChannels("@cursor/sdk", {
1136
- create: channel({
1137
- channelName: "Agent.create",
1138
- kind: "async"
1139
- }),
1140
- resume: channel({
1141
- channelName: "Agent.resume",
1142
- kind: "async"
1143
- }),
1144
- prompt: channel({
1145
- channelName: "Agent.prompt",
1146
- kind: "async"
1147
- }),
1148
- send: channel({
1149
- channelName: "agent.send",
1150
- kind: "async"
1151
- })
1152
- });
1204
+ var cursorSDKChannels = defineChannels(
1205
+ "@cursor/sdk",
1206
+ {
1207
+ create: channel({
1208
+ channelName: "Agent.create",
1209
+ kind: "async"
1210
+ }),
1211
+ resume: channel({
1212
+ channelName: "Agent.resume",
1213
+ kind: "async"
1214
+ }),
1215
+ prompt: channel({
1216
+ channelName: "Agent.prompt",
1217
+ kind: "async"
1218
+ }),
1219
+ send: channel({
1220
+ channelName: "agent.send",
1221
+ kind: "async"
1222
+ })
1223
+ },
1224
+ { instrumentationName: INSTRUMENTATION_NAMES.CURSOR_SDK }
1225
+ );
1153
1226
 
1154
1227
  // src/auto-instrumentations/configs/cursor-sdk.ts
1155
1228
  var cursorSDKVersionRange = ">=1.0.7 <2.0.0";
@@ -1197,24 +1270,28 @@ var cursorSDKConfigs = cursorSDKEntrypoints.flatMap((filePath) => [
1197
1270
  ]);
1198
1271
 
1199
1272
  // src/instrumentation/plugins/openai-agents-channels.ts
1200
- var openAIAgentsCoreChannels = defineChannels("@openai/agents-core", {
1201
- onTraceStart: channel({
1202
- channelName: "tracing.processor.onTraceStart",
1203
- kind: "async"
1204
- }),
1205
- onTraceEnd: channel({
1206
- channelName: "tracing.processor.onTraceEnd",
1207
- kind: "async"
1208
- }),
1209
- onSpanStart: channel({
1210
- channelName: "tracing.processor.onSpanStart",
1211
- kind: "async"
1212
- }),
1213
- onSpanEnd: channel({
1214
- channelName: "tracing.processor.onSpanEnd",
1215
- kind: "async"
1216
- })
1217
- });
1273
+ var openAIAgentsCoreChannels = defineChannels(
1274
+ "@openai/agents-core",
1275
+ {
1276
+ onTraceStart: channel({
1277
+ channelName: "tracing.processor.onTraceStart",
1278
+ kind: "async"
1279
+ }),
1280
+ onTraceEnd: channel({
1281
+ channelName: "tracing.processor.onTraceEnd",
1282
+ kind: "async"
1283
+ }),
1284
+ onSpanStart: channel({
1285
+ channelName: "tracing.processor.onSpanStart",
1286
+ kind: "async"
1287
+ }),
1288
+ onSpanEnd: channel({
1289
+ channelName: "tracing.processor.onSpanEnd",
1290
+ kind: "async"
1291
+ })
1292
+ },
1293
+ { instrumentationName: INSTRUMENTATION_NAMES.OPENAI_AGENTS }
1294
+ );
1218
1295
 
1219
1296
  // src/auto-instrumentations/configs/openai-agents.ts
1220
1297
  var lifecycleMethods = [
@@ -1242,24 +1319,28 @@ var openAIAgentsCoreConfigs = lifecycleMethods.flatMap(
1242
1319
  );
1243
1320
 
1244
1321
  // src/instrumentation/plugins/google-genai-channels.ts
1245
- var googleGenAIChannels = defineChannels("@google/genai", {
1246
- generateContent: channel({
1247
- channelName: "models.generateContent",
1248
- kind: "async"
1249
- }),
1250
- generateContentStream: channel({
1251
- channelName: "models.generateContentStream",
1252
- kind: "async"
1253
- }),
1254
- embedContent: channel({
1255
- channelName: "models.embedContent",
1256
- kind: "async"
1257
- }),
1258
- interactionsCreate: channel({
1259
- channelName: "interactions.create",
1260
- kind: "async"
1261
- })
1262
- });
1322
+ var googleGenAIChannels = defineChannels(
1323
+ "@google/genai",
1324
+ {
1325
+ generateContent: channel({
1326
+ channelName: "models.generateContent",
1327
+ kind: "async"
1328
+ }),
1329
+ generateContentStream: channel({
1330
+ channelName: "models.generateContentStream",
1331
+ kind: "async"
1332
+ }),
1333
+ embedContent: channel({
1334
+ channelName: "models.embedContent",
1335
+ kind: "async"
1336
+ }),
1337
+ interactionsCreate: channel({
1338
+ channelName: "interactions.create",
1339
+ kind: "async"
1340
+ })
1341
+ },
1342
+ { instrumentationName: INSTRUMENTATION_NAMES.GOOGLE_GENAI }
1343
+ );
1263
1344
 
1264
1345
  // src/auto-instrumentations/configs/google-genai.ts
1265
1346
  var googleGenAIConfigs = [
@@ -1339,28 +1420,32 @@ var googleGenAIConfigs = [
1339
1420
  ];
1340
1421
 
1341
1422
  // src/instrumentation/plugins/huggingface-channels.ts
1342
- var huggingFaceChannels = defineChannels("@huggingface/inference", {
1343
- chatCompletion: channel({
1344
- channelName: "chatCompletion",
1345
- kind: "async"
1346
- }),
1347
- chatCompletionStream: channel({
1348
- channelName: "chatCompletionStream",
1349
- kind: "sync-stream"
1350
- }),
1351
- textGeneration: channel({
1352
- channelName: "textGeneration",
1353
- kind: "async"
1354
- }),
1355
- textGenerationStream: channel({
1356
- channelName: "textGenerationStream",
1357
- kind: "sync-stream"
1358
- }),
1359
- featureExtraction: channel({
1360
- channelName: "featureExtraction",
1361
- kind: "async"
1362
- })
1363
- });
1423
+ var huggingFaceChannels = defineChannels(
1424
+ "@huggingface/inference",
1425
+ {
1426
+ chatCompletion: channel({
1427
+ channelName: "chatCompletion",
1428
+ kind: "async"
1429
+ }),
1430
+ chatCompletionStream: channel({
1431
+ channelName: "chatCompletionStream",
1432
+ kind: "sync-stream"
1433
+ }),
1434
+ textGeneration: channel({
1435
+ channelName: "textGeneration",
1436
+ kind: "async"
1437
+ }),
1438
+ textGenerationStream: channel({
1439
+ channelName: "textGenerationStream",
1440
+ kind: "sync-stream"
1441
+ }),
1442
+ featureExtraction: channel({
1443
+ channelName: "featureExtraction",
1444
+ kind: "async"
1445
+ })
1446
+ },
1447
+ { instrumentationName: INSTRUMENTATION_NAMES.HUGGINGFACE }
1448
+ );
1364
1449
 
1365
1450
  // src/auto-instrumentations/configs/huggingface.ts
1366
1451
  var huggingFaceConfigs = [
@@ -1607,20 +1692,24 @@ var huggingFaceConfigs = [
1607
1692
  ];
1608
1693
 
1609
1694
  // src/instrumentation/plugins/openrouter-agent-channels.ts
1610
- var openRouterAgentChannels = defineChannels("@openrouter/agent", {
1611
- callModel: channel({
1612
- channelName: "callModel",
1613
- kind: "sync-stream"
1614
- }),
1615
- callModelTurn: channel({
1616
- channelName: "callModel.turn",
1617
- kind: "async"
1618
- }),
1619
- toolExecute: channel({
1620
- channelName: "tool.execute",
1621
- kind: "async"
1622
- })
1623
- });
1695
+ var openRouterAgentChannels = defineChannels(
1696
+ "@openrouter/agent",
1697
+ {
1698
+ callModel: channel({
1699
+ channelName: "callModel",
1700
+ kind: "sync-stream"
1701
+ }),
1702
+ callModelTurn: channel({
1703
+ channelName: "callModel.turn",
1704
+ kind: "async"
1705
+ }),
1706
+ toolExecute: channel({
1707
+ channelName: "tool.execute",
1708
+ kind: "async"
1709
+ })
1710
+ },
1711
+ { instrumentationName: INSTRUMENTATION_NAMES.OPENROUTER_AGENT }
1712
+ );
1624
1713
 
1625
1714
  // src/auto-instrumentations/configs/openrouter-agent.ts
1626
1715
  var openRouterAgentConfigs = [
@@ -1639,38 +1728,40 @@ var openRouterAgentConfigs = [
1639
1728
  ];
1640
1729
 
1641
1730
  // src/instrumentation/plugins/openrouter-channels.ts
1642
- var openRouterChannels = defineChannels("@openrouter/sdk", {
1643
- chatSend: channel({
1644
- channelName: "chat.send",
1645
- kind: "async"
1646
- }),
1647
- embeddingsGenerate: channel({
1648
- channelName: "embeddings.generate",
1649
- kind: "async"
1650
- }),
1651
- rerankRerank: channel(
1652
- {
1731
+ var openRouterChannels = defineChannels(
1732
+ "@openrouter/sdk",
1733
+ {
1734
+ chatSend: channel({
1735
+ channelName: "chat.send",
1736
+ kind: "async"
1737
+ }),
1738
+ embeddingsGenerate: channel({
1739
+ channelName: "embeddings.generate",
1740
+ kind: "async"
1741
+ }),
1742
+ rerankRerank: channel({
1653
1743
  channelName: "rerank.rerank",
1654
1744
  kind: "async"
1655
- }
1656
- ),
1657
- betaResponsesSend: channel({
1658
- channelName: "beta.responses.send",
1659
- kind: "async"
1660
- }),
1661
- callModel: channel({
1662
- channelName: "callModel",
1663
- kind: "sync-stream"
1664
- }),
1665
- callModelTurn: channel({
1666
- channelName: "callModel.turn",
1667
- kind: "async"
1668
- }),
1669
- toolExecute: channel({
1670
- channelName: "tool.execute",
1671
- kind: "async"
1672
- })
1673
- });
1745
+ }),
1746
+ betaResponsesSend: channel({
1747
+ channelName: "beta.responses.send",
1748
+ kind: "async"
1749
+ }),
1750
+ callModel: channel({
1751
+ channelName: "callModel",
1752
+ kind: "sync-stream"
1753
+ }),
1754
+ callModelTurn: channel({
1755
+ channelName: "callModel.turn",
1756
+ kind: "async"
1757
+ }),
1758
+ toolExecute: channel({
1759
+ channelName: "tool.execute",
1760
+ kind: "async"
1761
+ })
1762
+ },
1763
+ { instrumentationName: INSTRUMENTATION_NAMES.OPENROUTER }
1764
+ );
1674
1765
 
1675
1766
  // src/auto-instrumentations/configs/openrouter.ts
1676
1767
  var openRouterConfigs = [
@@ -1678,7 +1769,7 @@ var openRouterConfigs = [
1678
1769
  channelName: openRouterChannels.chatSend.channelName,
1679
1770
  module: {
1680
1771
  name: "@openrouter/sdk",
1681
- versionRange: ">=0.9.11 <1.0.0",
1772
+ versionRange: ">=0.9.11 <2.0.0",
1682
1773
  filePath: "esm/sdk/chat.js"
1683
1774
  },
1684
1775
  functionQuery: {
@@ -1691,7 +1782,7 @@ var openRouterConfigs = [
1691
1782
  channelName: openRouterChannels.embeddingsGenerate.channelName,
1692
1783
  module: {
1693
1784
  name: "@openrouter/sdk",
1694
- versionRange: ">=0.9.11 <1.0.0",
1785
+ versionRange: ">=0.9.11 <2.0.0",
1695
1786
  filePath: "esm/sdk/embeddings.js"
1696
1787
  },
1697
1788
  functionQuery: {
@@ -1704,7 +1795,7 @@ var openRouterConfigs = [
1704
1795
  channelName: openRouterChannels.rerankRerank.channelName,
1705
1796
  module: {
1706
1797
  name: "@openrouter/sdk",
1707
- versionRange: ">=0.12.0 <1.0.0",
1798
+ versionRange: ">=0.12.0 <2.0.0",
1708
1799
  filePath: "esm/sdk/rerank.js"
1709
1800
  },
1710
1801
  functionQuery: {
@@ -1717,7 +1808,7 @@ var openRouterConfigs = [
1717
1808
  channelName: openRouterChannels.betaResponsesSend.channelName,
1718
1809
  module: {
1719
1810
  name: "@openrouter/sdk",
1720
- versionRange: ">=0.9.11 <1.0.0",
1811
+ versionRange: ">=0.9.11 <2.0.0",
1721
1812
  filePath: "esm/sdk/responses.js"
1722
1813
  },
1723
1814
  functionQuery: {
@@ -1730,7 +1821,7 @@ var openRouterConfigs = [
1730
1821
  channelName: openRouterChannels.callModel.channelName,
1731
1822
  module: {
1732
1823
  name: "@openrouter/sdk",
1733
- versionRange: ">=0.9.11 <1.0.0",
1824
+ versionRange: ">=0.9.11 <2.0.0",
1734
1825
  filePath: "esm/sdk/sdk.js"
1735
1826
  },
1736
1827
  functionQuery: {
@@ -1742,52 +1833,56 @@ var openRouterConfigs = [
1742
1833
  ];
1743
1834
 
1744
1835
  // src/instrumentation/plugins/mistral-channels.ts
1745
- var mistralChannels = defineChannels("@mistralai/mistralai", {
1746
- chatComplete: channel({
1747
- channelName: "chat.complete",
1748
- kind: "async"
1749
- }),
1750
- chatStream: channel({
1751
- channelName: "chat.stream",
1752
- kind: "async"
1753
- }),
1754
- embeddingsCreate: channel({
1755
- channelName: "embeddings.create",
1756
- kind: "async"
1757
- }),
1758
- classifiersModerate: channel({
1759
- channelName: "classifiers.moderate",
1760
- kind: "async"
1761
- }),
1762
- classifiersModerateChat: channel({
1763
- channelName: "classifiers.moderateChat",
1764
- kind: "async"
1765
- }),
1766
- classifiersClassify: channel({
1767
- channelName: "classifiers.classify",
1768
- kind: "async"
1769
- }),
1770
- classifiersClassifyChat: channel({
1771
- channelName: "classifiers.classifyChat",
1772
- kind: "async"
1773
- }),
1774
- fimComplete: channel({
1775
- channelName: "fim.complete",
1776
- kind: "async"
1777
- }),
1778
- fimStream: channel({
1779
- channelName: "fim.stream",
1780
- kind: "async"
1781
- }),
1782
- agentsComplete: channel({
1783
- channelName: "agents.complete",
1784
- kind: "async"
1785
- }),
1786
- agentsStream: channel({
1787
- channelName: "agents.stream",
1788
- kind: "async"
1789
- })
1790
- });
1836
+ var mistralChannels = defineChannels(
1837
+ "@mistralai/mistralai",
1838
+ {
1839
+ chatComplete: channel({
1840
+ channelName: "chat.complete",
1841
+ kind: "async"
1842
+ }),
1843
+ chatStream: channel({
1844
+ channelName: "chat.stream",
1845
+ kind: "async"
1846
+ }),
1847
+ embeddingsCreate: channel({
1848
+ channelName: "embeddings.create",
1849
+ kind: "async"
1850
+ }),
1851
+ classifiersModerate: channel({
1852
+ channelName: "classifiers.moderate",
1853
+ kind: "async"
1854
+ }),
1855
+ classifiersModerateChat: channel({
1856
+ channelName: "classifiers.moderateChat",
1857
+ kind: "async"
1858
+ }),
1859
+ classifiersClassify: channel({
1860
+ channelName: "classifiers.classify",
1861
+ kind: "async"
1862
+ }),
1863
+ classifiersClassifyChat: channel({
1864
+ channelName: "classifiers.classifyChat",
1865
+ kind: "async"
1866
+ }),
1867
+ fimComplete: channel({
1868
+ channelName: "fim.complete",
1869
+ kind: "async"
1870
+ }),
1871
+ fimStream: channel({
1872
+ channelName: "fim.stream",
1873
+ kind: "async"
1874
+ }),
1875
+ agentsComplete: channel({
1876
+ channelName: "agents.complete",
1877
+ kind: "async"
1878
+ }),
1879
+ agentsStream: channel({
1880
+ channelName: "agents.stream",
1881
+ kind: "async"
1882
+ })
1883
+ },
1884
+ { instrumentationName: INSTRUMENTATION_NAMES.MISTRAL }
1885
+ );
1791
1886
 
1792
1887
  // src/auto-instrumentations/configs/mistral.ts
1793
1888
  var mistralConfigs = [
@@ -2080,20 +2175,24 @@ var mistralConfigs = [
2080
2175
  ];
2081
2176
 
2082
2177
  // src/instrumentation/plugins/google-adk-channels.ts
2083
- var googleADKChannels = defineChannels("@google/adk", {
2084
- runnerRunAsync: channel({
2085
- channelName: "runner.runAsync",
2086
- kind: "sync-stream"
2087
- }),
2088
- agentRunAsync: channel({
2089
- channelName: "agent.runAsync",
2090
- kind: "sync-stream"
2091
- }),
2092
- toolRunAsync: channel({
2093
- channelName: "tool.runAsync",
2094
- kind: "async"
2095
- })
2096
- });
2178
+ var googleADKChannels = defineChannels(
2179
+ "@google/adk",
2180
+ {
2181
+ runnerRunAsync: channel({
2182
+ channelName: "runner.runAsync",
2183
+ kind: "sync-stream"
2184
+ }),
2185
+ agentRunAsync: channel({
2186
+ channelName: "agent.runAsync",
2187
+ kind: "sync-stream"
2188
+ }),
2189
+ toolRunAsync: channel({
2190
+ channelName: "tool.runAsync",
2191
+ kind: "async"
2192
+ })
2193
+ },
2194
+ { instrumentationName: INSTRUMENTATION_NAMES.GOOGLE_ADK }
2195
+ );
2097
2196
 
2098
2197
  // src/auto-instrumentations/configs/google-adk.ts
2099
2198
  var googleADKVersionRange = ">=0.1.0";
@@ -2324,24 +2423,28 @@ var googleADKConfigs = [
2324
2423
  ];
2325
2424
 
2326
2425
  // src/instrumentation/plugins/cohere-channels.ts
2327
- var cohereChannels = defineChannels("cohere-ai", {
2328
- chat: channel({
2329
- channelName: "chat",
2330
- kind: "async"
2331
- }),
2332
- chatStream: channel({
2333
- channelName: "chatStream",
2334
- kind: "async"
2335
- }),
2336
- embed: channel({
2337
- channelName: "embed",
2338
- kind: "async"
2339
- }),
2340
- rerank: channel({
2341
- channelName: "rerank",
2342
- kind: "async"
2343
- })
2344
- });
2426
+ var cohereChannels = defineChannels(
2427
+ "cohere-ai",
2428
+ {
2429
+ chat: channel({
2430
+ channelName: "chat",
2431
+ kind: "async"
2432
+ }),
2433
+ chatStream: channel({
2434
+ channelName: "chatStream",
2435
+ kind: "async"
2436
+ }),
2437
+ embed: channel({
2438
+ channelName: "embed",
2439
+ kind: "async"
2440
+ }),
2441
+ rerank: channel({
2442
+ channelName: "rerank",
2443
+ kind: "async"
2444
+ })
2445
+ },
2446
+ { instrumentationName: INSTRUMENTATION_NAMES.COHERE }
2447
+ );
2345
2448
 
2346
2449
  // src/auto-instrumentations/configs/cohere.ts
2347
2450
  var cohereConfigs = [
@@ -2608,18 +2711,20 @@ var cohereConfigs = [
2608
2711
  ];
2609
2712
 
2610
2713
  // src/instrumentation/plugins/groq-channels.ts
2611
- var groqChannels = defineChannels("groq-sdk", {
2612
- chatCompletionsCreate: channel({
2613
- channelName: "chat.completions.create",
2614
- kind: "async"
2615
- }),
2616
- embeddingsCreate: channel(
2617
- {
2714
+ var groqChannels = defineChannels(
2715
+ "groq-sdk",
2716
+ {
2717
+ chatCompletionsCreate: channel({
2718
+ channelName: "chat.completions.create",
2719
+ kind: "async"
2720
+ }),
2721
+ embeddingsCreate: channel({
2618
2722
  channelName: "embeddings.create",
2619
2723
  kind: "async"
2620
- }
2621
- )
2622
- });
2724
+ })
2725
+ },
2726
+ { instrumentationName: INSTRUMENTATION_NAMES.GROQ }
2727
+ );
2623
2728
 
2624
2729
  // src/auto-instrumentations/configs/groq.ts
2625
2730
  var groqConfigs = [
@@ -2652,38 +2757,46 @@ var groqConfigs = [
2652
2757
  ];
2653
2758
 
2654
2759
  // src/instrumentation/plugins/genkit-channels.ts
2655
- var genkitChannels = defineChannels("@genkit-ai/ai", {
2656
- generate: channel({
2657
- channelName: "generate",
2658
- kind: "async"
2659
- }),
2660
- generateStream: channel({
2661
- channelName: "generateStream",
2662
- kind: "sync-stream"
2663
- }),
2664
- embed: channel({
2665
- channelName: "embed",
2666
- kind: "async"
2667
- }),
2668
- embedMany: channel({
2669
- channelName: "embedMany",
2670
- kind: "async"
2671
- }),
2672
- actionRun: channel({
2673
- channelName: "action.run",
2674
- kind: "async"
2675
- }),
2676
- actionStream: channel({
2677
- channelName: "action.stream",
2678
- kind: "sync-stream"
2679
- })
2680
- });
2681
- var genkitCoreChannels = defineChannels("@genkit-ai/core", {
2682
- actionSpan: channel({
2683
- channelName: "action.span",
2684
- kind: "async"
2685
- })
2686
- });
2760
+ var genkitChannels = defineChannels(
2761
+ "@genkit-ai/ai",
2762
+ {
2763
+ generate: channel({
2764
+ channelName: "generate",
2765
+ kind: "async"
2766
+ }),
2767
+ generateStream: channel({
2768
+ channelName: "generateStream",
2769
+ kind: "sync-stream"
2770
+ }),
2771
+ embed: channel({
2772
+ channelName: "embed",
2773
+ kind: "async"
2774
+ }),
2775
+ embedMany: channel({
2776
+ channelName: "embedMany",
2777
+ kind: "async"
2778
+ }),
2779
+ actionRun: channel({
2780
+ channelName: "action.run",
2781
+ kind: "async"
2782
+ }),
2783
+ actionStream: channel({
2784
+ channelName: "action.stream",
2785
+ kind: "sync-stream"
2786
+ })
2787
+ },
2788
+ { instrumentationName: INSTRUMENTATION_NAMES.GENKIT }
2789
+ );
2790
+ var genkitCoreChannels = defineChannels(
2791
+ "@genkit-ai/core",
2792
+ {
2793
+ actionSpan: channel({
2794
+ channelName: "action.span",
2795
+ kind: "async"
2796
+ })
2797
+ },
2798
+ { instrumentationName: INSTRUMENTATION_NAMES.GENKIT }
2799
+ );
2687
2800
 
2688
2801
  // src/auto-instrumentations/configs/genkit.ts
2689
2802
  var genkitVersionRange = ">=1.0.0 <2.0.0";
@@ -2845,20 +2958,24 @@ var genkitConfigs = [
2845
2958
  ];
2846
2959
 
2847
2960
  // src/instrumentation/plugins/github-copilot-channels.ts
2848
- var gitHubCopilotChannels = defineChannels("@github/copilot-sdk", {
2849
- createSession: channel({
2850
- channelName: "client.createSession",
2851
- kind: "async"
2852
- }),
2853
- resumeSession: channel({
2854
- channelName: "client.resumeSession",
2855
- kind: "async"
2856
- }),
2857
- sendAndWait: channel({
2858
- channelName: "session.sendAndWait",
2859
- kind: "async"
2860
- })
2861
- });
2961
+ var gitHubCopilotChannels = defineChannels(
2962
+ "@github/copilot-sdk",
2963
+ {
2964
+ createSession: channel({
2965
+ channelName: "client.createSession",
2966
+ kind: "async"
2967
+ }),
2968
+ resumeSession: channel({
2969
+ channelName: "client.resumeSession",
2970
+ kind: "async"
2971
+ }),
2972
+ sendAndWait: channel({
2973
+ channelName: "session.sendAndWait",
2974
+ kind: "async"
2975
+ })
2976
+ },
2977
+ { instrumentationName: INSTRUMENTATION_NAMES.GITHUB_COPILOT }
2978
+ );
2862
2979
 
2863
2980
  // src/auto-instrumentations/configs/github-copilot.ts
2864
2981
  var gitHubCopilotConfigs = [
@@ -2949,16 +3066,20 @@ var gitHubCopilotConfigs = [
2949
3066
  ];
2950
3067
 
2951
3068
  // src/instrumentation/plugins/langchain-channels.ts
2952
- var langChainChannels = defineChannels("@langchain/core", {
2953
- configure: channel({
2954
- channelName: "CallbackManager.configure",
2955
- kind: "sync-stream"
2956
- }),
2957
- configureSync: channel({
2958
- channelName: "CallbackManager._configureSync",
2959
- kind: "sync-stream"
2960
- })
2961
- });
3069
+ var langChainChannels = defineChannels(
3070
+ "@langchain/core",
3071
+ {
3072
+ configure: channel({
3073
+ channelName: "CallbackManager.configure",
3074
+ kind: "sync-stream"
3075
+ }),
3076
+ configureSync: channel({
3077
+ channelName: "CallbackManager._configureSync",
3078
+ kind: "sync-stream"
3079
+ })
3080
+ },
3081
+ { instrumentationName: INSTRUMENTATION_NAMES.LANGCHAIN }
3082
+ );
2962
3083
 
2963
3084
  // src/auto-instrumentations/configs/langchain.ts
2964
3085
  var langChainCoreVersionRange = ">=0.3.42";
@@ -2993,20 +3114,24 @@ var langchainConfigs = [
2993
3114
  ];
2994
3115
 
2995
3116
  // src/instrumentation/plugins/langsmith-channels.ts
2996
- var langSmithChannels = defineChannels("langsmith", {
2997
- createRun: channel({
2998
- channelName: "Client.createRun",
2999
- kind: "async"
3000
- }),
3001
- updateRun: channel({
3002
- channelName: "Client.updateRun",
3003
- kind: "async"
3004
- }),
3005
- batchIngestRuns: channel({
3006
- channelName: "Client.batchIngestRuns",
3007
- kind: "async"
3008
- })
3009
- });
3117
+ var langSmithChannels = defineChannels(
3118
+ "langsmith",
3119
+ {
3120
+ createRun: channel({
3121
+ channelName: "Client.createRun",
3122
+ kind: "async"
3123
+ }),
3124
+ updateRun: channel({
3125
+ channelName: "Client.updateRun",
3126
+ kind: "async"
3127
+ }),
3128
+ batchIngestRuns: channel({
3129
+ channelName: "Client.batchIngestRuns",
3130
+ kind: "async"
3131
+ })
3132
+ },
3133
+ { instrumentationName: INSTRUMENTATION_NAMES.LANGSMITH }
3134
+ );
3010
3135
 
3011
3136
  // src/auto-instrumentations/configs/langsmith.ts
3012
3137
  var versionRange = ">=0.3.30 <1.0.0";
@@ -3050,11 +3175,12 @@ var piCodingAgentChannels = defineChannels(
3050
3175
  channelName: "AgentSession.prompt",
3051
3176
  kind: "async"
3052
3177
  })
3053
- }
3178
+ },
3179
+ { instrumentationName: INSTRUMENTATION_NAMES.PI_CODING_AGENT }
3054
3180
  );
3055
3181
 
3056
3182
  // src/auto-instrumentations/configs/pi-coding-agent.ts
3057
- var piCodingAgentVersionRange = ">=0.79.0 <0.80.0";
3183
+ var piCodingAgentVersionRange = ">=0.79.0 <0.82.0";
3058
3184
  var piCodingAgentConfigs = [
3059
3185
  {
3060
3186
  channelName: piCodingAgentChannels.prompt.channelName,
@@ -3074,6 +3200,7 @@ var piCodingAgentConfigs = [
3074
3200
  export {
3075
3201
  channel,
3076
3202
  defineChannels,
3203
+ INSTRUMENTATION_NAMES,
3077
3204
  openaiConfigs,
3078
3205
  openAICodexConfigs,
3079
3206
  anthropicConfigs,