@convex-dev/agent 0.1.9-alpha.5 → 0.1.9-alpha.7
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/commonjs/client/index.d.ts +71 -71
- package/dist/commonjs/component/messages.d.ts +210 -210
- package/dist/commonjs/component/schema.d.ts +563 -563
- package/dist/commonjs/component/streams.d.ts +11 -11
- package/dist/commonjs/component/threads.d.ts +18 -18
- package/dist/commonjs/component/vector/index.d.ts +3 -3
- package/dist/commonjs/component/vector/tables.d.ts +5 -3
- package/dist/commonjs/component/vector/tables.d.ts.map +1 -1
- package/dist/commonjs/react/index.d.ts +1 -1
- package/dist/commonjs/react/index.d.ts.map +1 -1
- package/dist/commonjs/react/index.js +7 -5
- package/dist/commonjs/react/index.js.map +1 -1
- package/dist/commonjs/validators.d.ts +160 -160
- package/dist/commonjs.tsbuildinfo +1 -1
- package/dist/esm/client/index.d.ts +19 -19
- package/dist/esm/component/messages.d.ts +37 -37
- package/dist/esm/component/schema.d.ts +563 -563
- package/dist/esm/component/threads.d.ts +15 -15
- package/dist/esm/component/vector/index.d.ts +3 -3
- package/dist/esm/component/vector/tables.d.ts +5 -3
- package/dist/esm/component/vector/tables.d.ts.map +1 -1
- package/dist/esm/react/index.d.ts +1 -1
- package/dist/esm/react/index.d.ts.map +1 -1
- package/dist/esm/react/index.js +7 -5
- package/dist/esm/react/index.js.map +1 -1
- package/dist/esm/validators.d.ts +160 -160
- package/dist/esm.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/react/index.ts +7 -6
|
@@ -398,9 +398,14 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
398
398
|
messageId: string;
|
|
399
399
|
message: {
|
|
400
400
|
id?: string | undefined;
|
|
401
|
-
|
|
401
|
+
userId?: string | undefined;
|
|
402
|
+
embeddingId?: string | undefined;
|
|
403
|
+
fileIds?: string[] | undefined;
|
|
404
|
+
error?: string | undefined;
|
|
405
|
+
agentName?: string | undefined;
|
|
406
|
+
model?: string | undefined;
|
|
407
|
+
provider?: string | undefined;
|
|
402
408
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
403
|
-
reasoning?: string | undefined;
|
|
404
409
|
message?: {
|
|
405
410
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
406
411
|
role: "user";
|
|
@@ -474,15 +479,17 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
474
479
|
role: "system";
|
|
475
480
|
content: string;
|
|
476
481
|
} | undefined;
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
+
text?: string | undefined;
|
|
483
|
+
reasoning?: string | undefined;
|
|
484
|
+
usage?: {
|
|
485
|
+
promptTokens: number;
|
|
486
|
+
completionTokens: number;
|
|
487
|
+
totalTokens: number;
|
|
488
|
+
} | undefined;
|
|
482
489
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
483
490
|
sources?: {
|
|
484
|
-
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
485
491
|
title?: string | undefined;
|
|
492
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
486
493
|
id: string;
|
|
487
494
|
sourceType: "url";
|
|
488
495
|
url: string;
|
|
@@ -495,11 +502,6 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
495
502
|
type: "redacted";
|
|
496
503
|
data: string;
|
|
497
504
|
})[] | undefined;
|
|
498
|
-
usage?: {
|
|
499
|
-
promptTokens: number;
|
|
500
|
-
completionTokens: number;
|
|
501
|
-
totalTokens: number;
|
|
502
|
-
} | undefined;
|
|
503
505
|
warnings?: ({
|
|
504
506
|
details?: string | undefined;
|
|
505
507
|
type: "unsupported-setting";
|
|
@@ -512,16 +514,14 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
512
514
|
type: "other";
|
|
513
515
|
message: string;
|
|
514
516
|
})[] | undefined;
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
tool: boolean;
|
|
519
|
-
threadId: string;
|
|
517
|
+
finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
|
|
518
|
+
_id: string;
|
|
519
|
+
_creationTime: number;
|
|
520
520
|
status: "pending" | "success" | "failed";
|
|
521
521
|
order: number;
|
|
522
|
+
threadId: string;
|
|
522
523
|
stepOrder: number;
|
|
523
|
-
|
|
524
|
-
_id: string;
|
|
524
|
+
tool: boolean;
|
|
525
525
|
};
|
|
526
526
|
}>;
|
|
527
527
|
/**
|
|
@@ -794,8 +794,8 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
794
794
|
* @returns A mutation that creates a thread.
|
|
795
795
|
*/
|
|
796
796
|
createThreadMutation(): import("convex/server").RegisteredMutation<"internal", {
|
|
797
|
-
title?: string | undefined;
|
|
798
797
|
userId?: string | undefined;
|
|
798
|
+
title?: string | undefined;
|
|
799
799
|
summary?: string | undefined;
|
|
800
800
|
}, Promise<{
|
|
801
801
|
threadId: string;
|
|
@@ -832,9 +832,10 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
832
832
|
*/
|
|
833
833
|
stream?: boolean | StreamingOptions;
|
|
834
834
|
}): import("convex/server").RegisteredAction<"internal", {
|
|
835
|
-
|
|
835
|
+
userId?: string | undefined;
|
|
836
|
+
threadId?: string | undefined;
|
|
836
837
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
837
|
-
|
|
838
|
+
system?: string | undefined;
|
|
838
839
|
messages?: ({
|
|
839
840
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
840
841
|
role: "user";
|
|
@@ -908,6 +909,15 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
908
909
|
role: "system";
|
|
909
910
|
content: string;
|
|
910
911
|
})[] | undefined;
|
|
912
|
+
headers?: Record<string, string> | undefined;
|
|
913
|
+
maxTokens?: number | undefined;
|
|
914
|
+
temperature?: number | undefined;
|
|
915
|
+
topP?: number | undefined;
|
|
916
|
+
topK?: number | undefined;
|
|
917
|
+
presencePenalty?: number | undefined;
|
|
918
|
+
frequencyPenalty?: number | undefined;
|
|
919
|
+
seed?: number | undefined;
|
|
920
|
+
maxRetries?: number | undefined;
|
|
911
921
|
stream?: boolean | undefined;
|
|
912
922
|
toolChoice?: "required" | "none" | "auto" | {
|
|
913
923
|
type: "tool";
|
|
@@ -917,16 +927,6 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
917
927
|
experimental_continueSteps?: boolean | undefined;
|
|
918
928
|
prompt?: string | undefined;
|
|
919
929
|
promptMessageId?: string | undefined;
|
|
920
|
-
maxTokens?: number | undefined;
|
|
921
|
-
temperature?: number | undefined;
|
|
922
|
-
topP?: number | undefined;
|
|
923
|
-
topK?: number | undefined;
|
|
924
|
-
presencePenalty?: number | undefined;
|
|
925
|
-
frequencyPenalty?: number | undefined;
|
|
926
|
-
seed?: number | undefined;
|
|
927
|
-
maxRetries?: number | undefined;
|
|
928
|
-
userId?: string | undefined;
|
|
929
|
-
threadId?: string | undefined;
|
|
930
930
|
contextOptions?: {
|
|
931
931
|
excludeToolMessages?: boolean | undefined;
|
|
932
932
|
recentMessages?: number | undefined;
|
|
@@ -965,9 +965,10 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
965
965
|
contextOptions?: ContextOptions;
|
|
966
966
|
storageOptions?: StorageOptions;
|
|
967
967
|
}): import("convex/server").RegisteredAction<"internal", {
|
|
968
|
-
|
|
968
|
+
userId?: string | undefined;
|
|
969
|
+
threadId?: string | undefined;
|
|
969
970
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
970
|
-
|
|
971
|
+
system?: string | undefined;
|
|
971
972
|
messages?: ({
|
|
972
973
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
973
974
|
role: "user";
|
|
@@ -1041,8 +1042,7 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
1041
1042
|
role: "system";
|
|
1042
1043
|
content: string;
|
|
1043
1044
|
})[] | undefined;
|
|
1044
|
-
|
|
1045
|
-
promptMessageId?: string | undefined;
|
|
1045
|
+
headers?: Record<string, string> | undefined;
|
|
1046
1046
|
maxTokens?: number | undefined;
|
|
1047
1047
|
temperature?: number | undefined;
|
|
1048
1048
|
topP?: number | undefined;
|
|
@@ -1051,8 +1051,8 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
1051
1051
|
frequencyPenalty?: number | undefined;
|
|
1052
1052
|
seed?: number | undefined;
|
|
1053
1053
|
maxRetries?: number | undefined;
|
|
1054
|
-
|
|
1055
|
-
|
|
1054
|
+
prompt?: string | undefined;
|
|
1055
|
+
promptMessageId?: string | undefined;
|
|
1056
1056
|
contextOptions?: {
|
|
1057
1057
|
excludeToolMessages?: boolean | undefined;
|
|
1058
1058
|
recentMessages?: number | undefined;
|
|
@@ -1097,23 +1097,28 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
1097
1097
|
* @returns A mutation that can be used to save messages to the thread.
|
|
1098
1098
|
*/
|
|
1099
1099
|
asSaveMessagesMutation(): import("convex/server").RegisteredMutation<"internal", {
|
|
1100
|
+
userId?: string | undefined;
|
|
1100
1101
|
pending?: boolean | undefined;
|
|
1101
1102
|
promptMessageId?: string | undefined;
|
|
1102
|
-
userId?: string | undefined;
|
|
1103
1103
|
failPendingSteps?: boolean | undefined;
|
|
1104
|
+
threadId: string;
|
|
1104
1105
|
messages: {
|
|
1105
1106
|
id?: string | undefined;
|
|
1106
|
-
text?: string | undefined;
|
|
1107
|
-
reasoning?: string | undefined;
|
|
1108
|
-
error?: string | undefined;
|
|
1109
1107
|
fileIds?: string[] | undefined;
|
|
1110
|
-
|
|
1108
|
+
error?: string | undefined;
|
|
1111
1109
|
model?: string | undefined;
|
|
1112
1110
|
provider?: string | undefined;
|
|
1111
|
+
text?: string | undefined;
|
|
1112
|
+
reasoning?: string | undefined;
|
|
1113
|
+
usage?: {
|
|
1114
|
+
promptTokens: number;
|
|
1115
|
+
completionTokens: number;
|
|
1116
|
+
totalTokens: number;
|
|
1117
|
+
} | undefined;
|
|
1113
1118
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1114
1119
|
sources?: {
|
|
1115
|
-
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1116
1120
|
title?: string | undefined;
|
|
1121
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1117
1122
|
id: string;
|
|
1118
1123
|
sourceType: "url";
|
|
1119
1124
|
url: string;
|
|
@@ -1126,11 +1131,6 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
1126
1131
|
type: "redacted";
|
|
1127
1132
|
data: string;
|
|
1128
1133
|
})[] | undefined;
|
|
1129
|
-
usage?: {
|
|
1130
|
-
promptTokens: number;
|
|
1131
|
-
completionTokens: number;
|
|
1132
|
-
totalTokens: number;
|
|
1133
|
-
} | undefined;
|
|
1134
1134
|
warnings?: ({
|
|
1135
1135
|
details?: string | undefined;
|
|
1136
1136
|
type: "unsupported-setting";
|
|
@@ -1143,6 +1143,7 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
1143
1143
|
type: "other";
|
|
1144
1144
|
message: string;
|
|
1145
1145
|
})[] | undefined;
|
|
1146
|
+
finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
|
|
1146
1147
|
message: {
|
|
1147
1148
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1148
1149
|
role: "user";
|
|
@@ -1217,7 +1218,6 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
1217
1218
|
content: string;
|
|
1218
1219
|
};
|
|
1219
1220
|
}[];
|
|
1220
|
-
threadId: string;
|
|
1221
1221
|
}, Promise<{
|
|
1222
1222
|
lastMessageId: string;
|
|
1223
1223
|
messageIds: string[];
|
|
@@ -1225,9 +1225,14 @@ export declare class Agent<AgentTools extends ToolSet> {
|
|
|
1225
1225
|
}
|
|
1226
1226
|
export declare function filterOutOrphanedToolMessages(docs: MessageDoc[]): {
|
|
1227
1227
|
id?: string | undefined;
|
|
1228
|
-
|
|
1228
|
+
userId?: string | undefined;
|
|
1229
|
+
embeddingId?: string | undefined;
|
|
1230
|
+
fileIds?: string[] | undefined;
|
|
1231
|
+
error?: string | undefined;
|
|
1232
|
+
agentName?: string | undefined;
|
|
1233
|
+
model?: string | undefined;
|
|
1234
|
+
provider?: string | undefined;
|
|
1229
1235
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1230
|
-
reasoning?: string | undefined;
|
|
1231
1236
|
message?: {
|
|
1232
1237
|
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1233
1238
|
role: "user";
|
|
@@ -1301,15 +1306,17 @@ export declare function filterOutOrphanedToolMessages(docs: MessageDoc[]): {
|
|
|
1301
1306
|
role: "system";
|
|
1302
1307
|
content: string;
|
|
1303
1308
|
} | undefined;
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
+
text?: string | undefined;
|
|
1310
|
+
reasoning?: string | undefined;
|
|
1311
|
+
usage?: {
|
|
1312
|
+
promptTokens: number;
|
|
1313
|
+
completionTokens: number;
|
|
1314
|
+
totalTokens: number;
|
|
1315
|
+
} | undefined;
|
|
1309
1316
|
providerMetadata?: Record<string, Record<string, any>> | undefined;
|
|
1310
1317
|
sources?: {
|
|
1311
|
-
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1312
1318
|
title?: string | undefined;
|
|
1319
|
+
providerOptions?: Record<string, Record<string, any>> | undefined;
|
|
1313
1320
|
id: string;
|
|
1314
1321
|
sourceType: "url";
|
|
1315
1322
|
url: string;
|
|
@@ -1322,11 +1329,6 @@ export declare function filterOutOrphanedToolMessages(docs: MessageDoc[]): {
|
|
|
1322
1329
|
type: "redacted";
|
|
1323
1330
|
data: string;
|
|
1324
1331
|
})[] | undefined;
|
|
1325
|
-
usage?: {
|
|
1326
|
-
promptTokens: number;
|
|
1327
|
-
completionTokens: number;
|
|
1328
|
-
totalTokens: number;
|
|
1329
|
-
} | undefined;
|
|
1330
1332
|
warnings?: ({
|
|
1331
1333
|
details?: string | undefined;
|
|
1332
1334
|
type: "unsupported-setting";
|
|
@@ -1339,16 +1341,14 @@ export declare function filterOutOrphanedToolMessages(docs: MessageDoc[]): {
|
|
|
1339
1341
|
type: "other";
|
|
1340
1342
|
message: string;
|
|
1341
1343
|
})[] | undefined;
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
tool: boolean;
|
|
1346
|
-
threadId: string;
|
|
1344
|
+
finishReason?: "length" | "error" | "other" | "stop" | "content-filter" | "tool-calls" | "unknown" | undefined;
|
|
1345
|
+
_id: string;
|
|
1346
|
+
_creationTime: number;
|
|
1347
1347
|
status: "pending" | "success" | "failed";
|
|
1348
1348
|
order: number;
|
|
1349
|
+
threadId: string;
|
|
1349
1350
|
stepOrder: number;
|
|
1350
|
-
|
|
1351
|
-
_id: string;
|
|
1351
|
+
tool: boolean;
|
|
1352
1352
|
}[];
|
|
1353
1353
|
type CoreMessageMaybeWithId = CoreMessage & {
|
|
1354
1354
|
id?: string | undefined;
|