@o-zakstam/voltagent-convex 1.1.2 → 1.1.4
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/{index.d.cts → defineVoltAgentAPI.d.ts} +59 -92
- 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 -221
- 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/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,78 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated utilities for implementing server-side Convex query and mutation functions.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { actionGeneric, httpActionGeneric, queryGeneric, mutationGeneric, internalActionGeneric, internalMutationGeneric, internalQueryGeneric, } from "convex/server";
|
|
11
|
+
/**
|
|
12
|
+
* Define a query in this Convex app's public API.
|
|
13
|
+
*
|
|
14
|
+
* This function will be allowed to read your Convex database and will be accessible from the client.
|
|
15
|
+
*
|
|
16
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
17
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
18
|
+
*/
|
|
19
|
+
export const query = queryGeneric;
|
|
20
|
+
/**
|
|
21
|
+
* Define a query that is only accessible from other Convex functions (but not from the client).
|
|
22
|
+
*
|
|
23
|
+
* This function will be allowed to read from your Convex database. It will not be accessible from the client.
|
|
24
|
+
*
|
|
25
|
+
* @param func - The query function. It receives a {@link QueryCtx} as its first argument.
|
|
26
|
+
* @returns The wrapped query. Include this as an `export` to name it and make it accessible.
|
|
27
|
+
*/
|
|
28
|
+
export const internalQuery = internalQueryGeneric;
|
|
29
|
+
/**
|
|
30
|
+
* Define a mutation in this Convex app's public API.
|
|
31
|
+
*
|
|
32
|
+
* This function will be allowed to modify your Convex database and will be accessible from the client.
|
|
33
|
+
*
|
|
34
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
35
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
36
|
+
*/
|
|
37
|
+
export const mutation = mutationGeneric;
|
|
38
|
+
/**
|
|
39
|
+
* Define a mutation that is only accessible from other Convex functions (but not from the client).
|
|
40
|
+
*
|
|
41
|
+
* This function will be allowed to modify your Convex database. It will not be accessible from the client.
|
|
42
|
+
*
|
|
43
|
+
* @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
|
|
44
|
+
* @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
|
|
45
|
+
*/
|
|
46
|
+
export const internalMutation = internalMutationGeneric;
|
|
47
|
+
/**
|
|
48
|
+
* Define an action in this Convex app's public API.
|
|
49
|
+
*
|
|
50
|
+
* An action is a function which can execute any JavaScript code, including non-deterministic
|
|
51
|
+
* code and code with side-effects, like calling third-party services.
|
|
52
|
+
* They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
|
|
53
|
+
* They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
|
|
54
|
+
*
|
|
55
|
+
* @param func - The action. It receives an {@link ActionCtx} as its first argument.
|
|
56
|
+
* @returns The wrapped action. Include this as an `export` to name it and make it accessible.
|
|
57
|
+
*/
|
|
58
|
+
export const action = actionGeneric;
|
|
59
|
+
/**
|
|
60
|
+
* Define an action that is only accessible from other Convex functions (but not from the client).
|
|
61
|
+
*
|
|
62
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument.
|
|
63
|
+
* @returns The wrapped function. Include this as an `export` to name it and make it accessible.
|
|
64
|
+
*/
|
|
65
|
+
export const internalAction = internalActionGeneric;
|
|
66
|
+
/**
|
|
67
|
+
* Define an HTTP action.
|
|
68
|
+
*
|
|
69
|
+
* The wrapped function will be used to respond to HTTP requests received
|
|
70
|
+
* by a Convex deployment if the requests matches the path and method where
|
|
71
|
+
* this action is routed. Be sure to route your httpAction in `convex/http.js`.
|
|
72
|
+
*
|
|
73
|
+
* @param func - The function. It receives an {@link ActionCtx} as its first argument
|
|
74
|
+
* and a Fetch API `Request` object as its second.
|
|
75
|
+
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
|
|
76
|
+
*/
|
|
77
|
+
export const httpAction = httpActionGeneric;
|
|
78
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/component/_generated/server.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB;;;;;;;GAOG;AAaH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAGvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,KAAK,GAAsC,YAAY,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,aAAa,GACxB,oBAAoB,CAAC;AAEvB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAyC,eAAe,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,uBAAuB,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,MAAM,GAAuC,aAAa,CAAC;AAExE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GACzB,qBAAqB,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAsB,iBAAiB,CAAC"}
|
|
@@ -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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* - 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"}
|