librechat-data-provider 0.8.509 → 0.8.522
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/dist/{data-service-BsdHkdKS.mjs → data-service-CaB7saTP.mjs} +2175 -113
- package/dist/data-service-CaB7saTP.mjs.map +1 -0
- package/dist/{data-service-XTxx76uB.js → data-service-D5kHzBt-.js} +2806 -150
- package/dist/data-service-D5kHzBt-.js.map +1 -0
- package/dist/index.js +1403 -92
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1248 -93
- package/dist/index.mjs.map +1 -1
- package/dist/react-query/index.js +2 -1
- package/dist/react-query/index.js.map +1 -1
- package/dist/react-query/index.mjs +2 -1
- package/dist/react-query/index.mjs.map +1 -1
- package/dist/types/accessPermissions.d.ts +4 -0
- package/dist/types/actions.d.ts +3 -3
- package/dist/types/agentToolOptions.d.ts +11 -0
- package/dist/types/api-endpoints.d.ts +28 -2
- package/dist/types/bedrock.d.ts +220 -0
- package/dist/types/cadence.d.ts +33 -0
- package/dist/types/codeEnvRef.d.ts +21 -0
- package/dist/types/config.d.ts +13457 -1573
- package/dist/types/data-service.d.ts +65 -14
- package/dist/types/feedback.d.ts +9 -1
- package/dist/types/file-config.d.ts +42 -5
- package/dist/types/filters.d.ts +1422 -0
- package/dist/types/generate.d.ts +85 -1
- package/dist/types/index.d.ts +10 -0
- package/dist/types/keys.d.ts +29 -4
- package/dist/types/langchain.d.ts +4 -0
- package/dist/types/limits.d.ts +13 -0
- package/dist/types/mcp.d.ts +338 -228
- package/dist/types/messages.d.ts +13 -0
- package/dist/types/models.d.ts +840 -68
- package/dist/types/parameterSettings.d.ts +7 -3
- package/dist/types/parsers.d.ts +13 -1
- package/dist/types/permissions.d.ts +42 -1
- package/dist/types/providers.d.ts +36 -0
- package/dist/types/react-query/react-query-service.d.ts +2 -7
- package/dist/types/request.d.ts +4 -2
- package/dist/types/roles.d.ts +34 -0
- package/dist/types/runSteps.d.ts +59 -0
- package/dist/types/schemas.d.ts +1358 -34
- package/dist/types/stateful-code.d.ts +7 -0
- package/dist/types/types/agents.d.ts +303 -8
- package/dist/types/types/assistants.d.ts +170 -7
- package/dist/types/types/files.d.ts +29 -8
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/insights.d.ts +62 -0
- package/dist/types/types/mcpServers.d.ts +25 -0
- package/dist/types/types/mutations.d.ts +2 -0
- package/dist/types/types/queries.d.ts +47 -5
- package/dist/types/types/queuedTurns.d.ts +870 -0
- package/dist/types/types/runs.d.ts +206 -26
- package/dist/types/types/schedules.d.ts +306 -0
- package/dist/types/types/skills.d.ts +34 -6
- package/dist/types/types/subagents.d.ts +159 -0
- package/dist/types/types/web.d.ts +12 -2
- package/dist/types/types.d.ts +175 -2
- package/dist/types/upload.d.ts +2 -0
- package/package.json +7 -5
- package/dist/data-service-BsdHkdKS.mjs.map +0 -1
- package/dist/data-service-XTxx76uB.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { CodeEnvRef, CodeEnvRefMap } from '../codeEnvRef';
|
|
1
2
|
import { EToolResources } from './assistants';
|
|
2
|
-
import type { CodeEnvRef } from '../codeEnvRef';
|
|
3
3
|
export declare enum FileSources {
|
|
4
4
|
local = "local",
|
|
5
5
|
firebase = "firebase",
|
|
@@ -34,12 +34,16 @@ export declare enum FileContext {
|
|
|
34
34
|
context = "context",
|
|
35
35
|
bytes = "bytes"
|
|
36
36
|
}
|
|
37
|
+
/** Structural type for a compiled matcher: a native `RegExp` or a linear-time engine both satisfy it. Only `test` is ever called on `supportedMimeTypes`. */
|
|
38
|
+
export type RegexLike = {
|
|
39
|
+
test(input: string): boolean;
|
|
40
|
+
};
|
|
37
41
|
export type EndpointFileConfig = {
|
|
38
42
|
disabled?: boolean;
|
|
39
43
|
fileLimit?: number;
|
|
40
44
|
fileSizeLimit?: number;
|
|
41
45
|
totalSizeLimit?: number;
|
|
42
|
-
supportedMimeTypes?:
|
|
46
|
+
supportedMimeTypes?: RegexLike[];
|
|
43
47
|
};
|
|
44
48
|
export type FileConfig = {
|
|
45
49
|
endpoints: {
|
|
@@ -56,17 +60,19 @@ export type FileConfig = {
|
|
|
56
60
|
maxWidth?: number;
|
|
57
61
|
maxHeight?: number;
|
|
58
62
|
quality?: number;
|
|
63
|
+
/** Set when `enabled` came from the admin config, in which case it wins over the user's setting */
|
|
64
|
+
enforced?: boolean;
|
|
59
65
|
};
|
|
60
66
|
ocr?: {
|
|
61
|
-
supportedMimeTypes?:
|
|
67
|
+
supportedMimeTypes?: RegexLike[];
|
|
62
68
|
};
|
|
63
69
|
text?: {
|
|
64
|
-
supportedMimeTypes?:
|
|
70
|
+
supportedMimeTypes?: RegexLike[];
|
|
65
71
|
};
|
|
66
72
|
stt?: {
|
|
67
|
-
supportedMimeTypes?:
|
|
73
|
+
supportedMimeTypes?: RegexLike[];
|
|
68
74
|
};
|
|
69
|
-
checkType?: (fileType: string, supportedTypes:
|
|
75
|
+
checkType?: (fileType: string, supportedTypes: RegexLike[]) => boolean;
|
|
70
76
|
};
|
|
71
77
|
export type FileConfigInput = {
|
|
72
78
|
endpoints?: {
|
|
@@ -92,7 +98,7 @@ export type FileConfigInput = {
|
|
|
92
98
|
stt?: {
|
|
93
99
|
supportedMimeTypes?: string[];
|
|
94
100
|
};
|
|
95
|
-
checkType?: (fileType: string, supportedTypes:
|
|
101
|
+
checkType?: (fileType: string, supportedTypes: RegexLike[]) => boolean;
|
|
96
102
|
};
|
|
97
103
|
export type TFile = {
|
|
98
104
|
_id?: string;
|
|
@@ -151,6 +157,9 @@ export type TFile = {
|
|
|
151
157
|
* resolve via `resolveCodeEnvRef`.
|
|
152
158
|
*/
|
|
153
159
|
codeEnvRef?: CodeEnvRef;
|
|
160
|
+
codeEnvRefs?: CodeEnvRefMap;
|
|
161
|
+
/** Dispatch-order stamp for the current source artifact generation. */
|
|
162
|
+
sourceDispatchedAt?: number;
|
|
154
163
|
};
|
|
155
164
|
createdAt?: string | Date;
|
|
156
165
|
updatedAt?: string | Date;
|
|
@@ -217,9 +226,18 @@ export type VoiceOptions = {
|
|
|
217
226
|
onMutate?: () => void | Promise<unknown>;
|
|
218
227
|
onError?: (error: unknown, variables: unknown, context?: unknown) => void;
|
|
219
228
|
};
|
|
229
|
+
export type TFilesUsageBody = {
|
|
230
|
+
file_ids: string[];
|
|
231
|
+
};
|
|
232
|
+
export type TFilesUsageResponse = {
|
|
233
|
+
/** Count of queued uploads whose TTL hold was extended. */
|
|
234
|
+
held: number;
|
|
235
|
+
};
|
|
220
236
|
export type DeleteFilesResponse = {
|
|
221
237
|
message: string;
|
|
222
|
-
result
|
|
238
|
+
result?: Record<string, unknown>;
|
|
239
|
+
deletedFileIds?: string[];
|
|
240
|
+
failedFileIds?: string[];
|
|
223
241
|
};
|
|
224
242
|
export type BatchFile = {
|
|
225
243
|
file_id: string;
|
|
@@ -240,4 +258,7 @@ export type DeleteMutationOptions = {
|
|
|
240
258
|
onSuccess?: (data: DeleteFilesResponse, variables: DeleteFilesBody, context?: unknown) => void;
|
|
241
259
|
onMutate?: (variables: DeleteFilesBody) => void | Promise<unknown>;
|
|
242
260
|
onError?: (error: unknown, variables: DeleteFilesBody, context?: unknown) => void;
|
|
261
|
+
/** Suppresses the result toasts. Background cleanup runs on a timer the user never asked for,
|
|
262
|
+
* and a storage failure that keeps failing would otherwise announce itself on every retry. */
|
|
263
|
+
silent?: boolean;
|
|
243
264
|
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export type InsightsRange = '24h' | '7d' | '30d' | 'custom';
|
|
2
|
+
export declare const INSIGHTS_MAX_RANGE_DAYS = 30;
|
|
3
|
+
export declare const INSIGHTS_SEARCH_MIN_LENGTH = 3;
|
|
4
|
+
export declare const INSIGHTS_SEARCH_MAX_LENGTH = 200;
|
|
5
|
+
export type TInsightsParams = {
|
|
6
|
+
range?: InsightsRange;
|
|
7
|
+
fromTimestamp?: string;
|
|
8
|
+
toTimestamp?: string;
|
|
9
|
+
timeZone?: string;
|
|
10
|
+
search?: string;
|
|
11
|
+
page?: number;
|
|
12
|
+
pageSize?: number;
|
|
13
|
+
};
|
|
14
|
+
export type TInsightsDailyPoint = {
|
|
15
|
+
date: string;
|
|
16
|
+
conversations: number;
|
|
17
|
+
users: number;
|
|
18
|
+
messages: number;
|
|
19
|
+
totalTokens: number;
|
|
20
|
+
};
|
|
21
|
+
export type TInsightsUser = {
|
|
22
|
+
userId: string;
|
|
23
|
+
name: string;
|
|
24
|
+
email: string;
|
|
25
|
+
conversations: number;
|
|
26
|
+
messages: number;
|
|
27
|
+
};
|
|
28
|
+
export type TInsightsChurnedUser = TInsightsUser & {
|
|
29
|
+
firstSeen: string;
|
|
30
|
+
lastSeen: string;
|
|
31
|
+
};
|
|
32
|
+
export type TInsightsConversation = {
|
|
33
|
+
conversationId: string;
|
|
34
|
+
date: string;
|
|
35
|
+
userId: string;
|
|
36
|
+
name: string;
|
|
37
|
+
email: string;
|
|
38
|
+
firstMessage: string;
|
|
39
|
+
messages: number;
|
|
40
|
+
totalTokens: number;
|
|
41
|
+
};
|
|
42
|
+
export type TInsightsSummary = {
|
|
43
|
+
totalUsers: number;
|
|
44
|
+
totalConversations: number;
|
|
45
|
+
totalMessages: number;
|
|
46
|
+
totalTokens: number;
|
|
47
|
+
};
|
|
48
|
+
export type TInsightsResponse = {
|
|
49
|
+
summary: TInsightsSummary;
|
|
50
|
+
daily: TInsightsDailyPoint[];
|
|
51
|
+
topUsers: TInsightsUser[];
|
|
52
|
+
churnedUsers: TInsightsChurnedUser[];
|
|
53
|
+
latest: {
|
|
54
|
+
conversations: TInsightsConversation[];
|
|
55
|
+
page: number;
|
|
56
|
+
pageSize: number;
|
|
57
|
+
pages: number;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export type TInsightsAccessResponse = {
|
|
61
|
+
access: boolean;
|
|
62
|
+
};
|
|
@@ -39,5 +39,30 @@ export type MCPServerDBObjectResponse = {
|
|
|
39
39
|
serverName: string;
|
|
40
40
|
/** True if access is only via agent (not directly shared with user) */
|
|
41
41
|
consumeOnly?: boolean;
|
|
42
|
+
/** True when chat request fields are required before the server can connect. */
|
|
43
|
+
requestScoped?: boolean;
|
|
42
44
|
} & MCPOptions;
|
|
43
45
|
export type MCPServersListResponse = Record<string, MCPServerDBObjectResponse>;
|
|
46
|
+
export type MCPReinitializeFailureReason = 'unreachable' | 'missing_custom_user_vars' | 'oauth_required' | 'initialization_failed';
|
|
47
|
+
export interface MCPReinitializeResponse {
|
|
48
|
+
success: boolean;
|
|
49
|
+
message: string;
|
|
50
|
+
serverName: string;
|
|
51
|
+
oauthRequired?: boolean;
|
|
52
|
+
oauthUrl?: string | null;
|
|
53
|
+
/** Shared OAuth attempt identifier used to poll durable flow state. */
|
|
54
|
+
flowId?: string;
|
|
55
|
+
/** Remaining OAuth completion window for this attempt, in milliseconds. */
|
|
56
|
+
oauthTimeout?: number;
|
|
57
|
+
failureReason?: MCPReinitializeFailureReason;
|
|
58
|
+
missingUserVars?: string[];
|
|
59
|
+
/** True when the server uses request-scoped placeholders and the connection
|
|
60
|
+
* was deferred to the next chat turn (tools are not enumerable up front). */
|
|
61
|
+
connectionDeferred?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface MCPOAuthStatusResponse {
|
|
64
|
+
status: 'PENDING' | 'COMPLETED' | 'FAILED';
|
|
65
|
+
completed: boolean;
|
|
66
|
+
failed: boolean;
|
|
67
|
+
error?: string;
|
|
68
|
+
}
|
|
@@ -114,10 +114,12 @@ export type ArchiveConversationOptions = MutationOptions<types.TArchiveConversat
|
|
|
114
114
|
export type PinConversationOptions = MutationOptions<types.TPinConversationResponse, types.TPinConversationRequest>;
|
|
115
115
|
export type DuplicateConvoOptions = MutationOptions<types.TDuplicateConvoResponse, types.TDuplicateConvoRequest>;
|
|
116
116
|
export type ForkConvoOptions = MutationOptions<types.TForkConvoResponse, types.TForkConvoRequest>;
|
|
117
|
+
export type ForkSharedConvoOptions = MutationOptions<types.TForkConvoResponse, types.TForkSharedConvoRequest>;
|
|
117
118
|
export type CreateSharedLinkOptions = MutationOptions<types.TSharedLink, Partial<types.TSharedLink>>;
|
|
118
119
|
export type updateTagsInConvoOptions = MutationOptions<types.TTagConversationResponse, types.TTagConversationRequest>;
|
|
119
120
|
export type UpdateSharedLinkOptions = MutationOptions<types.TSharedLink, Partial<types.TSharedLink>>;
|
|
120
121
|
export type ArchiveConvoOptions = MutationOptions<types.TArchiveConversationResponse, types.TArchiveConversationRequest>;
|
|
122
|
+
export type ArchiveAllConversationsOptions = MutationOptions<types.TArchiveAllConversationsResponse, void>;
|
|
121
123
|
export type DeleteSharedLinkContext = {
|
|
122
124
|
previousQueries?: Map<string, TDeleteSharedLinkResponse>;
|
|
123
125
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { InfiniteData } from '@tanstack/react-query';
|
|
2
|
+
import type { RerankerTypes, SearchProviders, ScraperProviders } from '../config';
|
|
2
3
|
import type * as p from '../accessPermissions';
|
|
3
4
|
import type * as a from '../types/agents';
|
|
4
5
|
import type * as s from '../schemas';
|
|
@@ -12,14 +13,16 @@ export type Conversation = {
|
|
|
12
13
|
};
|
|
13
14
|
export type ConversationListParams = {
|
|
14
15
|
cursor?: string;
|
|
16
|
+
limit?: number;
|
|
15
17
|
isArchived?: boolean;
|
|
16
|
-
|
|
18
|
+
pinned?: boolean;
|
|
19
|
+
sortBy?: 'title' | 'createdAt' | 'updatedAt' | 'archivedAt';
|
|
17
20
|
sortDirection?: 'asc' | 'desc';
|
|
18
21
|
tags?: string[];
|
|
19
22
|
search?: string;
|
|
20
23
|
projectId?: string;
|
|
21
24
|
};
|
|
22
|
-
export type MinimalConversation = Pick<s.TConversation, 'conversationId' | 'endpoint' | 'title' | 'createdAt' | 'updatedAt' | 'user' | 'chatProjectId'>;
|
|
25
|
+
export type MinimalConversation = Pick<s.TConversation, 'conversationId' | 'endpoint' | 'title' | 'createdAt' | 'updatedAt' | 'archivedAt' | 'user' | 'chatProjectId' | 'pinned'>;
|
|
23
26
|
export type ConversationListResponse = {
|
|
24
27
|
conversations: MinimalConversation[];
|
|
25
28
|
nextCursor: string | null;
|
|
@@ -64,7 +67,7 @@ export interface SharedLinksListParams {
|
|
|
64
67
|
export type SharedLinkItem = {
|
|
65
68
|
shareId: string;
|
|
66
69
|
title: string;
|
|
67
|
-
createdAt:
|
|
70
|
+
createdAt: string;
|
|
68
71
|
conversationId: string;
|
|
69
72
|
};
|
|
70
73
|
export interface SharedLinksResponse {
|
|
@@ -92,6 +95,9 @@ export type MCPTool = {
|
|
|
92
95
|
name: string;
|
|
93
96
|
pluginKey: string;
|
|
94
97
|
description: string;
|
|
98
|
+
/** Raw upstream tool name when the model-facing key stripped a redundant
|
|
99
|
+
* server-name prefix — gates the agent editor's legacy id migration. */
|
|
100
|
+
serverToolName?: string;
|
|
95
101
|
};
|
|
96
102
|
export type MCPServer = {
|
|
97
103
|
name: string;
|
|
@@ -110,16 +116,29 @@ export type VerifyToolAuthResponse = {
|
|
|
110
116
|
authenticated: boolean;
|
|
111
117
|
message?: string | s.AuthType;
|
|
112
118
|
authTypes?: [string, s.AuthType][];
|
|
119
|
+
searchProvider?: SearchProviders;
|
|
120
|
+
scraperProvider?: ScraperProviders;
|
|
121
|
+
rerankerType?: RerankerTypes;
|
|
113
122
|
};
|
|
114
123
|
export type GetToolCallParams = {
|
|
115
124
|
conversationId: string;
|
|
116
125
|
};
|
|
117
126
|
export type ToolCallResults = a.ToolCallResult[];
|
|
118
127
|
export type TUserMemory = {
|
|
128
|
+
/** Stable stored record identifier retained when content fields are redacted. */
|
|
129
|
+
_id?: string;
|
|
119
130
|
key: string;
|
|
120
131
|
value: string;
|
|
132
|
+
/** Optional generated or legacy summary content. */
|
|
133
|
+
summary?: string;
|
|
121
134
|
updated_at: string;
|
|
122
135
|
tokenCount?: number;
|
|
136
|
+
/** Agent partition this memory belongs to; absent = shared personal pool */
|
|
137
|
+
agentId?: string;
|
|
138
|
+
/** Display name of the partition's agent, resolved server-side when available */
|
|
139
|
+
agentName?: string;
|
|
140
|
+
/** Current policy removed one or more memory content fields from this response. */
|
|
141
|
+
contentFilterBlocked?: boolean;
|
|
123
142
|
};
|
|
124
143
|
export type MemoriesResponse = {
|
|
125
144
|
memories: TUserMemory[];
|
|
@@ -127,6 +146,13 @@ export type MemoriesResponse = {
|
|
|
127
146
|
tokenLimit: number | null;
|
|
128
147
|
usagePercentage: number | null;
|
|
129
148
|
};
|
|
149
|
+
export type UpdateMemoryResponse = {
|
|
150
|
+
updated: boolean;
|
|
151
|
+
memory: TUserMemory;
|
|
152
|
+
};
|
|
153
|
+
export type DeleteMemoryResponse = {
|
|
154
|
+
deleted: boolean;
|
|
155
|
+
};
|
|
130
156
|
export type PrincipalSearchParams = {
|
|
131
157
|
q: string;
|
|
132
158
|
limit?: number;
|
|
@@ -162,7 +188,12 @@ export type ListRolesResponse = {
|
|
|
162
188
|
};
|
|
163
189
|
export interface MCPServerStatus {
|
|
164
190
|
requiresOAuth: boolean;
|
|
191
|
+
/** The server connects only inside a chat request because its config reads BODY placeholders. */
|
|
192
|
+
requestScoped?: boolean;
|
|
193
|
+
/** Whether all declared per-user variables are present for an on-demand connection. */
|
|
194
|
+
configurationState?: 'configured' | 'needs_configuration';
|
|
165
195
|
connectionState: 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
196
|
+
authorizationState?: 'not_required' | 'authorizing' | 'authorized' | 'needs_authorization' | 'error';
|
|
166
197
|
}
|
|
167
198
|
export interface MCPConnectionStatusResponse {
|
|
168
199
|
success: boolean;
|
|
@@ -174,7 +205,10 @@ export interface MCPServerConnectionStatusResponse {
|
|
|
174
205
|
success: boolean;
|
|
175
206
|
serverName: string;
|
|
176
207
|
requiresOAuth: boolean;
|
|
208
|
+
requestScoped?: boolean;
|
|
209
|
+
configurationState?: MCPServerStatus['configurationState'];
|
|
177
210
|
connectionStatus: 'disconnected' | 'connecting' | 'connected' | 'error';
|
|
211
|
+
authorizationState?: MCPServerStatus['authorizationState'];
|
|
178
212
|
}
|
|
179
213
|
export interface MCPAuthValuesResponse {
|
|
180
214
|
success: boolean;
|
|
@@ -191,8 +225,16 @@ export type TUserFavorite = {
|
|
|
191
225
|
model?: string;
|
|
192
226
|
endpoint?: string;
|
|
193
227
|
spec?: string;
|
|
194
|
-
|
|
195
|
-
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Tool favorites — starred marketplace items (built-in capabilities, plugin
|
|
231
|
+
* tools, MCP servers, skills). Identity is the compound (itemType, itemId)
|
|
232
|
+
* pair, matching the marketplace `itemKey` format `itemType:itemId`.
|
|
233
|
+
*/
|
|
234
|
+
export type TToolFavoriteType = 'builtin' | 'tool' | 'mcp' | 'skill';
|
|
235
|
+
export type TToolFavorite = {
|
|
236
|
+
itemType: TToolFavoriteType;
|
|
237
|
+
itemId: string;
|
|
196
238
|
};
|
|
197
239
|
export type GraphTokenParams = {
|
|
198
240
|
scopes: string;
|