@raindrop-ai/ai-sdk 0.3.3 → 0.3.4

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.
@@ -765,6 +765,46 @@ declare function getContextManager(): ContextManager;
765
765
  declare function currentSpan(): ContextSpan;
766
766
  declare function withCurrent<R>(span: ContextSpan, callback: () => R): R;
767
767
 
768
+ /**
769
+ * `ai.prompt.tools`: the tool catalog a model call was given, one JSON
770
+ * document per tool, in the shape the Vercel AI SDK records on its
771
+ * `doGenerate` / `doStream` spans. Every integration emits this attribute on
772
+ * its model-call spans so downstream consumers (agent replay, world builder)
773
+ * can read what the model could call instead of guessing from the calls it
774
+ * happened to make.
775
+ *
776
+ * An absent attribute means the integration could not observe the tool list;
777
+ * an empty array means the model had no tools. Callers who know better than
778
+ * the integration pass a `tools` override, which replaces the inferred list.
779
+ */
780
+ declare const PROMPT_TOOLS_ATTRIBUTE = "ai.prompt.tools";
781
+ type JsonSchema = Record<string, unknown>;
782
+ type FunctionToolDeclaration = {
783
+ type: "function";
784
+ name: string;
785
+ description?: string;
786
+ inputSchema?: JsonSchema;
787
+ };
788
+ type ProviderDefinedToolDeclaration = {
789
+ type: "provider-defined";
790
+ id?: string;
791
+ name: string;
792
+ args?: Record<string, unknown>;
793
+ };
794
+ type ToolDeclaration = FunctionToolDeclaration | ProviderDefinedToolDeclaration;
795
+ /**
796
+ * What callers hand to a `tools` override. The canonical `ToolDeclaration`
797
+ * shape is accepted as-is; so is any framework shape `normalizeToolDeclarations`
798
+ * recognizes (OpenAI, Anthropic, Bedrock, LangChain, Pi, Mastra, AI SDK).
799
+ */
800
+ type ToolDeclarationInput = ToolDeclaration | {
801
+ name: string;
802
+ description?: string;
803
+ inputSchema?: JsonSchema;
804
+ parameters?: JsonSchema;
805
+ };
806
+ type PromptToolsOverride = ReadonlyArray<ToolDeclarationInput | unknown>;
807
+
768
808
  declare class EventShipper extends EventShipper$1 {
769
809
  constructor(opts: ConstructorParameters<typeof EventShipper$1>[0]);
770
810
  }
