@o-zakstam/voltagent-convex 1.1.1 → 1.1.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/defineVoltAgentAPI.d.ts +191 -0
- package/dist/client/defineVoltAgentAPI.d.ts.map +1 -0
- package/dist/client/defineVoltAgentAPI.js +318 -0
- package/dist/client/defineVoltAgentAPI.js.map +1 -0
- package/dist/client/index.d.ts +6 -563
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +8 -285
- package/dist/client/index.js.map +1 -1
- package/dist/client/types.d.ts +13 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +8 -0
- package/dist/client/types.js.map +1 -0
- package/dist/component/_generated/api.d.ts +44 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +31 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/component.d.ts +352 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +46 -0
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +121 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +78 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/conversations.d.ts +108 -0
- package/dist/component/conversations.d.ts.map +1 -0
- package/dist/component/conversations.js +278 -0
- package/dist/component/conversations.js.map +1 -0
- package/dist/component/convex.config.d.ts +13 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +21 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/messages.d.ts +235 -0
- package/dist/component/messages.d.ts.map +1 -0
- package/dist/component/messages.js +186 -0
- package/dist/component/messages.js.map +1 -0
- package/dist/component/schema.d.ts +535 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +113 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/component/steps.d.ts +65 -0
- package/dist/component/steps.d.ts.map +1 -0
- package/dist/component/steps.js +120 -0
- package/dist/component/steps.js.map +1 -0
- package/dist/component/validators.d.ts +633 -0
- package/dist/component/validators.d.ts.map +1 -0
- package/dist/component/validators.js +124 -0
- package/dist/component/validators.js.map +1 -0
- package/dist/component/workflows.d.ts +234 -0
- package/dist/component/workflows.d.ts.map +1 -0
- package/dist/component/workflows.js +229 -0
- package/dist/component/workflows.js.map +1 -0
- package/dist/component/workingMemory.d.ts +30 -0
- package/dist/component/workingMemory.d.ts.map +1 -0
- package/dist/component/workingMemory.js +131 -0
- package/dist/component/workingMemory.js.map +1 -0
- package/dist/index.d.ts +7 -318
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -434
- package/dist/index.js.map +1 -1
- package/dist/memory-adapter.d.ts +153 -0
- package/dist/memory-adapter.d.ts.map +1 -0
- package/dist/memory-adapter.js +462 -0
- package/dist/memory-adapter.js.map +1 -0
- package/dist/types.d.ts +167 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +25 -26
- package/src/client/defineVoltAgentAPI.ts +365 -0
- package/src/client/index.ts +8 -0
- package/src/client/types.ts +14 -0
- package/src/component/_generated/api.ts +60 -0
- package/src/component/_generated/component.ts +466 -0
- package/src/component/_generated/dataModel.ts +60 -0
- package/src/component/_generated/server.ts +156 -0
- package/src/index.ts +24 -0
- package/{dist/index.cjs → src/memory-adapter.ts} +345 -106
- package/src/types.ts +178 -0
- package/dist/client/index.cjs +0 -288
- package/dist/client/index.cjs.map +0 -1
- package/dist/client/index.d.cts +0 -566
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -322
- /package/{convex → src/component}/conversations.ts +0 -0
- /package/{convex → src/component}/convex.config.ts +0 -0
- /package/{convex → src/component}/messages.ts +0 -0
- /package/{convex → src/component}/schema.ts +0 -0
- /package/{convex → src/component}/steps.ts +0 -0
- /package/{convex → src/component}/validators.ts +0 -0
- /package/{convex → src/component}/workflows.ts +0 -0
- /package/{convex → src/component}/workingMemory.ts +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a new conversation
|
|
3
|
+
*/
|
|
4
|
+
export declare const create: import("convex/server").RegisteredMutation<"public", {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
userId: string;
|
|
8
|
+
resourceId: string;
|
|
9
|
+
metadata: Record<string, any>;
|
|
10
|
+
}, Promise<{
|
|
11
|
+
_id: import("convex/values").GenericId<"conversations">;
|
|
12
|
+
id: string;
|
|
13
|
+
resourceId: string;
|
|
14
|
+
userId: string;
|
|
15
|
+
title: string;
|
|
16
|
+
metadata: Record<string, any>;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
}>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a conversation by visible ID
|
|
22
|
+
*/
|
|
23
|
+
export declare const get: import("convex/server").RegisteredQuery<"public", {
|
|
24
|
+
id: string;
|
|
25
|
+
}, Promise<{
|
|
26
|
+
id: string;
|
|
27
|
+
resourceId: string;
|
|
28
|
+
userId: string;
|
|
29
|
+
title: string;
|
|
30
|
+
metadata: Record<string, any>;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
updatedAt: string;
|
|
33
|
+
} | null>>;
|
|
34
|
+
/**
|
|
35
|
+
* Get conversations by resource ID
|
|
36
|
+
*/
|
|
37
|
+
export declare const getByResourceId: import("convex/server").RegisteredQuery<"public", {
|
|
38
|
+
resourceId: string;
|
|
39
|
+
}, Promise<{
|
|
40
|
+
id: string;
|
|
41
|
+
resourceId: string;
|
|
42
|
+
userId: string;
|
|
43
|
+
title: string;
|
|
44
|
+
metadata: Record<string, any>;
|
|
45
|
+
createdAt: string;
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
}[]>>;
|
|
48
|
+
export declare const getByUserId: import("convex/server").RegisteredQuery<"public", {
|
|
49
|
+
limit?: number | undefined;
|
|
50
|
+
offset?: number | undefined;
|
|
51
|
+
orderBy?: string | undefined;
|
|
52
|
+
orderDirection?: string | undefined;
|
|
53
|
+
userId: string;
|
|
54
|
+
}, Promise<{
|
|
55
|
+
id: string;
|
|
56
|
+
resourceId: string;
|
|
57
|
+
userId: string;
|
|
58
|
+
title: string;
|
|
59
|
+
metadata: Record<string, any>;
|
|
60
|
+
createdAt: string;
|
|
61
|
+
updatedAt: string;
|
|
62
|
+
}[]>>;
|
|
63
|
+
/**
|
|
64
|
+
* Query conversations with filters
|
|
65
|
+
* Uses indexed queries to avoid loading all data into memory
|
|
66
|
+
*/
|
|
67
|
+
export declare const queryConversations: import("convex/server").RegisteredQuery<"public", {
|
|
68
|
+
userId?: string | undefined;
|
|
69
|
+
resourceId?: string | undefined;
|
|
70
|
+
limit?: number | undefined;
|
|
71
|
+
offset?: number | undefined;
|
|
72
|
+
orderBy?: string | undefined;
|
|
73
|
+
orderDirection?: string | undefined;
|
|
74
|
+
}, Promise<{
|
|
75
|
+
id: string;
|
|
76
|
+
resourceId: string;
|
|
77
|
+
userId: string;
|
|
78
|
+
title: string;
|
|
79
|
+
metadata: Record<string, any>;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
updatedAt: string;
|
|
82
|
+
}[]>>;
|
|
83
|
+
/**
|
|
84
|
+
* Update a conversation
|
|
85
|
+
*/
|
|
86
|
+
export declare const update: import("convex/server").RegisteredMutation<"public", {
|
|
87
|
+
title?: string | undefined;
|
|
88
|
+
resourceId?: string | undefined;
|
|
89
|
+
metadata?: Record<string, any> | undefined;
|
|
90
|
+
id: string;
|
|
91
|
+
}, Promise<{
|
|
92
|
+
id: string;
|
|
93
|
+
resourceId: string;
|
|
94
|
+
userId: string;
|
|
95
|
+
title: string;
|
|
96
|
+
metadata: Record<string, any>;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
updatedAt: string;
|
|
99
|
+
}>>;
|
|
100
|
+
/**
|
|
101
|
+
* Delete a conversation and all associated data
|
|
102
|
+
*/
|
|
103
|
+
export declare const remove: import("convex/server").RegisteredMutation<"public", {
|
|
104
|
+
id: string;
|
|
105
|
+
}, Promise<{
|
|
106
|
+
success: boolean;
|
|
107
|
+
}>>;
|
|
108
|
+
//# sourceMappingURL=conversations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/component/conversations.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;GAwCjB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,GAAG;;;;;;;;;;UAsBd,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;KAkB1B,CAAC;AAeH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;KAsCtB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;KAkE7B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;GAsCjB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,MAAM;;;;GAoCjB,CAAC"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conversation-related Convex functions
|
|
3
|
+
*/
|
|
4
|
+
import { mutation, query } from "./_generated/server";
|
|
5
|
+
import { v } from "convex/values";
|
|
6
|
+
import { vMetadata } from "./validators";
|
|
7
|
+
/**
|
|
8
|
+
* Create a new conversation
|
|
9
|
+
*/
|
|
10
|
+
export const create = mutation({
|
|
11
|
+
args: {
|
|
12
|
+
id: v.string(),
|
|
13
|
+
resourceId: v.string(),
|
|
14
|
+
userId: v.string(),
|
|
15
|
+
title: v.string(),
|
|
16
|
+
metadata: vMetadata,
|
|
17
|
+
},
|
|
18
|
+
handler: async (ctx, args) => {
|
|
19
|
+
const existing = await ctx.db
|
|
20
|
+
.query("conversations")
|
|
21
|
+
.withIndex("by_visible_id", (q) => q.eq("visibleId", args.id))
|
|
22
|
+
.first();
|
|
23
|
+
if (existing) {
|
|
24
|
+
throw new Error("Conversation already exists");
|
|
25
|
+
}
|
|
26
|
+
const now = new Date().toISOString();
|
|
27
|
+
const id = await ctx.db.insert("conversations", {
|
|
28
|
+
visibleId: args.id,
|
|
29
|
+
resourceId: args.resourceId,
|
|
30
|
+
userId: args.userId,
|
|
31
|
+
title: args.title,
|
|
32
|
+
metadata: args.metadata || {},
|
|
33
|
+
createdAt: now,
|
|
34
|
+
updatedAt: now,
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
_id: id,
|
|
38
|
+
id: args.id,
|
|
39
|
+
resourceId: args.resourceId,
|
|
40
|
+
userId: args.userId,
|
|
41
|
+
title: args.title,
|
|
42
|
+
metadata: args.metadata || {},
|
|
43
|
+
createdAt: now,
|
|
44
|
+
updatedAt: now,
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Get a conversation by visible ID
|
|
50
|
+
*/
|
|
51
|
+
export const get = query({
|
|
52
|
+
args: { id: v.string() },
|
|
53
|
+
handler: async (ctx, args) => {
|
|
54
|
+
const conversation = await ctx.db
|
|
55
|
+
.query("conversations")
|
|
56
|
+
.withIndex("by_visible_id", (q) => q.eq("visibleId", args.id))
|
|
57
|
+
.first();
|
|
58
|
+
if (!conversation) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
id: conversation.visibleId,
|
|
63
|
+
resourceId: conversation.resourceId,
|
|
64
|
+
userId: conversation.userId,
|
|
65
|
+
title: conversation.title,
|
|
66
|
+
metadata: conversation.metadata,
|
|
67
|
+
createdAt: conversation.createdAt,
|
|
68
|
+
updatedAt: conversation.updatedAt,
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
/**
|
|
73
|
+
* Get conversations by resource ID
|
|
74
|
+
*/
|
|
75
|
+
export const getByResourceId = query({
|
|
76
|
+
args: { resourceId: v.string() },
|
|
77
|
+
handler: async (ctx, args) => {
|
|
78
|
+
const conversations = await ctx.db
|
|
79
|
+
.query("conversations")
|
|
80
|
+
.withIndex("by_resource_id", (q) => q.eq("resourceId", args.resourceId))
|
|
81
|
+
.collect();
|
|
82
|
+
return conversations.map((c) => ({
|
|
83
|
+
id: c.visibleId,
|
|
84
|
+
resourceId: c.resourceId,
|
|
85
|
+
userId: c.userId,
|
|
86
|
+
title: c.title,
|
|
87
|
+
metadata: c.metadata,
|
|
88
|
+
createdAt: c.createdAt,
|
|
89
|
+
updatedAt: c.updatedAt,
|
|
90
|
+
}));
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* Get conversations by user ID with pagination and ordering
|
|
95
|
+
*/
|
|
96
|
+
// Map API field names to Convex schema field names
|
|
97
|
+
const orderByFieldMap = {
|
|
98
|
+
created_at: "createdAt",
|
|
99
|
+
updated_at: "updatedAt",
|
|
100
|
+
title: "title",
|
|
101
|
+
// Also support camelCase for flexibility
|
|
102
|
+
createdAt: "createdAt",
|
|
103
|
+
updatedAt: "updatedAt",
|
|
104
|
+
};
|
|
105
|
+
export const getByUserId = query({
|
|
106
|
+
args: {
|
|
107
|
+
userId: v.string(),
|
|
108
|
+
limit: v.optional(v.number()),
|
|
109
|
+
offset: v.optional(v.number()),
|
|
110
|
+
orderBy: v.optional(v.string()),
|
|
111
|
+
orderDirection: v.optional(v.string()),
|
|
112
|
+
},
|
|
113
|
+
handler: async (ctx, args) => {
|
|
114
|
+
let conversations = await ctx.db
|
|
115
|
+
.query("conversations")
|
|
116
|
+
.withIndex("by_user_id", (q) => q.eq("userId", args.userId))
|
|
117
|
+
.collect();
|
|
118
|
+
// Map the orderBy field and default to createdAt DESC per VoltAgent spec
|
|
119
|
+
const sortField = orderByFieldMap[args.orderBy || ""] || "createdAt";
|
|
120
|
+
const orderDir = args.orderDirection === "ASC" ? 1 : -1;
|
|
121
|
+
conversations.sort((a, b) => {
|
|
122
|
+
const aVal = a[sortField];
|
|
123
|
+
const bVal = b[sortField];
|
|
124
|
+
return orderDir * aVal.localeCompare(bVal);
|
|
125
|
+
});
|
|
126
|
+
const offset = args.offset || 0;
|
|
127
|
+
const limit = args.limit || 50;
|
|
128
|
+
conversations = conversations.slice(offset, offset + limit);
|
|
129
|
+
return conversations.map((c) => ({
|
|
130
|
+
id: c.visibleId,
|
|
131
|
+
resourceId: c.resourceId,
|
|
132
|
+
userId: c.userId,
|
|
133
|
+
title: c.title,
|
|
134
|
+
metadata: c.metadata,
|
|
135
|
+
createdAt: c.createdAt,
|
|
136
|
+
updatedAt: c.updatedAt,
|
|
137
|
+
}));
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
/**
|
|
141
|
+
* Query conversations with filters
|
|
142
|
+
* Uses indexed queries to avoid loading all data into memory
|
|
143
|
+
*/
|
|
144
|
+
export const queryConversations = query({
|
|
145
|
+
args: {
|
|
146
|
+
userId: v.optional(v.string()),
|
|
147
|
+
resourceId: v.optional(v.string()),
|
|
148
|
+
limit: v.optional(v.number()),
|
|
149
|
+
offset: v.optional(v.number()),
|
|
150
|
+
orderBy: v.optional(v.string()),
|
|
151
|
+
orderDirection: v.optional(v.string()),
|
|
152
|
+
},
|
|
153
|
+
handler: async (ctx, args) => {
|
|
154
|
+
// Use indexed queries based on available filters to avoid full table scans
|
|
155
|
+
let conversations;
|
|
156
|
+
if (args.userId) {
|
|
157
|
+
// Use user_id index - most common query pattern
|
|
158
|
+
conversations = await ctx.db
|
|
159
|
+
.query("conversations")
|
|
160
|
+
.withIndex("by_user_id", (q) => q.eq("userId", args.userId))
|
|
161
|
+
.collect();
|
|
162
|
+
// Apply secondary filter if needed
|
|
163
|
+
if (args.resourceId) {
|
|
164
|
+
conversations = conversations.filter((c) => c.resourceId === args.resourceId);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else if (args.resourceId) {
|
|
168
|
+
// Use resource_id index
|
|
169
|
+
conversations = await ctx.db
|
|
170
|
+
.query("conversations")
|
|
171
|
+
.withIndex("by_resource_id", (q) => q.eq("resourceId", args.resourceId))
|
|
172
|
+
.collect();
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
// No filters - apply a reasonable limit to prevent memory issues
|
|
176
|
+
// Return most recent conversations by default
|
|
177
|
+
const maxUnfilteredResults = 1000;
|
|
178
|
+
conversations = await ctx.db
|
|
179
|
+
.query("conversations")
|
|
180
|
+
.order("desc")
|
|
181
|
+
.take(maxUnfilteredResults);
|
|
182
|
+
}
|
|
183
|
+
// Map the orderBy field and default to createdAt DESC per VoltAgent spec
|
|
184
|
+
const sortField = orderByFieldMap[args.orderBy || ""] || "createdAt";
|
|
185
|
+
const orderDir = args.orderDirection === "ASC" ? 1 : -1;
|
|
186
|
+
conversations.sort((a, b) => {
|
|
187
|
+
const aVal = a[sortField];
|
|
188
|
+
const bVal = b[sortField];
|
|
189
|
+
return orderDir * aVal.localeCompare(bVal);
|
|
190
|
+
});
|
|
191
|
+
const offset = args.offset || 0;
|
|
192
|
+
const limit = args.limit || 50;
|
|
193
|
+
conversations = conversations.slice(offset, offset + limit);
|
|
194
|
+
return conversations.map((c) => ({
|
|
195
|
+
id: c.visibleId,
|
|
196
|
+
resourceId: c.resourceId,
|
|
197
|
+
userId: c.userId,
|
|
198
|
+
title: c.title,
|
|
199
|
+
metadata: c.metadata,
|
|
200
|
+
createdAt: c.createdAt,
|
|
201
|
+
updatedAt: c.updatedAt,
|
|
202
|
+
}));
|
|
203
|
+
},
|
|
204
|
+
});
|
|
205
|
+
/**
|
|
206
|
+
* Update a conversation
|
|
207
|
+
*/
|
|
208
|
+
export const update = mutation({
|
|
209
|
+
args: {
|
|
210
|
+
id: v.string(),
|
|
211
|
+
title: v.optional(v.string()),
|
|
212
|
+
resourceId: v.optional(v.string()),
|
|
213
|
+
metadata: v.optional(vMetadata),
|
|
214
|
+
},
|
|
215
|
+
handler: async (ctx, args) => {
|
|
216
|
+
const conversation = await ctx.db
|
|
217
|
+
.query("conversations")
|
|
218
|
+
.withIndex("by_visible_id", (q) => q.eq("visibleId", args.id))
|
|
219
|
+
.first();
|
|
220
|
+
if (!conversation) {
|
|
221
|
+
throw new Error("Conversation not found");
|
|
222
|
+
}
|
|
223
|
+
const updates = {
|
|
224
|
+
updatedAt: new Date().toISOString(),
|
|
225
|
+
};
|
|
226
|
+
if (args.title !== undefined)
|
|
227
|
+
updates.title = args.title;
|
|
228
|
+
if (args.resourceId !== undefined)
|
|
229
|
+
updates.resourceId = args.resourceId;
|
|
230
|
+
if (args.metadata !== undefined)
|
|
231
|
+
updates.metadata = args.metadata;
|
|
232
|
+
await ctx.db.patch(conversation._id, updates);
|
|
233
|
+
const updated = await ctx.db.get(conversation._id);
|
|
234
|
+
return {
|
|
235
|
+
id: updated.visibleId,
|
|
236
|
+
resourceId: updated.resourceId,
|
|
237
|
+
userId: updated.userId,
|
|
238
|
+
title: updated.title,
|
|
239
|
+
metadata: updated.metadata,
|
|
240
|
+
createdAt: updated.createdAt,
|
|
241
|
+
updatedAt: updated.updatedAt,
|
|
242
|
+
};
|
|
243
|
+
},
|
|
244
|
+
});
|
|
245
|
+
/**
|
|
246
|
+
* Delete a conversation and all associated data
|
|
247
|
+
*/
|
|
248
|
+
export const remove = mutation({
|
|
249
|
+
args: { id: v.string() },
|
|
250
|
+
handler: async (ctx, args) => {
|
|
251
|
+
const conversation = await ctx.db
|
|
252
|
+
.query("conversations")
|
|
253
|
+
.withIndex("by_visible_id", (q) => q.eq("visibleId", args.id))
|
|
254
|
+
.first();
|
|
255
|
+
if (!conversation) {
|
|
256
|
+
throw new Error("Conversation not found");
|
|
257
|
+
}
|
|
258
|
+
// Delete associated messages
|
|
259
|
+
const messages = await ctx.db
|
|
260
|
+
.query("messages")
|
|
261
|
+
.withIndex("by_conversation_id", (q) => q.eq("conversationId", args.id))
|
|
262
|
+
.collect();
|
|
263
|
+
for (const message of messages) {
|
|
264
|
+
await ctx.db.delete(message._id);
|
|
265
|
+
}
|
|
266
|
+
// Delete associated steps
|
|
267
|
+
const steps = await ctx.db
|
|
268
|
+
.query("conversationSteps")
|
|
269
|
+
.withIndex("by_conversation_id", (q) => q.eq("conversationId", args.id))
|
|
270
|
+
.collect();
|
|
271
|
+
for (const step of steps) {
|
|
272
|
+
await ctx.db.delete(step._id);
|
|
273
|
+
}
|
|
274
|
+
await ctx.db.delete(conversation._id);
|
|
275
|
+
return { success: true };
|
|
276
|
+
},
|
|
277
|
+
});
|
|
278
|
+
//# sourceMappingURL=conversations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../src/component/conversations.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC;IAC7B,IAAI,EAAE;QACJ,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;QACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;QACtB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,QAAQ,EAAE,SAAS;KACpB;IACD,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;QAC3B,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,EAAE;aAC1B,KAAK,CAAC,eAAe,CAAC;aACtB,SAAS,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,C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AE,CAAC,gBAAgB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;aACvE,OAAO,EAAE,CAAC;QAEb,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAChC,CAAC;QAED,MAAM,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;QAEtC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VoltAgent component definition.
|
|
3
|
+
*
|
|
4
|
+
* This component provides:
|
|
5
|
+
* - Conversation storage with metadata
|
|
6
|
+
* - Message persistence with UIMessage format
|
|
7
|
+
* - Working memory (conversation and user scoped)
|
|
8
|
+
* - Workflow state management for suspendable workflows
|
|
9
|
+
* - Conversation steps for observability
|
|
10
|
+
*/
|
|
11
|
+
declare const component: import("convex/server").ComponentDefinition<any>;
|
|
12
|
+
export default component;
|
|
13
|
+
//# sourceMappingURL=convex.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convex.config.d.ts","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AASA;;;;;;;;;GASG;AACH,QAAA,MAAM,SAAS,kDAA+B,CAAC;AAE/C,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VoltAgent Convex Component Configuration
|
|
3
|
+
*
|
|
4
|
+
* This file defines the VoltAgent component for Convex.
|
|
5
|
+
* When users install this component in their Convex project,
|
|
6
|
+
* they get isolated tables and functions for VoltAgent memory storage.
|
|
7
|
+
*/
|
|
8
|
+
import { defineComponent } from "convex/server";
|
|
9
|
+
/**
|
|
10
|
+
* VoltAgent component definition.
|
|
11
|
+
*
|
|
12
|
+
* This component provides:
|
|
13
|
+
* - Conversation storage with metadata
|
|
14
|
+
* - Message persistence with UIMessage format
|
|
15
|
+
* - Working memory (conversation and user scoped)
|
|
16
|
+
* - Workflow state management for suspendable workflows
|
|
17
|
+
* - Conversation steps for observability
|
|
18
|
+
*/
|
|
19
|
+
const component = defineComponent("voltagent");
|
|
20
|
+
export default component;
|
|
21
|
+
//# sourceMappingURL=convex.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convex.config.js","sourceRoot":"","sources":["../../src/component/convex.config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;;;;;GASG;AACH,MAAM,SAAS,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;AAE/C,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Add a single message to a conversation
|
|
3
|
+
*/
|
|
4
|
+
export declare const add: import("convex/server").RegisteredMutation<"public", {
|
|
5
|
+
metadata?: Record<string, any> | undefined;
|
|
6
|
+
id: string;
|
|
7
|
+
userId: string;
|
|
8
|
+
parts: ({
|
|
9
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
10
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
11
|
+
text: string;
|
|
12
|
+
type: "text";
|
|
13
|
+
} | {
|
|
14
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
15
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
16
|
+
mimeType?: string | undefined;
|
|
17
|
+
type: "image";
|
|
18
|
+
image: string;
|
|
19
|
+
} | {
|
|
20
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
21
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
22
|
+
filename?: string | undefined;
|
|
23
|
+
data: string;
|
|
24
|
+
type: "file";
|
|
25
|
+
mimeType: string;
|
|
26
|
+
} | {
|
|
27
|
+
providerExecuted?: boolean | undefined;
|
|
28
|
+
state?: "partial-call" | "call" | undefined;
|
|
29
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
30
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
31
|
+
toolCallId: string;
|
|
32
|
+
type: "tool-call";
|
|
33
|
+
args: Record<string, any>;
|
|
34
|
+
toolName: string;
|
|
35
|
+
} | {
|
|
36
|
+
providerExecuted?: boolean | undefined;
|
|
37
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
38
|
+
result?: any;
|
|
39
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
40
|
+
isError?: boolean | undefined;
|
|
41
|
+
toolCallId: string;
|
|
42
|
+
type: "tool-result";
|
|
43
|
+
toolName: string;
|
|
44
|
+
} | {
|
|
45
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
46
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
47
|
+
signature?: string | undefined;
|
|
48
|
+
text: string;
|
|
49
|
+
type: "reasoning";
|
|
50
|
+
} | {
|
|
51
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
52
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
53
|
+
data: string;
|
|
54
|
+
type: "redacted-reasoning";
|
|
55
|
+
} | {
|
|
56
|
+
title?: string | undefined;
|
|
57
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
58
|
+
url?: string | undefined;
|
|
59
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
60
|
+
filename?: string | undefined;
|
|
61
|
+
mediaType?: string | undefined;
|
|
62
|
+
id: string;
|
|
63
|
+
type: "source";
|
|
64
|
+
sourceType: "url" | "document";
|
|
65
|
+
})[];
|
|
66
|
+
conversationId: string;
|
|
67
|
+
role: string;
|
|
68
|
+
}, Promise<{
|
|
69
|
+
id: string;
|
|
70
|
+
updated: boolean;
|
|
71
|
+
created?: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
id: string;
|
|
74
|
+
created: boolean;
|
|
75
|
+
updated?: undefined;
|
|
76
|
+
}>>;
|
|
77
|
+
/**
|
|
78
|
+
* Add multiple messages to a conversation
|
|
79
|
+
*/
|
|
80
|
+
export declare const addMany: import("convex/server").RegisteredMutation<"public", {
|
|
81
|
+
messages: {
|
|
82
|
+
metadata?: Record<string, any> | undefined;
|
|
83
|
+
id: string;
|
|
84
|
+
userId: string;
|
|
85
|
+
parts: ({
|
|
86
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
87
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
88
|
+
text: string;
|
|
89
|
+
type: "text";
|
|
90
|
+
} | {
|
|
91
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
92
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
93
|
+
mimeType?: string | undefined;
|
|
94
|
+
type: "image";
|
|
95
|
+
image: string;
|
|
96
|
+
} | {
|
|
97
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
98
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
99
|
+
filename?: string | undefined;
|
|
100
|
+
data: string;
|
|
101
|
+
type: "file";
|
|
102
|
+
mimeType: string;
|
|
103
|
+
} | {
|
|
104
|
+
providerExecuted?: boolean | undefined;
|
|
105
|
+
state?: "partial-call" | "call" | undefined;
|
|
106
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
107
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
108
|
+
toolCallId: string;
|
|
109
|
+
type: "tool-call";
|
|
110
|
+
args: Record<string, any>;
|
|
111
|
+
toolName: string;
|
|
112
|
+
} | {
|
|
113
|
+
providerExecuted?: boolean | undefined;
|
|
114
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
115
|
+
result?: any;
|
|
116
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
117
|
+
isError?: boolean | undefined;
|
|
118
|
+
toolCallId: string;
|
|
119
|
+
type: "tool-result";
|
|
120
|
+
toolName: string;
|
|
121
|
+
} | {
|
|
122
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
123
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
124
|
+
signature?: string | undefined;
|
|
125
|
+
text: string;
|
|
126
|
+
type: "reasoning";
|
|
127
|
+
} | {
|
|
128
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
129
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
130
|
+
data: string;
|
|
131
|
+
type: "redacted-reasoning";
|
|
132
|
+
} | {
|
|
133
|
+
title?: string | undefined;
|
|
134
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
135
|
+
url?: string | undefined;
|
|
136
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
137
|
+
filename?: string | undefined;
|
|
138
|
+
mediaType?: string | undefined;
|
|
139
|
+
id: string;
|
|
140
|
+
type: "source";
|
|
141
|
+
sourceType: "url" | "document";
|
|
142
|
+
})[];
|
|
143
|
+
conversationId: string;
|
|
144
|
+
role: string;
|
|
145
|
+
}[];
|
|
146
|
+
}, Promise<{
|
|
147
|
+
id: string;
|
|
148
|
+
created?: boolean;
|
|
149
|
+
updated?: boolean;
|
|
150
|
+
}[]>>;
|
|
151
|
+
/**
|
|
152
|
+
* Get messages from a conversation with optional filtering
|
|
153
|
+
*/
|
|
154
|
+
export declare const get: import("convex/server").RegisteredQuery<"public", {
|
|
155
|
+
limit?: number | undefined;
|
|
156
|
+
before?: string | undefined;
|
|
157
|
+
after?: string | undefined;
|
|
158
|
+
roles?: string[] | undefined;
|
|
159
|
+
userId: string;
|
|
160
|
+
conversationId: string;
|
|
161
|
+
}, Promise<{
|
|
162
|
+
id: string;
|
|
163
|
+
role: string;
|
|
164
|
+
parts: ({
|
|
165
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
166
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
167
|
+
text: string;
|
|
168
|
+
type: "text";
|
|
169
|
+
} | {
|
|
170
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
171
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
172
|
+
mimeType?: string | undefined;
|
|
173
|
+
type: "image";
|
|
174
|
+
image: string;
|
|
175
|
+
} | {
|
|
176
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
177
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
178
|
+
filename?: string | undefined;
|
|
179
|
+
data: string;
|
|
180
|
+
type: "file";
|
|
181
|
+
mimeType: string;
|
|
182
|
+
} | {
|
|
183
|
+
providerExecuted?: boolean | undefined;
|
|
184
|
+
state?: "partial-call" | "call" | undefined;
|
|
185
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
186
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
187
|
+
toolCallId: string;
|
|
188
|
+
type: "tool-call";
|
|
189
|
+
args: Record<string, any>;
|
|
190
|
+
toolName: string;
|
|
191
|
+
} | {
|
|
192
|
+
providerExecuted?: boolean | undefined;
|
|
193
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
194
|
+
result?: any;
|
|
195
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
196
|
+
isError?: boolean | undefined;
|
|
197
|
+
toolCallId: string;
|
|
198
|
+
type: "tool-result";
|
|
199
|
+
toolName: string;
|
|
200
|
+
} | {
|
|
201
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
202
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
203
|
+
signature?: string | undefined;
|
|
204
|
+
text: string;
|
|
205
|
+
type: "reasoning";
|
|
206
|
+
} | {
|
|
207
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
208
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
209
|
+
data: string;
|
|
210
|
+
type: "redacted-reasoning";
|
|
211
|
+
} | {
|
|
212
|
+
title?: string | undefined;
|
|
213
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
214
|
+
url?: string | undefined;
|
|
215
|
+
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
216
|
+
filename?: string | undefined;
|
|
217
|
+
mediaType?: string | undefined;
|
|
218
|
+
id: string;
|
|
219
|
+
type: "source";
|
|
220
|
+
sourceType: "url" | "document";
|
|
221
|
+
})[];
|
|
222
|
+
metadata: {
|
|
223
|
+
createdAt: string;
|
|
224
|
+
};
|
|
225
|
+
}[]>>;
|
|
226
|
+
/**
|
|
227
|
+
* Clear messages for a user (optionally for a specific conversation)
|
|
228
|
+
*/
|
|
229
|
+
export declare const clear: import("convex/server").RegisteredMutation<"public", {
|
|
230
|
+
conversationId?: string | undefined;
|
|
231
|
+
userId: string;
|
|
232
|
+
}, Promise<{
|
|
233
|
+
success: boolean;
|
|
234
|
+
}>>;
|
|
235
|
+
//# sourceMappingURL=messages.d.ts.map
|