librechat-data-provider 0.8.502 → 0.8.504

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 (49) hide show
  1. package/dist/data-service-BFGYAHRx.mjs +6519 -0
  2. package/dist/data-service-BFGYAHRx.mjs.map +1 -0
  3. package/dist/data-service-Dk-uLruo.js +8518 -0
  4. package/dist/data-service-Dk-uLruo.js.map +1 -0
  5. package/dist/index.js +6592 -2
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +6161 -0
  8. package/dist/index.mjs.map +1 -0
  9. package/dist/react-query/index.js +361 -0
  10. package/dist/react-query/index.js.map +1 -0
  11. package/dist/react-query/index.mjs +326 -0
  12. package/dist/react-query/index.mjs.map +1 -0
  13. package/dist/types/accessPermissions.d.ts +13 -10
  14. package/dist/types/actions.d.ts +2 -2
  15. package/dist/types/api-endpoints.d.ts +19 -10
  16. package/dist/types/bedrock.d.ts +258 -212
  17. package/dist/types/config.d.ts +4823 -2612
  18. package/dist/types/data-service.d.ts +28 -8
  19. package/dist/types/file-config.d.ts +12 -12
  20. package/dist/types/generate.d.ts +66 -53
  21. package/dist/types/keys.d.ts +7 -0
  22. package/dist/types/limits.d.ts +2 -0
  23. package/dist/types/mcp.d.ts +1774 -249
  24. package/dist/types/models.d.ts +347 -206
  25. package/dist/types/parameterSettings.d.ts +6 -0
  26. package/dist/types/parsers.d.ts +8 -8
  27. package/dist/types/permissions.d.ts +65 -9
  28. package/dist/types/react-query/react-query-service.d.ts +1 -31
  29. package/dist/types/request.d.ts +1 -1
  30. package/dist/types/roles.d.ts +52 -0
  31. package/dist/types/schemas.d.ts +409 -143
  32. package/dist/types/types/agents.d.ts +15 -1
  33. package/dist/types/types/files.d.ts +1 -1
  34. package/dist/types/types/mutations.d.ts +1 -0
  35. package/dist/types/types/queries.d.ts +16 -3
  36. package/dist/types/types/skills.d.ts +72 -9
  37. package/dist/types/types.d.ts +48 -5
  38. package/package.json +11 -13
  39. package/dist/index.es.js +0 -2
  40. package/dist/index.es.js.map +0 -1
  41. package/dist/react-query/index.es.js +0 -2
  42. package/dist/react-query/index.es.js.map +0 -1
  43. package/dist/types/balance.spec.d.ts +0 -1
  44. package/dist/types/cloudfront-config.spec.d.ts +0 -1
  45. package/dist/types/codeEnvRef.spec.d.ts +0 -1
  46. package/dist/types/config.spec.d.ts +0 -1
  47. package/dist/types/file-config.spec.d.ts +0 -1
  48. package/dist/types/roles.spec.d.ts +0 -1
  49. package/dist/types/schemas.spec.d.ts +0 -1
@@ -1,6 +1,6 @@
1
- import { StepTypes, ContentTypes, ToolCallTypes } from './runs';
2
1
  import type { FunctionToolCall, SummaryContentPart } from './assistants';
3
2
  import type { TAttachment, TPlugin } from 'src/schemas';
