librechat-data-provider 0.8.405 → 0.8.407

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.
@@ -230,6 +230,7 @@ export declare function updatePromptLabels(variables: t.TUpdatePromptLabelsReque
230
230
  export declare function deletePromptGroup(id: string): Promise<t.TDeletePromptGroupResponse>;
231
231
  export declare function getCategories(): Promise<t.TGetCategoriesResponse>;
232
232
  export declare function getRandomPrompts(variables: t.TGetRandomPromptsRequest): Promise<t.TGetRandomPromptsResponse>;
233
+ export declare function listRoles(): Promise<q.ListRolesResponse>;
233
234
  export declare function getRole(roleName: string): Promise<r.TRole>;
234
235
  export declare function updatePromptPermissions(variables: m.UpdatePromptPermVars): Promise<m.UpdatePermResponse>;
235
236
  export declare function updateAgentPermissions(variables: m.UpdateAgentPermVars): Promise<m.UpdatePermResponse>;
@@ -46,6 +46,7 @@ export declare enum QueryKeys {
46
46
  agentCategories = "agentCategories",
47
47
  marketplaceAgents = "marketplaceAgents",
48
48
  roles = "roles",
49
+ rolesList = "rolesList",
49
50
  conversationTags = "conversationTags",
50
51
  health = "health",
51
52
  userTerms = "userTerms",
@@ -230,11 +230,9 @@ export declare const tModelSpecSchema: z.ZodObject<{
230
230
  defaultPreset: z.ZodOptional<z.ZodBoolean>;
231
231
  order: z.ZodOptional<z.ZodNumber>;
232
232
  endpoint: z.ZodNullable<z.ZodUnion<[z.ZodNativeEnum<typeof EModelEndpoint>, z.ZodString]>>;
233
- }, "isArchived" | "user" | "messages" | "parentMessageId" | "tags" | "file_ids" | "presetOverride" | "greeting" | "spec" | "iconURL" | "expiredAt" | "resendImages" | "chatGptLabel">, "strip", z.ZodTypeAny, {
233
+ }, "conversationId" | "isArchived" | "title" | "user" | "messages" | "parentMessageId" | "tags" | "file_ids" | "presetOverride" | "greeting" | "spec" | "iconURL" | "expiredAt" | "resendImages" | "chatGptLabel" | "presetId" | "defaultPreset" | "order">, "strip", z.ZodTypeAny, {
234
234
  endpoint: string | null;
235
- conversationId?: string | null | undefined;
236
235
  endpointType?: EModelEndpoint | null | undefined;
237
- title?: string | null | undefined;
238
236
  tools?: string[] | {
239
237
  name: string;
240
238
  pluginKey: string;
@@ -323,14 +321,9 @@ export declare const tModelSpecSchema: z.ZodObject<{
323
321
  append_current_datetime?: boolean | undefined;
324
322
  stop?: string[] | undefined;
325
323
  fileTokenLimit?: number | undefined;
326
- presetId?: string | null | undefined;
327
- defaultPreset?: boolean | undefined;
328
- order?: number | undefined;
329
324
  }, {
330
325
  endpoint: string | null;
331
- conversationId?: string | null | undefined;
332
326
  endpointType?: EModelEndpoint | null | undefined;
333
- title?: string | null | undefined;
334
327
  tools?: string[] | {
335
328
  name: string;
336
329
  pluginKey: string;
@@ -419,9 +412,6 @@ export declare const tModelSpecSchema: z.ZodObject<{
419
412
  append_current_datetime?: boolean | undefined;
420
413
  stop?: string[] | undefined;
421
414
  fileTokenLimit?: string | number | undefined;
422
- presetId?: string | null | undefined;
423
- defaultPreset?: boolean | undefined;
424
- order?: number | undefined;
425
415
  }>;
426
416
  order: z.ZodOptional<z.ZodNumber>;
427
417
  default: z.ZodOptional<z.ZodBoolean>;
@@ -442,9 +432,7 @@ export declare const tModelSpecSchema: z.ZodObject<{
442
432
  label: string;
443
433
  preset: {
444
434
  endpoint: string | null;
445
- conversationId?: string | null | undefined;
446
435
  endpointType?: EModelEndpoint | null | undefined;
447
- title?: string | null | undefined;
448
436
  tools?: string[] | {
449
437
  name: string;
450
438
  pluginKey: string;
@@ -533,9 +521,6 @@ export declare const tModelSpecSchema: z.ZodObject<{
533
521
  append_current_datetime?: boolean | undefined;
534
522
  stop?: string[] | undefined;
535
523
  fileTokenLimit?: number | undefined;
536
- presetId?: string | null | undefined;
537
- defaultPreset?: boolean | undefined;
538
- order?: number | undefined;
539
524
  };
540
525
  description?: string | undefined;
541
526
  artifacts?: string | boolean | undefined;
@@ -556,9 +541,7 @@ export declare const tModelSpecSchema: z.ZodObject<{
556
541
  label: string;
557
542
  preset: {
558
543
  endpoint: string | null;
559
- conversationId?: string | null | undefined;
560
544
  endpointType?: EModelEndpoint | null | undefined;
561
- title?: string | null | undefined;
562
545
  tools?: string[] | {
563
546
  name: string;
564
547
  pluginKey: string;
@@ -647,9 +630,6 @@ export declare const tModelSpecSchema: z.ZodObject<{
647
630
  append_current_datetime?: boolean | undefined;
648
631
  stop?: string[] | undefined;
649
632
  fileTokenLimit?: string | number | undefined;
650
- presetId?: string | null | undefined;
651
- defaultPreset?: boolean | undefined;
652
- order?: number | undefined;
653
633
  };
654
634
  description?: string | undefined;
655
635
  artifacts?: string | boolean | undefined;
@@ -868,11 +848,9 @@ export declare const specsConfigSchema: z.ZodObject<{
868
848
  defaultPreset: z.ZodOptional<z.ZodBoolean>;
869
849
  order: z.ZodOptional<z.ZodNumber>;
870
850
  endpoint: z.ZodNullable<z.ZodUnion<[z.ZodNativeEnum<typeof EModelEndpoint>, z.ZodString]>>;
871
- }, "isArchived" | "user" | "messages" | "parentMessageId" | "tags" | "file_ids" | "presetOverride" | "greeting" | "spec" | "iconURL" | "expiredAt" | "resendImages" | "chatGptLabel">, "strip", z.ZodTypeAny, {
851
+ }, "conversationId" | "isArchived" | "title" | "user" | "messages" | "parentMessageId" | "tags" | "file_ids" | "presetOverride" | "greeting" | "spec" | "iconURL" | "expiredAt" | "resendImages" | "chatGptLabel" | "presetId" | "defaultPreset" | "order">, "strip", z.ZodTypeAny, {
872
852
  endpoint: string | null;
873
- conversationId?: string | null | undefined;
874
853
  endpointType?: EModelEndpoint | null | undefined;
875
- title?: string | null | undefined;
876
854
  tools?: string[] | {
877
855
  name: string;
878
856
  pluginKey: string;
@@ -961,14 +939,9 @@ export declare const specsConfigSchema: z.ZodObject<{
961
939
  append_current_datetime?: boolean | undefined;
962
940
  stop?: string[] | undefined;
963
941
  fileTokenLimit?: number | undefined;
964
- presetId?: string | null | undefined;
965
- defaultPreset?: boolean | undefined;
966
- order?: number | undefined;
967
942
  }, {
968
943
  endpoint: string | null;
969
- conversationId?: string | null | undefined;
970
944
  endpointType?: EModelEndpoint | null | undefined;
971
- title?: string | null | undefined;
972
945
  tools?: string[] | {
973
946
  name: string;
974
947
  pluginKey: string;
@@ -1057,9 +1030,6 @@ export declare const specsConfigSchema: z.ZodObject<{
1057
1030
  append_current_datetime?: boolean | undefined;
1058
1031
  stop?: string[] | undefined;
1059
1032
  fileTokenLimit?: string | number | undefined;
1060
- presetId?: string | null | undefined;
1061
- defaultPreset?: boolean | undefined;
1062
- order?: number | undefined;
1063
1033
  }>;
1064
1034
  order: z.ZodOptional<z.ZodNumber>;
1065
1035
  default: z.ZodOptional<z.ZodBoolean>;
@@ -1080,9 +1050,7 @@ export declare const specsConfigSchema: z.ZodObject<{
1080
1050
  label: string;
1081
1051
  preset: {
1082
1052
  endpoint: string | null;
1083
- conversationId?: string | null | undefined;
1084
1053
  endpointType?: EModelEndpoint | null | undefined;
1085
- title?: string | null | undefined;
1086
1054
  tools?: string[] | {
1087
1055
  name: string;
1088
1056
  pluginKey: string;
@@ -1171,9 +1139,6 @@ export declare const specsConfigSchema: z.ZodObject<{
1171
1139
  append_current_datetime?: boolean | undefined;
1172
1140
  stop?: string[] | undefined;
1173
1141
  fileTokenLimit?: number | undefined;
1174
- presetId?: string | null | undefined;
1175
- defaultPreset?: boolean | undefined;
1176
- order?: number | undefined;
1177
1142
  };
1178
1143
  description?: string | undefined;
1179
1144
  artifacts?: string | boolean | undefined;
@@ -1194,9 +1159,7 @@ export declare const specsConfigSchema: z.ZodObject<{
1194
1159
  label: string;
1195
1160
  preset: {
1196
1161
  endpoint: string | null;
1197
- conversationId?: string | null | undefined;
1198
1162
  endpointType?: EModelEndpoint | null | undefined;
1199
- title?: string | null | undefined;
1200
1163
  tools?: string[] | {
1201
1164
  name: string;
1202
1165
  pluginKey: string;
@@ -1285,9 +1248,6 @@ export declare const specsConfigSchema: z.ZodObject<{
1285
1248
  append_current_datetime?: boolean | undefined;
1286
1249
  stop?: string[] | undefined;
1287
1250
  fileTokenLimit?: string | number | undefined;
1288
- presetId?: string | null | undefined;
1289
- defaultPreset?: boolean | undefined;
1290
- order?: number | undefined;
1291
1251
  };
1292
1252
  description?: string | undefined;
1293
1253
  artifacts?: string | boolean | undefined;
@@ -1313,9 +1273,7 @@ export declare const specsConfigSchema: z.ZodObject<{
1313
1273
  label: string;
1314
1274
  preset: {
1315
1275
  endpoint: string | null;
1316
- conversationId?: string | null | undefined;
1317
1276
  endpointType?: EModelEndpoint | null | undefined;
1318
- title?: string | null | undefined;
1319
1277
  tools?: string[] | {
1320
1278
  name: string;
1321
1279
  pluginKey: string;
@@ -1404,9 +1362,6 @@ export declare const specsConfigSchema: z.ZodObject<{
1404
1362
  append_current_datetime?: boolean | undefined;
1405
1363
  stop?: string[] | undefined;
1406
1364
  fileTokenLimit?: number | undefined;
1407
- presetId?: string | null | undefined;
1408
- defaultPreset?: boolean | undefined;
1409
- order?: number | undefined;
1410
1365
  };
1411
1366
  description?: string | undefined;
1412
1367
  artifacts?: string | boolean | undefined;
@@ -1430,9 +1385,7 @@ export declare const specsConfigSchema: z.ZodObject<{
1430
1385
  label: string;
1431
1386
  preset: {
1432
1387
  endpoint: string | null;
1433
- conversationId?: string | null | undefined;
1434
1388
  endpointType?: EModelEndpoint | null | undefined;
1435
- title?: string | null | undefined;
1436
1389
  tools?: string[] | {
1437
1390
  name: string;
1438
1391
  pluginKey: string;
@@ -1521,9 +1474,6 @@ export declare const specsConfigSchema: z.ZodObject<{
1521
1474
  append_current_datetime?: boolean | undefined;
1522
1475
  stop?: string[] | undefined;
1523
1476
  fileTokenLimit?: string | number | undefined;
1524
- presetId?: string | null | undefined;
1525
- defaultPreset?: boolean | undefined;
1526
- order?: number | undefined;
1527
1477
  };
1528
1478
  description?: string | undefined;
1529
1479
  artifacts?: string | boolean | undefined;
@@ -60,6 +60,29 @@ export declare enum PermissionTypes {
60
60
  */
61
61
  REMOTE_AGENTS = "REMOTE_AGENTS"
62
62
  }
63
+ /**
64
+ * Maps PermissionTypes to their corresponding `interface` config field names.
65
+ * Used to identify which interface fields seed role permissions at startup
66
+ * and must NOT be overridden via DB config (use the role permissions editor instead).
67
+ */
68
+ export declare const PERMISSION_TYPE_INTERFACE_FIELDS: Record<PermissionTypes, string>;
69
+ /** Set of interface config field names that correspond to role permissions. */
70
+ export declare const INTERFACE_PERMISSION_FIELDS: Set<string>;
71
+ /**
72
+ * YAML sub-keys within composite interface permission fields that map to permission bits.
73
+ * When an interface permission field is an object, only these sub-keys are stripped from
74
+ * DB overrides — other sub-keys (like `placeholder`, `trustCheckbox`) are UI-only and pass through.
75
+ *
76
+ * Mapping to Permissions enum:
77
+ * 'use' → Permissions.USE (agents, prompts, mcpServers, remoteAgents, marketplace)
78
+ * 'create' → Permissions.CREATE (agents, prompts, mcpServers, remoteAgents)
79
+ * 'share' → Permissions.SHARE (agents, prompts, mcpServers, remoteAgents)
80
+ * 'public' → Permissions.SHARE_PUBLIC (agents, prompts, mcpServers, remoteAgents)
81
+ * 'users' → Permissions.VIEW_USERS (peoplePicker only)
82
+ * 'groups' → Permissions.VIEW_GROUPS (peoplePicker only)
83
+ * 'roles' → Permissions.VIEW_ROLES (peoplePicker only)
84
+ */
85
+ export declare const PERMISSION_SUB_KEYS: Set<string>;
63
86
  /**
64
87
  * Enum for Role-Based Access Control Constants
65
88
  */
@@ -420,6 +420,8 @@ export declare const roleSchema: z.ZodObject<{
420
420
  };
421
421
  }>;
422
422
  export type TRole = z.infer<typeof roleSchema>;
423
+ /** Case-insensitive check for reserved system role names. */
424
+ export declare function isSystemRoleName(name: string | undefined | null): boolean;
423
425
  export declare const roleDefaults: {
424
426
  ADMIN: {
425
427
  name: SystemRoles.ADMIN;
@@ -2190,11 +2190,9 @@ export declare const tModelSpecPresetSchema: z.ZodObject<Omit<{
2190
2190
  defaultPreset: z.ZodOptional<z.ZodBoolean>;
2191
2191
  order: z.ZodOptional<z.ZodNumber>;
2192
2192
  endpoint: z.ZodNullable<z.ZodUnion<[z.ZodNativeEnum<typeof EModelEndpoint>, z.ZodString]>>;
2193
- }, "parentMessageId" | "iconURL" | "user" | "isArchived" | "messages" | "tags" | "file_ids" | "presetOverride" | "greeting" | "spec" | "expiredAt" | "resendImages" | "chatGptLabel">, "strip", z.ZodTypeAny, {
2193
+ }, "conversationId" | "parentMessageId" | "title" | "iconURL" | "user" | "isArchived" | "messages" | "tags" | "file_ids" | "presetOverride" | "greeting" | "spec" | "expiredAt" | "resendImages" | "chatGptLabel" | "presetId" | "defaultPreset" | "order">, "strip", z.ZodTypeAny, {
2194
2194
  endpoint: string | null;
2195
- conversationId?: string | null | undefined;
2196
2195
  model?: string | null | undefined;
2197
- title?: string | null | undefined;
2198
2196
  context?: string | null | undefined;
2199
2197
  endpointType?: EModelEndpoint | null | undefined;
2200
2198
  tools?: string[] | {
@@ -2259,14 +2257,9 @@ export declare const tModelSpecPresetSchema: z.ZodObject<Omit<{
2259
2257
  append_current_datetime?: boolean | undefined;
2260
2258
  stop?: string[] | undefined;
2261
2259
  fileTokenLimit?: number | undefined;
2262
- presetId?: string | null | undefined;
2263
- defaultPreset?: boolean | undefined;
2264
- order?: number | undefined;
2265
2260
  }, {
2266
2261
  endpoint: string | null;
2267
- conversationId?: string | null | undefined;
2268
2262
  model?: string | null | undefined;
2269
- title?: string | null | undefined;
2270
2263
  context?: string | null | undefined;
2271
2264
  endpointType?: EModelEndpoint | null | undefined;
2272
2265
  tools?: string[] | {
@@ -2331,9 +2324,6 @@ export declare const tModelSpecPresetSchema: z.ZodObject<Omit<{
2331
2324
  append_current_datetime?: boolean | undefined;
2332
2325
  stop?: string[] | undefined;
2333
2326
  fileTokenLimit?: string | number | undefined;
2334
- presetId?: string | null | undefined;
2335
- defaultPreset?: boolean | undefined;
2336
- order?: number | undefined;
2337
2327
  }>;
2338
2328
  export type TModelSpecPreset = z.infer<typeof tModelSpecPresetSchema>;
2339
2329
  export type TPreset = z.infer<typeof tPresetSchema>;
@@ -487,6 +487,24 @@ export type TContentData = StreamContentData & {
487
487
  };
488
488
  export declare const actionDelimiter = "_action_";
489
489
  export declare const actionDomainSeparator = "---";
490
+ /**
491
+ * Checks whether a tool name is an OpenAPI action tool.
492
+ *
493
+ * Action format: `operationId_action_normalizedDomain`
494
+ * MCP format: `toolName_mcp_serverName`
495
+ *
496
+ * Cross-delimiter collision: an MCP tool like `get_action_mcp_srv` contains
497
+ * `_action_` as a false positive. Guarded by checking whether `_mcp_` appears
498
+ * after `_action_`. In the collision case the `_mcp_` suffix always follows
499
+ * `_action_`; in a valid action tool whose operationId contains `_mcp_`, the
500
+ * `_mcp_` precedes `_action_`.
501
+ *
502
+ * Theoretical limitation: a non-RFC-compliant domain containing literal
503
+ * underscores that form `_mcp_` (e.g. `api_mcp_internal.com`) would produce
504
+ * a false negative. RFC 952/1123 prohibit underscores in hostnames, so this
505
+ * is not expected in practice.
506
+ */
507
+ export declare function isActionTool(toolName: string): boolean;
490
508
  export declare const hostImageIdSuffix = "_host_copy";
491
509
  export declare const hostImageNamePrefix = "host_copy_";
492
510
  export type AssistantAvatar = {
@@ -139,6 +139,16 @@ export type AccessRole = {
139
139
  permBits: number;
140
140
  };
141
141
  export type AccessRolesResponse = AccessRole[];
142
+ export type ListRolesResponse = {
143
+ roles: Array<{
144
+ _id?: string;
145
+ name: string;
146
+ description?: string;
147
+ }>;
148
+ total: number;
149
+ limit: number;
150
+ offset?: number;
151
+ };
142
152
  export interface MCPServerStatus {
143
153
  requiresOAuth: boolean;
144
154
  connectionState: 'disconnected' | 'connecting' | 'connected' | 'error';
@@ -244,6 +244,7 @@ export type TConfig = {
244
244
  azure?: boolean;
245
245
  availableTools?: [];
246
246
  availableRegions?: string[];
247
+ allowedProviders?: (string | EModelEndpoint)[];
247
248
  plugins?: Record<string, string>;
248
249
  name?: string;
249
250
  iconURL?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "librechat-data-provider",
3
- "version": "0.8.405",
3
+ "version": "0.8.407",
4
4
  "description": "data services for librechat apps",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "homepage": "https://librechat.ai",
45
45
  "dependencies": {
46
- "axios": "^1.13.5",
46
+ "axios": "1.13.6",
47
47
  "dayjs": "^1.11.13",
48
48
  "js-yaml": "^4.1.1",
49
49
  "zod": "^3.22.4"
@@ -57,7 +57,7 @@
57
57
  "@rollup/plugin-json": "^6.1.0",
58
58
  "@rollup/plugin-node-resolve": "^15.1.0",
59
59
  "@rollup/plugin-replace": "^5.0.5",
60
- "@rollup/plugin-terser": "^0.4.4",
60
+ "@rollup/plugin-terser": "^1.0.0",
61
61
  "@types/jest": "^29.5.2",
62
62
  "@types/js-yaml": "^4.0.9",
63
63
  "@types/node": "^20.3.0",
@@ -69,7 +69,7 @@
69
69
  "rimraf": "^6.1.3",
70
70
  "rollup": "^4.34.9",
71
71
  "rollup-plugin-peer-deps-external": "^2.2.4",
72
- "rollup-plugin-typescript2": "^0.35.0",
72
+ "rollup-plugin-typescript2": "^0.37.0",
73
73
  "typescript": "^5.0.4"
74
74
  },
75
75
  "peerDependencies": {