@convex-dev/agent 0.2.2 → 0.2.3
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/client/definePlaygroundAPI.d.ts +144 -13
- package/dist/client/definePlaygroundAPI.d.ts.map +1 -1
- package/dist/client/files.d.ts +1 -1
- package/dist/client/files.d.ts.map +1 -1
- package/dist/client/files.js.map +1 -1
- package/dist/client/index.d.ts +130 -10
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +17 -7
- package/dist/client/index.js.map +1 -1
- package/dist/client/messages.d.ts +32 -5
- package/dist/client/messages.d.ts.map +1 -1
- package/dist/client/messages.js +7 -4
- package/dist/client/messages.js.map +1 -1
- package/dist/client/search.d.ts +31 -4
- package/dist/client/search.d.ts.map +1 -1
- package/dist/client/search.js +2 -4
- package/dist/client/search.js.map +1 -1
- package/dist/client/streaming.d.ts +322 -39
- package/dist/client/streaming.d.ts.map +1 -1
- package/dist/component/_generated/api.d.ts +301 -15
- package/dist/component/messages.d.ts +336 -41
- package/dist/component/messages.d.ts.map +1 -1
- package/dist/component/messages.js +4 -4
- package/dist/component/messages.js.map +1 -1
- package/dist/component/schema.d.ts +874 -133
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/mapping.d.ts +4 -4
- package/dist/mapping.d.ts.map +1 -1
- package/dist/mapping.js +68 -38
- package/dist/mapping.js.map +1 -1
- package/dist/react/deltas.d.ts +3 -3
- package/dist/react/deltas.d.ts.map +1 -1
- package/dist/react/deltas.js +321 -28
- package/dist/react/deltas.js.map +1 -1
- package/dist/react/toUIMessages.d.ts.map +1 -1
- package/dist/react/toUIMessages.js +289 -180
- package/dist/react/toUIMessages.js.map +1 -1
- package/dist/react/useSmoothText.d.ts.map +1 -1
- package/dist/react/useSmoothText.js +15 -6
- package/dist/react/useSmoothText.js.map +1 -1
- package/dist/shared.d.ts +4 -0
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +8 -0
- package/dist/shared.js.map +1 -1
- package/dist/validators.d.ts +1887 -249
- package/dist/validators.d.ts.map +1 -1
- package/dist/validators.js +10 -3
- package/dist/validators.js.map +1 -1
- package/package.json +1 -1
- package/src/client/files.ts +4 -4
- package/src/client/index.ts +41 -15
- package/src/client/messages.ts +12 -4
- package/src/client/search.ts +2 -6
- package/src/component/_generated/api.d.ts +301 -15
- package/src/component/messages.ts +4 -3
- package/src/mapping.ts +105 -56
- package/src/react/deltas.ts +391 -46
- package/src/react/toUIMessages.test.ts +234 -4
- package/src/react/toUIMessages.ts +366 -192
- package/src/react/useSmoothText.ts +25 -13
- package/src/shared.ts +14 -0
- package/src/validators.ts +23 -15
package/src/validators.ts
CHANGED
|
@@ -36,6 +36,7 @@ export const vTextPart = v.object({
|
|
|
36
36
|
type: v.literal("text"),
|
|
37
37
|
text: v.string(),
|
|
38
38
|
providerOptions,
|
|
39
|
+
providerMetadata,
|
|
39
40
|
});
|
|
40
41
|
|
|
41
42
|
export const vImagePart = v.object({
|
|
@@ -51,6 +52,7 @@ export const vFilePart = v.object({
|
|
|
51
52
|
filename: v.optional(v.string()),
|
|
52
53
|
mimeType: v.string(),
|
|
53
54
|
providerOptions,
|
|
55
|
+
providerMetadata,
|
|
54
56
|
});
|
|
55
57
|
|
|
56
58
|
export const vUserContent = v.union(
|
|
@@ -63,13 +65,14 @@ export const vReasoningPart = v.object({
|
|
|
63
65
|
text: v.string(),
|
|
64
66
|
signature: v.optional(v.string()),
|
|
65
67
|
providerOptions,
|
|
66
|
-
|
|
68
|
+
providerMetadata,
|
|
67
69
|
});
|
|
68
70
|
|
|
69
71
|
export const vRedactedReasoningPart = v.object({
|
|
70
72
|
type: v.literal("redacted-reasoning"),
|
|
71
73
|
data: v.string(),
|
|
72
74
|
providerOptions,
|
|
75
|
+
providerMetadata,
|
|
73
76
|
});
|
|
74
77
|
|
|
75
78
|
export const vReasoningDetails = v.array(
|
|
@@ -89,23 +92,11 @@ export const vToolCallPart = v.object({
|
|
|
89
92
|
toolCallId: v.string(),
|
|
90
93
|
toolName: v.string(),
|
|
91
94
|
args: v.any(),
|
|
92
|
-
providerOptions,
|
|
93
95
|
providerExecuted: v.optional(v.boolean()),
|
|
96
|
+
providerOptions,
|
|
97
|
+
providerMetadata,
|
|
94
98
|
});
|
|
95
99
|
|
|
96
|
-
export const vAssistantContent = v.union(
|
|
97
|
-
v.string(),
|
|
98
|
-
v.array(
|
|
99
|
-
v.union(
|
|
100
|
-
vTextPart,
|
|
101
|
-
vFilePart,
|
|
102
|
-
vReasoningPart,
|
|
103
|
-
vRedactedReasoningPart,
|
|
104
|
-
vToolCallPart,
|
|
105
|
-
),
|
|
106
|
-
),
|
|
107
|
-
);
|
|
108
|
-
|
|
109
100
|
const vToolResultContent = v.array(
|
|
110
101
|
v.union(
|
|
111
102
|
v.object({ type: v.literal("text"), text: v.string() }),
|
|
@@ -123,6 +114,7 @@ export const vToolResultPart = v.object({
|
|
|
123
114
|
toolName: v.string(),
|
|
124
115
|
result: v.any(),
|
|
125
116
|
providerOptions,
|
|
117
|
+
providerMetadata,
|
|
126
118
|
providerExecuted: v.optional(v.boolean()),
|
|
127
119
|
|
|
128
120
|
// Deprecated in ai v5
|
|
@@ -134,6 +126,20 @@ export const vToolResultPart = v.object({
|
|
|
134
126
|
});
|
|
135
127
|
export const vToolContent = v.array(vToolResultPart);
|
|
136
128
|
|
|
129
|
+
export const vAssistantContent = v.union(
|
|
130
|
+
v.string(),
|
|
131
|
+
v.array(
|
|
132
|
+
v.union(
|
|
133
|
+
vTextPart,
|
|
134
|
+
vFilePart,
|
|
135
|
+
vReasoningPart,
|
|
136
|
+
vRedactedReasoningPart,
|
|
137
|
+
vToolCallPart,
|
|
138
|
+
vToolResultPart,
|
|
139
|
+
),
|
|
140
|
+
),
|
|
141
|
+
);
|
|
142
|
+
|
|
137
143
|
export const vContent = v.union(vUserContent, vAssistantContent, vToolContent);
|
|
138
144
|
export type Content = Infer<typeof vContent>;
|
|
139
145
|
|
|
@@ -177,6 +183,7 @@ export const vSource = v.union(
|
|
|
177
183
|
url: v.string(),
|
|
178
184
|
title: v.optional(v.string()),
|
|
179
185
|
providerOptions,
|
|
186
|
+
providerMetadata,
|
|
180
187
|
}),
|
|
181
188
|
v.object({
|
|
182
189
|
type: v.literal("source"),
|
|
@@ -185,6 +192,7 @@ export const vSource = v.union(
|
|
|
185
192
|
mediaType: v.string(),
|
|
186
193
|
title: v.string(),
|
|
187
194
|
filename: v.optional(v.string()),
|
|
195
|
+
providerOptions,
|
|
188
196
|
providerMetadata,
|
|
189
197
|
}),
|
|
190
198
|
);
|