braintrust 3.26.0 → 3.27.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/dev/dist/index.js +2440 -1067
- package/dev/dist/index.mjs +1644 -271
- package/dist/apply-auto-instrumentation.js +320 -261
- package/dist/apply-auto-instrumentation.mjs +118 -59
- package/dist/auto-instrumentations/bundler/esbuild.cjs +377 -59
- package/dist/auto-instrumentations/bundler/esbuild.mjs +5 -4
- package/dist/auto-instrumentations/bundler/next.cjs +379 -61
- package/dist/auto-instrumentations/bundler/next.mjs +6 -5
- package/dist/auto-instrumentations/bundler/rollup.cjs +377 -59
- package/dist/auto-instrumentations/bundler/rollup.mjs +5 -4
- package/dist/auto-instrumentations/bundler/vite.cjs +406 -60
- package/dist/auto-instrumentations/bundler/vite.mjs +34 -5
- package/dist/auto-instrumentations/bundler/webpack-loader.cjs +363 -59
- package/dist/auto-instrumentations/bundler/webpack.cjs +377 -59
- package/dist/auto-instrumentations/bundler/webpack.mjs +6 -5
- package/dist/auto-instrumentations/{chunk-AKKPLXTP.mjs → chunk-2AMDGD65.mjs} +160 -57
- package/dist/auto-instrumentations/{chunk-V5LEODRX.mjs → chunk-BW33ULMW.mjs} +1 -1
- package/dist/auto-instrumentations/{chunk-XYN63IG5.mjs → chunk-I55G56ZL.mjs} +21 -58
- package/dist/auto-instrumentations/{chunk-NRE4QUQR.mjs → chunk-JPUFNW7X.mjs} +140 -0
- package/dist/auto-instrumentations/{chunk-6E22MYSW.mjs → chunk-XEYKUBLY.mjs} +30 -4
- package/dist/auto-instrumentations/{chunk-XZHHE4Y3.mjs → chunk-ZNHTSSGI.mjs} +155 -2
- package/dist/auto-instrumentations/hook.mjs +161 -3
- package/dist/auto-instrumentations/index.cjs +296 -1
- package/dist/auto-instrumentations/index.d.mts +5 -1
- package/dist/auto-instrumentations/index.d.ts +5 -1
- package/dist/auto-instrumentations/index.mjs +6 -2
- package/dist/auto-instrumentations/loader/cjs-patch.cjs +105 -57
- package/dist/auto-instrumentations/loader/cjs-patch.mjs +2 -2
- package/dist/auto-instrumentations/loader/esm-hook.mjs +1 -1
- package/dist/browser.d.mts +57 -5
- package/dist/browser.d.ts +57 -5
- package/dist/browser.js +1855 -285
- package/dist/browser.mjs +1855 -285
- package/dist/{chunk-PN7EWK66.mjs → chunk-CZM5JIQL.mjs} +209 -1
- package/dist/{chunk-VYNNEKSA.js → chunk-MF7NU6BT.js} +216 -8
- package/dist/{chunk-VRZZQPAA.js → chunk-QRHGVBKU.js} +2403 -1220
- package/dist/{chunk-XIZOM2HO.mjs → chunk-YKD22IMR.mjs} +1454 -271
- package/dist/cli.js +1645 -272
- package/dist/edge-light.d.mts +1 -1
- package/dist/edge-light.d.ts +1 -1
- package/dist/edge-light.js +1855 -285
- package/dist/edge-light.mjs +1855 -285
- package/dist/index.d.mts +57 -5
- package/dist/index.d.ts +57 -5
- package/dist/index.js +600 -413
- package/dist/index.mjs +201 -14
- package/dist/instrumentation/index.d.mts +8 -0
- package/dist/instrumentation/index.d.ts +8 -0
- package/dist/instrumentation/index.js +1839 -466
- package/dist/instrumentation/index.mjs +1839 -466
- package/dist/vitest-evals-reporter.js +45 -43
- package/dist/vitest-evals-reporter.mjs +5 -3
- package/dist/workerd.d.mts +1 -1
- package/dist/workerd.d.ts +1 -1
- package/dist/workerd.js +1855 -285
- package/dist/workerd.mjs +1855 -285
- package/package.json +1 -1
|
@@ -26,6 +26,7 @@ __export(index_exports, {
|
|
|
26
26
|
claudeAgentSDKConfigs: () => claudeAgentSDKConfigs,
|
|
27
27
|
cloudflareAIChatConfigs: () => cloudflareAIChatConfigs,
|
|
28
28
|
cloudflareAgentsConfigs: () => cloudflareAgentsConfigs,
|
|
29
|
+
cloudflareThinkConfigs: () => cloudflareThinkConfigs,
|
|
29
30
|
cohereConfigs: () => cohereConfigs,
|
|
30
31
|
cursorSDKConfigs: () => cursorSDKConfigs,
|
|
31
32
|
genkitConfigs: () => genkitConfigs,
|
|
@@ -37,6 +38,7 @@ __export(index_exports, {
|
|
|
37
38
|
langSmithConfigs: () => langSmithConfigs,
|
|
38
39
|
langchainConfigs: () => langchainConfigs,
|
|
39
40
|
mistralConfigs: () => mistralConfigs,
|
|
41
|
+
ollamaConfigs: () => ollamaConfigs,
|
|
40
42
|
openAIAgentsCoreConfigs: () => openAIAgentsCoreConfigs,
|
|
41
43
|
openAICodexConfigs: () => openAICodexConfigs,
|
|
42
44
|
openRouterAgentConfigs: () => openRouterAgentConfigs,
|
|
@@ -51,8 +53,10 @@ var GLOBAL_INSTRUMENTATION_HOOKS_KEY = "__braintrust_instrumentation_hooks";
|
|
|
51
53
|
var GLOBAL_INSTRUMENTATION_HOOKS_PROTOCOL_VERSION = 1;
|
|
52
54
|
var GLOBAL_INSTRUMENTATION_HOOKS_REGISTRY_BRAND = "braintrust.global-instrumentation-hooks.registry";
|
|
53
55
|
var GLOBAL_INSTRUMENTATION_HOOK_BRAND = "braintrust.global-instrumentation-hooks.hook";
|
|
56
|
+
var GLOBAL_INVOCATION_HOOK_BRAND = "braintrust.global-instrumentation-hooks.invocation-hook";
|
|
54
57
|
var registryBrand = Symbol.for(GLOBAL_INSTRUMENTATION_HOOKS_REGISTRY_BRAND);
|
|
55
58
|
var hookBrand = Symbol.for(GLOBAL_INSTRUMENTATION_HOOK_BRAND);
|
|
59
|
+
var invocationHookBrand = Symbol.for(GLOBAL_INVOCATION_HOOK_BRAND);
|
|
56
60
|
var errorReporter;
|
|
57
61
|
function reportError(error) {
|
|
58
62
|
try {
|
|
@@ -188,12 +192,69 @@ var traceEvents = [
|
|
|
188
192
|
"asyncEnd",
|
|
189
193
|
"error"
|
|
190
194
|
];
|
|
195
|
+
function traceInvocation(hook, operator, target, thisArg, args, additional, callbackIndex = -1) {
|
|
196
|
+
const context = {
|
|
197
|
+
...additional,
|
|
198
|
+
arguments: args,
|
|
199
|
+
self: thisArg
|
|
200
|
+
};
|
|
201
|
+
const invoke = () => hook.invoke(target, thisArg, args, additional);
|
|
202
|
+
if (operator === "traceCallback") {
|
|
203
|
+
return hook.traceCallback(invoke, callbackIndex, context);
|
|
204
|
+
}
|
|
205
|
+
if (operator === "tracePromise") {
|
|
206
|
+
return hook.tracePromise(invoke, context);
|
|
207
|
+
}
|
|
208
|
+
return hook.traceSync(invoke, context);
|
|
209
|
+
}
|
|
210
|
+
var InvocationHook = class {
|
|
211
|
+
interceptors = [];
|
|
212
|
+
get hasInterceptors() {
|
|
213
|
+
return this.interceptors.length > 0;
|
|
214
|
+
}
|
|
215
|
+
intercept(interceptor) {
|
|
216
|
+
if (typeof interceptor !== "function") {
|
|
217
|
+
throw new TypeError("interceptor must be a function");
|
|
218
|
+
}
|
|
219
|
+
this.interceptors = [...this.interceptors, interceptor];
|
|
220
|
+
let active = true;
|
|
221
|
+
return () => {
|
|
222
|
+
if (!active) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
active = false;
|
|
226
|
+
const index = this.interceptors.indexOf(interceptor);
|
|
227
|
+
if (index !== -1) {
|
|
228
|
+
this.interceptors = [
|
|
229
|
+
...this.interceptors.slice(0, index),
|
|
230
|
+
...this.interceptors.slice(index + 1)
|
|
231
|
+
];
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
invoke(target, thisArg, args, additional) {
|
|
236
|
+
const interceptors = this.interceptors;
|
|
237
|
+
if (interceptors.length === 0) {
|
|
238
|
+
return Reflect.apply(target, thisArg, args);
|
|
239
|
+
}
|
|
240
|
+
let next = target;
|
|
241
|
+
for (let index = interceptors.length - 1; index >= 0; index -= 1) {
|
|
242
|
+
const interceptor = interceptors[index];
|
|
243
|
+
const downstream = next;
|
|
244
|
+
next = function(...nextArgs) {
|
|
245
|
+
return interceptor(downstream, this, nextArgs, additional);
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
return Reflect.apply(next, thisArg, args);
|
|
249
|
+
}
|
|
250
|
+
};
|
|
191
251
|
var TracingHook = class {
|
|
192
252
|
start;
|
|
193
253
|
end;
|
|
194
254
|
asyncStart;
|
|
195
255
|
asyncEnd;
|
|
196
256
|
error;
|
|
257
|
+
invocationHook = new InvocationHook();
|
|
197
258
|
constructor(nameOrChannels) {
|
|
198
259
|
Object.defineProperty(this, hookBrand, {
|
|
199
260
|
configurable: false,
|
|
@@ -201,6 +262,12 @@ var TracingHook = class {
|
|
|
201
262
|
value: GLOBAL_INSTRUMENTATION_HOOKS_PROTOCOL_VERSION,
|
|
202
263
|
writable: false
|
|
203
264
|
});
|
|
265
|
+
Object.defineProperty(this, invocationHookBrand, {
|
|
266
|
+
configurable: false,
|
|
267
|
+
enumerable: false,
|
|
268
|
+
value: GLOBAL_INSTRUMENTATION_HOOKS_PROTOCOL_VERSION,
|
|
269
|
+
writable: false
|
|
270
|
+
});
|
|
204
271
|
if (typeof nameOrChannels === "string") {
|
|
205
272
|
this.start = new HookChannel(`tracing:${nameOrChannels}:start`);
|
|
206
273
|
this.end = new HookChannel(`tracing:${nameOrChannels}:end`);
|
|
@@ -218,6 +285,26 @@ var TracingHook = class {
|
|
|
218
285
|
get hasSubscribers() {
|
|
219
286
|
return this.start.hasSubscribers || this.end.hasSubscribers || this.asyncStart.hasSubscribers || this.asyncEnd.hasSubscribers || this.error.hasSubscribers;
|
|
220
287
|
}
|
|
288
|
+
get hasInterceptors() {
|
|
289
|
+
return this.invocationHook.hasInterceptors;
|
|
290
|
+
}
|
|
291
|
+
intercept(interceptor) {
|
|
292
|
+
return this.invocationHook.intercept(interceptor);
|
|
293
|
+
}
|
|
294
|
+
invoke(target, thisArg, args, additional) {
|
|
295
|
+
return this.invocationHook.invoke(target, thisArg, args, additional);
|
|
296
|
+
}
|
|
297
|
+
traceInvocation(operator, target, thisArg, args, additional, callbackIndex = -1) {
|
|
298
|
+
return traceInvocation(
|
|
299
|
+
this,
|
|
300
|
+
operator,
|
|
301
|
+
target,
|
|
302
|
+
thisArg,
|
|
303
|
+
args,
|
|
304
|
+
additional,
|
|
305
|
+
callbackIndex
|
|
306
|
+
);
|
|
307
|
+
}
|
|
221
308
|
subscribe(handlers) {
|
|
222
309
|
for (const eventName of traceEvents) {
|
|
223
310
|
const handler = handlers[eventName];
|
|
@@ -439,6 +526,60 @@ function hasTracingHookShape(value) {
|
|
|
439
526
|
return false;
|
|
440
527
|
}
|
|
441
528
|
}
|
|
529
|
+
function hasInvocationHookShape(value) {
|
|
530
|
+
if (typeof value !== "object" && typeof value !== "function" || value === null) {
|
|
531
|
+
return false;
|
|
532
|
+
}
|
|
533
|
+
try {
|
|
534
|
+
const hook = value;
|
|
535
|
+
return value[invocationHookBrand] === GLOBAL_INSTRUMENTATION_HOOKS_PROTOCOL_VERSION && typeof hook.hasInterceptors === "boolean" && typeof hook.intercept === "function" && typeof hook.invoke === "function";
|
|
536
|
+
} catch {
|
|
537
|
+
return false;
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
function installInvocationHook(value) {
|
|
541
|
+
const hasInvocationHook = hasInvocationHookShape(value);
|
|
542
|
+
const invocationHook = new InvocationHook();
|
|
543
|
+
try {
|
|
544
|
+
if (!hasInvocationHook) {
|
|
545
|
+
Object.defineProperties(value, {
|
|
546
|
+
[invocationHookBrand]: {
|
|
547
|
+
configurable: false,
|
|
548
|
+
enumerable: false,
|
|
549
|
+
value: GLOBAL_INSTRUMENTATION_HOOKS_PROTOCOL_VERSION,
|
|
550
|
+
writable: false
|
|
551
|
+
},
|
|
552
|
+
hasInterceptors: {
|
|
553
|
+
configurable: false,
|
|
554
|
+
enumerable: false,
|
|
555
|
+
get: () => invocationHook.hasInterceptors
|
|
556
|
+
},
|
|
557
|
+
intercept: {
|
|
558
|
+
configurable: false,
|
|
559
|
+
enumerable: false,
|
|
560
|
+
value: invocationHook.intercept.bind(invocationHook),
|
|
561
|
+
writable: false
|
|
562
|
+
},
|
|
563
|
+
invoke: {
|
|
564
|
+
configurable: false,
|
|
565
|
+
enumerable: false,
|
|
566
|
+
value: invocationHook.invoke.bind(invocationHook),
|
|
567
|
+
writable: false
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
if (typeof value.traceInvocation !== "function") {
|
|
572
|
+
Object.defineProperty(value, "traceInvocation", {
|
|
573
|
+
configurable: false,
|
|
574
|
+
enumerable: false,
|
|
575
|
+
value: traceInvocation.bind(void 0, value),
|
|
576
|
+
writable: false
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
} catch (error) {
|
|
580
|
+
reportError(error);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
442
583
|
function isCompatibleTracingHook(value) {
|
|
443
584
|
try {
|
|
444
585
|
return value[hookBrand] === GLOBAL_INSTRUMENTATION_HOOKS_PROTOCOL_VERSION && hasTracingHookShape(value);
|
|
@@ -525,6 +666,7 @@ function newGlobalTracingChannel(nameOrChannels) {
|
|
|
525
666
|
return inertTracingHook;
|
|
526
667
|
}
|
|
527
668
|
if (isCompatibleTracingHook(existing)) {
|
|
669
|
+
installInvocationHook(existing);
|
|
528
670
|
return existing;
|
|
529
671
|
}
|
|
530
672
|
if (existing !== void 0) {
|
|
@@ -594,11 +736,21 @@ function defineChannels(pkg, channels, options) {
|
|
|
594
736
|
const tracingChannel2 = () => isomorph_default.newTracingChannel(
|
|
595
737
|
fullChannelName
|
|
596
738
|
);
|
|
739
|
+
const intercept2 = (interceptor) => {
|
|
740
|
+
const hook = tracingChannel2();
|
|
741
|
+
return typeof hook.intercept === "function" ? hook.intercept(interceptor) : () => {
|
|
742
|
+
};
|
|
743
|
+
};
|
|
597
744
|
return [
|
|
598
745
|
key,
|
|
599
746
|
{
|
|
600
747
|
...asyncSpec,
|
|
601
748
|
instrumentationName,
|
|
749
|
+
intercept: intercept2,
|
|
750
|
+
invoke: (target, thisArg, args, additional) => {
|
|
751
|
+
const hook = tracingChannel2();
|
|
752
|
+
return typeof hook.invoke === "function" ? hook.invoke(target, thisArg, args, additional) : Reflect.apply(target, thisArg, args);
|
|
753
|
+
},
|
|
602
754
|
tracingChannel: tracingChannel2,
|
|
603
755
|
tracePromise: (fn, context) => tracingChannel2().tracePromise(
|
|
604
756
|
fn,
|
|
@@ -612,11 +764,21 @@ function defineChannels(pkg, channels, options) {
|
|
|
612
764
|
const tracingChannel = () => isomorph_default.newTracingChannel(
|
|
613
765
|
fullChannelName
|
|
614
766
|
);
|
|
767
|
+
const intercept = (interceptor) => {
|
|
768
|
+
const hook = tracingChannel();
|
|
769
|
+
return typeof hook.intercept === "function" ? hook.intercept(interceptor) : () => {
|
|
770
|
+
};
|
|
771
|
+
};
|
|
615
772
|
return [
|
|
616
773
|
key,
|
|
617
774
|
{
|
|
618
775
|
...syncSpec,
|
|
619
776
|
instrumentationName,
|
|
777
|
+
intercept,
|
|
778
|
+
invoke: (target, thisArg, args, additional) => {
|
|
779
|
+
const hook = tracingChannel();
|
|
780
|
+
return typeof hook.invoke === "function" ? hook.invoke(target, thisArg, args, additional) : Reflect.apply(target, thisArg, args);
|
|
781
|
+
},
|
|
620
782
|
tracingChannel,
|
|
621
783
|
traceSync: (fn, context) => tracingChannel().traceSync(
|
|
622
784
|
fn,
|
|
@@ -638,6 +800,7 @@ var INSTRUMENTATION_NAMES = {
|
|
|
638
800
|
CLAUDE_AGENT_SDK: "claude-agent-sdk",
|
|
639
801
|
CLOUDFLARE_AI_CHAT: "cloudflare-ai-chat",
|
|
640
802
|
CLOUDFLARE_AGENTS: "cloudflare-agents",
|
|
803
|
+
CLOUDFLARE_THINK: "cloudflare-think",
|
|
641
804
|
COHERE: "cohere",
|
|
642
805
|
CURSOR_SDK: "cursor-sdk",
|
|
643
806
|
EVE: "eve",
|
|
@@ -652,6 +815,7 @@ var INSTRUMENTATION_NAMES = {
|
|
|
652
815
|
LANGSMITH: "langsmith",
|
|
653
816
|
MASTRA: "mastra",
|
|
654
817
|
MISTRAL: "mistral",
|
|
818
|
+
OLLAMA: "ollama",
|
|
655
819
|
OPENAI: "openai",
|
|
656
820
|
OPENAI_AGENTS: "openai-agents",
|
|
657
821
|
OPENAI_CODEX: "openai-codex",
|
|
@@ -946,6 +1110,14 @@ var anthropicChannels = defineChannels(
|
|
|
946
1110
|
betaMessagesToolRunner: channel({
|
|
947
1111
|
channelName: "beta.messages.toolRunner",
|
|
948
1112
|
kind: "sync-stream"
|
|
1113
|
+
}),
|
|
1114
|
+
betaSessionsEventsStream: channel({
|
|
1115
|
+
channelName: "beta.sessions.events.stream",
|
|
1116
|
+
kind: "async"
|
|
1117
|
+
}),
|
|
1118
|
+
betaSessionsThreadsEventsStream: channel({
|
|
1119
|
+
channelName: "beta.sessions.threads.events.stream",
|
|
1120
|
+
kind: "async"
|
|
949
1121
|
})
|
|
950
1122
|
},
|
|
951
1123
|
{ instrumentationName: INSTRUMENTATION_NAMES.ANTHROPIC }
|
|
@@ -1064,7 +1236,40 @@ var anthropicConfigs = [
|
|
|
1064
1236
|
methodName: "toolRunner",
|
|
1065
1237
|
kind: "Sync"
|
|
1066
1238
|
}
|
|
1067
|
-
}
|
|
1239
|
+
},
|
|
1240
|
+
// Managed Agents Sessions event streams are discovered automatically, but
|
|
1241
|
+
// remain passive until the user calls collectAnthropicSession() on the
|
|
1242
|
+
// returned stream.
|
|
1243
|
+
...["mjs", "js"].map(
|
|
1244
|
+
(extension) => ({
|
|
1245
|
+
channelName: anthropicChannels.betaSessionsEventsStream.channelName,
|
|
1246
|
+
module: {
|
|
1247
|
+
name: "@anthropic-ai/sdk",
|
|
1248
|
+
versionRange: ">=0.86.0",
|
|
1249
|
+
filePath: `resources/beta/sessions/events.${extension}`
|
|
1250
|
+
},
|
|
1251
|
+
functionQuery: {
|
|
1252
|
+
className: "Events",
|
|
1253
|
+
methodName: "stream",
|
|
1254
|
+
kind: "Async"
|
|
1255
|
+
}
|
|
1256
|
+
})
|
|
1257
|
+
),
|
|
1258
|
+
...["mjs", "js"].map(
|
|
1259
|
+
(extension) => ({
|
|
1260
|
+
channelName: anthropicChannels.betaSessionsThreadsEventsStream.channelName,
|
|
1261
|
+
module: {
|
|
1262
|
+
name: "@anthropic-ai/sdk",
|
|
1263
|
+
versionRange: ">=0.86.0",
|
|
1264
|
+
filePath: `resources/beta/sessions/threads/events.${extension}`
|
|
1265
|
+
},
|
|
1266
|
+
functionQuery: {
|
|
1267
|
+
className: "Events",
|
|
1268
|
+
methodName: "stream",
|
|
1269
|
+
kind: "Async"
|
|
1270
|
+
}
|
|
1271
|
+
})
|
|
1272
|
+
)
|
|
1068
1273
|
];
|
|
1069
1274
|
|
|
1070
1275
|
// src/instrumentation/plugins/bedrock-runtime-channels.ts
|
|
@@ -1715,6 +1920,36 @@ var cloudflareAgentsConfigs = [
|
|
|
1715
1920
|
}
|
|
1716
1921
|
];
|
|
1717
1922
|
|
|
1923
|
+
// src/instrumentation/plugins/cloudflare-think-channels.ts
|
|
1924
|
+
var cloudflareThinkChannels = defineChannels(
|
|
1925
|
+
"@cloudflare/think",
|
|
1926
|
+
{
|
|
1927
|
+
runInferenceLoop: channel({
|
|
1928
|
+
channelName: "Think.runInferenceLoop",
|
|
1929
|
+
kind: "async"
|
|
1930
|
+
})
|
|
1931
|
+
},
|
|
1932
|
+
{ instrumentationName: INSTRUMENTATION_NAMES.CLOUDFLARE_THINK }
|
|
1933
|
+
);
|
|
1934
|
+
|
|
1935
|
+
// src/auto-instrumentations/configs/cloudflare-think.ts
|
|
1936
|
+
var cloudflareThinkVersionRange = ">=0.13.0 <0.14.0";
|
|
1937
|
+
var cloudflareThinkConfigs = [
|
|
1938
|
+
{
|
|
1939
|
+
channelName: cloudflareThinkChannels.runInferenceLoop.channelName,
|
|
1940
|
+
module: {
|
|
1941
|
+
name: "@cloudflare/think",
|
|
1942
|
+
versionRange: cloudflareThinkVersionRange,
|
|
1943
|
+
filePath: "dist/think.js"
|
|
1944
|
+
},
|
|
1945
|
+
functionQuery: {
|
|
1946
|
+
className: "Think",
|
|
1947
|
+
methodName: "_runInferenceLoop",
|
|
1948
|
+
kind: "Async"
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
];
|
|
1952
|
+
|
|
1718
1953
|
// src/instrumentation/plugins/cursor-sdk-channels.ts
|
|
1719
1954
|
var cursorSDKChannels = defineChannels(
|
|
1720
1955
|
"@cursor/sdk",
|
|
@@ -2332,6 +2567,19 @@ var openRouterConfigs = [
|
|
|
2332
2567
|
kind: "Async"
|
|
2333
2568
|
}
|
|
2334
2569
|
},
|
|
2570
|
+
{
|
|
2571
|
+
channelName: openRouterChannels.betaResponsesSend.channelName,
|
|
2572
|
+
module: {
|
|
2573
|
+
name: "@openrouter/sdk",
|
|
2574
|
+
versionRange: ">=1.1.2 <2.0.0",
|
|
2575
|
+
filePath: "esm/sdk/betaresponses.js"
|
|
2576
|
+
},
|
|
2577
|
+
functionQuery: {
|
|
2578
|
+
className: "BetaResponses",
|
|
2579
|
+
methodName: "send",
|
|
2580
|
+
kind: "Async"
|
|
2581
|
+
}
|
|
2582
|
+
},
|
|
2335
2583
|
{
|
|
2336
2584
|
channelName: openRouterChannels.callModel.channelName,
|
|
2337
2585
|
module: {
|
|
@@ -2689,6 +2937,51 @@ var mistralConfigs = [
|
|
|
2689
2937
|
}
|
|
2690
2938
|
];
|
|
2691
2939
|
|
|
2940
|
+
// src/instrumentation/plugins/ollama-channels.ts
|
|
2941
|
+
var ollamaChannels = defineChannels(
|
|
2942
|
+
"ollama",
|
|
2943
|
+
{
|
|
2944
|
+
chat: channel({
|
|
2945
|
+
channelName: "chat",
|
|
2946
|
+
kind: "async"
|
|
2947
|
+
}),
|
|
2948
|
+
generate: channel({
|
|
2949
|
+
channelName: "generate",
|
|
2950
|
+
kind: "async"
|
|
2951
|
+
}),
|
|
2952
|
+
embed: channel({
|
|
2953
|
+
channelName: "embed",
|
|
2954
|
+
kind: "async"
|
|
2955
|
+
})
|
|
2956
|
+
},
|
|
2957
|
+
{ instrumentationName: INSTRUMENTATION_NAMES.OLLAMA }
|
|
2958
|
+
);
|
|
2959
|
+
|
|
2960
|
+
// src/auto-instrumentations/configs/ollama.ts
|
|
2961
|
+
var methods = [
|
|
2962
|
+
["chat", ollamaChannels.chat.channelName],
|
|
2963
|
+
["generate", ollamaChannels.generate.channelName],
|
|
2964
|
+
["embed", ollamaChannels.embed.channelName]
|
|
2965
|
+
];
|
|
2966
|
+
var implementationFiles = ["dist/browser.mjs", "dist/browser.cjs"];
|
|
2967
|
+
var ollamaConfigs = [
|
|
2968
|
+
...implementationFiles.flatMap(
|
|
2969
|
+
(filePath) => methods.map(([methodName, channelName]) => ({
|
|
2970
|
+
channelName,
|
|
2971
|
+
module: {
|
|
2972
|
+
name: "ollama",
|
|
2973
|
+
versionRange: ">=0.6.0 <0.7.0",
|
|
2974
|
+
filePath
|
|
2975
|
+
},
|
|
2976
|
+
functionQuery: {
|
|
2977
|
+
className: "Ollama",
|
|
2978
|
+
methodName,
|
|
2979
|
+
kind: "Async"
|
|
2980
|
+
}
|
|
2981
|
+
}))
|
|
2982
|
+
)
|
|
2983
|
+
];
|
|
2984
|
+
|
|
2692
2985
|
// src/instrumentation/plugins/google-adk-channels.ts
|
|
2693
2986
|
var googleADKChannels = defineChannels(
|
|
2694
2987
|
"@google/adk",
|
|
@@ -3757,6 +4050,7 @@ var piCodingAgentConfigs = [
|
|
|
3757
4050
|
claudeAgentSDKConfigs,
|
|
3758
4051
|
cloudflareAIChatConfigs,
|
|
3759
4052
|
cloudflareAgentsConfigs,
|
|
4053
|
+
cloudflareThinkConfigs,
|
|
3760
4054
|
cohereConfigs,
|
|
3761
4055
|
cursorSDKConfigs,
|
|
3762
4056
|
genkitConfigs,
|
|
@@ -3768,6 +4062,7 @@ var piCodingAgentConfigs = [
|
|
|
3768
4062
|
langSmithConfigs,
|
|
3769
4063
|
langchainConfigs,
|
|
3770
4064
|
mistralConfigs,
|
|
4065
|
+
ollamaConfigs,
|
|
3771
4066
|
openAIAgentsCoreConfigs,
|
|
3772
4067
|
openAICodexConfigs,
|
|
3773
4068
|
openRouterAgentConfigs,
|
|
@@ -58,6 +58,8 @@ declare const claudeAgentSDKConfigs: InstrumentationConfig[];
|
|
|
58
58
|
|
|
59
59
|
declare const cloudflareAgentsConfigs: InstrumentationConfig[];
|
|
60
60
|
|
|
61
|
+
declare const cloudflareThinkConfigs: InstrumentationConfig[];
|
|
62
|
+
|
|
61
63
|
declare const cursorSDKConfigs: InstrumentationConfig[];
|
|
62
64
|
|
|
63
65
|
declare const openAIAgentsCoreConfigs: InstrumentationConfig[];
|
|
@@ -83,6 +85,8 @@ declare const openRouterConfigs: InstrumentationConfig[];
|
|
|
83
85
|
|
|
84
86
|
declare const mistralConfigs: InstrumentationConfig[];
|
|
85
87
|
|
|
88
|
+
declare const ollamaConfigs: InstrumentationConfig[];
|
|
89
|
+
|
|
86
90
|
/**
|
|
87
91
|
* Instrumentation configurations for the Google ADK (@google/adk).
|
|
88
92
|
*
|
|
@@ -119,4 +123,4 @@ declare const langSmithConfigs: InstrumentationConfig[];
|
|
|
119
123
|
|
|
120
124
|
declare const piCodingAgentConfigs: InstrumentationConfig[];
|
|
121
125
|
|
|
122
|
-
export { InstrumentationConfig, aiSDKConfigs, anthropicConfigs, bedrockRuntimeConfigs, claudeAgentSDKConfigs, cloudflareAIChatConfigs, cloudflareAgentsConfigs, cohereConfigs, cursorSDKConfigs, genkitConfigs, gitHubCopilotConfigs, googleADKConfigs, googleGenAIConfigs, groqConfigs, huggingFaceConfigs, langSmithConfigs, langchainConfigs, mistralConfigs, openAIAgentsCoreConfigs, openAICodexConfigs, openRouterAgentConfigs, openRouterConfigs, openaiConfigs, piCodingAgentConfigs };
|
|
126
|
+
export { InstrumentationConfig, aiSDKConfigs, anthropicConfigs, bedrockRuntimeConfigs, claudeAgentSDKConfigs, cloudflareAIChatConfigs, cloudflareAgentsConfigs, cloudflareThinkConfigs, cohereConfigs, cursorSDKConfigs, genkitConfigs, gitHubCopilotConfigs, googleADKConfigs, googleGenAIConfigs, groqConfigs, huggingFaceConfigs, langSmithConfigs, langchainConfigs, mistralConfigs, ollamaConfigs, openAIAgentsCoreConfigs, openAICodexConfigs, openRouterAgentConfigs, openRouterConfigs, openaiConfigs, piCodingAgentConfigs };
|
|
@@ -58,6 +58,8 @@ declare const claudeAgentSDKConfigs: InstrumentationConfig[];
|
|
|
58
58
|
|
|
59
59
|
declare const cloudflareAgentsConfigs: InstrumentationConfig[];
|
|
60
60
|
|
|
61
|
+
declare const cloudflareThinkConfigs: InstrumentationConfig[];
|
|
62
|
+
|
|
61
63
|
declare const cursorSDKConfigs: InstrumentationConfig[];
|
|
62
64
|
|
|
63
65
|
declare const openAIAgentsCoreConfigs: InstrumentationConfig[];
|
|
@@ -83,6 +85,8 @@ declare const openRouterConfigs: InstrumentationConfig[];
|
|
|
83
85
|
|
|
84
86
|
declare const mistralConfigs: InstrumentationConfig[];
|
|
85
87
|
|
|
88
|
+
declare const ollamaConfigs: InstrumentationConfig[];
|
|
89
|
+
|
|
86
90
|
/**
|
|
87
91
|
* Instrumentation configurations for the Google ADK (@google/adk).
|
|
88
92
|
*
|
|
@@ -119,4 +123,4 @@ declare const langSmithConfigs: InstrumentationConfig[];
|
|
|
119
123
|
|
|
120
124
|
declare const piCodingAgentConfigs: InstrumentationConfig[];
|
|
121
125
|
|
|
122
|
-
export { InstrumentationConfig, aiSDKConfigs, anthropicConfigs, bedrockRuntimeConfigs, claudeAgentSDKConfigs, cloudflareAIChatConfigs, cloudflareAgentsConfigs, cohereConfigs, cursorSDKConfigs, genkitConfigs, gitHubCopilotConfigs, googleADKConfigs, googleGenAIConfigs, groqConfigs, huggingFaceConfigs, langSmithConfigs, langchainConfigs, mistralConfigs, openAIAgentsCoreConfigs, openAICodexConfigs, openRouterAgentConfigs, openRouterConfigs, openaiConfigs, piCodingAgentConfigs };
|
|
126
|
+
export { InstrumentationConfig, aiSDKConfigs, anthropicConfigs, bedrockRuntimeConfigs, claudeAgentSDKConfigs, cloudflareAIChatConfigs, cloudflareAgentsConfigs, cloudflareThinkConfigs, cohereConfigs, cursorSDKConfigs, genkitConfigs, gitHubCopilotConfigs, googleADKConfigs, googleGenAIConfigs, groqConfigs, huggingFaceConfigs, langSmithConfigs, langchainConfigs, mistralConfigs, ollamaConfigs, openAIAgentsCoreConfigs, openAICodexConfigs, openRouterAgentConfigs, openRouterConfigs, openaiConfigs, piCodingAgentConfigs };
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
claudeAgentSDKConfigs,
|
|
6
6
|
cloudflareAIChatConfigs,
|
|
7
7
|
cloudflareAgentsConfigs,
|
|
8
|
+
cloudflareThinkConfigs,
|
|
8
9
|
cohereConfigs,
|
|
9
10
|
cursorSDKConfigs,
|
|
10
11
|
genkitConfigs,
|
|
@@ -16,14 +17,15 @@ import {
|
|
|
16
17
|
langSmithConfigs,
|
|
17
18
|
langchainConfigs,
|
|
18
19
|
mistralConfigs,
|
|
20
|
+
ollamaConfigs,
|
|
19
21
|
openAIAgentsCoreConfigs,
|
|
20
22
|
openAICodexConfigs,
|
|
21
23
|
openRouterAgentConfigs,
|
|
22
24
|
openRouterConfigs,
|
|
23
25
|
openaiConfigs,
|
|
24
26
|
piCodingAgentConfigs
|
|
25
|
-
} from "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-ZNHTSSGI.mjs";
|
|
28
|
+
import "./chunk-JPUFNW7X.mjs";
|
|
27
29
|
export {
|
|
28
30
|
aiSDKConfigs,
|
|
29
31
|
anthropicConfigs,
|
|
@@ -31,6 +33,7 @@ export {
|
|
|
31
33
|
claudeAgentSDKConfigs,
|
|
32
34
|
cloudflareAIChatConfigs,
|
|
33
35
|
cloudflareAgentsConfigs,
|
|
36
|
+
cloudflareThinkConfigs,
|
|
34
37
|
cohereConfigs,
|
|
35
38
|
cursorSDKConfigs,
|
|
36
39
|
genkitConfigs,
|
|
@@ -42,6 +45,7 @@ export {
|
|
|
42
45
|
langSmithConfigs,
|
|
43
46
|
langchainConfigs,
|
|
44
47
|
mistralConfigs,
|
|
48
|
+
ollamaConfigs,
|
|
45
49
|
openAIAgentsCoreConfigs,
|
|
46
50
|
openAICodexConfigs,
|
|
47
51
|
openRouterAgentConfigs,
|