3
+ import { StepTypes, ContentTypes, ToolCallTypes } from './runs';
4
4
  export declare namespace Agents {
5
5
  type MessageType = 'human' | 'ai' | 'generic' | 'system' | 'function' | 'tool' | 'remove';
6
6
  type ImageDetail = 'auto' | 'low' | 'high';
@@ -188,6 +188,20 @@ export declare namespace Agents {
188
188
  responseMessageId?: string;
189
189
  conversationId?: string;
190
190
  sender?: string;
191
+ iconURL?: string;
192
+ model?: string;
193
+ titleEvent?: {
194
+ event: 'title';
195
+ data?: {
196
+ conversationId?: string;
197
+ title?: string;
198
+ };
199
+ };
200
+ replayEvents?: Array<{
201
+ event: string;
202
+ data?: unknown;
203
+ [key: string]: unknown;
204
+ }>;
191
205
  }
192
206
  /**
193
207
  * Represents a run step delta i.e. any changed fields on a run step during
@@ -16,7 +16,7 @@ export declare enum FileSources {
16
16
  text = "text",
17
17
  document_parser = "document_parser"
18
18
  }
19
- export declare const checkOpenAIStorage: (source: string) => boolean;
19
+ export declare const checkOpenAIStorage: (source: string) => source is FileSources.azure | FileSources.openai;
20
20
  export declare enum FileContext {
21
21
  avatar = "avatar",
22
22
  unknown = "unknown",
@@ -214,6 +214,7 @@ export type ToolParams<T extends ToolId> = ToolParamsMap[T] & {
214
214
  partIndex?: number;
215
215
  blockIndex?: number;
216
216
  conversationId: string;
217
+ isTemporary?: boolean;
217
218
  };
218
219
  export type ToolCallResponse = {
219
220
  result: unknown;
@@ -17,14 +17,27 @@ export type ConversationListParams = {
17
17
  sortDirection?: 'asc' | 'desc';
18
18
  tags?: string[];
19
19
  search?: string;
20
+ projectId?: string;
20
21
  };
21
- export type MinimalConversation = Pick<s.TConversation, 'conversationId' | 'endpoint' | 'title' | 'createdAt' | 'updatedAt' | 'user'>;
22
+ export type MinimalConversation = Pick<s.TConversation, 'conversationId' | 'endpoint' | 'title' | 'createdAt' | 'updatedAt' | 'user' | 'chatProjectId'>;
22
23
  export type ConversationListResponse = {
23
24
  conversations: MinimalConversation[];
24
25
  nextCursor: string | null;
25
26
  };
26
27
  export type ConversationData = InfiniteData<ConversationListResponse>;
27
28
  export type ConversationUpdater = (data: ConversationData, conversation: s.TConversation) => ConversationData;
29
+ export type ProjectListParams = {
30
+ cursor?: string;
31
+ limit?: number;
32
+ sortBy?: 'name' | 'createdAt' | 'lastConversationAt';
33
+ sortDirection?: 'asc' | 'desc';
34
+ search?: string;
35
+ };
36
+ export type ProjectListResponse = {
37
+ projects: t.TChatProject[];
38
+ nextCursor: string | null;
39
+ };
40
+ export type ProjectData = InfiniteData<ProjectListResponse>;
28
41
  export type MessagesListParams = {
29
42
  cursor?: string | null;
30
43
  sortBy?: 'endpoint' | 'createdAt' | 'updatedAt';
@@ -43,7 +56,6 @@ export type SharedMessagesResponse = Omit<s.TSharedLink, 'messages'> & {
43
56
  };
44
57
  export interface SharedLinksListParams {
45
58
  pageSize: number;
46
- isPublic: boolean;
47
59
  sortBy: 'title' | 'createdAt';
48
60
  sortDirection: 'asc' | 'desc';
49
61
  search?: string;
@@ -52,7 +64,6 @@ export interface SharedLinksListParams {
52
64
  export type SharedLinkItem = {
53
65
  shareId: string;
54
66
  title: string;
55
- isPublic: boolean;
56
67
  createdAt: Date;
57
68
  conversationId: string;
58
69
  };
@@ -156,6 +167,8 @@ export interface MCPServerStatus {
156
167
  export interface MCPConnectionStatusResponse {
157
168
  success: boolean;
158
169
  connectionStatus: Record<string, MCPServerStatus>;
170
+ /** Server-configured OAuth completion window in ms (`MCP_OAUTH_HANDLING_TIMEOUT`) */
171
+ oauthTimeout?: number;
159
172
  }
