@convex-dev/agent 0.1.10-alpha.1 → 0.1.10
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/README.md +1 -1
- package/dist/commonjs/client/createTool.js +8 -5
- package/dist/commonjs/client/createTool.js.map +1 -1
- package/dist/commonjs/client/files.js +8 -3
- package/dist/commonjs/client/files.js.map +1 -1
- package/dist/commonjs/client/index.d.ts +10 -11
- package/dist/commonjs/client/index.d.ts.map +1 -1
- package/dist/commonjs/client/index.js +80 -59
- package/dist/commonjs/client/index.js.map +1 -1
- package/dist/commonjs/client/streaming.d.ts.map +1 -1
- package/dist/commonjs/client/streaming.js +14 -15
- package/dist/commonjs/client/streaming.js.map +1 -1
- package/dist/commonjs/client/types.js +2 -1
- package/dist/commonjs/component/_generated/api.d.ts +2 -13
- package/dist/commonjs/component/_generated/api.js +7 -4
- package/dist/commonjs/component/_generated/api.js.map +1 -1
- package/dist/commonjs/component/_generated/server.js +11 -8
- package/dist/commonjs/component/_generated/server.js.map +1 -1
- package/dist/commonjs/component/apiKeys.js +16 -13
- package/dist/commonjs/component/apiKeys.js.map +1 -1
- package/dist/commonjs/component/convex.config.js +4 -2
- package/dist/commonjs/component/convex.config.js.map +1 -1
- package/dist/commonjs/component/files.d.ts +1 -1
- package/dist/commonjs/component/files.d.ts.map +1 -1
- package/dist/commonjs/component/files.js +47 -40
- package/dist/commonjs/component/files.js.map +1 -1
- package/dist/commonjs/component/messages.d.ts +31 -31
- package/dist/commonjs/component/messages.d.ts.map +1 -1
- package/dist/commonjs/component/messages.js +112 -107
- package/dist/commonjs/component/messages.js.map +1 -1
- package/dist/commonjs/component/schema.d.ts +74 -84
- package/dist/commonjs/component/schema.d.ts.map +1 -1
- package/dist/commonjs/component/schema.js +101 -99
- package/dist/commonjs/component/schema.js.map +1 -1
- package/dist/commonjs/component/streams.d.ts +0 -7
- package/dist/commonjs/component/streams.d.ts.map +1 -1
- package/dist/commonjs/component/streams.js +95 -118
- package/dist/commonjs/component/streams.js.map +1 -1
- package/dist/commonjs/component/threads.d.ts +8 -8
- package/dist/commonjs/component/threads.js +54 -51
- package/dist/commonjs/component/threads.js.map +1 -1
- package/dist/commonjs/component/users.js +49 -46
- package/dist/commonjs/component/users.js.map +1 -1
- package/dist/commonjs/component/vector/index.js +53 -48
- package/dist/commonjs/component/vector/index.js.map +1 -1
- package/dist/commonjs/component/vector/tables.d.ts +3 -5
- package/dist/commonjs/component/vector/tables.d.ts.map +1 -1
- package/dist/commonjs/component/vector/tables.js +32 -26
- package/dist/commonjs/component/vector/tables.js.map +1 -1
- package/dist/commonjs/mapping.d.ts +3 -3
- package/dist/commonjs/mapping.d.ts.map +1 -1
- package/dist/commonjs/mapping.js +39 -24
- package/dist/commonjs/mapping.js.map +1 -1
- package/dist/commonjs/react/deltas.d.ts.map +1 -1
- package/dist/commonjs/react/deltas.js +13 -7
- package/dist/commonjs/react/deltas.js.map +1 -1
- package/dist/commonjs/react/index.d.ts +2 -4
- package/dist/commonjs/react/index.d.ts.map +1 -1
- package/dist/commonjs/react/index.js +37 -42
- package/dist/commonjs/react/index.js.map +1 -1
- package/dist/commonjs/react/optimisticallySendMessage.js +7 -4
- package/dist/commonjs/react/optimisticallySendMessage.js.map +1 -1
- package/dist/commonjs/react/toUIMessages.js +8 -5
- package/dist/commonjs/react/toUIMessages.js.map +1 -1
- package/dist/commonjs/react/types.js +2 -1
- package/dist/commonjs/react/useSmoothText.js +8 -5
- package/dist/commonjs/react/useSmoothText.js.map +1 -1
- package/dist/commonjs/shared.js +9 -4
- package/dist/commonjs/shared.js.map +1 -1
- package/dist/commonjs/validators.d.ts +10 -15
- package/dist/commonjs/validators.d.ts.map +1 -1
- package/dist/commonjs/validators.js +249 -247
- package/dist/commonjs/validators.js.map +1 -1
- package/dist/commonjs/vitest.config.js +4 -2
- package/dist/commonjs/vitest.config.js.map +1 -1
- package/dist/commonjs.tsbuildinfo +1 -1
- package/dist/esm/client/index.d.ts +10 -11
- package/dist/esm/client/index.d.ts.map +1 -1
- package/dist/esm/client/index.js +2 -4
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/client/streaming.d.ts.map +1 -1
- package/dist/esm/client/streaming.js +1 -7
- package/dist/esm/client/streaming.js.map +1 -1
- package/dist/esm/component/_generated/api.d.ts +2 -13
- package/dist/esm/component/files.d.ts +1 -1
- package/dist/esm/component/files.d.ts.map +1 -1
- package/dist/esm/component/files.js +6 -4
- package/dist/esm/component/files.js.map +1 -1
- package/dist/esm/component/messages.d.ts +30 -30
- package/dist/esm/component/schema.d.ts +74 -84
- package/dist/esm/component/schema.d.ts.map +1 -1
- package/dist/esm/component/schema.js +2 -3
- package/dist/esm/component/schema.js.map +1 -1
- package/dist/esm/component/streams.d.ts +0 -7
- package/dist/esm/component/streams.d.ts.map +1 -1
- package/dist/esm/component/streams.js +22 -49
- package/dist/esm/component/streams.js.map +1 -1
- package/dist/esm/component/threads.d.ts +8 -8
- package/dist/esm/component/vector/tables.d.ts +3 -5
- package/dist/esm/component/vector/tables.d.ts.map +1 -1
- package/dist/esm/mapping.d.ts +3 -3
- package/dist/esm/mapping.d.ts.map +1 -1
- package/dist/esm/mapping.js +5 -3
- package/dist/esm/mapping.js.map +1 -1
- package/dist/esm/react/deltas.d.ts.map +1 -1
- package/dist/esm/react/deltas.js +2 -2
- package/dist/esm/react/deltas.js.map +1 -1
- package/dist/esm/react/index.d.ts +2 -4
- package/dist/esm/react/index.d.ts.map +1 -1
- package/dist/esm/react/index.js +9 -22
- package/dist/esm/react/index.js.map +1 -1
- package/dist/esm/react/optimisticallySendMessage.js +1 -1
- package/dist/esm/react/optimisticallySendMessage.js.map +1 -1
- package/dist/esm/validators.d.ts +10 -15
- package/dist/esm/validators.d.ts.map +1 -1
- package/dist/esm/validators.js +0 -2
- package/dist/esm/validators.js.map +1 -1
- package/dist/esm.tsbuildinfo +1 -1
- package/package.json +9 -4
- package/react/package.json +5 -0
- package/src/client/index.ts +15 -12
- package/src/client/streaming.ts +1 -7
- package/src/component/_generated/api.d.ts +2 -13
- package/src/component/files.ts +6 -4
- package/src/component/schema.ts +2 -3
- package/src/component/streams.ts +39 -85
- package/src/component/vector/tables.ts +1 -1
- package/src/mapping.ts +8 -4
- package/src/react/deltas.ts +2 -4
- package/src/react/index.ts +11 -23
- package/src/react/optimisticallySendMessage.ts +1 -1
- package/src/validators.ts +0 -6
- package/validators/package.json +5 -0
|
@@ -1,317 +1,319 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.vStreamDelta = exports.vStreamMessage = exports.vStreamArgs = exports.vStreamCursor = exports.vTextStreamPart = exports.vEmbeddingsWithMetadata = exports.vSafeObjectArgs = exports.vTextArgs = exports.vCallSettingsFields = exports.vStorageOptions = exports.vContextOptions = exports.vContextOptionsSearchOptions = exports.vSearchOptions = exports.vObjectResult = exports.vMessageEmbeddings = exports.vMessageWithMetadata = exports.vMessageWithMetadataInternal = exports.vLanguageModelV1CallWarning = exports.vUsage = exports.vFinishReason = exports.vResponseWithoutMessages = exports.vResponse = exports.vRequest = exports.vSource = exports.vMessage = exports.vSystemMessage = exports.vToolMessage = exports.vAssistantMessage = exports.vUserMessage = exports.vContent = exports.vToolContent = exports.vAssistantContent = exports.vToolCallPart = exports.vReasoningDetails = exports.vRedactedReasoningPart = exports.vReasoningPart = exports.vUserContent = exports.vFilePart = exports.vImagePart = exports.vTextPart = exports.vRole = exports.vMessageStatus = exports.vThreadStatus = exports.vProviderMetadata = exports.vProviderOptions = void 0;
|
|
4
|
+
exports.vPaginationResult = vPaginationResult;
|
|
5
|
+
const values_1 = require("convex/values");
|
|
6
|
+
const tables_js_1 = require("./component/vector/tables.js");
|
|
3
7
|
// const deprecated = v.optional(v.any()) as unknown as VNull<unknown, "optional">;
|
|
4
|
-
|
|
5
|
-
const providerOptions = v.optional(vProviderOptions);
|
|
6
|
-
|
|
8
|
+
exports.vProviderOptions = values_1.v.record(values_1.v.string(), values_1.v.record(values_1.v.string(), values_1.v.any()));
|
|
9
|
+
const providerOptions = values_1.v.optional(exports.vProviderOptions);
|
|
10
|
+
exports.vProviderMetadata = exports.vProviderOptions;
|
|
7
11
|
const providerMetadata = providerOptions;
|
|
8
|
-
|
|
12
|
+
exports.vThreadStatus = values_1.v.union(values_1.v.literal("active"), values_1.v.literal("archived") // unused
|
|
9
13
|
);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: v.literal("text"),
|
|
14
|
-
text: v.string(),
|
|
14
|
+
exports.vMessageStatus = values_1.v.union(values_1.v.literal("pending"), values_1.v.literal("success"), values_1.v.literal("failed"));
|
|
15
|
+
exports.vRole = values_1.v.union(values_1.v.literal("system"), values_1.v.literal("user"), values_1.v.literal("assistant"), values_1.v.literal("tool"));
|
|
16
|
+
exports.vTextPart = values_1.v.object({
|
|
17
|
+
type: values_1.v.literal("text"),
|
|
18
|
+
text: values_1.v.string(),
|
|
15
19
|
providerOptions,
|
|
16
20
|
});
|
|
17
|
-
|
|
18
|
-
type: v.literal("image"),
|
|
19
|
-
image: v.union(v.string(), v.bytes()),
|
|
20
|
-
mimeType: v.optional(v.string()),
|
|
21
|
+
exports.vImagePart = values_1.v.object({
|
|
22
|
+
type: values_1.v.literal("image"),
|
|
23
|
+
image: values_1.v.union(values_1.v.string(), values_1.v.bytes()),
|
|
24
|
+
mimeType: values_1.v.optional(values_1.v.string()),
|
|
21
25
|
providerOptions,
|
|
22
26
|
});
|
|
23
|
-
|
|
24
|
-
type: v.literal("file"),
|
|
25
|
-
data: v.union(v.string(), v.bytes()),
|
|
26
|
-
filename: v.optional(v.string()),
|
|
27
|
-
mimeType: v.string(),
|
|
27
|
+
exports.vFilePart = values_1.v.object({
|
|
28
|
+
type: values_1.v.literal("file"),
|
|
29
|
+
data: values_1.v.union(values_1.v.string(), values_1.v.bytes()),
|
|
30
|
+
filename: values_1.v.optional(values_1.v.string()),
|
|
31
|
+
mimeType: values_1.v.string(),
|
|
28
32
|
providerOptions,
|
|
29
33
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
type: v.literal("reasoning"),
|
|
33
|
-
text: v.string(),
|
|
34
|
-
signature: v.optional(v.string()),
|
|
34
|
+
exports.vUserContent = values_1.v.union(values_1.v.string(), values_1.v.array(values_1.v.union(exports.vTextPart, exports.vImagePart, exports.vFilePart)));
|
|
35
|
+
exports.vReasoningPart = values_1.v.object({
|
|
36
|
+
type: values_1.v.literal("reasoning"),
|
|
37
|
+
text: values_1.v.string(),
|
|
38
|
+
signature: values_1.v.optional(values_1.v.string()),
|
|
35
39
|
providerOptions,
|
|
36
40
|
});
|
|
37
|
-
|
|
38
|
-
type: v.literal("redacted-reasoning"),
|
|
39
|
-
data: v.string(),
|
|
41
|
+
exports.vRedactedReasoningPart = values_1.v.object({
|
|
42
|
+
type: values_1.v.literal("redacted-reasoning"),
|
|
43
|
+
data: values_1.v.string(),
|
|
40
44
|
providerOptions,
|
|
41
45
|
});
|
|
42
|
-
|
|
43
|
-
type: v.literal("text"),
|
|
44
|
-
text: v.string(),
|
|
45
|
-
signature: v.optional(v.string()),
|
|
46
|
-
}), v.object({
|
|
47
|
-
type: v.literal("redacted"),
|
|
48
|
-
data: v.string(),
|
|
46
|
+
exports.vReasoningDetails = values_1.v.array(values_1.v.union(values_1.v.object({
|
|
47
|
+
type: values_1.v.literal("text"),
|
|
48
|
+
text: values_1.v.string(),
|
|
49
|
+
signature: values_1.v.optional(values_1.v.string()),
|
|
50
|
+
}), values_1.v.object({
|
|
51
|
+
type: values_1.v.literal("redacted"),
|
|
52
|
+
data: values_1.v.string(),
|
|
49
53
|
})));
|
|
50
|
-
|
|
51
|
-
type: v.literal("tool-call"),
|
|
52
|
-
toolCallId: v.string(),
|
|
53
|
-
toolName: v.string(),
|
|
54
|
-
args: v.any(),
|
|
54
|
+
exports.vToolCallPart = values_1.v.object({
|
|
55
|
+
type: values_1.v.literal("tool-call"),
|
|
56
|
+
toolCallId: values_1.v.string(),
|
|
57
|
+
toolName: values_1.v.string(),
|
|
58
|
+
args: values_1.v.any(),
|
|
55
59
|
providerOptions,
|
|
56
60
|
});
|
|
57
|
-
|
|
58
|
-
const vToolResultContent = v.array(v.union(v.object({
|
|
59
|
-
type: v.literal("text"),
|
|
60
|
-
text: v.string(),
|
|
61
|
-
}), v.object({
|
|
62
|
-
type: v.literal("image"),
|
|
63
|
-
data: v.string(),
|
|
64
|
-
mimeType: v.optional(v.string()),
|
|
61
|
+
exports.vAssistantContent = values_1.v.union(values_1.v.string(), values_1.v.array(values_1.v.union(exports.vTextPart, exports.vFilePart, exports.vReasoningPart, exports.vRedactedReasoningPart, exports.vToolCallPart)));
|
|
62
|
+
const vToolResultContent = values_1.v.array(values_1.v.union(values_1.v.object({
|
|
63
|
+
type: values_1.v.literal("text"),
|
|
64
|
+
text: values_1.v.string(),
|
|
65
|
+
}), values_1.v.object({
|
|
66
|
+
type: values_1.v.literal("image"),
|
|
67
|
+
data: values_1.v.string(),
|
|
68
|
+
mimeType: values_1.v.optional(values_1.v.string()),
|
|
65
69
|
})));
|
|
66
|
-
const vToolResultPart = v.object({
|
|
67
|
-
type: v.literal("tool-result"),
|
|
68
|
-
toolCallId: v.string(),
|
|
69
|
-
toolName: v.string(),
|
|
70
|
-
result: v.any(),
|
|
70
|
+
const vToolResultPart = values_1.v.object({
|
|
71
|
+
type: values_1.v.literal("tool-result"),
|
|
72
|
+
toolCallId: values_1.v.string(),
|
|
73
|
+
toolName: values_1.v.string(),
|
|
74
|
+
result: values_1.v.any(),
|
|
71
75
|
// This is only here b/c steps include it in toolResults
|
|
72
76
|
// Normal CoreMessage doesn't have this
|
|
73
|
-
args: v.optional(v.any()),
|
|
74
|
-
experimental_content: v.optional(vToolResultContent),
|
|
75
|
-
isError: v.optional(v.boolean()),
|
|
77
|
+
args: values_1.v.optional(values_1.v.any()),
|
|
78
|
+
experimental_content: values_1.v.optional(vToolResultContent),
|
|
79
|
+
isError: values_1.v.optional(values_1.v.boolean()),
|
|
76
80
|
providerOptions,
|
|
77
81
|
});
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
role: v.literal("user"),
|
|
82
|
-
content: vUserContent,
|
|
82
|
+
exports.vToolContent = values_1.v.array(vToolResultPart);
|
|
83
|
+
exports.vContent = values_1.v.union(exports.vUserContent, exports.vAssistantContent, exports.vToolContent);
|
|
84
|
+
exports.vUserMessage = values_1.v.object({
|
|
85
|
+
role: values_1.v.literal("user"),
|
|
86
|
+
content: exports.vUserContent,
|
|
83
87
|
providerOptions,
|
|
84
88
|
});
|
|
85
|
-
|
|
86
|
-
role: v.literal("assistant"),
|
|
87
|
-
content: vAssistantContent,
|
|
89
|
+
exports.vAssistantMessage = values_1.v.object({
|
|
90
|
+
role: values_1.v.literal("assistant"),
|
|
91
|
+
content: exports.vAssistantContent,
|
|
88
92
|
providerOptions,
|
|
89
93
|
});
|
|
90
|
-
|
|
91
|
-
role: v.literal("tool"),
|
|
92
|
-
content: vToolContent,
|
|
94
|
+
exports.vToolMessage = values_1.v.object({
|
|
95
|
+
role: values_1.v.literal("tool"),
|
|
96
|
+
content: exports.vToolContent,
|
|
93
97
|
providerOptions,
|
|
94
98
|
});
|
|
95
|
-
|
|
96
|
-
role: v.literal("system"),
|
|
97
|
-
content: v.string(),
|
|
99
|
+
exports.vSystemMessage = values_1.v.object({
|
|
100
|
+
role: values_1.v.literal("system"),
|
|
101
|
+
content: values_1.v.string(),
|
|
98
102
|
providerOptions,
|
|
99
103
|
});
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
sourceType: v.literal("url"),
|
|
103
|
-
id: v.string(),
|
|
104
|
-
url: v.string(),
|
|
105
|
-
title: v.optional(v.string()),
|
|
104
|
+
exports.vMessage = values_1.v.union(exports.vUserMessage, exports.vAssistantMessage, exports.vToolMessage, exports.vSystemMessage);
|
|
105
|
+
exports.vSource = values_1.v.object({
|
|
106
|
+
sourceType: values_1.v.literal("url"),
|
|
107
|
+
id: values_1.v.string(),
|
|
108
|
+
url: values_1.v.string(),
|
|
109
|
+
title: values_1.v.optional(values_1.v.string()),
|
|
106
110
|
providerOptions,
|
|
107
111
|
});
|
|
108
|
-
|
|
109
|
-
body: v.optional(v.any()),
|
|
112
|
+
exports.vRequest = values_1.v.object({
|
|
113
|
+
body: values_1.v.optional(values_1.v.any()),
|
|
110
114
|
// These are not usually present
|
|
111
|
-
headers: v.optional(v.record(v.string(), v.string())),
|
|
112
|
-
method: v.optional(v.string()),
|
|
113
|
-
url: v.optional(v.string()),
|
|
115
|
+
headers: values_1.v.optional(values_1.v.record(values_1.v.string(), values_1.v.string())),
|
|
116
|
+
method: values_1.v.optional(values_1.v.string()),
|
|
117
|
+
url: values_1.v.optional(values_1.v.string()),
|
|
114
118
|
});
|
|
115
|
-
const vMessageWithFileAndId = v.object({
|
|
116
|
-
id: v.optional(v.string()),
|
|
117
|
-
message: vMessage,
|
|
118
|
-
fileId: v.optional(v.id("files")),
|
|
119
|
+
const vMessageWithFileAndId = values_1.v.object({
|
|
120
|
+
id: values_1.v.optional(values_1.v.string()),
|
|
121
|
+
message: exports.vMessage,
|
|
122
|
+
fileId: values_1.v.optional(values_1.v.id("files")),
|
|
119
123
|
});
|
|
120
|
-
|
|
121
|
-
id: v.string(),
|
|
122
|
-
timestamp: v.number(),
|
|
123
|
-
modelId: v.string(),
|
|
124
|
-
headers: v.optional(v.record(v.string(), v.string())), // clear these?
|
|
125
|
-
messages: v.array(vMessageWithFileAndId),
|
|
126
|
-
body: v.optional(v.any()),
|
|
124
|
+
exports.vResponse = values_1.v.object({
|
|
125
|
+
id: values_1.v.string(),
|
|
126
|
+
timestamp: values_1.v.number(),
|
|
127
|
+
modelId: values_1.v.string(),
|
|
128
|
+
headers: values_1.v.optional(values_1.v.record(values_1.v.string(), values_1.v.string())), // clear these?
|
|
129
|
+
messages: values_1.v.array(vMessageWithFileAndId),
|
|
130
|
+
body: values_1.v.optional(values_1.v.any()),
|
|
127
131
|
});
|
|
128
|
-
|
|
129
|
-
id: v.string(),
|
|
130
|
-
timestamp: v.number(),
|
|
131
|
-
modelId: v.string(),
|
|
132
|
-
headers: v.optional(v.record(v.string(), v.string())), // clear these?
|
|
133
|
-
body: v.optional(v.any()),
|
|
132
|
+
exports.vResponseWithoutMessages = values_1.v.object({
|
|
133
|
+
id: values_1.v.string(),
|
|
134
|
+
timestamp: values_1.v.number(),
|
|
135
|
+
modelId: values_1.v.string(),
|
|
136
|
+
headers: values_1.v.optional(values_1.v.record(values_1.v.string(), values_1.v.string())), // clear these?
|
|
137
|
+
body: values_1.v.optional(values_1.v.any()),
|
|
134
138
|
});
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
promptTokens: v.number(),
|
|
138
|
-
completionTokens: v.number(),
|
|
139
|
-
totalTokens: v.number(),
|
|
139
|
+
exports.vFinishReason = values_1.v.union(values_1.v.literal("stop"), values_1.v.literal("length"), values_1.v.literal("content-filter"), values_1.v.literal("tool-calls"), values_1.v.literal("error"), values_1.v.literal("other"), values_1.v.literal("unknown"));
|
|
140
|
+
exports.vUsage = values_1.v.object({
|
|
141
|
+
promptTokens: values_1.v.number(),
|
|
142
|
+
completionTokens: values_1.v.number(),
|
|
143
|
+
totalTokens: values_1.v.number(),
|
|
140
144
|
});
|
|
141
|
-
|
|
142
|
-
type: v.literal("unsupported-setting"),
|
|
143
|
-
setting: v.string(),
|
|
144
|
-
details: v.optional(v.string()),
|
|
145
|
-
}), v.object({
|
|
146
|
-
type: v.literal("unsupported-tool"),
|
|
147
|
-
tool: v.any(),
|
|
148
|
-
details: v.optional(v.string()),
|
|
149
|
-
}), v.object({
|
|
150
|
-
type: v.literal("other"),
|
|
151
|
-
message: v.string(),
|
|
145
|
+
exports.vLanguageModelV1CallWarning = values_1.v.union(values_1.v.object({
|
|
146
|
+
type: values_1.v.literal("unsupported-setting"),
|
|
147
|
+
setting: values_1.v.string(),
|
|
148
|
+
details: values_1.v.optional(values_1.v.string()),
|
|
149
|
+
}), values_1.v.object({
|
|
150
|
+
type: values_1.v.literal("unsupported-tool"),
|
|
151
|
+
tool: values_1.v.any(),
|
|
152
|
+
details: values_1.v.optional(values_1.v.string()),
|
|
153
|
+
}), values_1.v.object({
|
|
154
|
+
type: values_1.v.literal("other"),
|
|
155
|
+
message: values_1.v.string(),
|
|
152
156
|
}));
|
|
153
|
-
|
|
154
|
-
id: v.optional(v.string()), // external id, e.g. from Vercel AI SDK
|
|
155
|
-
message: vMessage,
|
|
156
|
-
text: v.optional(v.string()),
|
|
157
|
-
fileIds: v.optional(v.array(v.id("files"))),
|
|
157
|
+
exports.vMessageWithMetadataInternal = values_1.v.object({
|
|
158
|
+
id: values_1.v.optional(values_1.v.string()), // external id, e.g. from Vercel AI SDK
|
|
159
|
+
message: exports.vMessage,
|
|
160
|
+
text: values_1.v.optional(values_1.v.string()),
|
|
161
|
+
fileIds: values_1.v.optional(values_1.v.array(values_1.v.id("files"))),
|
|
158
162
|
// metadata
|
|
159
|
-
finishReason: v.optional(vFinishReason),
|
|
160
|
-
model: v.optional(v.string()),
|
|
161
|
-
provider: v.optional(v.string()),
|
|
163
|
+
finishReason: values_1.v.optional(exports.vFinishReason),
|
|
164
|
+
model: values_1.v.optional(values_1.v.string()),
|
|
165
|
+
provider: values_1.v.optional(values_1.v.string()),
|
|
162
166
|
providerMetadata,
|
|
163
|
-
sources: v.optional(v.array(vSource)),
|
|
164
|
-
reasoning: v.optional(v.string()),
|
|
165
|
-
reasoningDetails: v.optional(vReasoningDetails),
|
|
166
|
-
usage: v.optional(vUsage),
|
|
167
|
-
warnings: v.optional(v.array(vLanguageModelV1CallWarning)),
|
|
168
|
-
error: v.optional(v.string()),
|
|
167
|
+
sources: values_1.v.optional(values_1.v.array(exports.vSource)),
|
|
168
|
+
reasoning: values_1.v.optional(values_1.v.string()),
|
|
169
|
+
reasoningDetails: values_1.v.optional(exports.vReasoningDetails),
|
|
170
|
+
usage: values_1.v.optional(exports.vUsage),
|
|
171
|
+
warnings: values_1.v.optional(values_1.v.array(exports.vLanguageModelV1CallWarning)),
|
|
172
|
+
error: values_1.v.optional(values_1.v.string()),
|
|
169
173
|
});
|
|
170
|
-
|
|
171
|
-
...vMessageWithMetadataInternal.fields,
|
|
172
|
-
fileIds: v.optional(v.array(v.string())),
|
|
174
|
+
exports.vMessageWithMetadata = values_1.v.object({
|
|
175
|
+
...exports.vMessageWithMetadataInternal.fields,
|
|
176
|
+
fileIds: values_1.v.optional(values_1.v.array(values_1.v.string())),
|
|
173
177
|
});
|
|
174
|
-
|
|
175
|
-
model: v.string(),
|
|
176
|
-
dimension: vVectorDimension,
|
|
177
|
-
vectors: v.array(v.union(v.array(v.number()), v.null())),
|
|
178
|
+
exports.vMessageEmbeddings = values_1.v.object({
|
|
179
|
+
model: values_1.v.string(),
|
|
180
|
+
dimension: tables_js_1.vVectorDimension,
|
|
181
|
+
vectors: values_1.v.array(values_1.v.union(values_1.v.array(values_1.v.number()), values_1.v.null())),
|
|
178
182
|
});
|
|
179
|
-
|
|
180
|
-
request: vRequest,
|
|
181
|
-
response: vResponseWithoutMessages,
|
|
182
|
-
finishReason: vFinishReason,
|
|
183
|
-
usage: v.optional(v.any()),
|
|
184
|
-
object: v.any(),
|
|
185
|
-
error: v.optional(v.string()),
|
|
186
|
-
warnings: v.optional(v.array(vLanguageModelV1CallWarning)),
|
|
183
|
+
exports.vObjectResult = values_1.v.object({
|
|
184
|
+
request: exports.vRequest,
|
|
185
|
+
response: exports.vResponseWithoutMessages,
|
|
186
|
+
finishReason: exports.vFinishReason,
|
|
187
|
+
usage: values_1.v.optional(values_1.v.any()),
|
|
188
|
+
object: values_1.v.any(),
|
|
189
|
+
error: values_1.v.optional(values_1.v.string()),
|
|
190
|
+
warnings: values_1.v.optional(values_1.v.array(exports.vLanguageModelV1CallWarning)),
|
|
187
191
|
providerMetadata,
|
|
188
192
|
});
|
|
189
|
-
|
|
190
|
-
vector: v.optional(v.array(v.number())),
|
|
191
|
-
vectorModel: v.optional(v.string()),
|
|
192
|
-
text: v.optional(v.string()),
|
|
193
|
-
limit: v.number(),
|
|
194
|
-
vectorScoreThreshold: v.optional(v.number()),
|
|
195
|
-
messageRange: v.optional(v.object({ before: v.number(), after: v.number() })),
|
|
193
|
+
exports.vSearchOptions = values_1.v.object({
|
|
194
|
+
vector: values_1.v.optional(values_1.v.array(values_1.v.number())),
|
|
195
|
+
vectorModel: values_1.v.optional(values_1.v.string()),
|
|
196
|
+
text: values_1.v.optional(values_1.v.string()),
|
|
197
|
+
limit: values_1.v.number(),
|
|
198
|
+
vectorScoreThreshold: values_1.v.optional(values_1.v.number()),
|
|
199
|
+
messageRange: values_1.v.optional(values_1.v.object({ before: values_1.v.number(), after: values_1.v.number() })),
|
|
196
200
|
});
|
|
197
|
-
|
|
198
|
-
limit: v.number(),
|
|
199
|
-
textSearch: v.optional(v.boolean()),
|
|
200
|
-
vectorSearch: v.optional(v.boolean()),
|
|
201
|
-
messageRange: v.optional(v.object({ before: v.number(), after: v.number() })),
|
|
201
|
+
exports.vContextOptionsSearchOptions = values_1.v.object({
|
|
202
|
+
limit: values_1.v.number(),
|
|
203
|
+
textSearch: values_1.v.optional(values_1.v.boolean()),
|
|
204
|
+
vectorSearch: values_1.v.optional(values_1.v.boolean()),
|
|
205
|
+
messageRange: values_1.v.optional(values_1.v.object({ before: values_1.v.number(), after: values_1.v.number() })),
|
|
202
206
|
});
|
|
203
|
-
|
|
204
|
-
excludeToolMessages: v.optional(v.boolean()),
|
|
205
|
-
recentMessages: v.optional(v.number()),
|
|
206
|
-
searchOptions: v.optional(vContextOptionsSearchOptions),
|
|
207
|
-
searchOtherThreads: v.optional(v.boolean()),
|
|
207
|
+
exports.vContextOptions = values_1.v.object({
|
|
208
|
+
excludeToolMessages: values_1.v.optional(values_1.v.boolean()),
|
|
209
|
+
recentMessages: values_1.v.optional(values_1.v.number()),
|
|
210
|
+
searchOptions: values_1.v.optional(exports.vContextOptionsSearchOptions),
|
|
211
|
+
searchOtherThreads: values_1.v.optional(values_1.v.boolean()),
|
|
208
212
|
});
|
|
209
|
-
|
|
210
|
-
saveMessages: v.optional(v.union(v.literal("all"), v.literal("none"), v.literal("promptAndOutput"))),
|
|
213
|
+
exports.vStorageOptions = values_1.v.object({
|
|
214
|
+
saveMessages: values_1.v.optional(values_1.v.union(values_1.v.literal("all"), values_1.v.literal("none"), values_1.v.literal("promptAndOutput"))),
|
|
211
215
|
});
|
|
212
|
-
const vStorageOptionsIncludingDeprecated = v.object({
|
|
213
|
-
...vStorageOptions.fields,
|
|
214
|
-
saveAllInputMessages: v.optional(v.boolean()),
|
|
215
|
-
saveAnyInputMessages: v.optional(v.boolean()),
|
|
216
|
-
saveOutputMessages: v.optional(v.boolean()),
|
|
216
|
+
const vStorageOptionsIncludingDeprecated = values_1.v.object({
|
|
217
|
+
...exports.vStorageOptions.fields,
|
|
218
|
+
saveAllInputMessages: values_1.v.optional(values_1.v.boolean()),
|
|
219
|
+
saveAnyInputMessages: values_1.v.optional(values_1.v.boolean()),
|
|
220
|
+
saveOutputMessages: values_1.v.optional(values_1.v.boolean()),
|
|
217
221
|
});
|
|
218
222
|
const vPromptFields = {
|
|
219
|
-
system: v.optional(v.string()),
|
|
220
|
-
prompt: v.optional(v.string()),
|
|
221
|
-
messages: v.optional(v.array(vMessage)),
|
|
222
|
-
promptMessageId: v.optional(v.string()),
|
|
223
|
+
system: values_1.v.optional(values_1.v.string()),
|
|
224
|
+
prompt: values_1.v.optional(values_1.v.string()),
|
|
225
|
+
messages: values_1.v.optional(values_1.v.array(exports.vMessage)),
|
|
226
|
+
promptMessageId: values_1.v.optional(values_1.v.string()),
|
|
223
227
|
};
|
|
224
|
-
|
|
225
|
-
maxTokens: v.optional(v.number()),
|
|
226
|
-
temperature: v.optional(v.number()),
|
|
227
|
-
topP: v.optional(v.number()),
|
|
228
|
-
topK: v.optional(v.number()),
|
|
229
|
-
presencePenalty: v.optional(v.number()),
|
|
230
|
-
frequencyPenalty: v.optional(v.number()),
|
|
231
|
-
seed: v.optional(v.number()),
|
|
232
|
-
maxRetries: v.optional(v.number()),
|
|
233
|
-
headers: v.optional(v.record(v.string(), v.string())),
|
|
228
|
+
exports.vCallSettingsFields = {
|
|
229
|
+
maxTokens: values_1.v.optional(values_1.v.number()),
|
|
230
|
+
temperature: values_1.v.optional(values_1.v.number()),
|
|
231
|
+
topP: values_1.v.optional(values_1.v.number()),
|
|
232
|
+
topK: values_1.v.optional(values_1.v.number()),
|
|
233
|
+
presencePenalty: values_1.v.optional(values_1.v.number()),
|
|
234
|
+
frequencyPenalty: values_1.v.optional(values_1.v.number()),
|
|
235
|
+
seed: values_1.v.optional(values_1.v.number()),
|
|
236
|
+
maxRetries: values_1.v.optional(values_1.v.number()),
|
|
237
|
+
headers: values_1.v.optional(values_1.v.record(values_1.v.string(), values_1.v.string())),
|
|
234
238
|
};
|
|
235
239
|
const vCommonArgs = {
|
|
236
|
-
userId: v.optional(v.string()),
|
|
237
|
-
threadId: v.optional(v.string()),
|
|
238
|
-
contextOptions: v.optional(vContextOptions),
|
|
239
|
-
storageOptions: v.optional(vStorageOptionsIncludingDeprecated),
|
|
240
|
+
userId: values_1.v.optional(values_1.v.string()),
|
|
241
|
+
threadId: values_1.v.optional(values_1.v.string()),
|
|
242
|
+
contextOptions: values_1.v.optional(exports.vContextOptions),
|
|
243
|
+
storageOptions: values_1.v.optional(vStorageOptionsIncludingDeprecated),
|
|
240
244
|
providerOptions,
|
|
241
|
-
...vCallSettingsFields,
|
|
245
|
+
...exports.vCallSettingsFields,
|
|
242
246
|
...vPromptFields,
|
|
243
247
|
};
|
|
244
|
-
|
|
248
|
+
exports.vTextArgs = values_1.v.object({
|
|
245
249
|
...vCommonArgs,
|
|
246
|
-
stream: v.optional(v.boolean()),
|
|
247
|
-
toolChoice: v.optional(v.union(v.literal("auto"), v.literal("none"), v.literal("required"), v.object({
|
|
248
|
-
type: v.literal("tool"),
|
|
249
|
-
toolName: v.string(),
|
|
250
|
+
stream: values_1.v.optional(values_1.v.boolean()),
|
|
251
|
+
toolChoice: values_1.v.optional(values_1.v.union(values_1.v.literal("auto"), values_1.v.literal("none"), values_1.v.literal("required"), values_1.v.object({
|
|
252
|
+
type: values_1.v.literal("tool"),
|
|
253
|
+
toolName: values_1.v.string(),
|
|
250
254
|
}))),
|
|
251
|
-
maxSteps: v.optional(v.number()),
|
|
252
|
-
experimental_continueSteps: v.optional(v.boolean()),
|
|
255
|
+
maxSteps: values_1.v.optional(values_1.v.number()),
|
|
256
|
+
experimental_continueSteps: values_1.v.optional(values_1.v.boolean()),
|
|
253
257
|
});
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
vectors: v.array(v.union(v.array(v.number()), v.null())),
|
|
257
|
-
dimension: vVectorDimension,
|
|
258
|
-
model: v.string(),
|
|
258
|
+
exports.vSafeObjectArgs = values_1.v.object(vCommonArgs);
|
|
259
|
+
exports.vEmbeddingsWithMetadata = values_1.v.object({
|
|
260
|
+
vectors: values_1.v.array(values_1.v.union(values_1.v.array(values_1.v.number()), values_1.v.null())),
|
|
261
|
+
dimension: tables_js_1.vVectorDimension,
|
|
262
|
+
model: values_1.v.string(),
|
|
259
263
|
});
|
|
260
|
-
|
|
261
|
-
return v.object({
|
|
262
|
-
page: v.array(itemValidator),
|
|
263
|
-
continueCursor: v.string(),
|
|
264
|
-
isDone: v.boolean(),
|
|
265
|
-
splitCursor: v.optional(v.union(v.string(), v.null())),
|
|
266
|
-
pageStatus: v.optional(v.union(v.literal("SplitRecommended"), v.literal("SplitRequired"), v.null())),
|
|
264
|
+
function vPaginationResult(itemValidator) {
|
|
265
|
+
return values_1.v.object({
|
|
266
|
+
page: values_1.v.array(itemValidator),
|
|
267
|
+
continueCursor: values_1.v.string(),
|
|
268
|
+
isDone: values_1.v.boolean(),
|
|
269
|
+
splitCursor: values_1.v.optional(values_1.v.union(values_1.v.string(), values_1.v.null())),
|
|
270
|
+
pageStatus: values_1.v.optional(values_1.v.union(values_1.v.literal("SplitRecommended"), values_1.v.literal("SplitRequired"), values_1.v.null())),
|
|
267
271
|
});
|
|
268
272
|
}
|
|
269
|
-
|
|
270
|
-
type: v.literal("text-delta"),
|
|
271
|
-
textDelta: v.string(),
|
|
272
|
-
}), v.object({
|
|
273
|
-
type: v.literal("reasoning"),
|
|
274
|
-
textDelta: v.string(),
|
|
275
|
-
}), v.object({
|
|
276
|
-
type: v.literal("source"),
|
|
277
|
-
source: vSource,
|
|
278
|
-
}), vToolCallPart, v.object({
|
|
279
|
-
type: v.literal("tool-call-streaming-start"),
|
|
280
|
-
toolCallId: v.string(),
|
|
281
|
-
toolName: v.string(),
|
|
282
|
-
}), v.object({
|
|
283
|
-
type: v.literal("tool-call-delta"),
|
|
284
|
-
toolCallId: v.string(),
|
|
285
|
-
toolName: v.string(),
|
|
286
|
-
argsTextDelta: v.string(),
|
|
273
|
+
exports.vTextStreamPart = values_1.v.union(values_1.v.object({
|
|
274
|
+
type: values_1.v.literal("text-delta"),
|
|
275
|
+
textDelta: values_1.v.string(),
|
|
276
|
+
}), values_1.v.object({
|
|
277
|
+
type: values_1.v.literal("reasoning"),
|
|
278
|
+
textDelta: values_1.v.string(),
|
|
279
|
+
}), values_1.v.object({
|
|
280
|
+
type: values_1.v.literal("source"),
|
|
281
|
+
source: exports.vSource,
|
|
282
|
+
}), exports.vToolCallPart, values_1.v.object({
|
|
283
|
+
type: values_1.v.literal("tool-call-streaming-start"),
|
|
284
|
+
toolCallId: values_1.v.string(),
|
|
285
|
+
toolName: values_1.v.string(),
|
|
286
|
+
}), values_1.v.object({
|
|
287
|
+
type: values_1.v.literal("tool-call-delta"),
|
|
288
|
+
toolCallId: values_1.v.string(),
|
|
289
|
+
toolName: values_1.v.string(),
|
|
290
|
+
argsTextDelta: values_1.v.string(),
|
|
287
291
|
}), vToolResultPart);
|
|
288
|
-
|
|
289
|
-
streamId: v.string(),
|
|
290
|
-
cursor: v.number(),
|
|
292
|
+
exports.vStreamCursor = values_1.v.object({
|
|
293
|
+
streamId: values_1.v.string(),
|
|
294
|
+
cursor: values_1.v.number(),
|
|
291
295
|
});
|
|
292
|
-
|
|
293
|
-
kind: v.literal("list"),
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
cursors: v.array(vStreamCursor),
|
|
296
|
+
exports.vStreamArgs = values_1.v.optional(values_1.v.union(values_1.v.object({
|
|
297
|
+
kind: values_1.v.literal("list"),
|
|
298
|
+
}), values_1.v.object({
|
|
299
|
+
kind: values_1.v.literal("deltas"),
|
|
300
|
+
cursors: values_1.v.array(exports.vStreamCursor),
|
|
298
301
|
})));
|
|
299
|
-
|
|
300
|
-
streamId: v.string(),
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
stepOrder: v.number(),
|
|
302
|
+
exports.vStreamMessage = values_1.v.object({
|
|
303
|
+
streamId: values_1.v.string(),
|
|
304
|
+
order: values_1.v.number(),
|
|
305
|
+
stepOrder: values_1.v.number(),
|
|
304
306
|
// metadata
|
|
305
|
-
userId: v.optional(v.string()),
|
|
306
|
-
agentName: v.optional(v.string()),
|
|
307
|
-
model: v.optional(v.string()),
|
|
308
|
-
provider: v.optional(v.string()),
|
|
309
|
-
providerOptions: v.optional(vProviderOptions), // Sent to model
|
|
307
|
+
userId: values_1.v.optional(values_1.v.string()),
|
|
308
|
+
agentName: values_1.v.optional(values_1.v.string()),
|
|
309
|
+
model: values_1.v.optional(values_1.v.string()),
|
|
310
|
+
provider: values_1.v.optional(values_1.v.string()),
|
|
311
|
+
providerOptions: values_1.v.optional(exports.vProviderOptions), // Sent to model
|
|
310
312
|
});
|
|
311
|
-
|
|
312
|
-
streamId: v.string(),
|
|
313
|
-
start: v.number(), // inclusive
|
|
314
|
-
end: v.number(), // exclusive
|
|
315
|
-
parts: v.array(vTextStreamPart),
|
|
313
|
+
exports.vStreamDelta = values_1.v.object({
|
|
314
|
+
streamId: values_1.v.string(),
|
|
315
|
+
start: values_1.v.number(), // inclusive
|
|
316
|
+
end: values_1.v.number(), // exclusive
|
|
317
|
+
parts: values_1.v.array(exports.vTextStreamPart),
|
|
316
318
|
});
|
|
317
319
|
//# sourceMappingURL=validators.js.map
|