braintrust 3.24.0 → 3.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/NOTICE +6 -0
  2. package/dev/dist/index.d.mts +135 -2
  3. package/dev/dist/index.d.ts +135 -2
  4. package/dev/dist/index.js +4426 -2040
  5. package/dev/dist/index.mjs +3594 -1208
  6. package/dist/apply-auto-instrumentation.js +445 -403
  7. package/dist/apply-auto-instrumentation.mjs +249 -207
  8. package/dist/auto-instrumentations/bundler/esbuild.cjs +1449 -799
  9. package/dist/auto-instrumentations/bundler/esbuild.d.mts +4 -4
  10. package/dist/auto-instrumentations/bundler/esbuild.d.ts +4 -4
  11. package/dist/auto-instrumentations/bundler/esbuild.mjs +5 -8
  12. package/dist/auto-instrumentations/bundler/next.cjs +1448 -818
  13. package/dist/auto-instrumentations/bundler/next.mjs +6 -29
  14. package/dist/auto-instrumentations/bundler/rollup.cjs +1449 -799
  15. package/dist/auto-instrumentations/bundler/rollup.d.mts +4 -4
  16. package/dist/auto-instrumentations/bundler/rollup.d.ts +4 -4
  17. package/dist/auto-instrumentations/bundler/rollup.mjs +5 -8
  18. package/dist/auto-instrumentations/bundler/vite.cjs +1449 -799
  19. package/dist/auto-instrumentations/bundler/vite.d.mts +4 -4
  20. package/dist/auto-instrumentations/bundler/vite.d.ts +4 -4
  21. package/dist/auto-instrumentations/bundler/vite.mjs +5 -8
  22. package/dist/auto-instrumentations/bundler/webpack-loader.cjs +1602 -728
  23. package/dist/auto-instrumentations/bundler/webpack-loader.d.ts +20 -12
  24. package/dist/auto-instrumentations/bundler/webpack.cjs +1449 -799
  25. package/dist/auto-instrumentations/bundler/webpack.d.mts +4 -4
  26. package/dist/auto-instrumentations/bundler/webpack.d.ts +4 -4
  27. package/dist/auto-instrumentations/bundler/webpack.mjs +5 -4
  28. package/dist/auto-instrumentations/{chunk-GSZHTAQW.mjs → chunk-6E22MYSW.mjs} +194 -93
  29. package/dist/auto-instrumentations/{chunk-VT6DDNKM.mjs → chunk-AKKPLXTP.mjs} +631 -194
  30. package/dist/auto-instrumentations/chunk-NRE4QUQR.mjs +509 -0
  31. package/dist/auto-instrumentations/{chunk-BURMPO7L.mjs → chunk-V5LEODRX.mjs} +2 -6
  32. package/dist/auto-instrumentations/{chunk-M6DLIJ2Z.mjs → chunk-XYN63IG5.mjs} +124 -194
  33. package/dist/auto-instrumentations/{chunk-F43DNLPD.mjs → chunk-XZHHE4Y3.mjs} +646 -510
  34. package/dist/auto-instrumentations/hook.mjs +894 -657
  35. package/dist/auto-instrumentations/index.cjs +1125 -490
  36. package/dist/auto-instrumentations/index.d.mts +6 -2
  37. package/dist/auto-instrumentations/index.d.ts +6 -2
  38. package/dist/auto-instrumentations/index.mjs +6 -1
  39. package/dist/auto-instrumentations/loader/cjs-patch.cjs +492 -195
  40. package/dist/auto-instrumentations/loader/cjs-patch.d.mts +2 -2
  41. package/dist/auto-instrumentations/loader/cjs-patch.d.ts +2 -2
  42. package/dist/auto-instrumentations/loader/cjs-patch.mjs +3 -2
  43. package/dist/auto-instrumentations/loader/esm-hook.mjs +1 -1
  44. package/dist/auto-instrumentations/plugin-B-aZh7EP.d.ts +30 -0
  45. package/dist/auto-instrumentations/plugin-Bnj4E_6B.d.mts +30 -0
  46. package/dist/auto-instrumentations/{types-RNPaKi9o.d.mts → types-C1fVeiCp.d.mts} +1 -1
  47. package/dist/auto-instrumentations/{types-RNPaKi9o.d.ts → types-C1fVeiCp.d.ts} +1 -1
  48. package/dist/browser.d.mts +824 -197
  49. package/dist/browser.d.ts +824 -197
  50. package/dist/browser.js +3897 -1228
  51. package/dist/browser.mjs +3897 -1228
  52. package/dist/chunk-PN7EWK66.mjs +1784 -0
  53. package/dist/{chunk-SU6EHKJV.js → chunk-VRZZQPAA.js} +3289 -1577
  54. package/dist/chunk-VYNNEKSA.js +1784 -0
  55. package/dist/{chunk-XE5FS7QY.mjs → chunk-XIZOM2HO.mjs} +2470 -758
  56. package/dist/cli.js +3596 -1211
  57. package/dist/edge-light.d.mts +1 -1
  58. package/dist/edge-light.d.ts +1 -1
  59. package/dist/edge-light.js +3897 -1231
  60. package/dist/edge-light.mjs +3897 -1231
  61. package/dist/index.d.mts +824 -197
  62. package/dist/index.d.ts +824 -197
  63. package/dist/index.js +750 -445
  64. package/dist/index.mjs +334 -29
  65. package/dist/instrumentation/index.d.mts +135 -6
  66. package/dist/instrumentation/index.d.ts +135 -6
  67. package/dist/instrumentation/index.js +3696 -1257
  68. package/dist/instrumentation/index.mjs +3696 -1257
  69. package/dist/vitest-evals-reporter.js +16 -16
  70. package/dist/vitest-evals-reporter.mjs +2 -2
  71. package/dist/workerd.d.mts +1 -1
  72. package/dist/workerd.d.ts +1 -1
  73. package/dist/workerd.js +3897 -1231
  74. package/dist/workerd.mjs +3897 -1231
  75. package/licenses/node-diagnostics-channel/LICENSE +19 -0
  76. package/package.json +34 -35
  77. package/dist/auto-instrumentations/plugin-D0KHwSJv.d.mts +0 -44
  78. package/dist/auto-instrumentations/plugin-G6fgxk1b.d.ts +0 -44
  79. package/dist/chunk-7AUY2XWX.js +0 -1090
  80. package/dist/chunk-7F6GCRHH.mjs +0 -1090
