librechat-data-provider 0.8.401 → 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 (109) hide show
  1. package/dist/index.es.js +1 -1
  2. package/dist/index.es.js.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/react-query/index.es.js +1 -1
  6. package/dist/react-query/index.es.js.map +1 -1
  7. package/dist/types/accessPermissions.d.ts +744 -0
  8. package/dist/types/actions.d.ts +118 -0
  9. package/dist/types/api-endpoints.d.ts +149 -0
  10. package/dist/types/artifacts.d.ts +97 -0
  11. package/dist/types/azure.d.ts +22 -0
  12. package/dist/types/bedrock.d.ts +1220 -0
  13. package/dist/types/config.d.ts +13916 -0
  14. package/dist/types/config.spec.d.ts +1 -0
  15. package/dist/types/createPayload.d.ts +5 -0
  16. package/dist/types/data-service.d.ts +284 -0
  17. package/dist/types/feedback.d.ts +36 -0
  18. package/dist/types/file-config.d.ts +263 -0
  19. package/dist/types/file-config.spec.d.ts +1 -0
  20. package/dist/types/generate.d.ts +597 -0
  21. package/dist/types/headers-helpers.d.ts +2 -0
  22. package/{src/index.ts → dist/types/index.d.ts} +0 -15
  23. package/dist/types/keys.d.ts +92 -0
  24. package/dist/types/mcp.d.ts +2760 -0
  25. package/dist/types/messages.d.ts +10 -0
  26. package/dist/types/models.d.ts +1677 -0
  27. package/dist/types/parameterSettings.d.ts +69 -0
  28. package/dist/types/parsers.d.ts +110 -0
  29. package/dist/types/permissions.d.ts +522 -0
  30. package/dist/types/react-query/react-query-service.d.ts +85 -0
  31. package/dist/types/request.d.ts +25 -0
  32. package/dist/types/roles.d.ts +554 -0
  33. package/dist/types/roles.spec.d.ts +1 -0
  34. package/dist/types/schemas.d.ts +4815 -0
  35. package/dist/types/schemas.spec.d.ts +1 -0
  36. package/dist/types/types/agents.d.ts +433 -0
  37. package/dist/types/types/assistants.d.ts +547 -0
  38. package/dist/types/types/files.d.ts +172 -0
  39. package/dist/types/types/graph.d.ts +135 -0
  40. package/{src/types/mcpServers.ts → dist/types/types/mcpServers.d.ts} +12 -18
  41. package/dist/types/types/mutations.d.ts +209 -0
  42. package/dist/types/types/queries.d.ts +169 -0
  43. package/dist/types/types/runs.d.ts +36 -0
  44. package/dist/types/types/web.d.ts +520 -0
  45. package/dist/types/types.d.ts +503 -0
  46. package/dist/types/utils.d.ts +12 -0
  47. package/package.json +4 -1
  48. package/babel.config.js +0 -4
  49. package/check_updates.sh +0 -52
  50. package/jest.config.js +0 -19
  51. package/react-query/package-lock.json +0 -292
  52. package/react-query/package.json +0 -10
  53. package/rollup.config.js +0 -74
  54. package/server-rollup.config.js +0 -40
  55. package/specs/actions.spec.ts +0 -2533
  56. package/specs/api-endpoints-subdir.spec.ts +0 -140
  57. package/specs/api-endpoints.spec.ts +0 -74
  58. package/specs/azure.spec.ts +0 -844
  59. package/specs/bedrock.spec.ts +0 -862
  60. package/specs/filetypes.spec.ts +0 -175
  61. package/specs/generate.spec.ts +0 -770
  62. package/specs/headers-helpers.spec.ts +0 -24
  63. package/specs/mcp.spec.ts +0 -147
  64. package/specs/openapiSpecs.ts +0 -524
  65. package/specs/parsers.spec.ts +0 -601
  66. package/specs/request-interceptor.spec.ts +0 -304
  67. package/specs/utils.spec.ts +0 -196
  68. package/src/accessPermissions.ts +0 -346
  69. package/src/actions.ts +0 -813
  70. package/src/api-endpoints.ts +0 -440
  71. package/src/artifacts.ts +0 -3104
  72. package/src/azure.ts +0 -328
  73. package/src/bedrock.ts +0 -425
  74. package/src/config.spec.ts +0 -315
  75. package/src/config.ts +0 -1978
  76. package/src/createPayload.ts +0 -46
  77. package/src/data-service.ts +0 -1087
  78. package/src/feedback.ts +0 -141
  79. package/src/file-config.spec.ts +0 -1248
  80. package/src/file-config.ts +0 -764
  81. package/src/generate.ts +0 -634
  82. package/src/headers-helpers.ts +0 -13
  83. package/src/keys.ts +0 -99
  84. package/src/mcp.ts +0 -271
  85. package/src/messages.ts +0 -50
  86. package/src/models.ts +0 -69
  87. package/src/parameterSettings.ts +0 -1111
  88. package/src/parsers.ts +0 -563
  89. package/src/permissions.ts +0 -188
  90. package/src/react-query/react-query-service.ts +0 -566
  91. package/src/request.ts +0 -171
  92. package/src/roles.spec.ts +0 -132
  93. package/src/roles.ts +0 -225
  94. package/src/schemas.spec.ts +0 -355
  95. package/src/schemas.ts +0 -1225
  96. package/src/types/agents.ts +0 -445
  97. package/src/types/assistants.ts +0 -644
  98. package/src/types/files.ts +0 -191
  99. package/src/types/graph.ts +0 -145
  100. package/src/types/mutations.ts +0 -422
  101. package/src/types/queries.ts +0 -208
  102. package/src/types/runs.ts +0 -26
  103. package/src/types/web.ts +0 -588
  104. package/src/types.ts +0 -679
  105. package/src/utils.ts +0 -85
  106. package/tsconfig.json +0 -28
  107. package/tsconfig.spec.json +0 -10
  108. /package/{src/react-query/index.ts → dist/types/react-query/index.d.ts} +0 -0
  109. /package/{src/types/index.ts → dist/types/types/index.d.ts} +0 -0
