@raindrop-ai/ai-sdk 0.1.1 → 0.2.1
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/dist/{chunk-NU5KYBJA.mjs → chunk-V636SYSR.mjs} +494 -122
- package/dist/{index-BQwgg9kQ.d.mts → index-BUWOlY-2.d.mts} +25 -7
- package/dist/{index-BQwgg9kQ.d.ts → index-BUWOlY-2.d.ts} +25 -7
- package/dist/index.browser.d.mts +25 -7
- package/dist/index.browser.d.ts +25 -7
- package/dist/index.browser.js +494 -122
- package/dist/index.browser.mjs +494 -122
- package/dist/index.node.d.mts +1 -1
- package/dist/index.node.d.ts +1 -1
- package/dist/index.node.js +494 -122
- 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 +494 -122
- package/dist/index.workers.mjs +1 -1
- package/package.json +2 -2
|
@@ -56,6 +56,10 @@ type IdentifyInput$1 = {
|
|
|
56
56
|
userId: string;
|
|
57
57
|
traits?: Record<string, unknown>;
|
|
58
58
|
};
|
|
59
|
+
type EventUsage = {
|
|
60
|
+
promptTokens?: number;
|
|
61
|
+
completionTokens?: number;
|
|
62
|
+
};
|
|
59
63
|
type Patch = {
|
|
60
64
|
eventName?: string;
|
|
61
65
|
userId?: string;
|
|
@@ -63,6 +67,8 @@ type Patch = {
|
|
|
63
67
|
input?: string;
|
|
64
68
|
output?: string;
|
|
65
69
|
model?: string;
|
|
70
|
+
usage?: EventUsage;
|
|
71
|
+
error?: unknown;
|
|
66
72
|
properties?: Record<string, unknown>;
|
|
67
73
|
featureFlags?: Record<string, string>;
|
|
68
74
|
attachments?: Attachment$1[];
|
|
@@ -161,13 +167,7 @@ declare class EventShipper$1 {
|
|
|
161
167
|
*/
|
|
162
168
|
private requestOpts;
|
|
163
169
|
patch(eventId: string, patch: Patch): Promise<void>;
|
|
164
|
-
finish(eventId: string, patch:
|
|
165
|
-
output?: string;
|
|
166
|
-
model?: string;
|
|
167
|
-
properties?: Record<string, unknown>;
|
|
168
|
-
featureFlags?: Record<string, string>;
|
|
169
|
-
userId?: string;
|
|
170
|
-
}): Promise<void>;
|
|
170
|
+
finish(eventId: string, patch: Pick<Patch, "output" | "model" | "usage" | "error" | "properties" | "featureFlags" | "userId">): Promise<void>;
|
|
171
171
|
flush(): Promise<void>;
|
|
172
172
|
shutdown(): Promise<void>;
|
|
173
173
|
trackSignal(signal: SignalInput): Promise<void>;
|
|
@@ -399,6 +399,9 @@ declare class TraceShipper$1 {
|
|
|
399
399
|
spanIdB64: string;
|
|
400
400
|
};
|
|
401
401
|
eventId: string;
|
|
402
|
+
userId?: string;
|
|
403
|
+
convoId?: string;
|
|
404
|
+
eventName?: string;
|
|
402
405
|
operationId?: string;
|
|
403
406
|
attributes?: Array<OtlpKeyValue | undefined>;
|
|
404
407
|
startTimeUnixNano?: string;
|
|
@@ -417,6 +420,9 @@ declare class TraceShipper$1 {
|
|
|
417
420
|
spanIdB64: string;
|
|
418
421
|
};
|
|
419
422
|
eventId: string;
|
|
423
|
+
userId?: string;
|
|
424
|
+
convoId?: string;
|
|
425
|
+
eventName?: string;
|
|
420
426
|
startTimeUnixNano: string;
|
|
421
427
|
endTimeUnixNano: string;
|
|
422
428
|
attributes?: Array<OtlpKeyValue | undefined>;
|
|
@@ -1225,6 +1231,12 @@ type StartSpanArgs = {
|
|
|
1225
1231
|
parent?: TraceSpan;
|
|
1226
1232
|
/** AI SDK operation ID (e.g. "ai.toolCall", "ai.generateText"). Helps classify the span. */
|
|
1227
1233
|
operationId?: string;
|
|
1234
|
+
/** Raindrop user ID this span belongs to. Stamped onto the span so it rides onto nested spans. */
|
|
1235
|
+
userId?: string;
|
|
1236
|
+
/** Raindrop conversation ID this span belongs to. */
|
|
1237
|
+
convoId?: string;
|
|
1238
|
+
/** Raindrop event name this span belongs to. */
|
|
1239
|
+
eventName?: string;
|
|
1228
1240
|
/** Arbitrary string attributes. */
|
|
1229
1241
|
attributes?: Record<string, string>;
|
|
1230
1242
|
};
|
|
@@ -1243,6 +1255,12 @@ type CreateSpanArgs = {
|
|
|
1243
1255
|
parent?: TraceSpan;
|
|
1244
1256
|
/** AI SDK operation ID (e.g. "ai.toolCall"). Helps classify the span. */
|
|
1245
1257
|
operationId?: string;
|
|
1258
|
+
/** Raindrop user ID this span belongs to. Stamped onto the span so it rides onto nested spans. */
|
|
1259
|
+
userId?: string;
|
|
1260
|
+
/** Raindrop conversation ID this span belongs to. */
|
|
1261
|
+
convoId?: string;
|
|
1262
|
+
/** Raindrop event name this span belongs to. */
|
|
1263
|
+
eventName?: string;
|
|
1246
1264
|
/** Input data (will be JSON stringified if object). */
|
|
1247
1265
|
input?: unknown;
|
|
1248
1266
|
/** Output data (will be JSON stringified if object). */
|
|
@@ -56,6 +56,10 @@ type IdentifyInput$1 = {
|
|
|
56
56
|
userId: string;
|
|
57
57
|
traits?: Record<string, unknown>;
|
|
58
58
|
};
|
|
59
|
+
type EventUsage = {
|
|
60
|
+
promptTokens?: number;
|
|
61
|
+
completionTokens?: number;
|
|
62
|
+
};
|
|
59
63
|
type Patch = {
|
|
60
64
|
eventName?: string;
|
|
61
65
|
userId?: string;
|
|
@@ -63,6 +67,8 @@ type Patch = {
|
|
|
63
67
|
input?: string;
|
|
64
68
|
output?: string;
|
|
65
69
|
model?: string;
|
|
70
|
+
usage?: EventUsage;
|
|
71
|
+
error?: unknown;
|
|
66
72
|
properties?: Record<string, unknown>;
|
|
67
73
|
featureFlags?: Record<string, string>;
|
|
68
74
|
attachments?: Attachment$1[];
|
|
@@ -161,13 +167,7 @@ declare class EventShipper$1 {
|
|
|
161
167
|
*/
|
|
162
168
|
private requestOpts;
|
|
163
169
|
patch(eventId: string, patch: Patch): Promise<void>;
|
|
164
|
-
finish(eventId: string, patch:
|
|
165
|
-
output?: string;
|
|
166
|
-
model?: string;
|
|
167
|
-
properties?: Record<string, unknown>;
|
|
168
|
-
featureFlags?: Record<string, string>;
|
|
169
|
-
userId?: string;
|
|
170
|
-
}): Promise<void>;
|
|
170
|
+
finish(eventId: string, patch: Pick<Patch, "output" | "model" | "usage" | "error" | "properties" | "featureFlags" | "userId">): Promise<void>;
|
|
171
171
|
flush(): Promise<void>;
|
|
172
172
|
shutdown(): Promise<void>;
|
|
173
173
|
trackSignal(signal: SignalInput): Promise<void>;
|
|
@@ -399,6 +399,9 @@ declare class TraceShipper$1 {
|
|
|
399
399
|
spanIdB64: string;
|
|
400
400
|
};
|
|
401
401
|
eventId: string;
|
|
402
|
+
userId?: string;
|
|
403
|
+
convoId?: string;
|
|
404
|
+
eventName?: string;
|
|
402
405
|
operationId?: string;
|
|
403
406
|
attributes?: Array<OtlpKeyValue | undefined>;
|
|
404
407
|
startTimeUnixNano?: string;
|
|
@@ -417,6 +420,9 @@ declare class TraceShipper$1 {
|
|
|
417
420
|
spanIdB64: string;
|
|
418
421
|
};
|
|
419
422
|
eventId: string;
|
|
423
|
+
userId?: string;
|
|
424
|
+
convoId?: string;
|
|
425
|
+
eventName?: string;
|
|
420
426
|
startTimeUnixNano: string;
|
|
421
427
|
endTimeUnixNano: string;
|
|
422
428
|
attributes?: Array<OtlpKeyValue | undefined>;
|
|
@@ -1225,6 +1231,12 @@ type StartSpanArgs = {
|
|
|
1225
1231
|
parent?: TraceSpan;
|
|
1226
1232
|
/** AI SDK operation ID (e.g. "ai.toolCall", "ai.generateText"). Helps classify the span. */
|
|
1227
1233
|
operationId?: string;
|
|
1234
|
+
/** Raindrop user ID this span belongs to. Stamped onto the span so it rides onto nested spans. */
|
|
1235
|
+
userId?: string;
|
|
1236
|
+
/** Raindrop conversation ID this span belongs to. */
|
|
1237
|
+
convoId?: string;
|
|
1238
|
+
/** Raindrop event name this span belongs to. */
|
|
1239
|
+
eventName?: string;
|
|
1228
1240
|
/** Arbitrary string attributes. */
|
|
1229
1241
|
attributes?: Record<string, string>;
|
|
1230
1242
|
};
|
|
@@ -1243,6 +1255,12 @@ type CreateSpanArgs = {
|
|
|
1243
1255
|
parent?: TraceSpan;
|
|
1244
1256
|
/** AI SDK operation ID (e.g. "ai.toolCall"). Helps classify the span. */
|
|
1245
1257
|
operationId?: string;
|
|
1258
|
+
/** Raindrop user ID this span belongs to. Stamped onto the span so it rides onto nested spans. */
|
|
1259
|
+
userId?: string;
|
|
1260
|
+
/** Raindrop conversation ID this span belongs to. */
|
|
1261
|
+
convoId?: string;
|
|
1262
|
+
/** Raindrop event name this span belongs to. */
|
|
1263
|
+
eventName?: string;
|
|
1246
1264
|
/** Input data (will be JSON stringified if object). */
|
|
1247
1265
|
input?: unknown;
|
|
1248
1266
|
/** Output data (will be JSON stringified if object). */
|
package/dist/index.browser.d.mts
CHANGED
|
@@ -56,6 +56,10 @@ type IdentifyInput$1 = {
|
|
|
56
56
|
userId: string;
|
|
57
57
|
traits?: Record<string, unknown>;
|
|
58
58
|
};
|
|
59
|
+
type EventUsage = {
|
|
60
|
+
promptTokens?: number;
|
|
61
|
+
completionTokens?: number;
|
|
62
|
+
};
|
|
59
63
|
type Patch = {
|
|
60
64
|
eventName?: string;
|
|
61
65
|
userId?: string;
|
|
@@ -63,6 +67,8 @@ type Patch = {
|
|
|
63
67
|
input?: string;
|
|
64
68
|
output?: string;
|
|
65
69
|
model?: string;
|
|
70
|
+
usage?: EventUsage;
|
|
71
|
+
error?: unknown;
|
|
66
72
|
properties?: Record<string, unknown>;
|
|
67
73
|
featureFlags?: Record<string, string>;
|
|
68
74
|
attachments?: Attachment$1[];
|
|
@@ -161,13 +167,7 @@ declare class EventShipper$1 {
|
|
|
161
167
|
*/
|
|
162
168
|
private requestOpts;
|
|
163
169
|
patch(eventId: string, patch: Patch): Promise<void>;
|
|
164
|
-
finish(eventId: string, patch:
|
|
165
|
-
output?: string;
|
|
166
|
-
model?: string;
|
|
167
|
-
properties?: Record<string, unknown>;
|
|
168
|
-
featureFlags?: Record<string, string>;
|
|
169
|
-
userId?: string;
|
|
170
|
-
}): Promise<void>;
|
|
170
|
+
finish(eventId: string, patch: Pick<Patch, "output" | "model" | "usage" | "error" | "properties" | "featureFlags" | "userId">): Promise<void>;
|
|
171
171
|
flush(): Promise<void>;
|
|
172
172
|
shutdown(): Promise<void>;
|
|
173
173
|
trackSignal(signal: SignalInput): Promise<void>;
|
|
@@ -399,6 +399,9 @@ declare class TraceShipper$1 {
|
|
|
399
399
|
spanIdB64: string;
|
|
400
400
|
};
|
|
401
401
|
eventId: string;
|
|
402
|
+
userId?: string;
|
|
403
|
+
convoId?: string;
|
|
404
|
+
eventName?: string;
|
|
402
405
|
operationId?: string;
|
|
403
406
|
attributes?: Array<OtlpKeyValue | undefined>;
|
|
404
407
|
startTimeUnixNano?: string;
|
|
@@ -417,6 +420,9 @@ declare class TraceShipper$1 {
|
|
|
417
420
|
spanIdB64: string;
|
|
418
421
|
};
|
|
419
422
|
eventId: string;
|
|
423
|
+
userId?: string;
|
|
424
|
+
convoId?: string;
|
|
425
|
+
eventName?: string;
|
|
420
426
|
startTimeUnixNano: string;
|
|
421
427
|
endTimeUnixNano: string;
|
|
422
428
|
attributes?: Array<OtlpKeyValue | undefined>;
|
|
@@ -1225,6 +1231,12 @@ type StartSpanArgs = {
|
|
|
1225
1231
|
parent?: TraceSpan;
|
|
1226
1232
|
/** AI SDK operation ID (e.g. "ai.toolCall", "ai.generateText"). Helps classify the span. */
|
|
1227
1233
|
operationId?: string;
|
|
1234
|
+
/** Raindrop user ID this span belongs to. Stamped onto the span so it rides onto nested spans. */
|
|
1235
|
+
userId?: string;
|
|
1236
|
+
/** Raindrop conversation ID this span belongs to. */
|
|
1237
|
+
convoId?: string;
|
|
1238
|
+
/** Raindrop event name this span belongs to. */
|
|
1239
|
+
eventName?: string;
|
|
1228
1240
|
/** Arbitrary string attributes. */
|
|
1229
1241
|
attributes?: Record<string, string>;
|
|
1230
1242
|
};
|
|
@@ -1243,6 +1255,12 @@ type CreateSpanArgs = {
|
|
|
1243
1255
|
parent?: TraceSpan;
|
|
1244
1256
|
/** AI SDK operation ID (e.g. "ai.toolCall"). Helps classify the span. */
|
|
1245
1257
|
operationId?: string;
|
|
1258
|
+
/** Raindrop user ID this span belongs to. Stamped onto the span so it rides onto nested spans. */
|
|
1259
|
+
userId?: string;
|
|
1260
|
+
/** Raindrop conversation ID this span belongs to. */
|
|
1261
|
+
convoId?: string;
|
|
1262
|
+
/** Raindrop event name this span belongs to. */
|
|
1263
|
+
eventName?: string;
|
|
1246
1264
|
/** Input data (will be JSON stringified if object). */
|
|
1247
1265
|
input?: unknown;
|
|
1248
1266
|
/** Output data (will be JSON stringified if object). */
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -56,6 +56,10 @@ type IdentifyInput$1 = {
|
|
|
56
56
|
userId: string;
|
|
57
57
|
traits?: Record<string, unknown>;
|
|
58
58
|
};
|
|
59
|
+
type EventUsage = {
|
|
60
|
+
promptTokens?: number;
|
|
61
|
+
completionTokens?: number;
|
|
62
|
+
};
|
|
59
63
|
type Patch = {
|
|
60
64
|
eventName?: string;
|
|
61
65
|
userId?: string;
|
|
@@ -63,6 +67,8 @@ type Patch = {
|
|
|
63
67
|
input?: string;
|
|
64
68
|
output?: string;
|
|
65
69
|
model?: string;
|
|
70
|
+
usage?: EventUsage;
|
|
71
|
+
error?: unknown;
|
|
66
72
|
properties?: Record<string, unknown>;
|
|
67
73
|
featureFlags?: Record<string, string>;
|
|
68
74
|
attachments?: Attachment$1[];
|
|
@@ -161,13 +167,7 @@ declare class EventShipper$1 {
|
|
|
161
167
|
*/
|
|
162
168
|
private requestOpts;
|
|
163
169
|
patch(eventId: string, patch: Patch): Promise<void>;
|
|
164
|
-
finish(eventId: string, patch:
|
|
165
|
-
output?: string;
|
|
166
|
-
model?: string;
|
|
167
|
-
properties?: Record<string, unknown>;
|
|
168
|
-
featureFlags?: Record<string, string>;
|
|
169
|
-
userId?: string;
|
|
170
|
-
}): Promise<void>;
|
|
170
|
+
finish(eventId: string, patch: Pick<Patch, "output" | "model" | "usage" | "error" | "properties" | "featureFlags" | "userId">): Promise<void>;
|
|
171
171
|
flush(): Promise<void>;
|
|
172
172
|
shutdown(): Promise<void>;
|
|
173
173
|
trackSignal(signal: SignalInput): Promise<void>;
|
|
@@ -399,6 +399,9 @@ declare class TraceShipper$1 {
|
|
|
399
399
|
spanIdB64: string;
|
|
400
400
|
};
|
|
401
401
|
eventId: string;
|
|
402
|
+
userId?: string;
|
|
403
|
+
convoId?: string;
|
|
404
|
+
eventName?: string;
|
|
402
405
|
operationId?: string;
|
|
403
406
|
attributes?: Array<OtlpKeyValue | undefined>;
|
|
404
407
|
startTimeUnixNano?: string;
|
|
@@ -417,6 +420,9 @@ declare class TraceShipper$1 {
|
|
|
417
420
|
spanIdB64: string;
|
|
418
421
|
};
|
|
419
422
|
eventId: string;
|
|
423
|
+
userId?: string;
|
|
424
|
+
convoId?: string;
|
|
425
|
+
eventName?: string;
|
|
420
426
|
startTimeUnixNano: string;
|
|
421
427
|
endTimeUnixNano: string;
|
|
422
428
|
attributes?: Array<OtlpKeyValue | undefined>;
|
|
@@ -1225,6 +1231,12 @@ type StartSpanArgs = {
|
|
|
1225
1231
|
parent?: TraceSpan;
|
|
1226
1232
|
/** AI SDK operation ID (e.g. "ai.toolCall", "ai.generateText"). Helps classify the span. */
|
|
1227
1233
|
operationId?: string;
|
|
1234
|
+
/** Raindrop user ID this span belongs to. Stamped onto the span so it rides onto nested spans. */
|
|
1235
|
+
userId?: string;
|
|
1236
|
+
/** Raindrop conversation ID this span belongs to. */
|
|
1237
|
+
convoId?: string;
|
|
1238
|
+
/** Raindrop event name this span belongs to. */
|
|
1239
|
+
eventName?: string;
|
|
1228
1240
|
/** Arbitrary string attributes. */
|
|
1229
1241
|
attributes?: Record<string, string>;
|
|
1230
1242
|
};
|
|
@@ -1243,6 +1255,12 @@ type CreateSpanArgs = {
|
|
|
1243
1255
|
parent?: TraceSpan;
|
|
1244
1256
|
/** AI SDK operation ID (e.g. "ai.toolCall"). Helps classify the span. */
|
|
1245
1257
|
operationId?: string;
|
|
1258
|
+
/** Raindrop user ID this span belongs to. Stamped onto the span so it rides onto nested spans. */
|
|
1259
|
+
userId?: string;
|
|
1260
|
+
/** Raindrop conversation ID this span belongs to. */
|
|
1261
|
+
convoId?: string;
|
|
1262
|
+
/** Raindrop event name this span belongs to. */
|
|
1263
|
+
eventName?: string;
|
|
1246
1264
|
/** Input data (will be JSON stringified if object). */
|
|
1247
1265
|
input?: unknown;
|
|
1248
1266
|
/** Output data (will be JSON stringified if object). */
|