@convex-dev/agent 0.0.1-alpha.2 → 0.0.1-alpha.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.
Files changed (60) hide show
  1. package/README.md +91 -95
  2. package/dist/commonjs/client/index.d.ts +60 -60
  3. package/dist/commonjs/client/index.d.ts.map +1 -1
  4. package/dist/commonjs/client/index.js +80 -77
  5. package/dist/commonjs/client/index.js.map +1 -1
  6. package/dist/commonjs/client/types.d.ts +1 -1
  7. package/dist/commonjs/client/types.d.ts.map +1 -1
  8. package/dist/commonjs/component/messages.d.ts +56 -56
  9. package/dist/commonjs/component/messages.d.ts.map +1 -1
  10. package/dist/commonjs/component/messages.js +128 -134
  11. package/dist/commonjs/component/messages.js.map +1 -1
  12. package/dist/commonjs/component/schema.d.ts +256 -256
  13. package/dist/commonjs/component/schema.d.ts.map +1 -1
  14. package/dist/commonjs/component/schema.js +18 -18
  15. package/dist/commonjs/component/schema.js.map +1 -1
  16. package/dist/commonjs/component/vector/index.d.ts +4 -4
  17. package/dist/commonjs/component/vector/index.d.ts.map +1 -1
  18. package/dist/commonjs/component/vector/index.js +12 -10
  19. package/dist/commonjs/component/vector/index.js.map +1 -1
  20. package/dist/commonjs/component/vector/tables.d.ts +3 -3
  21. package/dist/commonjs/component/vector/tables.js +6 -6
  22. package/dist/commonjs/component/vector/tables.js.map +1 -1
  23. package/dist/commonjs/validators.d.ts +5 -5
  24. package/dist/commonjs/validators.d.ts.map +1 -1
  25. package/dist/commonjs/validators.js +3 -3
  26. package/dist/commonjs/validators.js.map +1 -1
  27. package/dist/esm/client/index.d.ts +60 -60
  28. package/dist/esm/client/index.d.ts.map +1 -1
  29. package/dist/esm/client/index.js +80 -77
  30. package/dist/esm/client/index.js.map +1 -1
  31. package/dist/esm/client/types.d.ts +1 -1
  32. package/dist/esm/client/types.d.ts.map +1 -1
  33. package/dist/esm/component/messages.d.ts +56 -56
  34. package/dist/esm/component/messages.d.ts.map +1 -1
  35. package/dist/esm/component/messages.js +128 -134
  36. package/dist/esm/component/messages.js.map +1 -1
  37. package/dist/esm/component/schema.d.ts +256 -256
  38. package/dist/esm/component/schema.d.ts.map +1 -1
  39. package/dist/esm/component/schema.js +18 -18
  40. package/dist/esm/component/schema.js.map +1 -1
  41. package/dist/esm/component/vector/index.d.ts +4 -4
  42. package/dist/esm/component/vector/index.d.ts.map +1 -1
  43. package/dist/esm/component/vector/index.js +12 -10
  44. package/dist/esm/component/vector/index.js.map +1 -1
  45. package/dist/esm/component/vector/tables.d.ts +3 -3
  46. package/dist/esm/component/vector/tables.js +6 -6
  47. package/dist/esm/component/vector/tables.js.map +1 -1
  48. package/dist/esm/validators.d.ts +5 -5
  49. package/dist/esm/validators.d.ts.map +1 -1
  50. package/dist/esm/validators.js +3 -3
  51. package/dist/esm/validators.js.map +1 -1
  52. package/package.json +2 -2
  53. package/src/client/index.ts +133 -127
  54. package/src/client/types.ts +1 -1
  55. package/src/component/_generated/api.d.ts +53 -53
  56. package/src/component/messages.ts +139 -145
  57. package/src/component/schema.ts +18 -18
  58. package/src/component/vector/index.ts +13 -11
  59. package/src/component/vector/tables.ts +6 -6
  60. package/src/validators.ts +6 -3
