librechat-data-provider 0.8.402 → 0.8.404

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