@raindrop-ai/ai-sdk 0.0.15 → 0.0.16

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/dist/index.d.mts CHANGED
@@ -8,18 +8,10 @@ type ParentSpanContext = {
8
8
  spanIdB64: string;
9
9
  eventId: string;
10
10
  };
11
- /**
12
- * Span interface for context propagation.
13
- * This is a minimal interface that spans must implement to be used with the context manager.
14
- */
15
11
  interface ContextSpan {
16
- /** The span's trace ID */
17
12
  readonly traceIdB64: string;
18
- /** The span's ID */
19
13
  readonly spanIdB64: string;
20
- /** Associated event ID */
21
14
  readonly eventId: string;
22
- /** Log data to the span */
23
15
  log?(data: Record<string, unknown>): void;
24
16
  }
25
17
  interface AsyncLocalStorageLike<T> {
@@ -27,56 +19,18 @@ interface AsyncLocalStorageLike<T> {
27
19
  run<R>(store: T, callback: () => R): R;
28
20
  enterWith?(store: T): void;
29
21
  }
30
- /**
31
- * Abstract base class for context managers.
32
- * Allows plugging in custom implementations (e.g., for OTEL integration).
33
- */
34
22
  declare abstract class ContextManager {
35
- /**
36
- * Get the parent span IDs from the current context.
37
- */
38
23
  abstract getParentSpanIds(): ParentSpanContext | undefined;
39
- /**
40
- * Run a callback with the given span as the current context.
41
- * This is synchronous - the callback runs immediately within the context.
42
- */
43
24
  abstract runInContext<R>(span: ContextSpan, callback: () => R): R;
44
- /**
45
- * Get the current span from context, if any.
46
- */
47
25
  abstract getCurrentSpan(): ContextSpan | undefined;
48
- /**
49
- * Check if the context manager is ready (AsyncLocalStorage is available).
50
- */
51
26
  abstract isReady(): boolean;
52
27
  }
53
28
  declare global {
54
29
  var RAINDROP_CONTEXT_MANAGER: (new () => ContextManager) | undefined;
55
30
  var RAINDROP_ASYNC_LOCAL_STORAGE: (new <T>() => AsyncLocalStorageLike<T>) | undefined;
56
31
  }
57
- /**
58
- * Get the global context manager instance.
59
- * Uses a custom context manager if one is registered via globalThis.RAINDROP_CONTEXT_MANAGER.
60
- */
61
32
  declare function getContextManager(): ContextManager;
62
- /**
63
- * Get the currently active span.
64
- * If there is no active span, returns a no-op span that supports the same interface.
65
- *
66
- * This allows you to log to the current span from anywhere:
67
- * ```ts
68
- * currentSpan().log?.({ custom: "data" });
69
- * ```
70
- */
71
33
  declare function currentSpan(): ContextSpan;
72
- /**
73
- * Run a callback with the given span as the current span context.
74
- * This is useful for ensuring nested operations inherit the correct parent.
75
- *
76
- * @param span The span to set as current
77
- * @param callback The function to run within the span context
78
- * @returns The return value of the callback
79
- */
80
34
  declare function withCurrent<R>(span: ContextSpan, callback: () => R): R;
81
35
 
82
36
  declare function _resetWarnedMissingUserId(): void;
package/dist/index.d.ts CHANGED
@@ -8,18 +8,10 @@ type ParentSpanContext = {
8
8
  spanIdB64: string;
9
9
  eventId: string;
10
10
  };
11
- /**
12
- * Span interface for context propagation.
13
- * This is a minimal interface that spans must implement to be used with the context manager.
14
- */
15
11
  interface ContextSpan {
16
- /** The span's trace ID */
17
12
  readonly traceIdB64: string;
18
- /** The span's ID */
19
13
  readonly spanIdB64: string;
20
- /** Associated event ID */
21
14
  readonly eventId: string;
22
- /** Log data to the span */
23
15
  log?(data: Record<string, unknown>): void;
24
16
  }
25
17
  interface AsyncLocalStorageLike<T> {
@@ -27,56 +19,18 @@ interface AsyncLocalStorageLike<T> {
27
19
  run<R>(store: T, callback: () => R): R;
28
20
  enterWith?(store: T): void;
29
21
  }
30
- /**
31
- * Abstract base class for context managers.
32
- * Allows plugging in custom implementations (e.g., for OTEL integration).
33
- */
34
22
  declare abstract class ContextManager {
35
- /**
36
- * Get the parent span IDs from the current context.
37
- */
38
23
  abstract getParentSpanIds(): ParentSpanContext | undefined;
39
- /**
40
- * Run a callback with the given span as the current context.
41
- * This is synchronous - the callback runs immediately within the context.
42
- */
43
24
  abstract runInContext<R>(span: ContextSpan, callback: () => R): R;
44
- /**
45
- * Get the current span from context, if any.
46
- */
47
25
  abstract getCurrentSpan(): ContextSpan | undefined;
48
- /**
49
- * Check if the context manager is ready (AsyncLocalStorage is available).
50
- */
51
26
  abstract isReady(): boolean;
52
27
  }
53
28
  declare global {
54
29
  var RAINDROP_CONTEXT_MANAGER: (new () => ContextManager) | undefined;
55
30
  var RAINDROP_ASYNC_LOCAL_STORAGE: (new <T>() => AsyncLocalStorageLike<T>) | undefined;
56
31
  }
57
- /**
58
- * Get the global context manager instance.
59
- * Uses a custom context manager if one is registered via globalThis.RAINDROP_CONTEXT_MANAGER.
60
- */
61
32
  declare function getContextManager(): ContextManager;
62
- /**
63
- * Get the currently active span.
64
- * If there is no active span, returns a no-op span that supports the same interface.
65
- *
66
- * This allows you to log to the current span from anywhere:
67
- * ```ts
68
- * currentSpan().log?.({ custom: "data" });
69
- * ```
70
- */
71
33
  declare function currentSpan(): ContextSpan;
72
- /**
73
- * Run a callback with the given span as the current span context.
74
- * This is useful for ensuring nested operations inherit the correct parent.
75
- *
76
- * @param span The span to set as current
77
- * @param callback The function to run within the span context
78
- * @returns The return value of the callback
79
- */
80
34
  declare function withCurrent<R>(span: ContextSpan, callback: () => R): R;
81
35
 
82
36
  declare function _resetWarnedMissingUserId(): void;