160
173
  export interface MCPServerConnectionStatusResponse {
161
174
  success: boolean;
@@ -22,9 +22,11 @@ export declare const SKILL_NAME_PATTERN: RegExp;
22
22
  /**
23
23
  * Source of a skill — where its canonical definition came from.
24
24
  * `inline` means the skill was authored directly in LibreChat.
25
- * `github` / `notion` are reserved for future sync integrations.
25
+ * `deployment` means the skill was loaded from the server's configured
26
+ * deployment skill directory and is not persisted as a Skill document.
27
+ * `github` is populated by admin-configured GitHub skill sync; `notion` is reserved.
26
28
  */
27
- export type SkillSource = 'inline' | 'github' | 'notion';
29
+ export type SkillSource = 'inline' | 'deployment' | 'github' | 'notion';
28
30
  /**
29
31
  * Category inferred from a skill file's top-level directory prefix.
30
32
  * `script` for `scripts/...`, `reference` for `references/...`, `asset` for `assets/...`,
@@ -51,11 +53,23 @@ export type SkillFrontmatter = {
51
53
  * Provenance metadata for skills that originated from an external source
52
54
  * (e.g. a GitHub commit SHA or a Notion page id).
53
55
  *
54
- * Reserved for phase 2+ external sync no code path currently populates this
55
- * in phase 1, but the column exists so a future sync worker can use it
56
- * without a schema migration.
56
+ * Populated by external sync workers with upstream identifiers such as source
57
+ * ids, paths, and commit/blob SHAs.
57
58
  */
58
- export type SkillSourceMetadata = Record<string, string | number | boolean>;
59
+ export type SkillSourceMetadata = Record<string, string | number | boolean> | {
60
+ provider: 'github';
61
+ sourceId: string;
62
+ upstreamId: string;
63
+ owner: string;
64
+ repo: string;
65
+ ref: string;
66
+ skillPath: string;
67
+ commitSha?: string;
68
+ skillBlobSha?: string;
69
+ syncedAt?: string;
70
+ syncStatus?: 'synced' | 'failed';
71
+ error?: string;
72
+ };
59
73
  /**
60
74
  * A non-blocking coaching hint surfaced alongside a successful create/update
61
75
  * response. Unlike validation errors (which return 400 and block the write),
@@ -83,8 +97,8 @@ export type TSkillWarning = {
83
97
  * - `frontmatter` is the structured YAML bag minus `name`/`description`
84
98
  * (those live as top-level columns). Validated strictly against a known
85
99
  * key set server-side.
86
- * - `source`/`sourceMetadata` are reserved for phase 2+ external sync and
87
- * always `'inline'` / absent in phase 1.
100
+ * - `source`/`sourceMetadata` identify whether the row is user-authored,
101
+ * deployment-provided, or mirrored from an external source such as GitHub.
88
102
  */
89
103
  export type TSkill = {
90
104
  _id: string;
@@ -170,6 +184,7 @@ export type TSkillFile = {
170
184
  isExecutable: boolean;
171
185
  author: string;
172
186
  tenantId?: string;
187
+ sourceMetadata?: Record<string, string | number | boolean>;
173
188
  /** Lazily cached text content (≤ 512 KB). Excluded from list responses. */
174
189
  content?: string;
175
190
  /** Set on first read. `true` prevents repeated storage reads for non-text files. */
@@ -177,6 +192,54 @@ export type TSkillFile = {
177
192
  createdAt: string;
178
193
  updatedAt: string;
179
194
  };
195
+ export type TGitHubSkillSyncCredentialSummary = {
196
+ provider: 'github';
197
+ credentialKey: string;
198
+ credentialPresent: boolean;
199
+ tokenFingerprint?: string;
200
+ updatedAt?: string;
201
+ createdAt?: string;
202
+ };
203
+ export type TGitHubSkillSyncSourceStatus = {
204
+ provider: 'github';
205
+ sourceId: string;
206
+ tenantId?: string;
207
+ status: 'idle' | 'running' | 'succeeded' | 'failed' | 'skipped';
208
+ credentialKey?: string;
209
+ credentialPresent: boolean;
210
+ owner?: string;
211
+ repo?: string;
212
+ ref?: string;
213
+ paths?: string[];
214
+ startedAt?: string;
215
+ finishedAt?: string;
216
+ lastSuccessAt?: string;
217
+ lastFailureAt?: string;
218
+ errorCode?: string;
219
+ errorMessage?: string;
220
+ syncedSkillCount: number;
221
+ syncedFileCount: number;
222
+ deletedSkillCount: number;
223
+ deletedFileCount: number;
224
+ updatedAt?: string;
225
+ createdAt?: string;
226
+ };
227
+ export type TGitHubSkillSyncStatusResponse = {
228
+ enabled: boolean;
229
+ intervalMinutes: number;
230
+ runOnStartup: boolean;
231
+ sources: TGitHubSkillSyncSourceStatus[];
232
+ credentials: TGitHubSkillSyncCredentialSummary[];
233
+ fineGrainedTokenRecommendation: string;
234
+ };
235
+ export type TGitHubSkillSyncCredentialUpdateRequest = {
236
+ token: string;
237
+ };
238
+ export type TGitHubSkillSyncManualRunResponse = {
239
+ status: 'started' | 'skipped' | 'completed' | 'failed';
240
+ message?: string;
241
+ sources?: TGitHubSkillSyncSourceStatus[];
242
+ };
180
243
  /** Request body for POST `/api/skills`. */
181
244
  export type TCreateSkill = {
182
245
  name: string;
@@ -185,7 +248,7 @@ export type TCreateSkill = {
185
248
  body: string;
186
249
  frontmatter?: Partial<SkillFrontmatter>;
187
250
  category?: string;
188
- /** When `true`, the skill auto-primes into every turn (mirrors `always-apply` frontmatter). */
251
+ /** When `true`, the skill auto-primes into every turn (mirrors always-apply frontmatter). */
189
252
  alwaysApply?: boolean;
190
253
  };
191
254
  /** Partial payload for PATCH `/api/skills/:id` — all fields optional. */
@@ -1,5 +1,5 @@
1
1
  import type { InfiniteData } from '@tanstack/react-query';
2
- import type { TConversationTag, EModelEndpoint, TConversation, TSharedLink, TAttachment, TMessage, TBanner } from './schemas';
2
+ import type { TConversationTag, EModelEndpoint, TConversation, TSharedLink, TAttachment, TMessage, TBanner, ReasoningResponseKey, ReasoningParameterFormat } from './schemas';
3
3
  import type { RefillIntervalUnit } from './balance';
4
4
  import type { SettingDefinition } from './generate';
5
5
  import type { TMinimalFeedback } from './feedback';
@@ -7,7 +7,7 @@ import type { ContentTypes } from './types/runs';
7
7
  import type { Agent } from './types/assistants';
8
8
  export * from './schemas';
9
9
  export type TMessages = TMessage[];
10
- export type TEndpointOption = Pick<TConversation, 'endpoint' | 'endpointType' | 'model' | 'modelLabel' | 'chatGptLabel' | 'promptPrefix' | 'temperature' | 'topP' | 'topK' | 'top_p' | 'frequency_penalty' | 'presence_penalty' | 'maxOutputTokens' | 'maxContextTokens' | 'max_tokens' | 'maxTokens' | 'resendFiles' | 'imageDetail' | 'reasoning_effort' | 'verbosity' | 'instructions' | 'additional_instructions' | 'append_current_datetime' | 'tools' | 'stop' | 'region' | 'additionalModelRequestFields' | 'promptCache' | 'thinking' | 'thinkingBudget' | 'thinkingLevel' | 'effort' | 'thinkingDisplay' | 'assistant_id' | 'agent_id' | 'iconURL' | 'greeting' | 'spec' | 'artifacts' | 'file_ids' | 'system' | 'examples' | 'context'> & {
10
+ export type TEndpointOption = Pick<TConversation, 'endpoint' | 'endpointType' | 'model' | 'modelLabel' | 'chatGptLabel' | 'promptPrefix' | 'temperature' | 'topP' | 'topK' | 'top_p' | 'frequency_penalty' | 'presence_penalty' | 'maxOutputTokens' | 'maxContextTokens' | 'max_tokens' | 'maxTokens' | 'resendFiles' | 'imageDetail' | 'reasoning_effort' | 'verbosity' | 'instructions' | 'additional_instructions' | 'append_current_datetime' | 'tools' | 'stop' | 'region' | 'additionalModelRequestFields' | 'promptCache' | 'thinking' | 'thinkingBudget' | 'thinkingLevel' | 'effort' | 'thinkingDisplay' | 'assistant_id' | 'agent_id' | 'iconURL' | 'greeting' | 'spec' | 'artifacts' | 'file_ids' | 'system' | 'chatProjectId' | 'examples' | 'context'> & {
11
11
  modelDisplayLabel?: string;
12
12
  key?: string | null;
13
13
  /** @deprecated Assistants API */
@@ -63,6 +63,8 @@ export type TSubmission = {
63
63
  isContinued?: boolean;
64
64
  isTemporary: boolean;
65
65
  messages: TMessage[];
66
+ /** Client-only full message context used to restore branch siblings after scoped regenerate. */
67
+ regenerateMessages?: TMessage[];
66
68
  isRegenerate?: boolean;
67
69
  initialResponse?: TMessage;
68
70
  conversation: Partial<TConversation>;
@@ -124,6 +126,7 @@ export type TUser = {
124
126
  avatar: string;
125
127
  role: string;
126
128
  provider: string;
129
+ tenantId?: string;
127
130
  plugins?: string[];
128
131
  twoFactorEnabled?: boolean;
129
132
  backupCodes?: TBackupCode[];
@@ -184,6 +187,37 @@ export type TUpdateConversationRequest = {
184
187
  title: string;
185
188
  };
186
189
  export type TUpdateConversationResponse = TConversation;
190
+ export type TChatProject = {
191
+ _id: string;
192
+ name: string;
193
+ description?: string;
194
+ user?: string;
195
+ conversationCount: number;
196
+ lastConversationAt?: string | null;
197
+ lastConversationId?: string | null;
198
+ createdAt: string;
199
+ updatedAt: string;
200
+ };
201
+ export type TCreateChatProjectRequest = {
202
+ name: string;
203
+ description?: string;
204
+ };
205
+ export type TUpdateChatProjectRequest = Partial<TCreateChatProjectRequest> & {
206
+ projectId: string;
207
+ };
208
+ export type TDeleteChatProjectResponse = {
209
+ deletedCount: number;
210
+ modifiedCount: number;
211
+ };
212
+ export type TAssignConversationToProjectRequest = {
213
+ conversationId: string;
214
+ projectId: string | null;
215
+ };
216
+ export type TAssignConversationToProjectResponse = {
217
+ conversation: TConversation;
218
+ previousProjectId: string | null;
219
+ projectId: string | null;
220
+ };
187
221
  export type TDeleteConversationRequest = {
188
222
  conversationId?: string;
189
223
  thread_id?: string;
@@ -207,9 +241,12 @@ export type TSharedMessagesResponse = Omit<TSharedLink, 'messages'> & {
207
241
  messages: TMessage[];
208
242
  };
209
243
  export type TCreateShareLinkRequest = Pick<TConversation, 'conversationId'>;
210
- export type TUpdateShareLinkRequest = Pick<TSharedLink, 'shareId'>;
211
- export type TSharedLinkResponse = Pick<TSharedLink, 'shareId'> & Pick<TConversation, 'conversationId'>;
212
- export type TSharedLinkGetResponse = TSharedLinkResponse & {
244
+ export type TUpdateShareLinkRequest = Pick<TSharedLink, 'shareId' | 'targetMessageId'>;
245
+ export type TSharedLinkResponse = Pick<TSharedLink, 'shareId'> & Pick<TSharedLink, 'targetMessageId'> & Pick<TConversation, 'conversationId'> & {
246
+ _id?: string;
247
+ };
248
+ export type TSharedLinkGetResponse = Omit<TSharedLinkResponse, 'shareId'> & {
249
+ shareId: string | null;
213
250
  success: boolean;
214
251
  };
215
252
  export type TConversationTagsResponse = TConversationTag[];
@@ -263,11 +300,17 @@ export type TConfig = {
263
300
  modelDisplayLabel?: string;
264
301
  userProvide?: boolean | null;
265
302
  userProvideURL?: boolean | null;
303
+ userProvideAccessKeyId?: boolean;
304
+ userProvideSecretAccessKey?: boolean;
305
+ userProvideSessionToken?: boolean;
306
+ userProvideBearerToken?: boolean;
266
307
  disableBuilder?: boolean;
267
308
  retrievalModels?: string[];
268
309
  capabilities?: string[];
269
310
  customParams?: {
270
311
  defaultParamsEndpoint?: string;
312
+ reasoningFormat?: ReasoningParameterFormat;
313
+ reasoningKey?: ReasoningResponseKey;
271
314
  paramDefinitions?: Partial<SettingDefinition>[];
272
315
  };
273
316
  };
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "librechat-data-provider",
3
- "version": "0.8.502",
3
+ "version": "0.8.504",
4
4
  "description": "data services for librechat apps",
5
5
  "main": "dist/index.js",
6
- "module": "dist/index.es.js",
6
+ "module": "dist/index.mjs",
7
7
  "types": "./dist/types/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "exports": {
10
10
  ".": {
11
- "import": "./dist/index.es.js",
11
+ "import": "./dist/index.mjs",
12
12
  "require": "./dist/index.js",
13
13
  "types": "./dist/types/index.d.ts"
14
14
  },
15
15
  "./react-query": {
16
- "import": "./dist/react-query/index.es.js",
16
+ "import": "./dist/react-query/index.mjs",
17
17
  "require": "./dist/react-query/index.js",
18
18
  "types": "./dist/types/react-query/index.d.ts"
19
19
  }
@@ -23,14 +23,14 @@
23
23
  ],
24
24
  "scripts": {
25
25
  "clean": "rimraf dist",
26
- "build": "npm run clean && rollup -c --silent --bundleConfigAsCjs",
27
- "build:watch": "rollup -c -w",
26
+ "build": "npm run clean && tsdown && tsc -p tsconfig.build.json",
27
+ "build:watch": "tsdown --watch",
28
28
  "rollup:api": "npx rollup -c server-rollup.config.js --bundleConfigAsCjs",
29
29
  "test": "jest --coverage --watch",
30
30
  "test:ci": "jest --coverage --ci --logHeapUsage",
31
31
  "verify": "npm run test:ci",
32
32
  "b:clean": "bun run rimraf dist",
33
- "b:build": "bun run b:clean && bun run rollup -c --silent --bundleConfigAsCjs"
33
+ "b:build": "bun run b:clean && bun run tsdown && bun run tsc -p tsconfig.build.json"
34
34
  },
35
35
  "repository": {
36
36
  "type": "git",
@@ -57,20 +57,18 @@
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": "^1.0.0",
61
60
  "@types/jest": "^29.5.2",
62
61
  "@types/js-yaml": "^4.0.9",
63
- "@types/node": "^20.3.0",
62
+ "@types/node": "^24.12.4",
64
63
  "@types/react": "^18.2.18",
65
64
  "@types/winston": "^2.4.4",
66
65
  "jest": "^30.2.0",
67
- "jest-junit": "^16.0.0",
66
+ "jest-junit": "^17.0.0",
68
67
  "openapi-types": "^12.1.3",
69
68
  "rimraf": "^6.1.3",
70
69
  "rollup": "^4.34.9",
71
- "rollup-plugin-peer-deps-external": "^2.2.4",
72
- "rollup-plugin-typescript2": "^0.37.0",
73
- "typescript": "^5.0.4"
70
+ "tsdown": "^0.22.2",
71
+ "typescript": "^5.9.3"
74
72
  },
75
73
  "peerDependencies": {
76
74
  "@tanstack/react-query": "^4.28.0"