@@ -40,7 +40,6 @@ export type Mounts = {
40
40
  "public",
41
41
  {
42
42
  agentName?: string;
43
- chatId?: string;
44
43
  failPendingSteps?: boolean;
45
44
  messages: Array<{
46
45
  fileId?: string;
@@ -147,6 +146,7 @@ export type Mounts = {
147
146
  parentMessageId?: string;
148
147
  pending?: boolean;
149
148
  stepId?: string;
149
+ threadId?: string;
150
150
  userId?: string;
151
151
  },
152
152
  {
@@ -154,7 +154,6 @@ export type Mounts = {
154
154
  _creationTime: number;
155
155
  _id: string;
156
156
  agentName?: string;
157
- chatId?: string;
158
157
  embeddingId?:
159
158
  | string
160
159
  | string
@@ -266,6 +265,7 @@ export type Mounts = {
266
265
  };
267
266
  model?: string;
268
267
  order: number;
268
+ parentMessageId?: string;
269
269
  status: "pending" | "success" | "failed";
270
270
  stepId?: string;
271
271
  stepOrder?: number;
@@ -278,7 +278,6 @@ export type Mounts = {
278
278
  _creationTime: number;
279
279
  _id: string;
280
280
  agentName?: string;
281
- chatId?: string;
282
281
  embeddingId?:
283
282
  | string
284
283
  | string
@@ -390,6 +389,7 @@ export type Mounts = {
390
389
  };
391
390
  model?: string;
392
391
  order: number;
392
+ parentMessageId?: string;
393
393
  status: "pending" | "success" | "failed";
394
394
  stepId?: string;
395
395
  stepOrder?: number;
@@ -404,7 +404,6 @@ export type Mounts = {
404
404
  "mutation",
405
405
  "public",
406
406
  {
407
- chatId: string;
408
407
  failPendingSteps?: boolean;
409
408
  messageId: string;
410
409
  steps: Array<{
@@ -711,11 +710,11 @@ export type Mounts = {
711
710
  >;
712
711
  };
713
712
  }>;
713
+ threadId: string;
714
714
  },
715
715
  Array<{
716
716
  _creationTime: number;
717
717
  _id: string;
718
- chatId: string;
719
718
  order: number;
720
719
  parentMessageId: string;
721
720
  status: "pending" | "success" | "failed";
@@ -917,18 +916,19 @@ export type Mounts = {
917
916
  >;
918
917
  };
919
918
  stepOrder: number;
919
+ threadId: string;
920
920
  }>
921
921
  >;
922
- archiveChat: FunctionReference<
922
+ archiveThread: FunctionReference<
923
923
  "mutation",
924
924
  "public",
925
- { chatId: string },
925
+ { threadId: string },
926
926
  {
927
927
  _creationTime: number;
928
928
  _id: string;
929
929
  defaultSystemPrompt?: string;
930
930
  order?: number;
931
- parentChatIds?: Array<string>;
931
+ parentThreadIds?: Array<string>;
932
932
  status: "active" | "archived";
933
933
  summary?: string;
934
934
  title?: string;
@@ -941,12 +941,12 @@ export type Mounts = {
941
941
  { messageId: string },
942
942
  null
943
943
  >;
944
- createChat: FunctionReference<
944
+ createThread: FunctionReference<
945
945
  "mutation",
946
946
  "public",
947
947
  {
948
948
  defaultSystemPrompt?: string;
949
- parentChatIds?: Array<string>;
949
+ parentThreadIds?: Array<string>;
950
950
  summary?: string;
951
951
  title?: string;
952
952
  userId?: string;
@@ -956,23 +956,23 @@ export type Mounts = {
956
956
  _id: string;
957
957
  defaultSystemPrompt?: string;
958
958
  order?: number;
959
- parentChatIds?: Array<string>;
959
+ parentThreadIds?: Array<string>;
960
960
  status: "active" | "archived";
961
961
  summary?: string;
962
962
  title?: string;
963
963
  userId?: string;
964
964
  }
965
965
  >;
966
- deleteAllForChatIdAsync: FunctionReference<
966
+ deleteAllForThreadIdAsync: FunctionReference<
967
967
  "mutation",
968
968
  "public",
969
- { chatId: string; cursor?: string; limit?: number },
969
+ { cursor?: string; limit?: number; threadId: string },
970
970
  { cursor: string; isDone: boolean }
971
971
  >;
972
- deleteAllForChatIdSync: FunctionReference<
972
+ deleteAllForThreadIdSync: FunctionReference<
973
973
  "action",
974
974
  "public",
975
- { chatId: string; cursor?: string; limit?: number },
975
+ { cursor?: string; limit?: number; threadId: string },
976
976
  { cursor: string; isDone: boolean }
977
977
  >;
978
978
  deleteAllForUserId: FunctionReference<
@@ -987,33 +987,49 @@ export type Mounts = {
987
987
  { userId: string },
988
988
  boolean
989
989
  >;
990
- getChat: FunctionReference<
990
+ getFilesToDelete: FunctionReference<
991
+ "query",
992
+ "public",
993
+ { cursor?: string; limit?: number },
994
+ {
995
+ continueCursor: string;
996
+ files: Array<{
997
+ _creationTime: number;
998
+ _id: string;
999
+ hash: string;
1000
+ refcount: number;
1001
+ storageId: string;
1002
+ }>;
1003
+ isDone: boolean;
1004
+ }
1005
+ >;
1006
+ getThread: FunctionReference<
991
1007
  "query",
992
1008
  "public",
993
- { chatId: string },
1009
+ { threadId: string },
994
1010
  {
995
1011
  _creationTime: number;
996
1012
  _id: string;
997
1013
  defaultSystemPrompt?: string;
998
1014
  order?: number;
999
- parentChatIds?: Array<string>;
1015
+ parentThreadIds?: Array<string>;
1000
1016
  status: "active" | "archived";
1001
1017
  summary?: string;
1002
1018
  title?: string;
1003
1019
  userId?: string;
1004
1020
  } | null
1005
1021
  >;
1006
- getChatMessages: FunctionReference<
1022
+ getThreadMessages: FunctionReference<
1007
1023
  "query",
1008
1024
  "public",
1009
1025
  {
1010
- chatId: string;
1011
1026
  cursor?: string;
1012
1027
  isTool?: boolean;
1013
1028
  limit?: number;
1014
1029
  order?: "asc" | "desc";
1015
1030
  parentMessageId?: string;
1016
1031
  statuses?: Array<"pending" | "success" | "failed">;
1032
+ threadId: string;
1017
1033
  },
1018
1034
  {
1019
1035
  continueCursor: string;
@@ -1022,7 +1038,6 @@ export type Mounts = {
1022
1038
  _creationTime: number;
1023
1039
  _id: string;
1024
1040
  agentName?: string;
1025
- chatId?: string;
1026
1041
  embeddingId?:
1027
1042
  | string
1028
1043
  | string
@@ -1134,6 +1149,7 @@ export type Mounts = {
1134
1149
  };
1135
1150
  model?: string;
1136
1151
  order: number;
1152
+ parentMessageId?: string;
1137
1153
  status: "pending" | "success" | "failed";
1138
1154
  stepId?: string;
1139
1155
  stepOrder?: number;
@@ -1144,7 +1160,7 @@ export type Mounts = {
1144
1160
  }>;
1145
1161
  }
1146
1162
  >;
1147
- getChatsByUserId: FunctionReference<
1163
+ getThreadsByUserId: FunctionReference<
1148
1164
  "query",
1149
1165
  "public",
1150
1166
  {
@@ -1155,35 +1171,19 @@ export type Mounts = {
1155
1171
  userId: string;
1156
1172
  },
1157
1173
  {
1158
- chats: Array<{
1174
+ continueCursor: string;
1175
+ isDone: boolean;
1176
+ threads: Array<{
1159
1177
  _creationTime: number;
1160
1178
  _id: string;
1161
1179
  defaultSystemPrompt?: string;
1162
1180
  order?: number;
1163
- parentChatIds?: Array<string>;
1181
+ parentThreadIds?: Array<string>;
1164
1182
  status: "active" | "archived";
1165
1183
  summary?: string;
1166
1184
  title?: string;
1167
1185
  userId?: string;
1168
1186
  }>;
1169
- continueCursor: string;
1170
- isDone: boolean;
1171
- }
1172
- >;
1173
- getFilesToDelete: FunctionReference<
1174
- "query",
1175
- "public",
1176
- { cursor?: string; limit?: number },
1177
- {
1178
- continueCursor: string;
1179
- files: Array<{
1180
- _creationTime: number;
1181
- _id: string;
1182
- hash: string;
1183
- refcount: number;
1184
- storageId: string;
1185
- }>;
1186
- isDone: boolean;
1187
1187
  }
1188
1188
  >;
1189
1189
  rollbackMessage: FunctionReference<
@@ -1196,11 +1196,11 @@ export type Mounts = {
1196
1196
  "action",
1197
1197
  "public",
1198
1198
  {
1199
- chatId?: string;
1200
1199
  limit: number;
1201
1200
  messageRange?: { after: number; before: number };
1202
1201
  parentMessageId?: string;
1203
1202
  text?: string;
1203
+ threadId?: string;
1204
1204
  userId?: string;
1205
1205
  vector?: Array<number>;
1206
1206
  vectorModel?: string;
@@ -1209,7 +1209,6 @@ export type Mounts = {
1209
1209
  _creationTime: number;
1210
1210
  _id: string;
1211
1211
  agentName?: string;
1212
- chatId?: string;
1213
1212
  embeddingId?:
1214
1213
  | string
1215
1214
  | string
@@ -1321,6 +1320,7 @@ export type Mounts = {
1321
1320
  };
1322
1321
  model?: string;
1323
1322
  order: number;
1323
+ parentMessageId?: string;
1324
1324
  status: "pending" | "success" | "failed";
1325
1325
  stepId?: string;
1326
1326
  stepOrder?: number;
@@ -1333,12 +1333,11 @@ export type Mounts = {
1333
1333
  textSearch: FunctionReference<
1334
1334
  "query",
1335
1335
  "public",
1336
- { chatId?: string; limit: number; text: string; userId?: string },
1336
+ { limit: number; text: string; threadId?: string; userId?: string },
1337
1337
  Array<{
1338
1338
  _creationTime: number;
1339
1339
  _id: string;
1340
1340
  agentName?: string;
1341
- chatId?: string;
1342
1341
  embeddingId?:
1343
1342
  | string
1344
1343
  | string
@@ -1450,6 +1449,7 @@ export type Mounts = {
1450
1449
  };
1451
1450
  model?: string;
1452
1451
  order: number;
1452
+ parentMessageId?: string;
1453
1453
  status: "pending" | "success" | "failed";
1454
1454
  stepId?: string;
1455
1455
  stepOrder?: number;
@@ -1459,24 +1459,24 @@ export type Mounts = {
1459
1459
  userId?: string;
1460
1460
  }>
1461
1461
  >;
1462
- updateChat: FunctionReference<
1462
+ updateThread: FunctionReference<
1463
1463
  "mutation",
1464
1464
  "public",
1465
1465
  {
1466
- chatId: string;
1467
1466
  patch: {
1468
1467
  defaultSystemPrompt?: string;
1469
1468
  status?: "active" | "archived";
1470
1469
  summary?: string;
1471
1470
  title?: string;
1472
1471
  };
1472
+ threadId: string;
1473
1473
  },
1474
1474
  {
1475
1475
  _creationTime: number;
1476
1476
  _id: string;
1477
1477
  defaultSystemPrompt?: string;
1478
1478
  order?: number;
1479
- parentChatIds?: Array<string>;
1479
+ parentThreadIds?: Array<string>;
1480
1480
  status: "active" | "archived";
1481
1481
  summary?: string;
1482
1482
  title?: string;
@@ -1504,14 +1504,14 @@ export type Mounts = {
1504
1504
  },
1505
1505
  null
1506
1506
  >;
1507
- deleteBatchForChat: FunctionReference<
1507
+ deleteBatchForThread: FunctionReference<
1508
1508
  "mutation",
1509
1509
  "public",
1510
1510
  {
1511
- chatId: string;
1512
1511
  cursor?: string;
1513
1512
  limit: number;
1514
1513
  model: string;
1514
+ threadId: string;
1515
1515
  vectorDimension:
1516
1516
  | 128
1517
1517
  | 256
@@ -1540,9 +1540,9 @@ export type Mounts = {
1540
1540
  | 3072
1541
1541
  | 4096;
1542
1542
  vectors: Array<{
1543
- chatId?: string;
1544
- kind: "chat" | "memory";
1543
+ kind: "thread" | "memory";
1545
1544
  model: string;
1545
+ threadId?: string;
1546
1546
  userId?: string;
1547
1547
  vector: Array<number>;
1548
1548
  }>;