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
|
@@ -0,0 +1,3268 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/auto-instrumentations/bundler/next.ts
|
|
31
|
+
var next_exports = {};
|
|
32
|
+
__export(next_exports, {
|
|
33
|
+
wrapNextjsConfigWithBraintrust: () => wrapNextjsConfigWithBraintrust
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(next_exports);
|
|
36
|
+
var import_node_module = require("module");
|
|
37
|
+
var import_node_path = require("path");
|
|
38
|
+
|
|
39
|
+
// src/auto-instrumentations/bundler/plugin.ts
|
|
40
|
+
var import_unplugin = require("unplugin");
|
|
41
|
+
var import_code_transformer = require("@apm-js-collab/code-transformer");
|
|
42
|
+
var import_path = require("path");
|
|
43
|
+
var import_fs = require("fs");
|
|
44
|
+
var import_url = require("url");
|
|
45
|
+
var import_module_details_from_path = __toESM(require("module-details-from-path"));
|
|
46
|
+
|
|
47
|
+
// src/instrumentation/config.ts
|
|
48
|
+
var envIntegrationAliases = {
|
|
49
|
+
openai: "openai",
|
|
50
|
+
"openai-codex": "openaiCodexSDK",
|
|
51
|
+
"openai-codex-sdk": "openaiCodexSDK",
|
|
52
|
+
openaicodexsdk: "openaiCodexSDK",
|
|
53
|
+
codex: "openaiCodexSDK",
|
|
54
|
+
"codex-sdk": "openaiCodexSDK",
|
|
55
|
+
anthropic: "anthropic",
|
|
56
|
+
aisdk: "aisdk",
|
|
57
|
+
"ai-sdk": "aisdk",
|
|
58
|
+
"vercel-ai": "aisdk",
|
|
59
|
+
vercel: "vercel",
|
|
60
|
+
claudeagentsdk: "claudeAgentSDK",
|
|
61
|
+
"claude-agent-sdk": "claudeAgentSDK",
|
|
62
|
+
cursor: "cursor",
|
|
63
|
+
"cursor-sdk": "cursorSDK",
|
|
64
|
+
cursorsdk: "cursorSDK",
|
|
65
|
+
flue: "flue",
|
|
66
|
+
"flue-runtime": "flue",
|
|
67
|
+
"openai-agents": "openAIAgents",
|
|
68
|
+
openaiagents: "openAIAgents",
|
|
69
|
+
"openai-agents-core": "openAIAgents",
|
|
70
|
+
openaiagentscore: "openAIAgents",
|
|
71
|
+
google: "google",
|
|
72
|
+
"google-genai": "googleGenAI",
|
|
73
|
+
googlegenai: "googleGenAI",
|
|
74
|
+
huggingface: "huggingface",
|
|
75
|
+
openrouter: "openrouter",
|
|
76
|
+
openrouteragent: "openrouterAgent",
|
|
77
|
+
"openrouter-agent": "openrouterAgent",
|
|
78
|
+
mistral: "mistral",
|
|
79
|
+
googleadk: "googleADK",
|
|
80
|
+
"google-adk": "googleADK",
|
|
81
|
+
cohere: "cohere",
|
|
82
|
+
groq: "groq",
|
|
83
|
+
"groq-sdk": "groq",
|
|
84
|
+
genkit: "genkit",
|
|
85
|
+
"firebase-genkit": "genkit",
|
|
86
|
+
githubcopilot: "gitHubCopilot",
|
|
87
|
+
"github-copilot": "gitHubCopilot",
|
|
88
|
+
"copilot-sdk": "gitHubCopilot",
|
|
89
|
+
langchain: "langchain",
|
|
90
|
+
"langchain-js": "langchain",
|
|
91
|
+
"@langchain": "langchain",
|
|
92
|
+
langgraph: "langgraph"
|
|
93
|
+
};
|
|
94
|
+
function readDisabledInstrumentationEnvConfig(disabledList) {
|
|
95
|
+
const integrations = {};
|
|
96
|
+
if (disabledList) {
|
|
97
|
+
for (const value of disabledList.split(",")) {
|
|
98
|
+
const sdk = value.trim().toLowerCase();
|
|
99
|
+
if (sdk.length > 0) {
|
|
100
|
+
integrations[envIntegrationAliases[sdk] ?? sdk] = false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return { integrations };
|
|
105
|
+
}
|
|
106
|
+
function isInstrumentationIntegrationDisabled(integrations, ...names) {
|
|
107
|
+
return names.some((name) => integrations?.[name] === false);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// src/isomorph.ts
|
|
111
|
+
var DefaultAsyncLocalStorage = class {
|
|
112
|
+
constructor() {
|
|
113
|
+
}
|
|
114
|
+
enterWith(_) {
|
|
115
|
+
}
|
|
116
|
+
run(_, callback) {
|
|
117
|
+
return callback();
|
|
118
|
+
}
|
|
119
|
+
getStore() {
|
|
120
|
+
return void 0;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
var DefaultChannel = class {
|
|
124
|
+
constructor(name) {
|
|
125
|
+
this.name = name;
|
|
126
|
+
}
|
|
127
|
+
hasSubscribers = false;
|
|
128
|
+
subscribe(_subscription) {
|
|
129
|
+
}
|
|
130
|
+
unsubscribe(_subscription) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
bindStore(_store, _transform) {
|
|
134
|
+
}
|
|
135
|
+
unbindStore(_store) {
|
|
136
|
+
return false;
|
|
137
|
+
}
|
|
138
|
+
publish(_message) {
|
|
139
|
+
}
|
|
140
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
141
|
+
runStores(_message, fn, thisArg, ...args) {
|
|
142
|
+
return fn.apply(thisArg, args);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
var DefaultTracingChannel = class {
|
|
146
|
+
start;
|
|
147
|
+
end;
|
|
148
|
+
asyncStart;
|
|
149
|
+
asyncEnd;
|
|
150
|
+
error;
|
|
151
|
+
constructor(nameOrChannels) {
|
|
152
|
+
if (typeof nameOrChannels === "string") {
|
|
153
|
+
this.start = new DefaultChannel(`tracing:${nameOrChannels}:start`);
|
|
154
|
+
this.end = new DefaultChannel(`tracing:${nameOrChannels}:end`);
|
|
155
|
+
this.asyncStart = new DefaultChannel(
|
|
156
|
+
`tracing:${nameOrChannels}:asyncStart`
|
|
157
|
+
);
|
|
158
|
+
this.asyncEnd = new DefaultChannel(`tracing:${nameOrChannels}:asyncEnd`);
|
|
159
|
+
this.error = new DefaultChannel(`tracing:${nameOrChannels}:error`);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
this.start = nameOrChannels.start ?? new DefaultChannel("tracing:start");
|
|
163
|
+
this.end = nameOrChannels.end ?? new DefaultChannel("tracing:end");
|
|
164
|
+
this.asyncStart = nameOrChannels.asyncStart ?? new DefaultChannel("tracing:asyncStart");
|
|
165
|
+
this.asyncEnd = nameOrChannels.asyncEnd ?? new DefaultChannel("tracing:asyncEnd");
|
|
166
|
+
this.error = nameOrChannels.error ?? new DefaultChannel("tracing:error");
|
|
167
|
+
}
|
|
168
|
+
get hasSubscribers() {
|
|
169
|
+
return this.start.hasSubscribers || this.end.hasSubscribers || this.asyncStart.hasSubscribers || this.asyncEnd.hasSubscribers || this.error.hasSubscribers;
|
|
170
|
+
}
|
|
171
|
+
subscribe(_handlers) {
|
|
172
|
+
}
|
|
173
|
+
unsubscribe(_handlers) {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
177
|
+
traceSync(fn, _message, thisArg, ...args) {
|
|
178
|
+
return fn.apply(thisArg, args);
|
|
179
|
+
}
|
|
180
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
181
|
+
tracePromise(fn, _message, thisArg, ...args) {
|
|
182
|
+
return fn.apply(thisArg, args);
|
|
183
|
+
}
|
|
184
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
185
|
+
traceCallback(fn, _position, _message, thisArg, ...args) {
|
|
186
|
+
return fn.apply(thisArg, args);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
var iso = {
|
|
190
|
+
buildType: "unknown",
|
|
191
|
+
// Will be set by configureBrowser() or configureNode()
|
|
192
|
+
getRepoInfo: async (_settings) => void 0,
|
|
193
|
+
getPastNAncestors: async () => [],
|
|
194
|
+
getEnv: (_name) => void 0,
|
|
195
|
+
getCallerLocation: () => void 0,
|
|
196
|
+
newAsyncLocalStorage: () => new DefaultAsyncLocalStorage(),
|
|
197
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
198
|
+
newTracingChannel: (nameOrChannels) => new DefaultTracingChannel(nameOrChannels),
|
|
199
|
+
processOn: (_0, _1) => {
|
|
200
|
+
},
|
|
201
|
+
basename: (filepath) => filepath.split(/[\\/]/).pop() || filepath,
|
|
202
|
+
// eslint-disable-next-line no-restricted-properties -- preserving intentional console usage.
|
|
203
|
+
writeln: (text) => console.log(text)
|
|
204
|
+
};
|
|
205
|
+
var isomorph_default = iso;
|
|
206
|
+
|
|
207
|
+
// src/instrumentation/core/channel-definitions.ts
|
|
208
|
+
function channel(spec) {
|
|
209
|
+
return spec;
|
|
210
|
+
}
|
|
211
|
+
function defineChannels(pkg, channels) {
|
|
212
|
+
return Object.fromEntries(
|
|
213
|
+
Object.entries(channels).map(([key, spec]) => {
|
|
214
|
+
const fullChannelName = `orchestrion:${pkg}:${spec.channelName}`;
|
|
215
|
+
if (spec.kind === "async") {
|
|
216
|
+
const asyncSpec = spec;
|
|
217
|
+
const tracingChannel2 = () => isomorph_default.newTracingChannel(
|
|
218
|
+
fullChannelName
|
|
219
|
+
);
|
|
220
|
+
return [
|
|
221
|
+
key,
|
|
222
|
+
{
|
|
223
|
+
...asyncSpec,
|
|
224
|
+
tracingChannel: tracingChannel2,
|
|
225
|
+
tracePromise: (fn, context) => tracingChannel2().tracePromise(
|
|
226
|
+
fn,
|
|
227
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
228
|
+
context
|
|
229
|
+
)
|
|
230
|
+
}
|
|
231
|
+
];
|
|
232
|
+
}
|
|
233
|
+
const syncSpec = spec;
|
|
234
|
+
const tracingChannel = () => isomorph_default.newTracingChannel(
|
|
235
|
+
fullChannelName
|
|
236
|
+
);
|
|
237
|
+
return [
|
|
238
|
+
key,
|
|
239
|
+
{
|
|
240
|
+
...syncSpec,
|
|
241
|
+
tracingChannel,
|
|
242
|
+
traceSync: (fn, context) => tracingChannel().traceSync(
|
|
243
|
+
fn,
|
|
244
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
245
|
+
context
|
|
246
|
+
)
|
|
247
|
+
}
|
|
248
|
+
];
|
|
249
|
+
})
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// src/instrumentation/plugins/ai-sdk-channels.ts
|
|
254
|
+
var aiSDKChannels = defineChannels("ai", {
|
|
255
|
+
generateText: channel({
|
|
256
|
+
channelName: "generateText",
|
|
257
|
+
kind: "async"
|
|
258
|
+
}),
|
|
259
|
+
streamText: channel({
|
|
260
|
+
channelName: "streamText",
|
|
261
|
+
kind: "async"
|
|
262
|
+
}),
|
|
263
|
+
streamTextSync: channel({
|
|
264
|
+
channelName: "streamText.sync",
|
|
265
|
+
kind: "sync-stream"
|
|
266
|
+
}),
|
|
267
|
+
generateObject: channel({
|
|
268
|
+
channelName: "generateObject",
|
|
269
|
+
kind: "async"
|
|
270
|
+
}),
|
|
271
|
+
streamObject: channel({
|
|
272
|
+
channelName: "streamObject",
|
|
273
|
+
kind: "async"
|
|
274
|
+
}),
|
|
275
|
+
streamObjectSync: channel({
|
|
276
|
+
channelName: "streamObject.sync",
|
|
277
|
+
kind: "sync-stream"
|
|
278
|
+
}),
|
|
279
|
+
embed: channel(
|
|
280
|
+
{
|
|
281
|
+
channelName: "embed",
|
|
282
|
+
kind: "async"
|
|
283
|
+
}
|
|
284
|
+
),
|
|
285
|
+
embedMany: channel({
|
|
286
|
+
channelName: "embedMany",
|
|
287
|
+
kind: "async"
|
|
288
|
+
}),
|
|
289
|
+
rerank: channel({
|
|
290
|
+
channelName: "rerank",
|
|
291
|
+
kind: "async"
|
|
292
|
+
}),
|
|
293
|
+
agentGenerate: channel({
|
|
294
|
+
channelName: "Agent.generate",
|
|
295
|
+
kind: "async"
|
|
296
|
+
}),
|
|
297
|
+
agentStream: channel({
|
|
298
|
+
channelName: "Agent.stream",
|
|
299
|
+
kind: "async"
|
|
300
|
+
}),
|
|
301
|
+
agentStreamSync: channel({
|
|
302
|
+
channelName: "Agent.stream.sync",
|
|
303
|
+
kind: "sync-stream"
|
|
304
|
+
}),
|
|
305
|
+
toolLoopAgentGenerate: channel({
|
|
306
|
+
channelName: "ToolLoopAgent.generate",
|
|
307
|
+
kind: "async"
|
|
308
|
+
}),
|
|
309
|
+
toolLoopAgentStream: channel({
|
|
310
|
+
channelName: "ToolLoopAgent.stream",
|
|
311
|
+
kind: "async"
|
|
312
|
+
})
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// src/auto-instrumentations/configs/ai-sdk.ts
|
|
316
|
+
var aiSDKConfigs = [
|
|
317
|
+
// generateText - async function
|
|
318
|
+
{
|
|
319
|
+
channelName: aiSDKChannels.generateText.channelName,
|
|
320
|
+
module: {
|
|
321
|
+
name: "ai",
|
|
322
|
+
versionRange: ">=3.0.0",
|
|
323
|
+
filePath: "dist/index.mjs"
|
|
324
|
+
},
|
|
325
|
+
functionQuery: {
|
|
326
|
+
functionName: "generateText",
|
|
327
|
+
kind: "Async"
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
channelName: aiSDKChannels.generateText.channelName,
|
|
332
|
+
module: {
|
|
333
|
+
name: "ai",
|
|
334
|
+
versionRange: ">=3.0.0",
|
|
335
|
+
filePath: "dist/index.js"
|
|
336
|
+
},
|
|
337
|
+
functionQuery: {
|
|
338
|
+
functionName: "generateText",
|
|
339
|
+
kind: "Async"
|
|
340
|
+
}
|
|
341
|
+
},
|
|
342
|
+
// streamText - async function (v3 only, before the sync refactor in v4)
|
|
343
|
+
{
|
|
344
|
+
channelName: aiSDKChannels.streamText.channelName,
|
|
345
|
+
module: {
|
|
346
|
+
name: "ai",
|
|
347
|
+
versionRange: ">=3.0.0 <4.0.0",
|
|
348
|
+
filePath: "dist/index.mjs"
|
|
349
|
+
},
|
|
350
|
+
functionQuery: {
|
|
351
|
+
functionName: "streamText",
|
|
352
|
+
kind: "Async"
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
// streamText - sync function returning stream (v4+)
|
|
356
|
+
{
|
|
357
|
+
channelName: aiSDKChannels.streamTextSync.channelName,
|
|
358
|
+
module: {
|
|
359
|
+
name: "ai",
|
|
360
|
+
versionRange: ">=4.0.0",
|
|
361
|
+
filePath: "dist/index.mjs"
|
|
362
|
+
},
|
|
363
|
+
functionQuery: {
|
|
364
|
+
functionName: "streamText",
|
|
365
|
+
kind: "Sync"
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
channelName: aiSDKChannels.streamText.channelName,
|
|
370
|
+
module: {
|
|
371
|
+
name: "ai",
|
|
372
|
+
versionRange: ">=3.0.0 <4.0.0",
|
|
373
|
+
filePath: "dist/index.js"
|
|
374
|
+
},
|
|
375
|
+
functionQuery: {
|
|
376
|
+
functionName: "streamText",
|
|
377
|
+
kind: "Async"
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
channelName: aiSDKChannels.streamTextSync.channelName,
|
|
382
|
+
module: {
|
|
383
|
+
name: "ai",
|
|
384
|
+
versionRange: ">=4.0.0",
|
|
385
|
+
filePath: "dist/index.js"
|
|
386
|
+
},
|
|
387
|
+
functionQuery: {
|
|
388
|
+
functionName: "streamText",
|
|
389
|
+
kind: "Sync"
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
// generateObject - async function
|
|
393
|
+
{
|
|
394
|
+
channelName: aiSDKChannels.generateObject.channelName,
|
|
395
|
+
module: {
|
|
396
|
+
name: "ai",
|
|
397
|
+
versionRange: ">=3.0.0",
|
|
398
|
+
filePath: "dist/index.mjs"
|
|
399
|
+
},
|
|
400
|
+
functionQuery: {
|
|
401
|
+
functionName: "generateObject",
|
|
402
|
+
kind: "Async"
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
channelName: aiSDKChannels.generateObject.channelName,
|
|
407
|
+
module: {
|
|
408
|
+
name: "ai",
|
|
409
|
+
versionRange: ">=3.0.0",
|
|
410
|
+
filePath: "dist/index.js"
|
|
411
|
+
},
|
|
412
|
+
functionQuery: {
|
|
413
|
+
functionName: "generateObject",
|
|
414
|
+
kind: "Async"
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
// embed - async function
|
|
418
|
+
{
|
|
419
|
+
channelName: aiSDKChannels.embed.channelName,
|
|
420
|
+
module: {
|
|
421
|
+
name: "ai",
|
|
422
|
+
versionRange: ">=3.0.0",
|
|
423
|
+
filePath: "dist/index.mjs"
|
|
424
|
+
},
|
|
425
|
+
functionQuery: {
|
|
426
|
+
functionName: "embed",
|
|
427
|
+
kind: "Async"
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
channelName: aiSDKChannels.embed.channelName,
|
|
432
|
+
module: {
|
|
433
|
+
name: "ai",
|
|
434
|
+
versionRange: ">=3.0.0",
|
|
435
|
+
filePath: "dist/index.js"
|
|
436
|
+
},
|
|
437
|
+
functionQuery: {
|
|
438
|
+
functionName: "embed",
|
|
439
|
+
kind: "Async"
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
// embedMany - async function
|
|
443
|
+
{
|
|
444
|
+
channelName: aiSDKChannels.embedMany.channelName,
|
|
445
|
+
module: {
|
|
446
|
+
name: "ai",
|
|
447
|
+
versionRange: ">=3.0.0",
|
|
448
|
+
filePath: "dist/index.mjs"
|
|
449
|
+
},
|
|
450
|
+
functionQuery: {
|
|
451
|
+
functionName: "embedMany",
|
|
452
|
+
kind: "Async"
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
channelName: aiSDKChannels.embedMany.channelName,
|
|
457
|
+
module: {
|
|
458
|
+
name: "ai",
|
|
459
|
+
versionRange: ">=3.0.0",
|
|
460
|
+
filePath: "dist/index.js"
|
|
461
|
+
},
|
|
462
|
+
functionQuery: {
|
|
463
|
+
functionName: "embedMany",
|
|
464
|
+
kind: "Async"
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
// rerank - async function
|
|
468
|
+
{
|
|
469
|
+
channelName: aiSDKChannels.rerank.channelName,
|
|
470
|
+
module: {
|
|
471
|
+
name: "ai",
|
|
472
|
+
versionRange: ">=5.0.0",
|
|
473
|
+
filePath: "dist/index.mjs"
|
|
474
|
+
},
|
|
475
|
+
functionQuery: {
|
|
476
|
+
functionName: "rerank",
|
|
477
|
+
kind: "Async"
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
channelName: aiSDKChannels.rerank.channelName,
|
|
482
|
+
module: {
|
|
483
|
+
name: "ai",
|
|
484
|
+
versionRange: ">=5.0.0",
|
|
485
|
+
filePath: "dist/index.js"
|
|
486
|
+
},
|
|
487
|
+
functionQuery: {
|
|
488
|
+
functionName: "rerank",
|
|
489
|
+
kind: "Async"
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
// streamObject - async function (v3 only, before the sync refactor in v4)
|
|
493
|
+
{
|
|
494
|
+
channelName: aiSDKChannels.streamObject.channelName,
|
|
495
|
+
module: {
|
|
496
|
+
name: "ai",
|
|
497
|
+
versionRange: ">=3.0.0 <4.0.0",
|
|
498
|
+
filePath: "dist/index.mjs"
|
|
499
|
+
},
|
|
500
|
+
functionQuery: {
|
|
501
|
+
functionName: "streamObject",
|
|
502
|
+
kind: "Async"
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
// streamObject - sync function returning stream (v4+)
|
|
506
|
+
{
|
|
507
|
+
channelName: aiSDKChannels.streamObjectSync.channelName,
|
|
508
|
+
module: {
|
|
509
|
+
name: "ai",
|
|
510
|
+
versionRange: ">=4.0.0",
|
|
511
|
+
filePath: "dist/index.mjs"
|
|
512
|
+
},
|
|
513
|
+
functionQuery: {
|
|
514
|
+
functionName: "streamObject",
|
|
515
|
+
kind: "Sync"
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
channelName: aiSDKChannels.streamObject.channelName,
|
|
520
|
+
module: {
|
|
521
|
+
name: "ai",
|
|
522
|
+
versionRange: ">=3.0.0 <4.0.0",
|
|
523
|
+
filePath: "dist/index.js"
|
|
524
|
+
},
|
|
525
|
+
functionQuery: {
|
|
526
|
+
functionName: "streamObject",
|
|
527
|
+
kind: "Async"
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
channelName: aiSDKChannels.streamObjectSync.channelName,
|
|
532
|
+
module: {
|
|
533
|
+
name: "ai",
|
|
534
|
+
versionRange: ">=4.0.0",
|
|
535
|
+
filePath: "dist/index.js"
|
|
536
|
+
},
|
|
537
|
+
functionQuery: {
|
|
538
|
+
functionName: "streamObject",
|
|
539
|
+
kind: "Sync"
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
// Agent.generate - async method (v5 only)
|
|
543
|
+
// The compiled AI SDK bundle emits this as an anonymous class method, so we
|
|
544
|
+
// target the first async `generate` method in the file instead of a class name.
|
|
545
|
+
{
|
|
546
|
+
channelName: aiSDKChannels.agentGenerate.channelName,
|
|
547
|
+
module: {
|
|
548
|
+
name: "ai",
|
|
549
|
+
versionRange: ">=5.0.0 <6.0.0",
|
|
550
|
+
filePath: "dist/index.mjs"
|
|
551
|
+
},
|
|
552
|
+
functionQuery: {
|
|
553
|
+
methodName: "generate",
|
|
554
|
+
kind: "Async",
|
|
555
|
+
index: 0
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
channelName: aiSDKChannels.agentGenerate.channelName,
|
|
560
|
+
module: {
|
|
561
|
+
name: "ai",
|
|
562
|
+
versionRange: ">=5.0.0 <6.0.0",
|
|
563
|
+
filePath: "dist/index.js"
|
|
564
|
+
},
|
|
565
|
+
functionQuery: {
|
|
566
|
+
methodName: "generate",
|
|
567
|
+
kind: "Async",
|
|
568
|
+
index: 0
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
// Agent.stream - sync method (v5 only)
|
|
572
|
+
// The compiled AI SDK bundle emits this as an anonymous class method, so we
|
|
573
|
+
// target the first sync `stream` method in the file instead of a class name.
|
|
574
|
+
{
|
|
575
|
+
channelName: aiSDKChannels.agentStreamSync.channelName,
|
|
576
|
+
module: {
|
|
577
|
+
name: "ai",
|
|
578
|
+
versionRange: ">=5.0.0 <6.0.0",
|
|
579
|
+
filePath: "dist/index.mjs"
|
|
580
|
+
},
|
|
581
|
+
functionQuery: {
|
|
582
|
+
methodName: "stream",
|
|
583
|
+
kind: "Sync",
|
|
584
|
+
index: 0
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
channelName: aiSDKChannels.agentStreamSync.channelName,
|
|
589
|
+
module: {
|
|
590
|
+
name: "ai",
|
|
591
|
+
versionRange: ">=5.0.0 <6.0.0",
|
|
592
|
+
filePath: "dist/index.js"
|
|
593
|
+
},
|
|
594
|
+
functionQuery: {
|
|
595
|
+
methodName: "stream",
|
|
596
|
+
kind: "Sync",
|
|
597
|
+
index: 0
|
|
598
|
+
}
|
|
599
|
+
},
|
|
600
|
+
// ToolLoopAgent.generate - async method (v6 only, Experimental_Agent is an alias)
|
|
601
|
+
// The compiled AI SDK bundle emits this as an anonymous class method, so we
|
|
602
|
+
// target the first async `generate` method in the file instead of a class name.
|
|
603
|
+
{
|
|
604
|
+
channelName: aiSDKChannels.toolLoopAgentGenerate.channelName,
|
|
605
|
+
module: {
|
|
606
|
+
name: "ai",
|
|
607
|
+
versionRange: ">=6.0.0 <7.0.0",
|
|
608
|
+
filePath: "dist/index.mjs"
|
|
609
|
+
},
|
|
610
|
+
functionQuery: {
|
|
611
|
+
methodName: "generate",
|
|
612
|
+
kind: "Async",
|
|
613
|
+
index: 0
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
channelName: aiSDKChannels.toolLoopAgentGenerate.channelName,
|
|
618
|
+
module: {
|
|
619
|
+
name: "ai",
|
|
620
|
+
versionRange: ">=6.0.0 <7.0.0",
|
|
621
|
+
filePath: "dist/index.js"
|
|
622
|
+
},
|
|
623
|
+
functionQuery: {
|
|
624
|
+
methodName: "generate",
|
|
625
|
+
kind: "Async",
|
|
626
|
+
index: 0
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
// ToolLoopAgent.stream - async method (v6 only, Experimental_Agent is an alias)
|
|
630
|
+
// The compiled AI SDK bundle emits this as an anonymous class method, so we
|
|
631
|
+
// target the first async `stream` method in the file instead of a class name.
|
|
632
|
+
{
|
|
633
|
+
channelName: aiSDKChannels.toolLoopAgentStream.channelName,
|
|
634
|
+
module: {
|
|
635
|
+
name: "ai",
|
|
636
|
+
versionRange: ">=6.0.0 <7.0.0",
|
|
637
|
+
filePath: "dist/index.mjs"
|
|
638
|
+
},
|
|
639
|
+
functionQuery: {
|
|
640
|
+
methodName: "stream",
|
|
641
|
+
kind: "Async",
|
|
642
|
+
index: 0
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
channelName: aiSDKChannels.toolLoopAgentStream.channelName,
|
|
647
|
+
module: {
|
|
648
|
+
name: "ai",
|
|
649
|
+
versionRange: ">=6.0.0 <7.0.0",
|
|
650
|
+
filePath: "dist/index.js"
|
|
651
|
+
},
|
|
652
|
+
functionQuery: {
|
|
653
|
+
methodName: "stream",
|
|
654
|
+
kind: "Async",
|
|
655
|
+
index: 0
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
];
|
|
659
|
+
|
|
660
|
+
// src/instrumentation/plugins/anthropic-channels.ts
|
|
661
|
+
var anthropicChannels = defineChannels("@anthropic-ai/sdk", {
|
|
662
|
+
messagesCreate: channel({
|
|
663
|
+
channelName: "messages.create",
|
|
664
|
+
kind: "async"
|
|
665
|
+
}),
|
|
666
|
+
betaMessagesCreate: channel({
|
|
667
|
+
channelName: "beta.messages.create",
|
|
668
|
+
kind: "async"
|
|
669
|
+
}),
|
|
670
|
+
betaMessagesToolRunner: channel({
|
|
671
|
+
channelName: "beta.messages.toolRunner",
|
|
672
|
+
kind: "sync-stream"
|
|
673
|
+
})
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
// src/auto-instrumentations/configs/anthropic.ts
|
|
677
|
+
var anthropicConfigs = [
|
|
678
|
+
// Messages API - create in older SDK layouts (supports streaming via stream=true parameter)
|
|
679
|
+
{
|
|
680
|
+
channelName: anthropicChannels.messagesCreate.channelName,
|
|
681
|
+
module: {
|
|
682
|
+
name: "@anthropic-ai/sdk",
|
|
683
|
+
versionRange: ">=0.27.0 <0.39.0",
|
|
684
|
+
filePath: "resources/messages.mjs"
|
|
685
|
+
},
|
|
686
|
+
functionQuery: {
|
|
687
|
+
className: "Messages",
|
|
688
|
+
methodName: "create",
|
|
689
|
+
kind: "Async"
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
// Messages API - create (supports streaming via stream=true parameter)
|
|
693
|
+
{
|
|
694
|
+
channelName: anthropicChannels.messagesCreate.channelName,
|
|
695
|
+
module: {
|
|
696
|
+
name: "@anthropic-ai/sdk",
|
|
697
|
+
versionRange: ">=0.39.0",
|
|
698
|
+
filePath: "resources/messages/messages.mjs"
|
|
699
|
+
},
|
|
700
|
+
functionQuery: {
|
|
701
|
+
className: "Messages",
|
|
702
|
+
methodName: "create",
|
|
703
|
+
kind: "Async"
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
// Beta Messages API - create (supports streaming via stream=true parameter)
|
|
707
|
+
{
|
|
708
|
+
channelName: anthropicChannels.betaMessagesCreate.channelName,
|
|
709
|
+
module: {
|
|
710
|
+
name: "@anthropic-ai/sdk",
|
|
711
|
+
versionRange: ">=0.39.0",
|
|
712
|
+
filePath: "resources/beta/messages/messages.mjs"
|
|
713
|
+
},
|
|
714
|
+
functionQuery: {
|
|
715
|
+
className: "Messages",
|
|
716
|
+
methodName: "create",
|
|
717
|
+
kind: "Async"
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
// Beta Messages API - toolRunner (sync helper returning async iterable/thenable)
|
|
721
|
+
{
|
|
722
|
+
channelName: anthropicChannels.betaMessagesToolRunner.channelName,
|
|
723
|
+
module: {
|
|
724
|
+
name: "@anthropic-ai/sdk",
|
|
725
|
+
versionRange: ">=0.39.0",
|
|
726
|
+
filePath: "resources/beta/messages/messages.mjs"
|
|
727
|
+
},
|
|
728
|
+
functionQuery: {
|
|
729
|
+
className: "Messages",
|
|
730
|
+
methodName: "toolRunner",
|
|
731
|
+
kind: "Sync"
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
];
|
|
735
|
+
|
|
736
|
+
// src/instrumentation/plugins/claude-agent-sdk-channels.ts
|
|
737
|
+
var claudeAgentSDKChannels = defineChannels(
|
|
738
|
+
"@anthropic-ai/claude-agent-sdk",
|
|
739
|
+
{
|
|
740
|
+
query: channel({
|
|
741
|
+
channelName: "query",
|
|
742
|
+
kind: "sync-stream"
|
|
743
|
+
})
|
|
744
|
+
}
|
|
745
|
+
);
|
|
746
|
+
|
|
747
|
+
// src/auto-instrumentations/configs/claude-agent-sdk.ts
|
|
748
|
+
var claudeAgentSDKConfigs = [
|
|
749
|
+
// query - Main entry point for agent interactions. The SDK returns an async
|
|
750
|
+
// iterable, but the exported query function itself is synchronous.
|
|
751
|
+
{
|
|
752
|
+
channelName: claudeAgentSDKChannels.query.channelName,
|
|
753
|
+
module: {
|
|
754
|
+
name: "@anthropic-ai/claude-agent-sdk",
|
|
755
|
+
versionRange: ">=0.1.0 <0.2.0",
|
|
756
|
+
filePath: "sdk.mjs"
|
|
757
|
+
},
|
|
758
|
+
functionQuery: {
|
|
759
|
+
functionName: "query",
|
|
760
|
+
kind: "Sync"
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
{
|
|
764
|
+
channelName: claudeAgentSDKChannels.query.channelName,
|
|
765
|
+
module: {
|
|
766
|
+
name: "@anthropic-ai/claude-agent-sdk",
|
|
767
|
+
versionRange: ">=0.2.0",
|
|
768
|
+
filePath: "sdk.mjs"
|
|
769
|
+
},
|
|
770
|
+
functionQuery: {
|
|
771
|
+
functionName: "query",
|
|
772
|
+
kind: "Sync",
|
|
773
|
+
isExportAlias: true
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
];
|
|
777
|
+
|
|
778
|
+
// src/instrumentation/plugins/cohere-channels.ts
|
|
779
|
+
var cohereChannels = defineChannels("cohere-ai", {
|
|
780
|
+
chat: channel({
|
|
781
|
+
channelName: "chat",
|
|
782
|
+
kind: "async"
|
|
783
|
+
}),
|
|
784
|
+
chatStream: channel({
|
|
785
|
+
channelName: "chatStream",
|
|
786
|
+
kind: "async"
|
|
787
|
+
}),
|
|
788
|
+
embed: channel({
|
|
789
|
+
channelName: "embed",
|
|
790
|
+
kind: "async"
|
|
791
|
+
}),
|
|
792
|
+
rerank: channel({
|
|
793
|
+
channelName: "rerank",
|
|
794
|
+
kind: "async"
|
|
795
|
+
})
|
|
796
|
+
});
|
|
797
|
+
|
|
798
|
+
// src/auto-instrumentations/configs/cohere.ts
|
|
799
|
+
var cohereConfigs = [
|
|
800
|
+
{
|
|
801
|
+
channelName: cohereChannels.chat.channelName,
|
|
802
|
+
module: {
|
|
803
|
+
name: "cohere-ai",
|
|
804
|
+
versionRange: ">=7.0.0 <8.0.0",
|
|
805
|
+
filePath: "Client.js"
|
|
806
|
+
},
|
|
807
|
+
functionQuery: {
|
|
808
|
+
className: "CohereClient",
|
|
809
|
+
methodName: "chat",
|
|
810
|
+
kind: "Async"
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
channelName: cohereChannels.chat.channelName,
|
|
815
|
+
module: {
|
|
816
|
+
name: "cohere-ai",
|
|
817
|
+
versionRange: ">=7.0.0 <7.21.0",
|
|
818
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
819
|
+
},
|
|
820
|
+
functionQuery: {
|
|
821
|
+
className: "V2",
|
|
822
|
+
methodName: "chat",
|
|
823
|
+
kind: "Async"
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
channelName: cohereChannels.chat.channelName,
|
|
828
|
+
module: {
|
|
829
|
+
name: "cohere-ai",
|
|
830
|
+
versionRange: ">=7.21.0 <8.0.0",
|
|
831
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
832
|
+
},
|
|
833
|
+
functionQuery: {
|
|
834
|
+
className: "V2Client",
|
|
835
|
+
methodName: "chat",
|
|
836
|
+
kind: "Async"
|
|
837
|
+
}
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
channelName: cohereChannels.chat.channelName,
|
|
841
|
+
module: {
|
|
842
|
+
name: "cohere-ai",
|
|
843
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
844
|
+
filePath: "Client.js"
|
|
845
|
+
},
|
|
846
|
+
functionQuery: {
|
|
847
|
+
className: "CohereClient",
|
|
848
|
+
methodName: "chat",
|
|
849
|
+
kind: "Async"
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
channelName: cohereChannels.chat.channelName,
|
|
854
|
+
module: {
|
|
855
|
+
name: "cohere-ai",
|
|
856
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
857
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
858
|
+
},
|
|
859
|
+
functionQuery: {
|
|
860
|
+
className: "V2Client",
|
|
861
|
+
methodName: "chat",
|
|
862
|
+
kind: "Async"
|
|
863
|
+
}
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
channelName: cohereChannels.chatStream.channelName,
|
|
867
|
+
module: {
|
|
868
|
+
name: "cohere-ai",
|
|
869
|
+
versionRange: ">=7.0.0 <8.0.0",
|
|
870
|
+
filePath: "Client.js"
|
|
871
|
+
},
|
|
872
|
+
functionQuery: {
|
|
873
|
+
className: "CohereClient",
|
|
874
|
+
methodName: "chatStream",
|
|
875
|
+
kind: "Async"
|
|
876
|
+
}
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
channelName: cohereChannels.chatStream.channelName,
|
|
880
|
+
module: {
|
|
881
|
+
name: "cohere-ai",
|
|
882
|
+
versionRange: ">=7.0.0 <7.21.0",
|
|
883
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
884
|
+
},
|
|
885
|
+
functionQuery: {
|
|
886
|
+
className: "V2",
|
|
887
|
+
methodName: "chatStream",
|
|
888
|
+
kind: "Async"
|
|
889
|
+
}
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
channelName: cohereChannels.chatStream.channelName,
|
|
893
|
+
module: {
|
|
894
|
+
name: "cohere-ai",
|
|
895
|
+
versionRange: ">=7.21.0 <8.0.0",
|
|
896
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
897
|
+
},
|
|
898
|
+
functionQuery: {
|
|
899
|
+
className: "V2Client",
|
|
900
|
+
methodName: "chatStream",
|
|
901
|
+
kind: "Async"
|
|
902
|
+
}
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
channelName: cohereChannels.chatStream.channelName,
|
|
906
|
+
module: {
|
|
907
|
+
name: "cohere-ai",
|
|
908
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
909
|
+
filePath: "Client.js"
|
|
910
|
+
},
|
|
911
|
+
functionQuery: {
|
|
912
|
+
className: "CohereClient",
|
|
913
|
+
methodName: "chatStream",
|
|
914
|
+
kind: "Async"
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
channelName: cohereChannels.chatStream.channelName,
|
|
919
|
+
module: {
|
|
920
|
+
name: "cohere-ai",
|
|
921
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
922
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
923
|
+
},
|
|
924
|
+
functionQuery: {
|
|
925
|
+
className: "V2Client",
|
|
926
|
+
methodName: "chatStream",
|
|
927
|
+
kind: "Async"
|
|
928
|
+
}
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
channelName: cohereChannels.embed.channelName,
|
|
932
|
+
module: {
|
|
933
|
+
name: "cohere-ai",
|
|
934
|
+
versionRange: ">=7.0.0 <8.0.0",
|
|
935
|
+
filePath: "Client.js"
|
|
936
|
+
},
|
|
937
|
+
functionQuery: {
|
|
938
|
+
className: "CohereClient",
|
|
939
|
+
methodName: "embed",
|
|
940
|
+
kind: "Async"
|
|
941
|
+
}
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
channelName: cohereChannels.embed.channelName,
|
|
945
|
+
module: {
|
|
946
|
+
name: "cohere-ai",
|
|
947
|
+
versionRange: ">=7.0.0 <7.21.0",
|
|
948
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
949
|
+
},
|
|
950
|
+
functionQuery: {
|
|
951
|
+
className: "V2",
|
|
952
|
+
methodName: "embed",
|
|
953
|
+
kind: "Async"
|
|
954
|
+
}
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
channelName: cohereChannels.embed.channelName,
|
|
958
|
+
module: {
|
|
959
|
+
name: "cohere-ai",
|
|
960
|
+
versionRange: ">=7.21.0 <8.0.0",
|
|
961
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
962
|
+
},
|
|
963
|
+
functionQuery: {
|
|
964
|
+
className: "V2Client",
|
|
965
|
+
methodName: "embed",
|
|
966
|
+
kind: "Async"
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
channelName: cohereChannels.embed.channelName,
|
|
971
|
+
module: {
|
|
972
|
+
name: "cohere-ai",
|
|
973
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
974
|
+
filePath: "Client.js"
|
|
975
|
+
},
|
|
976
|
+
functionQuery: {
|
|
977
|
+
className: "CohereClient",
|
|
978
|
+
methodName: "embed",
|
|
979
|
+
kind: "Async"
|
|
980
|
+
}
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
channelName: cohereChannels.embed.channelName,
|
|
984
|
+
module: {
|
|
985
|
+
name: "cohere-ai",
|
|
986
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
987
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
988
|
+
},
|
|
989
|
+
functionQuery: {
|
|
990
|
+
className: "V2Client",
|
|
991
|
+
methodName: "embed",
|
|
992
|
+
kind: "Async"
|
|
993
|
+
}
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
channelName: cohereChannels.rerank.channelName,
|
|
997
|
+
module: {
|
|
998
|
+
name: "cohere-ai",
|
|
999
|
+
versionRange: ">=7.0.0 <8.0.0",
|
|
1000
|
+
filePath: "Client.js"
|
|
1001
|
+
},
|
|
1002
|
+
functionQuery: {
|
|
1003
|
+
className: "CohereClient",
|
|
1004
|
+
methodName: "rerank",
|
|
1005
|
+
kind: "Async"
|
|
1006
|
+
}
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
channelName: cohereChannels.rerank.channelName,
|
|
1010
|
+
module: {
|
|
1011
|
+
name: "cohere-ai",
|
|
1012
|
+
versionRange: ">=7.0.0 <7.21.0",
|
|
1013
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
1014
|
+
},
|
|
1015
|
+
functionQuery: {
|
|
1016
|
+
className: "V2",
|
|
1017
|
+
methodName: "rerank",
|
|
1018
|
+
kind: "Async"
|
|
1019
|
+
}
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
channelName: cohereChannels.rerank.channelName,
|
|
1023
|
+
module: {
|
|
1024
|
+
name: "cohere-ai",
|
|
1025
|
+
versionRange: ">=7.21.0 <8.0.0",
|
|
1026
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
1027
|
+
},
|
|
1028
|
+
functionQuery: {
|
|
1029
|
+
className: "V2Client",
|
|
1030
|
+
methodName: "rerank",
|
|
1031
|
+
kind: "Async"
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
channelName: cohereChannels.rerank.channelName,
|
|
1036
|
+
module: {
|
|
1037
|
+
name: "cohere-ai",
|
|
1038
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
1039
|
+
filePath: "Client.js"
|
|
1040
|
+
},
|
|
1041
|
+
functionQuery: {
|
|
1042
|
+
className: "CohereClient",
|
|
1043
|
+
methodName: "rerank",
|
|
1044
|
+
kind: "Async"
|
|
1045
|
+
}
|
|
1046
|
+
},
|
|
1047
|
+
{
|
|
1048
|
+
channelName: cohereChannels.rerank.channelName,
|
|
1049
|
+
module: {
|
|
1050
|
+
name: "cohere-ai",
|
|
1051
|
+
versionRange: ">=8.0.0 <9.0.0",
|
|
1052
|
+
filePath: "api/resources/v2/client/Client.js"
|
|
1053
|
+
},
|
|
1054
|
+
functionQuery: {
|
|
1055
|
+
className: "V2Client",
|
|
1056
|
+
methodName: "rerank",
|
|
1057
|
+
kind: "Async"
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
];
|
|
1061
|
+
|
|
1062
|
+
// src/instrumentation/plugins/cursor-sdk-channels.ts
|
|
1063
|
+
var cursorSDKChannels = defineChannels("@cursor/sdk", {
|
|
1064
|
+
create: channel({
|
|
1065
|
+
channelName: "Agent.create",
|
|
1066
|
+
kind: "async"
|
|
1067
|
+
}),
|
|
1068
|
+
resume: channel({
|
|
1069
|
+
channelName: "Agent.resume",
|
|
1070
|
+
kind: "async"
|
|
1071
|
+
}),
|
|
1072
|
+
prompt: channel({
|
|
1073
|
+
channelName: "Agent.prompt",
|
|
1074
|
+
kind: "async"
|
|
1075
|
+
}),
|
|
1076
|
+
send: channel({
|
|
1077
|
+
channelName: "agent.send",
|
|
1078
|
+
kind: "async"
|
|
1079
|
+
})
|
|
1080
|
+
});
|
|
1081
|
+
|
|
1082
|
+
// src/auto-instrumentations/configs/cursor-sdk.ts
|
|
1083
|
+
var cursorSDKVersionRange = ">=1.0.7 <2.0.0";
|
|
1084
|
+
var cursorSDKEntrypoints = ["dist/esm/index.js", "dist/cjs/index.js"];
|
|
1085
|
+
var cursorSDKConfigs = cursorSDKEntrypoints.flatMap((filePath) => [
|
|
1086
|
+
{
|
|
1087
|
+
channelName: cursorSDKChannels.create.channelName,
|
|
1088
|
+
module: {
|
|
1089
|
+
name: "@cursor/sdk",
|
|
1090
|
+
versionRange: cursorSDKVersionRange,
|
|
1091
|
+
filePath
|
|
1092
|
+
},
|
|
1093
|
+
functionQuery: {
|
|
1094
|
+
className: "Agent",
|
|
1095
|
+
methodName: "create",
|
|
1096
|
+
kind: "Async"
|
|
1097
|
+
}
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
channelName: cursorSDKChannels.resume.channelName,
|
|
1101
|
+
module: {
|
|
1102
|
+
name: "@cursor/sdk",
|
|
1103
|
+
versionRange: cursorSDKVersionRange,
|
|
1104
|
+
filePath
|
|
1105
|
+
},
|
|
1106
|
+
functionQuery: {
|
|
1107
|
+
className: "Agent",
|
|
1108
|
+
methodName: "resume",
|
|
1109
|
+
kind: "Async"
|
|
1110
|
+
}
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
channelName: cursorSDKChannels.prompt.channelName,
|
|
1114
|
+
module: {
|
|
1115
|
+
name: "@cursor/sdk",
|
|
1116
|
+
versionRange: cursorSDKVersionRange,
|
|
1117
|
+
filePath
|
|
1118
|
+
},
|
|
1119
|
+
functionQuery: {
|
|
1120
|
+
className: "Agent",
|
|
1121
|
+
methodName: "prompt",
|
|
1122
|
+
kind: "Async"
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
]);
|
|
1126
|
+
|
|
1127
|
+
// src/instrumentation/plugins/flue-channels.ts
|
|
1128
|
+
var flueChannels = defineChannels("@flue/runtime", {
|
|
1129
|
+
createContext: channel({
|
|
1130
|
+
channelName: "createFlueContext",
|
|
1131
|
+
kind: "sync-stream"
|
|
1132
|
+
}),
|
|
1133
|
+
openSession: channel({
|
|
1134
|
+
channelName: "Harness.openSession",
|
|
1135
|
+
kind: "async"
|
|
1136
|
+
}),
|
|
1137
|
+
contextEvent: channel({
|
|
1138
|
+
channelName: "context.event",
|
|
1139
|
+
kind: "sync-stream"
|
|
1140
|
+
}),
|
|
1141
|
+
prompt: channel({
|
|
1142
|
+
channelName: "session.prompt",
|
|
1143
|
+
kind: "async"
|
|
1144
|
+
}),
|
|
1145
|
+
skill: channel({
|
|
1146
|
+
channelName: "session.skill",
|
|
1147
|
+
kind: "async"
|
|
1148
|
+
}),
|
|
1149
|
+
task: channel({
|
|
1150
|
+
channelName: "session.task",
|
|
1151
|
+
kind: "async"
|
|
1152
|
+
}),
|
|
1153
|
+
compact: channel({
|
|
1154
|
+
channelName: "session.compact",
|
|
1155
|
+
kind: "async"
|
|
1156
|
+
})
|
|
1157
|
+
});
|
|
1158
|
+
|
|
1159
|
+
// src/auto-instrumentations/configs/flue.ts
|
|
1160
|
+
var flueVersionRange = ">=0.7.0 <0.8.0";
|
|
1161
|
+
var flueConfigs = [
|
|
1162
|
+
{
|
|
1163
|
+
channelName: flueChannels.createContext.channelName,
|
|
1164
|
+
module: {
|
|
1165
|
+
name: "@flue/runtime",
|
|
1166
|
+
versionRange: flueVersionRange,
|
|
1167
|
+
filePath: "dist/internal.mjs"
|
|
1168
|
+
},
|
|
1169
|
+
functionQuery: {
|
|
1170
|
+
functionName: "createFlueContext",
|
|
1171
|
+
kind: "Sync"
|
|
1172
|
+
}
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
channelName: flueChannels.openSession.channelName,
|
|
1176
|
+
module: {
|
|
1177
|
+
name: "@flue/runtime",
|
|
1178
|
+
versionRange: flueVersionRange,
|
|
1179
|
+
filePath: "dist/internal.mjs"
|
|
1180
|
+
},
|
|
1181
|
+
functionQuery: {
|
|
1182
|
+
className: "Harness",
|
|
1183
|
+
methodName: "openSession",
|
|
1184
|
+
kind: "Async"
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
];
|
|
1188
|
+
|
|
1189
|
+
// src/instrumentation/plugins/genkit-channels.ts
|
|
1190
|
+
var genkitChannels = defineChannels("@genkit-ai/ai", {
|
|
1191
|
+
generate: channel({
|
|
1192
|
+
channelName: "generate",
|
|
1193
|
+
kind: "async"
|
|
1194
|
+
}),
|
|
1195
|
+
generateStream: channel({
|
|
1196
|
+
channelName: "generateStream",
|
|
1197
|
+
kind: "sync-stream"
|
|
1198
|
+
}),
|
|
1199
|
+
embed: channel({
|
|
1200
|
+
channelName: "embed",
|
|
1201
|
+
kind: "async"
|
|
1202
|
+
}),
|
|
1203
|
+
embedMany: channel({
|
|
1204
|
+
channelName: "embedMany",
|
|
1205
|
+
kind: "async"
|
|
1206
|
+
}),
|
|
1207
|
+
actionRun: channel({
|
|
1208
|
+
channelName: "action.run",
|
|
1209
|
+
kind: "async"
|
|
1210
|
+
}),
|
|
1211
|
+
actionStream: channel({
|
|
1212
|
+
channelName: "action.stream",
|
|
1213
|
+
kind: "sync-stream"
|
|
1214
|
+
})
|
|
1215
|
+
});
|
|
1216
|
+
var genkitCoreChannels = defineChannels("@genkit-ai/core", {
|
|
1217
|
+
actionSpan: channel({
|
|
1218
|
+
channelName: "action.span",
|
|
1219
|
+
kind: "async"
|
|
1220
|
+
})
|
|
1221
|
+
});
|
|
1222
|
+
|
|
1223
|
+
// src/auto-instrumentations/configs/genkit.ts
|
|
1224
|
+
var genkitVersionRange = ">=1.0.0 <2.0.0";
|
|
1225
|
+
var genkitConfigs = [
|
|
1226
|
+
{
|
|
1227
|
+
channelName: genkitChannels.generate.channelName,
|
|
1228
|
+
module: {
|
|
1229
|
+
name: "@genkit-ai/ai",
|
|
1230
|
+
versionRange: genkitVersionRange,
|
|
1231
|
+
filePath: "lib/genkit-ai.mjs"
|
|
1232
|
+
},
|
|
1233
|
+
functionQuery: {
|
|
1234
|
+
className: "GenkitAI",
|
|
1235
|
+
methodName: "generate",
|
|
1236
|
+
kind: "Async"
|
|
1237
|
+
}
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
channelName: genkitChannels.generate.channelName,
|
|
1241
|
+
module: {
|
|
1242
|
+
name: "@genkit-ai/ai",
|
|
1243
|
+
versionRange: genkitVersionRange,
|
|
1244
|
+
filePath: "lib/genkit-ai.js"
|
|
1245
|
+
},
|
|
1246
|
+
functionQuery: {
|
|
1247
|
+
className: "GenkitAI",
|
|
1248
|
+
methodName: "generate",
|
|
1249
|
+
kind: "Async"
|
|
1250
|
+
}
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
channelName: genkitChannels.generateStream.channelName,
|
|
1254
|
+
module: {
|
|
1255
|
+
name: "@genkit-ai/ai",
|
|
1256
|
+
versionRange: genkitVersionRange,
|
|
1257
|
+
filePath: "lib/genkit-ai.mjs"
|
|
1258
|
+
},
|
|
1259
|
+
functionQuery: {
|
|
1260
|
+
className: "GenkitAI",
|
|
1261
|
+
methodName: "generateStream",
|
|
1262
|
+
kind: "Sync"
|
|
1263
|
+
}
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
channelName: genkitChannels.generateStream.channelName,
|
|
1267
|
+
module: {
|
|
1268
|
+
name: "@genkit-ai/ai",
|
|
1269
|
+
versionRange: genkitVersionRange,
|
|
1270
|
+
filePath: "lib/genkit-ai.js"
|
|
1271
|
+
},
|
|
1272
|
+
functionQuery: {
|
|
1273
|
+
className: "GenkitAI",
|
|
1274
|
+
methodName: "generateStream",
|
|
1275
|
+
kind: "Sync"
|
|
1276
|
+
}
|
|
1277
|
+
},
|
|
1278
|
+
{
|
|
1279
|
+
channelName: genkitChannels.embed.channelName,
|
|
1280
|
+
module: {
|
|
1281
|
+
name: "@genkit-ai/ai",
|
|
1282
|
+
versionRange: genkitVersionRange,
|
|
1283
|
+
filePath: "lib/genkit-ai.mjs"
|
|
1284
|
+
},
|
|
1285
|
+
functionQuery: {
|
|
1286
|
+
className: "GenkitAI",
|
|
1287
|
+
methodName: "embed",
|
|
1288
|
+
kind: "Async"
|
|
1289
|
+
}
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
channelName: genkitChannels.embed.channelName,
|
|
1293
|
+
module: {
|
|
1294
|
+
name: "@genkit-ai/ai",
|
|
1295
|
+
versionRange: genkitVersionRange,
|
|
1296
|
+
filePath: "lib/genkit-ai.js"
|
|
1297
|
+
},
|
|
1298
|
+
functionQuery: {
|
|
1299
|
+
className: "GenkitAI",
|
|
1300
|
+
methodName: "embed",
|
|
1301
|
+
kind: "Async"
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
channelName: genkitChannels.embedMany.channelName,
|
|
1306
|
+
module: {
|
|
1307
|
+
name: "@genkit-ai/ai",
|
|
1308
|
+
versionRange: genkitVersionRange,
|
|
1309
|
+
filePath: "lib/genkit-ai.mjs"
|
|
1310
|
+
},
|
|
1311
|
+
functionQuery: {
|
|
1312
|
+
className: "GenkitAI",
|
|
1313
|
+
methodName: "embedMany",
|
|
1314
|
+
kind: "Async"
|
|
1315
|
+
}
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
channelName: genkitChannels.embedMany.channelName,
|
|
1319
|
+
module: {
|
|
1320
|
+
name: "@genkit-ai/ai",
|
|
1321
|
+
versionRange: genkitVersionRange,
|
|
1322
|
+
filePath: "lib/genkit-ai.js"
|
|
1323
|
+
},
|
|
1324
|
+
functionQuery: {
|
|
1325
|
+
className: "GenkitAI",
|
|
1326
|
+
methodName: "embedMany",
|
|
1327
|
+
kind: "Async"
|
|
1328
|
+
}
|
|
1329
|
+
},
|
|
1330
|
+
{
|
|
1331
|
+
channelName: genkitChannels.actionRun.channelName,
|
|
1332
|
+
module: {
|
|
1333
|
+
name: "@genkit-ai/ai",
|
|
1334
|
+
versionRange: genkitVersionRange,
|
|
1335
|
+
filePath: "lib/genkit-ai.mjs"
|
|
1336
|
+
},
|
|
1337
|
+
functionQuery: {
|
|
1338
|
+
className: "GenkitAI",
|
|
1339
|
+
methodName: "run",
|
|
1340
|
+
kind: "Async"
|
|
1341
|
+
}
|
|
1342
|
+
},
|
|
1343
|
+
{
|
|
1344
|
+
channelName: genkitChannels.actionRun.channelName,
|
|
1345
|
+
module: {
|
|
1346
|
+
name: "@genkit-ai/ai",
|
|
1347
|
+
versionRange: genkitVersionRange,
|
|
1348
|
+
filePath: "lib/genkit-ai.js"
|
|
1349
|
+
},
|
|
1350
|
+
functionQuery: {
|
|
1351
|
+
className: "GenkitAI",
|
|
1352
|
+
methodName: "run",
|
|
1353
|
+
kind: "Async"
|
|
1354
|
+
}
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
channelName: genkitCoreChannels.actionSpan.channelName,
|
|
1358
|
+
module: {
|
|
1359
|
+
name: "@genkit-ai/core",
|
|
1360
|
+
versionRange: genkitVersionRange,
|
|
1361
|
+
filePath: "lib/tracing/instrumentation.mjs"
|
|
1362
|
+
},
|
|
1363
|
+
functionQuery: {
|
|
1364
|
+
functionName: "runInNewSpan",
|
|
1365
|
+
kind: "Async"
|
|
1366
|
+
}
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
channelName: genkitCoreChannels.actionSpan.channelName,
|
|
1370
|
+
module: {
|
|
1371
|
+
name: "@genkit-ai/core",
|
|
1372
|
+
versionRange: genkitVersionRange,
|
|
1373
|
+
filePath: "lib/tracing/instrumentation.js"
|
|
1374
|
+
},
|
|
1375
|
+
functionQuery: {
|
|
1376
|
+
functionName: "runInNewSpan",
|
|
1377
|
+
kind: "Async"
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
];
|
|
1381
|
+
|
|
1382
|
+
// src/instrumentation/plugins/github-copilot-channels.ts
|
|
1383
|
+
var gitHubCopilotChannels = defineChannels("@github/copilot-sdk", {
|
|
1384
|
+
createSession: channel({
|
|
1385
|
+
channelName: "client.createSession",
|
|
1386
|
+
kind: "async"
|
|
1387
|
+
}),
|
|
1388
|
+
resumeSession: channel({
|
|
1389
|
+
channelName: "client.resumeSession",
|
|
1390
|
+
kind: "async"
|
|
1391
|
+
}),
|
|
1392
|
+
sendAndWait: channel({
|
|
1393
|
+
channelName: "session.sendAndWait",
|
|
1394
|
+
kind: "async"
|
|
1395
|
+
})
|
|
1396
|
+
});
|
|
1397
|
+
|
|
1398
|
+
// src/auto-instrumentations/configs/github-copilot.ts
|
|
1399
|
+
var gitHubCopilotConfigs = [
|
|
1400
|
+
// ESM: CopilotClient.createSession
|
|
1401
|
+
{
|
|
1402
|
+
channelName: gitHubCopilotChannels.createSession.channelName,
|
|
1403
|
+
module: {
|
|
1404
|
+
name: "@github/copilot-sdk",
|
|
1405
|
+
versionRange: ">=0.3.0",
|
|
1406
|
+
filePath: "dist/client.js"
|
|
1407
|
+
},
|
|
1408
|
+
functionQuery: {
|
|
1409
|
+
className: "CopilotClient",
|
|
1410
|
+
methodName: "createSession",
|
|
1411
|
+
kind: "Async"
|
|
1412
|
+
}
|
|
1413
|
+
},
|
|
1414
|
+
// CJS: CopilotClient.createSession
|
|
1415
|
+
{
|
|
1416
|
+
channelName: gitHubCopilotChannels.createSession.channelName,
|
|
1417
|
+
module: {
|
|
1418
|
+
name: "@github/copilot-sdk",
|
|
1419
|
+
versionRange: ">=0.3.0",
|
|
1420
|
+
filePath: "dist/cjs/client.js"
|
|
1421
|
+
},
|
|
1422
|
+
functionQuery: {
|
|
1423
|
+
className: "CopilotClient",
|
|
1424
|
+
methodName: "createSession",
|
|
1425
|
+
kind: "Async"
|
|
1426
|
+
}
|
|
1427
|
+
},
|
|
1428
|
+
// ESM: CopilotClient.resumeSession
|
|
1429
|
+
{
|
|
1430
|
+
channelName: gitHubCopilotChannels.resumeSession.channelName,
|
|
1431
|
+
module: {
|
|
1432
|
+
name: "@github/copilot-sdk",
|
|
1433
|
+
versionRange: ">=0.3.0",
|
|
1434
|
+
filePath: "dist/client.js"
|
|
1435
|
+
},
|
|
1436
|
+
functionQuery: {
|
|
1437
|
+
className: "CopilotClient",
|
|
1438
|
+
methodName: "resumeSession",
|
|
1439
|
+
kind: "Async"
|
|
1440
|
+
}
|
|
1441
|
+
},
|
|
1442
|
+
// CJS: CopilotClient.resumeSession
|
|
1443
|
+
{
|
|
1444
|
+
channelName: gitHubCopilotChannels.resumeSession.channelName,
|
|
1445
|
+
module: {
|
|
1446
|
+
name: "@github/copilot-sdk",
|
|
1447
|
+
versionRange: ">=0.3.0",
|
|
1448
|
+
filePath: "dist/cjs/client.js"
|
|
1449
|
+
},
|
|
1450
|
+
functionQuery: {
|
|
1451
|
+
className: "CopilotClient",
|
|
1452
|
+
methodName: "resumeSession",
|
|
1453
|
+
kind: "Async"
|
|
1454
|
+
}
|
|
1455
|
+
},
|
|
1456
|
+
// ESM: CopilotSession.sendAndWait
|
|
1457
|
+
{
|
|
1458
|
+
channelName: gitHubCopilotChannels.sendAndWait.channelName,
|
|
1459
|
+
module: {
|
|
1460
|
+
name: "@github/copilot-sdk",
|
|
1461
|
+
versionRange: ">=0.3.0",
|
|
1462
|
+
filePath: "dist/session.js"
|
|
1463
|
+
},
|
|
1464
|
+
functionQuery: {
|
|
1465
|
+
className: "CopilotSession",
|
|
1466
|
+
methodName: "sendAndWait",
|
|
1467
|
+
kind: "Async"
|
|
1468
|
+
}
|
|
1469
|
+
},
|
|
1470
|
+
// CJS: CopilotSession.sendAndWait
|
|
1471
|
+
{
|
|
1472
|
+
channelName: gitHubCopilotChannels.sendAndWait.channelName,
|
|
1473
|
+
module: {
|
|
1474
|
+
name: "@github/copilot-sdk",
|
|
1475
|
+
versionRange: ">=0.3.0",
|
|
1476
|
+
filePath: "dist/cjs/session.js"
|
|
1477
|
+
},
|
|
1478
|
+
functionQuery: {
|
|
1479
|
+
className: "CopilotSession",
|
|
1480
|
+
methodName: "sendAndWait",
|
|
1481
|
+
kind: "Async"
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
];
|
|
1485
|
+
|
|
1486
|
+
// src/instrumentation/plugins/google-adk-channels.ts
|
|
1487
|
+
var googleADKChannels = defineChannels("@google/adk", {
|
|
1488
|
+
runnerRunAsync: channel({
|
|
1489
|
+
channelName: "runner.runAsync",
|
|
1490
|
+
kind: "sync-stream"
|
|
1491
|
+
}),
|
|
1492
|
+
agentRunAsync: channel({
|
|
1493
|
+
channelName: "agent.runAsync",
|
|
1494
|
+
kind: "sync-stream"
|
|
1495
|
+
}),
|
|
1496
|
+
toolRunAsync: channel({
|
|
1497
|
+
channelName: "tool.runAsync",
|
|
1498
|
+
kind: "async"
|
|
1499
|
+
})
|
|
1500
|
+
});
|
|
1501
|
+
|
|
1502
|
+
// src/auto-instrumentations/configs/google-adk.ts
|
|
1503
|
+
var googleADKVersionRange = ">=0.1.0";
|
|
1504
|
+
var googleADKBundledIndexV06VersionRange = ">=0.6.1 <0.7.0";
|
|
1505
|
+
var googleADKBundledIndexV1VersionRange = ">=1.0.0 <2.0.0";
|
|
1506
|
+
var googleADKConfigs = [
|
|
1507
|
+
// --- Runner.runAsync --- async generator, kind "Sync" + sync-stream channel
|
|
1508
|
+
// Runner.runAsync — ESM individual module file
|
|
1509
|
+
{
|
|
1510
|
+
channelName: googleADKChannels.runnerRunAsync.channelName,
|
|
1511
|
+
module: {
|
|
1512
|
+
name: "@google/adk",
|
|
1513
|
+
versionRange: googleADKVersionRange,
|
|
1514
|
+
filePath: "dist/esm/runner/runner.js"
|
|
1515
|
+
},
|
|
1516
|
+
functionQuery: {
|
|
1517
|
+
className: "Runner",
|
|
1518
|
+
methodName: "runAsync",
|
|
1519
|
+
kind: "Sync"
|
|
1520
|
+
}
|
|
1521
|
+
},
|
|
1522
|
+
// Runner.runAsync — bundled CJS/ESM indexes
|
|
1523
|
+
// The bundled entrypoints minify class names, so target the 12th sync
|
|
1524
|
+
// `runAsync` method in file order rather than a class name. This mapping is
|
|
1525
|
+
// only validated against the current 0.6.x bundle layout, so keep the range
|
|
1526
|
+
// tight until we verify newer bundled outputs.
|
|
1527
|
+
{
|
|
1528
|
+
channelName: googleADKChannels.runnerRunAsync.channelName,
|
|
1529
|
+
module: {
|
|
1530
|
+
name: "@google/adk",
|
|
1531
|
+
versionRange: googleADKBundledIndexV06VersionRange,
|
|
1532
|
+
filePath: "dist/cjs/index.js"
|
|
1533
|
+
},
|
|
1534
|
+
functionQuery: {
|
|
1535
|
+
methodName: "runAsync",
|
|
1536
|
+
kind: "Sync",
|
|
1537
|
+
index: 11
|
|
1538
|
+
}
|
|
1539
|
+
},
|
|
1540
|
+
{
|
|
1541
|
+
channelName: googleADKChannels.runnerRunAsync.channelName,
|
|
1542
|
+
module: {
|
|
1543
|
+
name: "@google/adk",
|
|
1544
|
+
versionRange: googleADKBundledIndexV06VersionRange,
|
|
1545
|
+
filePath: "dist/esm/index.js"
|
|
1546
|
+
},
|
|
1547
|
+
functionQuery: {
|
|
1548
|
+
methodName: "runAsync",
|
|
1549
|
+
kind: "Sync",
|
|
1550
|
+
index: 11
|
|
1551
|
+
}
|
|
1552
|
+
},
|
|
1553
|
+
// The 1.x bundled entrypoints still inline the runtime into index.js, but
|
|
1554
|
+
// the minified method order changed. These indices are verified against 1.0.0.
|
|
1555
|
+
{
|
|
1556
|
+
channelName: googleADKChannels.runnerRunAsync.channelName,
|
|
1557
|
+
module: {
|
|
1558
|
+
name: "@google/adk",
|
|
1559
|
+
versionRange: googleADKBundledIndexV1VersionRange,
|
|
1560
|
+
filePath: "dist/cjs/index.js"
|
|
1561
|
+
},
|
|
1562
|
+
functionQuery: {
|
|
1563
|
+
methodName: "runAsync",
|
|
1564
|
+
kind: "Sync",
|
|
1565
|
+
index: 12
|
|
1566
|
+
}
|
|
1567
|
+
},
|
|
1568
|
+
{
|
|
1569
|
+
channelName: googleADKChannels.runnerRunAsync.channelName,
|
|
1570
|
+
module: {
|
|
1571
|
+
name: "@google/adk",
|
|
1572
|
+
versionRange: googleADKBundledIndexV1VersionRange,
|
|
1573
|
+
filePath: "dist/esm/index.js"
|
|
1574
|
+
},
|
|
1575
|
+
functionQuery: {
|
|
1576
|
+
methodName: "runAsync",
|
|
1577
|
+
kind: "Sync",
|
|
1578
|
+
index: 12
|
|
1579
|
+
}
|
|
1580
|
+
},
|
|
1581
|
+
// --- BaseAgent.runAsync --- async generator, kind "Sync" + sync-stream channel
|
|
1582
|
+
// BaseAgent.runAsync — ESM individual module file
|
|
1583
|
+
{
|
|
1584
|
+
channelName: googleADKChannels.agentRunAsync.channelName,
|
|
1585
|
+
module: {
|
|
1586
|
+
name: "@google/adk",
|
|
1587
|
+
versionRange: googleADKVersionRange,
|
|
1588
|
+
filePath: "dist/esm/agents/base_agent.js"
|
|
1589
|
+
},
|
|
1590
|
+
functionQuery: {
|
|
1591
|
+
className: "BaseAgent",
|
|
1592
|
+
methodName: "runAsync",
|
|
1593
|
+
kind: "Sync"
|
|
1594
|
+
}
|
|
1595
|
+
},
|
|
1596
|
+
// BaseAgent.runAsync — bundled CJS/ESM indexes
|
|
1597
|
+
// The bundled entrypoints minify class names, so target the first sync
|
|
1598
|
+
// `runAsync` method in file order rather than a class name. This mapping is
|
|
1599
|
+
// only validated against the current 0.6.x bundle layout, so keep the range
|
|
1600
|
+
// tight until we verify newer bundled outputs.
|
|
1601
|
+
{
|
|
1602
|
+
channelName: googleADKChannels.agentRunAsync.channelName,
|
|
1603
|
+
module: {
|
|
1604
|
+
name: "@google/adk",
|
|
1605
|
+
versionRange: googleADKBundledIndexV06VersionRange,
|
|
1606
|
+
filePath: "dist/cjs/index.js"
|
|
1607
|
+
},
|
|
1608
|
+
functionQuery: {
|
|
1609
|
+
methodName: "runAsync",
|
|
1610
|
+
kind: "Sync",
|
|
1611
|
+
index: 0
|
|
1612
|
+
}
|
|
1613
|
+
},
|
|
1614
|
+
{
|
|
1615
|
+
channelName: googleADKChannels.agentRunAsync.channelName,
|
|
1616
|
+
module: {
|
|
1617
|
+
name: "@google/adk",
|
|
1618
|
+
versionRange: googleADKBundledIndexV06VersionRange,
|
|
1619
|
+
filePath: "dist/esm/index.js"
|
|
1620
|
+
},
|
|
1621
|
+
functionQuery: {
|
|
1622
|
+
methodName: "runAsync",
|
|
1623
|
+
kind: "Sync",
|
|
1624
|
+
index: 0
|
|
1625
|
+
}
|
|
1626
|
+
},
|
|
1627
|
+
// The 1.x bundled entrypoints keep BaseAgent.runAsync as the first bundled
|
|
1628
|
+
// async-generator runAsync method in file order.
|
|
1629
|
+
{
|
|
1630
|
+
channelName: googleADKChannels.agentRunAsync.channelName,
|
|
1631
|
+
module: {
|
|
1632
|
+
name: "@google/adk",
|
|
1633
|
+
versionRange: googleADKBundledIndexV1VersionRange,
|
|
1634
|
+
filePath: "dist/cjs/index.js"
|
|
1635
|
+
},
|
|
1636
|
+
functionQuery: {
|
|
1637
|
+
methodName: "runAsync",
|
|
1638
|
+
kind: "Sync",
|
|
1639
|
+
index: 0
|
|
1640
|
+
}
|
|
1641
|
+
},
|
|
1642
|
+
{
|
|
1643
|
+
channelName: googleADKChannels.agentRunAsync.channelName,
|
|
1644
|
+
module: {
|
|
1645
|
+
name: "@google/adk",
|
|
1646
|
+
versionRange: googleADKBundledIndexV1VersionRange,
|
|
1647
|
+
filePath: "dist/esm/index.js"
|
|
1648
|
+
},
|
|
1649
|
+
functionQuery: {
|
|
1650
|
+
methodName: "runAsync",
|
|
1651
|
+
kind: "Sync",
|
|
1652
|
+
index: 0
|
|
1653
|
+
}
|
|
1654
|
+
},
|
|
1655
|
+
// --- FunctionTool.runAsync --- regular async, kind "Async"
|
|
1656
|
+
// FunctionTool.runAsync — ESM individual module file
|
|
1657
|
+
{
|
|
1658
|
+
channelName: googleADKChannels.toolRunAsync.channelName,
|
|
1659
|
+
module: {
|
|
1660
|
+
name: "@google/adk",
|
|
1661
|
+
versionRange: googleADKVersionRange,
|
|
1662
|
+
filePath: "dist/esm/tools/function_tool.js"
|
|
1663
|
+
},
|
|
1664
|
+
functionQuery: {
|
|
1665
|
+
className: "FunctionTool",
|
|
1666
|
+
methodName: "runAsync",
|
|
1667
|
+
kind: "Async"
|
|
1668
|
+
}
|
|
1669
|
+
},
|
|
1670
|
+
// FunctionTool.runAsync — bundled CJS/ESM indexes
|
|
1671
|
+
// The bundled entrypoints minify class names, so target the first async
|
|
1672
|
+
// `runAsync` method in file order rather than a class name. This mapping is
|
|
1673
|
+
// only validated against the current 0.6.x bundle layout, so keep the range
|
|
1674
|
+
// tight until we verify newer bundled outputs.
|
|
1675
|
+
{
|
|
1676
|
+
channelName: googleADKChannels.toolRunAsync.channelName,
|
|
1677
|
+
module: {
|
|
1678
|
+
name: "@google/adk",
|
|
1679
|
+
versionRange: googleADKBundledIndexV06VersionRange,
|
|
1680
|
+
filePath: "dist/cjs/index.js"
|
|
1681
|
+
},
|
|
1682
|
+
functionQuery: {
|
|
1683
|
+
methodName: "runAsync",
|
|
1684
|
+
kind: "Async",
|
|
1685
|
+
index: 1
|
|
1686
|
+
}
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
channelName: googleADKChannels.toolRunAsync.channelName,
|
|
1690
|
+
module: {
|
|
1691
|
+
name: "@google/adk",
|
|
1692
|
+
versionRange: googleADKBundledIndexV06VersionRange,
|
|
1693
|
+
filePath: "dist/esm/index.js"
|
|
1694
|
+
},
|
|
1695
|
+
functionQuery: {
|
|
1696
|
+
methodName: "runAsync",
|
|
1697
|
+
kind: "Async",
|
|
1698
|
+
index: 1
|
|
1699
|
+
}
|
|
1700
|
+
},
|
|
1701
|
+
// The 1.x bundle moves FunctionTool.runAsync behind one helper method.
|
|
1702
|
+
{
|
|
1703
|
+
channelName: googleADKChannels.toolRunAsync.channelName,
|
|
1704
|
+
module: {
|
|
1705
|
+
name: "@google/adk",
|
|
1706
|
+
versionRange: googleADKBundledIndexV1VersionRange,
|
|
1707
|
+
filePath: "dist/cjs/index.js"
|
|
1708
|
+
},
|
|
1709
|
+
functionQuery: {
|
|
1710
|
+
methodName: "runAsync",
|
|
1711
|
+
kind: "Async",
|
|
1712
|
+
index: 1
|
|
1713
|
+
}
|
|
1714
|
+
},
|
|
1715
|
+
{
|
|
1716
|
+
channelName: googleADKChannels.toolRunAsync.channelName,
|
|
1717
|
+
module: {
|
|
1718
|
+
name: "@google/adk",
|
|
1719
|
+
versionRange: googleADKBundledIndexV1VersionRange,
|
|
1720
|
+
filePath: "dist/esm/index.js"
|
|
1721
|
+
},
|
|
1722
|
+
functionQuery: {
|
|
1723
|
+
methodName: "runAsync",
|
|
1724
|
+
kind: "Async",
|
|
1725
|
+
index: 1
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
];
|
|
1729
|
+
|
|
1730
|
+
// src/instrumentation/plugins/google-genai-channels.ts
|
|
1731
|
+
var googleGenAIChannels = defineChannels("@google/genai", {
|
|
1732
|
+
generateContent: channel({
|
|
1733
|
+
channelName: "models.generateContent",
|
|
1734
|
+
kind: "async"
|
|
1735
|
+
}),
|
|
1736
|
+
generateContentStream: channel({
|
|
1737
|
+
channelName: "models.generateContentStream",
|
|
1738
|
+
kind: "async"
|
|
1739
|
+
}),
|
|
1740
|
+
embedContent: channel({
|
|
1741
|
+
channelName: "models.embedContent",
|
|
1742
|
+
kind: "async"
|
|
1743
|
+
})
|
|
1744
|
+
});
|
|
1745
|
+
|
|
1746
|
+
// src/auto-instrumentations/configs/google-genai.ts
|
|
1747
|
+
var googleGenAIConfigs = [
|
|
1748
|
+
// Models.generateContentInternal - The actual class method (Node.js entry point)
|
|
1749
|
+
// Note: generateContent is an arrow function property that calls this internal method
|
|
1750
|
+
{
|
|
1751
|
+
channelName: googleGenAIChannels.generateContent.channelName,
|
|
1752
|
+
module: {
|
|
1753
|
+
name: "@google/genai",
|
|
1754
|
+
versionRange: ">=1.0.0",
|
|
1755
|
+
filePath: "dist/node/index.mjs"
|
|
1756
|
+
},
|
|
1757
|
+
functionQuery: {
|
|
1758
|
+
className: "Models",
|
|
1759
|
+
methodName: "generateContentInternal",
|
|
1760
|
+
kind: "Async"
|
|
1761
|
+
}
|
|
1762
|
+
},
|
|
1763
|
+
// Models.generateContentStreamInternal - The actual class method (Node.js entry point)
|
|
1764
|
+
// Note: generateContentStream is an arrow function property that calls this internal method
|
|
1765
|
+
{
|
|
1766
|
+
channelName: googleGenAIChannels.generateContentStream.channelName,
|
|
1767
|
+
module: {
|
|
1768
|
+
name: "@google/genai",
|
|
1769
|
+
versionRange: ">=1.0.0",
|
|
1770
|
+
filePath: "dist/node/index.mjs"
|
|
1771
|
+
},
|
|
1772
|
+
functionQuery: {
|
|
1773
|
+
className: "Models",
|
|
1774
|
+
methodName: "generateContentStreamInternal",
|
|
1775
|
+
kind: "Async"
|
|
1776
|
+
}
|
|
1777
|
+
},
|
|
1778
|
+
// Models.embedContent - class method in older SDK versions
|
|
1779
|
+
{
|
|
1780
|
+
channelName: googleGenAIChannels.embedContent.channelName,
|
|
1781
|
+
module: {
|
|
1782
|
+
name: "@google/genai",
|
|
1783
|
+
versionRange: ">=1.0.0 <1.44.0",
|
|
1784
|
+
filePath: "dist/node/index.mjs"
|
|
1785
|
+
},
|
|
1786
|
+
functionQuery: {
|
|
1787
|
+
className: "Models",
|
|
1788
|
+
methodName: "embedContent",
|
|
1789
|
+
kind: "Async"
|
|
1790
|
+
}
|
|
1791
|
+
},
|
|
1792
|
+
// Models.embedContentInternal - class method in newer SDK versions
|
|
1793
|
+
// Note: embedContent is an arrow function property that calls this method
|
|
1794
|
+
{
|
|
1795
|
+
channelName: googleGenAIChannels.embedContent.channelName,
|
|
1796
|
+
module: {
|
|
1797
|
+
name: "@google/genai",
|
|
1798
|
+
versionRange: ">=1.44.0",
|
|
1799
|
+
filePath: "dist/node/index.mjs"
|
|
1800
|
+
},
|
|
1801
|
+
functionQuery: {
|
|
1802
|
+
className: "Models",
|
|
1803
|
+
methodName: "embedContentInternal",
|
|
1804
|
+
kind: "Async"
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
];
|
|
1808
|
+
|
|
1809
|
+
// src/instrumentation/plugins/groq-channels.ts
|
|
1810
|
+
var groqChannels = defineChannels("groq-sdk", {
|
|
1811
|
+
chatCompletionsCreate: channel({
|
|
1812
|
+
channelName: "chat.completions.create",
|
|
1813
|
+
kind: "async"
|
|
1814
|
+
}),
|
|
1815
|
+
embeddingsCreate: channel(
|
|
1816
|
+
{
|
|
1817
|
+
channelName: "embeddings.create",
|
|
1818
|
+
kind: "async"
|
|
1819
|
+
}
|
|
1820
|
+
)
|
|
1821
|
+
});
|
|
1822
|
+
|
|
1823
|
+
// src/auto-instrumentations/configs/groq.ts
|
|
1824
|
+
var groqConfigs = [
|
|
1825
|
+
{
|
|
1826
|
+
channelName: groqChannels.chatCompletionsCreate.channelName,
|
|
1827
|
+
module: {
|
|
1828
|
+
name: "groq-sdk",
|
|
1829
|
+
versionRange: ">=1.0.0",
|
|
1830
|
+
filePath: "resources/chat/completions.mjs"
|
|
1831
|
+
},
|
|
1832
|
+
functionQuery: {
|
|
1833
|
+
className: "Completions",
|
|
1834
|
+
methodName: "create",
|
|
1835
|
+
kind: "Async"
|
|
1836
|
+
}
|
|
1837
|
+
},
|
|
1838
|
+
{
|
|
1839
|
+
channelName: groqChannels.embeddingsCreate.channelName,
|
|
1840
|
+
module: {
|
|
1841
|
+
name: "groq-sdk",
|
|
1842
|
+
versionRange: ">=1.0.0",
|
|
1843
|
+
filePath: "resources/embeddings.mjs"
|
|
1844
|
+
},
|
|
1845
|
+
functionQuery: {
|
|
1846
|
+
className: "Embeddings",
|
|
1847
|
+
methodName: "create",
|
|
1848
|
+
kind: "Async"
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
];
|
|
1852
|
+
|
|
1853
|
+
// src/instrumentation/plugins/huggingface-channels.ts
|
|
1854
|
+
var huggingFaceChannels = defineChannels("@huggingface/inference", {
|
|
1855
|
+
chatCompletion: channel({
|
|
1856
|
+
channelName: "chatCompletion",
|
|
1857
|
+
kind: "async"
|
|
1858
|
+
}),
|
|
1859
|
+
chatCompletionStream: channel({
|
|
1860
|
+
channelName: "chatCompletionStream",
|
|
1861
|
+
kind: "sync-stream"
|
|
1862
|
+
}),
|
|
1863
|
+
textGeneration: channel({
|
|
1864
|
+
channelName: "textGeneration",
|
|
1865
|
+
kind: "async"
|
|
1866
|
+
}),
|
|
1867
|
+
textGenerationStream: channel({
|
|
1868
|
+
channelName: "textGenerationStream",
|
|
1869
|
+
kind: "sync-stream"
|
|
1870
|
+
}),
|
|
1871
|
+
featureExtraction: channel({
|
|
1872
|
+
channelName: "featureExtraction",
|
|
1873
|
+
kind: "async"
|
|
1874
|
+
})
|
|
1875
|
+
});
|
|
1876
|
+
|
|
1877
|
+
// src/auto-instrumentations/configs/huggingface.ts
|
|
1878
|
+
var huggingFaceConfigs = [
|
|
1879
|
+
{
|
|
1880
|
+
channelName: huggingFaceChannels.chatCompletion.channelName,
|
|
1881
|
+
module: {
|
|
1882
|
+
name: "@huggingface/inference",
|
|
1883
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
1884
|
+
filePath: "dist/index.js"
|
|
1885
|
+
},
|
|
1886
|
+
functionQuery: {
|
|
1887
|
+
functionName: "chatCompletion",
|
|
1888
|
+
kind: "Async"
|
|
1889
|
+
}
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
channelName: huggingFaceChannels.chatCompletion.channelName,
|
|
1893
|
+
module: {
|
|
1894
|
+
name: "@huggingface/inference",
|
|
1895
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
1896
|
+
filePath: "dist/index.cjs"
|
|
1897
|
+
},
|
|
1898
|
+
functionQuery: {
|
|
1899
|
+
functionName: "chatCompletion",
|
|
1900
|
+
kind: "Async"
|
|
1901
|
+
}
|
|
1902
|
+
},
|
|
1903
|
+
{
|
|
1904
|
+
channelName: huggingFaceChannels.chatCompletionStream.channelName,
|
|
1905
|
+
module: {
|
|
1906
|
+
name: "@huggingface/inference",
|
|
1907
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
1908
|
+
filePath: "dist/index.js"
|
|
1909
|
+
},
|
|
1910
|
+
functionQuery: {
|
|
1911
|
+
functionName: "chatCompletionStream",
|
|
1912
|
+
kind: "Sync"
|
|
1913
|
+
}
|
|
1914
|
+
},
|
|
1915
|
+
{
|
|
1916
|
+
channelName: huggingFaceChannels.chatCompletionStream.channelName,
|
|
1917
|
+
module: {
|
|
1918
|
+
name: "@huggingface/inference",
|
|
1919
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
1920
|
+
filePath: "dist/index.cjs"
|
|
1921
|
+
},
|
|
1922
|
+
functionQuery: {
|
|
1923
|
+
functionName: "chatCompletionStream",
|
|
1924
|
+
kind: "Sync"
|
|
1925
|
+
}
|
|
1926
|
+
},
|
|
1927
|
+
{
|
|
1928
|
+
channelName: huggingFaceChannels.textGeneration.channelName,
|
|
1929
|
+
module: {
|
|
1930
|
+
name: "@huggingface/inference",
|
|
1931
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
1932
|
+
filePath: "dist/index.js"
|
|
1933
|
+
},
|
|
1934
|
+
functionQuery: {
|
|
1935
|
+
functionName: "textGeneration",
|
|
1936
|
+
kind: "Async"
|
|
1937
|
+
}
|
|
1938
|
+
},
|
|
1939
|
+
{
|
|
1940
|
+
channelName: huggingFaceChannels.textGeneration.channelName,
|
|
1941
|
+
module: {
|
|
1942
|
+
name: "@huggingface/inference",
|
|
1943
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
1944
|
+
filePath: "dist/index.cjs"
|
|
1945
|
+
},
|
|
1946
|
+
functionQuery: {
|
|
1947
|
+
functionName: "textGeneration",
|
|
1948
|
+
kind: "Async"
|
|
1949
|
+
}
|
|
1950
|
+
},
|
|
1951
|
+
{
|
|
1952
|
+
channelName: huggingFaceChannels.textGenerationStream.channelName,
|
|
1953
|
+
module: {
|
|
1954
|
+
name: "@huggingface/inference",
|
|
1955
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
1956
|
+
filePath: "dist/index.js"
|
|
1957
|
+
},
|
|
1958
|
+
functionQuery: {
|
|
1959
|
+
functionName: "textGenerationStream",
|
|
1960
|
+
kind: "Sync"
|
|
1961
|
+
}
|
|
1962
|
+
},
|
|
1963
|
+
{
|
|
1964
|
+
channelName: huggingFaceChannels.textGenerationStream.channelName,
|
|
1965
|
+
module: {
|
|
1966
|
+
name: "@huggingface/inference",
|
|
1967
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
1968
|
+
filePath: "dist/index.cjs"
|
|
1969
|
+
},
|
|
1970
|
+
functionQuery: {
|
|
1971
|
+
functionName: "textGenerationStream",
|
|
1972
|
+
kind: "Sync"
|
|
1973
|
+
}
|
|
1974
|
+
},
|
|
1975
|
+
{
|
|
1976
|
+
channelName: huggingFaceChannels.featureExtraction.channelName,
|
|
1977
|
+
module: {
|
|
1978
|
+
name: "@huggingface/inference",
|
|
1979
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
1980
|
+
filePath: "dist/index.js"
|
|
1981
|
+
},
|
|
1982
|
+
functionQuery: {
|
|
1983
|
+
functionName: "featureExtraction",
|
|
1984
|
+
kind: "Async"
|
|
1985
|
+
}
|
|
1986
|
+
},
|
|
1987
|
+
{
|
|
1988
|
+
channelName: huggingFaceChannels.featureExtraction.channelName,
|
|
1989
|
+
module: {
|
|
1990
|
+
name: "@huggingface/inference",
|
|
1991
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
1992
|
+
filePath: "dist/index.cjs"
|
|
1993
|
+
},
|
|
1994
|
+
functionQuery: {
|
|
1995
|
+
functionName: "featureExtraction",
|
|
1996
|
+
kind: "Async"
|
|
1997
|
+
}
|
|
1998
|
+
},
|
|
1999
|
+
{
|
|
2000
|
+
channelName: huggingFaceChannels.chatCompletion.channelName,
|
|
2001
|
+
module: {
|
|
2002
|
+
name: "@huggingface/inference",
|
|
2003
|
+
versionRange: ">=3.0.0 <5.0.0",
|
|
2004
|
+
filePath: "dist/esm/tasks/nlp/chatCompletion.js"
|
|
2005
|
+
},
|
|
2006
|
+
functionQuery: {
|
|
2007
|
+
functionName: "chatCompletion",
|
|
2008
|
+
kind: "Async"
|
|
2009
|
+
}
|
|
2010
|
+
},
|
|
2011
|
+
{
|
|
2012
|
+
channelName: huggingFaceChannels.chatCompletion.channelName,
|
|
2013
|
+
module: {
|
|
2014
|
+
name: "@huggingface/inference",
|
|
2015
|
+
versionRange: ">=3.0.0 <5.0.0",
|
|
2016
|
+
filePath: "dist/commonjs/tasks/nlp/chatCompletion.js"
|
|
2017
|
+
},
|
|
2018
|
+
functionQuery: {
|
|
2019
|
+
functionName: "chatCompletion",
|
|
2020
|
+
kind: "Async"
|
|
2021
|
+
}
|
|
2022
|
+
},
|
|
2023
|
+
{
|
|
2024
|
+
channelName: huggingFaceChannels.chatCompletionStream.channelName,
|
|
2025
|
+
module: {
|
|
2026
|
+
name: "@huggingface/inference",
|
|
2027
|
+
versionRange: ">=3.0.0 <5.0.0",
|
|
2028
|
+
filePath: "dist/esm/tasks/nlp/chatCompletionStream.js"
|
|
2029
|
+
},
|
|
2030
|
+
functionQuery: {
|
|
2031
|
+
functionName: "chatCompletionStream",
|
|
2032
|
+
kind: "Sync"
|
|
2033
|
+
}
|
|
2034
|
+
},
|
|
2035
|
+
{
|
|
2036
|
+
channelName: huggingFaceChannels.chatCompletionStream.channelName,
|
|
2037
|
+
module: {
|
|
2038
|
+
name: "@huggingface/inference",
|
|
2039
|
+
versionRange: ">=3.0.0 <5.0.0",
|
|
2040
|
+
filePath: "dist/commonjs/tasks/nlp/chatCompletionStream.js"
|
|
2041
|
+
},
|
|
2042
|
+
functionQuery: {
|
|
2043
|
+
functionName: "chatCompletionStream",
|
|
2044
|
+
kind: "Sync"
|
|
2045
|
+
}
|
|
2046
|
+
},
|
|
2047
|
+
{
|
|
2048
|
+
channelName: huggingFaceChannels.textGeneration.channelName,
|
|
2049
|
+
module: {
|
|
2050
|
+
name: "@huggingface/inference",
|
|
2051
|
+
versionRange: ">=3.0.0 <5.0.0",
|
|
2052
|
+
filePath: "dist/esm/tasks/nlp/textGeneration.js"
|
|
2053
|
+
},
|
|
2054
|
+
functionQuery: {
|
|
2055
|
+
functionName: "textGeneration",
|
|
2056
|
+
kind: "Async"
|
|
2057
|
+
}
|
|
2058
|
+
},
|
|
2059
|
+
{
|
|
2060
|
+
channelName: huggingFaceChannels.textGeneration.channelName,
|
|
2061
|
+
module: {
|
|
2062
|
+
name: "@huggingface/inference",
|
|
2063
|
+
versionRange: ">=3.0.0 <5.0.0",
|
|
2064
|
+
filePath: "dist/commonjs/tasks/nlp/textGeneration.js"
|
|
2065
|
+
},
|
|
2066
|
+
functionQuery: {
|
|
2067
|
+
functionName: "textGeneration",
|
|
2068
|
+
kind: "Async"
|
|
2069
|
+
}
|
|
2070
|
+
},
|
|
2071
|
+
{
|
|
2072
|
+
channelName: huggingFaceChannels.textGenerationStream.channelName,
|
|
2073
|
+
module: {
|
|
2074
|
+
name: "@huggingface/inference",
|
|
2075
|
+
versionRange: ">=3.0.0 <5.0.0",
|
|
2076
|
+
filePath: "dist/esm/tasks/nlp/textGenerationStream.js"
|
|
2077
|
+
},
|
|
2078
|
+
functionQuery: {
|
|
2079
|
+
functionName: "textGenerationStream",
|
|
2080
|
+
kind: "Sync"
|
|
2081
|
+
}
|
|
2082
|
+
},
|
|
2083
|
+
{
|
|
2084
|
+
channelName: huggingFaceChannels.textGenerationStream.channelName,
|
|
2085
|
+
module: {
|
|
2086
|
+
name: "@huggingface/inference",
|
|
2087
|
+
versionRange: ">=3.0.0 <5.0.0",
|
|
2088
|
+
filePath: "dist/commonjs/tasks/nlp/textGenerationStream.js"
|
|
2089
|
+
},
|
|
2090
|
+
functionQuery: {
|
|
2091
|
+
functionName: "textGenerationStream",
|
|
2092
|
+
kind: "Sync"
|
|
2093
|
+
}
|
|
2094
|
+
},
|
|
2095
|
+
{
|
|
2096
|
+
channelName: huggingFaceChannels.featureExtraction.channelName,
|
|
2097
|
+
module: {
|
|
2098
|
+
name: "@huggingface/inference",
|
|
2099
|
+
versionRange: ">=3.0.0 <5.0.0",
|
|
2100
|
+
filePath: "dist/esm/tasks/nlp/featureExtraction.js"
|
|
2101
|
+
},
|
|
2102
|
+
functionQuery: {
|
|
2103
|
+
functionName: "featureExtraction",
|
|
2104
|
+
kind: "Async"
|
|
2105
|
+
}
|
|
2106
|
+
},
|
|
2107
|
+
{
|
|
2108
|
+
channelName: huggingFaceChannels.featureExtraction.channelName,
|
|
2109
|
+
module: {
|
|
2110
|
+
name: "@huggingface/inference",
|
|
2111
|
+
versionRange: ">=3.0.0 <5.0.0",
|
|
2112
|
+
filePath: "dist/commonjs/tasks/nlp/featureExtraction.js"
|
|
2113
|
+
},
|
|
2114
|
+
functionQuery: {
|
|
2115
|
+
functionName: "featureExtraction",
|
|
2116
|
+
kind: "Async"
|
|
2117
|
+
}
|
|
2118
|
+
}
|
|
2119
|
+
];
|
|
2120
|
+
|
|
2121
|
+
// src/instrumentation/plugins/langchain-channels.ts
|
|
2122
|
+
var langChainChannels = defineChannels("@langchain/core", {
|
|
2123
|
+
configure: channel({
|
|
2124
|
+
channelName: "CallbackManager.configure",
|
|
2125
|
+
kind: "sync-stream"
|
|
2126
|
+
}),
|
|
2127
|
+
configureSync: channel({
|
|
2128
|
+
channelName: "CallbackManager._configureSync",
|
|
2129
|
+
kind: "sync-stream"
|
|
2130
|
+
})
|
|
2131
|
+
});
|
|
2132
|
+
|
|
2133
|
+
// src/auto-instrumentations/configs/langchain.ts
|
|
2134
|
+
var langChainCoreVersionRange = ">=0.3.42";
|
|
2135
|
+
var langChainCallbackManagerFilePath = "dist/callbacks/manager.js";
|
|
2136
|
+
var langchainConfigs = [
|
|
2137
|
+
{
|
|
2138
|
+
channelName: langChainChannels.configure.channelName,
|
|
2139
|
+
module: {
|
|
2140
|
+
name: "@langchain/core",
|
|
2141
|
+
versionRange: langChainCoreVersionRange,
|
|
2142
|
+
filePath: langChainCallbackManagerFilePath
|
|
2143
|
+
},
|
|
2144
|
+
functionQuery: {
|
|
2145
|
+
className: "CallbackManager",
|
|
2146
|
+
methodName: "configure",
|
|
2147
|
+
kind: "Sync"
|
|
2148
|
+
}
|
|
2149
|
+
},
|
|
2150
|
+
{
|
|
2151
|
+
channelName: langChainChannels.configureSync.channelName,
|
|
2152
|
+
module: {
|
|
2153
|
+
name: "@langchain/core",
|
|
2154
|
+
versionRange: langChainCoreVersionRange,
|
|
2155
|
+
filePath: langChainCallbackManagerFilePath
|
|
2156
|
+
},
|
|
2157
|
+
functionQuery: {
|
|
2158
|
+
className: "CallbackManager",
|
|
2159
|
+
methodName: "_configureSync",
|
|
2160
|
+
kind: "Sync"
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
];
|
|
2164
|
+
|
|
2165
|
+
// src/instrumentation/plugins/mistral-channels.ts
|
|
2166
|
+
var mistralChannels = defineChannels("@mistralai/mistralai", {
|
|
2167
|
+
chatComplete: channel({
|
|
2168
|
+
channelName: "chat.complete",
|
|
2169
|
+
kind: "async"
|
|
2170
|
+
}),
|
|
2171
|
+
chatStream: channel({
|
|
2172
|
+
channelName: "chat.stream",
|
|
2173
|
+
kind: "async"
|
|
2174
|
+
}),
|
|
2175
|
+
embeddingsCreate: channel({
|
|
2176
|
+
channelName: "embeddings.create",
|
|
2177
|
+
kind: "async"
|
|
2178
|
+
}),
|
|
2179
|
+
classifiersModerate: channel({
|
|
2180
|
+
channelName: "classifiers.moderate",
|
|
2181
|
+
kind: "async"
|
|
2182
|
+
}),
|
|
2183
|
+
classifiersModerateChat: channel({
|
|
2184
|
+
channelName: "classifiers.moderateChat",
|
|
2185
|
+
kind: "async"
|
|
2186
|
+
}),
|
|
2187
|
+
classifiersClassify: channel({
|
|
2188
|
+
channelName: "classifiers.classify",
|
|
2189
|
+
kind: "async"
|
|
2190
|
+
}),
|
|
2191
|
+
classifiersClassifyChat: channel({
|
|
2192
|
+
channelName: "classifiers.classifyChat",
|
|
2193
|
+
kind: "async"
|
|
2194
|
+
}),
|
|
2195
|
+
fimComplete: channel({
|
|
2196
|
+
channelName: "fim.complete",
|
|
2197
|
+
kind: "async"
|
|
2198
|
+
}),
|
|
2199
|
+
fimStream: channel({
|
|
2200
|
+
channelName: "fim.stream",
|
|
2201
|
+
kind: "async"
|
|
2202
|
+
}),
|
|
2203
|
+
agentsComplete: channel({
|
|
2204
|
+
channelName: "agents.complete",
|
|
2205
|
+
kind: "async"
|
|
2206
|
+
}),
|
|
2207
|
+
agentsStream: channel({
|
|
2208
|
+
channelName: "agents.stream",
|
|
2209
|
+
kind: "async"
|
|
2210
|
+
})
|
|
2211
|
+
});
|
|
2212
|
+
|
|
2213
|
+
// src/auto-instrumentations/configs/mistral.ts
|
|
2214
|
+
var mistralConfigs = [
|
|
2215
|
+
{
|
|
2216
|
+
channelName: mistralChannels.chatComplete.channelName,
|
|
2217
|
+
module: {
|
|
2218
|
+
name: "@mistralai/mistralai",
|
|
2219
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
2220
|
+
filePath: "sdk/chat.js"
|
|
2221
|
+
},
|
|
2222
|
+
functionQuery: {
|
|
2223
|
+
className: "Chat",
|
|
2224
|
+
methodName: "complete",
|
|
2225
|
+
kind: "Async"
|
|
2226
|
+
}
|
|
2227
|
+
},
|
|
2228
|
+
{
|
|
2229
|
+
channelName: mistralChannels.chatComplete.channelName,
|
|
2230
|
+
module: {
|
|
2231
|
+
name: "@mistralai/mistralai",
|
|
2232
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2233
|
+
filePath: "esm/sdk/chat.js"
|
|
2234
|
+
},
|
|
2235
|
+
functionQuery: {
|
|
2236
|
+
className: "Chat",
|
|
2237
|
+
methodName: "complete",
|
|
2238
|
+
kind: "Async"
|
|
2239
|
+
}
|
|
2240
|
+
},
|
|
2241
|
+
{
|
|
2242
|
+
channelName: mistralChannels.chatStream.channelName,
|
|
2243
|
+
module: {
|
|
2244
|
+
name: "@mistralai/mistralai",
|
|
2245
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
2246
|
+
filePath: "sdk/chat.js"
|
|
2247
|
+
},
|
|
2248
|
+
functionQuery: {
|
|
2249
|
+
className: "Chat",
|
|
2250
|
+
methodName: "stream",
|
|
2251
|
+
kind: "Async"
|
|
2252
|
+
}
|
|
2253
|
+
},
|
|
2254
|
+
{
|
|
2255
|
+
channelName: mistralChannels.chatStream.channelName,
|
|
2256
|
+
module: {
|
|
2257
|
+
name: "@mistralai/mistralai",
|
|
2258
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2259
|
+
filePath: "esm/sdk/chat.js"
|
|
2260
|
+
},
|
|
2261
|
+
functionQuery: {
|
|
2262
|
+
className: "Chat",
|
|
2263
|
+
methodName: "stream",
|
|
2264
|
+
kind: "Async"
|
|
2265
|
+
}
|
|
2266
|
+
},
|
|
2267
|
+
{
|
|
2268
|
+
channelName: mistralChannels.embeddingsCreate.channelName,
|
|
2269
|
+
module: {
|
|
2270
|
+
name: "@mistralai/mistralai",
|
|
2271
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
2272
|
+
filePath: "sdk/embeddings.js"
|
|
2273
|
+
},
|
|
2274
|
+
functionQuery: {
|
|
2275
|
+
className: "Embeddings",
|
|
2276
|
+
methodName: "create",
|
|
2277
|
+
kind: "Async"
|
|
2278
|
+
}
|
|
2279
|
+
},
|
|
2280
|
+
{
|
|
2281
|
+
channelName: mistralChannels.embeddingsCreate.channelName,
|
|
2282
|
+
module: {
|
|
2283
|
+
name: "@mistralai/mistralai",
|
|
2284
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2285
|
+
filePath: "esm/sdk/embeddings.js"
|
|
2286
|
+
},
|
|
2287
|
+
functionQuery: {
|
|
2288
|
+
className: "Embeddings",
|
|
2289
|
+
methodName: "create",
|
|
2290
|
+
kind: "Async"
|
|
2291
|
+
}
|
|
2292
|
+
},
|
|
2293
|
+
{
|
|
2294
|
+
channelName: mistralChannels.classifiersModerate.channelName,
|
|
2295
|
+
module: {
|
|
2296
|
+
name: "@mistralai/mistralai",
|
|
2297
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
2298
|
+
filePath: "sdk/classifiers.js"
|
|
2299
|
+
},
|
|
2300
|
+
functionQuery: {
|
|
2301
|
+
className: "Classifiers",
|
|
2302
|
+
methodName: "moderate",
|
|
2303
|
+
kind: "Async"
|
|
2304
|
+
}
|
|
2305
|
+
},
|
|
2306
|
+
{
|
|
2307
|
+
channelName: mistralChannels.classifiersModerate.channelName,
|
|
2308
|
+
module: {
|
|
2309
|
+
name: "@mistralai/mistralai",
|
|
2310
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2311
|
+
filePath: "esm/sdk/classifiers.js"
|
|
2312
|
+
},
|
|
2313
|
+
functionQuery: {
|
|
2314
|
+
className: "Classifiers",
|
|
2315
|
+
methodName: "moderate",
|
|
2316
|
+
kind: "Async"
|
|
2317
|
+
}
|
|
2318
|
+
},
|
|
2319
|
+
{
|
|
2320
|
+
channelName: mistralChannels.classifiersModerateChat.channelName,
|
|
2321
|
+
module: {
|
|
2322
|
+
name: "@mistralai/mistralai",
|
|
2323
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
2324
|
+
filePath: "sdk/classifiers.js"
|
|
2325
|
+
},
|
|
2326
|
+
functionQuery: {
|
|
2327
|
+
className: "Classifiers",
|
|
2328
|
+
methodName: "moderateChat",
|
|
2329
|
+
kind: "Async"
|
|
2330
|
+
}
|
|
2331
|
+
},
|
|
2332
|
+
{
|
|
2333
|
+
channelName: mistralChannels.classifiersModerateChat.channelName,
|
|
2334
|
+
module: {
|
|
2335
|
+
name: "@mistralai/mistralai",
|
|
2336
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2337
|
+
filePath: "esm/sdk/classifiers.js"
|
|
2338
|
+
},
|
|
2339
|
+
functionQuery: {
|
|
2340
|
+
className: "Classifiers",
|
|
2341
|
+
methodName: "moderateChat",
|
|
2342
|
+
kind: "Async"
|
|
2343
|
+
}
|
|
2344
|
+
},
|
|
2345
|
+
{
|
|
2346
|
+
channelName: mistralChannels.classifiersClassify.channelName,
|
|
2347
|
+
module: {
|
|
2348
|
+
name: "@mistralai/mistralai",
|
|
2349
|
+
versionRange: ">=1.10.0 <2.0.0",
|
|
2350
|
+
filePath: "sdk/classifiers.js"
|
|
2351
|
+
},
|
|
2352
|
+
functionQuery: {
|
|
2353
|
+
className: "Classifiers",
|
|
2354
|
+
methodName: "classify",
|
|
2355
|
+
kind: "Async"
|
|
2356
|
+
}
|
|
2357
|
+
},
|
|
2358
|
+
{
|
|
2359
|
+
channelName: mistralChannels.classifiersClassify.channelName,
|
|
2360
|
+
module: {
|
|
2361
|
+
name: "@mistralai/mistralai",
|
|
2362
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2363
|
+
filePath: "esm/sdk/classifiers.js"
|
|
2364
|
+
},
|
|
2365
|
+
functionQuery: {
|
|
2366
|
+
className: "Classifiers",
|
|
2367
|
+
methodName: "classify",
|
|
2368
|
+
kind: "Async"
|
|
2369
|
+
}
|
|
2370
|
+
},
|
|
2371
|
+
{
|
|
2372
|
+
channelName: mistralChannels.classifiersClassifyChat.channelName,
|
|
2373
|
+
module: {
|
|
2374
|
+
name: "@mistralai/mistralai",
|
|
2375
|
+
versionRange: ">=1.10.0 <2.0.0",
|
|
2376
|
+
filePath: "sdk/classifiers.js"
|
|
2377
|
+
},
|
|
2378
|
+
functionQuery: {
|
|
2379
|
+
className: "Classifiers",
|
|
2380
|
+
methodName: "classifyChat",
|
|
2381
|
+
kind: "Async"
|
|
2382
|
+
}
|
|
2383
|
+
},
|
|
2384
|
+
{
|
|
2385
|
+
channelName: mistralChannels.classifiersClassifyChat.channelName,
|
|
2386
|
+
module: {
|
|
2387
|
+
name: "@mistralai/mistralai",
|
|
2388
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2389
|
+
filePath: "esm/sdk/classifiers.js"
|
|
2390
|
+
},
|
|
2391
|
+
functionQuery: {
|
|
2392
|
+
className: "Classifiers",
|
|
2393
|
+
methodName: "classifyChat",
|
|
2394
|
+
kind: "Async"
|
|
2395
|
+
}
|
|
2396
|
+
},
|
|
2397
|
+
{
|
|
2398
|
+
channelName: mistralChannels.fimComplete.channelName,
|
|
2399
|
+
module: {
|
|
2400
|
+
name: "@mistralai/mistralai",
|
|
2401
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
2402
|
+
filePath: "sdk/fim.js"
|
|
2403
|
+
},
|
|
2404
|
+
functionQuery: {
|
|
2405
|
+
className: "Fim",
|
|
2406
|
+
methodName: "complete",
|
|
2407
|
+
kind: "Async"
|
|
2408
|
+
}
|
|
2409
|
+
},
|
|
2410
|
+
{
|
|
2411
|
+
channelName: mistralChannels.fimComplete.channelName,
|
|
2412
|
+
module: {
|
|
2413
|
+
name: "@mistralai/mistralai",
|
|
2414
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2415
|
+
filePath: "esm/sdk/fim.js"
|
|
2416
|
+
},
|
|
2417
|
+
functionQuery: {
|
|
2418
|
+
className: "Fim",
|
|
2419
|
+
methodName: "complete",
|
|
2420
|
+
kind: "Async"
|
|
2421
|
+
}
|
|
2422
|
+
},
|
|
2423
|
+
{
|
|
2424
|
+
channelName: mistralChannels.fimStream.channelName,
|
|
2425
|
+
module: {
|
|
2426
|
+
name: "@mistralai/mistralai",
|
|
2427
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
2428
|
+
filePath: "sdk/fim.js"
|
|
2429
|
+
},
|
|
2430
|
+
functionQuery: {
|
|
2431
|
+
className: "Fim",
|
|
2432
|
+
methodName: "stream",
|
|
2433
|
+
kind: "Async"
|
|
2434
|
+
}
|
|
2435
|
+
},
|
|
2436
|
+
{
|
|
2437
|
+
channelName: mistralChannels.fimStream.channelName,
|
|
2438
|
+
module: {
|
|
2439
|
+
name: "@mistralai/mistralai",
|
|
2440
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2441
|
+
filePath: "esm/sdk/fim.js"
|
|
2442
|
+
},
|
|
2443
|
+
functionQuery: {
|
|
2444
|
+
className: "Fim",
|
|
2445
|
+
methodName: "stream",
|
|
2446
|
+
kind: "Async"
|
|
2447
|
+
}
|
|
2448
|
+
},
|
|
2449
|
+
{
|
|
2450
|
+
channelName: mistralChannels.agentsComplete.channelName,
|
|
2451
|
+
module: {
|
|
2452
|
+
name: "@mistralai/mistralai",
|
|
2453
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
2454
|
+
filePath: "sdk/agents.js"
|
|
2455
|
+
},
|
|
2456
|
+
functionQuery: {
|
|
2457
|
+
className: "Agents",
|
|
2458
|
+
methodName: "complete",
|
|
2459
|
+
kind: "Async"
|
|
2460
|
+
}
|
|
2461
|
+
},
|
|
2462
|
+
{
|
|
2463
|
+
channelName: mistralChannels.agentsComplete.channelName,
|
|
2464
|
+
module: {
|
|
2465
|
+
name: "@mistralai/mistralai",
|
|
2466
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2467
|
+
filePath: "esm/sdk/agents.js"
|
|
2468
|
+
},
|
|
2469
|
+
functionQuery: {
|
|
2470
|
+
className: "Agents",
|
|
2471
|
+
methodName: "complete",
|
|
2472
|
+
kind: "Async"
|
|
2473
|
+
}
|
|
2474
|
+
},
|
|
2475
|
+
{
|
|
2476
|
+
channelName: mistralChannels.agentsStream.channelName,
|
|
2477
|
+
module: {
|
|
2478
|
+
name: "@mistralai/mistralai",
|
|
2479
|
+
versionRange: ">=1.0.0 <2.0.0",
|
|
2480
|
+
filePath: "sdk/agents.js"
|
|
2481
|
+
},
|
|
2482
|
+
functionQuery: {
|
|
2483
|
+
className: "Agents",
|
|
2484
|
+
methodName: "stream",
|
|
2485
|
+
kind: "Async"
|
|
2486
|
+
}
|
|
2487
|
+
},
|
|
2488
|
+
{
|
|
2489
|
+
channelName: mistralChannels.agentsStream.channelName,
|
|
2490
|
+
module: {
|
|
2491
|
+
name: "@mistralai/mistralai",
|
|
2492
|
+
versionRange: ">=2.0.0 <3.0.0",
|
|
2493
|
+
filePath: "esm/sdk/agents.js"
|
|
2494
|
+
},
|
|
2495
|
+
functionQuery: {
|
|
2496
|
+
className: "Agents",
|
|
2497
|
+
methodName: "stream",
|
|
2498
|
+
kind: "Async"
|
|
2499
|
+
}
|
|
2500
|
+
}
|
|
2501
|
+
];
|
|
2502
|
+
|
|
2503
|
+
// src/instrumentation/plugins/openai-agents-channels.ts
|
|
2504
|
+
var openAIAgentsCoreChannels = defineChannels("@openai/agents-core", {
|
|
2505
|
+
onTraceStart: channel({
|
|
2506
|
+
channelName: "tracing.processor.onTraceStart",
|
|
2507
|
+
kind: "async"
|
|
2508
|
+
}),
|
|
2509
|
+
onTraceEnd: channel({
|
|
2510
|
+
channelName: "tracing.processor.onTraceEnd",
|
|
2511
|
+
kind: "async"
|
|
2512
|
+
}),
|
|
2513
|
+
onSpanStart: channel({
|
|
2514
|
+
channelName: "tracing.processor.onSpanStart",
|
|
2515
|
+
kind: "async"
|
|
2516
|
+
}),
|
|
2517
|
+
onSpanEnd: channel({
|
|
2518
|
+
channelName: "tracing.processor.onSpanEnd",
|
|
2519
|
+
kind: "async"
|
|
2520
|
+
})
|
|
2521
|
+
});
|
|
2522
|
+
|
|
2523
|
+
// src/auto-instrumentations/configs/openai-agents.ts
|
|
2524
|
+
var lifecycleMethods = [
|
|
2525
|
+
["onTraceStart", openAIAgentsCoreChannels.onTraceStart.channelName],
|
|
2526
|
+
["onTraceEnd", openAIAgentsCoreChannels.onTraceEnd.channelName],
|
|
2527
|
+
["onSpanStart", openAIAgentsCoreChannels.onSpanStart.channelName],
|
|
2528
|
+
["onSpanEnd", openAIAgentsCoreChannels.onSpanEnd.channelName]
|
|
2529
|
+
];
|
|
2530
|
+
var openAIAgentsCoreConfigs = lifecycleMethods.flatMap(
|
|
2531
|
+
([methodName, channelName]) => ["dist/tracing/processor.mjs", "dist/tracing/processor.js"].map(
|
|
2532
|
+
(filePath) => ({
|
|
2533
|
+
channelName,
|
|
2534
|
+
module: {
|
|
2535
|
+
name: "@openai/agents-core",
|
|
2536
|
+
versionRange: ">=0.0.14",
|
|
2537
|
+
filePath
|
|
2538
|
+
},
|
|
2539
|
+
functionQuery: {
|
|
2540
|
+
className: "MultiTracingProcessor",
|
|
2541
|
+
methodName,
|
|
2542
|
+
kind: "Async"
|
|
2543
|
+
}
|
|
2544
|
+
})
|
|
2545
|
+
)
|
|
2546
|
+
);
|
|
2547
|
+
|
|
2548
|
+
// src/instrumentation/plugins/openai-channels.ts
|
|
2549
|
+
var openAIChannels = defineChannels("openai", {
|
|
2550
|
+
chatCompletionsCreate: channel({
|
|
2551
|
+
channelName: "chat.completions.create",
|
|
2552
|
+
kind: "async"
|
|
2553
|
+
}),
|
|
2554
|
+
embeddingsCreate: channel({
|
|
2555
|
+
channelName: "embeddings.create",
|
|
2556
|
+
kind: "async"
|
|
2557
|
+
}),
|
|
2558
|
+
betaChatCompletionsParse: channel({
|
|
2559
|
+
channelName: "beta.chat.completions.parse",
|
|
2560
|
+
kind: "async"
|
|
2561
|
+
}),
|
|
2562
|
+
betaChatCompletionsStream: channel({
|
|
2563
|
+
channelName: "beta.chat.completions.stream",
|
|
2564
|
+
kind: "sync-stream"
|
|
2565
|
+
}),
|
|
2566
|
+
moderationsCreate: channel({
|
|
2567
|
+
channelName: "moderations.create",
|
|
2568
|
+
kind: "async"
|
|
2569
|
+
}),
|
|
2570
|
+
responsesCreate: channel({
|
|
2571
|
+
channelName: "responses.create",
|
|
2572
|
+
kind: "async"
|
|
2573
|
+
}),
|
|
2574
|
+
responsesStream: channel({
|
|
2575
|
+
channelName: "responses.stream",
|
|
2576
|
+
kind: "sync-stream"
|
|
2577
|
+
}),
|
|
2578
|
+
responsesParse: channel({
|
|
2579
|
+
channelName: "responses.parse",
|
|
2580
|
+
kind: "async"
|
|
2581
|
+
}),
|
|
2582
|
+
responsesCompact: channel({
|
|
2583
|
+
channelName: "responses.compact",
|
|
2584
|
+
kind: "async"
|
|
2585
|
+
})
|
|
2586
|
+
});
|
|
2587
|
+
|
|
2588
|
+
// src/auto-instrumentations/configs/openai.ts
|
|
2589
|
+
var openaiConfigs = [
|
|
2590
|
+
// Chat Completions
|
|
2591
|
+
{
|
|
2592
|
+
channelName: openAIChannels.chatCompletionsCreate.channelName,
|
|
2593
|
+
module: {
|
|
2594
|
+
name: "openai",
|
|
2595
|
+
versionRange: ">=4.0.0 <5.0.0",
|
|
2596
|
+
filePath: "resources/chat/completions.mjs"
|
|
2597
|
+
},
|
|
2598
|
+
functionQuery: {
|
|
2599
|
+
className: "Completions",
|
|
2600
|
+
methodName: "create",
|
|
2601
|
+
kind: "Async"
|
|
2602
|
+
}
|
|
2603
|
+
},
|
|
2604
|
+
{
|
|
2605
|
+
channelName: openAIChannels.chatCompletionsCreate.channelName,
|
|
2606
|
+
module: {
|
|
2607
|
+
name: "openai",
|
|
2608
|
+
versionRange: ">=4.0.0 <5.0.0",
|
|
2609
|
+
filePath: "resources/chat/completions/completions.mjs"
|
|
2610
|
+
},
|
|
2611
|
+
functionQuery: {
|
|
2612
|
+
className: "Completions",
|
|
2613
|
+
methodName: "create",
|
|
2614
|
+
kind: "Async"
|
|
2615
|
+
}
|
|
2616
|
+
},
|
|
2617
|
+
{
|
|
2618
|
+
channelName: openAIChannels.chatCompletionsCreate.channelName,
|
|
2619
|
+
module: {
|
|
2620
|
+
name: "openai",
|
|
2621
|
+
versionRange: ">=5.0.0",
|
|
2622
|
+
filePath: "resources/chat/completions/completions.mjs"
|
|
2623
|
+
},
|
|
2624
|
+
functionQuery: {
|
|
2625
|
+
className: "Completions",
|
|
2626
|
+
methodName: "create",
|
|
2627
|
+
kind: "Async"
|
|
2628
|
+
}
|
|
2629
|
+
},
|
|
2630
|
+
// Embeddings
|
|
2631
|
+
{
|
|
2632
|
+
channelName: openAIChannels.embeddingsCreate.channelName,
|
|
2633
|
+
module: {
|
|
2634
|
+
name: "openai",
|
|
2635
|
+
versionRange: ">=4.0.0",
|
|
2636
|
+
filePath: "resources/embeddings.mjs"
|
|
2637
|
+
},
|
|
2638
|
+
functionQuery: {
|
|
2639
|
+
className: "Embeddings",
|
|
2640
|
+
methodName: "create",
|
|
2641
|
+
kind: "Async"
|
|
2642
|
+
}
|
|
2643
|
+
},
|
|
2644
|
+
// Beta Chat Completions Parse
|
|
2645
|
+
{
|
|
2646
|
+
channelName: openAIChannels.betaChatCompletionsParse.channelName,
|
|
2647
|
+
module: {
|
|
2648
|
+
name: "openai",
|
|
2649
|
+
versionRange: ">=4.0.0 <5.0.0",
|
|
2650
|
+
filePath: "resources/beta/chat/completions.mjs"
|
|
2651
|
+
},
|
|
2652
|
+
functionQuery: {
|
|
2653
|
+
className: "Completions",
|
|
2654
|
+
methodName: "parse",
|
|
2655
|
+
kind: "Async"
|
|
2656
|
+
}
|
|
2657
|
+
},
|
|
2658
|
+
{
|
|
2659
|
+
channelName: openAIChannels.betaChatCompletionsParse.channelName,
|
|
2660
|
+
module: {
|
|
2661
|
+
name: "openai",
|
|
2662
|
+
versionRange: ">=5.0.0",
|
|
2663
|
+
filePath: "resources/chat/completions/completions.mjs"
|
|
2664
|
+
},
|
|
2665
|
+
functionQuery: {
|
|
2666
|
+
className: "Completions",
|
|
2667
|
+
methodName: "parse",
|
|
2668
|
+
kind: "Async"
|
|
2669
|
+
}
|
|
2670
|
+
},
|
|
2671
|
+
// Moderations
|
|
2672
|
+
{
|
|
2673
|
+
channelName: openAIChannels.moderationsCreate.channelName,
|
|
2674
|
+
module: {
|
|
2675
|
+
name: "openai",
|
|
2676
|
+
versionRange: ">=4.0.0",
|
|
2677
|
+
filePath: "resources/moderations.mjs"
|
|
2678
|
+
},
|
|
2679
|
+
functionQuery: {
|
|
2680
|
+
className: "Moderations",
|
|
2681
|
+
methodName: "create",
|
|
2682
|
+
kind: "Async"
|
|
2683
|
+
}
|
|
2684
|
+
},
|
|
2685
|
+
// Beta Chat Completions Stream
|
|
2686
|
+
{
|
|
2687
|
+
channelName: openAIChannels.betaChatCompletionsStream.channelName,
|
|
2688
|
+
module: {
|
|
2689
|
+
name: "openai",
|
|
2690
|
+
versionRange: ">=4.0.0 <5.0.0",
|
|
2691
|
+
filePath: "resources/beta/chat/completions.mjs"
|
|
2692
|
+
},
|
|
2693
|
+
functionQuery: {
|
|
2694
|
+
className: "Completions",
|
|
2695
|
+
methodName: "stream",
|
|
2696
|
+
kind: "Sync"
|
|
2697
|
+
}
|
|
2698
|
+
},
|
|
2699
|
+
{
|
|
2700
|
+
channelName: openAIChannels.betaChatCompletionsStream.channelName,
|
|
2701
|
+
module: {
|
|
2702
|
+
name: "openai",
|
|
2703
|
+
versionRange: ">=5.0.0",
|
|
2704
|
+
filePath: "resources/chat/completions/completions.mjs"
|
|
2705
|
+
},
|
|
2706
|
+
functionQuery: {
|
|
2707
|
+
className: "Completions",
|
|
2708
|
+
methodName: "stream",
|
|
2709
|
+
kind: "Sync"
|
|
2710
|
+
}
|
|
2711
|
+
},
|
|
2712
|
+
// Responses API (v4.87.0+)
|
|
2713
|
+
{
|
|
2714
|
+
channelName: openAIChannels.responsesCreate.channelName,
|
|
2715
|
+
module: {
|
|
2716
|
+
name: "openai",
|
|
2717
|
+
versionRange: ">=4.87.0",
|
|
2718
|
+
filePath: "resources/responses/responses.mjs"
|
|
2719
|
+
},
|
|
2720
|
+
functionQuery: {
|
|
2721
|
+
className: "Responses",
|
|
2722
|
+
methodName: "create",
|
|
2723
|
+
kind: "Async"
|
|
2724
|
+
}
|
|
2725
|
+
},
|
|
2726
|
+
{
|
|
2727
|
+
channelName: openAIChannels.responsesStream.channelName,
|
|
2728
|
+
module: {
|
|
2729
|
+
name: "openai",
|
|
2730
|
+
versionRange: ">=4.87.0",
|
|
2731
|
+
filePath: "resources/responses/responses.mjs"
|
|
2732
|
+
},
|
|
2733
|
+
functionQuery: {
|
|
2734
|
+
className: "Responses",
|
|
2735
|
+
methodName: "stream",
|
|
2736
|
+
kind: "Sync"
|
|
2737
|
+
}
|
|
2738
|
+
},
|
|
2739
|
+
{
|
|
2740
|
+
channelName: openAIChannels.responsesParse.channelName,
|
|
2741
|
+
module: {
|
|
2742
|
+
name: "openai",
|
|
2743
|
+
versionRange: ">=4.87.0",
|
|
2744
|
+
filePath: "resources/responses/responses.mjs"
|
|
2745
|
+
},
|
|
2746
|
+
functionQuery: {
|
|
2747
|
+
className: "Responses",
|
|
2748
|
+
methodName: "parse",
|
|
2749
|
+
kind: "Async"
|
|
2750
|
+
}
|
|
2751
|
+
},
|
|
2752
|
+
{
|
|
2753
|
+
channelName: openAIChannels.responsesCompact.channelName,
|
|
2754
|
+
module: {
|
|
2755
|
+
name: "openai",
|
|
2756
|
+
versionRange: ">=6.10.0",
|
|
2757
|
+
filePath: "resources/responses/responses.mjs"
|
|
2758
|
+
},
|
|
2759
|
+
functionQuery: {
|
|
2760
|
+
className: "Responses",
|
|
2761
|
+
methodName: "compact",
|
|
2762
|
+
kind: "Async"
|
|
2763
|
+
}
|
|
2764
|
+
}
|
|
2765
|
+
];
|
|
2766
|
+
|
|
2767
|
+
// src/instrumentation/plugins/openai-codex-channels.ts
|
|
2768
|
+
var openAICodexChannels = defineChannels("@openai/codex-sdk", {
|
|
2769
|
+
run: channel({
|
|
2770
|
+
channelName: "Thread.run",
|
|
2771
|
+
kind: "async"
|
|
2772
|
+
}),
|
|
2773
|
+
runStreamed: channel({
|
|
2774
|
+
channelName: "Thread.runStreamed",
|
|
2775
|
+
kind: "async"
|
|
2776
|
+
})
|
|
2777
|
+
});
|
|
2778
|
+
|
|
2779
|
+
// src/auto-instrumentations/configs/openai-codex.ts
|
|
2780
|
+
var openAICodexVersionRange = ">=0.128.0 <1.0.0";
|
|
2781
|
+
var openAICodexConfigs = [
|
|
2782
|
+
{
|
|
2783
|
+
channelName: openAICodexChannels.run.channelName,
|
|
2784
|
+
module: {
|
|
2785
|
+
name: "@openai/codex-sdk",
|
|
2786
|
+
versionRange: openAICodexVersionRange,
|
|
2787
|
+
filePath: "dist/index.js"
|
|
2788
|
+
},
|
|
2789
|
+
functionQuery: {
|
|
2790
|
+
className: "Thread",
|
|
2791
|
+
methodName: "run",
|
|
2792
|
+
kind: "Async"
|
|
2793
|
+
}
|
|
2794
|
+
},
|
|
2795
|
+
{
|
|
2796
|
+
channelName: openAICodexChannels.runStreamed.channelName,
|
|
2797
|
+
module: {
|
|
2798
|
+
name: "@openai/codex-sdk",
|
|
2799
|
+
versionRange: openAICodexVersionRange,
|
|
2800
|
+
filePath: "dist/index.js"
|
|
2801
|
+
},
|
|
2802
|
+
functionQuery: {
|
|
2803
|
+
className: "Thread",
|
|
2804
|
+
methodName: "runStreamed",
|
|
2805
|
+
kind: "Async"
|
|
2806
|
+
}
|
|
2807
|
+
}
|
|
2808
|
+
];
|
|
2809
|
+
|
|
2810
|
+
// src/instrumentation/plugins/openrouter-channels.ts
|
|
2811
|
+
var openRouterChannels = defineChannels("@openrouter/sdk", {
|
|
2812
|
+
chatSend: channel({
|
|
2813
|
+
channelName: "chat.send",
|
|
2814
|
+
kind: "async"
|
|
2815
|
+
}),
|
|
2816
|
+
embeddingsGenerate: channel({
|
|
2817
|
+
channelName: "embeddings.generate",
|
|
2818
|
+
kind: "async"
|
|
2819
|
+
}),
|
|
2820
|
+
rerankRerank: channel(
|
|
2821
|
+
{
|
|
2822
|
+
channelName: "rerank.rerank",
|
|
2823
|
+
kind: "async"
|
|
2824
|
+
}
|
|
2825
|
+
),
|
|
2826
|
+
betaResponsesSend: channel({
|
|
2827
|
+
channelName: "beta.responses.send",
|
|
2828
|
+
kind: "async"
|
|
2829
|
+
}),
|
|
2830
|
+
callModel: channel({
|
|
2831
|
+
channelName: "callModel",
|
|
2832
|
+
kind: "sync-stream"
|
|
2833
|
+
}),
|
|
2834
|
+
callModelTurn: channel({
|
|
2835
|
+
channelName: "callModel.turn",
|
|
2836
|
+
kind: "async"
|
|
2837
|
+
}),
|
|
2838
|
+
toolExecute: channel({
|
|
2839
|
+
channelName: "tool.execute",
|
|
2840
|
+
kind: "async"
|
|
2841
|
+
})
|
|
2842
|
+
});
|
|
2843
|
+
|
|
2844
|
+
// src/auto-instrumentations/configs/openrouter.ts
|
|
2845
|
+
var openRouterConfigs = [
|
|
2846
|
+
{
|
|
2847
|
+
channelName: openRouterChannels.chatSend.channelName,
|
|
2848
|
+
module: {
|
|
2849
|
+
name: "@openrouter/sdk",
|
|
2850
|
+
versionRange: ">=0.9.11 <1.0.0",
|
|
2851
|
+
filePath: "esm/sdk/chat.js"
|
|
2852
|
+
},
|
|
2853
|
+
functionQuery: {
|
|
2854
|
+
className: "Chat",
|
|
2855
|
+
methodName: "send",
|
|
2856
|
+
kind: "Async"
|
|
2857
|
+
}
|
|
2858
|
+
},
|
|
2859
|
+
{
|
|
2860
|
+
channelName: openRouterChannels.embeddingsGenerate.channelName,
|
|
2861
|
+
module: {
|
|
2862
|
+
name: "@openrouter/sdk",
|
|
2863
|
+
versionRange: ">=0.9.11 <1.0.0",
|
|
2864
|
+
filePath: "esm/sdk/embeddings.js"
|
|
2865
|
+
},
|
|
2866
|
+
functionQuery: {
|
|
2867
|
+
className: "Embeddings",
|
|
2868
|
+
methodName: "generate",
|
|
2869
|
+
kind: "Async"
|
|
2870
|
+
}
|
|
2871
|
+
},
|
|
2872
|
+
{
|
|
2873
|
+
channelName: openRouterChannels.rerankRerank.channelName,
|
|
2874
|
+
module: {
|
|
2875
|
+
name: "@openrouter/sdk",
|
|
2876
|
+
versionRange: ">=0.12.0 <1.0.0",
|
|
2877
|
+
filePath: "esm/sdk/rerank.js"
|
|
2878
|
+
},
|
|
2879
|
+
functionQuery: {
|
|
2880
|
+
className: "Rerank",
|
|
2881
|
+
methodName: "rerank",
|
|
2882
|
+
kind: "Async"
|
|
2883
|
+
}
|
|
2884
|
+
},
|
|
2885
|
+
{
|
|
2886
|
+
channelName: openRouterChannels.betaResponsesSend.channelName,
|
|
2887
|
+
module: {
|
|
2888
|
+
name: "@openrouter/sdk",
|
|
2889
|
+
versionRange: ">=0.9.11 <1.0.0",
|
|
2890
|
+
filePath: "esm/sdk/responses.js"
|
|
2891
|
+
},
|
|
2892
|
+
functionQuery: {
|
|
2893
|
+
className: "Responses",
|
|
2894
|
+
methodName: "send",
|
|
2895
|
+
kind: "Async"
|
|
2896
|
+
}
|
|
2897
|
+
},
|
|
2898
|
+
{
|
|
2899
|
+
channelName: openRouterChannels.callModel.channelName,
|
|
2900
|
+
module: {
|
|
2901
|
+
name: "@openrouter/sdk",
|
|
2902
|
+
versionRange: ">=0.9.11 <1.0.0",
|
|
2903
|
+
filePath: "esm/sdk/sdk.js"
|
|
2904
|
+
},
|
|
2905
|
+
functionQuery: {
|
|
2906
|
+
className: "OpenRouter",
|
|
2907
|
+
methodName: "callModel",
|
|
2908
|
+
kind: "Sync"
|
|
2909
|
+
}
|
|
2910
|
+
}
|
|
2911
|
+
];
|
|
2912
|
+
|
|
2913
|
+
// src/instrumentation/plugins/openrouter-agent-channels.ts
|
|
2914
|
+
var openRouterAgentChannels = defineChannels("@openrouter/agent", {
|
|
2915
|
+
callModel: channel({
|
|
2916
|
+
channelName: "callModel",
|
|
2917
|
+
kind: "sync-stream"
|
|
2918
|
+
}),
|
|
2919
|
+
callModelTurn: channel({
|
|
2920
|
+
channelName: "callModel.turn",
|
|
2921
|
+
kind: "async"
|
|
2922
|
+
}),
|
|
2923
|
+
toolExecute: channel({
|
|
2924
|
+
channelName: "tool.execute",
|
|
2925
|
+
kind: "async"
|
|
2926
|
+
})
|
|
2927
|
+
});
|
|
2928
|
+
|
|
2929
|
+
// src/auto-instrumentations/configs/openrouter-agent.ts
|
|
2930
|
+
var openRouterAgentConfigs = [
|
|
2931
|
+
{
|
|
2932
|
+
channelName: openRouterAgentChannels.callModel.channelName,
|
|
2933
|
+
module: {
|
|
2934
|
+
name: "@openrouter/agent",
|
|
2935
|
+
versionRange: ">=0.1.2",
|
|
2936
|
+
filePath: "esm/inner-loop/call-model.js"
|
|
2937
|
+
},
|
|
2938
|
+
functionQuery: {
|
|
2939
|
+
functionName: "callModel",
|
|
2940
|
+
kind: "Sync"
|
|
2941
|
+
}
|
|
2942
|
+
}
|
|
2943
|
+
];
|
|
2944
|
+
|
|
2945
|
+
// src/auto-instrumentations/configs/all.ts
|
|
2946
|
+
var defaultInstrumentationConfigGroups = [
|
|
2947
|
+
{ integrations: ["openai"], configs: openaiConfigs },
|
|
2948
|
+
{
|
|
2949
|
+
integrations: ["openaiCodexSDK"],
|
|
2950
|
+
configs: openAICodexConfigs
|
|
2951
|
+
},
|
|
2952
|
+
{ integrations: ["anthropic"], configs: anthropicConfigs },
|
|
2953
|
+
{
|
|
2954
|
+
integrations: ["aisdk", "vercel"],
|
|
2955
|
+
configs: aiSDKConfigs
|
|
2956
|
+
},
|
|
2957
|
+
{
|
|
2958
|
+
integrations: ["claudeAgentSDK"],
|
|
2959
|
+
configs: claudeAgentSDKConfigs
|
|
2960
|
+
},
|
|
2961
|
+
{ integrations: ["cursor", "cursorSDK"], configs: cursorSDKConfigs },
|
|
2962
|
+
{ integrations: ["flue"], configs: flueConfigs },
|
|
2963
|
+
{
|
|
2964
|
+
integrations: ["openAIAgents"],
|
|
2965
|
+
configs: openAIAgentsCoreConfigs
|
|
2966
|
+
},
|
|
2967
|
+
{
|
|
2968
|
+
integrations: ["google", "googleGenAI"],
|
|
2969
|
+
configs: googleGenAIConfigs
|
|
2970
|
+
},
|
|
2971
|
+
{ integrations: ["huggingface"], configs: huggingFaceConfigs },
|
|
2972
|
+
{
|
|
2973
|
+
integrations: ["langchain", "langgraph"],
|
|
2974
|
+
configs: langchainConfigs
|
|
2975
|
+
},
|
|
2976
|
+
{ integrations: ["openrouter"], configs: openRouterConfigs },
|
|
2977
|
+
{
|
|
2978
|
+
integrations: ["openrouterAgent"],
|
|
2979
|
+
configs: openRouterAgentConfigs
|
|
2980
|
+
},
|
|
2981
|
+
{ integrations: ["mistral"], configs: mistralConfigs },
|
|
2982
|
+
{ integrations: ["googleADK"], configs: googleADKConfigs },
|
|
2983
|
+
{ integrations: ["cohere"], configs: cohereConfigs },
|
|
2984
|
+
{ integrations: ["groq"], configs: groqConfigs },
|
|
2985
|
+
{
|
|
2986
|
+
integrations: ["genkit"],
|
|
2987
|
+
configs: genkitConfigs
|
|
2988
|
+
},
|
|
2989
|
+
{
|
|
2990
|
+
integrations: ["gitHubCopilot"],
|
|
2991
|
+
configs: gitHubCopilotConfigs
|
|
2992
|
+
}
|
|
2993
|
+
];
|
|
2994
|
+
function getDefaultInstrumentationConfigs({
|
|
2995
|
+
additionalInstrumentations,
|
|
2996
|
+
disabledIntegrationConfig,
|
|
2997
|
+
disabledIntegrations
|
|
2998
|
+
} = {}) {
|
|
2999
|
+
const disabledConfig = disabledIntegrationConfig ?? (disabledIntegrations ? readDisabledInstrumentationEnvConfig(
|
|
3000
|
+
[...disabledIntegrations].join(",")
|
|
3001
|
+
).integrations : void 0);
|
|
3002
|
+
return [
|
|
3003
|
+
...defaultInstrumentationConfigGroups.flatMap(
|
|
3004
|
+
({ configs, integrations }) => isInstrumentationIntegrationDisabled(disabledConfig, ...integrations) ? [] : configs
|
|
3005
|
+
),
|
|
3006
|
+
...additionalInstrumentations ?? []
|
|
3007
|
+
];
|
|
3008
|
+
}
|
|
3009
|
+
|
|
3010
|
+
// src/auto-instrumentations/bundler/plugin.ts
|
|
3011
|
+
function getModuleVersion(basedir) {
|
|
3012
|
+
try {
|
|
3013
|
+
const packageJsonPath = (0, import_path.join)(basedir, "package.json");
|
|
3014
|
+
const packageJson = JSON.parse((0, import_fs.readFileSync)(packageJsonPath, "utf8"));
|
|
3015
|
+
if (packageJson.version) {
|
|
3016
|
+
return packageJson.version;
|
|
3017
|
+
}
|
|
3018
|
+
} catch (error) {
|
|
3019
|
+
}
|
|
3020
|
+
return void 0;
|
|
3021
|
+
}
|
|
3022
|
+
var unplugin = (0, import_unplugin.createUnplugin)(
|
|
3023
|
+
(options = {}) => {
|
|
3024
|
+
const allInstrumentations = getDefaultInstrumentationConfigs({
|
|
3025
|
+
additionalInstrumentations: options.instrumentations
|
|
3026
|
+
});
|
|
3027
|
+
const dcModule = options.browser === false ? void 0 : "dc-browser";
|
|
3028
|
+
const instrumentationMatcher = (0, import_code_transformer.create)(allInstrumentations, dcModule);
|
|
3029
|
+
return {
|
|
3030
|
+
name: "code-transformer",
|
|
3031
|
+
enforce: "pre",
|
|
3032
|
+
transform(code, id) {
|
|
3033
|
+
if (!id) {
|
|
3034
|
+
return null;
|
|
3035
|
+
}
|
|
3036
|
+
const filePath = id.startsWith("file:") ? (0, import_url.fileURLToPath)(id) : id;
|
|
3037
|
+
const ext = (0, import_path.extname)(filePath);
|
|
3038
|
+
let isModule = ext === ".mjs" || ext === ".ts" || ext === ".tsx";
|
|
3039
|
+
if (ext === ".js") {
|
|
3040
|
+
isModule = code.includes("export ") || code.includes("import ");
|
|
3041
|
+
}
|
|
3042
|
+
const normalizedForPlatform = filePath.split("/").join(import_path.sep);
|
|
3043
|
+
const moduleDetails = (0, import_module_details_from_path.default)(normalizedForPlatform);
|
|
3044
|
+
if (!moduleDetails) {
|
|
3045
|
+
return null;
|
|
3046
|
+
}
|
|
3047
|
+
const moduleName = moduleDetails.name;
|
|
3048
|
+
const moduleVersion = getModuleVersion(moduleDetails.basedir);
|
|
3049
|
+
if (!moduleVersion) {
|
|
3050
|
+
console.warn(
|
|
3051
|
+
`No 'package.json' version found for module ${moduleName} at ${moduleDetails.basedir}. Skipping transformation.`
|
|
3052
|
+
);
|
|
3053
|
+
return null;
|
|
3054
|
+
}
|
|
3055
|
+
const normalizedModulePath = moduleDetails.path.replace(/\\/g, "/");
|
|
3056
|
+
const transformer = instrumentationMatcher.getTransformer(
|
|
3057
|
+
moduleName,
|
|
3058
|
+
moduleVersion,
|
|
3059
|
+
normalizedModulePath
|
|
3060
|
+
);
|
|
3061
|
+
if (!transformer) {
|
|
3062
|
+
return null;
|
|
3063
|
+
}
|
|
3064
|
+
try {
|
|
3065
|
+
const moduleType = isModule ? "esm" : "cjs";
|
|
3066
|
+
const result = transformer.transform(code, moduleType);
|
|
3067
|
+
const transformedCode = result.code.replace(
|
|
3068
|
+
/const \{tracingChannel: ([A-Za-z_$][\w$]*)\} = ([A-Za-z_$][\w$]*);/g,
|
|
3069
|
+
"const $1 = $2.tracingChannel;"
|
|
3070
|
+
);
|
|
3071
|
+
return {
|
|
3072
|
+
code: transformedCode,
|
|
3073
|
+
map: result.map
|
|
3074
|
+
};
|
|
3075
|
+
} catch (error) {
|
|
3076
|
+
console.warn(`Code transformation failed for ${id}: ${error}`);
|
|
3077
|
+
return null;
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
};
|
|
3081
|
+
}
|
|
3082
|
+
);
|
|
3083
|
+
|
|
3084
|
+
// src/auto-instrumentations/bundler/webpack.ts
|
|
3085
|
+
var webpackPlugin = unplugin.webpack;
|
|
3086
|
+
|
|
3087
|
+
// src/auto-instrumentations/bundler/next.ts
|
|
3088
|
+
var requireFromProject = (0, import_node_module.createRequire)((0, import_node_path.join)(process.cwd(), "package.json"));
|
|
3089
|
+
var TURBOPACK_RULE_MATCHER = "*.{js,mjs,cjs}";
|
|
3090
|
+
function wrapNextjsConfigWithBraintrust(nextConfig) {
|
|
3091
|
+
const castNextConfig = nextConfig ?? {};
|
|
3092
|
+
if (typeof castNextConfig === "function") {
|
|
3093
|
+
return function(...args) {
|
|
3094
|
+
const maybeConfig = castNextConfig.apply(this, args);
|
|
3095
|
+
if (isThenable(maybeConfig)) {
|
|
3096
|
+
return maybeConfig.then(
|
|
3097
|
+
(resolvedConfig) => createConfigObject(resolvedConfig)
|
|
3098
|
+
);
|
|
3099
|
+
}
|
|
3100
|
+
return createConfigObject(maybeConfig);
|
|
3101
|
+
};
|
|
3102
|
+
}
|
|
3103
|
+
return createConfigObject(castNextConfig);
|
|
3104
|
+
}
|
|
3105
|
+
function createConfigObject(nextConfig) {
|
|
3106
|
+
const config = { ...nextConfig ?? {} };
|
|
3107
|
+
const activeBundler = detectBundler();
|
|
3108
|
+
if (activeBundler === "turbopack") {
|
|
3109
|
+
if (config.turbopack || !config.experimental?.turbo) {
|
|
3110
|
+
return {
|
|
3111
|
+
...config,
|
|
3112
|
+
turbopack: wrapTurbopackConfig(config.turbopack)
|
|
3113
|
+
};
|
|
3114
|
+
}
|
|
3115
|
+
return {
|
|
3116
|
+
...config,
|
|
3117
|
+
experimental: {
|
|
3118
|
+
...config.experimental,
|
|
3119
|
+
turbo: wrapTurbopackConfig(config.experimental.turbo)
|
|
3120
|
+
}
|
|
3121
|
+
};
|
|
3122
|
+
}
|
|
3123
|
+
return {
|
|
3124
|
+
...config,
|
|
3125
|
+
webpack: wrapWebpackConfig(config.webpack)
|
|
3126
|
+
};
|
|
3127
|
+
}
|
|
3128
|
+
function detectBundler() {
|
|
3129
|
+
if (process.argv.includes("--webpack")) {
|
|
3130
|
+
return "webpack";
|
|
3131
|
+
}
|
|
3132
|
+
const turbopackEnv = process.env.TURBOPACK?.trim().toLowerCase();
|
|
3133
|
+
if (turbopackEnv && turbopackEnv !== "0" && turbopackEnv !== "false" || process.argv.includes("--turbo") || process.argv.includes("--turbopack")) {
|
|
3134
|
+
return "turbopack";
|
|
3135
|
+
}
|
|
3136
|
+
const nextMajorVersion = getNextMajorVersion();
|
|
3137
|
+
if (nextMajorVersion !== void 0 && nextMajorVersion >= 16) {
|
|
3138
|
+
return "turbopack";
|
|
3139
|
+
}
|
|
3140
|
+
return "webpack";
|
|
3141
|
+
}
|
|
3142
|
+
function wrapWebpackConfig(userWebpack) {
|
|
3143
|
+
return (incomingConfig, buildContext) => {
|
|
3144
|
+
const rawConfig = typeof userWebpack === "function" ? userWebpack(incomingConfig, buildContext) : incomingConfig;
|
|
3145
|
+
const config = rawConfig ?? incomingConfig;
|
|
3146
|
+
const existingPlugins = Array.isArray(config.plugins) ? config.plugins : [];
|
|
3147
|
+
const runtime = buildContext.isServer ? buildContext.nextRuntime === "edge" || buildContext.nextRuntime === "experimental-edge" ? "edge" : "server" : "client";
|
|
3148
|
+
const plugin = webpackPlugin({
|
|
3149
|
+
browser: runtime === "client" || runtime === "edge"
|
|
3150
|
+
});
|
|
3151
|
+
return {
|
|
3152
|
+
...config,
|
|
3153
|
+
plugins: [...existingPlugins, plugin]
|
|
3154
|
+
};
|
|
3155
|
+
};
|
|
3156
|
+
}
|
|
3157
|
+
function wrapTurbopackConfig(turbopackConfig) {
|
|
3158
|
+
const config = { ...turbopackConfig ?? {} };
|
|
3159
|
+
const resolveAlias = config.resolveAlias && typeof config.resolveAlias === "object" && !Array.isArray(config.resolveAlias) ? config.resolveAlias : {};
|
|
3160
|
+
const rules = config.rules && typeof config.rules === "object" && !Array.isArray(config.rules) ? config.rules : {};
|
|
3161
|
+
let dcBrowserPath;
|
|
3162
|
+
try {
|
|
3163
|
+
dcBrowserPath = (0, import_node_module.createRequire)(
|
|
3164
|
+
requireFromProject.resolve("braintrust/package.json")
|
|
3165
|
+
).resolve("dc-browser");
|
|
3166
|
+
} catch {
|
|
3167
|
+
try {
|
|
3168
|
+
dcBrowserPath = requireFromProject.resolve("dc-browser");
|
|
3169
|
+
} catch {
|
|
3170
|
+
dcBrowserPath = void 0;
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3173
|
+
if (dcBrowserPath && (0, import_node_path.isAbsolute)(dcBrowserPath)) {
|
|
3174
|
+
const relativeDcBrowserPath = (0, import_node_path.relative)(
|
|
3175
|
+
process.cwd(),
|
|
3176
|
+
dcBrowserPath
|
|
3177
|
+
).replace(/\\/g, "/");
|
|
3178
|
+
dcBrowserPath = relativeDcBrowserPath.startsWith(".") ? relativeDcBrowserPath : `./${relativeDcBrowserPath}`;
|
|
3179
|
+
}
|
|
3180
|
+
return {
|
|
3181
|
+
...config,
|
|
3182
|
+
// Turbopack resolves modules emitted by our loader from the app graph. The
|
|
3183
|
+
// browser diagnostics-channel shim is Braintrust's dependency, so alias it
|
|
3184
|
+
// to the copy installed with Braintrust while still letting user aliases win.
|
|
3185
|
+
resolveAlias: dcBrowserPath && resolveAlias["dc-browser"] === void 0 ? { ...resolveAlias, "dc-browser": dcBrowserPath } : config.resolveAlias,
|
|
3186
|
+
rules: addBraintrustTurbopackRule(rules)
|
|
3187
|
+
};
|
|
3188
|
+
}
|
|
3189
|
+
function addBraintrustTurbopackRule(rules) {
|
|
3190
|
+
const loaderPath = getWebpackLoaderPath();
|
|
3191
|
+
const braintrustRules = [
|
|
3192
|
+
{
|
|
3193
|
+
condition: { all: ["foreign", "browser"] },
|
|
3194
|
+
loaders: [
|
|
3195
|
+
{
|
|
3196
|
+
loader: loaderPath,
|
|
3197
|
+
options: { browser: true }
|
|
3198
|
+
}
|
|
3199
|
+
]
|
|
3200
|
+
},
|
|
3201
|
+
{
|
|
3202
|
+
condition: { all: ["foreign", "edge-light"] },
|
|
3203
|
+
loaders: [
|
|
3204
|
+
{
|
|
3205
|
+
loader: loaderPath,
|
|
3206
|
+
options: { browser: true }
|
|
3207
|
+
}
|
|
3208
|
+
]
|
|
3209
|
+
},
|
|
3210
|
+
{
|
|
3211
|
+
condition: { all: ["foreign", "node"] },
|
|
3212
|
+
loaders: [
|
|
3213
|
+
{
|
|
3214
|
+
loader: loaderPath,
|
|
3215
|
+
options: { browser: false }
|
|
3216
|
+
}
|
|
3217
|
+
]
|
|
3218
|
+
}
|
|
3219
|
+
];
|
|
3220
|
+
const existingRule = rules[TURBOPACK_RULE_MATCHER];
|
|
3221
|
+
if (!existingRule) {
|
|
3222
|
+
return {
|
|
3223
|
+
...rules,
|
|
3224
|
+
// Turbopack exposes the active runtime through rule conditions, so keep
|
|
3225
|
+
// client, edge, and node transforms separate instead of inferring later.
|
|
3226
|
+
[TURBOPACK_RULE_MATCHER]: braintrustRules
|
|
3227
|
+
};
|
|
3228
|
+
}
|
|
3229
|
+
if (Array.isArray(existingRule)) {
|
|
3230
|
+
return {
|
|
3231
|
+
...rules,
|
|
3232
|
+
[TURBOPACK_RULE_MATCHER]: [...existingRule, ...braintrustRules]
|
|
3233
|
+
};
|
|
3234
|
+
}
|
|
3235
|
+
if (typeof existingRule === "object" && existingRule !== null) {
|
|
3236
|
+
return {
|
|
3237
|
+
...rules,
|
|
3238
|
+
[TURBOPACK_RULE_MATCHER]: [existingRule, ...braintrustRules]
|
|
3239
|
+
};
|
|
3240
|
+
}
|
|
3241
|
+
return rules;
|
|
3242
|
+
}
|
|
3243
|
+
function getWebpackLoaderPath() {
|
|
3244
|
+
try {
|
|
3245
|
+
return requireFromProject.resolve("braintrust/webpack-loader");
|
|
3246
|
+
} catch {
|
|
3247
|
+
return "braintrust/webpack-loader";
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
function getNextMajorVersion() {
|
|
3251
|
+
try {
|
|
3252
|
+
const nextPackageJson = requireFromProject("next/package.json");
|
|
3253
|
+
if (typeof nextPackageJson.version !== "string") {
|
|
3254
|
+
return void 0;
|
|
3255
|
+
}
|
|
3256
|
+
const major = Number.parseInt(nextPackageJson.version.split(".")[0] ?? "");
|
|
3257
|
+
return Number.isFinite(major) ? major : void 0;
|
|
3258
|
+
} catch {
|
|
3259
|
+
return void 0;
|
|
3260
|
+
}
|
|
3261
|
+
}
|
|
3262
|
+
function isThenable(value) {
|
|
3263
|
+
return value !== null && value !== void 0 && (typeof value === "object" || typeof value === "function") && "then" in value && typeof value.then === "function";
|
|
3264
|
+
}
|
|
3265
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
3266
|
+
0 && (module.exports = {
|
|
3267
|
+
wrapNextjsConfigWithBraintrust
|
|
3268
|
+
});
|