@@ -24,6 +24,8 @@ __export(index_exports, {
24
24
  anthropicConfigs: () => anthropicConfigs,
25
25
  bedrockRuntimeConfigs: () => bedrockRuntimeConfigs,
26
26
  claudeAgentSDKConfigs: () => claudeAgentSDKConfigs,
27
+ cloudflareAIChatConfigs: () => cloudflareAIChatConfigs,
28
+ cloudflareAgentsConfigs: () => cloudflareAgentsConfigs,
27
29
  cohereConfigs: () => cohereConfigs,
28
30
  cursorSDKConfigs: () => cursorSDKConfigs,
29
31
  genkitConfigs: () => genkitConfigs,
@@ -44,84 +46,519 @@ __export(index_exports, {
44
46
  });
45
47
  module.exports = __toCommonJS(index_exports);
46
48
 
47
- // src/isomorph.ts
48
- var DefaultAsyncLocalStorage = class {
49
- constructor() {
50
- }
51
- enterWith(_) {
52
- }
53
- run(_, callback) {
54
- return callback();
49
+ // src/global-instrumentation-hooks.ts
50
+ var GLOBAL_INSTRUMENTATION_HOOKS_KEY = "__braintrust_instrumentation_hooks";
51
+ var GLOBAL_INSTRUMENTATION_HOOKS_PROTOCOL_VERSION = 1;
52
+ var GLOBAL_INSTRUMENTATION_HOOKS_REGISTRY_BRAND = "braintrust.global-instrumentation-hooks.registry";
53
+ var GLOBAL_INSTRUMENTATION_HOOK_BRAND = "braintrust.global-instrumentation-hooks.hook";
54
+ var registryBrand = Symbol.for(GLOBAL_INSTRUMENTATION_HOOKS_REGISTRY_BRAND);
55
+ var hookBrand = Symbol.for(GLOBAL_INSTRUMENTATION_HOOK_BRAND);
56
+ var errorReporter;
57
+ function reportError(error) {
58
+ try {
59
+ errorReporter?.(error);
60
+ } catch {
55
61
  }
56
- getStore() {
57
- return void 0;
62
+ }
63
+ function setContextValue(context, key, value) {
64
+ try {
65
+ context[key] = value;
66
+ } catch (error) {
67
+ reportError(error);
58
68
  }
59
- };
60
- var DefaultChannel = class {
69
+ }
70
+ function wrapStoreRun(store, message, next, transform) {
71
+ return () => {
72
+ let context;
73
+ try {
74
+ context = transform ? transform(message) : message;
75
+ } catch (error) {
76
+ reportError(error);
77
+ return next();
78
+ }
79
+ let called = false;
80
+ let result;
81
+ let providerError;
82
+ let providerThrew = false;
83
+ const runNext = () => {
84
+ if (called) {
85
+ reportError(
86
+ new Error(
87
+ "Instrumentation store invoked its callback more than once"
88
+ )
89
+ );
90
+ if (providerThrew) {
91
+ throw providerError;
92
+ }
93
+ return result;
94
+ }
95
+ called = true;
96
+ try {
97
+ result = next();
98
+ return result;
99
+ } catch (error) {
100
+ providerThrew = true;
101
+ providerError = error;
102
+ throw error;
103
+ }
104
+ };
105
+ try {
106
+ store.run(context, runNext);
107
+ } catch (error) {
108
+ if (!providerThrew || error !== providerError) {
109
+ reportError(error);
110
+ }
111
+ }
112
+ if (!called) {
113
+ reportError(
114
+ new Error("Instrumentation store did not invoke its callback")
115
+ );
116
+ return runNext();
117
+ }
118
+ if (providerThrew) {
119
+ throw providerError;
120
+ }
121
+ return result;
122
+ };
123
+ }
124
+ var HookChannel = class {
61
125
  constructor(name) {
62
126
  this.name = name;
63
127
  }
64
128
  name;
65
- hasSubscribers = false;
66
- subscribe(_subscription) {
129
+ subscribers = [];
130
+ stores = /* @__PURE__ */ new Map();
131
+ get hasSubscribers() {
132
+ return this.subscribers.length > 0 || this.stores.size > 0;
67
133
  }
68
- unsubscribe(_subscription) {
69
- return false;
134
+ subscribe(subscription) {
135
+ if (typeof subscription !== "function") {
136
+ throw new TypeError("subscription must be a function");
137
+ }
138
+ this.subscribers = [...this.subscribers, subscription];
70
139
  }
71
- bindStore(_store, _transform) {
140
+ unsubscribe(subscription) {
141
+ const index = this.subscribers.indexOf(subscription);
142
+ if (index === -1) {
143
+ return false;
144
+ }
145
+ this.subscribers = [
146
+ ...this.subscribers.slice(0, index),
147
+ ...this.subscribers.slice(index + 1)
148
+ ];
149
+ return true;
72
150
  }
73
- unbindStore(_store) {
74
- return false;
151
+ bindStore(store, transform) {
152
+ if (!store || typeof store.run !== "function") {
153
+ throw new TypeError("store must have a run method");
154
+ }
155
+ this.stores.set(
156
+ store,
157
+ transform
158
+ );
75
159
  }
76
- publish(_message) {
160
+ unbindStore(store) {
161
+ return this.stores.delete(store);
77
162
  }
78
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
79
- runStores(_message, fn, thisArg, ...args) {
80
- return fn.apply(thisArg, args);
163
+ publish(message) {
164
+ const subscribers = this.subscribers;
165
+ for (const subscriber of subscribers) {
166
+ try {
167
+ subscriber(message, this.name);
168
+ } catch (error) {
169
+ reportError(error);
170
+ }
171
+ }
172
+ }
173
+ runStores(message, fn, thisArg, ...args) {
174
+ let run = () => {
175
+ this.publish(message);
176
+ return Reflect.apply(fn, thisArg, args);
177
+ };
178
+ for (const [store, transform] of this.stores.entries()) {
179
+ run = wrapStoreRun(store, message, run, transform);
180
+ }
181
+ return run();
81
182
  }
82
183
  };
83
- var DefaultTracingChannel = class {
184
+ var traceEvents = [
185
+ "start",
186
+ "end",
187
+ "asyncStart",
188
+ "asyncEnd",
189
+ "error"
190
+ ];
191
+ var TracingHook = class {
84
192
  start;
85
193
  end;
86
194
  asyncStart;
87
195
  asyncEnd;
88
196
  error;
89
197
  constructor(nameOrChannels) {
198
+ Object.defineProperty(this, hookBrand, {
199
+ configurable: false,
200
+ enumerable: false,
201
+ value: GLOBAL_INSTRUMENTATION_HOOKS_PROTOCOL_VERSION,
202
+ writable: false
203
+ });
90
204
  if (typeof nameOrChannels === "string") {
91
- this.start = new DefaultChannel(`tracing:${nameOrChannels}:start`);
92
- this.end = new DefaultChannel(`tracing:${nameOrChannels}:end`);
93
- this.asyncStart = new DefaultChannel(
94
- `tracing:${nameOrChannels}:asyncStart`
95
- );
96
- this.asyncEnd = new DefaultChannel(`tracing:${nameOrChannels}:asyncEnd`);
97
- this.error = new DefaultChannel(`tracing:${nameOrChannels}:error`);
205
+ this.start = new HookChannel(`tracing:${nameOrChannels}:start`);
206
+ this.end = new HookChannel(`tracing:${nameOrChannels}:end`);
207
+ this.asyncStart = new HookChannel(`tracing:${nameOrChannels}:asyncStart`);
208
+ this.asyncEnd = new HookChannel(`tracing:${nameOrChannels}:asyncEnd`);
209
+ this.error = new HookChannel(`tracing:${nameOrChannels}:error`);
98
210
  return;
99
211
  }
100
- this.start = nameOrChannels.start ?? new DefaultChannel("tracing:start");
101
- this.end = nameOrChannels.end ?? new DefaultChannel("tracing:end");
102
- this.asyncStart = nameOrChannels.asyncStart ?? new DefaultChannel("tracing:asyncStart");
103
- this.asyncEnd = nameOrChannels.asyncEnd ?? new DefaultChannel("tracing:asyncEnd");
104
- this.error = nameOrChannels.error ?? new DefaultChannel("tracing:error");
212
+ this.start = nameOrChannels.start ?? new HookChannel("tracing:start");
213
+ this.end = nameOrChannels.end ?? new HookChannel("tracing:end");
214
+ this.asyncStart = nameOrChannels.asyncStart ?? new HookChannel("tracing:asyncStart");
215
+ this.asyncEnd = nameOrChannels.asyncEnd ?? new HookChannel("tracing:asyncEnd");
216
+ this.error = nameOrChannels.error ?? new HookChannel("tracing:error");
105
217
  }
106
218
  get hasSubscribers() {
107
219
  return this.start.hasSubscribers || this.end.hasSubscribers || this.asyncStart.hasSubscribers || this.asyncEnd.hasSubscribers || this.error.hasSubscribers;
108
220
  }
109
- subscribe(_handlers) {
221
+ subscribe(handlers) {
222
+ for (const eventName of traceEvents) {
223
+ const handler = handlers[eventName];
224
+ if (handler) {
225
+ this[eventName].subscribe(handler);
226
+ }
227
+ }
228
+ }
229
+ unsubscribe(handlers) {
230
+ let done = true;
231
+ for (const eventName of traceEvents) {
232
+ const handler = handlers[eventName];
233
+ if (handler && !this[eventName].unsubscribe(handler)) {
234
+ done = false;
235
+ }
236
+ }
237
+ return done;
238
+ }
239
+ traceSync(fn, message = {}, thisArg, ...args) {
240
+ if (!this.hasSubscribers) {
241
+ return Reflect.apply(fn, thisArg, args);
242
+ }
243
+ const context = message;
244
+ return this.start.runStores(message, () => {
245
+ try {
246
+ const result = Reflect.apply(fn, thisArg, args);
247
+ setContextValue(context, "result", result);
248
+ return result;
249
+ } catch (error) {
250
+ setContextValue(context, "error", error);
251
+ this.error.publish(message);
252
+ throw error;
253
+ } finally {
254
+ this.end.publish(message);
255
+ }
256
+ });
257
+ }
258
+ tracePromise(fn, message = {}, thisArg, ...args) {
259
+ if (!this.hasSubscribers) {
260
+ return Reflect.apply(fn, thisArg, args);
261
+ }
262
+ const context = message;
263
+ return this.start.runStores(message, () => {
264
+ let result;
265
+ try {
266
+ result = Reflect.apply(fn, thisArg, args);
267
+ } catch (error) {
268
+ setContextValue(context, "error", error);
269
+ this.error.publish(message);
270
+ this.end.publish(message);
271
+ throw error;
272
+ }
273
+ this.end.publish(message);
274
+ if (!result || typeof result !== "object" && typeof result !== "function") {
275
+ setContextValue(context, "result", result);
276
+ this.asyncStart.publish(message);
277
+ this.asyncEnd.publish(message);
278
+ return result;
279
+ }
280
+ let terminalPublished = false;
281
+ const finishUnobservedResult = (error) => {
282
+ reportError(error);
283
+ if (!terminalPublished) {
284
+ terminalPublished = true;
285
+ setContextValue(context, "result", result);
286
+ this.asyncStart.publish(message);
287
+ this.asyncEnd.publish(message);
288
+ }
289
+ return result;
290
+ };
291
+ let then;
292
+ try {
293
+ then = result.then;
294
+ } catch (error) {
295
+ return finishUnobservedResult(error);
296
+ }
297
+ if (typeof then !== "function") {
298
+ setContextValue(context, "result", result);
299
+ this.asyncStart.publish(message);
300
+ this.asyncEnd.publish(message);
301
+ return result;
302
+ }
303
+ const resolve = (resolved) => {
304
+ if (!terminalPublished) {
305
+ terminalPublished = true;
306
+ setContextValue(context, "result", resolved);
307
+ this.asyncStart.publish(message);
308
+ this.asyncEnd.publish(message);
309
+ }
310
+ return resolved;
311
+ };
312
+ let rejectionThrown = false;
313
+ let rejectionError;
314
+ const reject = (error) => {
315
+ if (!terminalPublished) {
316
+ terminalPublished = true;
317
+ setContextValue(context, "error", error);
318
+ this.error.publish(message);
319
+ this.asyncStart.publish(message);
320
+ this.asyncEnd.publish(message);
321
+ }
322
+ rejectionThrown = true;
323
+ rejectionError = error;
324
+ throw error;
325
+ };
326
+ let isPlainPromise;
327
+ try {
328
+ isPlainPromise = result instanceof Promise && result.constructor === Promise;
329
+ } catch (error) {
330
+ return finishUnobservedResult(error);
331
+ }
332
+ try {
333
+ if (isPlainPromise) {
334
+ return Reflect.apply(then, result, [resolve, reject]);
335
+ }
336
+ Reflect.apply(then, result, [
337
+ resolve,
338
+ (error) => {
339
+ try {
340
+ reject(error);
341
+ } catch {
342
+ }
343
+ }
344
+ ]);
345
+ } catch (error) {
346
+ if (rejectionThrown && error === rejectionError) {
347
+ return result;
348
+ }
349
+ return finishUnobservedResult(error);
350
+ }
351
+ return result;
352
+ });
353
+ }
354
+ traceCallback(fn, position = -1, message = {}, thisArg, ...args) {
355
+ if (!this.hasSubscribers) {
356
+ return Reflect.apply(fn, thisArg, args);
357
+ }
358
+ const context = message;
359
+ const callArgs = args.length > 0 ? args : context.arguments ?? args;
360
+ const callback = Array.prototype.at.call(callArgs, position);
361
+ if (typeof callback !== "function") {
362
+ return Reflect.apply(fn, thisArg, args);
363
+ }
364
+ const { asyncStart, asyncEnd, error: errorChannel } = this;
365
+ function wrappedCallback(error, result) {
366
+ if (error) {
367
+ setContextValue(context, "error", error);
368
+ errorChannel.publish(message);
369
+ } else {
370
+ setContextValue(context, "result", result);
371
+ }
372
+ return asyncStart.runStores(message, () => {
373
+ try {
374
+ return Reflect.apply(callback, this, arguments);
375
+ } finally {
376
+ asyncEnd.publish(message);
377
+ }
378
+ });
379
+ }
380
+ Array.prototype.splice.call(callArgs, position, 1, wrappedCallback);
381
+ return this.start.runStores(message, () => {
382
+ try {
383
+ return Reflect.apply(fn, thisArg, args);
384
+ } catch (error) {
385
+ setContextValue(context, "error", error);
386
+ this.error.publish(message);
387
+ throw error;
388
+ } finally {
389
+ this.end.publish(message);
390
+ }
391
+ });
110
392
  }
111
- unsubscribe(_handlers) {
393
+ };
394
+ var inertChannel = Object.freeze({
395
+ name: "braintrust:inert",
396
+ hasSubscribers: false,
397
+ subscribe() {
398
+ },
399
+ unsubscribe() {
400
+ return false;
401
+ },
402
+ bindStore() {
403
+ },
404
+ unbindStore() {
112
405
  return false;
406
+ },
407
+ publish() {
408
+ },
409
+ runStores(_message, fn, thisArg, ...args) {
410
+ return Reflect.apply(fn, thisArg, args);
113
411
  }
114
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
115
- traceSync(fn, _message, thisArg, ...args) {
116
- return fn.apply(thisArg, args);
412
+ });
413
+ var inertTracingHook = new TracingHook({
414
+ start: inertChannel,
415
+ end: inertChannel,
416
+ asyncStart: inertChannel,
417
+ asyncEnd: inertChannel,
418
+ error: inertChannel
419
+ });
420
+ function isHookChannel(value) {
421
+ if (typeof value !== "object" && typeof value !== "function" || value === null) {
422
+ return false;
117
423
  }
118
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
119
- tracePromise(fn, _message, thisArg, ...args) {
120
- return fn.apply(thisArg, args);
424
+ try {
425
+ const channel2 = value;
426
+ return typeof channel2.hasSubscribers === "boolean" && typeof channel2.subscribe === "function" && typeof channel2.unsubscribe === "function" && typeof channel2.bindStore === "function" && typeof channel2.unbindStore === "function" && typeof channel2.publish === "function" && typeof channel2.runStores === "function";
427
+ } catch {
428
+ return false;
121
429
  }
122
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
123
- traceCallback(fn, _position, _message, thisArg, ...args) {
124
- return fn.apply(thisArg, args);
430
+ }
431
+ function hasTracingHookShape(value) {
432
+ if (typeof value !== "object" && typeof value !== "function" || value === null) {
433
+ return false;
434
+ }
435
+ try {
436
+ const hook = value;
437
+ return typeof hook.hasSubscribers === "boolean" && typeof hook.subscribe === "function" && typeof hook.unsubscribe === "function" && typeof hook.traceSync === "function" && typeof hook.tracePromise === "function" && typeof hook.traceCallback === "function" && isHookChannel(hook.start) && isHookChannel(hook.end) && isHookChannel(hook.asyncStart) && isHookChannel(hook.asyncEnd) && isHookChannel(hook.error);
438
+ } catch {
439
+ return false;
440
+ }
441
+ }
442
+ function isCompatibleTracingHook(value) {
443
+ try {
444
+ return value[hookBrand] === GLOBAL_INSTRUMENTATION_HOOKS_PROTOCOL_VERSION && hasTracingHookShape(value);
445
+ } catch {
446
+ return false;
447
+ }
448
+ }
449
+ function isCompatibleHookRegistry(value) {
450
+ try {
451
+ return value instanceof Map && value[registryBrand] === GLOBAL_INSTRUMENTATION_HOOKS_PROTOCOL_VERSION;
452
+ } catch {
453
+ return false;
454
+ }
455
+ }
456
+ function getHookRegistry() {
457
+ let descriptor;
458
+ try {
459
+ descriptor = Object.getOwnPropertyDescriptor(
460
+ globalThis,
461
+ GLOBAL_INSTRUMENTATION_HOOKS_KEY
462
+ );
463
+ } catch (error) {
464
+ reportError(error);
465
+ return void 0;
466
+ }
467
+ if (descriptor && "value" in descriptor && isCompatibleHookRegistry(descriptor.value) && (descriptor.configurable || descriptor.enumerable === false)) {
468
+ if (descriptor.configurable || descriptor.writable) {
469
+ try {
470
+ Object.defineProperty(globalThis, GLOBAL_INSTRUMENTATION_HOOKS_KEY, {
471
+ configurable: false,
472
+ enumerable: false,
473
+ value: descriptor.value,
474
+ writable: false
475
+ });
476
+ } catch (error) {
477
+ reportError(error);
478
+ return void 0;
479
+ }
480
+ }
481
+ return descriptor.value;
482
+ }
483
+ if (descriptor && !descriptor.configurable) {
484
+ reportError(new Error("Incompatible global instrumentation hook registry"));
485
+ return void 0;
486
+ }
487
+ const registry = /* @__PURE__ */ new Map();
488
+ try {
489
+ Object.defineProperty(registry, registryBrand, {
490
+ configurable: false,
491
+ enumerable: false,
492
+ value: GLOBAL_INSTRUMENTATION_HOOKS_PROTOCOL_VERSION,
493
+ writable: false
494
+ });
495
+ } catch (error) {
496
+ reportError(error);
497
+ return void 0;
498
+ }
499
+ try {
500
+ Object.defineProperty(globalThis, GLOBAL_INSTRUMENTATION_HOOKS_KEY, {
501
+ configurable: false,
502
+ enumerable: false,
503
+ value: registry,
504
+ writable: false
505
+ });
506
+ return registry;
507
+ } catch (error) {
508
+ reportError(error);
509
+ return void 0;
510
+ }
511
+ }
512
+ function newGlobalTracingChannel(nameOrChannels) {
513
+ if (typeof nameOrChannels !== "string") {
514
+ return new TracingHook(nameOrChannels);
515
+ }
516
+ const registry = getHookRegistry();
517
+ if (!registry) {
518
+ return inertTracingHook;
519
+ }
520
+ let existing;
521
+ try {
522
+ existing = Map.prototype.get.call(registry, nameOrChannels);
523
+ } catch (error) {
524
+ reportError(error);
525
+ return inertTracingHook;
526
+ }
527
+ if (isCompatibleTracingHook(existing)) {
528
+ return existing;
529
+ }
530
+ if (existing !== void 0) {
531
+ reportError(
532
+ new Error(`Invalid global instrumentation hook: ${nameOrChannels}`)
533
+ );
534
+ try {
535
+ Map.prototype.delete.call(registry, nameOrChannels);
536
+ } catch (error) {
537
+ reportError(error);
538
+ return inertTracingHook;
539
+ }
540
+ }
541
+ const hook = new TracingHook(nameOrChannels);
542
+ try {
543
+ Map.prototype.set.call(registry, nameOrChannels, hook);
544
+ } catch (error) {
545
+ reportError(error);
546
+ return inertTracingHook;
547
+ }
548
+ return hook;
549
+ }
550
+
551
+ // src/isomorph.ts
552
+ var DefaultAsyncLocalStorage = class {
553
+ constructor() {
554
+ }
555
+ enterWith(_) {
556
+ }
557
+ run(_, callback) {
558
+ return callback();
559
+ }
560
+ getStore() {
561
+ return void 0;
125
562
  }
126
563
  };
127
564
  var iso = {
@@ -134,7 +571,7 @@ var iso = {
134
571
  getCallerLocation: () => void 0,
135
572
  newAsyncLocalStorage: () => new DefaultAsyncLocalStorage(),
136
573
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
137
- newTracingChannel: (nameOrChannels) => new DefaultTracingChannel(nameOrChannels),
574
+ newTracingChannel: (nameOrChannels) => newGlobalTracingChannel(nameOrChannels),
138
575
  processOn: (_0, _1) => {
139
576
  },
140
577
  basename: (filepath) => filepath.split(/[\\/]/).pop() || filepath,
@@ -147,7 +584,8 @@ var isomorph_default = iso;
147
584
  function channel(spec) {
148
585
  return spec;
149
586
  }
150
- function defineChannels(pkg, channels) {
587
+ function defineChannels(pkg, channels, options) {
588
+ const { instrumentationName } = options;
151
589
  return Object.fromEntries(
152
590
  Object.entries(channels).map(([key, spec]) => {
153
591
  const fullChannelName = `orchestrion:${pkg}:${spec.channelName}`;
@@ -160,6 +598,7 @@ function defineChannels(pkg, channels) {
160
598
  key,
161
599
  {
162
600
  ...asyncSpec,
601
+ instrumentationName,
163
602
  tracingChannel: tracingChannel2,
164
603
  tracePromise: (fn, context) => tracingChannel2().tracePromise(
165
604
  fn,
@@ -177,6 +616,7 @@ function defineChannels(pkg, channels) {
177
616
  key,
178
617
  {
179
618
  ...syncSpec,
619
+ instrumentationName,
180
620
  tracingChannel,
181
621
  traceSync: (fn, context) => tracingChannel().traceSync(
182
622
  fn,
@@ -189,45 +629,81 @@ function defineChannels(pkg, channels) {
189
629
  );
190
630
  }
191
631
 
632
+ // src/span-origin.ts
633
+ var INSTRUMENTATION_NAMES = {
634
+ AI_SDK: "ai-sdk",
635
+ ANTHROPIC: "anthropic",
636
+ BEDROCK_RUNTIME: "bedrock-runtime",
637
+ BRAINTRUST_JS_LOGGER: "braintrust-js-logger",
638
+ CLAUDE_AGENT_SDK: "claude-agent-sdk",
639
+ CLOUDFLARE_AI_CHAT: "cloudflare-ai-chat",
640
+ CLOUDFLARE_AGENTS: "cloudflare-agents",
641
+ COHERE: "cohere",
642
+ CURSOR_SDK: "cursor-sdk",
643
+ EVE: "eve",
644
+ FLUE: "flue",
645
+ GENKIT: "genkit",
646
+ GITHUB_COPILOT: "github-copilot",
647
+ GOOGLE_ADK: "google-adk",
648
+ GOOGLE_GENAI: "google-genai",
649
+ GROQ: "groq",
650
+ HUGGINGFACE: "huggingface",
651
+ LANGCHAIN: "langchain",
652
+ LANGSMITH: "langsmith",
653
+ MASTRA: "mastra",
654
+ MISTRAL: "mistral",
655
+ OPENAI: "openai",
656
+ OPENAI_AGENTS: "openai-agents",
657
+ OPENAI_CODEX: "openai-codex",
658
+ OPENROUTER: "openrouter",
659
+ OPENROUTER_AGENT: "openrouter-agent",
660
+ PI_CODING_AGENT: "pi-coding-agent",
661
+ STRANDS_AGENT_SDK: "strands-agent-sdk"
662
+ };
663
+
192
664
  // src/instrumentation/plugins/openai-channels.ts
193
- var openAIChannels = defineChannels("openai", {
194
- chatCompletionsCreate: channel({
195
- channelName: "chat.completions.create",
196
- kind: "async"
197
- }),
198
- embeddingsCreate: channel({
199
- channelName: "embeddings.create",
200
- kind: "async"
201
- }),
202
- betaChatCompletionsParse: channel({
203
- channelName: "beta.chat.completions.parse",
204
- kind: "async"
205
- }),
206
- betaChatCompletionsStream: channel({
207
- channelName: "beta.chat.completions.stream",
208
- kind: "sync-stream"
209
- }),
210
- moderationsCreate: channel({
211
- channelName: "moderations.create",
212
- kind: "async"
213
- }),
214
- responsesCreate: channel({
215
- channelName: "responses.create",
216
- kind: "async"
217
- }),
218
- responsesStream: channel({
219
- channelName: "responses.stream",
220
- kind: "sync-stream"
221
- }),
222
- responsesParse: channel({
223
- channelName: "responses.parse",
224
- kind: "async"
225
- }),
226
- responsesCompact: channel({
227
- channelName: "responses.compact",
228
- kind: "async"
229
- })
230
- });
665
+ var openAIChannels = defineChannels(
666
+ "openai",
667
+ {
668
+ chatCompletionsCreate: channel({
669
+ channelName: "chat.completions.create",
670
+ kind: "async"
671
+ }),
672
+ embeddingsCreate: channel({
673
+ channelName: "embeddings.create",
674
+ kind: "async"
675
+ }),
676
+ betaChatCompletionsParse: channel({
677
+ channelName: "beta.chat.completions.parse",
678
+ kind: "async"
679
+ }),
680
+ betaChatCompletionsStream: channel({
681
+ channelName: "beta.chat.completions.stream",
682
+ kind: "sync-stream"
683
+ }),
684
+ moderationsCreate: channel({
685
+ channelName: "moderations.create",
686
+ kind: "async"
687
+ }),
688
+ responsesCreate: channel({
689
+ channelName: "responses.create",
690
+ kind: "async"
691
+ }),
692
+ responsesStream: channel({
693
+ channelName: "responses.stream",
694
+ kind: "sync-stream"
695
+ }),
696
+ responsesParse: channel({
697
+ channelName: "responses.parse",
698
+ kind: "async"
699
+ }),
700
+ responsesCompact: channel({
701
+ channelName: "responses.compact",
702
+ kind: "async"
703
+ })
704
+ },
705
+ { instrumentationName: INSTRUMENTATION_NAMES.OPENAI }
706
+ );
231
707
 
232
708
  // src/auto-instrumentations/configs/openai.ts
233
709
  var openaiConfigs = [
@@ -409,16 +885,20 @@ var openaiConfigs = [
409
885
  ];
410
886
 
411
887
  // src/instrumentation/plugins/openai-codex-channels.ts
412
- var openAICodexChannels = defineChannels("@openai/codex-sdk", {
413
- run: channel({
414
- channelName: "Thread.run",
415
- kind: "async"
416
- }),
417
- runStreamed: channel({
418
- channelName: "Thread.runStreamed",
419
- kind: "async"
420
- })
421
- });
888
+ var openAICodexChannels = defineChannels(
889
+ "@openai/codex-sdk",
890
+ {
891
+ run: channel({
892
+ channelName: "Thread.run",
893
+ kind: "async"
894
+ }),
895
+ runStreamed: channel({
896
+ channelName: "Thread.runStreamed",
897
+ kind: "async"
898
+ })
899
+ },
900
+ { instrumentationName: INSTRUMENTATION_NAMES.OPENAI_CODEX }
901
+ );
422
902
 
423
903
  // src/auto-instrumentations/configs/openai-codex.ts
424
904
  var openAICodexVersionRange = ">=0.128.0 <1.0.0";
@@ -452,20 +932,24 @@ var openAICodexConfigs = [
452
932
  ];
453
933
 
454
934
  // src/instrumentation/plugins/anthropic-channels.ts
455
- var anthropicChannels = defineChannels("@anthropic-ai/sdk", {
456
- messagesCreate: channel({
457
- channelName: "messages.create",
458
- kind: "async"
459
- }),
460
- betaMessagesCreate: channel({
461
- channelName: "beta.messages.create",
462
- kind: "async"
463
- }),
464
- betaMessagesToolRunner: channel({
465
- channelName: "beta.messages.toolRunner",
466
- kind: "sync-stream"
467
- })
468
- });
935
+ var anthropicChannels = defineChannels(
936
+ "@anthropic-ai/sdk",
937
+ {
938
+ messagesCreate: channel({
939
+ channelName: "messages.create",
940
+ kind: "async"
941
+ }),
942
+ betaMessagesCreate: channel({
943
+ channelName: "beta.messages.create",
944
+ kind: "async"
945
+ }),
946
+ betaMessagesToolRunner: channel({
947
+ channelName: "beta.messages.toolRunner",
948
+ kind: "sync-stream"
949
+ })
950
+ },
951
+ { instrumentationName: INSTRUMENTATION_NAMES.ANTHROPIC }
952
+ );
469
953
 
470
954
  // src/auto-instrumentations/configs/anthropic.ts
471
955
  var anthropicConfigs = [
@@ -588,15 +1072,27 @@ var clientSendChannel = channel({
588
1072
  channelName: "client.send",
589
1073
  kind: "async"
590
1074
  });
591
- var bedrockRuntimeChannels = defineChannels("aws-bedrock-runtime", {
592
- clientSend: clientSendChannel
593
- });
594
- var smithyCoreChannels = defineChannels("@smithy/core", {
595
- clientSend: clientSendChannel
596
- });
597
- var smithyClientChannels = defineChannels("@smithy/smithy-client", {
598
- clientSend: clientSendChannel
599
- });
1075
+ var bedrockRuntimeChannels = defineChannels(
1076
+ "aws-bedrock-runtime",
1077
+ {
1078
+ clientSend: clientSendChannel
1079
+ },
1080
+ { instrumentationName: INSTRUMENTATION_NAMES.BEDROCK_RUNTIME }
1081
+ );
1082
+ var smithyCoreChannels = defineChannels(
1083
+ "@smithy/core",
1084
+ {
1085
+ clientSend: clientSendChannel
1086
+ },
1087
+ { instrumentationName: INSTRUMENTATION_NAMES.BEDROCK_RUNTIME }
1088
+ );
1089
+ var smithyClientChannels = defineChannels(
1090
+ "@smithy/smithy-client",
1091
+ {
1092
+ clientSend: clientSendChannel
1093
+ },
1094
+ { instrumentationName: INSTRUMENTATION_NAMES.BEDROCK_RUNTIME }
1095
+ );
600
1096
 
601
1097
  // src/auto-instrumentations/configs/bedrock-runtime.ts
602
1098
  var bedrockRuntimeConfigs = [
@@ -655,92 +1151,102 @@ var bedrockRuntimeConfigs = [
655
1151
  ];
656
1152
 
657
1153
  // src/instrumentation/plugins/ai-sdk-channels.ts
658
- var aiSDKChannels = defineChannels("ai", {
659
- generateText: channel({
660
- channelName: "generateText",
661
- kind: "async"
662
- }),
663
- streamText: channel({
664
- channelName: "streamText",
665
- kind: "async"
666
- }),
667
- streamTextSync: channel({
668
- channelName: "streamText.sync",
669
- kind: "sync-stream"
670
- }),
671
- generateObject: channel({
672
- channelName: "generateObject",
673
- kind: "async"
674
- }),
675
- streamObject: channel({
676
- channelName: "streamObject",
677
- kind: "async"
678
- }),
679
- streamObjectSync: channel({
680
- channelName: "streamObject.sync",
681
- kind: "sync-stream"
682
- }),
683
- embed: channel(
684
- {
1154
+ var aiSDKChannels = defineChannels(
1155
+ "ai",
1156
+ {
1157
+ generateText: channel({
1158
+ channelName: "generateText",
1159
+ kind: "async"
1160
+ }),
1161
+ streamText: channel({
1162
+ channelName: "streamText",
1163
+ kind: "async"
1164
+ }),
1165
+ streamTextSync: channel({
1166
+ channelName: "streamText.sync",
1167
+ kind: "sync-stream"
1168
+ }),
1169
+ generateObject: channel({
1170
+ channelName: "generateObject",
1171
+ kind: "async"
1172
+ }),
1173
+ streamObject: channel({
1174
+ channelName: "streamObject",
1175
+ kind: "async"
1176
+ }),
1177
+ streamObjectSync: channel({
1178
+ channelName: "streamObject.sync",
1179
+ kind: "sync-stream"
1180
+ }),
1181
+ embed: channel({
685
1182
  channelName: "embed",
686
1183
  kind: "async"
687
- }
688
- ),
689
- embedMany: channel({
690
- channelName: "embedMany",
691
- kind: "async"
692
- }),
693
- rerank: channel({
694
- channelName: "rerank",
695
- kind: "async"
696
- }),
697
- agentGenerate: channel({
698
- channelName: "Agent.generate",
699
- kind: "async"
700
- }),
701
- agentStream: channel({
702
- channelName: "Agent.stream",
703
- kind: "async"
704
- }),
705
- agentStreamSync: channel({
706
- channelName: "Agent.stream.sync",
707
- kind: "sync-stream"
708
- }),
709
- toolLoopAgentGenerate: channel({
710
- channelName: "ToolLoopAgent.generate",
711
- kind: "async"
712
- }),
713
- toolLoopAgentStream: channel({
714
- channelName: "ToolLoopAgent.stream",
715
- kind: "async"
716
- }),
717
- workflowAgentStream: channel({
718
- channelName: "WorkflowAgent.stream",
719
- kind: "async"
720
- }),
721
- v7CreateTelemetryDispatcher: channel({
722
- channelName: "createTelemetryDispatcher",
723
- kind: "sync-stream"
724
- })
725
- });
726
- var harnessAgentChannels = defineChannels("@ai-sdk/harness", {
727
- generate: channel({
728
- channelName: "HarnessAgent.generate",
729
- kind: "async"
730
- }),
731
- stream: channel({
732
- channelName: "HarnessAgent.stream",
733
- kind: "async"
734
- }),
735
- continueGenerate: channel({
736
- channelName: "HarnessAgent.continueGenerate",
737
- kind: "async"
738
- }),
739
- continueStream: channel({
740
- channelName: "HarnessAgent.continueStream",
741
- kind: "async"
742
- })
743
- });
1184
+ }),
1185
+ embedMany: channel({
1186
+ channelName: "embedMany",
1187
+ kind: "async"
1188
+ }),
1189
+ rerank: channel({
1190
+ channelName: "rerank",
1191
+ kind: "async"
1192
+ }),
1193
+ agentGenerate: channel({
1194
+ channelName: "Agent.generate",
1195
+ kind: "async"
1196
+ }),
1197
+ agentStream: channel({
1198
+ channelName: "Agent.stream",
1199
+ kind: "async"
1200
+ }),
1201
+ agentStreamSync: channel({
1202
+ channelName: "Agent.stream.sync",
1203
+ kind: "sync-stream"
1204
+ }),
1205
+ toolLoopAgentGenerate: channel({
1206
+ channelName: "ToolLoopAgent.generate",
1207
+ kind: "async"
1208
+ }),
1209
+ toolLoopAgentStream: channel({
1210
+ channelName: "ToolLoopAgent.stream",
1211
+ kind: "async"
1212
+ }),
1213
+ workflowAgentStream: channel({
1214
+ channelName: "WorkflowAgent.stream",
1215
+ kind: "async"
1216
+ }),
1217
+ v7CreateTelemetryDispatcher: channel({
1218
+ channelName: "createTelemetryDispatcher",
1219
+ kind: "sync-stream"
1220
+ })
1221
+ },
1222
+ { instrumentationName: INSTRUMENTATION_NAMES.AI_SDK }
1223
+ );
1224
+ var harnessAgentChannels = defineChannels(
1225
+ "@ai-sdk/harness",
1226
+ {
1227
+ createSession: channel({
1228
+ channelName: "HarnessAgent.createSession",
1229
+ kind: "async"
1230
+ }),
1231
+ generate: channel({
1232
+ channelName: "HarnessAgent.generate",
1233
+ kind: "async"
1234
+ }),
1235
+ stream: channel({
1236
+ channelName: "HarnessAgent.stream",
1237
+ kind: "async"
1238
+ }),
1239
+ continueGenerate: channel({
1240
+ channelName: "HarnessAgent.continueGenerate",
1241
+ kind: "async"
1242
+ }),
1243
+ continueStream: channel({
1244
+ channelName: "HarnessAgent.continueStream",
1245
+ kind: "async"
1246
+ })
1247
+ },
1248
+ { instrumentationName: INSTRUMENTATION_NAMES.AI_SDK }
1249
+ );
744
1250
 
745
1251
  // src/auto-instrumentations/configs/ai-sdk.ts
746
1252
  var aiSDKConfigs = [
@@ -748,6 +1254,7 @@ var aiSDKConfigs = [
748
1254
  // `./agent` entrypoint. The compiled class expression is anonymous, so match
749
1255
  // the first async method with each public name instead of a class name.
750
1256
  ...[
1257
+ ["createSession", harnessAgentChannels.createSession.channelName],
751
1258
  ["generate", harnessAgentChannels.generate.channelName],
752
1259
  ["stream", harnessAgentChannels.stream.channelName],
753
1260
  ["continueGenerate", harnessAgentChannels.continueGenerate.channelName],
@@ -1143,7 +1650,8 @@ var claudeAgentSDKChannels = defineChannels(
1143
1650
  channelName: "query",
1144
1651
  kind: "sync-stream"
1145
1652
  })
1146
- }
1653
+ },
1654
+ { instrumentationName: INSTRUMENTATION_NAMES.CLAUDE_AGENT_SDK }
1147
1655
  );
1148
1656
 
1149
1657
  // src/auto-instrumentations/configs/claude-agent-sdk.ts
@@ -1177,25 +1685,59 @@ var claudeAgentSDKConfigs = [
1177
1685
  }
1178
1686
  ];
1179
1687
 
1688
+ // src/instrumentation/plugins/cloudflare-agents-channels.ts
1689
+ var cloudflareAgentsChannels = defineChannels(
1690
+ "agents",
1691
+ {
1692
+ runAgentTool: channel({
1693
+ channelName: "Agent.runAgentTool",
1694
+ kind: "async"
1695
+ })
1696
+ },
1697
+ { instrumentationName: INSTRUMENTATION_NAMES.CLOUDFLARE_AGENTS }
1698
+ );
1699
+
1700
+ // src/auto-instrumentations/configs/cloudflare-agents.ts
1701
+ var cloudflareAgentsVersionRange = ">=0.17.0 <0.18.0";
1702
+ var cloudflareAgentsConfigs = [
1703
+ {
1704
+ channelName: cloudflareAgentsChannels.runAgentTool.channelName,
1705
+ module: {
1706
+ name: "agents",
1707
+ versionRange: cloudflareAgentsVersionRange,
1708
+ filePath: "dist/index.js"
1709
+ },
1710
+ functionQuery: {
1711
+ className: "Agent",
1712
+ methodName: "runAgentTool",
1713
+ kind: "Async"
1714
+ }
1715
+ }
1716
+ ];
1717
+
1180
1718
  // src/instrumentation/plugins/cursor-sdk-channels.ts
1181
- var cursorSDKChannels = defineChannels("@cursor/sdk", {
1182
- create: channel({
1183
- channelName: "Agent.create",
1184
- kind: "async"
1185
- }),
1186
- resume: channel({
1187
- channelName: "Agent.resume",
1188
- kind: "async"
1189
- }),
1190
- prompt: channel({
1191
- channelName: "Agent.prompt",
1192
- kind: "async"
1193
- }),
1194
- send: channel({
1195
- channelName: "agent.send",
1196
- kind: "async"
1197
- })
1198
- });
1719
+ var cursorSDKChannels = defineChannels(
1720
+ "@cursor/sdk",
1721
+ {
1722
+ create: channel({
1723
+ channelName: "Agent.create",
1724
+ kind: "async"
1725
+ }),
1726
+ resume: channel({
1727
+ channelName: "Agent.resume",
1728
+ kind: "async"
1729
+ }),
1730
+ prompt: channel({
1731
+ channelName: "Agent.prompt",
1732
+ kind: "async"
1733
+ }),
1734
+ send: channel({
1735
+ channelName: "agent.send",
1736
+ kind: "async"
1737
+ })
1738
+ },
1739
+ { instrumentationName: INSTRUMENTATION_NAMES.CURSOR_SDK }
1740
+ );
1199
1741
 
1200
1742
  // src/auto-instrumentations/configs/cursor-sdk.ts
1201
1743
  var cursorSDKVersionRange = ">=1.0.7 <2.0.0";
@@ -1243,24 +1785,28 @@ var cursorSDKConfigs = cursorSDKEntrypoints.flatMap((filePath) => [
1243
1785
  ]);
1244
1786
 
1245
1787
  // src/instrumentation/plugins/openai-agents-channels.ts
1246
- var openAIAgentsCoreChannels = defineChannels("@openai/agents-core", {
1247
- onTraceStart: channel({
1248
- channelName: "tracing.processor.onTraceStart",
1249
- kind: "async"
1250
- }),
1251
- onTraceEnd: channel({
1252
- channelName: "tracing.processor.onTraceEnd",
1253
- kind: "async"
1254
- }),
1255
- onSpanStart: channel({
1256
- channelName: "tracing.processor.onSpanStart",
1257
- kind: "async"
1258
- }),
1259
- onSpanEnd: channel({
1260
- channelName: "tracing.processor.onSpanEnd",
1261
- kind: "async"
1262
- })
1263
- });
1788
+ var openAIAgentsCoreChannels = defineChannels(
1789
+ "@openai/agents-core",
1790
+ {
1791
+ onTraceStart: channel({
1792
+ channelName: "tracing.processor.onTraceStart",
1793
+ kind: "async"
1794
+ }),
1795
+ onTraceEnd: channel({
1796
+ channelName: "tracing.processor.onTraceEnd",
1797
+ kind: "async"
1798
+ }),
1799
+ onSpanStart: channel({
1800
+ channelName: "tracing.processor.onSpanStart",
1801
+ kind: "async"
1802
+ }),
1803
+ onSpanEnd: channel({
1804
+ channelName: "tracing.processor.onSpanEnd",
1805
+ kind: "async"
1806
+ })
1807
+ },
1808
+ { instrumentationName: INSTRUMENTATION_NAMES.OPENAI_AGENTS }
1809
+ );
1264
1810
 
1265
1811
  // src/auto-instrumentations/configs/openai-agents.ts
1266
1812
  var lifecycleMethods = [
@@ -1288,24 +1834,28 @@ var openAIAgentsCoreConfigs = lifecycleMethods.flatMap(
1288
1834
  );
1289
1835
 
1290
1836
  // src/instrumentation/plugins/google-genai-channels.ts
1291
- var googleGenAIChannels = defineChannels("@google/genai", {
1292
- generateContent: channel({
1293
- channelName: "models.generateContent",
1294
- kind: "async"
1295
- }),
1296
- generateContentStream: channel({
1297
- channelName: "models.generateContentStream",
1298
- kind: "async"
1299
- }),
1300
- embedContent: channel({
1301
- channelName: "models.embedContent",
1302
- kind: "async"
1303
- }),
1304
- interactionsCreate: channel({
1305
- channelName: "interactions.create",
1306
- kind: "async"
1307
- })
1308
- });
1837
+ var googleGenAIChannels = defineChannels(
1838
+ "@google/genai",
1839
+ {
1840
+ generateContent: channel({
1841
+ channelName: "models.generateContent",
1842
+ kind: "async"
1843
+ }),
1844
+ generateContentStream: channel({
1845
+ channelName: "models.generateContentStream",
1846
+ kind: "async"
1847
+ }),
1848
+ embedContent: channel({
1849
+ channelName: "models.embedContent",
1850
+ kind: "async"
1851
+ }),
1852
+ interactionsCreate: channel({
1853
+ channelName: "interactions.create",
1854
+ kind: "async"
1855
+ })
1856
+ },
1857
+ { instrumentationName: INSTRUMENTATION_NAMES.GOOGLE_GENAI }
1858
+ );
1309
1859
 
1310
1860
  // src/auto-instrumentations/configs/google-genai.ts
1311
1861
  var googleGenAIConfigs = [
@@ -1385,28 +1935,32 @@ var googleGenAIConfigs = [
1385
1935
  ];
1386
1936
 
1387
1937
  // src/instrumentation/plugins/huggingface-channels.ts
1388
- var huggingFaceChannels = defineChannels("@huggingface/inference", {
1389
- chatCompletion: channel({
1390
- channelName: "chatCompletion",
1391
- kind: "async"
1392
- }),
1393
- chatCompletionStream: channel({
1394
- channelName: "chatCompletionStream",
1395
- kind: "sync-stream"
1396
- }),
1397
- textGeneration: channel({
1398
- channelName: "textGeneration",
1399
- kind: "async"
1400
- }),
1401
- textGenerationStream: channel({
1402
- channelName: "textGenerationStream",
1403
- kind: "sync-stream"
1404
- }),
1405
- featureExtraction: channel({
1406
- channelName: "featureExtraction",
1407
- kind: "async"
1408
- })
1409
- });
1938
+ var huggingFaceChannels = defineChannels(
1939
+ "@huggingface/inference",
1940
+ {
1941
+ chatCompletion: channel({
1942
+ channelName: "chatCompletion",
1943
+ kind: "async"
1944
+ }),
1945
+ chatCompletionStream: channel({
1946
+ channelName: "chatCompletionStream",
1947
+ kind: "sync-stream"
1948
+ }),
1949
+ textGeneration: channel({
1950
+ channelName: "textGeneration",
1951
+ kind: "async"
1952
+ }),
1953
+ textGenerationStream: channel({
1954
+ channelName: "textGenerationStream",
1955
+ kind: "sync-stream"
1956
+ }),
1957
+ featureExtraction: channel({
1958
+ channelName: "featureExtraction",
1959
+ kind: "async"
1960
+ })
1961
+ },
1962
+ { instrumentationName: INSTRUMENTATION_NAMES.HUGGINGFACE }
1963
+ );
1410
1964
 
1411
1965
  // src/auto-instrumentations/configs/huggingface.ts
1412
1966
  var huggingFaceConfigs = [
@@ -1653,20 +2207,24 @@ var huggingFaceConfigs = [
1653
2207
  ];
1654
2208
 
1655
2209
  // src/instrumentation/plugins/openrouter-agent-channels.ts
1656
- var openRouterAgentChannels = defineChannels("@openrouter/agent", {
1657
- callModel: channel({
1658
- channelName: "callModel",
1659
- kind: "sync-stream"
1660
- }),
1661
- callModelTurn: channel({
1662
- channelName: "callModel.turn",
1663
- kind: "async"
1664
- }),
1665
- toolExecute: channel({
1666
- channelName: "tool.execute",
1667
- kind: "async"
1668
- })
1669
- });
2210
+ var openRouterAgentChannels = defineChannels(
2211
+ "@openrouter/agent",
2212
+ {
2213
+ callModel: channel({
2214
+ channelName: "callModel",
2215
+ kind: "sync-stream"
2216
+ }),
2217
+ callModelTurn: channel({
2218
+ channelName: "callModel.turn",
2219
+ kind: "async"
2220
+ }),
2221
+ toolExecute: channel({
2222
+ channelName: "tool.execute",
2223
+ kind: "async"
2224
+ })
2225
+ },
2226
+ { instrumentationName: INSTRUMENTATION_NAMES.OPENROUTER_AGENT }
2227
+ );
1670
2228
 
1671
2229
  // src/auto-instrumentations/configs/openrouter-agent.ts
1672
2230
  var openRouterAgentConfigs = [
@@ -1685,38 +2243,40 @@ var openRouterAgentConfigs = [
1685
2243
  ];
1686
2244
 
1687
2245
  // src/instrumentation/plugins/openrouter-channels.ts
1688
- var openRouterChannels = defineChannels("@openrouter/sdk", {
1689
- chatSend: channel({
1690
- channelName: "chat.send",
1691
- kind: "async"
1692
- }),
1693
- embeddingsGenerate: channel({
1694
- channelName: "embeddings.generate",
1695
- kind: "async"
1696
- }),
1697
- rerankRerank: channel(
1698
- {
2246
+ var openRouterChannels = defineChannels(
2247
+ "@openrouter/sdk",
2248
+ {
2249
+ chatSend: channel({
2250
+ channelName: "chat.send",
2251
+ kind: "async"
2252
+ }),
2253
+ embeddingsGenerate: channel({
2254
+ channelName: "embeddings.generate",
2255
+ kind: "async"
2256
+ }),
2257
+ rerankRerank: channel({
1699
2258
  channelName: "rerank.rerank",
1700
2259
  kind: "async"
1701
- }
1702
- ),
1703
- betaResponsesSend: channel({
1704
- channelName: "beta.responses.send",
1705
- kind: "async"
1706
- }),
1707
- callModel: channel({
1708
- channelName: "callModel",
1709
- kind: "sync-stream"
1710
- }),
1711
- callModelTurn: channel({
1712
- channelName: "callModel.turn",
1713
- kind: "async"
1714
- }),
1715
- toolExecute: channel({
1716
- channelName: "tool.execute",
1717
- kind: "async"
1718
- })
1719
- });
2260
+ }),
2261
+ betaResponsesSend: channel({
2262
+ channelName: "beta.responses.send",
2263
+ kind: "async"
2264
+ }),
2265
+ callModel: channel({
2266
+ channelName: "callModel",
2267
+ kind: "sync-stream"
2268
+ }),
2269
+ callModelTurn: channel({
2270
+ channelName: "callModel.turn",
2271
+ kind: "async"
2272
+ }),
2273
+ toolExecute: channel({
2274
+ channelName: "tool.execute",
2275
+ kind: "async"
2276
+ })
2277
+ },
2278
+ { instrumentationName: INSTRUMENTATION_NAMES.OPENROUTER }
2279
+ );
1720
2280
 
1721
2281
  // src/auto-instrumentations/configs/openrouter.ts
1722
2282
  var openRouterConfigs = [
@@ -1724,7 +2284,7 @@ var openRouterConfigs = [
1724
2284
  channelName: openRouterChannels.chatSend.channelName,
1725
2285
  module: {
1726
2286
  name: "@openrouter/sdk",
1727
- versionRange: ">=0.9.11 <1.0.0",
2287
+ versionRange: ">=0.9.11 <2.0.0",
1728
2288
  filePath: "esm/sdk/chat.js"
1729
2289
  },
1730
2290
  functionQuery: {
@@ -1737,7 +2297,7 @@ var openRouterConfigs = [
1737
2297
  channelName: openRouterChannels.embeddingsGenerate.channelName,
1738
2298
  module: {
1739
2299
  name: "@openrouter/sdk",
1740
- versionRange: ">=0.9.11 <1.0.0",
2300
+ versionRange: ">=0.9.11 <2.0.0",
1741
2301
  filePath: "esm/sdk/embeddings.js"
1742
2302
  },
1743
2303
  functionQuery: {
@@ -1750,7 +2310,7 @@ var openRouterConfigs = [
1750
2310
  channelName: openRouterChannels.rerankRerank.channelName,
1751
2311
  module: {
1752
2312
  name: "@openrouter/sdk",
1753
- versionRange: ">=0.12.0 <1.0.0",
2313
+ versionRange: ">=0.12.0 <2.0.0",
1754
2314
  filePath: "esm/sdk/rerank.js"
1755
2315
  },
1756
2316
  functionQuery: {
@@ -1763,7 +2323,7 @@ var openRouterConfigs = [
1763
2323
  channelName: openRouterChannels.betaResponsesSend.channelName,
1764
2324
  module: {
1765
2325
  name: "@openrouter/sdk",
1766
- versionRange: ">=0.9.11 <1.0.0",
2326
+ versionRange: ">=0.9.11 <2.0.0",
1767
2327
  filePath: "esm/sdk/responses.js"
1768
2328
  },
1769
2329
  functionQuery: {
@@ -1776,7 +2336,7 @@ var openRouterConfigs = [
1776
2336
  channelName: openRouterChannels.callModel.channelName,
1777
2337
  module: {
1778
2338
  name: "@openrouter/sdk",
1779
- versionRange: ">=0.9.11 <1.0.0",
2339
+ versionRange: ">=0.9.11 <2.0.0",
1780
2340
  filePath: "esm/sdk/sdk.js"
1781
2341
  },
1782
2342
  functionQuery: {
@@ -1788,52 +2348,56 @@ var openRouterConfigs = [
1788
2348
  ];
1789
2349
 
1790
2350
  // src/instrumentation/plugins/mistral-channels.ts
1791
- var mistralChannels = defineChannels("@mistralai/mistralai", {
1792
- chatComplete: channel({
1793
- channelName: "chat.complete",
1794
- kind: "async"
1795
- }),
1796
- chatStream: channel({
1797
- channelName: "chat.stream",
1798
- kind: "async"
1799
- }),
1800
- embeddingsCreate: channel({
1801
- channelName: "embeddings.create",
1802
- kind: "async"
1803
- }),
1804
- classifiersModerate: channel({
1805
- channelName: "classifiers.moderate",
1806
- kind: "async"
1807
- }),
1808
- classifiersModerateChat: channel({
1809
- channelName: "classifiers.moderateChat",
1810
- kind: "async"
1811
- }),
1812
- classifiersClassify: channel({
1813
- channelName: "classifiers.classify",
1814
- kind: "async"
1815
- }),
1816
- classifiersClassifyChat: channel({
1817
- channelName: "classifiers.classifyChat",
1818
- kind: "async"
1819
- }),
1820
- fimComplete: channel({
1821
- channelName: "fim.complete",
1822
- kind: "async"
1823
- }),
1824
- fimStream: channel({
1825
- channelName: "fim.stream",
1826
- kind: "async"
1827
- }),
1828
- agentsComplete: channel({
1829
- channelName: "agents.complete",
1830
- kind: "async"
1831
- }),
1832
- agentsStream: channel({
1833
- channelName: "agents.stream",
1834
- kind: "async"
1835
- })
1836
- });
2351
+ var mistralChannels = defineChannels(
2352
+ "@mistralai/mistralai",
2353
+ {
2354
+ chatComplete: channel({
2355
+ channelName: "chat.complete",
2356
+ kind: "async"
2357
+ }),
2358
+ chatStream: channel({
2359
+ channelName: "chat.stream",
2360
+ kind: "async"
2361
+ }),
2362
+ embeddingsCreate: channel({
2363
+ channelName: "embeddings.create",
2364
+ kind: "async"
2365
+ }),
2366
+ classifiersModerate: channel({
2367
+ channelName: "classifiers.moderate",
2368
+ kind: "async"
2369
+ }),
2370
+ classifiersModerateChat: channel({
2371
+ channelName: "classifiers.moderateChat",
2372
+ kind: "async"
2373
+ }),
2374
+ classifiersClassify: channel({
2375
+ channelName: "classifiers.classify",
2376
+ kind: "async"
2377
+ }),
2378
+ classifiersClassifyChat: channel({
2379
+ channelName: "classifiers.classifyChat",
2380
+ kind: "async"
2381
+ }),
2382
+ fimComplete: channel({
2383
+ channelName: "fim.complete",
2384
+ kind: "async"
2385
+ }),
2386
+ fimStream: channel({
2387
+ channelName: "fim.stream",
2388
+ kind: "async"
2389
+ }),
2390
+ agentsComplete: channel({
2391
+ channelName: "agents.complete",
2392
+ kind: "async"
2393
+ }),
2394
+ agentsStream: channel({
2395
+ channelName: "agents.stream",
2396
+ kind: "async"
2397
+ })
2398
+ },
2399
+ { instrumentationName: INSTRUMENTATION_NAMES.MISTRAL }
2400
+ );
1837
2401
 
1838
2402
  // src/auto-instrumentations/configs/mistral.ts
1839
2403
  var mistralConfigs = [
@@ -2126,20 +2690,24 @@ var mistralConfigs = [
2126
2690
  ];
2127
2691
 
2128
2692
  // src/instrumentation/plugins/google-adk-channels.ts
2129
- var googleADKChannels = defineChannels("@google/adk", {
2130
- runnerRunAsync: channel({
2131
- channelName: "runner.runAsync",
2132
- kind: "sync-stream"
2133
- }),
2134
- agentRunAsync: channel({
2135
- channelName: "agent.runAsync",
2136
- kind: "sync-stream"
2137
- }),
2138
- toolRunAsync: channel({
2139
- channelName: "tool.runAsync",
2140
- kind: "async"
2141
- })
2142
- });
2693
+ var googleADKChannels = defineChannels(
2694
+ "@google/adk",
2695
+ {
2696
+ runnerRunAsync: channel({
2697
+ channelName: "runner.runAsync",
2698
+ kind: "sync-stream"
2699
+ }),
2700
+ agentRunAsync: channel({
2701
+ channelName: "agent.runAsync",
2702
+ kind: "sync-stream"
2703
+ }),
2704
+ toolRunAsync: channel({
2705
+ channelName: "tool.runAsync",
2706
+ kind: "async"
2707
+ })
2708
+ },
2709
+ { instrumentationName: INSTRUMENTATION_NAMES.GOOGLE_ADK }
2710
+ );
2143
2711
 
2144
2712
  // src/auto-instrumentations/configs/google-adk.ts
2145
2713
  var googleADKVersionRange = ">=0.1.0";
@@ -2369,25 +2937,67 @@ var googleADKConfigs = [
2369
2937
  }
2370
2938
  ];
2371
2939
 
2940
+ // src/instrumentation/plugins/cloudflare-ai-chat-channels.ts
2941
+ var cloudflareAIChatChannels = defineChannels(
2942
+ "@cloudflare/ai-chat",
2943
+ {
2944
+ runExclusiveChatTurn: channel({
2945
+ channelName: "AIChatAgent._runExclusiveChatTurn",
2946
+ kind: "async"
2947
+ }),
2948
+ onChatResponse: channel({
2949
+ channelName: "AIChatAgent.onChatResponse",
2950
+ kind: "sync-stream"
2951
+ })
2952
+ },
2953
+ { instrumentationName: INSTRUMENTATION_NAMES.CLOUDFLARE_AI_CHAT }
2954
+ );
2955
+
2956
+ // src/auto-instrumentations/configs/cloudflare-ai-chat.ts
2957
+ var cloudflareAIChatVersionRange = ">=0.9.0 <0.10.0";
2958
+ var cloudflareAIChatConfigs = [
2959
+ {
2960
+ // AIChatAgent subclasses replace onChatMessage, so there is no stable
2961
+ // public implementation for the transformer to target. This runner is
2962
+ // the narrowest shared boundary around every chat turn; keep the version
2963
+ // range tight because it is an internal method.
2964
+ channelName: cloudflareAIChatChannels.runExclusiveChatTurn.channelName,
2965
+ module: {
2966
+ name: "@cloudflare/ai-chat",
2967
+ versionRange: cloudflareAIChatVersionRange,
2968
+ filePath: "dist/index.js"
2969
+ },
2970
+ functionQuery: {
2971
+ className: "AIChatAgent",
2972
+ methodName: "_runExclusiveChatTurn",
2973
+ kind: "Async"
2974
+ }
2975
+ }
2976
+ ];
2977
+
2372
2978
  // src/instrumentation/plugins/cohere-channels.ts
2373
- var cohereChannels = defineChannels("cohere-ai", {
2374
- chat: channel({
2375
- channelName: "chat",
2376
- kind: "async"
2377
- }),
2378
- chatStream: channel({
2379
- channelName: "chatStream",
2380
- kind: "async"
2381
- }),
2382
- embed: channel({
2383
- channelName: "embed",
2384
- kind: "async"
2385
- }),
2386
- rerank: channel({
2387
- channelName: "rerank",
2388
- kind: "async"
2389
- })
2390
- });
2979
+ var cohereChannels = defineChannels(
2980
+ "cohere-ai",
2981
+ {
2982
+ chat: channel({
2983
+ channelName: "chat",
2984
+ kind: "async"
2985
+ }),
2986
+ chatStream: channel({
2987
+ channelName: "chatStream",
2988
+ kind: "async"
2989
+ }),
2990
+ embed: channel({
2991
+ channelName: "embed",
2992
+ kind: "async"
2993
+ }),
2994
+ rerank: channel({
2995
+ channelName: "rerank",
2996
+ kind: "async"
2997
+ })
2998
+ },
2999
+ { instrumentationName: INSTRUMENTATION_NAMES.COHERE }
3000
+ );
2391
3001
 
2392
3002
  // src/auto-instrumentations/configs/cohere.ts
2393
3003
  var cohereConfigs = [
@@ -2654,18 +3264,20 @@ var cohereConfigs = [
2654
3264
  ];
2655
3265
 
2656
3266
  // src/instrumentation/plugins/groq-channels.ts
2657
- var groqChannels = defineChannels("groq-sdk", {
2658
- chatCompletionsCreate: channel({
2659
- channelName: "chat.completions.create",
2660
- kind: "async"
2661
- }),
2662
- embeddingsCreate: channel(
2663
- {
3267
+ var groqChannels = defineChannels(
3268
+ "groq-sdk",
3269
+ {
3270
+ chatCompletionsCreate: channel({
3271
+ channelName: "chat.completions.create",
3272
+ kind: "async"
3273
+ }),
3274
+ embeddingsCreate: channel({
2664
3275
  channelName: "embeddings.create",
2665
3276
  kind: "async"
2666
- }
2667
- )
2668
- });
3277
+ })
3278
+ },
3279
+ { instrumentationName: INSTRUMENTATION_NAMES.GROQ }
3280
+ );
2669
3281
 
2670
3282
  // src/auto-instrumentations/configs/groq.ts
2671
3283
  var groqConfigs = [
@@ -2698,38 +3310,46 @@ var groqConfigs = [
2698
3310
  ];
2699
3311
 
2700
3312
  // src/instrumentation/plugins/genkit-channels.ts
2701
- var genkitChannels = defineChannels("@genkit-ai/ai", {
2702
- generate: channel({
2703
- channelName: "generate",
2704
- kind: "async"
2705
- }),
2706
- generateStream: channel({
2707
- channelName: "generateStream",
2708
- kind: "sync-stream"
2709
- }),
2710
- embed: channel({
2711
- channelName: "embed",
2712
- kind: "async"
2713
- }),
2714
- embedMany: channel({
2715
- channelName: "embedMany",
2716
- kind: "async"
2717
- }),
2718
- actionRun: channel({
2719
- channelName: "action.run",
2720
- kind: "async"
2721
- }),
2722
- actionStream: channel({
2723
- channelName: "action.stream",
2724
- kind: "sync-stream"
2725
- })
2726
- });
2727
- var genkitCoreChannels = defineChannels("@genkit-ai/core", {
2728
- actionSpan: channel({
2729
- channelName: "action.span",
2730
- kind: "async"
2731
- })
2732
- });
3313
+ var genkitChannels = defineChannels(
3314
+ "@genkit-ai/ai",
3315
+ {
3316
+ generate: channel({
3317
+ channelName: "generate",
3318
+ kind: "async"
3319
+ }),
3320
+ generateStream: channel({
3321
+ channelName: "generateStream",
3322
+ kind: "sync-stream"
3323
+ }),
3324
+ embed: channel({
3325
+ channelName: "embed",
3326
+ kind: "async"
3327
+ }),
3328
+ embedMany: channel({
3329
+ channelName: "embedMany",
3330
+ kind: "async"
3331
+ }),
3332
+ actionRun: channel({
3333
+ channelName: "action.run",
3334
+ kind: "async"
3335
+ }),
3336
+ actionStream: channel({
3337
+ channelName: "action.stream",
3338
+ kind: "sync-stream"
3339
+ })
3340
+ },
3341
+ { instrumentationName: INSTRUMENTATION_NAMES.GENKIT }
3342
+ );
3343
+ var genkitCoreChannels = defineChannels(
3344
+ "@genkit-ai/core",
3345
+ {
3346
+ actionSpan: channel({
3347
+ channelName: "action.span",
3348
+ kind: "async"
3349
+ })
3350
+ },
3351
+ { instrumentationName: INSTRUMENTATION_NAMES.GENKIT }
3352
+ );
2733
3353
 
2734
3354
  // src/auto-instrumentations/configs/genkit.ts
2735
3355
  var genkitVersionRange = ">=1.0.0 <2.0.0";
@@ -2891,20 +3511,24 @@ var genkitConfigs = [
2891
3511
  ];
2892
3512
 
2893
3513
  // src/instrumentation/plugins/github-copilot-channels.ts
2894
- var gitHubCopilotChannels = defineChannels("@github/copilot-sdk", {
2895
- createSession: channel({
2896
- channelName: "client.createSession",
2897
- kind: "async"
2898
- }),
2899
- resumeSession: channel({
2900
- channelName: "client.resumeSession",
2901
- kind: "async"
2902
- }),
2903
- sendAndWait: channel({
2904
- channelName: "session.sendAndWait",
2905
- kind: "async"
2906
- })
2907
- });
3514
+ var gitHubCopilotChannels = defineChannels(
3515
+ "@github/copilot-sdk",
3516
+ {
3517
+ createSession: channel({
3518
+ channelName: "client.createSession",
3519
+ kind: "async"
3520
+ }),
3521
+ resumeSession: channel({
3522
+ channelName: "client.resumeSession",
3523
+ kind: "async"
3524
+ }),
3525
+ sendAndWait: channel({
3526
+ channelName: "session.sendAndWait",
3527
+ kind: "async"
3528
+ })
3529
+ },
3530
+ { instrumentationName: INSTRUMENTATION_NAMES.GITHUB_COPILOT }
3531
+ );
2908
3532
 
2909
3533
  // src/auto-instrumentations/configs/github-copilot.ts
2910
3534
  var gitHubCopilotConfigs = [
@@ -2995,16 +3619,20 @@ var gitHubCopilotConfigs = [
2995
3619
  ];
2996
3620
 
2997
3621
  // src/instrumentation/plugins/langchain-channels.ts
2998
- var langChainChannels = defineChannels("@langchain/core", {
2999
- configure: channel({
3000
- channelName: "CallbackManager.configure",
3001
- kind: "sync-stream"
3002
- }),
3003
- configureSync: channel({
3004
- channelName: "CallbackManager._configureSync",
3005
- kind: "sync-stream"
3006
- })
3007
- });
3622
+ var langChainChannels = defineChannels(
3623
+ "@langchain/core",
3624
+ {
3625
+ configure: channel({
3626
+ channelName: "CallbackManager.configure",
3627
+ kind: "sync-stream"
3628
+ }),
3629
+ configureSync: channel({
3630
+ channelName: "CallbackManager._configureSync",
3631
+ kind: "sync-stream"
3632
+ })
3633
+ },
3634
+ { instrumentationName: INSTRUMENTATION_NAMES.LANGCHAIN }
3635
+ );
3008
3636
 
3009
3637
  // src/auto-instrumentations/configs/langchain.ts
3010
3638
  var langChainCoreVersionRange = ">=0.3.42";
@@ -3039,20 +3667,24 @@ var langchainConfigs = [
3039
3667
  ];
3040
3668
 
3041
3669
  // src/instrumentation/plugins/langsmith-channels.ts
3042
- var langSmithChannels = defineChannels("langsmith", {
3043
- createRun: channel({
3044
- channelName: "Client.createRun",
3045
- kind: "async"
3046
- }),
3047
- updateRun: channel({
3048
- channelName: "Client.updateRun",
3049
- kind: "async"
3050
- }),
3051
- batchIngestRuns: channel({
3052
- channelName: "Client.batchIngestRuns",
3053
- kind: "async"
3054
- })
3055
- });
3670
+ var langSmithChannels = defineChannels(
3671
+ "langsmith",
3672
+ {
3673
+ createRun: channel({
3674
+ channelName: "Client.createRun",
3675
+ kind: "async"
3676
+ }),
3677
+ updateRun: channel({
3678
+ channelName: "Client.updateRun",
3679
+ kind: "async"
3680
+ }),
3681
+ batchIngestRuns: channel({
3682
+ channelName: "Client.batchIngestRuns",
3683
+ kind: "async"
3684
+ })
3685
+ },
3686
+ { instrumentationName: INSTRUMENTATION_NAMES.LANGSMITH }
3687
+ );
3056
3688
 
3057
3689
  // src/auto-instrumentations/configs/langsmith.ts
3058
3690
  var versionRange = ">=0.3.30 <1.0.0";
@@ -3096,11 +3728,12 @@ var piCodingAgentChannels = defineChannels(
3096
3728
  channelName: "AgentSession.prompt",
3097
3729
  kind: "async"
3098
3730
  })
3099
- }
3731
+ },
3732
+ { instrumentationName: INSTRUMENTATION_NAMES.PI_CODING_AGENT }
3100
3733
  );
3101
3734
 
3102
3735
  // src/auto-instrumentations/configs/pi-coding-agent.ts
3103
- var piCodingAgentVersionRange = ">=0.79.0 <0.80.0";
3736
+ var piCodingAgentVersionRange = ">=0.79.0 <0.82.0";
3104
3737
  var piCodingAgentConfigs = [
3105
3738
  {
3106
3739
  channelName: piCodingAgentChannels.prompt.channelName,
@@ -3122,6 +3755,8 @@ var piCodingAgentConfigs = [
3122
3755
  anthropicConfigs,
3123
3756
  bedrockRuntimeConfigs,
3124
3757
  claudeAgentSDKConfigs,
3758
+ cloudflareAIChatConfigs,
3759
+ cloudflareAgentsConfigs,
3125
3760
  cohereConfigs,
3126
3761
  cursorSDKConfigs,
3127
3762
  genkitConfigs,