@raindrop-ai/ai-sdk 0.0.19-beta.4 → 0.0.20

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.
@@ -0,0 +1,601 @@
1
+ type OtlpAnyValue = {
2
+ stringValue?: string;
3
+ intValue?: string;
4
+ doubleValue?: number;
5
+ boolValue?: boolean;
6
+ arrayValue?: {
7
+ values: OtlpAnyValue[];
8
+ };
9
+ };
10
+ type OtlpKeyValue = {
11
+ key: string;
12
+ value: OtlpAnyValue;
13
+ };
14
+ declare const SpanStatusCode: {
15
+ readonly UNSET: 0;
16
+ readonly OK: 1;
17
+ readonly ERROR: 2;
18
+ };
19
+ type OtlpSpanStatus = {
20
+ code: (typeof SpanStatusCode)[keyof typeof SpanStatusCode] | number;
21
+ message?: string;
22
+ };
23
+ type OtlpSpan = {
24
+ traceId: string;
25
+ spanId: string;
26
+ parentSpanId?: string;
27
+ name: string;
28
+ startTimeUnixNano: string;
29
+ endTimeUnixNano: string;
30
+ attributes?: OtlpKeyValue[];
31
+ status?: OtlpSpanStatus;
32
+ };
33
+ type SpanIds = {
34
+ traceIdB64: string;
35
+ spanIdB64: string;
36
+ parentSpanIdB64?: string;
37
+ };
38
+
39
+ type Attachment$1 = {
40
+ type: string;
41
+ role: string;
42
+ name?: string;
43
+ value: string;
44
+ };
45
+ type IdentifyInput$1 = {
46
+ userId: string;
47
+ traits?: Record<string, unknown>;
48
+ };
49
+ type Patch = {
50
+ eventName?: string;
51
+ userId?: string;
52
+ convoId?: string;
53
+ input?: string;
54
+ output?: string;
55
+ model?: string;
56
+ properties?: Record<string, unknown>;
57
+ attachments?: Attachment$1[];
58
+ isPending?: boolean;
59
+ timestamp?: string;
60
+ };
61
+ type SignalInput = {
62
+ eventId: string;
63
+ name: string;
64
+ type?: "default" | "feedback" | "edit" | "standard" | "agent" | "agent_internal";
65
+ sentiment?: "POSITIVE" | "NEGATIVE";
66
+ timestamp?: string;
67
+ properties?: Record<string, unknown>;
68
+ attachmentId?: string;
69
+ comment?: string;
70
+ after?: string;
71
+ };
72
+ type EventShipperOptions = {
73
+ writeKey?: string;
74
+ endpoint?: string;
75
+ enabled?: boolean;
76
+ debug: boolean;
77
+ partialFlushMs?: number;
78
+ sdkName?: string;
79
+ libraryName?: string;
80
+ libraryVersion?: string;
81
+ defaultEventName?: string;
82
+ };
83
+ declare class EventShipper$1 {
84
+ private baseUrl;
85
+ private writeKey?;
86
+ private enabled;
87
+ private debug;
88
+ private partialFlushMs;
89
+ private sdkName;
90
+ private prefix;
91
+ private defaultEventName;
92
+ private context;
93
+ private buffers;
94
+ private sticky;
95
+ private timers;
96
+ private inFlight;
97
+ constructor(opts: EventShipperOptions);
98
+ isDebugEnabled(): boolean;
99
+ private authHeaders;
100
+ patch(eventId: string, patch: Patch): Promise<void>;
101
+ finish(eventId: string, patch: {
102
+ output?: string;
103
+ model?: string;
104
+ properties?: Record<string, unknown>;
105
+ userId?: string;
106
+ }): Promise<void>;
107
+ flush(): Promise<void>;
108
+ shutdown(): Promise<void>;
109
+ trackSignal(signal: SignalInput): Promise<void>;
110
+ identify(users: IdentifyInput$1 | IdentifyInput$1[]): Promise<void>;
111
+ private flushOne;
112
+ }
113
+
114
+ type InternalSpan = {
115
+ ids: SpanIds;
116
+ name: string;
117
+ startTimeUnixNano: string;
118
+ endTimeUnixNano?: string;
119
+ attributes: Array<OtlpKeyValue | undefined>;
120
+ };
121
+ type TraceShipperOptions = {
122
+ writeKey?: string;
123
+ endpoint?: string;
124
+ enabled?: boolean;
125
+ debug: boolean;
126
+ debugSpans?: boolean;
127
+ flushIntervalMs?: number;
128
+ maxBatchSize?: number;
129
+ maxQueueSize?: number;
130
+ sdkName?: string;
131
+ serviceName?: string;
132
+ serviceVersion?: string;
133
+ };
134
+ declare class TraceShipper$1 {
135
+ private baseUrl;
136
+ private writeKey?;
137
+ private enabled;
138
+ private debug;
139
+ private debugSpans;
140
+ private sdkName;
141
+ private prefix;
142
+ private serviceName;
143
+ private serviceVersion;
144
+ private flushIntervalMs;
145
+ private maxBatchSize;
146
+ private maxQueueSize;
147
+ private queue;
148
+ private timer;
149
+ private inFlight;
150
+ constructor(opts: TraceShipperOptions);
151
+ isDebugEnabled(): boolean;
152
+ private authHeaders;
153
+ startSpan(args: {
154
+ name: string;
155
+ parent?: {
156
+ traceIdB64: string;
157
+ spanIdB64: string;
158
+ };
159
+ eventId: string;
160
+ operationId?: string;
161
+ attributes?: Array<OtlpKeyValue | undefined>;
162
+ startTimeUnixNano?: string;
163
+ }): InternalSpan;
164
+ endSpan(span: InternalSpan, extra?: {
165
+ attributes?: InternalSpan["attributes"];
166
+ error?: unknown;
167
+ status?: OtlpSpanStatus;
168
+ endTimeUnixNano?: string;
169
+ }): void;
170
+ createSpan(args: {
171
+ name: string;
172
+ parent?: {
173
+ traceIdB64: string;
174
+ spanIdB64: string;
175
+ };
176
+ eventId: string;
177
+ startTimeUnixNano: string;
178
+ endTimeUnixNano: string;
179
+ attributes?: Array<OtlpKeyValue | undefined>;
180
+ status?: OtlpSpanStatus;
181
+ }): void;
182
+ enqueue(span: OtlpSpan): void;
183
+ flush(): Promise<void>;
184
+ shutdown(): Promise<void>;
185
+ }
186
+
187
+ type ParentSpanContext = {
188
+ traceIdB64: string;
189
+ spanIdB64: string;
190
+ eventId: string;
191
+ };
192
+ interface ContextSpan {
193
+ readonly traceIdB64: string;
194
+ readonly spanIdB64: string;
195
+ readonly eventId: string;
196
+ log?(data: Record<string, unknown>): void;
197
+ }
198
+ interface AsyncLocalStorageLike<T> {
199
+ getStore(): T | undefined;
200
+ run<R>(store: T, callback: () => R): R;
201
+ enterWith?(store: T): void;
202
+ }
203
+ declare abstract class ContextManager {
204
+ abstract getParentSpanIds(): ParentSpanContext | undefined;
205
+ abstract runInContext<R>(span: ContextSpan, callback: () => R): R;
206
+ abstract getCurrentSpan(): ContextSpan | undefined;
207
+ abstract isReady(): boolean;
208
+ }
209
+ declare global {
210
+ var RAINDROP_CONTEXT_MANAGER: (new () => ContextManager) | undefined;
211
+ var RAINDROP_ASYNC_LOCAL_STORAGE: (new <T>() => AsyncLocalStorageLike<T>) | undefined;
212
+ }
213
+ declare function getContextManager(): ContextManager;
214
+ declare function currentSpan(): ContextSpan;
215
+ declare function withCurrent<R>(span: ContextSpan, callback: () => R): R;
216
+
217
+ declare class EventShipper extends EventShipper$1 {
218
+ constructor(opts: ConstructorParameters<typeof EventShipper$1>[0]);
219
+ }
220
+
221
+ declare class TraceShipper extends TraceShipper$1 {
222
+ constructor(opts: ConstructorParameters<typeof TraceShipper$1>[0]);
223
+ }
224
+
225
+ /**
226
+ * Raindrop TelemetryIntegration for AI SDK v7+
227
+ *
228
+ * Implements the AI SDK's TelemetryIntegration interface to capture traces and
229
+ * events natively, replacing the Proxy-based wrapping used for v4-v6.
230
+ *
231
+ * Modeled after the upstream OpenTelemetryIntegration but uses Raindrop's
232
+ * TraceShipper (OTLP/HTTP) + EventShipper instead of the OTel Tracer API.
233
+ */
234
+
235
+ type Listener<T> = (event: T) => PromiseLike<void> | void;
236
+ interface TelemetryIntegration {
237
+ onStart?: Listener<any>;
238
+ onStepStart?: Listener<any>;
239
+ onToolCallStart?: Listener<any>;
240
+ onToolCallFinish?: Listener<any>;
241
+ onChunk?: Listener<any>;
242
+ onStepFinish?: Listener<any>;
243
+ onEmbedStart?: Listener<any>;
244
+ onEmbedFinish?: Listener<any>;
245
+ onFinish?: Listener<any>;
246
+ onError?: Listener<any>;
247
+ executeTool?: <T>(params: {
248
+ callId: string;
249
+ toolCallId: string;
250
+ execute: () => PromiseLike<T>;
251
+ }) => PromiseLike<T>;
252
+ }
253
+ type RaindropTelemetryIntegrationOptions = {
254
+ traceShipper: TraceShipper;
255
+ eventShipper: EventShipper;
256
+ sendTraces?: boolean;
257
+ sendEvents?: boolean;
258
+ debug?: boolean;
259
+ context?: {
260
+ userId?: string;
261
+ eventId?: string;
262
+ eventName?: string;
263
+ convoId?: string;
264
+ properties?: Record<string, unknown>;
265
+ };
266
+ };
267
+ declare class RaindropTelemetryIntegration implements TelemetryIntegration {
268
+ private readonly traceShipper;
269
+ private readonly eventShipper;
270
+ private readonly sendTraces;
271
+ private readonly sendEvents;
272
+ private readonly debug;
273
+ private readonly defaultContext;
274
+ private readonly callStates;
275
+ constructor(opts: RaindropTelemetryIntegrationOptions);
276
+ private getState;
277
+ private cleanup;
278
+ private spanParentRef;
279
+ private extractRaindropMetadata;
280
+ /**
281
+ * Extract the user-facing input text from an onStart event.
282
+ * Mirrors the logic in the v4-v6 Proxy path (lastUserMessageTextFromArgs / extractInputFromArgs).
283
+ */
284
+ private extractInputText;
285
+ onStart: (event: any) => void;
286
+ onStepStart: (event: any) => void;
287
+ onToolCallStart: (event: any) => void;
288
+ onToolCallFinish: (event: any) => void;
289
+ onChunk: (event: any) => void;
290
+ onStepFinish: (event: any) => void;
291
+ onEmbedStart: (event: any) => void;
292
+ onEmbedFinish: (event: any) => void;
293
+ onFinish: (event: any) => void;
294
+ private finishGenerate;
295
+ private finishEmbed;
296
+ onError: (error: unknown) => void;
297
+ executeTool: <T>({ callId, toolCallId, execute, }: {
298
+ callId: string;
299
+ toolCallId: string;
300
+ execute: () => PromiseLike<T>;
301
+ }) => Promise<T>;
302
+ }
303
+
304
+ type IdentifyInput = {
305
+ userId: string;
306
+ traits?: Record<string, unknown>;
307
+ };
308
+
309
+ declare function _resetWarnedMissingUserId(): void;
310
+
311
+ /**
312
+ * Options for creating event metadata for call-time context override.
313
+ */
314
+ type EventMetadataOptions = {
315
+ /** User identifier (overrides wrap-time userId) */
316
+ userId?: string;
317
+ /** Event identifier. If not provided, a unique ID is generated. */
318
+ eventId?: string;
319
+ /** Conversation identifier to group related events */
320
+ convoId?: string;
321
+ /** Custom event name (overrides wrap-time eventName) */
322
+ eventName?: string;
323
+ /** Additional properties to merge with wrap-time properties */
324
+ properties?: Record<string, unknown>;
325
+ };
326
+ /**
327
+ * Creates metadata for use with the AI SDK's `experimental_telemetry.metadata` option.
328
+ * This allows per-call context override when using the wrapped AI SDK.
329
+ *
330
+ * Call-time values override wrap-time defaults. Properties are merged (call-time wins on conflicts).
331
+ *
332
+ * @example
333
+ * ```typescript
334
+ * import { generateText } from "ai";
335
+ * import { createRaindropAISDK, eventMetadata } from "@raindrop-ai/ai-sdk";
336
+ *
337
+ * const raindrop = createRaindropAISDK({ writeKey: "..." });
338
+ * const { generateText } = raindrop.wrap(ai, {
339
+ * context: { userId: "default-user" } // wrap-time defaults
340
+ * });
341
+ *
342
+ * // Override context per-call
343
+ * const result = await generateText({
344
+ * model: openai("gpt-4"),
345
+ * prompt: "Hello!",
346
+ * experimental_telemetry: {
347
+ * isEnabled: true,
348
+ * metadata: eventMetadata({
349
+ * convoId: "convo-123", // add convoId for this call
350
+ * eventName: "custom-chat", // override eventName
351
+ * }),
352
+ * },
353
+ * });
354
+ * ```
355
+ */
356
+ declare function eventMetadata(options: EventMetadataOptions): Record<string, string>;
357
+ type AISDKChatRequestMessageLike = {
358
+ id?: string;
359
+ role?: string;
360
+ [key: string]: unknown;
361
+ };
362
+ type AISDKChatRequestLike = {
363
+ id?: string;
364
+ messageId?: string;
365
+ trigger?: string;
366
+ messages?: AISDKChatRequestMessageLike[];
367
+ [key: string]: unknown;
368
+ };
369
+ /**
370
+ * Creates stable Raindrop metadata from an AI SDK UI chat request body.
371
+ *
372
+ * This is useful for `useChat` applications that require multiple server round-trips
373
+ * for a single user turn, e.g. when the model triggers client-side tools.
374
+ *
375
+ * The helper derives:
376
+ * - `convoId` from the AI SDK chat request `id`
377
+ * - `eventId` from the latest user message id in `messages`
378
+ *
379
+ * Reusing the same derived `eventId` across tool handoff round-trips allows the
380
+ * wrapper to patch one logical event instead of creating a new event per POST.
381
+ */
382
+ declare function eventMetadataFromChatRequest(options: EventMetadataOptions & {
383
+ request: AISDKChatRequestLike;
384
+ }): Record<string, string>;
385
+ type AgentCallMetadata = ReturnType<typeof eventMetadata>;
386
+ type NormalizeUnknownAgentOptions<T> = T extends {
387
+ options: infer CallOptions;
388
+ } ? unknown extends CallOptions ? Omit<T, "options"> & {
389
+ options?: never;
390
+ } : T : T;
391
+ /**
392
+ * Wraps an agent instance type so `generate()` and `stream()` accept optional
393
+ * Raindrop call metadata while preserving original return types.
394
+ */
395
+ type AgentWithMetadata<A> = A extends {
396
+ generate: (...args: infer GenerateArgs) => infer GenerateReturn;
397
+ stream: (...args: infer StreamArgs) => infer StreamReturn;
398
+ } ? Omit<A, "generate" | "stream"> & {
399
+ generate(...args: GenerateArgs extends [infer Options, ...infer Rest] ? [NormalizeUnknownAgentOptions<Options> & {
400
+ metadata?: AgentCallMetadata;
401
+ }, ...Rest] : GenerateArgs): GenerateReturn;
402
+ stream(...args: StreamArgs extends [infer Options, ...infer Rest] ? [NormalizeUnknownAgentOptions<Options> & {
403
+ metadata?: AgentCallMetadata;
404
+ }, ...Rest] : StreamArgs): StreamReturn;
405
+ } : A;
406
+ type AgentConstructor = abstract new (...args: any[]) => any;
407
+ type WrapAgentExport<T extends object, K extends PropertyKey> = K extends keyof T ? T[K] extends AgentConstructor ? Omit<T, K> & {
408
+ [P in K]: new (...args: ConstructorParameters<T[K]>) => AgentWithMetadata<InstanceType<T[K]>>;
409
+ } : T : T;
410
+ /**
411
+ * Structural wrapper type for AI SDK modules.
412
+ *
413
+ * Rewrites AI SDK agent constructor exports so their instance `generate()` and
414
+ * `stream()` methods accept Raindrop `metadata` while preserving original
415
+ * return types. Covers the current and deprecated public export names.
416
+ */
417
+ type WrappedAISDK<T extends object> = WrapAgentExport<WrapAgentExport<WrapAgentExport<T, "ToolLoopAgent">, "Experimental_Agent">, "Agent">;
418
+ /**
419
+ * Backward-compatible alias for wrapped AI SDK module types.
420
+ *
421
+ * This alias intentionally avoids referencing `import("ai")` to satisfy type
422
+ * resolution without requiring `ai` to be installed.
423
+ *
424
+ * Prefer `WrappedAISDK<typeof ai>` in app code when you have an `ai` import.
425
+ */
426
+ type WrappedAI<T extends object = any> = WrappedAISDK<T>;
427
+ type Attachment = {
428
+ attachment_id?: string;
429
+ name?: string;
430
+ value: string;
431
+ role: "input" | "output";
432
+ } & ({
433
+ type: "code";
434
+ language?: string;
435
+ } | {
436
+ type: "text" | "image" | "iframe";
437
+ });
438
+ type RaindropAISDKOptions = {
439
+ /**
440
+ * API write key. If omitted, telemetry shipping is disabled but `wrap()` is
441
+ * still available for a consistent integration surface.
442
+ */
443
+ writeKey?: string;
444
+ endpoint?: string;
445
+ traces?: {
446
+ enabled?: boolean;
447
+ flushIntervalMs?: number;
448
+ maxBatchSize?: number;
449
+ maxQueueSize?: number;
450
+ debug?: boolean;
451
+ debugSpans?: boolean;
452
+ };
453
+ events?: {
454
+ enabled?: boolean;
455
+ partialFlushMs?: number;
456
+ debug?: boolean;
457
+ };
458
+ };
459
+ type RaindropAISDKContext = {
460
+ userId?: string;
461
+ eventId?: string;
462
+ eventName?: string;
463
+ convoId?: string;
464
+ properties?: Record<string, unknown>;
465
+ attachments?: Attachment[];
466
+ };
467
+
468
+ type BuildEventPatch = {
469
+ eventName?: string;
470
+ input?: string;
471
+ output?: string;
472
+ model?: string;
473
+ properties?: Record<string, unknown>;
474
+ attachments?: Attachment[];
475
+ };
476
+ /**
477
+ * Message format passed to `buildEvent`.
478
+ *
479
+ * This is intentionally "AI SDK shaped" but loosely typed:
480
+ * - works across AI SDK versions
481
+ * - avoids requiring users to import AI SDK types
482
+ */
483
+ type AISDKMessage = {
484
+ role: "system" | "user" | "assistant" | "tool" | string;
485
+ content: unknown;
486
+ [key: string]: unknown;
487
+ };
488
+ /**
489
+ * Build or override the Raindrop Event payload from an AI SDK conversation transcript.
490
+ *
491
+ * The wrapper calls this twice:
492
+ * - early with the input messages (system/user)
493
+ * - at the end with appended response messages (assistant/tool, incl tool-call + tool-result parts)
494
+ */
495
+ type EventBuilder = (messages: AISDKMessage[]) => void | BuildEventPatch;
496
+ type SelfDiagnosticsSignalDefinition = {
497
+ /**
498
+ * Human-readable meaning of this signal.
499
+ * Used in the injected tool schema and stored in signal properties.
500
+ */
501
+ description: string;
502
+ /**
503
+ * Optional default sentiment for this signal key.
504
+ * This can help dashboards classify negative/positive programmatic signals.
505
+ */
506
+ sentiment?: "POSITIVE" | "NEGATIVE";
507
+ };
508
+ type SelfDiagnosticsSignalDefinitions = Record<string, SelfDiagnosticsSignalDefinition>;
509
+ type SelfDiagnosticsOptions = {
510
+ /** Enable automatic injection of the self diagnostics tool. Default: false */
511
+ enabled?: boolean;
512
+ /**
513
+ * Signal keys and descriptions exposed to the model.
514
+ * Defaults to a built-in set when omitted.
515
+ */
516
+ signals?: SelfDiagnosticsSignalDefinitions;
517
+ /**
518
+ * Optional extra guidance for when the model should emit self diagnostics.
519
+ * The SDK still generates a full tool prompt from `signals`.
520
+ */
521
+ guidance?: string;
522
+ /**
523
+ * Optional tool name override for the injected self diagnostics tool.
524
+ * Defaults to "__raindrop_report".
525
+ */
526
+ toolName?: string;
527
+ };
528
+ type WrapAISDKOptions = {
529
+ context: RaindropAISDKContext | ((info: {
530
+ operation: string;
531
+ args: unknown;
532
+ }) => RaindropAISDKContext);
533
+ buildEvent?: EventBuilder;
534
+ autoAttachment?: boolean;
535
+ selfDiagnostics?: SelfDiagnosticsOptions;
536
+ send?: {
537
+ events?: boolean;
538
+ traces?: boolean;
539
+ };
540
+ /**
541
+ * Use the AI SDK's native TelemetryIntegration instead of Proxy-based wrapping.
542
+ * Requires AI SDK v7+. Throws on older versions.
543
+ *
544
+ * When enabled, `wrap()` registers a `RaindropTelemetryIntegration` globally
545
+ * and returns the original module instead of a Proxy.
546
+ *
547
+ * Default: false (uses Proxy wrapping for backward compatibility).
548
+ */
549
+ nativeTelemetry?: boolean;
550
+ };
551
+ type EventPatch = {
552
+ eventName?: string;
553
+ userId?: string;
554
+ convoId?: string;
555
+ input?: string;
556
+ output?: string;
557
+ model?: string;
558
+ properties?: Record<string, unknown>;
559
+ attachments?: Attachment[];
560
+ isPending?: boolean;
561
+ timestamp?: string;
562
+ };
563
+ type RaindropAISDKClient = {
564
+ wrap<T extends object>(aiSDK: T, options?: WrapAISDKOptions): WrappedAISDK<T>;
565
+ /**
566
+ * Create a TelemetryIntegration instance for direct registration with AI SDK v7+.
567
+ * Use with `registerTelemetryIntegration()` from the `ai` package.
568
+ */
569
+ createTelemetryIntegration(context?: RaindropTelemetryIntegrationOptions["context"]): RaindropTelemetryIntegration;
570
+ events: {
571
+ patch(eventId: string, patch: EventPatch): Promise<void>;
572
+ addAttachments(eventId: string, attachments: Attachment[]): Promise<void>;
573
+ setProperties(eventId: string, properties: Record<string, unknown>): Promise<void>;
574
+ finish(eventId: string, patch: {
575
+ output?: string;
576
+ model?: string;
577
+ properties?: Record<string, unknown>;
578
+ }): Promise<void>;
579
+ };
580
+ users: {
581
+ identify(users: IdentifyInput | IdentifyInput[]): Promise<void>;
582
+ };
583
+ signals: {
584
+ track(signal: {
585
+ eventId: string;
586
+ name: "thumbs_up" | "thumbs_down" | string;
587
+ type?: "default" | "feedback" | "edit" | "standard" | "agent" | "agent_internal";
588
+ sentiment?: "POSITIVE" | "NEGATIVE";
589
+ timestamp?: string;
590
+ properties?: Record<string, unknown>;
591
+ attachmentId?: string;
592
+ comment?: string;
593
+ after?: string;
594
+ }): Promise<void>;
595
+ };
596
+ flush(): Promise<void>;
597
+ shutdown(): Promise<void>;
598
+ };
599
+ declare function createRaindropAISDK(opts: RaindropAISDKOptions): RaindropAISDKClient;
600
+
601
+ export { type AISDKChatRequestLike as A, type BuildEventPatch as B, ContextManager as C, type EventBuilder as E, type IdentifyInput as I, type RaindropAISDKClient as R, type SelfDiagnosticsOptions as S, type WrapAISDKOptions as W, _resetWarnedMissingUserId as _, type AISDKChatRequestMessageLike as a, type AISDKMessage as b, type AgentCallMetadata as c, type AgentWithMetadata as d, type Attachment as e, type ContextSpan as f, type EventMetadataOptions as g, type RaindropAISDKContext as h, type RaindropAISDKOptions as i, RaindropTelemetryIntegration as j, type RaindropTelemetryIntegrationOptions as k, type SelfDiagnosticsSignalDefinition as l, type SelfDiagnosticsSignalDefinitions as m, type WrappedAI as n, type WrappedAISDK as o, createRaindropAISDK as p, currentSpan as q, eventMetadata as r, eventMetadataFromChatRequest as s, getContextManager as t, withCurrent as w };