@raindrop-ai/ai-sdk 0.3.2 → 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.
package/README.md CHANGED
@@ -55,6 +55,28 @@ await raindrop.users.identify({
55
55
  await raindrop.flush();
56
56
  ```
57
57
 
58
+ ## Tool catalog capture
59
+
60
+ Every model-call span (`ai.generateText.doGenerate`, `ai.streamText.doStream`, ...)
61
+ records the tools the model was given as `ai.prompt.tools`: one JSON document per
62
+ tool with `name`, `description` and the JSON Schema as `inputSchema` (Zod and other
63
+ framework schemas are converted through the AI SDK's own `asSchema`). Provider-defined
64
+ tools (`openai.web_search`, ...) keep their `id` / `args` and get no invented schema.
65
+ This works on both the `wrap()` Proxy path and the v7 native telemetry path and is
66
+ gated by `recordInputs`, like `ai.prompt.messages`.
67
+
68
+ | Option | Type | Default | Description |
69
+ | --- | --- | --- | --- |
70
+ | `tools` | `ToolDeclaration[]` | - | Overrides the tool catalog recorded as `ai.prompt.tools` on every model span. Use when the integration cannot see the tools the model was given. |
71
+
72
+ ```ts
73
+ // wrap() path
74
+ const { generateText } = raindrop.wrap(ai, { context: { userId }, tools: myToolCatalog });
75
+ // v7 native telemetry path
76
+ registerTelemetry(raindrop({ writeKey, tools: myToolCatalog }));
77
+ registerTelemetry(client.createTelemetryIntegration({ context: { userId }, tools: [] }));
78
+ ```
79
+
58
80
  ## Projects
59
81
 
60
82
  If your org has multiple projects, route events to a specific one by passing its
@@ -71,6 +93,32 @@ This sets the `X-Raindrop-Project-Id` header on every event and trace. Omit it
71
93
  (or pass `"default"`) to use your org's default **Production** project — the
72
94
  existing behavior. Single-project orgs need nothing new.
73
95
 
96
+ ## Application Git identity
97
+
98
+ Each client reports the application commit SHA when it can determine one. In Node.js, local Git discovery runs in the background and never delays or fails application calls. Browser and edge builds do not import Node Git/filesystem APIs. Automatic branch discovery is off by default.
99
+
100
+ ```ts
101
+ const raindrop = createRaindropAISDK({
102
+ writeKey: process.env.RAINDROP_WRITE_KEY!,
103
+ appGit: {
104
+ commitSha: "0123456789abcdef0123456789abcdef01234567",
105
+ commitDirty: false,
106
+ branch: "main",
107
+ detectBranch: true,
108
+ sourceDirectory: "/path/to/application",
109
+ },
110
+ });
111
+
112
+ const withoutGit = createRaindropAISDK({
113
+ writeKey: process.env.RAINDROP_WRITE_KEY!,
114
+ appGit: false,
115
+ });
116
+ ```
117
+
118
+ `commitSha`, `commitDirty`, and `branch` are explicit overrides. `detectBranch` opts into automatic branch lookup, `sourceDirectory` selects the application repository, and `autoDetect: false` disables automatic sources while retaining explicit values.
119
+
120
+ Integration authors combining this client with another telemetry exporter can pass the same core `appGitContext` to both feeds. The injected context takes precedence over `appGit`; stop every feed that shares it before calling `shutdown()`, which disposes the context. Disposal is idempotent.
121
+
74
122
  ## Payload size limits
75
123
 
76
124
  Text fields (event input/output, tool/LLM span payloads such as `ai.prompt`,