@@ -1118,6 +1158,11 @@ type RaindropTelemetryIntegrationOptions = {
1118
1158
  debug?: boolean;
1119
1159
  /** See {@link SubagentApiOptions.settledEventIds}. */
1120
1160
  settledEventIds?: Set<string>;
1161
+ /**
1162
+ * Overrides the tool catalog recorded as `ai.prompt.tools` on every model
1163
+ * span (replaces the step's tools; `[]` records an empty catalog).
1164
+ */
1165
+ tools?: PromptToolsOverride;
1121
1166
  context?: {
1122
1167
  userId?: string;
1123
1168
  eventId?: string;
@@ -1135,6 +1180,7 @@ declare class RaindropTelemetryIntegration implements TelemetryIntegration {
1135
1180
  private readonly subagentWrapping;
1136
1181
  private readonly debug;
1137
1182
  private readonly defaultContext;
1183
+ private readonly promptTools;
1138
1184
  private readonly callStates;
1139
1185
  /**
1140
1186
  * Per-tool-call snapshot of the parent-tool ALS context taken right
@@ -1804,6 +1850,12 @@ type WrapAISDKOptions = {
1804
1850
  * Default: false (uses Proxy wrapping for backward compatibility).
1805
1851
  */
1806
1852
  nativeTelemetry?: boolean;
1853
+ /**
1854
+ * Overrides the tool catalog recorded as `ai.prompt.tools` on every model
1855
+ * span, replacing the tools the AI SDK hands the model. `[]` records an
1856
+ * explicitly empty catalog.
1857
+ */
1858
+ tools?: PromptToolsOverride;
1807
1859
  };
1808
1860
  /**
1809
1861
  * Opaque handle for a trace span. Pass as `parent` when creating child spans.
@@ -1900,6 +1952,7 @@ type RaindropAISDKClient = {
1900
1952
  createTelemetryIntegration(contextOrOptions?: RaindropTelemetryIntegrationOptions["context"] | {
1901
1953
  context?: RaindropTelemetryIntegrationOptions["context"];
1902
1954
  subagentWrapping?: boolean;
1955
+ tools?: PromptToolsOverride;
1903
1956
  }): RaindropTelemetryIntegration;
1904
1957
  /**
1905
1958
  * Detached sub-agent hand-offs: record a sub-agent that runs in another
@@ -2013,6 +2066,11 @@ type RaindropTelemetryOptions = RaindropAISDKOptions & {
2013
2066
  * spans nest correctly. Enabled by default.
2014
2067
  */
2015
2068
  subagentWrapping?: boolean;
2069
+ /**
2070
+ * Overrides the tool catalog recorded as `ai.prompt.tools` on every model
2071
+ * span. Use when the integration cannot see the tools the model was given.
2072
+ */
2073
+ tools?: PromptToolsOverride;
2016
2074
  };
2017
2075
  /**
2018
2076
  * One-line factory for the AI SDK v7 `registerTelemetry` DX.
@@ -2047,4 +2105,4 @@ type RaindropTelemetryOptions = RaindropAISDKOptions & {
2047
2105
  */
2048
2106
  declare function raindrop(options?: RaindropTelemetryOptions): RaindropTelemetryIntegration;
2049
2107
 
2050
- export { type SubagentRun as $, type AISDKChatRequestLike as A, type BuildEventPatch as B, type CarrierHeaders as C, DEFAULT_MAX_TEXT_FIELD_CHARS as D, type EndSpanArgs as E, type FeatureFlagValue as F, type RaindropTelemetryOptions as G, HANDOFF_ATTRIBUTE_PREFIXES as H, type IdentifyInput as I, SUBAGENT_AGENT_ROLE as J, SUBAGENT_CANCELLED_OUTPUT as K, type SelfDiagnosticsOptions as L, type SelfDiagnosticsSignalDefinition as M, type SelfDiagnosticsSignalDefinitions as N, type OtlpAnyValue as O, type ParentToolContext as P, type SelfDiagnosticsTool as Q, REDACTED_PLACEHOLDER as R, SUBAGENT_ABORTED_OUTPUT as S, type SelfDiagnosticsToolInput as T, type SelfDiagnosticsToolOptions as U, type SelfDiagnosticsToolResult as V, type StartSpanArgs as W, SubagentApi as X, type SubagentDispatch as Y, type SubagentDispatchOptions as Z, type SubagentResumeOptions as _, type AISDKChatRequestMessageLike as a, type SubagentRunMetadata as a0, TOOL_EVENTS_ALLOW as a1, TRUNCATION_MARKER as a2, type TraceCarrier as a3, type TraceSpan as a4, type TransformSpanHook as a5, type WrapAISDKOptions as a6, type WrappedAI as a7, type WrappedAISDK as a8, _resetParentToolContextStorage as a9, _resetRaindropCallMetadataStorage as aa, _resetWarnedMissingUserId as ab, boundedStringify as ac, capText as ad, clearParentToolContext as ae, createRaindropAISDK as af, currentSpan as ag, defaultTransformSpan as ah, enterParentToolContext as ai, eventMetadata as aj, eventMetadataFromChatRequest as ak, fromHeaders as al, getContextManager as am, getCurrentParentToolContext as an, getCurrentRaindropCallMetadata as ao, normalizeFeatureFlags as ap, raindrop as aq, readRaindropCallMetadataFromArgs as ar, redactJsonAttributeValue as as, redactSecretsInObject as at, resetUnresolvedCarrierWarning as au, runWithParentToolContext as av, runWithRaindropCallMetadata as aw, toHeaders as ax, toLangSmithHeaders as ay, withCurrent as az, type AISDKMessage as b, type AgentCallMetadata as c, type AgentWithMetadata as d, type Attachment as e, ContextManager as f, type ContextSpan as g, type CreateSpanArgs as h, DEFAULT_REDACT_ATTRIBUTE_KEYS as i, DEFAULT_SECRET_KEY_NAMES as j, DETACHED_MODE as k, type DetachedChildLink as l, type DetachedDispatch as m, type EventBuilder as n, type EventMetadataOptions as o, type FeatureFlags as p, HANDOFF_ATTRIBUTE_SUFFIXES as q, HANDOFF_TERMINAL_CANCELLED as r, HANDOFF_TERMINAL_PROPERTY_KEY as s, type OtlpSpan as t, type RaindropAISDKClient as u, type RaindropAISDKContext as v, type RaindropAISDKOptions as w, type RaindropCallMetadata as x, RaindropTelemetryIntegration as y, type RaindropTelemetryIntegrationOptions as z };
2108
+ export { type SubagentDispatchOptions as $, type AISDKChatRequestLike as A, type BuildEventPatch as B, type CarrierHeaders as C, DEFAULT_MAX_TEXT_FIELD_CHARS as D, type EndSpanArgs as E, type FeatureFlagValue as F, RaindropTelemetryIntegration as G, HANDOFF_ATTRIBUTE_PREFIXES as H, type IdentifyInput as I, type RaindropTelemetryIntegrationOptions as J, type RaindropTelemetryOptions as K, SUBAGENT_AGENT_ROLE as L, SUBAGENT_CANCELLED_OUTPUT as M, type SelfDiagnosticsOptions as N, type OtlpAnyValue as O, PROMPT_TOOLS_ATTRIBUTE as P, type SelfDiagnosticsSignalDefinition as Q, REDACTED_PLACEHOLDER as R, SUBAGENT_ABORTED_OUTPUT as S, type SelfDiagnosticsSignalDefinitions as T, type SelfDiagnosticsTool as U, type SelfDiagnosticsToolInput as V, type SelfDiagnosticsToolOptions as W, type SelfDiagnosticsToolResult as X, type StartSpanArgs as Y, SubagentApi as Z, type SubagentDispatch as _, type AISDKChatRequestMessageLike as a, type SubagentResumeOptions as a0, type SubagentRun as a1, type SubagentRunMetadata as a2, TOOL_EVENTS_ALLOW as a3, TRUNCATION_MARKER as a4, type ToolDeclaration as a5, type TraceCarrier as a6, type TraceSpan as a7, type TransformSpanHook as a8, type WrapAISDKOptions as a9, toHeaders as aA, toLangSmithHeaders as aB, withCurrent as aC, type WrappedAI as aa, type WrappedAISDK as ab, _resetParentToolContextStorage as ac, _resetRaindropCallMetadataStorage as ad, _resetWarnedMissingUserId as ae, boundedStringify as af, capText as ag, clearParentToolContext as ah, createRaindropAISDK as ai, currentSpan as aj, defaultTransformSpan as ak, enterParentToolContext as al, eventMetadata as am, eventMetadataFromChatRequest as an, fromHeaders as ao, getContextManager as ap, getCurrentParentToolContext as aq, getCurrentRaindropCallMetadata as ar, normalizeFeatureFlags as as, raindrop as at, readRaindropCallMetadataFromArgs as au, redactJsonAttributeValue as av, redactSecretsInObject as aw, resetUnresolvedCarrierWarning as ax, runWithParentToolContext as ay, runWithRaindropCallMetadata as az, type AISDKMessage as b, type AgentCallMetadata as c, type AgentWithMetadata as d, type Attachment as e, ContextManager as f, type ContextSpan as g, type CreateSpanArgs as h, DEFAULT_REDACT_ATTRIBUTE_KEYS as i, DEFAULT_SECRET_KEY_NAMES as j, DETACHED_MODE as k, type DetachedChildLink as l, type DetachedDispatch as m, type EventBuilder as n, type EventMetadataOptions as o, type FeatureFlags as p, HANDOFF_ATTRIBUTE_SUFFIXES as q, HANDOFF_TERMINAL_CANCELLED as r, HANDOFF_TERMINAL_PROPERTY_KEY as s, type OtlpSpan as t, type ParentToolContext as u, type PromptToolsOverride as v, type RaindropAISDKClient as w, type RaindropAISDKContext as x, type RaindropAISDKOptions as y, type RaindropCallMetadata as z };
@@ -765,6 +765,46 @@ declare function getContextManager(): ContextManager;
765
765
  declare function currentSpan(): ContextSpan;
766
766
  declare function withCurrent<R>(span: ContextSpan, callback: () => R): R;
767
767
 
768
+ /**
769
+ * `ai.prompt.tools`: the tool catalog a model call was given, one JSON
770
+ * document per tool, in the shape the Vercel AI SDK records on its
771
+ * `doGenerate` / `doStream` spans. Every integration emits this attribute on
772
+ * its model-call spans so downstream consumers (agent replay, world builder)
773
+ * can read what the model could call instead of guessing from the calls it
774
+ * happened to make.
775
+ *
776
+ * An absent attribute means the integration could not observe the tool list;
777
+ * an empty array means the model had no tools. Callers who know better than
778
+ * the integration pass a `tools` override, which replaces the inferred list.
779
+ */
780
+ declare const PROMPT_TOOLS_ATTRIBUTE = "ai.prompt.tools";
781
+ type JsonSchema = Record<string, unknown>;
782
+ type FunctionToolDeclaration = {
783
+ type: "function";
784
+ name: string;
785
+ description?: string;
786
+ inputSchema?: JsonSchema;
787
+ };
788
+ type ProviderDefinedToolDeclaration = {
789
+ type: "provider-defined";
790
+ id?: string;
791
+ name: string;
792
+ args?: Record<string, unknown>;
793
+ };
794
+ type ToolDeclaration = FunctionToolDeclaration | ProviderDefinedToolDeclaration;
795
+ /**
796
+ * What callers hand to a `tools` override. The canonical `ToolDeclaration`
797
+ * shape is accepted as-is; so is any framework shape `normalizeToolDeclarations`
798
+ * recognizes (OpenAI, Anthropic, Bedrock, LangChain, Pi, Mastra, AI SDK).
799
+ */
800
+ type ToolDeclarationInput = ToolDeclaration | {
801
+ name: string;
802
+ description?: string;
803
+ inputSchema?: JsonSchema;
804
+ parameters?: JsonSchema;
805
+ };
806
+ type PromptToolsOverride = ReadonlyArray<ToolDeclarationInput | unknown>;
807
+
768
808
  declare class EventShipper extends EventShipper$1 {
769
809
  constructor(opts: ConstructorParameters<typeof EventShipper$1>[0]);
770
810
  }
@@ -1118,6 +1158,11 @@ type RaindropTelemetryIntegrationOptions = {
1118
1158
  debug?: boolean;
1119
1159
  /** See {@link SubagentApiOptions.settledEventIds}. */
1120
1160
  settledEventIds?: Set<string>;
1161
+ /**
1162
+ * Overrides the tool catalog recorded as `ai.prompt.tools` on every model
1163
+ * span (replaces the step's tools; `[]` records an empty catalog).
1164
+ */
1165
+ tools?: PromptToolsOverride;
1121
1166
  context?: {
1122
1167
  userId?: string;
1123
1168
  eventId?: string;
@@ -1135,6 +1180,7 @@ declare class RaindropTelemetryIntegration implements TelemetryIntegration {
1135
1180
  private readonly subagentWrapping;
1136
1181
  private readonly debug;
1137
1182
  private readonly defaultContext;
1183
+ private readonly promptTools;
1138
1184
  private readonly callStates;
1139
1185
  /**
1140
1186
  * Per-tool-call snapshot of the parent-tool ALS context taken right
@@ -1804,6 +1850,12 @@ type WrapAISDKOptions = {
1804
1850
  * Default: false (uses Proxy wrapping for backward compatibility).
1805
1851
  */
1806
1852
  nativeTelemetry?: boolean;
1853
+ /**
1854
+ * Overrides the tool catalog recorded as `ai.prompt.tools` on every model
1855
+ * span, replacing the tools the AI SDK hands the model. `[]` records an
1856
+ * explicitly empty catalog.
1857
+ */
1858
+ tools?: PromptToolsOverride;
1807
1859
  };
1808
1860
  /**
1809
1861
  * Opaque handle for a trace span. Pass as `parent` when creating child spans.
@@ -1900,6 +1952,7 @@ type RaindropAISDKClient = {
1900
1952
  createTelemetryIntegration(contextOrOptions?: RaindropTelemetryIntegrationOptions["context"] | {
1901
1953
  context?: RaindropTelemetryIntegrationOptions["context"];
1902
1954
  subagentWrapping?: boolean;
1955
+ tools?: PromptToolsOverride;
1903
1956
  }): RaindropTelemetryIntegration;
1904
1957
  /**
1905
1958
  * Detached sub-agent hand-offs: record a sub-agent that runs in another
@@ -2013,6 +2066,11 @@ type RaindropTelemetryOptions = RaindropAISDKOptions & {
2013
2066
  * spans nest correctly. Enabled by default.
2014
2067
  */
2015
2068
  subagentWrapping?: boolean;
2069
+ /**
2070
+ * Overrides the tool catalog recorded as `ai.prompt.tools` on every model
2071
+ * span. Use when the integration cannot see the tools the model was given.
2072
+ */
2073
+ tools?: PromptToolsOverride;
2016
2074
  };
2017
2075
  /**
2018
2076
  * One-line factory for the AI SDK v7 `registerTelemetry` DX.
@@ -2047,4 +2105,4 @@ type RaindropTelemetryOptions = RaindropAISDKOptions & {
2047
2105
  */
2048
2106
  declare function raindrop(options?: RaindropTelemetryOptions): RaindropTelemetryIntegration;
2049
2107
 
2050
- export { type SubagentRun as $, type AISDKChatRequestLike as A, type BuildEventPatch as B, type CarrierHeaders as C, DEFAULT_MAX_TEXT_FIELD_CHARS as D, type EndSpanArgs as E, type FeatureFlagValue as F, type RaindropTelemetryOptions as G, HANDOFF_ATTRIBUTE_PREFIXES as H, type IdentifyInput as I, SUBAGENT_AGENT_ROLE as J, SUBAGENT_CANCELLED_OUTPUT as K, type SelfDiagnosticsOptions as L, type SelfDiagnosticsSignalDefinition as M, type SelfDiagnosticsSignalDefinitions as N, type OtlpAnyValue as O, type ParentToolContext as P, type SelfDiagnosticsTool as Q, REDACTED_PLACEHOLDER as R, SUBAGENT_ABORTED_OUTPUT as S, type SelfDiagnosticsToolInput as T, type SelfDiagnosticsToolOptions as U, type SelfDiagnosticsToolResult as V, type StartSpanArgs as W, SubagentApi as X, type SubagentDispatch as Y, type SubagentDispatchOptions as Z, type SubagentResumeOptions as _, type AISDKChatRequestMessageLike as a, type SubagentRunMetadata as a0, TOOL_EVENTS_ALLOW as a1, TRUNCATION_MARKER as a2, type TraceCarrier as a3, type TraceSpan as a4, type TransformSpanHook as a5, type WrapAISDKOptions as a6, type WrappedAI as a7, type WrappedAISDK as a8, _resetParentToolContextStorage as a9, _resetRaindropCallMetadataStorage as aa, _resetWarnedMissingUserId as ab, boundedStringify as ac, capText as ad, clearParentToolContext as ae, createRaindropAISDK as af, currentSpan as ag, defaultTransformSpan as ah, enterParentToolContext as ai, eventMetadata as aj, eventMetadataFromChatRequest as ak, fromHeaders as al, getContextManager as am, getCurrentParentToolContext as an, getCurrentRaindropCallMetadata as ao, normalizeFeatureFlags as ap, raindrop as aq, readRaindropCallMetadataFromArgs as ar, redactJsonAttributeValue as as, redactSecretsInObject as at, resetUnresolvedCarrierWarning as au, runWithParentToolContext as av, runWithRaindropCallMetadata as aw, toHeaders as ax, toLangSmithHeaders as ay, withCurrent as az, type AISDKMessage as b, type AgentCallMetadata as c, type AgentWithMetadata as d, type Attachment as e, ContextManager as f, type ContextSpan as g, type CreateSpanArgs as h, DEFAULT_REDACT_ATTRIBUTE_KEYS as i, DEFAULT_SECRET_KEY_NAMES as j, DETACHED_MODE as k, type DetachedChildLink as l, type DetachedDispatch as m, type EventBuilder as n, type EventMetadataOptions as o, type FeatureFlags as p, HANDOFF_ATTRIBUTE_SUFFIXES as q, HANDOFF_TERMINAL_CANCELLED as r, HANDOFF_TERMINAL_PROPERTY_KEY as s, type OtlpSpan as t, type RaindropAISDKClient as u, type RaindropAISDKContext as v, type RaindropAISDKOptions as w, type RaindropCallMetadata as x, RaindropTelemetryIntegration as y, type RaindropTelemetryIntegrationOptions as z };
2108
+ export { type SubagentDispatchOptions as $, type AISDKChatRequestLike as A, type BuildEventPatch as B, type CarrierHeaders as C, DEFAULT_MAX_TEXT_FIELD_CHARS as D, type EndSpanArgs as E, type FeatureFlagValue as F, RaindropTelemetryIntegration as G, HANDOFF_ATTRIBUTE_PREFIXES as H, type IdentifyInput as I, type RaindropTelemetryIntegrationOptions as J, type RaindropTelemetryOptions as K, SUBAGENT_AGENT_ROLE as L, SUBAGENT_CANCELLED_OUTPUT as M, type SelfDiagnosticsOptions as N, type OtlpAnyValue as O, PROMPT_TOOLS_ATTRIBUTE as P, type SelfDiagnosticsSignalDefinition as Q, REDACTED_PLACEHOLDER as R, SUBAGENT_ABORTED_OUTPUT as S, type SelfDiagnosticsSignalDefinitions as T, type SelfDiagnosticsTool as U, type SelfDiagnosticsToolInput as V, type SelfDiagnosticsToolOptions as W, type SelfDiagnosticsToolResult as X, type StartSpanArgs as Y, SubagentApi as Z, type SubagentDispatch as _, type AISDKChatRequestMessageLike as a, type SubagentResumeOptions as a0, type SubagentRun as a1, type SubagentRunMetadata as a2, TOOL_EVENTS_ALLOW as a3, TRUNCATION_MARKER as a4, type ToolDeclaration as a5, type TraceCarrier as a6, type TraceSpan as a7, type TransformSpanHook as a8, type WrapAISDKOptions as a9, toHeaders as aA, toLangSmithHeaders as aB, withCurrent as aC, type WrappedAI as aa, type WrappedAISDK as ab, _resetParentToolContextStorage as ac, _resetRaindropCallMetadataStorage as ad, _resetWarnedMissingUserId as ae, boundedStringify as af, capText as ag, clearParentToolContext as ah, createRaindropAISDK as ai, currentSpan as aj, defaultTransformSpan as ak, enterParentToolContext as al, eventMetadata as am, eventMetadataFromChatRequest as an, fromHeaders as ao, getContextManager as ap, getCurrentParentToolContext as aq, getCurrentRaindropCallMetadata as ar, normalizeFeatureFlags as as, raindrop as at, readRaindropCallMetadataFromArgs as au, redactJsonAttributeValue as av, redactSecretsInObject as aw, resetUnresolvedCarrierWarning as ax, runWithParentToolContext as ay, runWithRaindropCallMetadata as az, type AISDKMessage as b, type AgentCallMetadata as c, type AgentWithMetadata as d, type Attachment as e, ContextManager as f, type ContextSpan as g, type CreateSpanArgs as h, DEFAULT_REDACT_ATTRIBUTE_KEYS as i, DEFAULT_SECRET_KEY_NAMES as j, DETACHED_MODE as k, type DetachedChildLink as l, type DetachedDispatch as m, type EventBuilder as n, type EventMetadataOptions as o, type FeatureFlags as p, HANDOFF_ATTRIBUTE_SUFFIXES as q, HANDOFF_TERMINAL_CANCELLED as r, HANDOFF_TERMINAL_PROPERTY_KEY as s, type OtlpSpan as t, type ParentToolContext as u, type PromptToolsOverride as v, type RaindropAISDKClient as w, type RaindropAISDKContext as x, type RaindropAISDKOptions as y, type RaindropCallMetadata as z };
@@ -765,6 +765,46 @@ declare function getContextManager(): ContextManager;
765
765
  declare function currentSpan(): ContextSpan;
766
766
  declare function withCurrent<R>(span: ContextSpan, callback: () => R): R;
767
767
 
768
+ /**
769
+ * `ai.prompt.tools`: the tool catalog a model call was given, one JSON
770
+ * document per tool, in the shape the Vercel AI SDK records on its
771
+ * `doGenerate` / `doStream` spans. Every integration emits this attribute on
772
+ * its model-call spans so downstream consumers (agent replay, world builder)
773
+ * can read what the model could call instead of guessing from the calls it
774
+ * happened to make.
775
+ *
776
+ * An absent attribute means the integration could not observe the tool list;
777
+ * an empty array means the model had no tools. Callers who know better than
778
+ * the integration pass a `tools` override, which replaces the inferred list.
779
+ */
780
+ declare const PROMPT_TOOLS_ATTRIBUTE = "ai.prompt.tools";
781
+ type JsonSchema = Record<string, unknown>;
782
+ type FunctionToolDeclaration = {
783
+ type: "function";
784
+ name: string;
785
+ description?: string;
786
+ inputSchema?: JsonSchema;
787
+ };
788
+ type ProviderDefinedToolDeclaration = {
789
+ type: "provider-defined";
790
+ id?: string;
791
+ name: string;
792
+ args?: Record<string, unknown>;
793
+ };
794
+ type ToolDeclaration = FunctionToolDeclaration | ProviderDefinedToolDeclaration;
795
+ /**
796
+ * What callers hand to a `tools` override. The canonical `ToolDeclaration`
797
+ * shape is accepted as-is; so is any framework shape `normalizeToolDeclarations`
798
+ * recognizes (OpenAI, Anthropic, Bedrock, LangChain, Pi, Mastra, AI SDK).
799
+ */
800
+ type ToolDeclarationInput = ToolDeclaration | {
801
+ name: string;
802
+ description?: string;
803
+ inputSchema?: JsonSchema;
804
+ parameters?: JsonSchema;
805
+ };
806
+ type PromptToolsOverride = ReadonlyArray<ToolDeclarationInput | unknown>;
807
+
768
808
  declare class EventShipper extends EventShipper$1 {
769
809
  constructor(opts: ConstructorParameters<typeof EventShipper$1>[0]);
770
810
  }
@@ -1118,6 +1158,11 @@ type RaindropTelemetryIntegrationOptions = {
1118
1158
  debug?: boolean;
1119
1159
  /** See {@link SubagentApiOptions.settledEventIds}. */
1120
1160
  settledEventIds?: Set<string>;
1161
+ /**
1162
+ * Overrides the tool catalog recorded as `ai.prompt.tools` on every model
1163
+ * span (replaces the step's tools; `[]` records an empty catalog).
1164
+ */
1165
+ tools?: PromptToolsOverride;
1121
1166
  context?: {
1122
1167
  userId?: string;
1123
1168
  eventId?: string;
@@ -1135,6 +1180,7 @@ declare class RaindropTelemetryIntegration implements TelemetryIntegration {
1135
1180
  private readonly subagentWrapping;
1136
1181
  private readonly debug;
1137
1182
  private readonly defaultContext;
1183
+ private readonly promptTools;
1138
1184
  private readonly callStates;
1139
1185
  /**
1140
1186
  * Per-tool-call snapshot of the parent-tool ALS context taken right
@@ -1804,6 +1850,12 @@ type WrapAISDKOptions = {
1804
1850
  * Default: false (uses Proxy wrapping for backward compatibility).
1805
1851
  */
1806
1852
  nativeTelemetry?: boolean;
1853
+ /**
1854
+ * Overrides the tool catalog recorded as `ai.prompt.tools` on every model
1855
+ * span, replacing the tools the AI SDK hands the model. `[]` records an
1856
+ * explicitly empty catalog.
1857
+ */
1858
+ tools?: PromptToolsOverride;
1807
1859
  };
1808
1860
  /**
1809
1861
  * Opaque handle for a trace span. Pass as `parent` when creating child spans.
@@ -1900,6 +1952,7 @@ type RaindropAISDKClient = {
1900
1952
  createTelemetryIntegration(contextOrOptions?: RaindropTelemetryIntegrationOptions["context"] | {
1901
1953
  context?: RaindropTelemetryIntegrationOptions["context"];
1902
1954
  subagentWrapping?: boolean;
1955
+ tools?: PromptToolsOverride;
1903
1956
  }): RaindropTelemetryIntegration;
1904
1957
  /**
1905
1958
  * Detached sub-agent hand-offs: record a sub-agent that runs in another
@@ -2013,6 +2066,11 @@ type RaindropTelemetryOptions = RaindropAISDKOptions & {
2013
2066
  * spans nest correctly. Enabled by default.
2014
2067
  */
2015
2068
  subagentWrapping?: boolean;
2069
+ /**
2070
+ * Overrides the tool catalog recorded as `ai.prompt.tools` on every model
2071
+ * span. Use when the integration cannot see the tools the model was given.
2072
+ */
2073
+ tools?: PromptToolsOverride;
2016
2074
  };
2017
2075
  /**
2018
2076
  * One-line factory for the AI SDK v7 `registerTelemetry` DX.
@@ -2047,4 +2105,4 @@ type RaindropTelemetryOptions = RaindropAISDKOptions & {
2047
2105
  */
2048
2106
  declare function raindrop(options?: RaindropTelemetryOptions): RaindropTelemetryIntegration;
2049
2107
 
2050
- export { type AISDKChatRequestLike, type AISDKChatRequestMessageLike, type AISDKMessage, type AgentCallMetadata, type AgentWithMetadata, type Attachment, type BuildEventPatch, type CarrierHeaders, ContextManager, type ContextSpan, type CreateSpanArgs, DEFAULT_MAX_TEXT_FIELD_CHARS, DEFAULT_REDACT_ATTRIBUTE_KEYS, DEFAULT_SECRET_KEY_NAMES, DETACHED_MODE, type DetachedChildLink, type DetachedDispatch, type EndSpanArgs, type EventBuilder, type EventMetadataOptions, type FeatureFlagValue, type FeatureFlags, HANDOFF_ATTRIBUTE_PREFIXES, HANDOFF_ATTRIBUTE_SUFFIXES, HANDOFF_TERMINAL_CANCELLED, HANDOFF_TERMINAL_PROPERTY_KEY, type IdentifyInput, type OtlpAnyValue, type OtlpSpan, type ParentToolContext, REDACTED_PLACEHOLDER, type RaindropAISDKClient, type RaindropAISDKContext, type RaindropAISDKOptions, type RaindropCallMetadata, RaindropTelemetryIntegration, type RaindropTelemetryIntegrationOptions, type RaindropTelemetryOptions, SUBAGENT_ABORTED_OUTPUT, SUBAGENT_AGENT_ROLE, SUBAGENT_CANCELLED_OUTPUT, type SelfDiagnosticsOptions, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type SelfDiagnosticsTool, type SelfDiagnosticsToolInput, type SelfDiagnosticsToolOptions, type SelfDiagnosticsToolResult, type StartSpanArgs, SubagentApi, type SubagentDispatch, type SubagentDispatchOptions, type SubagentResumeOptions, type SubagentRun, type SubagentRunMetadata, TOOL_EVENTS_ALLOW, TRUNCATION_MARKER, type TraceCarrier, type TraceSpan, type TransformSpanHook, type WrapAISDKOptions, type WrappedAI, type WrappedAISDK, _resetParentToolContextStorage, _resetRaindropCallMetadataStorage, _resetWarnedMissingUserId, boundedStringify, capText, clearParentToolContext, createRaindropAISDK, currentSpan, defaultTransformSpan, enterParentToolContext, eventMetadata, eventMetadataFromChatRequest, fromHeaders, getContextManager, getCurrentParentToolContext, getCurrentRaindropCallMetadata, normalizeFeatureFlags, raindrop, readRaindropCallMetadataFromArgs, redactJsonAttributeValue, redactSecretsInObject, resetUnresolvedCarrierWarning, runWithParentToolContext, runWithRaindropCallMetadata, toHeaders, toLangSmithHeaders, withCurrent };
2108
+ export { type AISDKChatRequestLike, type AISDKChatRequestMessageLike, type AISDKMessage, type AgentCallMetadata, type AgentWithMetadata, type Attachment, type BuildEventPatch, type CarrierHeaders, ContextManager, type ContextSpan, type CreateSpanArgs, DEFAULT_MAX_TEXT_FIELD_CHARS, DEFAULT_REDACT_ATTRIBUTE_KEYS, DEFAULT_SECRET_KEY_NAMES, DETACHED_MODE, type DetachedChildLink, type DetachedDispatch, type EndSpanArgs, type EventBuilder, type EventMetadataOptions, type FeatureFlagValue, type FeatureFlags, HANDOFF_ATTRIBUTE_PREFIXES, HANDOFF_ATTRIBUTE_SUFFIXES, HANDOFF_TERMINAL_CANCELLED, HANDOFF_TERMINAL_PROPERTY_KEY, type IdentifyInput, type OtlpAnyValue, type OtlpSpan, PROMPT_TOOLS_ATTRIBUTE, type ParentToolContext, type PromptToolsOverride, REDACTED_PLACEHOLDER, type RaindropAISDKClient, type RaindropAISDKContext, type RaindropAISDKOptions, type RaindropCallMetadata, RaindropTelemetryIntegration, type RaindropTelemetryIntegrationOptions, type RaindropTelemetryOptions, SUBAGENT_ABORTED_OUTPUT, SUBAGENT_AGENT_ROLE, SUBAGENT_CANCELLED_OUTPUT, type SelfDiagnosticsOptions, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type SelfDiagnosticsTool, type SelfDiagnosticsToolInput, type SelfDiagnosticsToolOptions, type SelfDiagnosticsToolResult, type StartSpanArgs, SubagentApi, type SubagentDispatch, type SubagentDispatchOptions, type SubagentResumeOptions, type SubagentRun, type SubagentRunMetadata, TOOL_EVENTS_ALLOW, TRUNCATION_MARKER, type ToolDeclaration, type TraceCarrier, type TraceSpan, type TransformSpanHook, type WrapAISDKOptions, type WrappedAI, type WrappedAISDK, _resetParentToolContextStorage, _resetRaindropCallMetadataStorage, _resetWarnedMissingUserId, boundedStringify, capText, clearParentToolContext, createRaindropAISDK, currentSpan, defaultTransformSpan, enterParentToolContext, eventMetadata, eventMetadataFromChatRequest, fromHeaders, getContextManager, getCurrentParentToolContext, getCurrentRaindropCallMetadata, normalizeFeatureFlags, raindrop, readRaindropCallMetadataFromArgs, redactJsonAttributeValue, redactSecretsInObject, resetUnresolvedCarrierWarning, runWithParentToolContext, runWithRaindropCallMetadata, toHeaders, toLangSmithHeaders, withCurrent };
@@ -765,6 +765,46 @@ declare function getContextManager(): ContextManager;
765
765
  declare function currentSpan(): ContextSpan;
766
766
  declare function withCurrent<R>(span: ContextSpan, callback: () => R): R;
767
767
 
768
+ /**
769
+ * `ai.prompt.tools`: the tool catalog a model call was given, one JSON
770
+ * document per tool, in the shape the Vercel AI SDK records on its
771
+ * `doGenerate` / `doStream` spans. Every integration emits this attribute on
772
+ * its model-call spans so downstream consumers (agent replay, world builder)
773
+ * can read what the model could call instead of guessing from the calls it
774
+ * happened to make.
775
+ *
776
+ * An absent attribute means the integration could not observe the tool list;
777
+ * an empty array means the model had no tools. Callers who know better than
778
+ * the integration pass a `tools` override, which replaces the inferred list.
779
+ */
780
+ declare const PROMPT_TOOLS_ATTRIBUTE = "ai.prompt.tools";
781
+ type JsonSchema = Record<string, unknown>;
782
+ type FunctionToolDeclaration = {
783
+ type: "function";
784
+ name: string;
785
+ description?: string;
786
+ inputSchema?: JsonSchema;
787
+ };
788
+ type ProviderDefinedToolDeclaration = {
789
+ type: "provider-defined";
790
+ id?: string;
791
+ name: string;
792
+ args?: Record<string, unknown>;
793
+ };
794
+ type ToolDeclaration = FunctionToolDeclaration | ProviderDefinedToolDeclaration;
795
+ /**
796
+ * What callers hand to a `tools` override. The canonical `ToolDeclaration`
797
+ * shape is accepted as-is; so is any framework shape `normalizeToolDeclarations`
798
+ * recognizes (OpenAI, Anthropic, Bedrock, LangChain, Pi, Mastra, AI SDK).
799
+ */
800
+ type ToolDeclarationInput = ToolDeclaration | {
801
+ name: string;
802
+ description?: string;
803
+ inputSchema?: JsonSchema;
804
+ parameters?: JsonSchema;
805
+ };
806
+ type PromptToolsOverride = ReadonlyArray<ToolDeclarationInput | unknown>;
807
+
768
808
  declare class EventShipper extends EventShipper$1 {
769
809
  constructor(opts: ConstructorParameters<typeof EventShipper$1>[0]);
770
810
  }
@@ -1118,6 +1158,11 @@ type RaindropTelemetryIntegrationOptions = {
1118
1158
  debug?: boolean;
1119
1159
  /** See {@link SubagentApiOptions.settledEventIds}. */
1120
1160
  settledEventIds?: Set<string>;
1161
+ /**
1162
+ * Overrides the tool catalog recorded as `ai.prompt.tools` on every model
1163
+ * span (replaces the step's tools; `[]` records an empty catalog).
1164
+ */
1165
+ tools?: PromptToolsOverride;
1121
1166
  context?: {
1122
1167
  userId?: string;
1123
1168
  eventId?: string;
@@ -1135,6 +1180,7 @@ declare class RaindropTelemetryIntegration implements TelemetryIntegration {
1135
1180
  private readonly subagentWrapping;
1136
1181
  private readonly debug;
1137
1182
  private readonly defaultContext;
1183
+ private readonly promptTools;
1138
1184
  private readonly callStates;
1139
1185
  /**
1140
1186
  * Per-tool-call snapshot of the parent-tool ALS context taken right
@@ -1804,6 +1850,12 @@ type WrapAISDKOptions = {
1804
1850
  * Default: false (uses Proxy wrapping for backward compatibility).
1805
1851
  */
1806
1852
  nativeTelemetry?: boolean;
1853
+ /**
1854
+ * Overrides the tool catalog recorded as `ai.prompt.tools` on every model
1855
+ * span, replacing the tools the AI SDK hands the model. `[]` records an
1856
+ * explicitly empty catalog.
1857
+ */
1858
+ tools?: PromptToolsOverride;
1807
1859
  };
1808
1860
  /**
1809
1861
  * Opaque handle for a trace span. Pass as `parent` when creating child spans.
@@ -1900,6 +1952,7 @@ type RaindropAISDKClient = {
1900
1952
  createTelemetryIntegration(contextOrOptions?: RaindropTelemetryIntegrationOptions["context"] | {
1901
1953
  context?: RaindropTelemetryIntegrationOptions["context"];
1902
1954
  subagentWrapping?: boolean;
1955
+ tools?: PromptToolsOverride;
1903
1956
  }): RaindropTelemetryIntegration;
1904
1957
  /**
1905
1958
  * Detached sub-agent hand-offs: record a sub-agent that runs in another
@@ -2013,6 +2066,11 @@ type RaindropTelemetryOptions = RaindropAISDKOptions & {
2013
2066
  * spans nest correctly. Enabled by default.
2014
2067
  */
2015
2068
  subagentWrapping?: boolean;
2069
+ /**
2070
+ * Overrides the tool catalog recorded as `ai.prompt.tools` on every model
2071
+ * span. Use when the integration cannot see the tools the model was given.
2072
+ */
2073
+ tools?: PromptToolsOverride;
2016
2074
  };
2017
2075
  /**
2018
2076
  * One-line factory for the AI SDK v7 `registerTelemetry` DX.
@@ -2047,4 +2105,4 @@ type RaindropTelemetryOptions = RaindropAISDKOptions & {
2047
2105
  */
2048
2106
  declare function raindrop(options?: RaindropTelemetryOptions): RaindropTelemetryIntegration;
2049
2107
 
2050
- export { type AISDKChatRequestLike, type AISDKChatRequestMessageLike, type AISDKMessage, type AgentCallMetadata, type AgentWithMetadata, type Attachment, type BuildEventPatch, type CarrierHeaders, ContextManager, type ContextSpan, type CreateSpanArgs, DEFAULT_MAX_TEXT_FIELD_CHARS, DEFAULT_REDACT_ATTRIBUTE_KEYS, DEFAULT_SECRET_KEY_NAMES, DETACHED_MODE, type DetachedChildLink, type DetachedDispatch, type EndSpanArgs, type EventBuilder, type EventMetadataOptions, type FeatureFlagValue, type FeatureFlags, HANDOFF_ATTRIBUTE_PREFIXES, HANDOFF_ATTRIBUTE_SUFFIXES, HANDOFF_TERMINAL_CANCELLED, HANDOFF_TERMINAL_PROPERTY_KEY, type IdentifyInput, type OtlpAnyValue, type OtlpSpan, type ParentToolContext, REDACTED_PLACEHOLDER, type RaindropAISDKClient, type RaindropAISDKContext, type RaindropAISDKOptions, type RaindropCallMetadata, RaindropTelemetryIntegration, type RaindropTelemetryIntegrationOptions, type RaindropTelemetryOptions, SUBAGENT_ABORTED_OUTPUT, SUBAGENT_AGENT_ROLE, SUBAGENT_CANCELLED_OUTPUT, type SelfDiagnosticsOptions, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type SelfDiagnosticsTool, type SelfDiagnosticsToolInput, type SelfDiagnosticsToolOptions, type SelfDiagnosticsToolResult, type StartSpanArgs, SubagentApi, type SubagentDispatch, type SubagentDispatchOptions, type SubagentResumeOptions, type SubagentRun, type SubagentRunMetadata, TOOL_EVENTS_ALLOW, TRUNCATION_MARKER, type TraceCarrier, type TraceSpan, type TransformSpanHook, type WrapAISDKOptions, type WrappedAI, type WrappedAISDK, _resetParentToolContextStorage, _resetRaindropCallMetadataStorage, _resetWarnedMissingUserId, boundedStringify, capText, clearParentToolContext, createRaindropAISDK, currentSpan, defaultTransformSpan, enterParentToolContext, eventMetadata, eventMetadataFromChatRequest, fromHeaders, getContextManager, getCurrentParentToolContext, getCurrentRaindropCallMetadata, normalizeFeatureFlags, raindrop, readRaindropCallMetadataFromArgs, redactJsonAttributeValue, redactSecretsInObject, resetUnresolvedCarrierWarning, runWithParentToolContext, runWithRaindropCallMetadata, toHeaders, toLangSmithHeaders, withCurrent };
2108
+ export { type AISDKChatRequestLike, type AISDKChatRequestMessageLike, type AISDKMessage, type AgentCallMetadata, type AgentWithMetadata, type Attachment, type BuildEventPatch, type CarrierHeaders, ContextManager, type ContextSpan, type CreateSpanArgs, DEFAULT_MAX_TEXT_FIELD_CHARS, DEFAULT_REDACT_ATTRIBUTE_KEYS, DEFAULT_SECRET_KEY_NAMES, DETACHED_MODE, type DetachedChildLink, type DetachedDispatch, type EndSpanArgs, type EventBuilder, type EventMetadataOptions, type FeatureFlagValue, type FeatureFlags, HANDOFF_ATTRIBUTE_PREFIXES, HANDOFF_ATTRIBUTE_SUFFIXES, HANDOFF_TERMINAL_CANCELLED, HANDOFF_TERMINAL_PROPERTY_KEY, type IdentifyInput, type OtlpAnyValue, type OtlpSpan, PROMPT_TOOLS_ATTRIBUTE, type ParentToolContext, type PromptToolsOverride, REDACTED_PLACEHOLDER, type RaindropAISDKClient, type RaindropAISDKContext, type RaindropAISDKOptions, type RaindropCallMetadata, RaindropTelemetryIntegration, type RaindropTelemetryIntegrationOptions, type RaindropTelemetryOptions, SUBAGENT_ABORTED_OUTPUT, SUBAGENT_AGENT_ROLE, SUBAGENT_CANCELLED_OUTPUT, type SelfDiagnosticsOptions, type SelfDiagnosticsSignalDefinition, type SelfDiagnosticsSignalDefinitions, type SelfDiagnosticsTool, type SelfDiagnosticsToolInput, type SelfDiagnosticsToolOptions, type SelfDiagnosticsToolResult, type StartSpanArgs, SubagentApi, type SubagentDispatch, type SubagentDispatchOptions, type SubagentResumeOptions, type SubagentRun, type SubagentRunMetadata, TOOL_EVENTS_ALLOW, TRUNCATION_MARKER, type ToolDeclaration, type TraceCarrier, type TraceSpan, type TransformSpanHook, type WrapAISDKOptions, type WrappedAI, type WrappedAISDK, _resetParentToolContextStorage, _resetRaindropCallMetadataStorage, _resetWarnedMissingUserId, boundedStringify, capText, clearParentToolContext, createRaindropAISDK, currentSpan, defaultTransformSpan, enterParentToolContext, eventMetadata, eventMetadataFromChatRequest, fromHeaders, getContextManager, getCurrentParentToolContext, getCurrentRaindropCallMetadata, normalizeFeatureFlags, raindrop, readRaindropCallMetadataFromArgs, redactJsonAttributeValue, redactSecretsInObject, resetUnresolvedCarrierWarning, runWithParentToolContext, runWithRaindropCallMetadata, toHeaders, toLangSmithHeaders, withCurrent };