raindrop-ai 0.0.88 → 0.0.89

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,30 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ export {
28
+ __commonJS,
29
+ __toESM
30
+ };
package/dist/index.d.mts CHANGED
@@ -3,6 +3,43 @@ import { Span } from '@opentelemetry/api';
3
3
  import { z } from 'zod';
4
4
  import { SpanProcessorOptions } from '@traceloop/node-server-sdk';
5
5
 
6
+ type LocalDebuggerLiveEventType = "text_delta" | "reasoning_delta" | "tool_start" | "tool_result" | "status";
7
+ type LocalDebuggerLiveEventInput$1 = {
8
+ traceId: string;
9
+ spanId?: string;
10
+ type: LocalDebuggerLiveEventType | (string & {});
11
+ content?: string;
12
+ timestamp?: number;
13
+ metadata?: Record<string, unknown>;
14
+ };
15
+
16
+ type ParentSpanContext = {
17
+ traceIdB64: string;
18
+ spanIdB64: string;
19
+ eventId: string;
20
+ };
21
+ interface ContextSpan {
22
+ readonly traceIdB64: string;
23
+ readonly spanIdB64: string;
24
+ readonly eventId: string;
25
+ log?(data: Record<string, unknown>): void;
26
+ }
27
+ interface AsyncLocalStorageLike<T> {
28
+ getStore(): T | undefined;
29
+ run<R>(store: T, callback: () => R): R;
30
+ enterWith?(store: T): void;
31
+ }
32
+ declare abstract class ContextManager {
33
+ abstract getParentSpanIds(): ParentSpanContext | undefined;
34
+ abstract runInContext<R>(span: ContextSpan, callback: () => R): R;
35
+ abstract getCurrentSpan(): ContextSpan | undefined;
36
+ abstract isReady(): boolean;
37
+ }
38
+ declare global {
39
+ var RAINDROP_CONTEXT_MANAGER: (new () => ContextManager) | undefined;
40
+ var RAINDROP_ASYNC_LOCAL_STORAGE: (new <T>() => AsyncLocalStorageLike<T>) | undefined;
41
+ }
42
+
6
43
  /**
7
44
  * Version-agnostic SpanProcessor interface.
8
45
  *
@@ -316,6 +353,9 @@ interface TrackToolParams {
316
353
  error?: Error | string;
317
354
  properties?: Record<string, string>;
318
355
  }
356
+ type LocalDebuggerLiveEventInput = Omit<LocalDebuggerLiveEventInput$1, "traceId"> & {
357
+ traceId?: string;
358
+ };
319
359
  /**
320
360
  * A wrapper around an OpenTelemetry span for tool invocations.
321
361
  *
@@ -636,6 +676,13 @@ type Interaction = {
636
676
  * ```
637
677
  */
638
678
  trackTool(params: TrackToolParams): void;
679
+ /**
680
+ * Emits a live event to the local debugger for this interaction's trace.
681
+ *
682
+ * Use this to surface streaming output or framework-specific progress from
683
+ * integrations that do not use `@raindrop-ai/ai-sdk`.
684
+ */
685
+ emitLiveEvent(event: LocalDebuggerLiveEventInput): void;
639
686
  };
640
687
  type Tracer = {
641
688
  /**
@@ -668,6 +715,10 @@ type Tracer = {
668
715
  * ```
669
716
  */
670
717
  trackTool(params: TrackToolParams): void;
718
+ /**
719
+ * Emits a live event to the local debugger using the current active trace.
720
+ */
721
+ emitLiveEvent(event: LocalDebuggerLiveEventInput): void;
671
722
  };
672
723
 
