@raindrop-ai/ai-sdk 0.0.19-beta.3 → 0.0.19
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 +22 -3
- package/dist/{chunk-TVOZIVJA.mjs → chunk-CNLUX2MV.mjs} +93 -767
- package/dist/index-C9H6HnZm.d.mts +313 -0
- package/dist/index-C9H6HnZm.d.ts +313 -0
- package/dist/{index.d.mts → index.browser.d.mts} +2 -290
- package/dist/{index.d.ts → index.browser.d.ts} +2 -290
- package/dist/{index.js → index.browser.js} +68 -746
- package/dist/index.browser.mjs +3314 -0
- package/dist/index.node.d.mts +1 -1
- package/dist/index.node.d.ts +1 -1
- package/dist/index.node.js +69 -746
- 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 +69 -746
- package/dist/index.workers.mjs +1 -1
- package/package.json +15 -29
- package/dist/index.mjs +0 -1
package/README.md
CHANGED
|
@@ -58,7 +58,20 @@ If `userId` is missing from both `wrap()` context and `eventMetadata()`, the SDK
|
|
|
58
58
|
|
|
59
59
|
## Runtime support
|
|
60
60
|
|
|
61
|
-
###
|
|
61
|
+
### Browsers and edge runtimes
|
|
62
|
+
|
|
63
|
+
Use the browser entrypoint:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import { createRaindropAISDK } from "@raindrop-ai/ai-sdk/browser";
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The SDK works without `async_hooks` shims. When `AsyncLocalStorage` is not available,
|
|
70
|
+
Raindrop falls back to synchronous context scoping: nested work in the same call stack
|
|
71
|
+
still inherits context, but automatic propagation across arbitrary async boundaries is
|
|
72
|
+
not guaranteed.
|
|
73
|
+
|
|
74
|
+
### Node.js
|
|
62
75
|
|
|
63
76
|
Use the default import:
|
|
64
77
|
|
|
@@ -66,17 +79,23 @@ Use the default import:
|
|
|
66
79
|
import { createRaindropAISDK } from "@raindrop-ai/ai-sdk";
|
|
67
80
|
```
|
|
68
81
|
|
|
82
|
+
In Node, the default entrypoint wires up `AsyncLocalStorage` automatically.
|
|
83
|
+
|
|
69
84
|
### Cloudflare Workers
|
|
70
85
|
|
|
71
86
|
Cloudflare Workers can provide `AsyncLocalStorage` via `node:async_hooks` when `nodejs_compat` is enabled ([docs](https://developers.cloudflare.com/workers/runtime-apis/nodejs/asynclocalstorage/)).
|
|
72
87
|
|
|
73
|
-
|
|
88
|
+
If `nodejs_compat` is enabled, use the Workers entrypoint:
|
|
74
89
|
|
|
75
90
|
```ts
|
|
76
91
|
import { createRaindropAISDK } from "@raindrop-ai/ai-sdk/workers";
|
|
77
92
|
```
|
|
78
93
|
|
|
79
|
-
|
|
94
|
+
This enables real `AsyncLocalStorage` propagation in Workers.
|
|
95
|
+
|
|
96
|
+
If `nodejs_compat` is not enabled, use the browser entrypoint instead. The SDK still works,
|
|
97
|
+
but it uses the same synchronous fallback described above rather than real
|
|
98
|
+
`AsyncLocalStorage`.
|
|
80
99
|
|
|
81
100
|
## Supported AI SDK Versions
|
|
82
101
|
|