braintrust 3.10.0 → 3.12.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.
- package/README.md +8 -8
- package/dev/dist/index.d.mts +51 -3
- package/dev/dist/index.d.ts +51 -3
- package/dev/dist/index.js +13138 -8915
- package/dev/dist/index.mjs +13015 -8792
- package/dist/apply-auto-instrumentation.browser.d.mts +2 -0
- package/dist/apply-auto-instrumentation.browser.d.ts +2 -0
- package/dist/apply-auto-instrumentation.browser.js +18 -0
- package/dist/apply-auto-instrumentation.browser.mjs +0 -0
- package/dist/apply-auto-instrumentation.d.mts +2 -0
- package/dist/apply-auto-instrumentation.d.ts +2 -0
- package/dist/apply-auto-instrumentation.js +2534 -0
- package/dist/apply-auto-instrumentation.mjs +2534 -0
- package/dist/auto-instrumentations/bundler/esbuild.cjs +1775 -737
- package/dist/auto-instrumentations/bundler/esbuild.d.mts +9 -5
- package/dist/auto-instrumentations/bundler/esbuild.d.ts +9 -5
- package/dist/auto-instrumentations/bundler/esbuild.mjs +10 -2
- package/dist/auto-instrumentations/bundler/next.cjs +3268 -0
- package/dist/auto-instrumentations/bundler/next.d.mts +3 -0
- package/dist/auto-instrumentations/bundler/next.d.ts +3 -0
- package/dist/auto-instrumentations/bundler/next.mjs +189 -0
- package/dist/auto-instrumentations/bundler/rollup.cjs +1775 -737
- package/dist/auto-instrumentations/bundler/rollup.d.mts +9 -5
- package/dist/auto-instrumentations/bundler/rollup.d.ts +9 -5
- package/dist/auto-instrumentations/bundler/rollup.mjs +10 -2
- package/dist/auto-instrumentations/bundler/vite.cjs +1775 -737
- package/dist/auto-instrumentations/bundler/vite.d.mts +9 -5
- package/dist/auto-instrumentations/bundler/vite.d.ts +9 -5
- package/dist/auto-instrumentations/bundler/vite.mjs +10 -2
- package/dist/auto-instrumentations/bundler/webpack-loader.cjs +1713 -690
- package/dist/auto-instrumentations/bundler/webpack-loader.d.ts +3 -3
- package/dist/auto-instrumentations/bundler/webpack.cjs +1775 -737
- package/dist/auto-instrumentations/bundler/webpack.d.mts +9 -5
- package/dist/auto-instrumentations/bundler/webpack.d.ts +9 -5
- package/dist/auto-instrumentations/bundler/webpack.mjs +6 -6
- package/dist/auto-instrumentations/{chunk-GZNXBBPU.mjs → chunk-2DPA74KK.mjs} +856 -5
- package/dist/auto-instrumentations/chunk-73BZUKVI.mjs +300 -0
- package/dist/auto-instrumentations/chunk-AFXRW7I7.mjs +18 -0
- package/dist/auto-instrumentations/{chunk-ITP7RAUY.mjs → chunk-MWZXZQUO.mjs} +23 -1
- package/dist/auto-instrumentations/hook.mjs +1912 -1125
- package/dist/auto-instrumentations/index.cjs +615 -4
- package/dist/auto-instrumentations/index.d.mts +18 -1
- package/dist/auto-instrumentations/index.d.ts +18 -1
- package/dist/auto-instrumentations/index.mjs +12 -247
- package/dist/auto-instrumentations/loader/cjs-patch.cjs +26 -1
- package/dist/auto-instrumentations/loader/cjs-patch.mjs +28 -1
- package/dist/auto-instrumentations/loader/esm-hook.mjs +35 -3
- package/dist/auto-instrumentations/plugin-D7nDswtC.d.mts +44 -0
- package/dist/auto-instrumentations/plugin-D7nDswtC.d.ts +44 -0
- package/dist/browser.d.mts +577 -287
- package/dist/browser.d.ts +577 -287
- package/dist/browser.js +10221 -5524
- package/dist/browser.mjs +10221 -5524
- package/dist/chunk-BW4DF4CY.js +816 -0
- package/dist/chunk-MSLBGITU.mjs +816 -0
- package/dist/cli.js +13143 -8892
- package/dist/edge-light.d.mts +1 -1
- package/dist/edge-light.d.ts +1 -1
- package/dist/edge-light.js +10221 -5524
- package/dist/edge-light.mjs +10221 -5524
- package/dist/index.d.mts +590 -300
- package/dist/index.d.ts +590 -300
- package/dist/index.js +9309 -5371
- package/dist/index.mjs +10340 -6402
- package/dist/instrumentation/index.d.mts +7863 -39
- package/dist/instrumentation/index.d.ts +7863 -39
- package/dist/instrumentation/index.js +10263 -6034
- package/dist/instrumentation/index.mjs +10262 -6034
- package/dist/workerd.d.mts +1 -1
- package/dist/workerd.d.ts +1 -1
- package/dist/workerd.js +10221 -5524
- package/dist/workerd.mjs +10221 -5524
- package/package.json +33 -19
- package/util/dist/index.js +6 -0
- package/util/dist/index.mjs +6 -0
- package/dist/auto-instrumentations/chunk-XWEQQOQH.mjs +0 -106
- package/dist/auto-instrumentations/plugin-Df3qKIl2.d.mts +0 -22
- package/dist/auto-instrumentations/plugin-Df3qKIl2.d.ts +0 -22
|
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/auto-instrumentations/bundler/esbuild.ts
|
|
31
31
|
var esbuild_exports = {};
|
|
32
32
|
__export(esbuild_exports, {
|
|
33
|
+
braintrustEsbuildPlugin: () => braintrustEsbuildPlugin,
|
|
33
34
|
esbuildPlugin: () => esbuildPlugin
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(esbuild_exports);
|
|
@@ -42,6 +43,69 @@ var import_fs = require("fs");
|
|
|
42
43
|
var import_url = require("url");
|
|
43
44
|
var import_module_details_from_path = __toESM(require("module-details-from-path"));
|
|
44
45
|
|
|
46
|
+
// src/instrumentation/config.ts
|
|
47
|
+
var envIntegrationAliases = {
|
|
48
|
+
openai: "openai",
|
|
49
|
+
"openai-codex": "openaiCodexSDK",
|
|
50
|
+
"openai-codex-sdk": "openaiCodexSDK",
|
|
51
|
+
openaicodexsdk: "openaiCodexSDK",
|
|
52
|
+
codex: "openaiCodexSDK",
|
|
53
|
+
"codex-sdk": "openaiCodexSDK",
|
|
54
|
+
anthropic: "anthropic",
|
|
55
|
+
aisdk: "aisdk",
|
|
56
|
+
"ai-sdk": "aisdk",
|
|
57
|
+
"vercel-ai": "aisdk",
|
|
58
|
+
vercel: "vercel",
|
|
59
|
+
claudeagentsdk: "claudeAgentSDK",
|
|
60
|
+
"claude-agent-sdk": "claudeAgentSDK",
|
|
61
|
+
cursor: "cursor",
|
|
62
|
+
"cursor-sdk": "cursorSDK",
|
|
63
|
+
cursorsdk: "cursorSDK",
|
|
64
|
+
flue: "flue",
|
|
65
|
+
"flue-runtime": "flue",
|
|
66
|
+
"openai-agents": "openAIAgents",
|
|
67
|
+
openaiagents: "openAIAgents",
|
|
68
|
+
"openai-agents-core": "openAIAgents",
|
|
69
|
+
openaiagentscore: "openAIAgents",
|
|
70
|
+
google: "google",
|
|
71
|
+
"google-genai": "googleGenAI",
|
|
72
|
+
googlegenai: "googleGenAI",
|
|
73
|
+
huggingface: "huggingface",
|
|
74
|
+
openrouter: "openrouter",
|
|
75
|
+
openrouteragent: "openrouterAgent",
|
|
76
|
+
"openrouter-agent": "openrouterAgent",
|
|
77
|
+
mistral: "mistral",
|
|
78
|
+
googleadk: "googleADK",
|
|
79
|
+
"google-adk": "googleADK",
|
|
80
|
+
cohere: "cohere",
|
|
81
|
+
groq: "groq",
|
|
82
|
+
"groq-sdk": "groq",
|
|
83
|
+
genkit: "genkit",
|
|
84
|
+
"firebase-genkit": "genkit",
|
|
85
|
+
githubcopilot: "gitHubCopilot",
|
|
86
|
+
"github-copilot": "gitHubCopilot",
|
|
87
|
+
"copilot-sdk": "gitHubCopilot",
|
|
88
|
+
langchain: "langchain",
|
|
89
|
+
"langchain-js": "langchain",
|
|
90
|
+
"@langchain": "langchain",
|
|
91
|
+
langgraph: "langgraph"
|
|
92
|
+
};
|
|
93
|
+
function readDisabledInstrumentationEnvConfig(disabledList) {
|
|
94
|
+
const integrations = {};
|
|
95
|
+
if (disabledList) {
|
|
96
|
+
for (const value of disabledList.split(",")) {
|
|
97
|
+
const sdk = value.trim().toLowerCase();
|
|
98
|
+
if (sdk.length > 0) {
|
|
99
|
+
integrations[envIntegrationAliases[sdk] ?? sdk] = false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return { integrations };
|
|
104
|
+
}
|
|
105
|
+
function isInstrumentationIntegrationDisabled(integrations, ...names) {
|
|
106
|
+
return names.some((name) => integrations?.[name] === false);
|
|
107
|
+
}
|
|
108
|
+
|
|
45
109
|
// src/isomorph.ts
|
|
46
110
|
var DefaultAsyncLocalStorage = class {
|
|
47
111
|
constructor() {
|
|
@@ -185,231 +249,419 @@ function defineChannels(pkg, channels) {
|
|
|
185
249
|
);
|
|
186
250
|
}
|
|
187
251
|
|
|
188
|
-
// src/instrumentation/plugins/
|
|
189
|
-
var
|
|
190
|
-
|
|
191
|
-
channelName: "
|
|
252
|
+
// src/instrumentation/plugins/ai-sdk-channels.ts
|
|
253
|
+
var aiSDKChannels = defineChannels("ai", {
|
|
254
|
+
generateText: channel({
|
|
255
|
+
channelName: "generateText",
|
|
192
256
|
kind: "async"
|
|
193
257
|
}),
|
|
194
|
-
|
|
195
|
-
channelName: "
|
|
258
|
+
streamText: channel({
|
|
259
|
+
channelName: "streamText",
|
|
196
260
|
kind: "async"
|
|
197
261
|
}),
|
|
198
|
-
|
|
199
|
-
channelName: "
|
|
262
|
+
streamTextSync: channel({
|
|
263
|
+
channelName: "streamText.sync",
|
|
264
|
+
kind: "sync-stream"
|
|
265
|
+
}),
|
|
266
|
+
generateObject: channel({
|
|
267
|
+
channelName: "generateObject",
|
|
200
268
|
kind: "async"
|
|
201
269
|
}),
|
|
202
|
-
|
|
203
|
-
channelName: "
|
|
270
|
+
streamObject: channel({
|
|
271
|
+
channelName: "streamObject",
|
|
272
|
+
kind: "async"
|
|
273
|
+
}),
|
|
274
|
+
streamObjectSync: channel({
|
|
275
|
+
channelName: "streamObject.sync",
|
|
204
276
|
kind: "sync-stream"
|
|
205
277
|
}),
|
|
206
|
-
|
|
207
|
-
|
|
278
|
+
embed: channel(
|
|
279
|
+
{
|
|
280
|
+
channelName: "embed",
|
|
281
|
+
kind: "async"
|
|
282
|
+
}
|
|
283
|
+
),
|
|
284
|
+
embedMany: channel({
|
|
285
|
+
channelName: "embedMany",
|
|
208
286
|
kind: "async"
|
|
209
287
|
}),
|
|
210
|
-
|
|
211
|
-
channelName: "
|
|
288
|
+
rerank: channel({
|
|
289
|
+
channelName: "rerank",
|
|
212
290
|
kind: "async"
|
|
213
291
|
}),
|
|
214
|
-
|
|
215
|
-
channelName: "
|
|
292
|
+
agentGenerate: channel({
|
|
293
|
+
channelName: "Agent.generate",
|
|
294
|
+
kind: "async"
|
|
295
|
+
}),
|
|
296
|
+
agentStream: channel({
|
|
297
|
+
channelName: "Agent.stream",
|
|
298
|
+
kind: "async"
|
|
299
|
+
}),
|
|
300
|
+
agentStreamSync: channel({
|
|
301
|
+
channelName: "Agent.stream.sync",
|
|
216
302
|
kind: "sync-stream"
|
|
217
303
|
}),
|
|
218
|
-
|
|
219
|
-
channelName: "
|
|
304
|
+
toolLoopAgentGenerate: channel({
|
|
305
|
+
channelName: "ToolLoopAgent.generate",
|
|
220
306
|
kind: "async"
|
|
221
307
|
}),
|
|
222
|
-
|
|
223
|
-
channelName: "
|
|
308
|
+
toolLoopAgentStream: channel({
|
|
309
|
+
channelName: "ToolLoopAgent.stream",
|
|
224
310
|
kind: "async"
|
|
225
311
|
})
|
|
226
312
|
});
|
|
227
313
|
|
|
228
|
-
// src/auto-instrumentations/configs/
|
|
229
|
-
var
|
|
230
|
-
//
|
|
314
|
+
// src/auto-instrumentations/configs/ai-sdk.ts
|
|
315
|
+
var aiSDKConfigs = [
|
|
316
|
+
// generateText - async function
|
|
231
317
|
{
|
|
232
|
-
channelName:
|
|
318
|
+
channelName: aiSDKChannels.generateText.channelName,
|
|
233
319
|
module: {
|
|
234
|
-
name: "
|
|
235
|
-
versionRange: ">=
|
|
236
|
-
filePath: "
|
|
320
|
+
name: "ai",
|
|
321
|
+
versionRange: ">=3.0.0",
|
|
322
|
+
filePath: "dist/index.mjs"
|
|
237
323
|
},
|
|
238
324
|
functionQuery: {
|
|
239
|
-
|
|
240
|
-
methodName: "create",
|
|
325
|
+
functionName: "generateText",
|
|
241
326
|
kind: "Async"
|
|
242
327
|
}
|
|
243
328
|
},
|
|
244
329
|
{
|
|
245
|
-
channelName:
|
|
330
|
+
channelName: aiSDKChannels.generateText.channelName,
|
|
246
331
|
module: {
|
|
247
|
-
name: "
|
|
248
|
-
versionRange: ">=
|
|
249
|
-
filePath: "
|
|
332
|
+
name: "ai",
|
|
333
|
+
versionRange: ">=3.0.0",
|
|
334
|
+
filePath: "dist/index.js"
|
|
250
335
|
},
|
|
251
336
|
functionQuery: {
|
|
252
|
-
|
|
253
|
-
methodName: "create",
|
|
337
|
+
functionName: "generateText",
|
|
254
338
|
kind: "Async"
|
|
255
339
|
}
|
|
256
340
|
},
|
|
341
|
+
// streamText - async function (v3 only, before the sync refactor in v4)
|
|
257
342
|
{
|
|
258
|
-
channelName:
|
|
343
|
+
channelName: aiSDKChannels.streamText.channelName,
|
|
259
344
|
module: {
|
|
260
|
-
name: "
|
|
261
|
-
versionRange: ">=
|
|
262
|
-
filePath: "
|
|
345
|
+
name: "ai",
|
|
346
|
+
versionRange: ">=3.0.0 <4.0.0",
|
|
347
|
+
filePath: "dist/index.mjs"
|
|
263
348
|
},
|
|
264
349
|
functionQuery: {
|
|
265
|
-
|
|
266
|
-
methodName: "create",
|
|
350
|
+
functionName: "streamText",
|
|
267
351
|
kind: "Async"
|
|
268
352
|
}
|
|
269
353
|
},
|
|
270
|
-
//
|
|
354
|
+
// streamText - sync function returning stream (v4+)
|
|
271
355
|
{
|
|
272
|
-
channelName:
|
|
356
|
+
channelName: aiSDKChannels.streamTextSync.channelName,
|
|
273
357
|
module: {
|
|
274
|
-
name: "
|
|
358
|
+
name: "ai",
|
|
275
359
|
versionRange: ">=4.0.0",
|
|
276
|
-
filePath: "
|
|
360
|
+
filePath: "dist/index.mjs"
|
|
277
361
|
},
|
|
278
362
|
functionQuery: {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
kind: "Async"
|
|
363
|
+
functionName: "streamText",
|
|
364
|
+
kind: "Sync"
|
|
282
365
|
}
|
|
283
366
|
},
|
|
284
|
-
// Beta Chat Completions Parse
|
|
285
367
|
{
|
|
286
|
-
channelName:
|
|
368
|
+
channelName: aiSDKChannels.streamText.channelName,
|
|
287
369
|
module: {
|
|
288
|
-
name: "
|
|
289
|
-
versionRange: ">=
|
|
290
|
-
filePath: "
|
|
370
|
+
name: "ai",
|
|
371
|
+
versionRange: ">=3.0.0 <4.0.0",
|
|
372
|
+
filePath: "dist/index.js"
|
|
291
373
|
},
|
|
292
374
|
functionQuery: {
|
|
293
|
-
|
|
294
|
-
methodName: "parse",
|
|
375
|
+
functionName: "streamText",
|
|
295
376
|
kind: "Async"
|
|
296
377
|
}
|
|
297
378
|
},
|
|
298
379
|
{
|
|
299
|
-
channelName:
|
|
380
|
+
channelName: aiSDKChannels.streamTextSync.channelName,
|
|
300
381
|
module: {
|
|
301
|
-
name: "
|
|
302
|
-
versionRange: ">=
|
|
303
|
-
filePath: "
|
|
382
|
+
name: "ai",
|
|
383
|
+
versionRange: ">=4.0.0",
|
|
384
|
+
filePath: "dist/index.js"
|
|
304
385
|
},
|
|
305
386
|
functionQuery: {
|
|
306
|
-
|
|
307
|
-
|
|
387
|
+
functionName: "streamText",
|
|
388
|
+
kind: "Sync"
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
// generateObject - async function
|
|
392
|
+
{
|
|
393
|
+
channelName: aiSDKChannels.generateObject.channelName,
|
|
394
|
+
module: {
|
|
395
|
+
name: "ai",
|
|
396
|
+
versionRange: ">=3.0.0",
|
|
397
|
+
filePath: "dist/index.mjs"
|
|
398
|
+
},
|
|
399
|
+
functionQuery: {
|
|
400
|
+
functionName: "generateObject",
|
|
308
401
|
kind: "Async"
|
|
309
402
|
}
|
|
310
403
|
},
|
|
311
|
-
// Moderations
|
|
312
404
|
{
|
|
313
|
-
channelName:
|
|
405
|
+
channelName: aiSDKChannels.generateObject.channelName,
|
|
314
406
|
module: {
|
|
315
|
-
name: "
|
|
316
|
-
versionRange: ">=
|
|
317
|
-
filePath: "
|
|
407
|
+
name: "ai",
|
|
408
|
+
versionRange: ">=3.0.0",
|
|
409
|
+
filePath: "dist/index.js"
|
|
318
410
|
},
|
|
319
411
|
functionQuery: {
|
|
320
|
-
|
|
321
|
-
methodName: "create",
|
|
412
|
+
functionName: "generateObject",
|
|
322
413
|
kind: "Async"
|
|
323
414
|
}
|
|
324
415
|
},
|
|
325
|
-
//
|
|
416
|
+
// embed - async function
|
|
326
417
|
{
|
|
327
|
-
channelName:
|
|
418
|
+
channelName: aiSDKChannels.embed.channelName,
|
|
328
419
|
module: {
|
|
329
|
-
name: "
|
|
330
|
-
versionRange: ">=
|
|
331
|
-
filePath: "
|
|
420
|
+
name: "ai",
|
|
421
|
+
versionRange: ">=3.0.0",
|
|
422
|
+
filePath: "dist/index.mjs"
|
|
332
423
|
},
|
|
333
424
|
functionQuery: {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
kind: "Sync"
|
|
425
|
+
functionName: "embed",
|
|
426
|
+
kind: "Async"
|
|
337
427
|
}
|
|
338
428
|
},
|
|
339
429
|
{
|
|
340
|
-
channelName:
|
|
430
|
+
channelName: aiSDKChannels.embed.channelName,
|
|
341
431
|
module: {
|
|
342
|
-
name: "
|
|
343
|
-
versionRange: ">=
|
|
344
|
-
filePath: "
|
|
432
|
+
name: "ai",
|
|
433
|
+
versionRange: ">=3.0.0",
|
|
434
|
+
filePath: "dist/index.js"
|
|
345
435
|
},
|
|
346
436
|
functionQuery: {
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
kind: "Sync"
|
|
437
|
+
functionName: "embed",
|
|
438
|
+
kind: "Async"
|
|
350
439
|
}
|
|
351
440
|
},
|
|
352
|
-
//
|
|
441
|
+
// embedMany - async function
|
|
353
442
|
{
|
|
354
|
-
channelName:
|
|
443
|
+
channelName: aiSDKChannels.embedMany.channelName,
|
|
355
444
|
module: {
|
|
356
|
-
name: "
|
|
357
|
-
versionRange: ">=
|
|
358
|
-
filePath: "
|
|
445
|
+
name: "ai",
|
|
446
|
+
versionRange: ">=3.0.0",
|
|
447
|
+
filePath: "dist/index.mjs"
|
|
359
448
|
},
|
|
360
449
|
functionQuery: {
|
|
361
|
-
|
|
362
|
-
methodName: "create",
|
|
450
|
+
functionName: "embedMany",
|
|
363
451
|
kind: "Async"
|
|
364
452
|
}
|
|
365
453
|
},
|
|
366
454
|
{
|
|
367
|
-
channelName:
|
|
455
|
+
channelName: aiSDKChannels.embedMany.channelName,
|
|
368
456
|
module: {
|
|
369
|
-
name: "
|
|
370
|
-
versionRange: ">=
|
|
371
|
-
filePath: "
|
|
457
|
+
name: "ai",
|
|
458
|
+
versionRange: ">=3.0.0",
|
|
459
|
+
filePath: "dist/index.js"
|
|
372
460
|
},
|
|
373
461
|
functionQuery: {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
kind: "Sync"
|
|
462
|
+
functionName: "embedMany",
|
|
463
|
+
kind: "Async"
|
|
377
464
|
}
|
|
378
465
|
},
|
|
466
|
+
// rerank - async function
|
|
379
467
|
{
|
|
380
|
-
channelName:
|
|
468
|
+
channelName: aiSDKChannels.rerank.channelName,
|
|
381
469
|
module: {
|
|
382
|
-
name: "
|
|
383
|
-
versionRange: ">=
|
|
384
|
-
filePath: "
|
|
470
|
+
name: "ai",
|
|
471
|
+
versionRange: ">=5.0.0",
|
|
472
|
+
filePath: "dist/index.mjs"
|
|
385
473
|
},
|
|
386
474
|
functionQuery: {
|
|
387
|
-
|
|
388
|
-
methodName: "parse",
|
|
475
|
+
functionName: "rerank",
|
|
389
476
|
kind: "Async"
|
|
390
477
|
}
|
|
391
478
|
},
|
|
392
479
|
{
|
|
393
|
-
channelName:
|
|
480
|
+
channelName: aiSDKChannels.rerank.channelName,
|
|
394
481
|
module: {
|
|
395
|
-
name: "
|
|
396
|
-
versionRange: ">=
|
|
397
|
-
filePath: "
|
|
482
|
+
name: "ai",
|
|
483
|
+
versionRange: ">=5.0.0",
|
|
484
|
+
filePath: "dist/index.js"
|
|
398
485
|
},
|
|
399
486
|
functionQuery: {
|
|
400
|
-
|
|
401
|
-
methodName: "compact",
|
|
487
|
+
functionName: "rerank",
|
|
402
488
|
kind: "Async"
|
|
403
489
|
}
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
490
|
+
},
|
|
491
|
+
// streamObject - async function (v3 only, before the sync refactor in v4)
|
|
492
|
+
{
|
|
493
|
+
channelName: aiSDKChannels.streamObject.channelName,
|
|
494
|
+
module: {
|
|
495
|
+
name: "ai",
|
|
496
|
+
versionRange: ">=3.0.0 <4.0.0",
|
|
497
|
+
filePath: "dist/index.mjs"
|
|
498
|
+
},
|
|
499
|
+
functionQuery: {
|
|
500
|
+
functionName: "streamObject",
|
|
501
|
+
kind: "Async"
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
// streamObject - sync function returning stream (v4+)
|
|
505
|
+
{
|
|
506
|
+
channelName: aiSDKChannels.streamObjectSync.channelName,
|
|
507
|
+
module: {
|
|
508
|
+
name: "ai",
|
|
509
|
+
versionRange: ">=4.0.0",
|
|
510
|
+
filePath: "dist/index.mjs"
|
|
511
|
+
},
|
|
512
|
+
functionQuery: {
|
|
513
|
+
functionName: "streamObject",
|
|
514
|
+
kind: "Sync"
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
channelName: aiSDKChannels.streamObject.channelName,
|
|
519
|
+
module: {
|
|
520
|
+
name: "ai",
|
|
521
|
+
versionRange: ">=3.0.0 <4.0.0",
|
|
522
|
+
filePath: "dist/index.js"
|
|
523
|
+
},
|
|
524
|
+
functionQuery: {
|
|
525
|
+
functionName: "streamObject",
|
|
526
|
+
kind: "Async"
|
|
527
|
+
}
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
channelName: aiSDKChannels.streamObjectSync.channelName,
|
|
531
|
+
module: {
|
|
532
|
+
name: "ai",
|
|
533
|
+
versionRange: ">=4.0.0",
|
|
534
|
+
filePath: "dist/index.js"
|
|
535
|
+
},
|
|
536
|
+
functionQuery: {
|
|
537
|
+
functionName: "streamObject",
|
|
538
|
+
kind: "Sync"
|
|
539
|
+
}
|
|
540
|
+
},
|
|
541
|
+
// Agent.generate - async method (v5 only)
|
|
542
|
+
// The compiled AI SDK bundle emits this as an anonymous class method, so we
|
|
543
|
+
// target the first async `generate` method in the file instead of a class name.
|
|
544
|
+
{
|
|
545
|
+
channelName: aiSDKChannels.agentGenerate.channelName,
|
|
546
|
+
module: {
|
|
547
|
+
name: "ai",
|
|
548
|
+
versionRange: ">=5.0.0 <6.0.0",
|
|
549
|
+
filePath: "dist/index.mjs"
|
|
550
|
+
},
|
|
551
|
+
functionQuery: {
|
|
552
|
+
methodName: "generate",
|
|
553
|
+
kind: "Async",
|
|
554
|
+
index: 0
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
channelName: aiSDKChannels.agentGenerate.channelName,
|
|
559
|
+
module: {
|
|
560
|
+
name: "ai",
|
|
561
|
+
versionRange: ">=5.0.0 <6.0.0",
|
|
562
|
+
filePath: "dist/index.js"
|
|
563
|
+
},
|
|
564
|
+
functionQuery: {
|
|
565
|
+
methodName: "generate",
|
|
566
|
+
kind: "Async",
|
|
567
|
+
index: 0
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
// Agent.stream - sync method (v5 only)
|
|
571
|
+
// The compiled AI SDK bundle emits this as an anonymous class method, so we
|
|
572
|
+
// target the first sync `stream` method in the file instead of a class name.
|
|
573
|
+
{
|
|
574
|
+
channelName: aiSDKChannels.agentStreamSync.channelName,
|
|
575
|
+
module: {
|
|
576
|
+
name: "ai",
|
|
577
|
+
versionRange: ">=5.0.0 <6.0.0",
|
|
578
|
+
filePath: "dist/index.mjs"
|
|
579
|
+
},
|
|
580
|
+
functionQuery: {
|
|
581
|
+
methodName: "stream",
|
|
582
|
+
kind: "Sync",
|
|
583
|
+
index: 0
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
{
|
|
587
|
+
channelName: aiSDKChannels.agentStreamSync.channelName,
|
|
588
|
+
module: {
|
|
589
|
+
name: "ai",
|
|
590
|
+
versionRange: ">=5.0.0 <6.0.0",
|
|
591
|
+
filePath: "dist/index.js"
|
|
592
|
+
},
|
|
593
|
+
functionQuery: {
|
|
594
|
+
methodName: "stream",
|
|
595
|
+
kind: "Sync",
|
|
596
|
+
index: 0
|
|
597
|
+
}
|
|
598
|
+
},
|
|
599
|
+
// ToolLoopAgent.generate - async method (v6 only, Experimental_Agent is an alias)
|
|
600
|
+
// The compiled AI SDK bundle emits this as an anonymous class method, so we
|
|
601
|
+
// target the first async `generate` method in the file instead of a class name.
|
|
602
|
+
{
|
|
603
|
+
channelName: aiSDKChannels.toolLoopAgentGenerate.channelName,
|
|
604
|
+
module: {
|
|
605
|
+
name: "ai",
|
|
606
|
+
versionRange: ">=6.0.0 <7.0.0",
|
|
607
|
+
filePath: "dist/index.mjs"
|
|
608
|
+
},
|
|
609
|
+
functionQuery: {
|
|
610
|
+
methodName: "generate",
|
|
611
|
+
kind: "Async",
|
|
612
|
+
index: 0
|
|
613
|
+
}
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
channelName: aiSDKChannels.toolLoopAgentGenerate.channelName,
|
|
617
|
+
module: {
|
|
618
|
+
name: "ai",
|
|
619
|
+
versionRange: ">=6.0.0 <7.0.0",
|
|
620
|
+
filePath: "dist/index.js"
|
|
621
|
+
},
|
|
622
|
+
functionQuery: {
|
|
623
|
+
methodName: "generate",
|
|
624
|
+
kind: "Async",
|
|
625
|
+
index: 0
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
// ToolLoopAgent.stream - async method (v6 only, Experimental_Agent is an alias)
|
|
629
|
+
// The compiled AI SDK bundle emits this as an anonymous class method, so we
|
|
630
|
+
// target the first async `stream` method in the file instead of a class name.
|
|
631
|
+
{
|
|
632
|
+
channelName: aiSDKChannels.toolLoopAgentStream.channelName,
|
|
633
|
+
module: {
|
|
634
|
+
name: "ai",
|
|
635
|
+
versionRange: ">=6.0.0 <7.0.0",
|
|
636
|
+
filePath: "dist/index.mjs"
|
|
637
|
+
},
|
|
638
|
+
functionQuery: {
|
|
639
|
+
methodName: "stream",
|
|
640
|
+
kind: "Async",
|
|
641
|
+
index: 0
|
|
642
|
+
}
|
|
643
|
+
},
|
|
644
|
+
{
|
|
645
|
+
channelName: aiSDKChannels.toolLoopAgentStream.channelName,
|
|
646
|
+
module: {
|
|
647
|
+
name: "ai",
|
|
648
|
+
versionRange: ">=6.0.0 <7.0.0",
|
|
649
|
+
filePath: "dist/index.js"
|
|
650
|
+
},
|
|
651
|
+
functionQuery: {
|
|
652
|
+
methodName: "stream",
|
|
653
|
+
kind: "Async",
|
|
654
|
+
index: 0
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
];
|
|
658
|
+
|
|
659
|
+
// src/instrumentation/plugins/anthropic-channels.ts
|
|
660
|
+
var anthropicChannels = defineChannels("@anthropic-ai/sdk", {
|
|
661
|
+
messagesCreate: channel({
|
|
662
|
+
channelName: "messages.create",
|
|
663
|
+
kind: "async"
|
|
664
|
+
}),
|
|
413
665
|
betaMessagesCreate: channel({
|
|
414
666
|
channelName: "beta.messages.create",
|
|
415
667
|
kind: "async"
|
|
@@ -480,519 +732,999 @@ var anthropicConfigs = [
|
|
|
480
732
|
}
|
|
481
733
|
];
|
|
482
734
|
|
|
483
|
-
// src/instrumentation/plugins/
|
|
484
|
-
var
|
|
485
|
-
|
|
486
|
-
|
|
735
|
+
// src/instrumentation/plugins/claude-agent-sdk-channels.ts
|
|
736
|
+
var claudeAgentSDKChannels = defineChannels(
|
|
737
|
+
"@anthropic-ai/claude-agent-sdk",
|
|
738
|
+
{
|
|
739
|
+
query: channel({
|
|
740
|
+
channelName: "query",
|
|
741
|
+
kind: "sync-stream"
|
|
742
|
+
})
|
|
743
|
+
}
|
|
744
|
+
);
|
|
745
|
+
|
|
746
|
+
// src/auto-instrumentations/configs/claude-agent-sdk.ts
|
|
747
|
+
var claudeAgentSDKConfigs = [
|
|
748
|
+
// query - Main entry point for agent interactions. The SDK returns an async
|
|
749
|
+
// iterable, but the exported query function itself is synchronous.
|
|
750
|
+
{
|
|
751
|
+
channelName: claudeAgentSDKChannels.query.channelName,
|
|
752
|
+
module: {
|
|
753
|
+
name: "@anthropic-ai/claude-agent-sdk",
|
|
754
|
+
versionRange: ">=0.1.0 <0.2.0",
|
|
755
|
+
filePath: "sdk.mjs"
|
|
756
|
+
},
|
|
757
|
+
functionQuery: {
|
|
758
|
+
functionName: "query",
|
|
759
|
+
kind: "Sync"
|
|
760
|
+
}
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
channelName: claudeAgentSDKChannels.query.channelName,
|
|
764
|
+
module: {
|
|
765
|
+
name: "@anthropic-ai/claude-agent-sdk",
|
|
766
|
+
versionRange: ">=0.2.0",
|
|
767
|
+
filePath: "sdk.mjs"
|
|
768
|
+
},
|
|
769
|
+
functionQuery: {
|
|
770
|
+
functionName: "query",
|
|
771
|
+
kind: "Sync",
|
|
772
|
+
isExportAlias: true
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
];
|
|
776
|
+
|
|
777
|
+
// src/instrumentation/plugins/cohere-channels.ts
|
|
778
|
+
var cohereChannels = defineChannels("cohere-ai", {
|
|
779
|
+
chat: channel({
|
|
780
|
+
channelName: "chat",
|
|
487
781
|
kind: "async"
|
|
488
782
|
}),
|
|
489
|
-
|
|
490
|
-
channelName: "
|
|
783
|
+
chatStream: channel({
|
|
784
|
+
channelName: "chatStream",
|
|
491
785
|
kind: "async"
|
|
492
786
|
}),
|
|
493
|
-
|
|
494
|
-
channelName: "
|
|
495
|
-
kind: "sync-stream"
|
|
496
|
-
}),
|
|
497
|
-
generateObject: channel({
|
|
498
|
-
channelName: "generateObject",
|
|
787
|
+
embed: channel({
|
|
788
|
+
channelName: "embed",
|
|
499
789
|
kind: "async"
|
|
500
790
|
}),
|
|
501
|
-
|
|
502
|
-
channelName: "
|
|
791
|
+
rerank: channel({
|
|
792
|
+
channelName: "rerank",
|
|
503
793
|
kind: "async"
|
|
504
|
-
})
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
794
|
+
})
|
|
795
|
+
});
|
|
796
|
+
|
|
797
|
+
// src/auto-instrumentations/configs/cohere.ts
|
|
798
|
+
var cohereConfigs = [
|
|
799
|
+
{
|
|
800
|
+
channelName: cohereChannels.chat.channelName,
|
|
801
|
+
module: {
|
|
802
|
+
name: "cohere-ai",
|
|
803
|
+
versionRange: ">=7.0.0 <8.0.0",
|
|
804
|
+
filePath: "Client.js"
|
|
805
|
+
},
|
|
806
|
+
functionQuery: {
|
|
807
|
+
className: "CohereClient",
|
|
808
|
+
methodName: "chat",
|
|
809
|
+
kind: "Async"
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
channelName: cohereChannels.chat.channelName,
|
|
814
|
+
module: {
|
|
815
|
+
name: "cohere-ai",
|
|
816
|
+
versionRange: ">=7.0.0 <7.21.0",
|
|
817
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
818
|
+
},
|
|
819
|
+
functionQuery: {
|
|
820
|
+
className: "V2",
|
|
821
|
+
methodName: "chat",
|
|
822
|
+
kind: "Async"
|
|
823
|
+
}
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
channelName: cohereChannels.chat.channelName,
|
|
827
|
+
module: {
|
|
828
|
+
name: "cohere-ai",
|
|
829
|
+
versionRange: ">=7.21.0 <8.0.0",
|
|
830
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
831
|
+
},
|
|
832
|
+
functionQuery: {
|
|
833
|
+
className: "V2Client",
|
|
834
|
+
methodName: "chat",
|
|
835
|
+
kind: "Async"
|
|
836
|
+
}
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
channelName: cohereChannels.chat.channelName,
|
|
840
|
+
module: {
|
|
841
|
+
name: "cohere-ai",
|
|
842
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
843
|
+
filePath: "Client.js"
|
|
844
|
+
},
|
|
845
|
+
functionQuery: {
|
|
846
|
+
className: "CohereClient",
|
|
847
|
+
methodName: "chat",
|
|
848
|
+
kind: "Async"
|
|
849
|
+
}
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
channelName: cohereChannels.chat.channelName,
|
|
853
|
+
module: {
|
|
854
|
+
name: "cohere-ai",
|
|
855
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
856
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
857
|
+
},
|
|
858
|
+
functionQuery: {
|
|
859
|
+
className: "V2Client",
|
|
860
|
+
methodName: "chat",
|
|
861
|
+
kind: "Async"
|
|
862
|
+
}
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
channelName: cohereChannels.chatStream.channelName,
|
|
866
|
+
module: {
|
|
867
|
+
name: "cohere-ai",
|
|
868
|
+
versionRange: ">=7.0.0 <8.0.0",
|
|
869
|
+
filePath: "Client.js"
|
|
870
|
+
},
|
|
871
|
+
functionQuery: {
|
|
872
|
+
className: "CohereClient",
|
|
873
|
+
methodName: "chatStream",
|
|
874
|
+
kind: "Async"
|
|
875
|
+
}
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
channelName: cohereChannels.chatStream.channelName,
|
|
879
|
+
module: {
|
|
880
|
+
name: "cohere-ai",
|
|
881
|
+
versionRange: ">=7.0.0 <7.21.0",
|
|
882
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
883
|
+
},
|
|
884
|
+
functionQuery: {
|
|
885
|
+
className: "V2",
|
|
886
|
+
methodName: "chatStream",
|
|
887
|
+
kind: "Async"
|
|
888
|
+
}
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
channelName: cohereChannels.chatStream.channelName,
|
|
892
|
+
module: {
|
|
893
|
+
name: "cohere-ai",
|
|
894
|
+
versionRange: ">=7.21.0 <8.0.0",
|
|
895
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
896
|
+
},
|
|
897
|
+
functionQuery: {
|
|
898
|
+
className: "V2Client",
|
|
899
|
+
methodName: "chatStream",
|
|
900
|
+
kind: "Async"
|
|
901
|
+
}
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
channelName: cohereChannels.chatStream.channelName,
|
|
905
|
+
module: {
|
|
906
|
+
name: "cohere-ai",
|
|
907
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
908
|
+
filePath: "Client.js"
|
|
909
|
+
},
|
|
910
|
+
functionQuery: {
|
|
911
|
+
className: "CohereClient",
|
|
912
|
+
methodName: "chatStream",
|
|
913
|
+
kind: "Async"
|
|
914
|
+
}
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
channelName: cohereChannels.chatStream.channelName,
|
|
918
|
+
module: {
|
|
919
|
+
name: "cohere-ai",
|
|
920
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
921
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
922
|
+
},
|
|
923
|
+
functionQuery: {
|
|
924
|
+
className: "V2Client",
|
|
925
|
+
methodName: "chatStream",
|
|
926
|
+
kind: "Async"
|
|
927
|
+
}
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
channelName: cohereChannels.embed.channelName,
|
|
931
|
+
module: {
|
|
932
|
+
name: "cohere-ai",
|
|
933
|
+
versionRange: ">=7.0.0 <8.0.0",
|
|
934
|
+
filePath: "Client.js"
|
|
935
|
+
},
|
|
936
|
+
functionQuery: {
|
|
937
|
+
className: "CohereClient",
|
|
938
|
+
methodName: "embed",
|
|
939
|
+
kind: "Async"
|
|
940
|
+
}
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
channelName: cohereChannels.embed.channelName,
|
|
944
|
+
module: {
|
|
945
|
+
name: "cohere-ai",
|
|
946
|
+
versionRange: ">=7.0.0 <7.21.0",
|
|
947
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
948
|
+
},
|
|
949
|
+
functionQuery: {
|
|
950
|
+
className: "V2",
|
|
951
|
+
methodName: "embed",
|
|
952
|
+
kind: "Async"
|
|
953
|
+
}
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
channelName: cohereChannels.embed.channelName,
|
|
957
|
+
module: {
|
|
958
|
+
name: "cohere-ai",
|
|
959
|
+
versionRange: ">=7.21.0 <8.0.0",
|
|
960
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
961
|
+
},
|
|
962
|
+
functionQuery: {
|
|
963
|
+
className: "V2Client",
|
|
964
|
+
methodName: "embed",
|
|
965
|
+
kind: "Async"
|
|
966
|
+
}
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
channelName: cohereChannels.embed.channelName,
|
|
970
|
+
module: {
|
|
971
|
+
name: "cohere-ai",
|
|
972
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
973
|
+
filePath: "Client.js"
|
|
974
|
+
},
|
|
975
|
+
functionQuery: {
|
|
976
|
+
className: "CohereClient",
|
|
977
|
+
methodName: "embed",
|
|
978
|
+
kind: "Async"
|
|
979
|
+
}
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
channelName: cohereChannels.embed.channelName,
|
|
983
|
+
module: {
|
|
984
|
+
name: "cohere-ai",
|
|
985
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
986
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
987
|
+
},
|
|
988
|
+
functionQuery: {
|
|
989
|
+
className: "V2Client",
|
|
990
|
+
methodName: "embed",
|
|
991
|
+
kind: "Async"
|
|
992
|
+
}
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
channelName: cohereChannels.rerank.channelName,
|
|
996
|
+
module: {
|
|
997
|
+
name: "cohere-ai",
|
|
998
|
+
versionRange: ">=7.0.0 <8.0.0",
|
|
999
|
+
filePath: "Client.js"
|
|
1000
|
+
},
|
|
1001
|
+
functionQuery: {
|
|
1002
|
+
className: "CohereClient",
|
|
1003
|
+
methodName: "rerank",
|
|
1004
|
+
kind: "Async"
|
|
1005
|
+
}
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
channelName: cohereChannels.rerank.channelName,
|
|
1009
|
+
module: {
|
|
1010
|
+
name: "cohere-ai",
|
|
1011
|
+
versionRange: ">=7.0.0 <7.21.0",
|
|
1012
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
1013
|
+
},
|
|
1014
|
+
functionQuery: {
|
|
1015
|
+
className: "V2",
|
|
1016
|
+
methodName: "rerank",
|
|
1017
|
+
kind: "Async"
|
|
1018
|
+
}
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
channelName: cohereChannels.rerank.channelName,
|
|
1022
|
+
module: {
|
|
1023
|
+
name: "cohere-ai",
|
|
1024
|
+
versionRange: ">=7.21.0 <8.0.0",
|
|
1025
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
1026
|
+
},
|
|
1027
|
+
functionQuery: {
|
|
1028
|
+
className: "V2Client",
|
|
1029
|
+
methodName: "rerank",
|
|
1030
|
+
kind: "Async"
|
|
1031
|
+
}
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
channelName: cohereChannels.rerank.channelName,
|
|
1035
|
+
module: {
|
|
1036
|
+
name: "cohere-ai",
|
|
1037
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
1038
|
+
filePath: "Client.js"
|
|
1039
|
+
},
|
|
1040
|
+
functionQuery: {
|
|
1041
|
+
className: "CohereClient",
|
|
1042
|
+
methodName: "rerank",
|
|
1043
|
+
kind: "Async"
|
|
1044
|
+
}
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
channelName: cohereChannels.rerank.channelName,
|
|
1048
|
+
module: {
|
|
1049
|
+
name: "cohere-ai",
|
|
1050
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
1051
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
1052
|
+
},
|
|
1053
|
+
functionQuery: {
|
|
1054
|
+
className: "V2Client",
|
|
1055
|
+
methodName: "rerank",
|
|
1056
|
+
kind: "Async"
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
];
|
|
1060
|
+
|
|
1061
|
+
// src/instrumentation/plugins/cursor-sdk-channels.ts
|
|
1062
|
+
var cursorSDKChannels = defineChannels("@cursor/sdk", {
|
|
1063
|
+
create: channel({
|
|
1064
|
+
channelName: "Agent.create",
|
|
1065
|
+
kind: "async"
|
|
1066
|
+
}),
|
|
1067
|
+
resume: channel({
|
|
1068
|
+
channelName: "Agent.resume",
|
|
1069
|
+
kind: "async"
|
|
1070
|
+
}),
|
|
1071
|
+
prompt: channel({
|
|
1072
|
+
channelName: "Agent.prompt",
|
|
1073
|
+
kind: "async"
|
|
1074
|
+
}),
|
|
1075
|
+
send: channel({
|
|
1076
|
+
channelName: "agent.send",
|
|
1077
|
+
kind: "async"
|
|
1078
|
+
})
|
|
1079
|
+
});
|
|
1080
|
+
|
|
1081
|
+
// src/auto-instrumentations/configs/cursor-sdk.ts
|
|
1082
|
+
var cursorSDKVersionRange = ">=1.0.7 <2.0.0";
|
|
1083
|
+
var cursorSDKEntrypoints = ["dist/esm/index.js", "dist/cjs/index.js"];
|
|
1084
|
+
var cursorSDKConfigs = cursorSDKEntrypoints.flatMap((filePath) => [
|
|
1085
|
+
{
|
|
1086
|
+
channelName: cursorSDKChannels.create.channelName,
|
|
1087
|
+
module: {
|
|
1088
|
+
name: "@cursor/sdk",
|
|
1089
|
+
versionRange: cursorSDKVersionRange,
|
|
1090
|
+
filePath
|
|
1091
|
+
},
|
|
1092
|
+
functionQuery: {
|
|
1093
|
+
className: "Agent",
|
|
1094
|
+
methodName: "create",
|
|
1095
|
+
kind: "Async"
|
|
1096
|
+
}
|
|
1097
|
+
},
|
|
1098
|
+
{
|
|
1099
|
+
channelName: cursorSDKChannels.resume.channelName,
|
|
1100
|
+
module: {
|
|
1101
|
+
name: "@cursor/sdk",
|
|
1102
|
+
versionRange: cursorSDKVersionRange,
|
|
1103
|
+
filePath
|
|
1104
|
+
},
|
|
1105
|
+
functionQuery: {
|
|
1106
|
+
className: "Agent",
|
|
1107
|
+
methodName: "resume",
|
|
1108
|
+
kind: "Async"
|
|
1109
|
+
}
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
channelName: cursorSDKChannels.prompt.channelName,
|
|
1113
|
+
module: {
|
|
1114
|
+
name: "@cursor/sdk",
|
|
1115
|
+
versionRange: cursorSDKVersionRange,
|
|
1116
|
+
filePath
|
|
1117
|
+
},
|
|
1118
|
+
functionQuery: {
|
|
1119
|
+
className: "Agent",
|
|
1120
|
+
methodName: "prompt",
|
|
1121
|
+
kind: "Async"
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
]);
|
|
1125
|
+
|
|
1126
|
+
// src/instrumentation/plugins/flue-channels.ts
|
|
1127
|
+
var flueChannels = defineChannels("@flue/runtime", {
|
|
1128
|
+
createContext: channel({
|
|
1129
|
+
channelName: "createFlueContext",
|
|
1130
|
+
kind: "sync-stream"
|
|
1131
|
+
}),
|
|
1132
|
+
openSession: channel({
|
|
1133
|
+
channelName: "Harness.openSession",
|
|
1134
|
+
kind: "async"
|
|
1135
|
+
}),
|
|
1136
|
+
contextEvent: channel({
|
|
1137
|
+
channelName: "context.event",
|
|
1138
|
+
kind: "sync-stream"
|
|
1139
|
+
}),
|
|
1140
|
+
prompt: channel({
|
|
1141
|
+
channelName: "session.prompt",
|
|
1142
|
+
kind: "async"
|
|
1143
|
+
}),
|
|
1144
|
+
skill: channel({
|
|
1145
|
+
channelName: "session.skill",
|
|
1146
|
+
kind: "async"
|
|
1147
|
+
}),
|
|
1148
|
+
task: channel({
|
|
1149
|
+
channelName: "session.task",
|
|
1150
|
+
kind: "async"
|
|
1151
|
+
}),
|
|
1152
|
+
compact: channel({
|
|
1153
|
+
channelName: "session.compact",
|
|
1154
|
+
kind: "async"
|
|
1155
|
+
})
|
|
1156
|
+
});
|
|
1157
|
+
|
|
1158
|
+
// src/auto-instrumentations/configs/flue.ts
|
|
1159
|
+
var flueVersionRange = ">=0.7.0 <0.8.0";
|
|
1160
|
+
var flueConfigs = [
|
|
1161
|
+
{
|
|
1162
|
+
channelName: flueChannels.createContext.channelName,
|
|
1163
|
+
module: {
|
|
1164
|
+
name: "@flue/runtime",
|
|
1165
|
+
versionRange: flueVersionRange,
|
|
1166
|
+
filePath: "dist/internal.mjs"
|
|
1167
|
+
},
|
|
1168
|
+
functionQuery: {
|
|
1169
|
+
functionName: "createFlueContext",
|
|
1170
|
+
kind: "Sync"
|
|
1171
|
+
}
|
|
1172
|
+
},
|
|
1173
|
+
{
|
|
1174
|
+
channelName: flueChannels.openSession.channelName,
|
|
1175
|
+
module: {
|
|
1176
|
+
name: "@flue/runtime",
|
|
1177
|
+
versionRange: flueVersionRange,
|
|
1178
|
+
filePath: "dist/internal.mjs"
|
|
1179
|
+
},
|
|
1180
|
+
functionQuery: {
|
|
1181
|
+
className: "Harness",
|
|
1182
|
+
methodName: "openSession",
|
|
1183
|
+
kind: "Async"
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
];
|
|
1187
|
+
|
|
1188
|
+
// src/instrumentation/plugins/genkit-channels.ts
|
|
1189
|
+
var genkitChannels = defineChannels("@genkit-ai/ai", {
|
|
1190
|
+
generate: channel({
|
|
1191
|
+
channelName: "generate",
|
|
517
1192
|
kind: "async"
|
|
518
1193
|
}),
|
|
519
|
-
|
|
520
|
-
channelName: "
|
|
521
|
-
kind: "
|
|
1194
|
+
generateStream: channel({
|
|
1195
|
+
channelName: "generateStream",
|
|
1196
|
+
kind: "sync-stream"
|
|
522
1197
|
}),
|
|
523
|
-
|
|
524
|
-
channelName: "
|
|
1198
|
+
embed: channel({
|
|
1199
|
+
channelName: "embed",
|
|
525
1200
|
kind: "async"
|
|
526
1201
|
}),
|
|
527
|
-
|
|
528
|
-
channelName: "
|
|
1202
|
+
embedMany: channel({
|
|
1203
|
+
channelName: "embedMany",
|
|
529
1204
|
kind: "async"
|
|
530
1205
|
}),
|
|
531
|
-
|
|
532
|
-
channelName: "
|
|
533
|
-
kind: "sync-stream"
|
|
534
|
-
}),
|
|
535
|
-
toolLoopAgentGenerate: channel({
|
|
536
|
-
channelName: "ToolLoopAgent.generate",
|
|
1206
|
+
actionRun: channel({
|
|
1207
|
+
channelName: "action.run",
|
|
537
1208
|
kind: "async"
|
|
538
1209
|
}),
|
|
539
|
-
|
|
540
|
-
channelName: "
|
|
1210
|
+
actionStream: channel({
|
|
1211
|
+
channelName: "action.stream",
|
|
1212
|
+
kind: "sync-stream"
|
|
1213
|
+
})
|
|
1214
|
+
});
|
|
1215
|
+
var genkitCoreChannels = defineChannels("@genkit-ai/core", {
|
|
1216
|
+
actionSpan: channel({
|
|
1217
|
+
channelName: "action.span",
|
|
541
1218
|
kind: "async"
|
|
542
1219
|
})
|
|
543
1220
|
});
|
|
544
1221
|
|
|
545
|
-
// src/auto-instrumentations/configs/
|
|
546
|
-
var
|
|
547
|
-
|
|
1222
|
+
// src/auto-instrumentations/configs/genkit.ts
|
|
1223
|
+
var genkitVersionRange = ">=1.0.0 <2.0.0";
|
|
1224
|
+
var genkitConfigs = [
|
|
548
1225
|
{
|
|
549
|
-
channelName:
|
|
1226
|
+
channelName: genkitChannels.generate.channelName,
|
|
550
1227
|
module: {
|
|
551
|
-
name: "ai",
|
|
552
|
-
versionRange:
|
|
553
|
-
filePath: "
|
|
1228
|
+
name: "@genkit-ai/ai",
|
|
1229
|
+
versionRange: genkitVersionRange,
|
|
1230
|
+
filePath: "lib/genkit-ai.mjs"
|
|
554
1231
|
},
|
|
555
1232
|
functionQuery: {
|
|
556
|
-
|
|
1233
|
+
className: "GenkitAI",
|
|
1234
|
+
methodName: "generate",
|
|
557
1235
|
kind: "Async"
|
|
558
1236
|
}
|
|
559
1237
|
},
|
|
560
1238
|
{
|
|
561
|
-
channelName:
|
|
1239
|
+
channelName: genkitChannels.generate.channelName,
|
|
562
1240
|
module: {
|
|
563
|
-
name: "ai",
|
|
564
|
-
versionRange:
|
|
565
|
-
filePath: "
|
|
1241
|
+
name: "@genkit-ai/ai",
|
|
1242
|
+
versionRange: genkitVersionRange,
|
|
1243
|
+
filePath: "lib/genkit-ai.js"
|
|
566
1244
|
},
|
|
567
1245
|
functionQuery: {
|
|
568
|
-
|
|
1246
|
+
className: "GenkitAI",
|
|
1247
|
+
methodName: "generate",
|
|
569
1248
|
kind: "Async"
|
|
570
1249
|
}
|
|
571
1250
|
},
|
|
572
|
-
// streamText - async function (v3 only, before the sync refactor in v4)
|
|
573
1251
|
{
|
|
574
|
-
channelName:
|
|
1252
|
+
channelName: genkitChannels.generateStream.channelName,
|
|
575
1253
|
module: {
|
|
576
|
-
name: "ai",
|
|
577
|
-
versionRange:
|
|
578
|
-
filePath: "
|
|
1254
|
+
name: "@genkit-ai/ai",
|
|
1255
|
+
versionRange: genkitVersionRange,
|
|
1256
|
+
filePath: "lib/genkit-ai.mjs"
|
|
579
1257
|
},
|
|
580
1258
|
functionQuery: {
|
|
581
|
-
|
|
582
|
-
|
|
1259
|
+
className: "GenkitAI",
|
|
1260
|
+
methodName: "generateStream",
|
|
1261
|
+
kind: "Sync"
|
|
583
1262
|
}
|
|
584
1263
|
},
|
|
585
|
-
// streamText - sync function returning stream (v4+)
|
|
586
1264
|
{
|
|
587
|
-
channelName:
|
|
1265
|
+
channelName: genkitChannels.generateStream.channelName,
|
|
588
1266
|
module: {
|
|
589
|
-
name: "ai",
|
|
590
|
-
versionRange:
|
|
591
|
-
filePath: "
|
|
1267
|
+
name: "@genkit-ai/ai",
|
|
1268
|
+
versionRange: genkitVersionRange,
|
|
1269
|
+
filePath: "lib/genkit-ai.js"
|
|
592
1270
|
},
|
|
593
1271
|
functionQuery: {
|
|
594
|
-
|
|
1272
|
+
className: "GenkitAI",
|
|
1273
|
+
methodName: "generateStream",
|
|
595
1274
|
kind: "Sync"
|
|
596
1275
|
}
|
|
597
1276
|
},
|
|
598
1277
|
{
|
|
599
|
-
channelName:
|
|
1278
|
+
channelName: genkitChannels.embed.channelName,
|
|
600
1279
|
module: {
|
|
601
|
-
name: "ai",
|
|
602
|
-
versionRange:
|
|
603
|
-
filePath: "
|
|
1280
|
+
name: "@genkit-ai/ai",
|
|
1281
|
+
versionRange: genkitVersionRange,
|
|
1282
|
+
filePath: "lib/genkit-ai.mjs"
|
|
604
1283
|
},
|
|
605
1284
|
functionQuery: {
|
|
606
|
-
|
|
1285
|
+
className: "GenkitAI",
|
|
1286
|
+
methodName: "embed",
|
|
607
1287
|
kind: "Async"
|
|
608
1288
|
}
|
|
609
1289
|
},
|
|
610
1290
|
{
|
|
611
|
-
channelName:
|
|
1291
|
+
channelName: genkitChannels.embed.channelName,
|
|
612
1292
|
module: {
|
|
613
|
-
name: "ai",
|
|
614
|
-
versionRange:
|
|
615
|
-
filePath: "
|
|
1293
|
+
name: "@genkit-ai/ai",
|
|
1294
|
+
versionRange: genkitVersionRange,
|
|
1295
|
+
filePath: "lib/genkit-ai.js"
|
|
616
1296
|
},
|
|
617
1297
|
functionQuery: {
|
|
618
|
-
|
|
619
|
-
|
|
1298
|
+
className: "GenkitAI",
|
|
1299
|
+
methodName: "embed",
|
|
1300
|
+
kind: "Async"
|
|
620
1301
|
}
|
|
621
1302
|
},
|
|
622
|
-
// generateObject - async function
|
|
623
1303
|
{
|
|
624
|
-
channelName:
|
|
1304
|
+
channelName: genkitChannels.embedMany.channelName,
|
|
625
1305
|
module: {
|
|
626
|
-
name: "ai",
|
|
627
|
-
versionRange:
|
|
628
|
-
filePath: "
|
|
1306
|
+
name: "@genkit-ai/ai",
|
|
1307
|
+
versionRange: genkitVersionRange,
|
|
1308
|
+
filePath: "lib/genkit-ai.mjs"
|
|
629
1309
|
},
|
|
630
1310
|
functionQuery: {
|
|
631
|
-
|
|
1311
|
+
className: "GenkitAI",
|
|
1312
|
+
methodName: "embedMany",
|
|
632
1313
|
kind: "Async"
|
|
633
1314
|
}
|
|
634
1315
|
},
|
|
635
1316
|
{
|
|
636
|
-
channelName:
|
|
1317
|
+
channelName: genkitChannels.embedMany.channelName,
|
|
637
1318
|
module: {
|
|
638
|
-
name: "ai",
|
|
639
|
-
versionRange:
|
|
640
|
-
filePath: "
|
|
1319
|
+
name: "@genkit-ai/ai",
|
|
1320
|
+
versionRange: genkitVersionRange,
|
|
1321
|
+
filePath: "lib/genkit-ai.js"
|
|
641
1322
|
},
|
|
642
1323
|
functionQuery: {
|
|
643
|
-
|
|
1324
|
+
className: "GenkitAI",
|
|
1325
|
+
methodName: "embedMany",
|
|
644
1326
|
kind: "Async"
|
|
645
1327
|
}
|
|
646
1328
|
},
|
|
647
|
-
// embed - async function
|
|
648
1329
|
{
|
|
649
|
-
channelName:
|
|
1330
|
+
channelName: genkitChannels.actionRun.channelName,
|
|
650
1331
|
module: {
|
|
651
|
-
name: "ai",
|
|
652
|
-
versionRange:
|
|
653
|
-
filePath: "
|
|
1332
|
+
name: "@genkit-ai/ai",
|
|
1333
|
+
versionRange: genkitVersionRange,
|
|
1334
|
+
filePath: "lib/genkit-ai.mjs"
|
|
654
1335
|
},
|
|
655
1336
|
functionQuery: {
|
|
656
|
-
|
|
1337
|
+
className: "GenkitAI",
|
|
1338
|
+
methodName: "run",
|
|
657
1339
|
kind: "Async"
|
|
658
1340
|
}
|
|
659
1341
|
},
|
|
660
1342
|
{
|
|
661
|
-
channelName:
|
|
1343
|
+
channelName: genkitChannels.actionRun.channelName,
|
|
662
1344
|
module: {
|
|
663
|
-
name: "ai",
|
|
664
|
-
versionRange:
|
|
665
|
-
filePath: "
|
|
1345
|
+
name: "@genkit-ai/ai",
|
|
1346
|
+
versionRange: genkitVersionRange,
|
|
1347
|
+
filePath: "lib/genkit-ai.js"
|
|
666
1348
|
},
|
|
667
1349
|
functionQuery: {
|
|
668
|
-
|
|
1350
|
+
className: "GenkitAI",
|
|
1351
|
+
methodName: "run",
|
|
669
1352
|
kind: "Async"
|
|
670
1353
|
}
|
|
671
1354
|
},
|
|
672
|
-
// embedMany - async function
|
|
673
1355
|
{
|
|
674
|
-
channelName:
|
|
1356
|
+
channelName: genkitCoreChannels.actionSpan.channelName,
|
|
675
1357
|
module: {
|
|
676
|
-
name: "ai",
|
|
677
|
-
versionRange:
|
|
678
|
-
filePath: "
|
|
1358
|
+
name: "@genkit-ai/core",
|
|
1359
|
+
versionRange: genkitVersionRange,
|
|
1360
|
+
filePath: "lib/tracing/instrumentation.mjs"
|
|
679
1361
|
},
|
|
680
1362
|
functionQuery: {
|
|
681
|
-
functionName: "
|
|
1363
|
+
functionName: "runInNewSpan",
|
|
682
1364
|
kind: "Async"
|
|
683
1365
|
}
|
|
684
1366
|
},
|
|
685
1367
|
{
|
|
686
|
-
channelName:
|
|
1368
|
+
channelName: genkitCoreChannels.actionSpan.channelName,
|
|
687
1369
|
module: {
|
|
688
|
-
name: "ai",
|
|
689
|
-
versionRange:
|
|
690
|
-
filePath: "
|
|
1370
|
+
name: "@genkit-ai/core",
|
|
1371
|
+
versionRange: genkitVersionRange,
|
|
1372
|
+
filePath: "lib/tracing/instrumentation.js"
|
|
691
1373
|
},
|
|
692
1374
|
functionQuery: {
|
|
693
|
-
functionName: "
|
|
1375
|
+
functionName: "runInNewSpan",
|
|
694
1376
|
kind: "Async"
|
|
695
1377
|
}
|
|
696
|
-
}
|
|
697
|
-
|
|
1378
|
+
}
|
|
1379
|
+
];
|
|
1380
|
+
|
|
1381
|
+
// src/instrumentation/plugins/github-copilot-channels.ts
|
|
1382
|
+
var gitHubCopilotChannels = defineChannels("@github/copilot-sdk", {
|
|
1383
|
+
createSession: channel({
|
|
1384
|
+
channelName: "client.createSession",
|
|
1385
|
+
kind: "async"
|
|
1386
|
+
}),
|
|
1387
|
+
resumeSession: channel({
|
|
1388
|
+
channelName: "client.resumeSession",
|
|
1389
|
+
kind: "async"
|
|
1390
|
+
}),
|
|
1391
|
+
sendAndWait: channel({
|
|
1392
|
+
channelName: "session.sendAndWait",
|
|
1393
|
+
kind: "async"
|
|
1394
|
+
})
|
|
1395
|
+
});
|
|
1396
|
+
|
|
1397
|
+
// src/auto-instrumentations/configs/github-copilot.ts
|
|
1398
|
+
var gitHubCopilotConfigs = [
|
|
1399
|
+
// ESM: CopilotClient.createSession
|
|
698
1400
|
{
|
|
699
|
-
channelName:
|
|
1401
|
+
channelName: gitHubCopilotChannels.createSession.channelName,
|
|
700
1402
|
module: {
|
|
701
|
-
name: "
|
|
702
|
-
versionRange: ">=
|
|
703
|
-
filePath: "dist/
|
|
1403
|
+
name: "@github/copilot-sdk",
|
|
1404
|
+
versionRange: ">=0.3.0",
|
|
1405
|
+
filePath: "dist/client.js"
|
|
704
1406
|
},
|
|
705
1407
|
functionQuery: {
|
|
706
|
-
|
|
1408
|
+
className: "CopilotClient",
|
|
1409
|
+
methodName: "createSession",
|
|
707
1410
|
kind: "Async"
|
|
708
1411
|
}
|
|
709
1412
|
},
|
|
1413
|
+
// CJS: CopilotClient.createSession
|
|
710
1414
|
{
|
|
711
|
-
channelName:
|
|
1415
|
+
channelName: gitHubCopilotChannels.createSession.channelName,
|
|
712
1416
|
module: {
|
|
713
|
-
name: "
|
|
714
|
-
versionRange: ">=
|
|
715
|
-
filePath: "dist/
|
|
1417
|
+
name: "@github/copilot-sdk",
|
|
1418
|
+
versionRange: ">=0.3.0",
|
|
1419
|
+
filePath: "dist/cjs/client.js"
|
|
716
1420
|
},
|
|
717
1421
|
functionQuery: {
|
|
718
|
-
|
|
1422
|
+
className: "CopilotClient",
|
|
1423
|
+
methodName: "createSession",
|
|
719
1424
|
kind: "Async"
|
|
720
1425
|
}
|
|
721
1426
|
},
|
|
722
|
-
//
|
|
1427
|
+
// ESM: CopilotClient.resumeSession
|
|
723
1428
|
{
|
|
724
|
-
channelName:
|
|
1429
|
+
channelName: gitHubCopilotChannels.resumeSession.channelName,
|
|
725
1430
|
module: {
|
|
726
|
-
name: "
|
|
727
|
-
versionRange: ">=
|
|
728
|
-
filePath: "dist/
|
|
1431
|
+
name: "@github/copilot-sdk",
|
|
1432
|
+
versionRange: ">=0.3.0",
|
|
1433
|
+
filePath: "dist/client.js"
|
|
729
1434
|
},
|
|
730
1435
|
functionQuery: {
|
|
731
|
-
|
|
1436
|
+
className: "CopilotClient",
|
|
1437
|
+
methodName: "resumeSession",
|
|
732
1438
|
kind: "Async"
|
|
733
1439
|
}
|
|
734
1440
|
},
|
|
735
|
-
//
|
|
1441
|
+
// CJS: CopilotClient.resumeSession
|
|
736
1442
|
{
|
|
737
|
-
channelName:
|
|
1443
|
+
channelName: gitHubCopilotChannels.resumeSession.channelName,
|
|
738
1444
|
module: {
|
|
739
|
-
name: "
|
|
740
|
-
versionRange: ">=
|
|
741
|
-
filePath: "dist/
|
|
1445
|
+
name: "@github/copilot-sdk",
|
|
1446
|
+
versionRange: ">=0.3.0",
|
|
1447
|
+
filePath: "dist/cjs/client.js"
|
|
742
1448
|
},
|
|
743
1449
|
functionQuery: {
|
|
744
|
-
|
|
745
|
-
|
|
1450
|
+
className: "CopilotClient",
|
|
1451
|
+
methodName: "resumeSession",
|
|
1452
|
+
kind: "Async"
|
|
746
1453
|
}
|
|
747
1454
|
},
|
|
1455
|
+
// ESM: CopilotSession.sendAndWait
|
|
748
1456
|
{
|
|
749
|
-
channelName:
|
|
1457
|
+
channelName: gitHubCopilotChannels.sendAndWait.channelName,
|
|
750
1458
|
module: {
|
|
751
|
-
name: "
|
|
752
|
-
versionRange: ">=
|
|
753
|
-
filePath: "dist/
|
|
1459
|
+
name: "@github/copilot-sdk",
|
|
1460
|
+
versionRange: ">=0.3.0",
|
|
1461
|
+
filePath: "dist/session.js"
|
|
754
1462
|
},
|
|
755
1463
|
functionQuery: {
|
|
756
|
-
|
|
1464
|
+
className: "CopilotSession",
|
|
1465
|
+
methodName: "sendAndWait",
|
|
757
1466
|
kind: "Async"
|
|
758
1467
|
}
|
|
759
1468
|
},
|
|
1469
|
+
// CJS: CopilotSession.sendAndWait
|
|
760
1470
|
{
|
|
761
|
-
channelName:
|
|
1471
|
+
channelName: gitHubCopilotChannels.sendAndWait.channelName,
|
|
762
1472
|
module: {
|
|
763
|
-
name: "
|
|
764
|
-
versionRange: ">=
|
|
765
|
-
filePath: "dist/
|
|
1473
|
+
name: "@github/copilot-sdk",
|
|
1474
|
+
versionRange: ">=0.3.0",
|
|
1475
|
+
filePath: "dist/cjs/session.js"
|
|
766
1476
|
},
|
|
767
1477
|
functionQuery: {
|
|
768
|
-
|
|
769
|
-
|
|
1478
|
+
className: "CopilotSession",
|
|
1479
|
+
methodName: "sendAndWait",
|
|
1480
|
+
kind: "Async"
|
|
770
1481
|
}
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
1482
|
+
}
|
|
1483
|
+
];
|
|
1484
|
+
|
|
1485
|
+
// src/instrumentation/plugins/google-adk-channels.ts
|
|
1486
|
+
var googleADKChannels = defineChannels("@google/adk", {
|
|
1487
|
+
runnerRunAsync: channel({
|
|
1488
|
+
channelName: "runner.runAsync",
|
|
1489
|
+
kind: "sync-stream"
|
|
1490
|
+
}),
|
|
1491
|
+
agentRunAsync: channel({
|
|
1492
|
+
channelName: "agent.runAsync",
|
|
1493
|
+
kind: "sync-stream"
|
|
1494
|
+
}),
|
|
1495
|
+
toolRunAsync: channel({
|
|
1496
|
+
channelName: "tool.runAsync",
|
|
1497
|
+
kind: "async"
|
|
1498
|
+
})
|
|
1499
|
+
});
|
|
1500
|
+
|
|
1501
|
+
// src/auto-instrumentations/configs/google-adk.ts
|
|
1502
|
+
var googleADKVersionRange = ">=0.1.0";
|
|
1503
|
+
var googleADKBundledIndexV06VersionRange = ">=0.6.1 <0.7.0";
|
|
1504
|
+
var googleADKBundledIndexV1VersionRange = ">=1.0.0 <2.0.0";
|
|
1505
|
+
var googleADKConfigs = [
|
|
1506
|
+
// --- Runner.runAsync --- async generator, kind "Sync" + sync-stream channel
|
|
1507
|
+
// Runner.runAsync — ESM individual module file
|
|
775
1508
|
{
|
|
776
|
-
channelName:
|
|
1509
|
+
channelName: googleADKChannels.runnerRunAsync.channelName,
|
|
777
1510
|
module: {
|
|
778
|
-
name: "
|
|
779
|
-
versionRange:
|
|
780
|
-
filePath: "dist/
|
|
1511
|
+
name: "@google/adk",
|
|
1512
|
+
versionRange: googleADKVersionRange,
|
|
1513
|
+
filePath: "dist/esm/runner/runner.js"
|
|
781
1514
|
},
|
|
782
1515
|
functionQuery: {
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
1516
|
+
className: "Runner",
|
|
1517
|
+
methodName: "runAsync",
|
|
1518
|
+
kind: "Sync"
|
|
786
1519
|
}
|
|
787
1520
|
},
|
|
1521
|
+
// Runner.runAsync — bundled CJS/ESM indexes
|
|
1522
|
+
// The bundled entrypoints minify class names, so target the 12th sync
|
|
1523
|
+
// `runAsync` method in file order rather than a class name. This mapping is
|
|
1524
|
+
// only validated against the current 0.6.x bundle layout, so keep the range
|
|
1525
|
+
// tight until we verify newer bundled outputs.
|
|
788
1526
|
{
|
|
789
|
-
channelName:
|
|
1527
|
+
channelName: googleADKChannels.runnerRunAsync.channelName,
|
|
790
1528
|
module: {
|
|
791
|
-
name: "
|
|
792
|
-
versionRange:
|
|
793
|
-
filePath: "dist/index.js"
|
|
1529
|
+
name: "@google/adk",
|
|
1530
|
+
versionRange: googleADKBundledIndexV06VersionRange,
|
|
1531
|
+
filePath: "dist/cjs/index.js"
|
|
794
1532
|
},
|
|
795
1533
|
functionQuery: {
|
|
796
|
-
methodName: "
|
|
797
|
-
kind: "
|
|
798
|
-
index:
|
|
1534
|
+
methodName: "runAsync",
|
|
1535
|
+
kind: "Sync",
|
|
1536
|
+
index: 11
|
|
799
1537
|
}
|
|
800
1538
|
},
|
|
801
|
-
// Agent.stream - sync method (v5 only)
|
|
802
|
-
// The compiled AI SDK bundle emits this as an anonymous class method, so we
|
|
803
|
-
// target the first sync `stream` method in the file instead of a class name.
|
|
804
1539
|
{
|
|
805
|
-
channelName:
|
|
1540
|
+
channelName: googleADKChannels.runnerRunAsync.channelName,
|
|
806
1541
|
module: {
|
|
807
|
-
name: "
|
|
808
|
-
versionRange:
|
|
809
|
-
filePath: "dist/index.
|
|
1542
|
+
name: "@google/adk",
|
|
1543
|
+
versionRange: googleADKBundledIndexV06VersionRange,
|
|
1544
|
+
filePath: "dist/esm/index.js"
|
|
810
1545
|
},
|
|
811
1546
|
functionQuery: {
|
|
812
|
-
methodName: "
|
|
1547
|
+
methodName: "runAsync",
|
|
813
1548
|
kind: "Sync",
|
|
814
|
-
index:
|
|
1549
|
+
index: 11
|
|
815
1550
|
}
|
|
816
1551
|
},
|
|
1552
|
+
// The 1.x bundled entrypoints still inline the runtime into index.js, but
|
|
1553
|
+
// the minified method order changed. These indices are verified against 1.0.0.
|
|
817
1554
|
{
|
|
818
|
-
channelName:
|
|
1555
|
+
channelName: googleADKChannels.runnerRunAsync.channelName,
|
|
819
1556
|
module: {
|
|
820
|
-
name: "
|
|
821
|
-
versionRange:
|
|
822
|
-
filePath: "dist/index.js"
|
|
1557
|
+
name: "@google/adk",
|
|
1558
|
+
versionRange: googleADKBundledIndexV1VersionRange,
|
|
1559
|
+
filePath: "dist/cjs/index.js"
|
|
823
1560
|
},
|
|
824
1561
|
functionQuery: {
|
|
825
|
-
methodName: "
|
|
1562
|
+
methodName: "runAsync",
|
|
826
1563
|
kind: "Sync",
|
|
827
|
-
index:
|
|
1564
|
+
index: 12
|
|
828
1565
|
}
|
|
829
1566
|
},
|
|
830
|
-
// ToolLoopAgent.generate - async method (v6 only, Experimental_Agent is an alias)
|
|
831
|
-
// The compiled AI SDK bundle emits this as an anonymous class method, so we
|
|
832
|
-
// target the first async `generate` method in the file instead of a class name.
|
|
833
1567
|
{
|
|
834
|
-
channelName:
|
|
1568
|
+
channelName: googleADKChannels.runnerRunAsync.channelName,
|
|
835
1569
|
module: {
|
|
836
|
-
name: "
|
|
837
|
-
versionRange:
|
|
838
|
-
filePath: "dist/index.
|
|
1570
|
+
name: "@google/adk",
|
|
1571
|
+
versionRange: googleADKBundledIndexV1VersionRange,
|
|
1572
|
+
filePath: "dist/esm/index.js"
|
|
839
1573
|
},
|
|
840
1574
|
functionQuery: {
|
|
841
|
-
methodName: "
|
|
842
|
-
kind: "
|
|
843
|
-
index:
|
|
1575
|
+
methodName: "runAsync",
|
|
1576
|
+
kind: "Sync",
|
|
1577
|
+
index: 12
|
|
844
1578
|
}
|
|
845
1579
|
},
|
|
1580
|
+
// --- BaseAgent.runAsync --- async generator, kind "Sync" + sync-stream channel
|
|
1581
|
+
// BaseAgent.runAsync — ESM individual module file
|
|
846
1582
|
{
|
|
847
|
-
channelName:
|
|
1583
|
+
channelName: googleADKChannels.agentRunAsync.channelName,
|
|
848
1584
|
module: {
|
|
849
|
-
name: "
|
|
850
|
-
versionRange:
|
|
851
|
-
filePath: "dist/
|
|
1585
|
+
name: "@google/adk",
|
|
1586
|
+
versionRange: googleADKVersionRange,
|
|
1587
|
+
filePath: "dist/esm/agents/base_agent.js"
|
|
852
1588
|
},
|
|
853
1589
|
functionQuery: {
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
1590
|
+
className: "BaseAgent",
|
|
1591
|
+
methodName: "runAsync",
|
|
1592
|
+
kind: "Sync"
|
|
857
1593
|
}
|
|
858
1594
|
},
|
|
859
|
-
//
|
|
860
|
-
// The
|
|
861
|
-
//
|
|
1595
|
+
// BaseAgent.runAsync — bundled CJS/ESM indexes
|
|
1596
|
+
// The bundled entrypoints minify class names, so target the first sync
|
|
1597
|
+
// `runAsync` method in file order rather than a class name. This mapping is
|
|
1598
|
+
// only validated against the current 0.6.x bundle layout, so keep the range
|
|
1599
|
+
// tight until we verify newer bundled outputs.
|
|
862
1600
|
{
|
|
863
|
-
channelName:
|
|
1601
|
+
channelName: googleADKChannels.agentRunAsync.channelName,
|
|
864
1602
|
module: {
|
|
865
|
-
name: "
|
|
866
|
-
versionRange:
|
|
867
|
-
filePath: "dist/index.
|
|
1603
|
+
name: "@google/adk",
|
|
1604
|
+
versionRange: googleADKBundledIndexV06VersionRange,
|
|
1605
|
+
filePath: "dist/cjs/index.js"
|
|
868
1606
|
},
|
|
869
1607
|
functionQuery: {
|
|
870
|
-
methodName: "
|
|
871
|
-
kind: "
|
|
1608
|
+
methodName: "runAsync",
|
|
1609
|
+
kind: "Sync",
|
|
872
1610
|
index: 0
|
|
873
1611
|
}
|
|
874
1612
|
},
|
|
875
1613
|
{
|
|
876
|
-
channelName:
|
|
1614
|
+
channelName: googleADKChannels.agentRunAsync.channelName,
|
|
877
1615
|
module: {
|
|
878
|
-
name: "
|
|
879
|
-
versionRange:
|
|
880
|
-
filePath: "dist/index.js"
|
|
881
|
-
},
|
|
882
|
-
functionQuery: {
|
|
883
|
-
methodName: "
|
|
884
|
-
kind: "
|
|
885
|
-
index: 0
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
// src/instrumentation/plugins/claude-agent-sdk-channels.ts
|
|
891
|
-
var claudeAgentSDKChannels = defineChannels(
|
|
892
|
-
"@anthropic-ai/claude-agent-sdk",
|
|
893
|
-
{
|
|
894
|
-
query: channel({
|
|
895
|
-
channelName: "query",
|
|
896
|
-
kind: "sync-stream"
|
|
897
|
-
})
|
|
898
|
-
}
|
|
899
|
-
);
|
|
900
|
-
|
|
901
|
-
// src/auto-instrumentations/configs/claude-agent-sdk.ts
|
|
902
|
-
var claudeAgentSDKConfigs = [
|
|
903
|
-
// query - Main entry point for agent interactions. The SDK returns an async
|
|
904
|
-
// iterable, but the exported query function itself is synchronous.
|
|
1616
|
+
name: "@google/adk",
|
|
1617
|
+
versionRange: googleADKBundledIndexV06VersionRange,
|
|
1618
|
+
filePath: "dist/esm/index.js"
|
|
1619
|
+
},
|
|
1620
|
+
functionQuery: {
|
|
1621
|
+
methodName: "runAsync",
|
|
1622
|
+
kind: "Sync",
|
|
1623
|
+
index: 0
|
|
1624
|
+
}
|
|
1625
|
+
},
|
|
1626
|
+
// The 1.x bundled entrypoints keep BaseAgent.runAsync as the first bundled
|
|
1627
|
+
// async-generator runAsync method in file order.
|
|
905
1628
|
{
|
|
906
|
-
channelName:
|
|
1629
|
+
channelName: googleADKChannels.agentRunAsync.channelName,
|
|
907
1630
|
module: {
|
|
908
|
-
name: "@
|
|
909
|
-
versionRange:
|
|
910
|
-
filePath: "
|
|
1631
|
+
name: "@google/adk",
|
|
1632
|
+
versionRange: googleADKBundledIndexV1VersionRange,
|
|
1633
|
+
filePath: "dist/cjs/index.js"
|
|
911
1634
|
},
|
|
912
1635
|
functionQuery: {
|
|
913
|
-
|
|
914
|
-
kind: "Sync"
|
|
1636
|
+
methodName: "runAsync",
|
|
1637
|
+
kind: "Sync",
|
|
1638
|
+
index: 0
|
|
915
1639
|
}
|
|
916
1640
|
},
|
|
917
1641
|
{
|
|
918
|
-
channelName:
|
|
1642
|
+
channelName: googleADKChannels.agentRunAsync.channelName,
|
|
919
1643
|
module: {
|
|
920
|
-
name: "@
|
|
921
|
-
versionRange:
|
|
922
|
-
filePath: "
|
|
1644
|
+
name: "@google/adk",
|
|
1645
|
+
versionRange: googleADKBundledIndexV1VersionRange,
|
|
1646
|
+
filePath: "dist/esm/index.js"
|
|
923
1647
|
},
|
|
924
1648
|
functionQuery: {
|
|
925
|
-
|
|
1649
|
+
methodName: "runAsync",
|
|
926
1650
|
kind: "Sync",
|
|
927
|
-
|
|
1651
|
+
index: 0
|
|
928
1652
|
}
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
// src/instrumentation/plugins/cursor-sdk-channels.ts
|
|
933
|
-
var cursorSDKChannels = defineChannels("@cursor/sdk", {
|
|
934
|
-
create: channel({
|
|
935
|
-
channelName: "Agent.create",
|
|
936
|
-
kind: "async"
|
|
937
|
-
}),
|
|
938
|
-
resume: channel({
|
|
939
|
-
channelName: "Agent.resume",
|
|
940
|
-
kind: "async"
|
|
941
|
-
}),
|
|
942
|
-
prompt: channel({
|
|
943
|
-
channelName: "Agent.prompt",
|
|
944
|
-
kind: "async"
|
|
945
|
-
}),
|
|
946
|
-
send: channel({
|
|
947
|
-
channelName: "agent.send",
|
|
948
|
-
kind: "async"
|
|
949
|
-
})
|
|
950
|
-
});
|
|
951
|
-
|
|
952
|
-
// src/auto-instrumentations/configs/cursor-sdk.ts
|
|
953
|
-
var cursorSDKVersionRange = ">=1.0.7 <2.0.0";
|
|
954
|
-
var cursorSDKEntrypoints = ["dist/esm/index.js", "dist/cjs/index.js"];
|
|
955
|
-
var cursorSDKConfigs = cursorSDKEntrypoints.flatMap((filePath) => [
|
|
1653
|
+
},
|
|
1654
|
+
// --- FunctionTool.runAsync --- regular async, kind "Async"
|
|
1655
|
+
// FunctionTool.runAsync — ESM individual module file
|
|
956
1656
|
{
|
|
957
|
-
channelName:
|
|
1657
|
+
channelName: googleADKChannels.toolRunAsync.channelName,
|
|
958
1658
|
module: {
|
|
959
|
-
name: "@
|
|
960
|
-
versionRange:
|
|
961
|
-
filePath
|
|
1659
|
+
name: "@google/adk",
|
|
1660
|
+
versionRange: googleADKVersionRange,
|
|
1661
|
+
filePath: "dist/esm/tools/function_tool.js"
|
|
962
1662
|
},
|
|
963
1663
|
functionQuery: {
|
|
964
|
-
className: "
|
|
965
|
-
methodName: "
|
|
1664
|
+
className: "FunctionTool",
|
|
1665
|
+
methodName: "runAsync",
|
|
966
1666
|
kind: "Async"
|
|
967
1667
|
}
|
|
968
1668
|
},
|
|
1669
|
+
// FunctionTool.runAsync — bundled CJS/ESM indexes
|
|
1670
|
+
// The bundled entrypoints minify class names, so target the first async
|
|
1671
|
+
// `runAsync` method in file order rather than a class name. This mapping is
|
|
1672
|
+
// only validated against the current 0.6.x bundle layout, so keep the range
|
|
1673
|
+
// tight until we verify newer bundled outputs.
|
|
969
1674
|
{
|
|
970
|
-
channelName:
|
|
1675
|
+
channelName: googleADKChannels.toolRunAsync.channelName,
|
|
971
1676
|
module: {
|
|
972
|
-
name: "@
|
|
973
|
-
versionRange:
|
|
974
|
-
filePath
|
|
1677
|
+
name: "@google/adk",
|
|
1678
|
+
versionRange: googleADKBundledIndexV06VersionRange,
|
|
1679
|
+
filePath: "dist/cjs/index.js"
|
|
975
1680
|
},
|
|
976
1681
|
functionQuery: {
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1682
|
+
methodName: "runAsync",
|
|
1683
|
+
kind: "Async",
|
|
1684
|
+
index: 1
|
|
980
1685
|
}
|
|
981
1686
|
},
|
|
982
1687
|
{
|
|
983
|
-
channelName:
|
|
1688
|
+
channelName: googleADKChannels.toolRunAsync.channelName,
|
|
984
1689
|
module: {
|
|
985
|
-
name: "@
|
|
986
|
-
versionRange:
|
|
987
|
-
filePath
|
|
1690
|
+
name: "@google/adk",
|
|
1691
|
+
versionRange: googleADKBundledIndexV06VersionRange,
|
|
1692
|
+
filePath: "dist/esm/index.js"
|
|
988
1693
|
},
|
|
989
1694
|
functionQuery: {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
1695
|
+
methodName: "runAsync",
|
|
1696
|
+
kind: "Async",
|
|
1697
|
+
index: 1
|
|
1698
|
+
}
|
|
1699
|
+
},
|
|
1700
|
+
// The 1.x bundle moves FunctionTool.runAsync behind one helper method.
|
|
1701
|
+
{
|
|
1702
|
+
channelName: googleADKChannels.toolRunAsync.channelName,
|
|
1703
|
+
module: {
|
|
1704
|
+
name: "@google/adk",
|
|
1705
|
+
versionRange: googleADKBundledIndexV1VersionRange,
|
|
1706
|
+
filePath: "dist/cjs/index.js"
|
|
1707
|
+
},
|
|
1708
|
+
functionQuery: {
|
|
1709
|
+
methodName: "runAsync",
|
|
1710
|
+
kind: "Async",
|
|
1711
|
+
index: 1
|
|
1712
|
+
}
|
|
1713
|
+
},
|
|
1714
|
+
{
|
|
1715
|
+
channelName: googleADKChannels.toolRunAsync.channelName,
|
|
1716
|
+
module: {
|
|
1717
|
+
name: "@google/adk",
|
|
1718
|
+
versionRange: googleADKBundledIndexV1VersionRange,
|
|
1719
|
+
filePath: "dist/esm/index.js"
|
|
1720
|
+
},
|
|
1721
|
+
functionQuery: {
|
|
1722
|
+
methodName: "runAsync",
|
|
1723
|
+
kind: "Async",
|
|
1724
|
+
index: 1
|
|
993
1725
|
}
|
|
994
1726
|
}
|
|
995
|
-
]
|
|
1727
|
+
];
|
|
996
1728
|
|
|
997
1729
|
// src/instrumentation/plugins/google-genai-channels.ts
|
|
998
1730
|
var googleGenAIChannels = defineChannels("@google/genai", {
|
|
@@ -1073,6 +1805,50 @@ var googleGenAIConfigs = [
|
|
|
1073
1805
|
}
|
|
1074
1806
|
];
|
|
1075
1807
|
|
|
1808
|
+
// src/instrumentation/plugins/groq-channels.ts
|
|
1809
|
+
var groqChannels = defineChannels("groq-sdk", {
|
|
1810
|
+
chatCompletionsCreate: channel({
|
|
1811
|
+
channelName: "chat.completions.create",
|
|
1812
|
+
kind: "async"
|
|
1813
|
+
}),
|
|
1814
|
+
embeddingsCreate: channel(
|
|
1815
|
+
{
|
|
1816
|
+
channelName: "embeddings.create",
|
|
1817
|
+
kind: "async"
|
|
1818
|
+
}
|
|
1819
|
+
)
|
|
1820
|
+
});
|
|
1821
|
+
|
|
1822
|
+
// src/auto-instrumentations/configs/groq.ts
|
|
1823
|
+
var groqConfigs = [
|
|
1824
|
+
{
|
|
1825
|
+
channelName: groqChannels.chatCompletionsCreate.channelName,
|
|
1826
|
+
module: {
|
|
1827
|
+
name: "groq-sdk",
|
|
1828
|
+
versionRange: ">=1.0.0",
|
|
1829
|
+
filePath: "resources/chat/completions.mjs"
|
|
1830
|
+
},
|
|
1831
|
+
functionQuery: {
|
|
1832
|
+
className: "Completions",
|
|
1833
|
+
methodName: "create",
|
|
1834
|
+
kind: "Async"
|
|
1835
|
+
}
|
|
1836
|
+
},
|
|
1837
|
+
{
|
|
1838
|
+
channelName: groqChannels.embeddingsCreate.channelName,
|
|
1839
|
+
module: {
|
|
1840
|
+
name: "groq-sdk",
|
|
1841
|
+
versionRange: ">=1.0.0",
|
|
1842
|
+
filePath: "resources/embeddings.mjs"
|
|
1843
|
+
},
|
|
1844
|
+
functionQuery: {
|
|
1845
|
+
className: "Embeddings",
|
|
1846
|
+
methodName: "create",
|
|
1847
|
+
kind: "Async"
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
];
|
|
1851
|
+
|
|
1076
1852
|
// src/instrumentation/plugins/huggingface-channels.ts
|
|
1077
1853
|
var huggingFaceChannels = defineChannels("@huggingface/inference", {
|
|
1078
1854
|
chatCompletion: channel({
|
|
@@ -1341,136 +2117,45 @@ var huggingFaceConfigs = [
|
|
|
1341
2117
|
}
|
|
1342
2118
|
];
|
|
1343
2119
|
|
|
1344
|
-
// src/instrumentation/plugins/
|
|
1345
|
-
var
|
|
1346
|
-
|
|
1347
|
-
channelName: "
|
|
2120
|
+
// src/instrumentation/plugins/langchain-channels.ts
|
|
2121
|
+
var langChainChannels = defineChannels("@langchain/core", {
|
|
2122
|
+
configure: channel({
|
|
2123
|
+
channelName: "CallbackManager.configure",
|
|
1348
2124
|
kind: "sync-stream"
|
|
1349
2125
|
}),
|
|
1350
|
-
|
|
1351
|
-
channelName: "
|
|
1352
|
-
kind: "async"
|
|
1353
|
-
}),
|
|
1354
|
-
toolExecute: channel({
|
|
1355
|
-
channelName: "tool.execute",
|
|
1356
|
-
kind: "async"
|
|
1357
|
-
})
|
|
1358
|
-
});
|
|
1359
|
-
|
|
1360
|
-
// src/auto-instrumentations/configs/openrouter-agent.ts
|
|
1361
|
-
var openRouterAgentConfigs = [
|
|
1362
|
-
{
|
|
1363
|
-
channelName: openRouterAgentChannels.callModel.channelName,
|
|
1364
|
-
module: {
|
|
1365
|
-
name: "@openrouter/agent",
|
|
1366
|
-
versionRange: ">=0.1.2",
|
|
1367
|
-
filePath: "esm/inner-loop/call-model.js"
|
|
1368
|
-
},
|
|
1369
|
-
functionQuery: {
|
|
1370
|
-
functionName: "callModel",
|
|
1371
|
-
kind: "Sync"
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
];
|
|
1375
|
-
|
|
1376
|
-
// src/instrumentation/plugins/openrouter-channels.ts
|
|
1377
|
-
var openRouterChannels = defineChannels("@openrouter/sdk", {
|
|
1378
|
-
chatSend: channel({
|
|
1379
|
-
channelName: "chat.send",
|
|
1380
|
-
kind: "async"
|
|
1381
|
-
}),
|
|
1382
|
-
embeddingsGenerate: channel({
|
|
1383
|
-
channelName: "embeddings.generate",
|
|
1384
|
-
kind: "async"
|
|
1385
|
-
}),
|
|
1386
|
-
rerankRerank: channel(
|
|
1387
|
-
{
|
|
1388
|
-
channelName: "rerank.rerank",
|
|
1389
|
-
kind: "async"
|
|
1390
|
-
}
|
|
1391
|
-
),
|
|
1392
|
-
betaResponsesSend: channel({
|
|
1393
|
-
channelName: "beta.responses.send",
|
|
1394
|
-
kind: "async"
|
|
1395
|
-
}),
|
|
1396
|
-
callModel: channel({
|
|
1397
|
-
channelName: "callModel",
|
|
2126
|
+
configureSync: channel({
|
|
2127
|
+
channelName: "CallbackManager._configureSync",
|
|
1398
2128
|
kind: "sync-stream"
|
|
1399
|
-
}),
|
|
1400
|
-
callModelTurn: channel({
|
|
1401
|
-
channelName: "callModel.turn",
|
|
1402
|
-
kind: "async"
|
|
1403
|
-
}),
|
|
1404
|
-
toolExecute: channel({
|
|
1405
|
-
channelName: "tool.execute",
|
|
1406
|
-
kind: "async"
|
|
1407
2129
|
})
|
|
1408
2130
|
});
|
|
1409
2131
|
|
|
1410
|
-
// src/auto-instrumentations/configs/
|
|
1411
|
-
var
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
module: {
|
|
1415
|
-
name: "@openrouter/sdk",
|
|
1416
|
-
versionRange: ">=0.9.11 <1.0.0",
|
|
1417
|
-
filePath: "esm/sdk/chat.js"
|
|
1418
|
-
},
|
|
1419
|
-
functionQuery: {
|
|
1420
|
-
className: "Chat",
|
|
1421
|
-
methodName: "send",
|
|
1422
|
-
kind: "Async"
|
|
1423
|
-
}
|
|
1424
|
-
},
|
|
1425
|
-
{
|
|
1426
|
-
channelName: openRouterChannels.embeddingsGenerate.channelName,
|
|
1427
|
-
module: {
|
|
1428
|
-
name: "@openrouter/sdk",
|
|
1429
|
-
versionRange: ">=0.9.11 <1.0.0",
|
|
1430
|
-
filePath: "esm/sdk/embeddings.js"
|
|
1431
|
-
},
|
|
1432
|
-
functionQuery: {
|
|
1433
|
-
className: "Embeddings",
|
|
1434
|
-
methodName: "generate",
|
|
1435
|
-
kind: "Async"
|
|
1436
|
-
}
|
|
1437
|
-
},
|
|
1438
|
-
{
|
|
1439
|
-
channelName: openRouterChannels.rerankRerank.channelName,
|
|
1440
|
-
module: {
|
|
1441
|
-
name: "@openrouter/sdk",
|
|
1442
|
-
versionRange: ">=0.12.0 <1.0.0",
|
|
1443
|
-
filePath: "esm/sdk/rerank.js"
|
|
1444
|
-
},
|
|
1445
|
-
functionQuery: {
|
|
1446
|
-
className: "Rerank",
|
|
1447
|
-
methodName: "rerank",
|
|
1448
|
-
kind: "Async"
|
|
1449
|
-
}
|
|
1450
|
-
},
|
|
2132
|
+
// src/auto-instrumentations/configs/langchain.ts
|
|
2133
|
+
var langChainCoreVersionRange = ">=0.3.42";
|
|
2134
|
+
var langChainCallbackManagerFilePath = "dist/callbacks/manager.js";
|
|
2135
|
+
var langchainConfigs = [
|
|
1451
2136
|
{
|
|
1452
|
-
channelName:
|
|
2137
|
+
channelName: langChainChannels.configure.channelName,
|
|
1453
2138
|
module: {
|
|
1454
|
-
name: "@
|
|
1455
|
-
versionRange:
|
|
1456
|
-
filePath:
|
|
2139
|
+
name: "@langchain/core",
|
|
2140
|
+
versionRange: langChainCoreVersionRange,
|
|
2141
|
+
filePath: langChainCallbackManagerFilePath
|
|
1457
2142
|
},
|
|
1458
2143
|
functionQuery: {
|
|
1459
|
-
className: "
|
|
1460
|
-
methodName: "
|
|
1461
|
-
kind: "
|
|
2144
|
+
className: "CallbackManager",
|
|
2145
|
+
methodName: "configure",
|
|
2146
|
+
kind: "Sync"
|
|
1462
2147
|
}
|
|
1463
2148
|
},
|
|
1464
2149
|
{
|
|
1465
|
-
channelName:
|
|
2150
|
+
channelName: langChainChannels.configureSync.channelName,
|
|
1466
2151
|
module: {
|
|
1467
|
-
name: "@
|
|
1468
|
-
versionRange:
|
|
1469
|
-
filePath:
|
|
2152
|
+
name: "@langchain/core",
|
|
2153
|
+
versionRange: langChainCoreVersionRange,
|
|
2154
|
+
filePath: langChainCallbackManagerFilePath
|
|
1470
2155
|
},
|
|
1471
2156
|
functionQuery: {
|
|
1472
|
-
className: "
|
|
1473
|
-
methodName: "
|
|
2157
|
+
className: "CallbackManager",
|
|
2158
|
+
methodName: "_configureSync",
|
|
1474
2159
|
kind: "Sync"
|
|
1475
2160
|
}
|
|
1476
2161
|
}
|
|
@@ -1482,12 +2167,28 @@ var mistralChannels = defineChannels("@mistralai/mistralai", {
|
|
|
1482
2167
|
channelName: "chat.complete",
|
|
1483
2168
|
kind: "async"
|
|
1484
2169
|
}),
|
|
1485
|
-
chatStream: channel({
|
|
1486
|
-
channelName: "chat.stream",
|
|
2170
|
+
chatStream: channel({
|
|
2171
|
+
channelName: "chat.stream",
|
|
2172
|
+
kind: "async"
|
|
2173
|
+
}),
|
|
2174
|
+
embeddingsCreate: channel({
|
|
2175
|
+
channelName: "embeddings.create",
|
|
2176
|
+
kind: "async"
|
|
2177
|
+
}),
|
|
2178
|
+
classifiersModerate: channel({
|
|
2179
|
+
channelName: "classifiers.moderate",
|
|
2180
|
+
kind: "async"
|
|
2181
|
+
}),
|
|
2182
|
+
classifiersModerateChat: channel({
|
|
2183
|
+
channelName: "classifiers.moderateChat",
|
|
1487
2184
|
kind: "async"
|
|
1488
2185
|
}),
|
|
1489
|
-
|
|
1490
|
-
channelName: "
|
|
2186
|
+
classifiersClassify: channel({
|
|
2187
|
+
channelName: "classifiers.classify",
|
|
2188
|
+
kind: "async"
|
|
2189
|
+
}),
|
|
2190
|
+
classifiersClassifyChat: channel({
|
|
2191
|
+
channelName: "classifiers.classifyChat",
|
|
1491
2192
|
kind: "async"
|
|
1492
2193
|
}),
|
|
1493
2194
|
fimComplete: channel({
|
|
@@ -1588,6 +2289,110 @@ var mistralConfigs = [
|
|
|
1588
2289
|
kind: "Async"
|
|
1589
2290
|
}
|
|
1590
2291
|
},
|
|
2292
|
+
{
|
|
2293
|
+
channelName: mistralChannels.classifiersModerate.channelName,
|
|
2294
|
+
module: {
|
|
2295
|
+
name: "@mistralai/mistralai",
|
|
2296
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
2297
|
+
filePath: "sdk/classifiers.js"
|
|
2298
|
+
},
|
|
2299
|
+
functionQuery: {
|
|
2300
|
+
className: "Classifiers",
|
|
2301
|
+
methodName: "moderate",
|
|
2302
|
+
kind: "Async"
|
|
2303
|
+
}
|
|
2304
|
+
},
|
|
2305
|
+
{
|
|
2306
|
+
channelName: mistralChannels.classifiersModerate.channelName,
|
|
2307
|
+
module: {
|
|
2308
|
+
name: "@mistralai/mistralai",
|
|
2309
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2310
|
+
filePath: "esm/sdk/classifiers.js"
|
|
2311
|
+
},
|
|
2312
|
+
functionQuery: {
|
|
2313
|
+
className: "Classifiers",
|
|
2314
|
+
methodName: "moderate",
|
|
2315
|
+
kind: "Async"
|
|
2316
|
+
}
|
|
2317
|
+
},
|
|
2318
|
+
{
|
|
2319
|
+
channelName: mistralChannels.classifiersModerateChat.channelName,
|
|
2320
|
+
module: {
|
|
2321
|
+
name: "@mistralai/mistralai",
|
|
2322
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
2323
|
+
filePath: "sdk/classifiers.js"
|
|
2324
|
+
},
|
|
2325
|
+
functionQuery: {
|
|
2326
|
+
className: "Classifiers",
|
|
2327
|
+
methodName: "moderateChat",
|
|
2328
|
+
kind: "Async"
|
|
2329
|
+
}
|
|
2330
|
+
},
|
|
2331
|
+
{
|
|
2332
|
+
channelName: mistralChannels.classifiersModerateChat.channelName,
|
|
2333
|
+
module: {
|
|
2334
|
+
name: "@mistralai/mistralai",
|
|
2335
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2336
|
+
filePath: "esm/sdk/classifiers.js"
|
|
2337
|
+
},
|
|
2338
|
+
functionQuery: {
|
|
2339
|
+
className: "Classifiers",
|
|
2340
|
+
methodName: "moderateChat",
|
|
2341
|
+
kind: "Async"
|
|
2342
|
+
}
|
|
2343
|
+
},
|
|
2344
|
+
{
|
|
2345
|
+
channelName: mistralChannels.classifiersClassify.channelName,
|
|
2346
|
+
module: {
|
|
2347
|
+
name: "@mistralai/mistralai",
|
|
2348
|
+
versionRange: ">=1.10.0 <2.0.0",
|
|
2349
|
+
filePath: "sdk/classifiers.js"
|
|
2350
|
+
},
|
|
2351
|
+
functionQuery: {
|
|
2352
|
+
className: "Classifiers",
|
|
2353
|
+
methodName: "classify",
|
|
2354
|
+
kind: "Async"
|
|
2355
|
+
}
|
|
2356
|
+
},
|
|
2357
|
+
{
|
|
2358
|
+
channelName: mistralChannels.classifiersClassify.channelName,
|
|
2359
|
+
module: {
|
|
2360
|
+
name: "@mistralai/mistralai",
|
|
2361
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2362
|
+
filePath: "esm/sdk/classifiers.js"
|
|
2363
|
+
},
|
|
2364
|
+
functionQuery: {
|
|
2365
|
+
className: "Classifiers",
|
|
2366
|
+
methodName: "classify",
|
|
2367
|
+
kind: "Async"
|
|
2368
|
+
}
|
|
2369
|
+
},
|
|
2370
|
+
{
|
|
2371
|
+
channelName: mistralChannels.classifiersClassifyChat.channelName,
|
|
2372
|
+
module: {
|
|
2373
|
+
name: "@mistralai/mistralai",
|
|
2374
|
+
versionRange: ">=1.10.0 <2.0.0",
|
|
2375
|
+
filePath: "sdk/classifiers.js"
|
|
2376
|
+
},
|
|
2377
|
+
functionQuery: {
|
|
2378
|
+
className: "Classifiers",
|
|
2379
|
+
methodName: "classifyChat",
|
|
2380
|
+
kind: "Async"
|
|
2381
|
+
}
|
|
2382
|
+
},
|
|
2383
|
+
{
|
|
2384
|
+
channelName: mistralChannels.classifiersClassifyChat.channelName,
|
|
2385
|
+
module: {
|
|
2386
|
+
name: "@mistralai/mistralai",
|
|
2387
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2388
|
+
filePath: "esm/sdk/classifiers.js"
|
|
2389
|
+
},
|
|
2390
|
+
functionQuery: {
|
|
2391
|
+
className: "Classifiers",
|
|
2392
|
+
methodName: "classifyChat",
|
|
2393
|
+
kind: "Async"
|
|
2394
|
+
}
|
|
2395
|
+
},
|
|
1591
2396
|
{
|
|
1592
2397
|
channelName: mistralChannels.fimComplete.channelName,
|
|
1593
2398
|
module: {
|
|
@@ -1694,281 +2499,512 @@ var mistralConfigs = [
|
|
|
1694
2499
|
}
|
|
1695
2500
|
];
|
|
1696
2501
|
|
|
1697
|
-
// src/instrumentation/plugins/
|
|
1698
|
-
var
|
|
1699
|
-
|
|
1700
|
-
channelName: "
|
|
2502
|
+
// src/instrumentation/plugins/openai-agents-channels.ts
|
|
2503
|
+
var openAIAgentsCoreChannels = defineChannels("@openai/agents-core", {
|
|
2504
|
+
onTraceStart: channel({
|
|
2505
|
+
channelName: "tracing.processor.onTraceStart",
|
|
1701
2506
|
kind: "async"
|
|
1702
2507
|
}),
|
|
1703
|
-
|
|
1704
|
-
channelName: "
|
|
2508
|
+
onTraceEnd: channel({
|
|
2509
|
+
channelName: "tracing.processor.onTraceEnd",
|
|
1705
2510
|
kind: "async"
|
|
1706
2511
|
}),
|
|
1707
|
-
|
|
1708
|
-
channelName: "
|
|
2512
|
+
onSpanStart: channel({
|
|
2513
|
+
channelName: "tracing.processor.onSpanStart",
|
|
1709
2514
|
kind: "async"
|
|
1710
2515
|
}),
|
|
1711
|
-
|
|
1712
|
-
channelName: "
|
|
2516
|
+
onSpanEnd: channel({
|
|
2517
|
+
channelName: "tracing.processor.onSpanEnd",
|
|
1713
2518
|
kind: "async"
|
|
1714
2519
|
})
|
|
1715
2520
|
});
|
|
1716
2521
|
|
|
1717
|
-
// src/auto-instrumentations/configs/
|
|
1718
|
-
var
|
|
2522
|
+
// src/auto-instrumentations/configs/openai-agents.ts
|
|
2523
|
+
var lifecycleMethods = [
|
|
2524
|
+
["onTraceStart", openAIAgentsCoreChannels.onTraceStart.channelName],
|
|
2525
|
+
["onTraceEnd", openAIAgentsCoreChannels.onTraceEnd.channelName],
|
|
2526
|
+
["onSpanStart", openAIAgentsCoreChannels.onSpanStart.channelName],
|
|
2527
|
+
["onSpanEnd", openAIAgentsCoreChannels.onSpanEnd.channelName]
|
|
2528
|
+
];
|
|
2529
|
+
var openAIAgentsCoreConfigs = lifecycleMethods.flatMap(
|
|
2530
|
+
([methodName, channelName]) => ["dist/tracing/processor.mjs", "dist/tracing/processor.js"].map(
|
|
2531
|
+
(filePath) => ({
|
|
2532
|
+
channelName,
|
|
2533
|
+
module: {
|
|
2534
|
+
name: "@openai/agents-core",
|
|
2535
|
+
versionRange: ">=0.0.14",
|
|
2536
|
+
filePath
|
|
2537
|
+
},
|
|
2538
|
+
functionQuery: {
|
|
2539
|
+
className: "MultiTracingProcessor",
|
|
2540
|
+
methodName,
|
|
2541
|
+
kind: "Async"
|
|
2542
|
+
}
|
|
2543
|
+
})
|
|
2544
|
+
)
|
|
2545
|
+
);
|
|
2546
|
+
|
|
2547
|
+
// src/instrumentation/plugins/openai-channels.ts
|
|
2548
|
+
var openAIChannels = defineChannels("openai", {
|
|
2549
|
+
chatCompletionsCreate: channel({
|
|
2550
|
+
channelName: "chat.completions.create",
|
|
2551
|
+
kind: "async"
|
|
2552
|
+
}),
|
|
2553
|
+
embeddingsCreate: channel({
|
|
2554
|
+
channelName: "embeddings.create",
|
|
2555
|
+
kind: "async"
|
|
2556
|
+
}),
|
|
2557
|
+
betaChatCompletionsParse: channel({
|
|
2558
|
+
channelName: "beta.chat.completions.parse",
|
|
2559
|
+
kind: "async"
|
|
2560
|
+
}),
|
|
2561
|
+
betaChatCompletionsStream: channel({
|
|
2562
|
+
channelName: "beta.chat.completions.stream",
|
|
2563
|
+
kind: "sync-stream"
|
|
2564
|
+
}),
|
|
2565
|
+
moderationsCreate: channel({
|
|
2566
|
+
channelName: "moderations.create",
|
|
2567
|
+
kind: "async"
|
|
2568
|
+
}),
|
|
2569
|
+
responsesCreate: channel({
|
|
2570
|
+
channelName: "responses.create",
|
|
2571
|
+
kind: "async"
|
|
2572
|
+
}),
|
|
2573
|
+
responsesStream: channel({
|
|
2574
|
+
channelName: "responses.stream",
|
|
2575
|
+
kind: "sync-stream"
|
|
2576
|
+
}),
|
|
2577
|
+
responsesParse: channel({
|
|
2578
|
+
channelName: "responses.parse",
|
|
2579
|
+
kind: "async"
|
|
2580
|
+
}),
|
|
2581
|
+
responsesCompact: channel({
|
|
2582
|
+
channelName: "responses.compact",
|
|
2583
|
+
kind: "async"
|
|
2584
|
+
})
|
|
2585
|
+
});
|
|
2586
|
+
|
|
2587
|
+
// src/auto-instrumentations/configs/openai.ts
|
|
2588
|
+
var openaiConfigs = [
|
|
2589
|
+
// Chat Completions
|
|
1719
2590
|
{
|
|
1720
|
-
channelName:
|
|
2591
|
+
channelName: openAIChannels.chatCompletionsCreate.channelName,
|
|
1721
2592
|
module: {
|
|
1722
|
-
name: "
|
|
1723
|
-
versionRange: ">=
|
|
1724
|
-
filePath: "
|
|
2593
|
+
name: "openai",
|
|
2594
|
+
versionRange: ">=4.0.0 <5.0.0",
|
|
2595
|
+
filePath: "resources/chat/completions.mjs"
|
|
1725
2596
|
},
|
|
1726
2597
|
functionQuery: {
|
|
1727
|
-
className: "
|
|
1728
|
-
methodName: "
|
|
2598
|
+
className: "Completions",
|
|
2599
|
+
methodName: "create",
|
|
1729
2600
|
kind: "Async"
|
|
1730
2601
|
}
|
|
1731
2602
|
},
|
|
1732
2603
|
{
|
|
1733
|
-
channelName:
|
|
2604
|
+
channelName: openAIChannels.chatCompletionsCreate.channelName,
|
|
1734
2605
|
module: {
|
|
1735
|
-
name: "
|
|
1736
|
-
versionRange: ">=
|
|
1737
|
-
filePath: "
|
|
2606
|
+
name: "openai",
|
|
2607
|
+
versionRange: ">=4.0.0 <5.0.0",
|
|
2608
|
+
filePath: "resources/chat/completions/completions.mjs"
|
|
1738
2609
|
},
|
|
1739
2610
|
functionQuery: {
|
|
1740
|
-
className: "
|
|
1741
|
-
methodName: "
|
|
2611
|
+
className: "Completions",
|
|
2612
|
+
methodName: "create",
|
|
1742
2613
|
kind: "Async"
|
|
1743
2614
|
}
|
|
1744
2615
|
},
|
|
1745
2616
|
{
|
|
1746
|
-
channelName:
|
|
2617
|
+
channelName: openAIChannels.chatCompletionsCreate.channelName,
|
|
1747
2618
|
module: {
|
|
1748
|
-
name: "
|
|
1749
|
-
versionRange: ">=
|
|
1750
|
-
filePath: "
|
|
2619
|
+
name: "openai",
|
|
2620
|
+
versionRange: ">=5.0.0",
|
|
2621
|
+
filePath: "resources/chat/completions/completions.mjs"
|
|
1751
2622
|
},
|
|
1752
2623
|
functionQuery: {
|
|
1753
|
-
className: "
|
|
1754
|
-
methodName: "
|
|
2624
|
+
className: "Completions",
|
|
2625
|
+
methodName: "create",
|
|
1755
2626
|
kind: "Async"
|
|
1756
2627
|
}
|
|
1757
2628
|
},
|
|
2629
|
+
// Embeddings
|
|
1758
2630
|
{
|
|
1759
|
-
channelName:
|
|
2631
|
+
channelName: openAIChannels.embeddingsCreate.channelName,
|
|
1760
2632
|
module: {
|
|
1761
|
-
name: "
|
|
1762
|
-
versionRange: ">=
|
|
1763
|
-
filePath: "
|
|
2633
|
+
name: "openai",
|
|
2634
|
+
versionRange: ">=4.0.0",
|
|
2635
|
+
filePath: "resources/embeddings.mjs"
|
|
1764
2636
|
},
|
|
1765
2637
|
functionQuery: {
|
|
1766
|
-
className: "
|
|
1767
|
-
methodName: "
|
|
2638
|
+
className: "Embeddings",
|
|
2639
|
+
methodName: "create",
|
|
1768
2640
|
kind: "Async"
|
|
1769
2641
|
}
|
|
1770
2642
|
},
|
|
2643
|
+
// Beta Chat Completions Parse
|
|
1771
2644
|
{
|
|
1772
|
-
channelName:
|
|
2645
|
+
channelName: openAIChannels.betaChatCompletionsParse.channelName,
|
|
1773
2646
|
module: {
|
|
1774
|
-
name: "
|
|
1775
|
-
versionRange: ">=
|
|
1776
|
-
filePath: "
|
|
2647
|
+
name: "openai",
|
|
2648
|
+
versionRange: ">=4.0.0 <5.0.0",
|
|
2649
|
+
filePath: "resources/beta/chat/completions.mjs"
|
|
1777
2650
|
},
|
|
1778
2651
|
functionQuery: {
|
|
1779
|
-
className: "
|
|
1780
|
-
methodName: "
|
|
2652
|
+
className: "Completions",
|
|
2653
|
+
methodName: "parse",
|
|
1781
2654
|
kind: "Async"
|
|
1782
2655
|
}
|
|
1783
2656
|
},
|
|
1784
2657
|
{
|
|
1785
|
-
channelName:
|
|
2658
|
+
channelName: openAIChannels.betaChatCompletionsParse.channelName,
|
|
1786
2659
|
module: {
|
|
1787
|
-
name: "
|
|
1788
|
-
versionRange: ">=
|
|
1789
|
-
filePath: "
|
|
2660
|
+
name: "openai",
|
|
2661
|
+
versionRange: ">=5.0.0",
|
|
2662
|
+
filePath: "resources/chat/completions/completions.mjs"
|
|
2663
|
+
},
|
|
2664
|
+
functionQuery: {
|
|
2665
|
+
className: "Completions",
|
|
2666
|
+
methodName: "parse",
|
|
2667
|
+
kind: "Async"
|
|
2668
|
+
}
|
|
2669
|
+
},
|
|
2670
|
+
// Moderations
|
|
2671
|
+
{
|
|
2672
|
+
channelName: openAIChannels.moderationsCreate.channelName,
|
|
2673
|
+
module: {
|
|
2674
|
+
name: "openai",
|
|
2675
|
+
versionRange: ">=4.0.0",
|
|
2676
|
+
filePath: "resources/moderations.mjs"
|
|
2677
|
+
},
|
|
2678
|
+
functionQuery: {
|
|
2679
|
+
className: "Moderations",
|
|
2680
|
+
methodName: "create",
|
|
2681
|
+
kind: "Async"
|
|
2682
|
+
}
|
|
2683
|
+
},
|
|
2684
|
+
// Beta Chat Completions Stream
|
|
2685
|
+
{
|
|
2686
|
+
channelName: openAIChannels.betaChatCompletionsStream.channelName,
|
|
2687
|
+
module: {
|
|
2688
|
+
name: "openai",
|
|
2689
|
+
versionRange: ">=4.0.0 <5.0.0",
|
|
2690
|
+
filePath: "resources/beta/chat/completions.mjs"
|
|
2691
|
+
},
|
|
2692
|
+
functionQuery: {
|
|
2693
|
+
className: "Completions",
|
|
2694
|
+
methodName: "stream",
|
|
2695
|
+
kind: "Sync"
|
|
2696
|
+
}
|
|
2697
|
+
},
|
|
2698
|
+
{
|
|
2699
|
+
channelName: openAIChannels.betaChatCompletionsStream.channelName,
|
|
2700
|
+
module: {
|
|
2701
|
+
name: "openai",
|
|
2702
|
+
versionRange: ">=5.0.0",
|
|
2703
|
+
filePath: "resources/chat/completions/completions.mjs"
|
|
2704
|
+
},
|
|
2705
|
+
functionQuery: {
|
|
2706
|
+
className: "Completions",
|
|
2707
|
+
methodName: "stream",
|
|
2708
|
+
kind: "Sync"
|
|
2709
|
+
}
|
|
2710
|
+
},
|
|
2711
|
+
// Responses API (v4.87.0+)
|
|
2712
|
+
{
|
|
2713
|
+
channelName: openAIChannels.responsesCreate.channelName,
|
|
2714
|
+
module: {
|
|
2715
|
+
name: "openai",
|
|
2716
|
+
versionRange: ">=4.87.0",
|
|
2717
|
+
filePath: "resources/responses/responses.mjs"
|
|
1790
2718
|
},
|
|
1791
2719
|
functionQuery: {
|
|
1792
|
-
className: "
|
|
1793
|
-
methodName: "
|
|
2720
|
+
className: "Responses",
|
|
2721
|
+
methodName: "create",
|
|
1794
2722
|
kind: "Async"
|
|
1795
2723
|
}
|
|
1796
2724
|
},
|
|
1797
2725
|
{
|
|
1798
|
-
channelName:
|
|
2726
|
+
channelName: openAIChannels.responsesStream.channelName,
|
|
1799
2727
|
module: {
|
|
1800
|
-
name: "
|
|
1801
|
-
versionRange: ">=
|
|
1802
|
-
filePath: "
|
|
2728
|
+
name: "openai",
|
|
2729
|
+
versionRange: ">=4.87.0",
|
|
2730
|
+
filePath: "resources/responses/responses.mjs"
|
|
1803
2731
|
},
|
|
1804
2732
|
functionQuery: {
|
|
1805
|
-
className: "
|
|
1806
|
-
methodName: "
|
|
1807
|
-
kind: "
|
|
2733
|
+
className: "Responses",
|
|
2734
|
+
methodName: "stream",
|
|
2735
|
+
kind: "Sync"
|
|
1808
2736
|
}
|
|
1809
2737
|
},
|
|
1810
2738
|
{
|
|
1811
|
-
channelName:
|
|
2739
|
+
channelName: openAIChannels.responsesParse.channelName,
|
|
1812
2740
|
module: {
|
|
1813
|
-
name: "
|
|
1814
|
-
versionRange: ">=
|
|
1815
|
-
filePath: "
|
|
2741
|
+
name: "openai",
|
|
2742
|
+
versionRange: ">=4.87.0",
|
|
2743
|
+
filePath: "resources/responses/responses.mjs"
|
|
1816
2744
|
},
|
|
1817
2745
|
functionQuery: {
|
|
1818
|
-
className: "
|
|
1819
|
-
methodName: "
|
|
2746
|
+
className: "Responses",
|
|
2747
|
+
methodName: "parse",
|
|
1820
2748
|
kind: "Async"
|
|
1821
2749
|
}
|
|
1822
2750
|
},
|
|
1823
2751
|
{
|
|
1824
|
-
channelName:
|
|
2752
|
+
channelName: openAIChannels.responsesCompact.channelName,
|
|
1825
2753
|
module: {
|
|
1826
|
-
name: "
|
|
1827
|
-
versionRange: ">=
|
|
1828
|
-
filePath: "
|
|
2754
|
+
name: "openai",
|
|
2755
|
+
versionRange: ">=6.10.0",
|
|
2756
|
+
filePath: "resources/responses/responses.mjs"
|
|
1829
2757
|
},
|
|
1830
2758
|
functionQuery: {
|
|
1831
|
-
className: "
|
|
1832
|
-
methodName: "
|
|
2759
|
+
className: "Responses",
|
|
2760
|
+
methodName: "compact",
|
|
1833
2761
|
kind: "Async"
|
|
1834
2762
|
}
|
|
1835
|
-
}
|
|
2763
|
+
}
|
|
2764
|
+
];
|
|
2765
|
+
|
|
2766
|
+
// src/instrumentation/plugins/openai-codex-channels.ts
|
|
2767
|
+
var openAICodexChannels = defineChannels("@openai/codex-sdk", {
|
|
2768
|
+
run: channel({
|
|
2769
|
+
channelName: "Thread.run",
|
|
2770
|
+
kind: "async"
|
|
2771
|
+
}),
|
|
2772
|
+
runStreamed: channel({
|
|
2773
|
+
channelName: "Thread.runStreamed",
|
|
2774
|
+
kind: "async"
|
|
2775
|
+
})
|
|
2776
|
+
});
|
|
2777
|
+
|
|
2778
|
+
// src/auto-instrumentations/configs/openai-codex.ts
|
|
2779
|
+
var openAICodexVersionRange = ">=0.128.0 <1.0.0";
|
|
2780
|
+
var openAICodexConfigs = [
|
|
1836
2781
|
{
|
|
1837
|
-
channelName:
|
|
2782
|
+
channelName: openAICodexChannels.run.channelName,
|
|
1838
2783
|
module: {
|
|
1839
|
-
name: "
|
|
1840
|
-
versionRange:
|
|
1841
|
-
filePath: "
|
|
2784
|
+
name: "@openai/codex-sdk",
|
|
2785
|
+
versionRange: openAICodexVersionRange,
|
|
2786
|
+
filePath: "dist/index.js"
|
|
1842
2787
|
},
|
|
1843
2788
|
functionQuery: {
|
|
1844
|
-
className: "
|
|
1845
|
-
methodName: "
|
|
2789
|
+
className: "Thread",
|
|
2790
|
+
methodName: "run",
|
|
1846
2791
|
kind: "Async"
|
|
1847
2792
|
}
|
|
1848
2793
|
},
|
|
1849
2794
|
{
|
|
1850
|
-
channelName:
|
|
2795
|
+
channelName: openAICodexChannels.runStreamed.channelName,
|
|
1851
2796
|
module: {
|
|
1852
|
-
name: "
|
|
1853
|
-
versionRange:
|
|
1854
|
-
filePath: "
|
|
2797
|
+
name: "@openai/codex-sdk",
|
|
2798
|
+
versionRange: openAICodexVersionRange,
|
|
2799
|
+
filePath: "dist/index.js"
|
|
1855
2800
|
},
|
|
1856
2801
|
functionQuery: {
|
|
1857
|
-
className: "
|
|
1858
|
-
methodName: "
|
|
2802
|
+
className: "Thread",
|
|
2803
|
+
methodName: "runStreamed",
|
|
1859
2804
|
kind: "Async"
|
|
1860
2805
|
}
|
|
1861
|
-
}
|
|
2806
|
+
}
|
|
2807
|
+
];
|
|
2808
|
+
|
|
2809
|
+
// src/instrumentation/plugins/openrouter-channels.ts
|
|
2810
|
+
var openRouterChannels = defineChannels("@openrouter/sdk", {
|
|
2811
|
+
chatSend: channel({
|
|
2812
|
+
channelName: "chat.send",
|
|
2813
|
+
kind: "async"
|
|
2814
|
+
}),
|
|
2815
|
+
embeddingsGenerate: channel({
|
|
2816
|
+
channelName: "embeddings.generate",
|
|
2817
|
+
kind: "async"
|
|
2818
|
+
}),
|
|
2819
|
+
rerankRerank: channel(
|
|
2820
|
+
{
|
|
2821
|
+
channelName: "rerank.rerank",
|
|
2822
|
+
kind: "async"
|
|
2823
|
+
}
|
|
2824
|
+
),
|
|
2825
|
+
betaResponsesSend: channel({
|
|
2826
|
+
channelName: "beta.responses.send",
|
|
2827
|
+
kind: "async"
|
|
2828
|
+
}),
|
|
2829
|
+
callModel: channel({
|
|
2830
|
+
channelName: "callModel",
|
|
2831
|
+
kind: "sync-stream"
|
|
2832
|
+
}),
|
|
2833
|
+
callModelTurn: channel({
|
|
2834
|
+
channelName: "callModel.turn",
|
|
2835
|
+
kind: "async"
|
|
2836
|
+
}),
|
|
2837
|
+
toolExecute: channel({
|
|
2838
|
+
channelName: "tool.execute",
|
|
2839
|
+
kind: "async"
|
|
2840
|
+
})
|
|
2841
|
+
});
|
|
2842
|
+
|
|
2843
|
+
// src/auto-instrumentations/configs/openrouter.ts
|
|
2844
|
+
var openRouterConfigs = [
|
|
1862
2845
|
{
|
|
1863
|
-
channelName:
|
|
2846
|
+
channelName: openRouterChannels.chatSend.channelName,
|
|
1864
2847
|
module: {
|
|
1865
|
-
name: "
|
|
1866
|
-
versionRange: ">=
|
|
1867
|
-
filePath: "
|
|
2848
|
+
name: "@openrouter/sdk",
|
|
2849
|
+
versionRange: ">=0.9.11 <1.0.0",
|
|
2850
|
+
filePath: "esm/sdk/chat.js"
|
|
1868
2851
|
},
|
|
1869
2852
|
functionQuery: {
|
|
1870
|
-
className: "
|
|
1871
|
-
methodName: "
|
|
2853
|
+
className: "Chat",
|
|
2854
|
+
methodName: "send",
|
|
1872
2855
|
kind: "Async"
|
|
1873
2856
|
}
|
|
1874
2857
|
},
|
|
1875
2858
|
{
|
|
1876
|
-
channelName:
|
|
2859
|
+
channelName: openRouterChannels.embeddingsGenerate.channelName,
|
|
1877
2860
|
module: {
|
|
1878
|
-
name: "
|
|
1879
|
-
versionRange: ">=
|
|
1880
|
-
filePath: "
|
|
2861
|
+
name: "@openrouter/sdk",
|
|
2862
|
+
versionRange: ">=0.9.11 <1.0.0",
|
|
2863
|
+
filePath: "esm/sdk/embeddings.js"
|
|
1881
2864
|
},
|
|
1882
2865
|
functionQuery: {
|
|
1883
|
-
className: "
|
|
1884
|
-
methodName: "
|
|
2866
|
+
className: "Embeddings",
|
|
2867
|
+
methodName: "generate",
|
|
1885
2868
|
kind: "Async"
|
|
1886
2869
|
}
|
|
1887
2870
|
},
|
|
1888
2871
|
{
|
|
1889
|
-
channelName:
|
|
2872
|
+
channelName: openRouterChannels.rerankRerank.channelName,
|
|
1890
2873
|
module: {
|
|
1891
|
-
name: "
|
|
1892
|
-
versionRange: ">=
|
|
1893
|
-
filePath: "
|
|
2874
|
+
name: "@openrouter/sdk",
|
|
2875
|
+
versionRange: ">=0.12.0 <1.0.0",
|
|
2876
|
+
filePath: "esm/sdk/rerank.js"
|
|
1894
2877
|
},
|
|
1895
2878
|
functionQuery: {
|
|
1896
|
-
className: "
|
|
2879
|
+
className: "Rerank",
|
|
1897
2880
|
methodName: "rerank",
|
|
1898
2881
|
kind: "Async"
|
|
1899
2882
|
}
|
|
1900
2883
|
},
|
|
1901
2884
|
{
|
|
1902
|
-
channelName:
|
|
2885
|
+
channelName: openRouterChannels.betaResponsesSend.channelName,
|
|
1903
2886
|
module: {
|
|
1904
|
-
name: "
|
|
1905
|
-
versionRange: ">=
|
|
1906
|
-
filePath: "
|
|
2887
|
+
name: "@openrouter/sdk",
|
|
2888
|
+
versionRange: ">=0.9.11 <1.0.0",
|
|
2889
|
+
filePath: "esm/sdk/responses.js"
|
|
1907
2890
|
},
|
|
1908
2891
|
functionQuery: {
|
|
1909
|
-
className: "
|
|
1910
|
-
methodName: "
|
|
2892
|
+
className: "Responses",
|
|
2893
|
+
methodName: "send",
|
|
1911
2894
|
kind: "Async"
|
|
1912
2895
|
}
|
|
1913
2896
|
},
|
|
1914
2897
|
{
|
|
1915
|
-
channelName:
|
|
2898
|
+
channelName: openRouterChannels.callModel.channelName,
|
|
1916
2899
|
module: {
|
|
1917
|
-
name: "
|
|
1918
|
-
versionRange: ">=
|
|
1919
|
-
filePath: "
|
|
2900
|
+
name: "@openrouter/sdk",
|
|
2901
|
+
versionRange: ">=0.9.11 <1.0.0",
|
|
2902
|
+
filePath: "esm/sdk/sdk.js"
|
|
1920
2903
|
},
|
|
1921
2904
|
functionQuery: {
|
|
1922
|
-
className: "
|
|
1923
|
-
methodName: "
|
|
1924
|
-
kind: "
|
|
2905
|
+
className: "OpenRouter",
|
|
2906
|
+
methodName: "callModel",
|
|
2907
|
+
kind: "Sync"
|
|
1925
2908
|
}
|
|
1926
2909
|
}
|
|
1927
2910
|
];
|
|
1928
2911
|
|
|
1929
|
-
// src/instrumentation/plugins/
|
|
1930
|
-
var
|
|
1931
|
-
|
|
1932
|
-
channelName: "
|
|
2912
|
+
// src/instrumentation/plugins/openrouter-agent-channels.ts
|
|
2913
|
+
var openRouterAgentChannels = defineChannels("@openrouter/agent", {
|
|
2914
|
+
callModel: channel({
|
|
2915
|
+
channelName: "callModel",
|
|
2916
|
+
kind: "sync-stream"
|
|
2917
|
+
}),
|
|
2918
|
+
callModelTurn: channel({
|
|
2919
|
+
channelName: "callModel.turn",
|
|
1933
2920
|
kind: "async"
|
|
1934
2921
|
}),
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
}
|
|
1940
|
-
)
|
|
2922
|
+
toolExecute: channel({
|
|
2923
|
+
channelName: "tool.execute",
|
|
2924
|
+
kind: "async"
|
|
2925
|
+
})
|
|
1941
2926
|
});
|
|
1942
2927
|
|
|
1943
|
-
// src/auto-instrumentations/configs/
|
|
1944
|
-
var
|
|
2928
|
+
// src/auto-instrumentations/configs/openrouter-agent.ts
|
|
2929
|
+
var openRouterAgentConfigs = [
|
|
1945
2930
|
{
|
|
1946
|
-
channelName:
|
|
2931
|
+
channelName: openRouterAgentChannels.callModel.channelName,
|
|
1947
2932
|
module: {
|
|
1948
|
-
name: "
|
|
1949
|
-
versionRange: ">=1.
|
|
1950
|
-
filePath: "
|
|
2933
|
+
name: "@openrouter/agent",
|
|
2934
|
+
versionRange: ">=0.1.2",
|
|
2935
|
+
filePath: "esm/inner-loop/call-model.js"
|
|
1951
2936
|
},
|
|
1952
2937
|
functionQuery: {
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
kind: "Async"
|
|
2938
|
+
functionName: "callModel",
|
|
2939
|
+
kind: "Sync"
|
|
1956
2940
|
}
|
|
2941
|
+
}
|
|
2942
|
+
];
|
|
2943
|
+
|
|
2944
|
+
// src/auto-instrumentations/configs/all.ts
|
|
2945
|
+
var defaultInstrumentationConfigGroups = [
|
|
2946
|
+
{ integrations: ["openai"], configs: openaiConfigs },
|
|
2947
|
+
{
|
|
2948
|
+
integrations: ["openaiCodexSDK"],
|
|
2949
|
+
configs: openAICodexConfigs
|
|
1957
2950
|
},
|
|
2951
|
+
{ integrations: ["anthropic"], configs: anthropicConfigs },
|
|
1958
2952
|
{
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
2953
|
+
integrations: ["aisdk", "vercel"],
|
|
2954
|
+
configs: aiSDKConfigs
|
|
2955
|
+
},
|
|
2956
|
+
{
|
|
2957
|
+
integrations: ["claudeAgentSDK"],
|
|
2958
|
+
configs: claudeAgentSDKConfigs
|
|
2959
|
+
},
|
|
2960
|
+
{ integrations: ["cursor", "cursorSDK"], configs: cursorSDKConfigs },
|
|
2961
|
+
{ integrations: ["flue"], configs: flueConfigs },
|
|
2962
|
+
{
|
|
2963
|
+
integrations: ["openAIAgents"],
|
|
2964
|
+
configs: openAIAgentsCoreConfigs
|
|
2965
|
+
},
|
|
2966
|
+
{
|
|
2967
|
+
integrations: ["google", "googleGenAI"],
|
|
2968
|
+
configs: googleGenAIConfigs
|
|
2969
|
+
},
|
|
2970
|
+
{ integrations: ["huggingface"], configs: huggingFaceConfigs },
|
|
2971
|
+
{
|
|
2972
|
+
integrations: ["langchain", "langgraph"],
|
|
2973
|
+
configs: langchainConfigs
|
|
2974
|
+
},
|
|
2975
|
+
{ integrations: ["openrouter"], configs: openRouterConfigs },
|
|
2976
|
+
{
|
|
2977
|
+
integrations: ["openrouterAgent"],
|
|
2978
|
+
configs: openRouterAgentConfigs
|
|
2979
|
+
},
|
|
2980
|
+
{ integrations: ["mistral"], configs: mistralConfigs },
|
|
2981
|
+
{ integrations: ["googleADK"], configs: googleADKConfigs },
|
|
2982
|
+
{ integrations: ["cohere"], configs: cohereConfigs },
|
|
2983
|
+
{ integrations: ["groq"], configs: groqConfigs },
|
|
2984
|
+
{
|
|
2985
|
+
integrations: ["genkit"],
|
|
2986
|
+
configs: genkitConfigs
|
|
2987
|
+
},
|
|
2988
|
+
{
|
|
2989
|
+
integrations: ["gitHubCopilot"],
|
|
2990
|
+
configs: gitHubCopilotConfigs
|
|
1970
2991
|
}
|
|
1971
2992
|
];
|
|
2993
|
+
function getDefaultInstrumentationConfigs({
|
|
2994
|
+
additionalInstrumentations,
|
|
2995
|
+
disabledIntegrationConfig,
|
|
2996
|
+
disabledIntegrations
|
|
2997
|
+
} = {}) {
|
|
2998
|
+
const disabledConfig = disabledIntegrationConfig ?? (disabledIntegrations ? readDisabledInstrumentationEnvConfig(
|
|
2999
|
+
[...disabledIntegrations].join(",")
|
|
3000
|
+
).integrations : void 0);
|
|
3001
|
+
return [
|
|
3002
|
+
...defaultInstrumentationConfigGroups.flatMap(
|
|
3003
|
+
({ configs, integrations }) => isInstrumentationIntegrationDisabled(disabledConfig, ...integrations) ? [] : configs
|
|
3004
|
+
),
|
|
3005
|
+
...additionalInstrumentations ?? []
|
|
3006
|
+
];
|
|
3007
|
+
}
|
|
1972
3008
|
|
|
1973
3009
|
// src/auto-instrumentations/bundler/plugin.ts
|
|
1974
3010
|
function getModuleVersion(basedir) {
|
|
@@ -1982,77 +3018,79 @@ function getModuleVersion(basedir) {
|
|
|
1982
3018
|
}
|
|
1983
3019
|
return void 0;
|
|
1984
3020
|
}
|
|
1985
|
-
var unplugin = (0, import_unplugin.createUnplugin)(
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
if (!moduleVersion) {
|
|
2024
|
-
console.warn(
|
|
2025
|
-
`No 'package.json' version found for module ${moduleName} at ${moduleDetails.basedir}. Skipping transformation.`
|
|
3021
|
+
var unplugin = (0, import_unplugin.createUnplugin)(
|
|
3022
|
+
(options = {}) => {
|
|
3023
|
+
const allInstrumentations = getDefaultInstrumentationConfigs({
|
|
3024
|
+
additionalInstrumentations: options.instrumentations
|
|
3025
|
+
});
|
|
3026
|
+
const dcModule = options.browser === false ? void 0 : "dc-browser";
|
|
3027
|
+
const instrumentationMatcher = (0, import_code_transformer.create)(allInstrumentations, dcModule);
|
|
3028
|
+
return {
|
|
3029
|
+
name: "code-transformer",
|
|
3030
|
+
enforce: "pre",
|
|
3031
|
+
transform(code, id) {
|
|
3032
|
+
if (!id) {
|
|
3033
|
+
return null;
|
|
3034
|
+
}
|
|
3035
|
+
const filePath = id.startsWith("file:") ? (0, import_url.fileURLToPath)(id) : id;
|
|
3036
|
+
const ext = (0, import_path.extname)(filePath);
|
|
3037
|
+
let isModule = ext === ".mjs" || ext === ".ts" || ext === ".tsx";
|
|
3038
|
+
if (ext === ".js") {
|
|
3039
|
+
isModule = code.includes("export ") || code.includes("import ");
|
|
3040
|
+
}
|
|
3041
|
+
const normalizedForPlatform = filePath.split("/").join(import_path.sep);
|
|
3042
|
+
const moduleDetails = (0, import_module_details_from_path.default)(normalizedForPlatform);
|
|
3043
|
+
if (!moduleDetails) {
|
|
3044
|
+
return null;
|
|
3045
|
+
}
|
|
3046
|
+
const moduleName = moduleDetails.name;
|
|
3047
|
+
const moduleVersion = getModuleVersion(moduleDetails.basedir);
|
|
3048
|
+
if (!moduleVersion) {
|
|
3049
|
+
console.warn(
|
|
3050
|
+
`No 'package.json' version found for module ${moduleName} at ${moduleDetails.basedir}. Skipping transformation.`
|
|
3051
|
+
);
|
|
3052
|
+
return null;
|
|
3053
|
+
}
|
|
3054
|
+
const normalizedModulePath = moduleDetails.path.replace(/\\/g, "/");
|
|
3055
|
+
const transformer = instrumentationMatcher.getTransformer(
|
|
3056
|
+
moduleName,
|
|
3057
|
+
moduleVersion,
|
|
3058
|
+
normalizedModulePath
|
|
2026
3059
|
);
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
}
|
|
2045
|
-
} catch (error) {
|
|
2046
|
-
console.warn(`Code transformation failed for ${id}: ${error}`);
|
|
2047
|
-
return null;
|
|
3060
|
+
if (!transformer) {
|
|
3061
|
+
return null;
|
|
3062
|
+
}
|
|
3063
|
+
try {
|
|
3064
|
+
const moduleType = isModule ? "esm" : "cjs";
|
|
3065
|
+
const result = transformer.transform(code, moduleType);
|
|
3066
|
+
const transformedCode = result.code.replace(
|
|
3067
|
+
/const \{tracingChannel: ([A-Za-z_$][\w$]*)\} = ([A-Za-z_$][\w$]*);/g,
|
|
3068
|
+
"const $1 = $2.tracingChannel;"
|
|
3069
|
+
);
|
|
3070
|
+
return {
|
|
3071
|
+
code: transformedCode,
|
|
3072
|
+
map: result.map
|
|
3073
|
+
};
|
|
3074
|
+
} catch (error) {
|
|
3075
|
+
console.warn(`Code transformation failed for ${id}: ${error}`);
|
|
3076
|
+
return null;
|
|
3077
|
+
}
|
|
2048
3078
|
}
|
|
2049
|
-
}
|
|
2050
|
-
}
|
|
2051
|
-
|
|
3079
|
+
};
|
|
3080
|
+
}
|
|
3081
|
+
);
|
|
2052
3082
|
|
|
2053
3083
|
// src/auto-instrumentations/bundler/esbuild.ts
|
|
3084
|
+
function braintrustEsbuildPlugin(options = {}) {
|
|
3085
|
+
const { useDiagnosticChannelCompatShim = false, ...pluginOptions } = options;
|
|
3086
|
+
return unplugin.esbuild({
|
|
3087
|
+
...pluginOptions,
|
|
3088
|
+
browser: useDiagnosticChannelCompatShim
|
|
3089
|
+
});
|
|
3090
|
+
}
|
|
2054
3091
|
var esbuildPlugin = unplugin.esbuild;
|
|
2055
3092
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2056
3093
|
0 && (module.exports = {
|
|
3094
|
+
braintrustEsbuildPlugin,
|
|
2057
3095
|
esbuildPlugin
|
|
2058
3096
|
});
|