673
724
  interface AnalyticsConfig {
@@ -925,4 +976,4 @@ declare class Raindrop {
925
976
  close(): Promise<void>;
926
977
  }
927
978
 
928
- export { type AiTrackEvent, type Attachment, type AttachmentType, type BeginInteractionOptions, type FinishInteractionOptions, type IdentifyEvent, type Interaction, MAX_INGEST_SIZE_BYTES, type PartialAiTrackEvent, Raindrop, type RaindropProperties, type RaindropPropertyLeaf, type RaindropPropertyValue, type RaindropSpanProcessor, type SelfDiagnoseOptions, type SelfDiagnosticsExecuteContext, type SelfDiagnosticsExecuteResult, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type SelfDiagnosticsTool, type SelfDiagnosticsToolInputSchema, type SelfDiagnosticsToolOptions, type SignalEvent, type SpanParams, type ToolParams, type ToolSpan, type TraceContext, type Tracer, type TrackToolParams, type WorkflowParams, Raindrop as default };
979
+ export { type AiTrackEvent, type Attachment, type AttachmentType, type BeginInteractionOptions, type FinishInteractionOptions, type IdentifyEvent, type Interaction, type LocalDebuggerLiveEventInput, MAX_INGEST_SIZE_BYTES, type PartialAiTrackEvent, Raindrop, type RaindropProperties, type RaindropPropertyLeaf, type RaindropPropertyValue, type RaindropSpanProcessor, type SelfDiagnoseOptions, type SelfDiagnosticsExecuteContext, type SelfDiagnosticsExecuteResult, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type SelfDiagnosticsTool, type SelfDiagnosticsToolInputSchema, type SelfDiagnosticsToolOptions, type SignalEvent, type SpanParams, type ToolParams, type ToolSpan, type TraceContext, type Tracer, type TrackToolParams, type WorkflowParams, Raindrop as default };
package/dist/index.d.ts CHANGED
@@ -3,6 +3,43 @@ import { Span } from '@opentelemetry/api';
3
3
  import { z } from 'zod';
4
4
  import { SpanProcessorOptions } from '@traceloop/node-server-sdk';
5
5
 
6
+ type LocalDebuggerLiveEventType = "text_delta" | "reasoning_delta" | "tool_start" | "tool_result" | "status";
7
+ type LocalDebuggerLiveEventInput$1 = {
8
+ traceId: string;
9
+ spanId?: string;
10
+ type: LocalDebuggerLiveEventType | (string & {});
11
+ content?: string;
12
+ timestamp?: number;
13
+ metadata?: Record<string, unknown>;
14
+ };
15
+
16
+ type ParentSpanContext = {
17
+ traceIdB64: string;
18
+ spanIdB64: string;
19
+ eventId: string;
20
+ };
21
+ interface ContextSpan {
22
+ readonly traceIdB64: string;
23
+ readonly spanIdB64: string;
24
+ readonly eventId: string;
25
+ log?(data: Record<string, unknown>): void;
26
+ }
27
+ interface AsyncLocalStorageLike<T> {
28
+ getStore(): T | undefined;
29
+ run<R>(store: T, callback: () => R): R;
30
+ enterWith?(store: T): void;
31
+ }
32
+ declare abstract class ContextManager {
33
+ abstract getParentSpanIds(): ParentSpanContext | undefined;
34
+ abstract runInContext<R>(span: ContextSpan, callback: () => R): R;
35
+ abstract getCurrentSpan(): ContextSpan | undefined;
36
+ abstract isReady(): boolean;
37
+ }
38
+ declare global {
39
+ var RAINDROP_CONTEXT_MANAGER: (new () => ContextManager) | undefined;
40
+ var RAINDROP_ASYNC_LOCAL_STORAGE: (new <T>() => AsyncLocalStorageLike<T>) | undefined;
41
+ }
42
+
6
43
  /**
7
44
  * Version-agnostic SpanProcessor interface.
8
45
  *
@@ -316,6 +353,9 @@ interface TrackToolParams {
316
353
  error?: Error | string;
317
354
  properties?: Record<string, string>;
318
355
  }
356
+ type LocalDebuggerLiveEventInput = Omit<LocalDebuggerLiveEventInput$1, "traceId"> & {
357
+ traceId?: string;
358
+ };
319
359
  /**
320
360
  * A wrapper around an OpenTelemetry span for tool invocations.
321
361
  *
@@ -636,6 +676,13 @@ type Interaction = {
636
676
  * ```
637
677
  */
638
678
  trackTool(params: TrackToolParams): void;
679
+ /**
680
+ * Emits a live event to the local debugger for this interaction's trace.
681
+ *
682
+ * Use this to surface streaming output or framework-specific progress from
683
+ * integrations that do not use `@raindrop-ai/ai-sdk`.
684
+ */
685
+ emitLiveEvent(event: LocalDebuggerLiveEventInput): void;
639
686
  };
640
687
  type Tracer = {
641
688
  /**
@@ -668,6 +715,10 @@ type Tracer = {
668
715
  * ```
669
716
  */
670
717
  trackTool(params: TrackToolParams): void;
718
+ /**
719
+ * Emits a live event to the local debugger using the current active trace.
720
+ */
721
+ emitLiveEvent(event: LocalDebuggerLiveEventInput): void;
671
722
  };
672
723
 
673
724
  interface AnalyticsConfig {
@@ -925,4 +976,4 @@ declare class Raindrop {
925
976
  close(): Promise<void>;
926
977
  }
927
978
 
928
- export { type AiTrackEvent, type Attachment, type AttachmentType, type BeginInteractionOptions, type FinishInteractionOptions, type IdentifyEvent, type Interaction, MAX_INGEST_SIZE_BYTES, type PartialAiTrackEvent, Raindrop, type RaindropProperties, type RaindropPropertyLeaf, type RaindropPropertyValue, type RaindropSpanProcessor, type SelfDiagnoseOptions, type SelfDiagnosticsExecuteContext, type SelfDiagnosticsExecuteResult, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type SelfDiagnosticsTool, type SelfDiagnosticsToolInputSchema, type SelfDiagnosticsToolOptions, type SignalEvent, type SpanParams, type ToolParams, type ToolSpan, type TraceContext, type Tracer, type TrackToolParams, type WorkflowParams, Raindrop as default };
979
+ export { type AiTrackEvent, type Attachment, type AttachmentType, type BeginInteractionOptions, type FinishInteractionOptions, type IdentifyEvent, type Interaction, type LocalDebuggerLiveEventInput, MAX_INGEST_SIZE_BYTES, type PartialAiTrackEvent, Raindrop, type RaindropProperties, type RaindropPropertyLeaf, type RaindropPropertyValue, type RaindropSpanProcessor, type SelfDiagnoseOptions, type SelfDiagnosticsExecuteContext, type SelfDiagnosticsExecuteResult, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type SelfDiagnosticsTool, type SelfDiagnosticsToolInputSchema, type SelfDiagnosticsToolOptions, type SignalEvent, type SpanParams, type ToolParams, type ToolSpan, type TraceContext, type Tracer, type TrackToolParams, type WorkflowParams, Raindrop as default };