@raindrop-ai/ai-sdk 0.0.16 → 0.0.17
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 +6 -6
- package/dist/{chunk-MYJCN2H7.mjs → chunk-IPXCP2EO.mjs} +12 -6
- package/dist/index.d.mts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +12 -6
- package/dist/index.mjs +1 -1
- package/dist/index.node.js +12 -6
- package/dist/index.node.mjs +1 -1
- package/dist/index.workers.js +12 -6
- package/dist/index.workers.mjs +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Standalone Vercel AI SDK integration for Raindrop:
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
12
|
+
pnpm add @raindrop-ai/ai-sdk
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
@@ -121,15 +121,15 @@ packages/ai-sdk/
|
|
|
121
121
|
|
|
122
122
|
```bash
|
|
123
123
|
# Run all version tests (requires OPENAI_API_KEY and RAINDROP_WRITE_KEY in .env)
|
|
124
|
-
|
|
124
|
+
pnpm test
|
|
125
125
|
|
|
126
126
|
# Run specific version
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
pnpm test:v4
|
|
128
|
+
pnpm test:v5
|
|
129
|
+
pnpm test:v6
|
|
130
130
|
|
|
131
131
|
# Quick smoke test (real LLM calls, single version)
|
|
132
|
-
|
|
132
|
+
pnpm smoke:min
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
### Test Coverage
|
|
@@ -782,7 +782,7 @@ async function* asyncGeneratorWithCurrent(span, gen) {
|
|
|
782
782
|
// package.json
|
|
783
783
|
var package_default = {
|
|
784
784
|
name: "@raindrop-ai/ai-sdk",
|
|
785
|
-
version: "0.0.
|
|
785
|
+
version: "0.0.17"};
|
|
786
786
|
|
|
787
787
|
// src/internal/version.ts
|
|
788
788
|
var libraryName = package_default.name;
|
|
@@ -1933,7 +1933,7 @@ function wrapAISDK(aiSDK, deps) {
|
|
|
1933
1933
|
"generateObject",
|
|
1934
1934
|
"streamObject"
|
|
1935
1935
|
]);
|
|
1936
|
-
const agentClasses = /* @__PURE__ */ new Set(["ToolLoopAgent"]);
|
|
1936
|
+
const agentClasses = /* @__PURE__ */ new Set(["Agent", "Experimental_Agent", "ToolLoopAgent"]);
|
|
1937
1937
|
const sendEvents = ((_a = deps.options.send) == null ? void 0 : _a.events) !== false;
|
|
1938
1938
|
const sendTraces = ((_b = deps.options.send) == null ? void 0 : _b.traces) !== false;
|
|
1939
1939
|
const autoAttachmentEnabled = deps.options.autoAttachment !== false;
|
|
@@ -2693,10 +2693,16 @@ function wrapModel(args, aiSDK, outerOperationId, ctx) {
|
|
|
2693
2693
|
if (firstChunkMs === void 0) firstChunkMs = Date.now();
|
|
2694
2694
|
if (isRecord(value)) {
|
|
2695
2695
|
const type = value["type"];
|
|
2696
|
-
if (type === "text-delta"
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2696
|
+
if (type === "text-delta") {
|
|
2697
|
+
let textDelta;
|
|
2698
|
+
if (typeof value["delta"] === "string") {
|
|
2699
|
+
textDelta = value["delta"];
|
|
2700
|
+
} else if (typeof value["textDelta"] === "string") {
|
|
2701
|
+
textDelta = value["textDelta"];
|
|
2702
|
+
}
|
|
2703
|
+
if (typeof textDelta === "string") activeText += textDelta;
|
|
2704
|
+
}
|
|
2705
|
+
if (type === "finish") finishReason = extractFinishReason(value);
|
|
2700
2706
|
if (type === "tool-call") toolCallsLocal.push(value);
|
|
2701
2707
|
if ("response" in value && isRecord(value["response"])) {
|
|
2702
2708
|
const response = value["response"];
|
package/dist/index.d.mts
CHANGED
|
@@ -102,18 +102,18 @@ type AgentWithMetadata<A> = A extends {
|
|
|
102
102
|
metadata?: AgentCallMetadata;
|
|
103
103
|
}, ...Rest] : StreamArgs): StreamReturn;
|
|
104
104
|
} : A;
|
|
105
|
+
type AgentConstructor = abstract new (...args: any[]) => any;
|
|
106
|
+
type WrapAgentExport<T extends object, K extends PropertyKey> = K extends keyof T ? T[K] extends AgentConstructor ? Omit<T, K> & {
|
|
107
|
+
[P in K]: new (...args: ConstructorParameters<T[K]>) => AgentWithMetadata<InstanceType<T[K]>>;
|
|
108
|
+
} : T : T;
|
|
105
109
|
/**
|
|
106
110
|
* Structural wrapper type for AI SDK modules.
|
|
107
111
|
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
112
|
+
* Rewrites AI SDK agent constructor exports so their instance `generate()` and
|
|
113
|
+
* `stream()` methods accept Raindrop `metadata` while preserving original
|
|
114
|
+
* return types. Covers the current and deprecated public export names.
|
|
111
115
|
*/
|
|
112
|
-
type WrappedAISDK<T extends object> = T
|
|
113
|
-
ToolLoopAgent: abstract new (...args: any[]) => any;
|
|
114
|
-
} ? Omit<T, "ToolLoopAgent"> & {
|
|
115
|
-
ToolLoopAgent: new (...args: ConstructorParameters<T["ToolLoopAgent"]>) => AgentWithMetadata<InstanceType<T["ToolLoopAgent"]>>;
|
|
116
|
-
} : T;
|
|
116
|
+
type WrappedAISDK<T extends object> = WrapAgentExport<WrapAgentExport<WrapAgentExport<T, "ToolLoopAgent">, "Experimental_Agent">, "Agent">;
|
|
117
117
|
/**
|
|
118
118
|
* Backward-compatible alias for wrapped AI SDK module types.
|
|
119
119
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -102,18 +102,18 @@ type AgentWithMetadata<A> = A extends {
|
|
|
102
102
|
metadata?: AgentCallMetadata;
|
|
103
103
|
}, ...Rest] : StreamArgs): StreamReturn;
|
|
104
104
|
} : A;
|
|
105
|
+
type AgentConstructor = abstract new (...args: any[]) => any;
|
|
106
|
+
type WrapAgentExport<T extends object, K extends PropertyKey> = K extends keyof T ? T[K] extends AgentConstructor ? Omit<T, K> & {
|
|
107
|
+
[P in K]: new (...args: ConstructorParameters<T[K]>) => AgentWithMetadata<InstanceType<T[K]>>;
|
|
108
|
+
} : T : T;
|
|
105
109
|
/**
|
|
106
110
|
* Structural wrapper type for AI SDK modules.
|
|
107
111
|
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
112
|
+
* Rewrites AI SDK agent constructor exports so their instance `generate()` and
|
|
113
|
+
* `stream()` methods accept Raindrop `metadata` while preserving original
|
|
114
|
+
* return types. Covers the current and deprecated public export names.
|
|
111
115
|
*/
|
|
112
|
-
type WrappedAISDK<T extends object> = T
|
|
113
|
-
ToolLoopAgent: abstract new (...args: any[]) => any;
|
|
114
|
-
} ? Omit<T, "ToolLoopAgent"> & {
|
|
115
|
-
ToolLoopAgent: new (...args: ConstructorParameters<T["ToolLoopAgent"]>) => AgentWithMetadata<InstanceType<T["ToolLoopAgent"]>>;
|
|
116
|
-
} : T;
|
|
116
|
+
type WrappedAISDK<T extends object> = WrapAgentExport<WrapAgentExport<WrapAgentExport<T, "ToolLoopAgent">, "Experimental_Agent">, "Agent">;
|
|
117
117
|
/**
|
|
118
118
|
* Backward-compatible alias for wrapped AI SDK module types.
|
|
119
119
|
*
|
package/dist/index.js
CHANGED
|
@@ -784,7 +784,7 @@ async function* asyncGeneratorWithCurrent(span, gen) {
|
|
|
784
784
|
// package.json
|
|
785
785
|
var package_default = {
|
|
786
786
|
name: "@raindrop-ai/ai-sdk",
|
|
787
|
-
version: "0.0.
|
|
787
|
+
version: "0.0.17"};
|
|
788
788
|
|
|
789
789
|
// src/internal/version.ts
|
|
790
790
|
var libraryName = package_default.name;
|
|
@@ -1935,7 +1935,7 @@ function wrapAISDK(aiSDK, deps) {
|
|
|
1935
1935
|
"generateObject",
|
|
1936
1936
|
"streamObject"
|
|
1937
1937
|
]);
|
|
1938
|
-
const agentClasses = /* @__PURE__ */ new Set(["ToolLoopAgent"]);
|
|
1938
|
+
const agentClasses = /* @__PURE__ */ new Set(["Agent", "Experimental_Agent", "ToolLoopAgent"]);
|
|
1939
1939
|
const sendEvents = ((_a = deps.options.send) == null ? void 0 : _a.events) !== false;
|
|
1940
1940
|
const sendTraces = ((_b = deps.options.send) == null ? void 0 : _b.traces) !== false;
|
|
1941
1941
|
const autoAttachmentEnabled = deps.options.autoAttachment !== false;
|
|
@@ -2695,10 +2695,16 @@ function wrapModel(args, aiSDK, outerOperationId, ctx) {
|
|
|
2695
2695
|
if (firstChunkMs === void 0) firstChunkMs = Date.now();
|
|
2696
2696
|
if (isRecord(value)) {
|
|
2697
2697
|
const type = value["type"];
|
|
2698
|
-
if (type === "text-delta"
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2698
|
+
if (type === "text-delta") {
|
|
2699
|
+
let textDelta;
|
|
2700
|
+
if (typeof value["delta"] === "string") {
|
|
2701
|
+
textDelta = value["delta"];
|
|
2702
|
+
} else if (typeof value["textDelta"] === "string") {
|
|
2703
|
+
textDelta = value["textDelta"];
|
|
2704
|
+
}
|
|
2705
|
+
if (typeof textDelta === "string") activeText += textDelta;
|
|
2706
|
+
}
|
|
2707
|
+
if (type === "finish") finishReason = extractFinishReason(value);
|
|
2702
2708
|
if (type === "tool-call") toolCallsLocal.push(value);
|
|
2703
2709
|
if ("response" in value && isRecord(value["response"])) {
|
|
2704
2710
|
const response = value["response"];
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { _resetWarnedMissingUserId, createRaindropAISDK, currentSpan, eventMetadata, getContextManager, withCurrent } from './chunk-
|
|
1
|
+
export { _resetWarnedMissingUserId, createRaindropAISDK, currentSpan, eventMetadata, getContextManager, withCurrent } from './chunk-IPXCP2EO.mjs';
|
package/dist/index.node.js
CHANGED
|
@@ -788,7 +788,7 @@ async function* asyncGeneratorWithCurrent(span, gen) {
|
|
|
788
788
|
// package.json
|
|
789
789
|
var package_default = {
|
|
790
790
|
name: "@raindrop-ai/ai-sdk",
|
|
791
|
-
version: "0.0.
|
|
791
|
+
version: "0.0.17"};
|
|
792
792
|
|
|
793
793
|
// src/internal/version.ts
|
|
794
794
|
var libraryName = package_default.name;
|
|
@@ -1939,7 +1939,7 @@ function wrapAISDK(aiSDK, deps) {
|
|
|
1939
1939
|
"generateObject",
|
|
1940
1940
|
"streamObject"
|
|
1941
1941
|
]);
|
|
1942
|
-
const agentClasses = /* @__PURE__ */ new Set(["ToolLoopAgent"]);
|
|
1942
|
+
const agentClasses = /* @__PURE__ */ new Set(["Agent", "Experimental_Agent", "ToolLoopAgent"]);
|
|
1943
1943
|
const sendEvents = ((_a = deps.options.send) == null ? void 0 : _a.events) !== false;
|
|
1944
1944
|
const sendTraces = ((_b = deps.options.send) == null ? void 0 : _b.traces) !== false;
|
|
1945
1945
|
const autoAttachmentEnabled = deps.options.autoAttachment !== false;
|
|
@@ -2699,10 +2699,16 @@ function wrapModel(args, aiSDK, outerOperationId, ctx) {
|
|
|
2699
2699
|
if (firstChunkMs === void 0) firstChunkMs = Date.now();
|
|
2700
2700
|
if (isRecord(value)) {
|
|
2701
2701
|
const type = value["type"];
|
|
2702
|
-
if (type === "text-delta"
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2702
|
+
if (type === "text-delta") {
|
|
2703
|
+
let textDelta;
|
|
2704
|
+
if (typeof value["delta"] === "string") {
|
|
2705
|
+
textDelta = value["delta"];
|
|
2706
|
+
} else if (typeof value["textDelta"] === "string") {
|
|
2707
|
+
textDelta = value["textDelta"];
|
|
2708
|
+
}
|
|
2709
|
+
if (typeof textDelta === "string") activeText += textDelta;
|
|
2710
|
+
}
|
|
2711
|
+
if (type === "finish") finishReason = extractFinishReason(value);
|
|
2706
2712
|
if (type === "tool-call") toolCallsLocal.push(value);
|
|
2707
2713
|
if ("response" in value && isRecord(value["response"])) {
|
|
2708
2714
|
const response = value["response"];
|
package/dist/index.node.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { _resetWarnedMissingUserId, createRaindropAISDK, currentSpan, eventMetadata, getContextManager, withCurrent } from './chunk-
|
|
1
|
+
export { _resetWarnedMissingUserId, createRaindropAISDK, currentSpan, eventMetadata, getContextManager, withCurrent } from './chunk-IPXCP2EO.mjs';
|
|
2
2
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
3
3
|
|
|
4
4
|
globalThis.RAINDROP_ASYNC_LOCAL_STORAGE = AsyncLocalStorage;
|
package/dist/index.workers.js
CHANGED
|
@@ -788,7 +788,7 @@ async function* asyncGeneratorWithCurrent(span, gen) {
|
|
|
788
788
|
// package.json
|
|
789
789
|
var package_default = {
|
|
790
790
|
name: "@raindrop-ai/ai-sdk",
|
|
791
|
-
version: "0.0.
|
|
791
|
+
version: "0.0.17"};
|
|
792
792
|
|
|
793
793
|
// src/internal/version.ts
|
|
794
794
|
var libraryName = package_default.name;
|
|
@@ -1939,7 +1939,7 @@ function wrapAISDK(aiSDK, deps) {
|
|
|
1939
1939
|
"generateObject",
|
|
1940
1940
|
"streamObject"
|
|
1941
1941
|
]);
|
|
1942
|
-
const agentClasses = /* @__PURE__ */ new Set(["ToolLoopAgent"]);
|
|
1942
|
+
const agentClasses = /* @__PURE__ */ new Set(["Agent", "Experimental_Agent", "ToolLoopAgent"]);
|
|
1943
1943
|
const sendEvents = ((_a = deps.options.send) == null ? void 0 : _a.events) !== false;
|
|
1944
1944
|
const sendTraces = ((_b = deps.options.send) == null ? void 0 : _b.traces) !== false;
|
|
1945
1945
|
const autoAttachmentEnabled = deps.options.autoAttachment !== false;
|
|
@@ -2699,10 +2699,16 @@ function wrapModel(args, aiSDK, outerOperationId, ctx) {
|
|
|
2699
2699
|
if (firstChunkMs === void 0) firstChunkMs = Date.now();
|
|
2700
2700
|
if (isRecord(value)) {
|
|
2701
2701
|
const type = value["type"];
|
|
2702
|
-
if (type === "text-delta"
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2702
|
+
if (type === "text-delta") {
|
|
2703
|
+
let textDelta;
|
|
2704
|
+
if (typeof value["delta"] === "string") {
|
|
2705
|
+
textDelta = value["delta"];
|
|
2706
|
+
} else if (typeof value["textDelta"] === "string") {
|
|
2707
|
+
textDelta = value["textDelta"];
|
|
2708
|
+
}
|
|
2709
|
+
if (typeof textDelta === "string") activeText += textDelta;
|
|
2710
|
+
}
|
|
2711
|
+
if (type === "finish") finishReason = extractFinishReason(value);
|
|
2706
2712
|
if (type === "tool-call") toolCallsLocal.push(value);
|
|
2707
2713
|
if ("response" in value && isRecord(value["response"])) {
|
|
2708
2714
|
const response = value["response"];
|
package/dist/index.workers.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { _resetWarnedMissingUserId, createRaindropAISDK, currentSpan, eventMetadata, getContextManager, withCurrent } from './chunk-
|
|
1
|
+
export { _resetWarnedMissingUserId, createRaindropAISDK, currentSpan, eventMetadata, getContextManager, withCurrent } from './chunk-IPXCP2EO.mjs';
|
|
2
2
|
import { AsyncLocalStorage } from 'async_hooks';
|
|
3
3
|
|
|
4
4
|
if (!globalThis.RAINDROP_ASYNC_LOCAL_STORAGE) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raindrop-ai/ai-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "Standalone Vercel AI SDK integration for Raindrop (events + OTLP/HTTP JSON traces, no OTEL runtime)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"smoke:min": "tsx ./scripts/smoke.min.ts",
|
|
34
34
|
"eval:agent-reporting": "tsx ./scripts/evals/agent-reporting/run.ts",
|
|
35
35
|
"harness": "tsx ./scripts/traceHarness.ts",
|
|
36
|
-
"test": "
|
|
37
|
-
"test:v4": "
|
|
38
|
-
"test:v5": "
|
|
39
|
-
"test:v6": "
|
|
40
|
-
"test:install": "cd tests/v4 &&
|
|
36
|
+
"test": "pnpm build && pnpm test:v4 && pnpm test:v5 && pnpm test:v6",
|
|
37
|
+
"test:v4": "pnpm build && cd tests/v4 && pnpm install --ignore-workspace --lockfile=false && pnpm test",
|
|
38
|
+
"test:v5": "pnpm build && cd tests/v5 && pnpm install --ignore-workspace --lockfile=false && pnpm test",
|
|
39
|
+
"test:v6": "pnpm build && cd tests/v6 && pnpm install --ignore-workspace --lockfile=false && pnpm test",
|
|
40
|
+
"test:install": "cd tests/v4 && pnpm install --ignore-workspace --lockfile=false && cd ../v5 && pnpm install --ignore-workspace --lockfile=false && cd ../v6 && pnpm install --ignore-workspace --lockfile=false"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@raindrop-ai/core": "
|
|
43
|
+
"@raindrop-ai/core": "workspace:*",
|
|
44
44
|
"@types/node": "^20.11.17",
|
|
45
45
|
"msw": "^2.12.7",
|
|
46
46
|
"tsup": "^8.4.0",
|