@tpmjs/types 0.1.2 → 0.2.1

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.
@@ -0,0 +1,300 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const AIProviderSchema: z.ZodEnum<{
4
+ OPENAI: "OPENAI";
5
+ ANTHROPIC: "ANTHROPIC";
6
+ GOOGLE: "GOOGLE";
7
+ GROQ: "GROQ";
8
+ MISTRAL: "MISTRAL";
9
+ }>;
10
+ declare const MessageRoleSchema: z.ZodEnum<{
11
+ USER: "USER";
12
+ ASSISTANT: "ASSISTANT";
13
+ TOOL: "TOOL";
14
+ SYSTEM: "SYSTEM";
15
+ }>;
16
+ type AIProvider = z.infer<typeof AIProviderSchema>;
17
+ type MessageRole = z.infer<typeof MessageRoleSchema>;
18
+ declare const CreateAgentSchema: z.ZodObject<{
19
+ name: z.ZodString;
20
+ uid: z.ZodOptional<z.ZodString>;
21
+ description: z.ZodOptional<z.ZodString>;
22
+ provider: z.ZodEnum<{
23
+ OPENAI: "OPENAI";
24
+ ANTHROPIC: "ANTHROPIC";
25
+ GOOGLE: "GOOGLE";
26
+ GROQ: "GROQ";
27
+ MISTRAL: "MISTRAL";
28
+ }>;
29
+ modelId: z.ZodString;
30
+ systemPrompt: z.ZodOptional<z.ZodString>;
31
+ temperature: z.ZodDefault<z.ZodNumber>;
32
+ maxToolCallsPerTurn: z.ZodDefault<z.ZodNumber>;
33
+ maxMessagesInContext: z.ZodDefault<z.ZodNumber>;
34
+ isPublic: z.ZodDefault<z.ZodBoolean>;
35
+ collectionIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
+ toolIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
37
+ }, z.core.$strip>;
38
+ declare const UpdateAgentSchema: z.ZodObject<{
39
+ name: z.ZodOptional<z.ZodString>;
40
+ uid: z.ZodOptional<z.ZodString>;
41
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
+ provider: z.ZodOptional<z.ZodEnum<{
43
+ OPENAI: "OPENAI";
44
+ ANTHROPIC: "ANTHROPIC";
45
+ GOOGLE: "GOOGLE";
46
+ GROQ: "GROQ";
47
+ MISTRAL: "MISTRAL";
48
+ }>>;
49
+ modelId: z.ZodOptional<z.ZodString>;
50
+ systemPrompt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
+ temperature: z.ZodOptional<z.ZodNumber>;
52
+ maxToolCallsPerTurn: z.ZodOptional<z.ZodNumber>;
53
+ maxMessagesInContext: z.ZodOptional<z.ZodNumber>;
54
+ isPublic: z.ZodOptional<z.ZodBoolean>;
55
+ executorType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
56
+ default: "default";
57
+ custom_url: "custom_url";
58
+ }>>>;
59
+ executorConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
60
+ url: z.ZodString;
61
+ apiKey: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$strip>>>;
63
+ envVars: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
64
+ }, z.core.$strip>;
65
+ declare const AddCollectionToAgentSchema: z.ZodObject<{
66
+ collectionId: z.ZodString;
67
+ position: z.ZodOptional<z.ZodNumber>;
68
+ }, z.core.$strip>;
69
+ declare const AddToolToAgentSchema: z.ZodObject<{
70
+ toolId: z.ZodString;
71
+ position: z.ZodOptional<z.ZodNumber>;
72
+ }, z.core.$strip>;
73
+ declare const CloneAgentSchema: z.ZodObject<{
74
+ name: z.ZodOptional<z.ZodString>;
75
+ uid: z.ZodOptional<z.ZodString>;
76
+ }, z.core.$strip>;
77
+ declare const SUPPORTED_PROVIDERS: readonly ["OPENAI", "ANTHROPIC", "GOOGLE", "GROQ", "MISTRAL"];
78
+ declare const AddApiKeySchema: z.ZodObject<{
79
+ provider: z.ZodEnum<{
80
+ OPENAI: "OPENAI";
81
+ ANTHROPIC: "ANTHROPIC";
82
+ GOOGLE: "GOOGLE";
83
+ GROQ: "GROQ";
84
+ MISTRAL: "MISTRAL";
85
+ }>;
86
+ apiKey: z.ZodString;
87
+ }, z.core.$strip>;
88
+ declare const ApiKeyInfoSchema: z.ZodObject<{
89
+ provider: z.ZodEnum<{
90
+ OPENAI: "OPENAI";
91
+ ANTHROPIC: "ANTHROPIC";
92
+ GOOGLE: "GOOGLE";
93
+ GROQ: "GROQ";
94
+ MISTRAL: "MISTRAL";
95
+ }>;
96
+ keyHint: z.ZodNullable<z.ZodString>;
97
+ createdAt: z.ZodDate;
98
+ updatedAt: z.ZodDate;
99
+ }, z.core.$strip>;
100
+ declare const CreateConversationSchema: z.ZodObject<{
101
+ slug: z.ZodOptional<z.ZodString>;
102
+ title: z.ZodOptional<z.ZodString>;
103
+ }, z.core.$strip>;
104
+ declare const SendMessageSchema: z.ZodObject<{
105
+ message: z.ZodString;
106
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
107
+ }, z.core.$strip>;
108
+ declare const ToolCallSchema: z.ZodObject<{
109
+ id: z.ZodString;
110
+ name: z.ZodString;
111
+ arguments: z.ZodString;
112
+ }, z.core.$strip>;
113
+ declare const MessageSchema: z.ZodObject<{
114
+ id: z.ZodString;
115
+ role: z.ZodEnum<{
116
+ USER: "USER";
117
+ ASSISTANT: "ASSISTANT";
118
+ TOOL: "TOOL";
119
+ SYSTEM: "SYSTEM";
120
+ }>;
121
+ content: z.ZodString;
122
+ toolCalls: z.ZodNullable<z.ZodArray<z.ZodObject<{
123
+ id: z.ZodString;
124
+ name: z.ZodString;
125
+ arguments: z.ZodString;
126
+ }, z.core.$strip>>>;
127
+ toolCallId: z.ZodNullable<z.ZodString>;
128
+ toolName: z.ZodNullable<z.ZodString>;
129
+ toolResult: z.ZodNullable<z.ZodAny>;
130
+ inputTokens: z.ZodNullable<z.ZodNumber>;
131
+ outputTokens: z.ZodNullable<z.ZodNumber>;
132
+ createdAt: z.ZodDate;
133
+ }, z.core.$strip>;
134
+ declare const AgentSchema: z.ZodObject<{
135
+ id: z.ZodString;
136
+ uid: z.ZodString;
137
+ name: z.ZodString;
138
+ description: z.ZodNullable<z.ZodString>;
139
+ provider: z.ZodEnum<{
140
+ OPENAI: "OPENAI";
141
+ ANTHROPIC: "ANTHROPIC";
142
+ GOOGLE: "GOOGLE";
143
+ GROQ: "GROQ";
144
+ MISTRAL: "MISTRAL";
145
+ }>;
146
+ modelId: z.ZodString;
147
+ systemPrompt: z.ZodNullable<z.ZodString>;
148
+ temperature: z.ZodNumber;
149
+ maxToolCallsPerTurn: z.ZodNumber;
150
+ maxMessagesInContext: z.ZodNumber;
151
+ isPublic: z.ZodBoolean;
152
+ toolCount: z.ZodNumber;
153
+ collectionCount: z.ZodNumber;
154
+ forkCount: z.ZodDefault<z.ZodNumber>;
155
+ forkedFromId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
156
+ createdAt: z.ZodDate;
157
+ updatedAt: z.ZodDate;
158
+ }, z.core.$strip>;
159
+ declare const ConversationSchema: z.ZodObject<{
160
+ id: z.ZodString;
161
+ agentId: z.ZodString;
162
+ slug: z.ZodString;
163
+ title: z.ZodNullable<z.ZodString>;
164
+ createdAt: z.ZodDate;
165
+ updatedAt: z.ZodDate;
166
+ messageCount: z.ZodOptional<z.ZodNumber>;
167
+ }, z.core.$strip>;
168
+ declare const ConversationWithMessagesSchema: z.ZodObject<{
169
+ id: z.ZodString;
170
+ agentId: z.ZodString;
171
+ slug: z.ZodString;
172
+ title: z.ZodNullable<z.ZodString>;
173
+ createdAt: z.ZodDate;
174
+ updatedAt: z.ZodDate;
175
+ messageCount: z.ZodOptional<z.ZodNumber>;
176
+ messages: z.ZodArray<z.ZodObject<{
177
+ id: z.ZodString;
178
+ role: z.ZodEnum<{
179
+ USER: "USER";
180
+ ASSISTANT: "ASSISTANT";
181
+ TOOL: "TOOL";
182
+ SYSTEM: "SYSTEM";
183
+ }>;
184
+ content: z.ZodString;
185
+ toolCalls: z.ZodNullable<z.ZodArray<z.ZodObject<{
186
+ id: z.ZodString;
187
+ name: z.ZodString;
188
+ arguments: z.ZodString;
189
+ }, z.core.$strip>>>;
190
+ toolCallId: z.ZodNullable<z.ZodString>;
191
+ toolName: z.ZodNullable<z.ZodString>;
192
+ toolResult: z.ZodNullable<z.ZodAny>;
193
+ inputTokens: z.ZodNullable<z.ZodNumber>;
194
+ outputTokens: z.ZodNullable<z.ZodNumber>;
195
+ createdAt: z.ZodDate;
196
+ }, z.core.$strip>>;
197
+ }, z.core.$strip>;
198
+ type CreateAgentInput = z.infer<typeof CreateAgentSchema>;
199
+ type UpdateAgentInput = z.infer<typeof UpdateAgentSchema>;
200
+ type AddCollectionToAgentInput = z.infer<typeof AddCollectionToAgentSchema>;
201
+ type AddToolToAgentInput = z.infer<typeof AddToolToAgentSchema>;
202
+ type CloneAgentInput = z.infer<typeof CloneAgentSchema>;
203
+ type AddApiKeyInput = z.infer<typeof AddApiKeySchema>;
204
+ type ApiKeyInfo = z.infer<typeof ApiKeyInfoSchema>;
205
+ type CreateConversationInput = z.infer<typeof CreateConversationSchema>;
206
+ type SendMessageInput = z.infer<typeof SendMessageSchema>;
207
+ type ToolCall = z.infer<typeof ToolCallSchema>;
208
+ type Message = z.infer<typeof MessageSchema>;
209
+ type Agent = z.infer<typeof AgentSchema>;
210
+ type Conversation = z.infer<typeof ConversationSchema>;
211
+ type ConversationWithMessages = z.infer<typeof ConversationWithMessagesSchema>;
212
+ declare const AGENT_LIMITS: {
213
+ readonly MAX_AGENTS_PER_USER: 20;
214
+ readonly MAX_COLLECTIONS_PER_AGENT: 10;
215
+ readonly MAX_TOOLS_PER_AGENT: 50;
216
+ readonly MAX_SYSTEM_PROMPT_LENGTH: 10000;
217
+ readonly MAX_NAME_LENGTH: 100;
218
+ readonly MAX_DESCRIPTION_LENGTH: 500;
219
+ readonly MAX_UID_LENGTH: 50;
220
+ };
221
+ declare const CONVERSATION_LIMITS: {
222
+ readonly MAX_CONVERSATIONS_PER_AGENT: 100;
223
+ readonly MAX_MESSAGE_LENGTH: 50000;
224
+ readonly MAX_TITLE_LENGTH: 200;
225
+ readonly MAX_SLUG_LENGTH: 100;
226
+ };
227
+ declare const PROVIDER_MODELS: {
228
+ readonly OPENAI: readonly [{
229
+ readonly id: "gpt-4o";
230
+ readonly name: "GPT-4o";
231
+ readonly contextWindow: 128000;
232
+ }, {
233
+ readonly id: "gpt-4o-mini";
234
+ readonly name: "GPT-4o Mini";
235
+ readonly contextWindow: 128000;
236
+ }, {
237
+ readonly id: "gpt-4-turbo";
238
+ readonly name: "GPT-4 Turbo";
239
+ readonly contextWindow: 128000;
240
+ }, {
241
+ readonly id: "gpt-3.5-turbo";
242
+ readonly name: "GPT-3.5 Turbo";
243
+ readonly contextWindow: 16385;
244
+ }];
245
+ readonly ANTHROPIC: readonly [{
246
+ readonly id: "claude-3-5-sonnet-20241022";
247
+ readonly name: "Claude 3.5 Sonnet";
248
+ readonly contextWindow: 200000;
249
+ }, {
250
+ readonly id: "claude-3-5-haiku-20241022";
251
+ readonly name: "Claude 3.5 Haiku";
252
+ readonly contextWindow: 200000;
253
+ }, {
254
+ readonly id: "claude-3-opus-20240229";
255
+ readonly name: "Claude 3 Opus";
256
+ readonly contextWindow: 200000;
257
+ }];
258
+ readonly GOOGLE: readonly [{
259
+ readonly id: "gemini-2.0-flash-exp";
260
+ readonly name: "Gemini 2.0 Flash";
261
+ readonly contextWindow: 1000000;
262
+ }, {
263
+ readonly id: "gemini-1.5-pro";
264
+ readonly name: "Gemini 1.5 Pro";
265
+ readonly contextWindow: 1000000;
266
+ }, {
267
+ readonly id: "gemini-1.5-flash";
268
+ readonly name: "Gemini 1.5 Flash";
269
+ readonly contextWindow: 1000000;
270
+ }];
271
+ readonly GROQ: readonly [{
272
+ readonly id: "llama-3.3-70b-versatile";
273
+ readonly name: "Llama 3.3 70B";
274
+ readonly contextWindow: 131072;
275
+ }, {
276
+ readonly id: "llama-3.1-8b-instant";
277
+ readonly name: "Llama 3.1 8B";
278
+ readonly contextWindow: 131072;
279
+ }, {
280
+ readonly id: "mixtral-8x7b-32768";
281
+ readonly name: "Mixtral 8x7B";
282
+ readonly contextWindow: 32768;
283
+ }];
284
+ readonly MISTRAL: readonly [{
285
+ readonly id: "mistral-large-latest";
286
+ readonly name: "Mistral Large";
287
+ readonly contextWindow: 128000;
288
+ }, {
289
+ readonly id: "mistral-small-latest";
290
+ readonly name: "Mistral Small";
291
+ readonly contextWindow: 128000;
292
+ }];
293
+ };
294
+ type ProviderModel = {
295
+ id: string;
296
+ name: string;
297
+ contextWindow: number;
298
+ };
299
+
300
+ export { AGENT_LIMITS, type AIProvider, AIProviderSchema, type AddApiKeyInput, AddApiKeySchema, type AddCollectionToAgentInput, AddCollectionToAgentSchema, type AddToolToAgentInput, AddToolToAgentSchema, type Agent, AgentSchema, type ApiKeyInfo, ApiKeyInfoSchema, CONVERSATION_LIMITS, type CloneAgentInput, CloneAgentSchema, type Conversation, ConversationSchema, type ConversationWithMessages, ConversationWithMessagesSchema, type CreateAgentInput, CreateAgentSchema, type CreateConversationInput, CreateConversationSchema, type Message, type MessageRole, MessageRoleSchema, MessageSchema, PROVIDER_MODELS, type ProviderModel, SUPPORTED_PROVIDERS, type SendMessageInput, SendMessageSchema, type ToolCall, ToolCallSchema, type UpdateAgentInput, UpdateAgentSchema };
package/dist/agent.js ADDED
@@ -0,0 +1,206 @@
1
+ import { z } from 'zod';
2
+
3
+ // src/agent.ts
4
+ var ExecutorTypeSchema = z.enum(["default", "custom_url"]);
5
+ var DefaultExecutorConfigSchema = z.object({
6
+ type: z.literal("default")
7
+ });
8
+ var CustomUrlExecutorConfigSchema = z.object({
9
+ type: z.literal("custom_url"),
10
+ /** URL of the custom executor (must be HTTPS in production) */
11
+ url: z.string().url(),
12
+ /** Optional API key for Bearer token authentication */
13
+ apiKey: z.string().optional()
14
+ });
15
+ z.discriminatedUnion("type", [
16
+ DefaultExecutorConfigSchema,
17
+ CustomUrlExecutorConfigSchema
18
+ ]);
19
+ z.object({
20
+ packageName: z.string().min(1),
21
+ name: z.string().min(1),
22
+ version: z.string().optional(),
23
+ importUrl: z.string().url().optional(),
24
+ params: z.record(z.string(), z.unknown()),
25
+ env: z.record(z.string(), z.string()).optional()
26
+ });
27
+ z.object({
28
+ success: z.boolean(),
29
+ output: z.unknown().optional(),
30
+ error: z.string().optional(),
31
+ executionTimeMs: z.number()
32
+ });
33
+ z.object({
34
+ status: z.enum(["ok", "degraded", "error"]),
35
+ version: z.string().optional(),
36
+ info: z.record(z.string(), z.unknown()).optional()
37
+ });
38
+ z.object({
39
+ url: z.string().url(),
40
+ apiKey: z.string().optional()
41
+ });
42
+
43
+ // src/agent.ts
44
+ var UID_REGEX = /^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/;
45
+ var ExecutorConfigUpdateSchema = z.object({
46
+ url: z.string().url(),
47
+ apiKey: z.string().optional()
48
+ }).nullable().optional();
49
+ var AIProviderSchema = z.enum(["OPENAI", "ANTHROPIC", "GOOGLE", "GROQ", "MISTRAL"]);
50
+ var MessageRoleSchema = z.enum(["USER", "ASSISTANT", "TOOL", "SYSTEM"]);
51
+ var CreateAgentSchema = z.object({
52
+ name: z.string().min(1, "Name is required").max(100, "Name must be 100 characters or less"),
53
+ uid: z.string().min(1, "UID is required").max(50, "UID must be 50 characters or less").regex(UID_REGEX, "UID must be lowercase alphanumeric with hyphens").optional(),
54
+ description: z.string().max(500, "Description must be 500 characters or less").optional(),
55
+ provider: AIProviderSchema,
56
+ modelId: z.string().min(1, "Model ID is required").max(100),
57
+ systemPrompt: z.string().max(1e4, "System prompt must be 10,000 characters or less").optional(),
58
+ temperature: z.number().min(0).max(2).default(0.7),
59
+ maxToolCallsPerTurn: z.number().int().min(1).max(100).default(20),
60
+ maxMessagesInContext: z.number().int().min(1).max(100).default(10),
61
+ isPublic: z.boolean().default(true),
62
+ collectionIds: z.array(z.string()).optional(),
63
+ toolIds: z.array(z.string()).optional()
64
+ });
65
+ var UpdateAgentSchema = z.object({
66
+ name: z.string().min(1).max(100).optional(),
67
+ uid: z.string().min(1).max(50).regex(UID_REGEX).optional(),
68
+ description: z.string().max(500).nullable().optional(),
69
+ provider: AIProviderSchema.optional(),
70
+ modelId: z.string().min(1).max(100).optional(),
71
+ systemPrompt: z.string().max(1e4).nullable().optional(),
72
+ temperature: z.number().min(0).max(2).optional(),
73
+ maxToolCallsPerTurn: z.number().int().min(1).max(100).optional(),
74
+ maxMessagesInContext: z.number().int().min(1).max(100).optional(),
75
+ isPublic: z.boolean().optional(),
76
+ // Executor configuration
77
+ executorType: ExecutorTypeSchema.nullable().optional(),
78
+ executorConfig: ExecutorConfigUpdateSchema,
79
+ // Tool environment variables
80
+ envVars: z.record(z.string(), z.string()).nullable().optional()
81
+ });
82
+ var AddCollectionToAgentSchema = z.object({
83
+ collectionId: z.string().min(1, "Collection ID is required"),
84
+ position: z.number().int().min(0).optional()
85
+ });
86
+ var AddToolToAgentSchema = z.object({
87
+ toolId: z.string().min(1, "Tool ID is required"),
88
+ position: z.number().int().min(0).optional()
89
+ });
90
+ var CloneAgentSchema = z.object({
91
+ name: z.string().min(1).max(100).optional(),
92
+ // If not provided, will append "(copy)"
93
+ uid: z.string().min(1).max(50).regex(UID_REGEX, "UID must be lowercase alphanumeric with hyphens").optional()
94
+ // If not provided, will generate from name
95
+ });
96
+ var SUPPORTED_PROVIDERS = ["OPENAI", "ANTHROPIC", "GOOGLE", "GROQ", "MISTRAL"];
97
+ var AddApiKeySchema = z.object({
98
+ provider: AIProviderSchema,
99
+ apiKey: z.string().min(10, "API key is required")
100
+ });
101
+ var ApiKeyInfoSchema = z.object({
102
+ provider: AIProviderSchema,
103
+ keyHint: z.string().nullable(),
104
+ createdAt: z.date(),
105
+ updatedAt: z.date()
106
+ });
107
+ var CreateConversationSchema = z.object({
108
+ slug: z.string().min(1).max(100).regex(/^[a-z0-9-]+$/, "Slug must be lowercase alphanumeric with hyphens").optional(),
109
+ title: z.string().max(200).optional()
110
+ });
111
+ var SendMessageSchema = z.object({
112
+ message: z.string().min(1, "Message is required").max(5e4, "Message too long"),
113
+ env: z.record(z.string(), z.string()).optional()
114
+ });
115
+ var ToolCallSchema = z.object({
116
+ id: z.string(),
117
+ name: z.string(),
118
+ arguments: z.string()
119
+ });
120
+ var MessageSchema = z.object({
121
+ id: z.string(),
122
+ role: MessageRoleSchema,
123
+ content: z.string(),
124
+ toolCalls: z.array(ToolCallSchema).nullable(),
125
+ toolCallId: z.string().nullable(),
126
+ toolName: z.string().nullable(),
127
+ toolResult: z.any().nullable(),
128
+ inputTokens: z.number().nullable(),
129
+ outputTokens: z.number().nullable(),
130
+ createdAt: z.date()
131
+ });
132
+ var AgentSchema = z.object({
133
+ id: z.string(),
134
+ uid: z.string(),
135
+ name: z.string(),
136
+ description: z.string().nullable(),
137
+ provider: AIProviderSchema,
138
+ modelId: z.string(),
139
+ systemPrompt: z.string().nullable(),
140
+ temperature: z.number(),
141
+ maxToolCallsPerTurn: z.number(),
142
+ maxMessagesInContext: z.number(),
143
+ isPublic: z.boolean(),
144
+ toolCount: z.number(),
145
+ collectionCount: z.number(),
146
+ forkCount: z.number().default(0),
147
+ forkedFromId: z.string().nullable().optional(),
148
+ createdAt: z.date(),
149
+ updatedAt: z.date()
150
+ });
151
+ var ConversationSchema = z.object({
152
+ id: z.string(),
153
+ agentId: z.string(),
154
+ slug: z.string(),
155
+ title: z.string().nullable(),
156
+ createdAt: z.date(),
157
+ updatedAt: z.date(),
158
+ messageCount: z.number().optional()
159
+ });
160
+ var ConversationWithMessagesSchema = ConversationSchema.extend({
161
+ messages: z.array(MessageSchema)
162
+ });
163
+ var AGENT_LIMITS = {
164
+ MAX_AGENTS_PER_USER: 20,
165
+ MAX_COLLECTIONS_PER_AGENT: 10,
166
+ MAX_TOOLS_PER_AGENT: 50,
167
+ MAX_SYSTEM_PROMPT_LENGTH: 1e4,
168
+ MAX_NAME_LENGTH: 100,
169
+ MAX_DESCRIPTION_LENGTH: 500,
170
+ MAX_UID_LENGTH: 50
171
+ };
172
+ var CONVERSATION_LIMITS = {
173
+ MAX_CONVERSATIONS_PER_AGENT: 100,
174
+ MAX_MESSAGE_LENGTH: 5e4,
175
+ MAX_TITLE_LENGTH: 200,
176
+ MAX_SLUG_LENGTH: 100
177
+ };
178
+ var PROVIDER_MODELS = {
179
+ OPENAI: [
180
+ { id: "gpt-4o", name: "GPT-4o", contextWindow: 128e3 },
181
+ { id: "gpt-4o-mini", name: "GPT-4o Mini", contextWindow: 128e3 },
182
+ { id: "gpt-4-turbo", name: "GPT-4 Turbo", contextWindow: 128e3 },
183
+ { id: "gpt-3.5-turbo", name: "GPT-3.5 Turbo", contextWindow: 16385 }
184
+ ],
185
+ ANTHROPIC: [
186
+ { id: "claude-3-5-sonnet-20241022", name: "Claude 3.5 Sonnet", contextWindow: 2e5 },
187
+ { id: "claude-3-5-haiku-20241022", name: "Claude 3.5 Haiku", contextWindow: 2e5 },
188
+ { id: "claude-3-opus-20240229", name: "Claude 3 Opus", contextWindow: 2e5 }
189
+ ],
190
+ GOOGLE: [
191
+ { id: "gemini-2.0-flash-exp", name: "Gemini 2.0 Flash", contextWindow: 1e6 },
192
+ { id: "gemini-1.5-pro", name: "Gemini 1.5 Pro", contextWindow: 1e6 },
193
+ { id: "gemini-1.5-flash", name: "Gemini 1.5 Flash", contextWindow: 1e6 }
194
+ ],
195
+ GROQ: [
196
+ { id: "llama-3.3-70b-versatile", name: "Llama 3.3 70B", contextWindow: 131072 },
197
+ { id: "llama-3.1-8b-instant", name: "Llama 3.1 8B", contextWindow: 131072 },
198
+ { id: "mixtral-8x7b-32768", name: "Mixtral 8x7B", contextWindow: 32768 }
199
+ ],
200
+ MISTRAL: [
201
+ { id: "mistral-large-latest", name: "Mistral Large", contextWindow: 128e3 },
202
+ { id: "mistral-small-latest", name: "Mistral Small", contextWindow: 128e3 }
203
+ ]
204
+ };
205
+
206
+ export { AGENT_LIMITS, AIProviderSchema, AddApiKeySchema, AddCollectionToAgentSchema, AddToolToAgentSchema, AgentSchema, ApiKeyInfoSchema, CONVERSATION_LIMITS, CloneAgentSchema, ConversationSchema, ConversationWithMessagesSchema, CreateAgentSchema, CreateConversationSchema, MessageRoleSchema, MessageSchema, PROVIDER_MODELS, SUPPORTED_PROVIDERS, SendMessageSchema, ToolCallSchema, UpdateAgentSchema };
@@ -0,0 +1,125 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const CreateCollectionSchema: z.ZodObject<{
4
+ name: z.ZodString;
5
+ description: z.ZodOptional<z.ZodString>;
6
+ isPublic: z.ZodDefault<z.ZodBoolean>;
7
+ }, z.core.$strip>;
8
+ declare const UpdateCollectionSchema: z.ZodObject<{
9
+ name: z.ZodOptional<z.ZodString>;
10
+ description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ isPublic: z.ZodOptional<z.ZodBoolean>;
12
+ executorType: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
13
+ default: "default";
14
+ custom_url: "custom_url";
15
+ }>>>;
16
+ executorConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
17
+ url: z.ZodString;
18
+ apiKey: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strip>>>;
20
+ envVars: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>>;
21
+ }, z.core.$strip>;
22
+ declare const AddToolToCollectionSchema: z.ZodObject<{
23
+ toolId: z.ZodString;
24
+ note: z.ZodOptional<z.ZodString>;
25
+ position: z.ZodOptional<z.ZodNumber>;
26
+ }, z.core.$strip>;
27
+ declare const UpdateCollectionToolSchema: z.ZodObject<{
28
+ note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
29
+ position: z.ZodOptional<z.ZodNumber>;
30
+ }, z.core.$strip>;
31
+ declare const ReorderToolsSchema: z.ZodObject<{
32
+ toolIds: z.ZodArray<z.ZodString>;
33
+ }, z.core.$strip>;
34
+ declare const AddBridgeToolToCollectionSchema: z.ZodObject<{
35
+ serverId: z.ZodString;
36
+ toolName: z.ZodString;
37
+ displayName: z.ZodOptional<z.ZodString>;
38
+ note: z.ZodOptional<z.ZodString>;
39
+ }, z.core.$strip>;
40
+ declare const UpdateCollectionBridgeToolSchema: z.ZodObject<{
41
+ displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
42
+ note: z.ZodOptional<z.ZodNullable<z.ZodString>>;
43
+ }, z.core.$strip>;
44
+ declare const CloneCollectionSchema: z.ZodObject<{
45
+ name: z.ZodOptional<z.ZodString>;
46
+ }, z.core.$strip>;
47
+ declare const CollectionSchema: z.ZodObject<{
48
+ id: z.ZodString;
49
+ name: z.ZodString;
50
+ slug: z.ZodNullable<z.ZodString>;
51
+ description: z.ZodNullable<z.ZodString>;
52
+ isPublic: z.ZodBoolean;
53
+ toolCount: z.ZodNumber;
54
+ forkCount: z.ZodDefault<z.ZodNumber>;
55
+ forkedFromId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
+ createdAt: z.ZodDate;
57
+ updatedAt: z.ZodDate;
58
+ }, z.core.$strip>;
59
+ declare const CollectionToolSchema: z.ZodObject<{
60
+ id: z.ZodString;
61
+ toolId: z.ZodString;
62
+ position: z.ZodNumber;
63
+ note: z.ZodNullable<z.ZodString>;
64
+ addedAt: z.ZodDate;
65
+ tool: z.ZodObject<{
66
+ id: z.ZodString;
67
+ name: z.ZodString;
68
+ description: z.ZodString;
69
+ package: z.ZodObject<{
70
+ id: z.ZodString;
71
+ npmPackageName: z.ZodString;
72
+ category: z.ZodString;
73
+ }, z.core.$strip>;
74
+ }, z.core.$strip>;
75
+ }, z.core.$strip>;
76
+ declare const CollectionWithToolsSchema: z.ZodObject<{
77
+ id: z.ZodString;
78
+ name: z.ZodString;
79
+ slug: z.ZodNullable<z.ZodString>;
80
+ description: z.ZodNullable<z.ZodString>;
81
+ isPublic: z.ZodBoolean;
82
+ toolCount: z.ZodNumber;
83
+ forkCount: z.ZodDefault<z.ZodNumber>;
84
+ forkedFromId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
85
+ createdAt: z.ZodDate;
86
+ updatedAt: z.ZodDate;
87
+ tools: z.ZodArray<z.ZodObject<{
88
+ id: z.ZodString;
89
+ toolId: z.ZodString;
90
+ position: z.ZodNumber;
91
+ note: z.ZodNullable<z.ZodString>;
92
+ addedAt: z.ZodDate;
93
+ tool: z.ZodObject<{
94
+ id: z.ZodString;
95
+ name: z.ZodString;
96
+ description: z.ZodString;
97
+ package: z.ZodObject<{
98
+ id: z.ZodString;
99
+ npmPackageName: z.ZodString;
100
+ category: z.ZodString;
101
+ }, z.core.$strip>;
102
+ }, z.core.$strip>;
103
+ }, z.core.$strip>>;
104
+ }, z.core.$strip>;
105
+ type CreateCollectionInput = z.infer<typeof CreateCollectionSchema>;
106
+ type UpdateCollectionInput = z.infer<typeof UpdateCollectionSchema>;
107
+ type AddToolToCollectionInput = z.infer<typeof AddToolToCollectionSchema>;
108
+ type UpdateCollectionToolInput = z.infer<typeof UpdateCollectionToolSchema>;
109
+ type ReorderToolsInput = z.infer<typeof ReorderToolsSchema>;
110
+ type CloneCollectionInput = z.infer<typeof CloneCollectionSchema>;
111
+ type AddBridgeToolToCollectionInput = z.infer<typeof AddBridgeToolToCollectionSchema>;
112
+ type UpdateCollectionBridgeToolInput = z.infer<typeof UpdateCollectionBridgeToolSchema>;
113
+ type Collection = z.infer<typeof CollectionSchema>;
114
+ type CollectionTool = z.infer<typeof CollectionToolSchema>;
115
+ type CollectionWithTools = z.infer<typeof CollectionWithToolsSchema>;
116
+ declare const COLLECTION_LIMITS: {
117
+ readonly MAX_COLLECTIONS_PER_USER: 50;
118
+ readonly MAX_TOOLS_PER_COLLECTION: 100;
119
+ readonly MAX_BRIDGE_TOOLS_PER_COLLECTION: 50;
120
+ readonly MAX_NAME_LENGTH: 100;
121
+ readonly MAX_DESCRIPTION_LENGTH: 500;
122
+ readonly MAX_NOTE_LENGTH: 500;
123
+ };
124
+
125
+ export { type AddBridgeToolToCollectionInput, AddBridgeToolToCollectionSchema, type AddToolToCollectionInput, AddToolToCollectionSchema, COLLECTION_LIMITS, type CloneCollectionInput, CloneCollectionSchema, type Collection, CollectionSchema, type CollectionTool, CollectionToolSchema, type CollectionWithTools, CollectionWithToolsSchema, type CreateCollectionInput, CreateCollectionSchema, type ReorderToolsInput, ReorderToolsSchema, type UpdateCollectionBridgeToolInput, UpdateCollectionBridgeToolSchema, type UpdateCollectionInput, UpdateCollectionSchema, type UpdateCollectionToolInput, UpdateCollectionToolSchema };