@@ -1,445 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-namespace */
2
- import { StepTypes, ContentTypes, ToolCallTypes } from './runs';
3
- import type { TAttachment, TPlugin } from 'src/schemas';
4
- import type { FunctionToolCall } from './assistants';
5
-
6
- export namespace Agents {
7
- export type MessageType = 'human' | 'ai' | 'generic' | 'system' | 'function' | 'tool' | 'remove';
8
-
9
- export type ImageDetail = 'auto' | 'low' | 'high';
10
-
11
- export type ReasoningContentText = {
12
- type: ContentTypes.THINK;
13
- think: string;
14
- };
15
-
16
- export type MessageContentText = {
17
- type: ContentTypes.TEXT;
18
- text: string;
19
- tool_call_ids?: string[];
20
- };
21
-
22
- export type AgentUpdate = {
23
- type: ContentTypes.AGENT_UPDATE;
24
- agent_update: {
25
- index: number;
26
- runId: string;
27
- agentId: string;
28
- };
29
- };
30
-
31
- export type MessageContentImageUrl = {
32
- type: ContentTypes.IMAGE_URL;
33
- image_url: string | { url: string; detail?: ImageDetail };
34
- };
35
-
36
- export type MessageContentVideoUrl = {
37
- type: ContentTypes.VIDEO_URL;
38
- video_url: { url: string };
39
- };
40
-
41
- export type MessageContentInputAudio = {
42
- type: ContentTypes.INPUT_AUDIO;
43
- input_audio: {
44
- data: string;
45
- format: string;
46
- };
47
- };
48
-
49
- export type MessageContentComplex =
50
- | ReasoningContentText
51
- | AgentUpdate
52
- | MessageContentText
53
- | MessageContentImageUrl
54
- | MessageContentVideoUrl
55
- | MessageContentInputAudio
56
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
- | (Record<string, any> & { type?: ContentTypes | string })
58
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
59
- | (Record<string, any> & { type?: never });
60
-
61
- export type MessageContent = string | MessageContentComplex[];
62
-
63
- /**
64
- * A call to a tool.
65
- */
66
- export type ToolCall = {
67
- /** Type ("tool_call") according to Assistants Tool Call Structure */
68
- type: ToolCallTypes.TOOL_CALL;
69
- /** The name of the tool to be called */
70
- name: string;
71
-
72
- /** The arguments to the tool call */
73
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
74
- args?: string | Record<string, any>;
75
-
76
- /** If provided, an identifier associated with the tool call */
77
- id?: string;
78
- /** If provided, the output of the tool call */
79
- output?: string;
80
- /** Auth URL */
81
- auth?: string;
82
- /** Expiration time */
83
- expires_at?: number;
84
- };
85
-
86
- export type ToolEndEvent = {
87
- /** The Step Id of the Tool Call */
88
- id: string;
89
- /** The Completed Tool Call */
90
- tool_call?: ToolCall;
91
- /** The content index of the tool call */
92
- index: number;
93
- };
94
-
95
- export type ToolCallContent = {
96
- type: ContentTypes.TOOL_CALL;
97
- tool_call?: ToolCall;
98
- };
99
-
100
- /**
101
- * A chunk of a tool call (e.g., as part of a stream).
102
- * When merging ToolCallChunks (e.g., via AIMessageChunk.__add__),
103
- * all string attributes are concatenated. Chunks are only merged if their
104
- * values of `index` are equal and not None.
105
- *
106
- * @example
107
- * ```ts
108
- * const leftChunks = [
109
- * {
110
- * name: "foo",
111
- * args: '{"a":',
112
- * index: 0
113
- * }
114
- * ];
115
- *
116
- * const leftAIMessageChunk = new AIMessageChunk({
117
- * content: "",
118
- * tool_call_chunks: leftChunks
119
- * });
120
- *
121
- * const rightChunks = [
122
- * {
123
- * name: undefined,
124
- * args: '1}',
125
- * index: 0
126
- * }
127
- * ];
128
- *
129
- * const rightAIMessageChunk = new AIMessageChunk({
130
- * content: "",
131
- * tool_call_chunks: rightChunks
132
- * });
133
- *
134
- * const result = leftAIMessageChunk.concat(rightAIMessageChunk);
135
- * // result.tool_call_chunks is equal to:
136
- * // [
137
- * // {
138
- * // name: "foo",
139
- * // args: '{"a":1}'
140
- * // index: 0
141
- * // }
142
- * // ]
143
- * ```
144
- *
145
- * @property {string} [name] - If provided, a substring of the name of the tool to be called
146
- * @property {string} [args] - If provided, a JSON substring of the arguments to the tool call
147
- * @property {string} [id] - If provided, a substring of an identifier for the tool call
148
- * @property {number} [index] - If provided, the index of the tool call in a sequence
149
- */
150
- export type ToolCallChunk = {
151
- name?: string;
152
-
153
- args?: string;
154
-
155
- id?: string;
156
-
157
- index?: number;
158
-
159
- type?: 'tool_call_chunk';
160
- };
161
-
162
- /** Event names are of the format: on_[runnable_type]_(start|stream|end).
163
-
164
- Runnable types are one of:
165
-
166
- llm - used by non chat models
167
- chat_model - used by chat models
168
- prompt -- e.g., ChatPromptTemplate
169
- tool -- LangChain tools
170
- chain - most Runnables are of this type
171
- Further, the events are categorized as one of:
172
-
173
- start - when the runnable starts
174
- stream - when the runnable is streaming
175
- end - when the runnable ends
176
- start, stream and end are associated with slightly different data payload.
177
-
178
- Please see the documentation for EventData for more details. */
179
- export type EventName = string;
180
- export type RunStep = {
181
- type: StepTypes;
182
- id: string; // #new
183
- runId?: string; // #new
184
- agentId?: string; // #new
185
- index: number; // #new
186
- stepIndex?: number; // #new
187
- /** Group ID for parallel content - parts with same groupId are displayed in columns */
188
- groupId?: number; // #new
189
- stepDetails: StepDetails;
190
- usage: null | object;
191
- };
192
-
193
- /** Content part for aggregated message content */
194
- export interface ContentPart {
195
- type: string;
196
- text?: string;
197
- [key: string]: unknown;
198
- }
199
-
200
- /** User message metadata for rebuilding submission on reconnect */
201
- export interface UserMessageMeta {
202
- messageId: string;
203
- parentMessageId?: string;
204
- conversationId?: string;
205
- text?: string;
206
- }
207
-
208
- /** State data sent to reconnecting clients */
209
- export interface ResumeState {
210
- runSteps: RunStep[];
211
- /** Aggregated content parts - can be MessageContentComplex[] or ContentPart[] */
212
- aggregatedContent?: MessageContentComplex[];
213
- userMessage?: UserMessageMeta;
214
- responseMessageId?: string;
215
- conversationId?: string;
216
- sender?: string;
217
- }
218
- /**
219
- * Represents a run step delta i.e. any changed fields on a run step during
220
- * streaming.
221
- */
222
- export interface RunStepDeltaEvent {
223
- /**
224
- * The identifier of the run step, which can be referenced in API endpoints.
225
- */
226
- id: string;
227
- /**
228
- * The delta containing the fields that have changed on the run step.
229
- */
230
- delta: ToolCallDelta;
231
- }
232
- export type StepDetails = MessageCreationDetails | ToolCallsDetails;
233
- export type MessageCreationDetails = {
234
- type: StepTypes.MESSAGE_CREATION;
235
- message_creation: {
236
- message_id: string;
237
- };
238
- };
239
- export type ToolCallsDetails = {
240
- type: StepTypes.TOOL_CALLS;
241
- tool_calls: AgentToolCall[];
242
- };
243
- export type ToolCallDelta = {
244
- type: StepTypes.TOOL_CALLS | string;
245
- tool_calls?: ToolCallChunk[];
246
- auth?: string;
247
- expires_at?: number;
248
- };
249
- export type AgentToolCall = FunctionToolCall | ToolCall;
250
- export interface ExtendedMessageContent {
251
- type?: string;
252
- text?: string;
253
- input?: string;
254
- index?: number;
255
- id?: string;
256
- name?: string;
257
- }
258
- /**
259
- * Represents a message delta i.e. any changed fields on a message during
260
- * streaming.
261
- */
262
- export interface MessageDeltaEvent {
263
- /**
264
- * The identifier of the message, which can be referenced in API endpoints.
265
- */
266
- id: string;
267
- /**
268
- * The delta containing the fields that have changed on the Message.
269
- */
270
- delta: MessageDelta;
271
- }
272
- /**
273
- * The delta containing the fields that have changed on the Message.
274
- */
275
- export interface MessageDelta {
276
- /**
277
- * The content of the message in array of text and/or images.
278
- */
279
- content?: Agents.MessageContentComplex[];
280
- }
281
-
282
- /**
283
- * Represents a reasoning delta i.e. any changed fields on a message during
284
- * streaming.
285
- */
286
- export interface ReasoningDeltaEvent {
287
- /**
288
- * The identifier of the message, which can be referenced in API endpoints.
289
- */
290
- id: string;
291
-
292
- /**
293
- * The delta containing the fields that have changed.
294
- */
295
- delta: ReasoningDelta;
296
- }
297
-
298
- /**
299
- * The reasoning delta containing the fields that have changed on the Message.
300
- */
301
- export interface ReasoningDelta {
302
- /**
303
- * The content of the message in array of text and/or images.
304
- */
305
- content?: MessageContentComplex[];
306
- }
307
-
308
- export type ReasoningDeltaUpdate = { type: ContentTypes.THINK; think: string };
309
- export type ContentType =
310
- | ContentTypes.THINK
311
- | ContentTypes.TEXT
312
- | ContentTypes.IMAGE_URL
313
- | ContentTypes.VIDEO_URL
314
- | ContentTypes.INPUT_AUDIO
315
- | string;
316
- }
317
-
318
- export type ToolCallResult = {
319
- user: string;
320
- toolId: string;
321
- result?: unknown;
322
- messageId: string;
323
- partIndex?: number;
324
- blockIndex?: number;
325
- conversationId: string;
326
- attachments?: TAttachment[];
327
- };
328
-
329
- export enum AuthTypeEnum {
330
- ServiceHttp = 'service_http',
331
- OAuth = 'oauth',
332
- None = 'none',
333
- }
334
-
335
- export enum AuthorizationTypeEnum {
336
- Bearer = 'bearer',
337
- Basic = 'basic',
338
- Custom = 'custom',
339
- }
340
-
341
- export enum TokenExchangeMethodEnum {
342
- DefaultPost = 'default_post',
343
- BasicAuthHeader = 'basic_auth_header',
344
- }
345
-
346
- export type Action = {
347
- action_id: string;
348
- type?: string;
349
- settings?: Record<string, unknown>;
350
- metadata: ActionMetadata;
351
- version: number | string;
352
- } & ({ assistant_id: string; agent_id?: never } | { assistant_id?: never; agent_id: string });
353
-
354
- export type ActionMetadata = {
355
- api_key?: string;
356
- auth?: ActionAuth;
357
- domain?: string;
358
- privacy_policy_url?: string;
359
- raw_spec?: string;
360
- oauth_client_id?: string;
361
- oauth_client_secret?: string;
362
- };
363
-
364
- export type ActionAuth = {
365
- authorization_type?: AuthorizationTypeEnum;
366
- custom_auth_header?: string;
367
- type?: AuthTypeEnum;
368
- authorization_content_type?: string;
369
- authorization_url?: string;
370
- client_url?: string;
371
- scope?: string;
372
- token_exchange_method?: TokenExchangeMethodEnum;
373
- };
374
-
375
- export type ActionMetadataRuntime = ActionMetadata & {
376
- oauth_access_token?: string;
377
- oauth_refresh_token?: string;
378
- oauth_token_expires_at?: Date;
379
- };
380
-
381
- export type MCP = {
382
- serverName: string;
383
- metadata: MCPMetadata;
384
- } & ({ assistant_id: string; agent_id?: never } | { assistant_id?: never; agent_id?: string });
385
-
386
- export type MCPMetadata = Omit<ActionMetadata, 'auth'> & {
387
- name?: string;
388
- description?: string;
389
- url?: string;
390
- tools?: string[];
391
- auth?: MCPAuth;
392
- icon?: string;
393
- trust?: boolean;
394
- };
395
-
396
- export type MCPAuth = ActionAuth;
397
-
398
- export type AgentToolType = {
399
- tool_id: string;
400
- metadata: ToolMetadata;
401
- } & ({ assistant_id: string; agent_id?: never } | { assistant_id?: never; agent_id?: string });
402
-
403
- export type ToolMetadata = TPlugin;
404
-
405
- export interface BaseMessage {
406
- content: string;
407
- role?: string;
408
- [key: string]: unknown;
409
- }
410
-
411
- export interface BaseGraphState {
412
- [key: string]: unknown;
413
- }
414
-
415
- export type GraphEdge = {
416
- /** Agent ID, use a list for multiple sources */
417
- from: string | string[];
418
- /** Agent ID, use a list for multiple destinations */
419
- to: string | string[];
420
- description?: string;
421
- /** Can return boolean or specific destination(s) */
422
- condition?: (state: BaseGraphState) => boolean | string | string[];
423
- /** 'handoff' creates tools for dynamic routing, 'direct' creates direct edges, which also allow parallel execution */
424
- edgeType?: 'handoff' | 'direct';
425
- /**
426
- * For direct edges: Optional prompt to add when transitioning through this edge.
427
- * String prompts can include variables like {results} which will be replaced with
428
- * messages from startIndex onwards. When {results} is used, excludeResults defaults to true.
429
- *
430
- * For handoff edges: Description for the input parameter that the handoff tool accepts,
431
- * allowing the supervisor to pass specific instructions/context to the transferred agent.
432
- */
433
- prompt?: string | ((messages: BaseMessage[], runStartIndex: number) => string | undefined);
434
- /**
435
- * When true, excludes messages from startIndex when adding prompt.
436
- * Automatically set to true when {results} variable is used in prompt.
437
- */
438
- excludeResults?: boolean;
439
- /**
440
- * For handoff edges: Customizes the parameter name for the handoff input.
441
- * Defaults to "instructions" if not specified.
442
- * Only applies when prompt is provided for handoff edges.
443
- */
444
- promptKey?: string;
445
- };