@raindrop-ai/ai-sdk 0.0.31 → 0.0.32
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/README.md +37 -0
- package/dist/{chunk-7VSCLQIX.mjs → chunk-YDMJ6ABM.mjs} +263 -164
- package/dist/{index-IMe7ZUXV.d.mts → index-CwK0GdEe.d.mts} +42 -1
- package/dist/{index-IMe7ZUXV.d.ts → index-CwK0GdEe.d.ts} +42 -1
- package/dist/index.browser.d.mts +42 -1
- package/dist/index.browser.d.ts +42 -1
- package/dist/index.browser.js +276 -177
- package/dist/index.browser.mjs +276 -177
- package/dist/index.node.d.mts +1 -1
- package/dist/index.node.d.ts +1 -1
- package/dist/index.node.js +276 -177
- package/dist/index.node.mjs +1 -1
- package/dist/index.workers.d.mts +1 -1
- package/dist/index.workers.d.ts +1 -1
- package/dist/index.workers.js +276 -177
- package/dist/index.workers.mjs +1 -1
- package/package.json +1 -1
|
@@ -462,6 +462,7 @@ declare class RaindropTelemetryIntegration implements TelemetryIntegration {
|
|
|
462
462
|
onLanguageModelCallStart: (_event: any) => void;
|
|
463
463
|
onLanguageModelCallEnd: (_event: any) => void;
|
|
464
464
|
onChunk: (event: any) => void;
|
|
465
|
+
private emitProviderExecutedToolSpans;
|
|
465
466
|
onStepFinish: (event: any) => void;
|
|
466
467
|
onEmbedStart: (event: any) => void;
|
|
467
468
|
onEmbedFinish: (event: any) => void;
|
|
@@ -893,6 +894,38 @@ type SelfDiagnosticsOptions = {
|
|
|
893
894
|
*/
|
|
894
895
|
toolName?: string;
|
|
895
896
|
};
|
|
897
|
+
type SelfDiagnosticsToolOptions = Omit<SelfDiagnosticsOptions, "enabled"> & {
|
|
898
|
+
/** Fixed Raindrop event ID to attach diagnostic signals to. */
|
|
899
|
+
eventId?: string;
|
|
900
|
+
/** Dynamic event ID resolver, useful when one tool instance serves many runs. */
|
|
901
|
+
getEventId?: () => string | undefined;
|
|
902
|
+
/** Behavior when no event ID can be resolved. Default: "warn" */
|
|
903
|
+
onMissingEventId?: "warn" | "ignore" | "throw";
|
|
904
|
+
};
|
|
905
|
+
type SelfDiagnosticsToolInput = {
|
|
906
|
+
category: string;
|
|
907
|
+
detail: string;
|
|
908
|
+
};
|
|
909
|
+
type SelfDiagnosticsToolResult = {
|
|
910
|
+
acknowledged: true;
|
|
911
|
+
category: string;
|
|
912
|
+
} | {
|
|
913
|
+
acknowledged: false;
|
|
914
|
+
category: string;
|
|
915
|
+
reason: "missing_event_id";
|
|
916
|
+
};
|
|
917
|
+
type SelfDiagnosticsTool = {
|
|
918
|
+
name: string;
|
|
919
|
+
description: string;
|
|
920
|
+
/**
|
|
921
|
+
* AI SDK v4 tool schema. This is the same cross-version schema object as
|
|
922
|
+
* `inputSchema`; both fields are exposed so the tool works on AI SDK v4-v7.
|
|
923
|
+
*/
|
|
924
|
+
parameters: any;
|
|
925
|
+
/** AI SDK v5+ tool schema. */
|
|
926
|
+
inputSchema: any;
|
|
927
|
+
execute(input: SelfDiagnosticsToolInput): Promise<SelfDiagnosticsToolResult>;
|
|
928
|
+
};
|
|
896
929
|
type WrapAISDKOptions = {
|
|
897
930
|
context: RaindropAISDKContext | ((info: {
|
|
898
931
|
operation: string;
|
|
@@ -977,6 +1010,14 @@ type EventPatch = {
|
|
|
977
1010
|
};
|
|
978
1011
|
type RaindropAISDKClient = {
|
|
979
1012
|
wrap<T extends object>(aiSDK: T, options?: WrapAISDKOptions): WrappedAISDK<T>;
|
|
1013
|
+
/**
|
|
1014
|
+
* Create a standalone AI SDK self-diagnostics tool.
|
|
1015
|
+
*
|
|
1016
|
+
* The tool automatically uses the active Raindrop event while executing
|
|
1017
|
+
* under `createTelemetryIntegration()` with tracing enabled. Pass `eventId`
|
|
1018
|
+
* or `getEventId` when no active trace context is available.
|
|
1019
|
+
*/
|
|
1020
|
+
createSelfDiagnosticsTool(options?: SelfDiagnosticsToolOptions): SelfDiagnosticsTool;
|
|
980
1021
|
/**
|
|
981
1022
|
* Create a TelemetryIntegration instance for direct registration with AI SDK v7+.
|
|
982
1023
|
* Use with `registerTelemetryIntegration()` from the `ai` package.
|
|
@@ -1062,4 +1103,4 @@ type RaindropAISDKClient = {
|
|
|
1062
1103
|
};
|
|
1063
1104
|
declare function createRaindropAISDK(opts: RaindropAISDKOptions): RaindropAISDKClient;
|
|
1064
1105
|
|
|
1065
|
-
export {
|
|
1106
|
+
export { redactJsonAttributeValue as $, type AISDKChatRequestLike as A, type BuildEventPatch as B, ContextManager as C, DEFAULT_REDACT_ATTRIBUTE_KEYS as D, type EndSpanArgs as E, type WrappedAISDK as F, _resetRaindropCallMetadataStorage as G, _resetWarnedMissingUserId as H, type IdentifyInput as I, clearParentToolContext as J, createRaindropAISDK as K, currentSpan as L, defaultTransformSpan as M, enterParentToolContext as N, type OtlpAnyValue as O, type ParentToolContext as P, eventMetadata as Q, REDACTED_PLACEHOLDER as R, type SelfDiagnosticsOptions as S, type TraceSpan as T, eventMetadataFromChatRequest as U, getContextManager as V, type WrapAISDKOptions as W, getCurrentParentToolContext as X, getCurrentRaindropCallMetadata as Y, readRaindropCallMetadataFromArgs as Z, _resetParentToolContextStorage as _, type AISDKChatRequestMessageLike as a, redactSecretsInObject as a0, runWithParentToolContext as a1, runWithRaindropCallMetadata as a2, withCurrent as a3, type AISDKMessage as b, type AgentCallMetadata as c, type AgentWithMetadata as d, type Attachment as e, type ContextSpan as f, type CreateSpanArgs as g, DEFAULT_SECRET_KEY_NAMES as h, type EventBuilder as i, type EventMetadataOptions as j, type OtlpSpan as k, type RaindropAISDKClient as l, type RaindropAISDKContext as m, type RaindropAISDKOptions as n, type RaindropCallMetadata as o, RaindropTelemetryIntegration as p, type RaindropTelemetryIntegrationOptions as q, type SelfDiagnosticsSignalDefinition as r, type SelfDiagnosticsSignalDefinitions as s, type SelfDiagnosticsTool as t, type SelfDiagnosticsToolInput as u, type SelfDiagnosticsToolOptions as v, type SelfDiagnosticsToolResult as w, type StartSpanArgs as x, type TransformSpanHook as y, type WrappedAI as z };
|
package/dist/index.browser.d.mts
CHANGED
|
@@ -462,6 +462,7 @@ declare class RaindropTelemetryIntegration implements TelemetryIntegration {
|
|
|
462
462
|
onLanguageModelCallStart: (_event: any) => void;
|
|
463
463
|
onLanguageModelCallEnd: (_event: any) => void;
|
|
464
464
|
onChunk: (event: any) => void;
|
|
465
|
+
private emitProviderExecutedToolSpans;
|
|
465
466
|
onStepFinish: (event: any) => void;
|
|
466
467
|
onEmbedStart: (event: any) => void;
|
|
467
468
|
onEmbedFinish: (event: any) => void;
|
|
@@ -893,6 +894,38 @@ type SelfDiagnosticsOptions = {
|
|
|
893
894
|
*/
|
|
894
895
|
toolName?: string;
|
|
895
896
|
};
|
|
897
|
+
type SelfDiagnosticsToolOptions = Omit<SelfDiagnosticsOptions, "enabled"> & {
|
|
898
|
+
/** Fixed Raindrop event ID to attach diagnostic signals to. */
|
|
899
|
+
eventId?: string;
|
|
900
|
+
/** Dynamic event ID resolver, useful when one tool instance serves many runs. */
|
|
901
|
+
getEventId?: () => string | undefined;
|
|
902
|
+
/** Behavior when no event ID can be resolved. Default: "warn" */
|
|
903
|
+
onMissingEventId?: "warn" | "ignore" | "throw";
|
|
904
|
+
};
|
|
905
|
+
type SelfDiagnosticsToolInput = {
|
|
906
|
+
category: string;
|
|
907
|
+
detail: string;
|
|
908
|
+
};
|
|
909
|
+
type SelfDiagnosticsToolResult = {
|
|
910
|
+
acknowledged: true;
|
|
911
|
+
category: string;
|
|
912
|
+
} | {
|
|
913
|
+
acknowledged: false;
|
|
914
|
+
category: string;
|
|
915
|
+
reason: "missing_event_id";
|
|
916
|
+
};
|
|
917
|
+
type SelfDiagnosticsTool = {
|
|
918
|
+
name: string;
|
|
919
|
+
description: string;
|
|
920
|
+
/**
|
|
921
|
+
* AI SDK v4 tool schema. This is the same cross-version schema object as
|
|
922
|
+
* `inputSchema`; both fields are exposed so the tool works on AI SDK v4-v7.
|
|
923
|
+
*/
|
|
924
|
+
parameters: any;
|
|
925
|
+
/** AI SDK v5+ tool schema. */
|
|
926
|
+
inputSchema: any;
|
|
927
|
+
execute(input: SelfDiagnosticsToolInput): Promise<SelfDiagnosticsToolResult>;
|
|
928
|
+
};
|
|
896
929
|
type WrapAISDKOptions = {
|
|
897
930
|
context: RaindropAISDKContext | ((info: {
|
|
898
931
|
operation: string;
|
|
@@ -977,6 +1010,14 @@ type EventPatch = {
|
|
|
977
1010
|
};
|
|
978
1011
|
type RaindropAISDKClient = {
|
|
979
1012
|
wrap<T extends object>(aiSDK: T, options?: WrapAISDKOptions): WrappedAISDK<T>;
|
|
1013
|
+
/**
|
|
1014
|
+
* Create a standalone AI SDK self-diagnostics tool.
|
|
1015
|
+
*
|
|
1016
|
+
* The tool automatically uses the active Raindrop event while executing
|
|
1017
|
+
* under `createTelemetryIntegration()` with tracing enabled. Pass `eventId`
|
|
1018
|
+
* or `getEventId` when no active trace context is available.
|
|
1019
|
+
*/
|
|
1020
|
+
createSelfDiagnosticsTool(options?: SelfDiagnosticsToolOptions): SelfDiagnosticsTool;
|
|
980
1021
|
/**
|
|
981
1022
|
* Create a TelemetryIntegration instance for direct registration with AI SDK v7+.
|
|
982
1023
|
* Use with `registerTelemetryIntegration()` from the `ai` package.
|
|
@@ -1062,4 +1103,4 @@ type RaindropAISDKClient = {
|
|
|
1062
1103
|
};
|
|
1063
1104
|
declare function createRaindropAISDK(opts: RaindropAISDKOptions): RaindropAISDKClient;
|
|
1064
1105
|
|
|
1065
|
-
export { type AISDKChatRequestLike, type AISDKChatRequestMessageLike, type AISDKMessage, type AgentCallMetadata, type AgentWithMetadata, type Attachment, type BuildEventPatch, ContextManager, type ContextSpan, type CreateSpanArgs, DEFAULT_REDACT_ATTRIBUTE_KEYS, DEFAULT_SECRET_KEY_NAMES, type EndSpanArgs, type EventBuilder, type EventMetadataOptions, type IdentifyInput, type OtlpAnyValue, type OtlpSpan, type ParentToolContext, REDACTED_PLACEHOLDER, type RaindropAISDKClient, type RaindropAISDKContext, type RaindropAISDKOptions, type RaindropCallMetadata, RaindropTelemetryIntegration, type RaindropTelemetryIntegrationOptions, type SelfDiagnosticsOptions, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type StartSpanArgs, type TraceSpan, type TransformSpanHook, type WrapAISDKOptions, type WrappedAI, type WrappedAISDK, _resetParentToolContextStorage, _resetRaindropCallMetadataStorage, _resetWarnedMissingUserId, clearParentToolContext, createRaindropAISDK, currentSpan, defaultTransformSpan, enterParentToolContext, eventMetadata, eventMetadataFromChatRequest, getContextManager, getCurrentParentToolContext, getCurrentRaindropCallMetadata, readRaindropCallMetadataFromArgs, redactJsonAttributeValue, redactSecretsInObject, runWithParentToolContext, runWithRaindropCallMetadata, withCurrent };
|
|
1106
|
+
export { type AISDKChatRequestLike, type AISDKChatRequestMessageLike, type AISDKMessage, type AgentCallMetadata, type AgentWithMetadata, type Attachment, type BuildEventPatch, ContextManager, type ContextSpan, type CreateSpanArgs, DEFAULT_REDACT_ATTRIBUTE_KEYS, DEFAULT_SECRET_KEY_NAMES, type EndSpanArgs, type EventBuilder, type EventMetadataOptions, type IdentifyInput, type OtlpAnyValue, type OtlpSpan, type ParentToolContext, REDACTED_PLACEHOLDER, type RaindropAISDKClient, type RaindropAISDKContext, type RaindropAISDKOptions, type RaindropCallMetadata, RaindropTelemetryIntegration, type RaindropTelemetryIntegrationOptions, type SelfDiagnosticsOptions, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type SelfDiagnosticsTool, type SelfDiagnosticsToolInput, type SelfDiagnosticsToolOptions, type SelfDiagnosticsToolResult, type StartSpanArgs, type TraceSpan, type TransformSpanHook, type WrapAISDKOptions, type WrappedAI, type WrappedAISDK, _resetParentToolContextStorage, _resetRaindropCallMetadataStorage, _resetWarnedMissingUserId, clearParentToolContext, createRaindropAISDK, currentSpan, defaultTransformSpan, enterParentToolContext, eventMetadata, eventMetadataFromChatRequest, getContextManager, getCurrentParentToolContext, getCurrentRaindropCallMetadata, readRaindropCallMetadataFromArgs, redactJsonAttributeValue, redactSecretsInObject, runWithParentToolContext, runWithRaindropCallMetadata, withCurrent };
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -462,6 +462,7 @@ declare class RaindropTelemetryIntegration implements TelemetryIntegration {
|
|
|
462
462
|
onLanguageModelCallStart: (_event: any) => void;
|
|
463
463
|
onLanguageModelCallEnd: (_event: any) => void;
|
|
464
464
|
onChunk: (event: any) => void;
|
|
465
|
+
private emitProviderExecutedToolSpans;
|
|
465
466
|
onStepFinish: (event: any) => void;
|
|
466
467
|
onEmbedStart: (event: any) => void;
|
|
467
468
|
onEmbedFinish: (event: any) => void;
|
|
@@ -893,6 +894,38 @@ type SelfDiagnosticsOptions = {
|
|
|
893
894
|
*/
|
|
894
895
|
toolName?: string;
|
|
895
896
|
};
|
|
897
|
+
type SelfDiagnosticsToolOptions = Omit<SelfDiagnosticsOptions, "enabled"> & {
|
|
898
|
+
/** Fixed Raindrop event ID to attach diagnostic signals to. */
|
|
899
|
+
eventId?: string;
|
|
900
|
+
/** Dynamic event ID resolver, useful when one tool instance serves many runs. */
|
|
901
|
+
getEventId?: () => string | undefined;
|
|
902
|
+
/** Behavior when no event ID can be resolved. Default: "warn" */
|
|
903
|
+
onMissingEventId?: "warn" | "ignore" | "throw";
|
|
904
|
+
};
|
|
905
|
+
type SelfDiagnosticsToolInput = {
|
|
906
|
+
category: string;
|
|
907
|
+
detail: string;
|
|
908
|
+
};
|
|
909
|
+
type SelfDiagnosticsToolResult = {
|
|
910
|
+
acknowledged: true;
|
|
911
|
+
category: string;
|
|
912
|
+
} | {
|
|
913
|
+
acknowledged: false;
|
|
914
|
+
category: string;
|
|
915
|
+
reason: "missing_event_id";
|
|
916
|
+
};
|
|
917
|
+
type SelfDiagnosticsTool = {
|
|
918
|
+
name: string;
|
|
919
|
+
description: string;
|
|
920
|
+
/**
|
|
921
|
+
* AI SDK v4 tool schema. This is the same cross-version schema object as
|
|
922
|
+
* `inputSchema`; both fields are exposed so the tool works on AI SDK v4-v7.
|
|
923
|
+
*/
|
|
924
|
+
parameters: any;
|
|
925
|
+
/** AI SDK v5+ tool schema. */
|
|
926
|
+
inputSchema: any;
|
|
927
|
+
execute(input: SelfDiagnosticsToolInput): Promise<SelfDiagnosticsToolResult>;
|
|
928
|
+
};
|
|
896
929
|
type WrapAISDKOptions = {
|
|
897
930
|
context: RaindropAISDKContext | ((info: {
|
|
898
931
|
operation: string;
|
|
@@ -977,6 +1010,14 @@ type EventPatch = {
|
|
|
977
1010
|
};
|
|
978
1011
|
type RaindropAISDKClient = {
|
|
979
1012
|
wrap<T extends object>(aiSDK: T, options?: WrapAISDKOptions): WrappedAISDK<T>;
|
|
1013
|
+
/**
|
|
1014
|
+
* Create a standalone AI SDK self-diagnostics tool.
|
|
1015
|
+
*
|
|
1016
|
+
* The tool automatically uses the active Raindrop event while executing
|
|
1017
|
+
* under `createTelemetryIntegration()` with tracing enabled. Pass `eventId`
|
|
1018
|
+
* or `getEventId` when no active trace context is available.
|
|
1019
|
+
*/
|
|
1020
|
+
createSelfDiagnosticsTool(options?: SelfDiagnosticsToolOptions): SelfDiagnosticsTool;
|
|
980
1021
|
/**
|
|
981
1022
|
* Create a TelemetryIntegration instance for direct registration with AI SDK v7+.
|
|
982
1023
|
* Use with `registerTelemetryIntegration()` from the `ai` package.
|
|
@@ -1062,4 +1103,4 @@ type RaindropAISDKClient = {
|
|
|
1062
1103
|
};
|
|
1063
1104
|
declare function createRaindropAISDK(opts: RaindropAISDKOptions): RaindropAISDKClient;
|
|
1064
1105
|
|
|
1065
|
-
export { type AISDKChatRequestLike, type AISDKChatRequestMessageLike, type AISDKMessage, type AgentCallMetadata, type AgentWithMetadata, type Attachment, type BuildEventPatch, ContextManager, type ContextSpan, type CreateSpanArgs, DEFAULT_REDACT_ATTRIBUTE_KEYS, DEFAULT_SECRET_KEY_NAMES, type EndSpanArgs, type EventBuilder, type EventMetadataOptions, type IdentifyInput, type OtlpAnyValue, type OtlpSpan, type ParentToolContext, REDACTED_PLACEHOLDER, type RaindropAISDKClient, type RaindropAISDKContext, type RaindropAISDKOptions, type RaindropCallMetadata, RaindropTelemetryIntegration, type RaindropTelemetryIntegrationOptions, type SelfDiagnosticsOptions, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type StartSpanArgs, type TraceSpan, type TransformSpanHook, type WrapAISDKOptions, type WrappedAI, type WrappedAISDK, _resetParentToolContextStorage, _resetRaindropCallMetadataStorage, _resetWarnedMissingUserId, clearParentToolContext, createRaindropAISDK, currentSpan, defaultTransformSpan, enterParentToolContext, eventMetadata, eventMetadataFromChatRequest, getContextManager, getCurrentParentToolContext, getCurrentRaindropCallMetadata, readRaindropCallMetadataFromArgs, redactJsonAttributeValue, redactSecretsInObject, runWithParentToolContext, runWithRaindropCallMetadata, withCurrent };
|
|
1106
|
+
export { type AISDKChatRequestLike, type AISDKChatRequestMessageLike, type AISDKMessage, type AgentCallMetadata, type AgentWithMetadata, type Attachment, type BuildEventPatch, ContextManager, type ContextSpan, type CreateSpanArgs, DEFAULT_REDACT_ATTRIBUTE_KEYS, DEFAULT_SECRET_KEY_NAMES, type EndSpanArgs, type EventBuilder, type EventMetadataOptions, type IdentifyInput, type OtlpAnyValue, type OtlpSpan, type ParentToolContext, REDACTED_PLACEHOLDER, type RaindropAISDKClient, type RaindropAISDKContext, type RaindropAISDKOptions, type RaindropCallMetadata, RaindropTelemetryIntegration, type RaindropTelemetryIntegrationOptions, type SelfDiagnosticsOptions, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type SelfDiagnosticsTool, type SelfDiagnosticsToolInput, type SelfDiagnosticsToolOptions, type SelfDiagnosticsToolResult, type StartSpanArgs, type TraceSpan, type TransformSpanHook, type WrapAISDKOptions, type WrappedAI, type WrappedAISDK, _resetParentToolContextStorage, _resetRaindropCallMetadataStorage, _resetWarnedMissingUserId, clearParentToolContext, createRaindropAISDK, currentSpan, defaultTransformSpan, enterParentToolContext, eventMetadata, eventMetadataFromChatRequest, getContextManager, getCurrentParentToolContext, getCurrentRaindropCallMetadata, readRaindropCallMetadataFromArgs, redactJsonAttributeValue, redactSecretsInObject, runWithParentToolContext, runWithRaindropCallMetadata, withCurrent };
|