librechat-data-provider 0.8.507 → 0.8.509
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-D7mtXwG5.mjs → data-service-BsdHkdKS.mjs} +86 -14
- package/dist/data-service-BsdHkdKS.mjs.map +1 -0
- package/dist/{data-service-CCdWvcRd.js → data-service-XTxx76uB.js} +91 -13
- package/dist/data-service-XTxx76uB.js.map +1 -0
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -2
- package/dist/index.mjs.map +1 -1
- package/dist/react-query/index.js +1 -1
- package/dist/react-query/index.mjs +1 -1
- package/dist/types/api-endpoints.d.ts +5 -0
- package/dist/types/bedrock.d.ts +5 -0
- package/dist/types/config.d.ts +121 -0
- package/dist/types/data-service.d.ts +7 -2
- package/dist/types/generate.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/keys.d.ts +1 -0
- package/dist/types/models.d.ts +12 -0
- package/dist/types/schemas.d.ts +55 -4
- package/dist/types/types/mutations.d.ts +5 -5
- package/dist/types/types.d.ts +4 -0
- package/package.json +1 -1
- package/dist/data-service-CCdWvcRd.js.map +0 -1
- package/dist/data-service-D7mtXwG5.mjs.map +0 -1
|
@@ -957,7 +957,15 @@ const tMessageSchema = zod.z.object({
|
|
|
957
957
|
* edits to the skill's `alwaysApply` flag (the user bubble reflects
|
|
958
958
|
* what actually ran, not the current catalog).
|
|
959
959
|
*/
|
|
960
|
-
alwaysAppliedSkills: zod.z.array(zod.z.string()).optional()
|
|
960
|
+
alwaysAppliedSkills: zod.z.array(zod.z.string()).optional(),
|
|
961
|
+
/**
|
|
962
|
+
* Verbatim excerpts the user quoted (via the "Add to chat" selection
|
|
963
|
+
* popup) to reference on this turn. UI metadata that `MessageQuotes`
|
|
964
|
+
* renders above the user bubble so the references persist on reload. The
|
|
965
|
+
* excerpts are merged into the user message text sent to the model at
|
|
966
|
+
* request time and counted in the user message token count.
|
|
967
|
+
*/
|
|
968
|
+
quotes: zod.z.array(zod.z.string()).optional()
|
|
961
969
|
});
|
|
962
970
|
const coerceNumber = zod.z.union([zod.z.number(), zod.z.string()]).transform((val) => {
|
|
963
971
|
if (typeof val === "string") return val.trim() === "" ? void 0 : parseFloat(val);
|
|
@@ -1019,6 +1027,7 @@ const tConversationSchema = zod.z.object({
|
|
|
1019
1027
|
effort: eAnthropicEffortSchema.optional().nullable(),
|
|
1020
1028
|
thinkingDisplay: eThinkingDisplaySchema.optional().nullable(),
|
|
1021
1029
|
web_search: zod.z.boolean().optional(),
|
|
1030
|
+
url_context: zod.z.boolean().optional(),
|
|
1022
1031
|
disableStreaming: zod.z.boolean().optional(),
|
|
1023
1032
|
assistant_id: zod.z.string().optional(),
|
|
1024
1033
|
agent_id: zod.z.string().optional(),
|
|
@@ -1109,6 +1118,8 @@ const tQueryParamsSchema = tConversationSchema.pick({
|
|
|
1109
1118
|
useResponsesApi: true,
|
|
1110
1119
|
/** @endpoints openAI, anthropic, google */
|
|
1111
1120
|
web_search: true,
|
|
1121
|
+
/** @endpoints google */
|
|
1122
|
+
url_context: true,
|
|
1112
1123
|
/** @endpoints openAI, custom, azureOpenAI */
|
|
1113
1124
|
disableStreaming: true,
|
|
1114
1125
|
/** @endpoints google, anthropic, bedrock */
|
|
@@ -1206,6 +1217,7 @@ const googleBaseSchema = tConversationSchema.pick({
|
|
|
1206
1217
|
thinkingBudget: true,
|
|
1207
1218
|
thinkingLevel: true,
|
|
1208
1219
|
web_search: true,
|
|
1220
|
+
url_context: true,
|
|
1209
1221
|
fileTokenLimit: true,
|
|
1210
1222
|
iconURL: true,
|
|
1211
1223
|
greeting: true,
|
|
@@ -1232,7 +1244,8 @@ const googleGenConfigSchema = zod.z.object({
|
|
|
1232
1244
|
thinkingBudget: coerceNumber.optional(),
|
|
1233
1245
|
thinkingLevel: zod.z.string().optional()
|
|
1234
1246
|
}).optional(),
|
|
1235
|
-
web_search: zod.z.boolean().optional()
|
|
1247
|
+
web_search: zod.z.boolean().optional(),
|
|
1248
|
+
url_context: zod.z.boolean().optional()
|
|
1236
1249
|
}).strip().optional();
|
|
1237
1250
|
function removeNullishValues(obj, removeEmptyStrings) {
|
|
1238
1251
|
const newObj = { ...obj };
|
|
@@ -2457,10 +2470,15 @@ const messagesArtifacts = (messageId) => `${messagesRoot}/artifact/${messageId}`
|
|
|
2457
2470
|
const messagesBranch = () => `${messagesRoot}/branch`;
|
|
2458
2471
|
const shareRoot = `${BASE_URL}/api/share`;
|
|
2459
2472
|
const shareMessages = (shareId) => `${shareRoot}/${shareId}`;
|
|
2473
|
+
const sharedStartupConfig = (shareId) => `${shareMessages(shareId)}/config`;
|
|
2460
2474
|
const getSharedLink$1 = (conversationId) => `${shareRoot}/link/${conversationId}`;
|
|
2461
2475
|
const getSharedLinks = (pageSize, sortBy, sortDirection, search, cursor) => `${shareRoot}?pageSize=${pageSize}&sortBy=${sortBy}&sortDirection=${sortDirection}${search ? `&search=${search}` : ""}${cursor ? `&cursor=${cursor}` : ""}`;
|
|
2462
2476
|
const createSharedLink$1 = (conversationId) => `${shareRoot}/${conversationId}`;
|
|
2463
2477
|
const updateSharedLink$1 = (shareId) => `${shareRoot}/${shareId}`;
|
|
2478
|
+
/** Share-scoped file routes: serve snapshotted files via shared-link permission. */
|
|
2479
|
+
const sharedFile = (shareId, fileId) => `${shareRoot}/${shareId}/files/${encodeURIComponent(fileId)}`;
|
|
2480
|
+
const sharedFileDownload = (shareId, fileId) => `${sharedFile(shareId, fileId)}/download`;
|
|
2481
|
+
const sharedFilePreview = (shareId, fileId) => `${sharedFile(shareId, fileId)}/preview`;
|
|
2464
2482
|
const keysEndpoint = `${BASE_URL}/api/keys`;
|
|
2465
2483
|
const keys = () => keysEndpoint;
|
|
2466
2484
|
const userKeyQuery$1 = (name) => `${keysEndpoint}?name=${name}`;
|
|
@@ -3622,6 +3640,10 @@ const endpointSchema = baseEndpointSchema.merge(zod.z.object({
|
|
|
3622
3640
|
defaultParamsEndpoint: zod.z.string().default("custom"),
|
|
3623
3641
|
reasoningFormat: eReasoningParameterFormatSchema.optional(),
|
|
3624
3642
|
reasoningKey: eReasoningResponseKeySchema.optional(),
|
|
3643
|
+
/** Replays `reasoning_content` within a run's tool-call turns (e.g. Xiaomi MiMo, Kimi). */
|
|
3644
|
+
includeReasoningContent: zod.z.boolean().optional(),
|
|
3645
|
+
/** Also reconstructs `reasoning_content` from persisted history across turns (implies `includeReasoningContent`). */
|
|
3646
|
+
includeReasoningHistory: zod.z.boolean().optional(),
|
|
3625
3647
|
paramDefinitions: zod.z.array(paramDefinitionSchema).optional()
|
|
3626
3648
|
}).strict().optional(),
|
|
3627
3649
|
directEndpoint: zod.z.boolean().optional(),
|
|
@@ -3878,6 +3900,8 @@ const interfaceSchema = zod.z.object({
|
|
|
3878
3900
|
marketplace: zod.z.object({ use: zod.z.boolean().optional() }).optional(),
|
|
3879
3901
|
fileSearch: zod.z.boolean().optional(),
|
|
3880
3902
|
fileCitations: zod.z.boolean().optional(),
|
|
3903
|
+
/** Tool keys (and `'mcp'` or an MCP server name) pinned to the prompt bar by default */
|
|
3904
|
+
defaultPinnedTools: zod.z.array(zod.z.string()).optional(),
|
|
3881
3905
|
buildInfo: zod.z.boolean().optional(),
|
|
3882
3906
|
remoteAgents: zod.z.object({
|
|
3883
3907
|
use: zod.z.boolean().optional(),
|
|
@@ -3895,7 +3919,8 @@ const interfaceSchema = zod.z.object({
|
|
|
3895
3919
|
sharedLinks: zod.z.union([zod.z.boolean(), zod.z.object({
|
|
3896
3920
|
create: zod.z.boolean().optional(),
|
|
3897
3921
|
share: zod.z.boolean().optional(),
|
|
3898
|
-
public: zod.z.boolean().optional()
|
|
3922
|
+
public: zod.z.boolean().optional(),
|
|
3923
|
+
snapshotFiles: zod.z.boolean().optional()
|
|
3899
3924
|
})]).optional()
|
|
3900
3925
|
}).default({
|
|
3901
3926
|
modelSelect: true,
|
|
@@ -3953,7 +3978,8 @@ const interfaceSchema = zod.z.object({
|
|
|
3953
3978
|
sharedLinks: {
|
|
3954
3979
|
create: true,
|
|
3955
3980
|
share: true,
|
|
3956
|
-
public: true
|
|
3981
|
+
public: true,
|
|
3982
|
+
snapshotFiles: true
|
|
3957
3983
|
}
|
|
3958
3984
|
});
|
|
3959
3985
|
const turnstileOptionsSchema = zod.z.object({
|
|
@@ -4905,7 +4931,7 @@ let TTSProviders = /* @__PURE__ */ function(TTSProviders) {
|
|
|
4905
4931
|
/** Enum for app-wide constants */
|
|
4906
4932
|
let Constants = /* @__PURE__ */ function(Constants) {
|
|
4907
4933
|
/**
|
|
4908
|
-
* Key for the app's version. The placeholder `v0.8.7
|
|
4934
|
+
* Key for the app's version. The placeholder `v0.8.7` is
|
|
4909
4935
|
* swapped in by `@rollup/plugin-replace` during `npm run build:data-provider`
|
|
4910
4936
|
* using the value of the root `package.json`'s `version` field. Consumers
|
|
4911
4937
|
* always import this via the built dist bundle (see `main` field in
|
|
@@ -4913,7 +4939,7 @@ let Constants = /* @__PURE__ */ function(Constants) {
|
|
|
4913
4939
|
* substituted value. Only tests that import the TypeScript source directly
|
|
4914
4940
|
* would observe the raw placeholder.
|
|
4915
4941
|
*/
|
|
4916
|
-
Constants["VERSION"] = "v0.8.7
|
|
4942
|
+
Constants["VERSION"] = "v0.8.7";
|
|
4917
4943
|
/** Key for the Custom Config's version (librechat.yaml). */
|
|
4918
4944
|
Constants["CONFIG_VERSION"] = "1.3.13";
|
|
4919
4945
|
/** Standard value for the first message's `parentMessageId` value, to indicate no parent exists. */
|
|
@@ -5331,6 +5357,7 @@ function hasPermissions(permissions, requiredPermission) {
|
|
|
5331
5357
|
let QueryKeys = /* @__PURE__ */ function(QueryKeys) {
|
|
5332
5358
|
QueryKeys["messages"] = "messages";
|
|
5333
5359
|
QueryKeys["sharedMessages"] = "sharedMessages";
|
|
5360
|
+
QueryKeys["sharedStartupConfig"] = "sharedStartupConfig";
|
|
5334
5361
|
QueryKeys["sharedLinks"] = "sharedLinks";
|
|
5335
5362
|
QueryKeys["allConversations"] = "allConversations";
|
|
5336
5363
|
QueryKeys["archivedConversations"] = "archivedConversations";
|
|
@@ -5500,6 +5527,27 @@ const AUTH_REDIRECT_STORAGE_KEY = "librechat.auth.redirect.startedAt";
|
|
|
5500
5527
|
const AUTH_REDIRECT_DEDUPE_MS = 15e3;
|
|
5501
5528
|
const TOKEN_REFRESH_BUFFER_MS = 120 * 1e3;
|
|
5502
5529
|
const refreshToken = (retry) => _post(refreshToken$1(retry));
|
|
5530
|
+
const SHARE_PAGE_PATH_REGEX = /^\/share\/[^/]+\/?$/;
|
|
5531
|
+
const SHARED_MESSAGES_PATH_REGEX = /^\/api\/share\/[^/]+$/;
|
|
5532
|
+
const normalizePathname = (pathname) => pathname.startsWith("/") ? pathname : `/${pathname}`;
|
|
5533
|
+
const stripBasePath = (pathname) => {
|
|
5534
|
+
const normalizedPathname = normalizePathname(pathname);
|
|
5535
|
+
const baseUrl = apiBaseUrl();
|
|
5536
|
+
if (!baseUrl) return normalizedPathname;
|
|
5537
|
+
const normalizedBaseUrl = normalizePathname(baseUrl);
|
|
5538
|
+
if (normalizedPathname === normalizedBaseUrl || normalizedPathname.startsWith(`${normalizedBaseUrl}/`)) return normalizedPathname.slice(normalizedBaseUrl.length) || "/";
|
|
5539
|
+
return normalizedPathname;
|
|
5540
|
+
};
|
|
5541
|
+
const isSharePage = () => SHARE_PAGE_PATH_REGEX.test(stripBasePath(window.location.pathname));
|
|
5542
|
+
const getRequestPathname = (url) => {
|
|
5543
|
+
if (typeof url !== "string") return "";
|
|
5544
|
+
try {
|
|
5545
|
+
return new URL(url, window.location.origin).pathname;
|
|
5546
|
+
} catch {
|
|
5547
|
+
return url.split(/[?#]/)[0] ?? "";
|
|
5548
|
+
}
|
|
5549
|
+
};
|
|
5550
|
+
const isSharedMessagesRequest = (url, method) => method?.toLowerCase() === "get" && SHARED_MESSAGES_PATH_REGEX.test(stripBasePath(getRequestPathname(url)));
|
|
5503
5551
|
const dispatchTokenUpdatedEvent = (token) => {
|
|
5504
5552
|
setTokenHeader(token);
|
|
5505
5553
|
clearAuthRedirectStartedAt();
|
|
@@ -5619,8 +5667,9 @@ if (typeof window !== "undefined") {
|
|
|
5619
5667
|
if (isAuthRecoveryEndpoint(originalRequest.url) && !isRefreshRequest) return Promise.reject(error);
|
|
5620
5668
|
if (isRefreshRequest && getAuthRecoveryState().refreshPromise) return Promise.reject(error);
|
|
5621
5669
|
/** Skip refresh when the Authorization header has been cleared (e.g. during logout),
|
|
5622
|
-
* but allow shared link
|
|
5623
|
-
|
|
5670
|
+
* but allow the shared link data request to proceed so private shares can still
|
|
5671
|
+
* recover auth/redirect without unrelated share-page queries forcing login. */
|
|
5672
|
+
if (!axios.default.defaults.headers.common["Authorization"] && !(isSharePage() && isSharedMessagesRequest(originalRequest.url, originalRequest.method))) return Promise.reject(error);
|
|
5624
5673
|
if (isAuthRedirectInProgress()) return Promise.reject(error);
|
|
5625
5674
|
if (error.response.status === 401 && !originalRequest._retry) {
|
|
5626
5675
|
if (!(getAuthRecoveryState().refreshPromise != null)) console.warn("401 error, refreshing token");
|
|
@@ -5762,8 +5811,11 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5762
5811
|
getResourcePermissions: () => getResourcePermissions,
|
|
5763
5812
|
getRole: () => getRole,
|
|
5764
5813
|
getSearchEnabled: () => getSearchEnabled,
|
|
5814
|
+
getSharedFileDownload: () => getSharedFileDownload,
|
|
5815
|
+
getSharedFilePreview: () => getSharedFilePreview,
|
|
5765
5816
|
getSharedLink: () => getSharedLink,
|
|
5766
5817
|
getSharedMessages: () => getSharedMessages,
|
|
5818
|
+
getSharedStartupConfig: () => getSharedStartupConfig,
|
|
5767
5819
|
getSkill: () => getSkill,
|
|
5768
5820
|
getSkillFavorites: () => getSkillFavorites,
|
|
5769
5821
|
getSkillFileContent: () => getSkillFileContent,
|
|
@@ -5892,6 +5944,9 @@ function updateSkillStates(skillStates$1) {
|
|
|
5892
5944
|
function getSharedMessages(shareId) {
|
|
5893
5945
|
return request_default.get(shareMessages(shareId));
|
|
5894
5946
|
}
|
|
5947
|
+
function getSharedStartupConfig(shareId) {
|
|
5948
|
+
return request_default.get(sharedStartupConfig(shareId));
|
|
5949
|
+
}
|
|
5895
5950
|
const listSharedLinks = async (params) => {
|
|
5896
5951
|
const { pageSize, sortBy, sortDirection, search, cursor } = params;
|
|
5897
5952
|
return request_default.get(getSharedLinks(pageSize, sortBy, sortDirection, search, cursor));
|
|
@@ -5899,11 +5954,17 @@ const listSharedLinks = async (params) => {
|
|
|
5899
5954
|
function getSharedLink(conversationId) {
|
|
5900
5955
|
return request_default.get(getSharedLink$1(conversationId));
|
|
5901
5956
|
}
|
|
5902
|
-
function createSharedLink(conversationId, targetMessageId) {
|
|
5903
|
-
return request_default.post(createSharedLink$1(conversationId), {
|
|
5957
|
+
function createSharedLink(conversationId, targetMessageId, snapshotFiles) {
|
|
5958
|
+
return request_default.post(createSharedLink$1(conversationId), {
|
|
5959
|
+
targetMessageId,
|
|
5960
|
+
snapshotFiles
|
|
5961
|
+
});
|
|
5904
5962
|
}
|
|
5905
|
-
function updateSharedLink(shareId, targetMessageId) {
|
|
5906
|
-
return request_default.patch(updateSharedLink$1(shareId), {
|
|
5963
|
+
function updateSharedLink(shareId, targetMessageId, snapshotFiles) {
|
|
5964
|
+
return request_default.patch(updateSharedLink$1(shareId), {
|
|
5965
|
+
targetMessageId,
|
|
5966
|
+
snapshotFiles
|
|
5967
|
+
});
|
|
5907
5968
|
}
|
|
5908
5969
|
function deleteSharedLink(shareId) {
|
|
5909
5970
|
return request_default.delete(shareMessages(shareId));
|
|
@@ -6099,6 +6160,10 @@ const getFiles = () => {
|
|
|
6099
6160
|
const getFilePreview = (fileId) => {
|
|
6100
6161
|
return request_default.get(filePreview(fileId));
|
|
6101
6162
|
};
|
|
6163
|
+
/** Preview status for a snapshotted file served through a shared link. */
|
|
6164
|
+
const getSharedFilePreview = (shareId, fileId) => {
|
|
6165
|
+
return request_default.get(sharedFilePreview(shareId, fileId));
|
|
6166
|
+
};
|
|
6102
6167
|
const getAgentFiles = (agentId) => {
|
|
6103
6168
|
return request_default.get(agentFiles(agentId));
|
|
6104
6169
|
};
|
|
@@ -6242,6 +6307,13 @@ const getFileDownload = async (userId, file_id) => {
|
|
|
6242
6307
|
const getFileDownloadURL = async (userId, file_id) => {
|
|
6243
6308
|
return request_default.get(`${files()}/download-url/${userId}/${file_id}`);
|
|
6244
6309
|
};
|
|
6310
|
+
/** Blob download for a snapshotted file served through a shared link. */
|
|
6311
|
+
const getSharedFileDownload = async (shareId, file_id) => {
|
|
6312
|
+
return request_default.getResponse(sharedFileDownload(shareId, file_id), {
|
|
6313
|
+
responseType: "blob",
|
|
6314
|
+
headers: { Accept: "application/octet-stream" }
|
|
6315
|
+
});
|
|
6316
|
+
};
|
|
6245
6317
|
const getCodeOutputDownload = async (url) => {
|
|
6246
6318
|
return request_default.getResponse(url, {
|
|
6247
6319
|
responseType: "blob",
|
|
@@ -8352,6 +8424,12 @@ Object.defineProperty(exports, "setTokenHeader", {
|
|
|
8352
8424
|
return setTokenHeader;
|
|
8353
8425
|
}
|
|
8354
8426
|
});
|
|
8427
|
+
Object.defineProperty(exports, "sharedFileDownload", {
|
|
8428
|
+
enumerable: true,
|
|
8429
|
+
get: function() {
|
|
8430
|
+
return sharedFileDownload;
|
|
8431
|
+
}
|
|
8432
|
+
});
|
|
8355
8433
|
Object.defineProperty(exports, "skillSyncConfigSchema", {
|
|
8356
8434
|
enumerable: true,
|
|
8357
8435
|
get: function() {
|
|
@@ -8617,4 +8695,4 @@ Object.defineProperty(exports, "webSearchSchema", {
|
|
|
8617
8695
|
}
|
|
8618
8696
|
});
|
|
8619
8697
|
|
|
8620
|
-
//# sourceMappingURL=data-service-
|
|
8698
|
+
//# sourceMappingURL=data-service-XTxx76uB.js.map
|