librechat-data-provider 0.7.68 → 0.7.71

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/src/roles.ts CHANGED
@@ -34,6 +34,14 @@ export enum PermissionTypes {
34
34
  * Type for Multi-Conversation Permissions
35
35
  */
36
36
  MULTI_CONVO = 'MULTI_CONVO',
37
+ /**
38
+ * Type for Temporary Chat
39
+ */
40
+ TEMPORARY_CHAT = 'TEMPORARY_CHAT',
41
+ /**
42
+ * Type for using the "Run Code" LC Code Interpreter API feature
43
+ */
44
+ RUN_CODE = 'RUN_CODE',
37
45
  }
38
46
 
39
47
  /**
@@ -68,7 +76,15 @@ export const agentPermissionsSchema = z.object({
68
76
  });
69
77
 
70
78
  export const multiConvoPermissionsSchema = z.object({
71
- [Permissions.USE]: z.boolean().default(false),
79
+ [Permissions.USE]: z.boolean().default(true),
80
+ });
81
+
82
+ export const temporaryChatPermissionsSchema = z.object({
83
+ [Permissions.USE]: z.boolean().default(true),
84
+ });
85
+
86
+ export const runCodePermissionsSchema = z.object({
87
+ [Permissions.USE]: z.boolean().default(true),
72
88
  });
73
89
 
74
90
  export const roleSchema = z.object({
@@ -77,6 +93,8 @@ export const roleSchema = z.object({
77
93
  [PermissionTypes.BOOKMARKS]: bookmarkPermissionsSchema,
78
94
  [PermissionTypes.AGENTS]: agentPermissionsSchema,
79
95
  [PermissionTypes.MULTI_CONVO]: multiConvoPermissionsSchema,
96
+ [PermissionTypes.TEMPORARY_CHAT]: temporaryChatPermissionsSchema,
97
+ [PermissionTypes.RUN_CODE]: runCodePermissionsSchema,
80
98
  });
81
99
 
82
100
  export type TRole = z.infer<typeof roleSchema>;
@@ -84,6 +102,8 @@ export type TAgentPermissions = z.infer<typeof agentPermissionsSchema>;
84
102
  export type TPromptPermissions = z.infer<typeof promptPermissionsSchema>;
85
103
  export type TBookmarkPermissions = z.infer<typeof bookmarkPermissionsSchema>;
86
104
  export type TMultiConvoPermissions = z.infer<typeof multiConvoPermissionsSchema>;
105
+ export type TTemporaryChatPermissions = z.infer<typeof temporaryChatPermissionsSchema>;
106
+ export type TRunCodePermissions = z.infer<typeof runCodePermissionsSchema>;
87
107
 
88
108
  const defaultRolesSchema = z.object({
89
109
  [SystemRoles.ADMIN]: roleSchema.extend({
@@ -106,6 +126,12 @@ const defaultRolesSchema = z.object({
106
126
  [PermissionTypes.MULTI_CONVO]: multiConvoPermissionsSchema.extend({
107
127
  [Permissions.USE]: z.boolean().default(true),
108
128
  }),
129
+ [PermissionTypes.TEMPORARY_CHAT]: temporaryChatPermissionsSchema.extend({
130
+ [Permissions.USE]: z.boolean().default(true),
131
+ }),
132
+ [PermissionTypes.RUN_CODE]: runCodePermissionsSchema.extend({
133
+ [Permissions.USE]: z.boolean().default(true),
134
+ }),
109
135
  }),
110
136
  [SystemRoles.USER]: roleSchema.extend({
111
137
  name: z.literal(SystemRoles.USER),
@@ -113,6 +139,8 @@ const defaultRolesSchema = z.object({
113
139
  [PermissionTypes.BOOKMARKS]: bookmarkPermissionsSchema,
114
140
  [PermissionTypes.AGENTS]: agentPermissionsSchema,
115
141
  [PermissionTypes.MULTI_CONVO]: multiConvoPermissionsSchema,
142
+ [PermissionTypes.TEMPORARY_CHAT]: temporaryChatPermissionsSchema,
143
+ [PermissionTypes.RUN_CODE]: runCodePermissionsSchema,
116
144
  }),
117
145
  });
118
146
 
@@ -123,6 +151,8 @@ export const roleDefaults = defaultRolesSchema.parse({
123
151
  [PermissionTypes.BOOKMARKS]: {},
124
152
  [PermissionTypes.AGENTS]: {},
125
153
  [PermissionTypes.MULTI_CONVO]: {},
154
+ [PermissionTypes.TEMPORARY_CHAT]: {},
155
+ [PermissionTypes.RUN_CODE]: {},
126
156
  },
127
157
  [SystemRoles.USER]: {
128
158
  name: SystemRoles.USER,
@@ -130,5 +160,7 @@ export const roleDefaults = defaultRolesSchema.parse({
130
160
  [PermissionTypes.BOOKMARKS]: {},
131
161
  [PermissionTypes.AGENTS]: {},
132
162
  [PermissionTypes.MULTI_CONVO]: {},
163
+ [PermissionTypes.TEMPORARY_CHAT]: {},
164
+ [PermissionTypes.RUN_CODE]: {},
133
165
  },
134
166
  });