librechat-data-provider 0.8.506 → 0.8.508
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-CCdWvcRd.js → data-service-DN-HeTC-.js} +73 -10
- package/dist/data-service-DN-HeTC-.js.map +1 -0
- package/dist/{data-service-D7mtXwG5.mjs → data-service-DgNwjhBS.mjs} +68 -11
- package/dist/data-service-DgNwjhBS.mjs.map +1 -0
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -10
- 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 +4 -0
- package/dist/types/config.d.ts +33 -0
- package/dist/types/data-service.d.ts +6 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/schemas.d.ts +10 -0
- package/dist/types/types/mutations.d.ts +5 -5
- package/dist/types/types.d.ts +2 -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);
|
|
@@ -2461,6 +2469,10 @@ const getSharedLink$1 = (conversationId) => `${shareRoot}/link/${conversationId}
|
|
|
2461
2469
|
const getSharedLinks = (pageSize, sortBy, sortDirection, search, cursor) => `${shareRoot}?pageSize=${pageSize}&sortBy=${sortBy}&sortDirection=${sortDirection}${search ? `&search=${search}` : ""}${cursor ? `&cursor=${cursor}` : ""}`;
|
|
2462
2470
|
const createSharedLink$1 = (conversationId) => `${shareRoot}/${conversationId}`;
|
|
2463
2471
|
const updateSharedLink$1 = (shareId) => `${shareRoot}/${shareId}`;
|
|
2472
|
+
/** Share-scoped file routes: serve snapshotted files via shared-link permission. */
|
|
2473
|
+
const sharedFile = (shareId, fileId) => `${shareRoot}/${shareId}/files/${encodeURIComponent(fileId)}`;
|
|
2474
|
+
const sharedFileDownload = (shareId, fileId) => `${sharedFile(shareId, fileId)}/download`;
|
|
2475
|
+
const sharedFilePreview = (shareId, fileId) => `${sharedFile(shareId, fileId)}/preview`;
|
|
2464
2476
|
const keysEndpoint = `${BASE_URL}/api/keys`;
|
|
2465
2477
|
const keys = () => keysEndpoint;
|
|
2466
2478
|
const userKeyQuery$1 = (name) => `${keysEndpoint}?name=${name}`;
|
|
@@ -3878,6 +3890,8 @@ const interfaceSchema = zod.z.object({
|
|
|
3878
3890
|
marketplace: zod.z.object({ use: zod.z.boolean().optional() }).optional(),
|
|
3879
3891
|
fileSearch: zod.z.boolean().optional(),
|
|
3880
3892
|
fileCitations: zod.z.boolean().optional(),
|
|
3893
|
+
/** Tool keys (and `'mcp'` or an MCP server name) pinned to the prompt bar by default */
|
|
3894
|
+
defaultPinnedTools: zod.z.array(zod.z.string()).optional(),
|
|
3881
3895
|
buildInfo: zod.z.boolean().optional(),
|
|
3882
3896
|
remoteAgents: zod.z.object({
|
|
3883
3897
|
use: zod.z.boolean().optional(),
|
|
@@ -3895,7 +3909,8 @@ const interfaceSchema = zod.z.object({
|
|
|
3895
3909
|
sharedLinks: zod.z.union([zod.z.boolean(), zod.z.object({
|
|
3896
3910
|
create: zod.z.boolean().optional(),
|
|
3897
3911
|
share: zod.z.boolean().optional(),
|
|
3898
|
-
public: zod.z.boolean().optional()
|
|
3912
|
+
public: zod.z.boolean().optional(),
|
|
3913
|
+
snapshotFiles: zod.z.boolean().optional()
|
|
3899
3914
|
})]).optional()
|
|
3900
3915
|
}).default({
|
|
3901
3916
|
modelSelect: true,
|
|
@@ -3953,7 +3968,8 @@ const interfaceSchema = zod.z.object({
|
|
|
3953
3968
|
sharedLinks: {
|
|
3954
3969
|
create: true,
|
|
3955
3970
|
share: true,
|
|
3956
|
-
public: true
|
|
3971
|
+
public: true,
|
|
3972
|
+
snapshotFiles: true
|
|
3957
3973
|
}
|
|
3958
3974
|
});
|
|
3959
3975
|
const turnstileOptionsSchema = zod.z.object({
|
|
@@ -5500,6 +5516,27 @@ const AUTH_REDIRECT_STORAGE_KEY = "librechat.auth.redirect.startedAt";
|
|
|
5500
5516
|
const AUTH_REDIRECT_DEDUPE_MS = 15e3;
|
|
5501
5517
|
const TOKEN_REFRESH_BUFFER_MS = 120 * 1e3;
|
|
5502
5518
|
const refreshToken = (retry) => _post(refreshToken$1(retry));
|
|
5519
|
+
const SHARE_PAGE_PATH_REGEX = /^\/share\/[^/]+\/?$/;
|
|
5520
|
+
const SHARED_MESSAGES_PATH_REGEX = /^\/api\/share\/[^/]+$/;
|
|
5521
|
+
const normalizePathname = (pathname) => pathname.startsWith("/") ? pathname : `/${pathname}`;
|
|
5522
|
+
const stripBasePath = (pathname) => {
|
|
5523
|
+
const normalizedPathname = normalizePathname(pathname);
|
|
5524
|
+
const baseUrl = apiBaseUrl();
|
|
5525
|
+
if (!baseUrl) return normalizedPathname;
|
|
5526
|
+
const normalizedBaseUrl = normalizePathname(baseUrl);
|
|
5527
|
+
if (normalizedPathname === normalizedBaseUrl || normalizedPathname.startsWith(`${normalizedBaseUrl}/`)) return normalizedPathname.slice(normalizedBaseUrl.length) || "/";
|
|
5528
|
+
return normalizedPathname;
|
|
5529
|
+
};
|
|
5530
|
+
const isSharePage = () => SHARE_PAGE_PATH_REGEX.test(stripBasePath(window.location.pathname));
|
|
5531
|
+
const getRequestPathname = (url) => {
|
|
5532
|
+
if (typeof url !== "string") return "";
|
|
5533
|
+
try {
|
|
5534
|
+
return new URL(url, window.location.origin).pathname;
|
|
5535
|
+
} catch {
|
|
5536
|
+
return url.split(/[?#]/)[0] ?? "";
|
|
5537
|
+
}
|
|
5538
|
+
};
|
|
5539
|
+
const isSharedMessagesRequest = (url, method) => method?.toLowerCase() === "get" && SHARED_MESSAGES_PATH_REGEX.test(stripBasePath(getRequestPathname(url)));
|
|
5503
5540
|
const dispatchTokenUpdatedEvent = (token) => {
|
|
5504
5541
|
setTokenHeader(token);
|
|
5505
5542
|
clearAuthRedirectStartedAt();
|
|
@@ -5619,8 +5656,9 @@ if (typeof window !== "undefined") {
|
|
|
5619
5656
|
if (isAuthRecoveryEndpoint(originalRequest.url) && !isRefreshRequest) return Promise.reject(error);
|
|
5620
5657
|
if (isRefreshRequest && getAuthRecoveryState().refreshPromise) return Promise.reject(error);
|
|
5621
5658
|
/** Skip refresh when the Authorization header has been cleared (e.g. during logout),
|
|
5622
|
-
* but allow shared link
|
|
5623
|
-
|
|
5659
|
+
* but allow the shared link data request to proceed so private shares can still
|
|
5660
|
+
* recover auth/redirect without unrelated share-page queries forcing login. */
|
|
5661
|
+
if (!axios.default.defaults.headers.common["Authorization"] && !(isSharePage() && isSharedMessagesRequest(originalRequest.url, originalRequest.method))) return Promise.reject(error);
|
|
5624
5662
|
if (isAuthRedirectInProgress()) return Promise.reject(error);
|
|
5625
5663
|
if (error.response.status === 401 && !originalRequest._retry) {
|
|
5626
5664
|
if (!(getAuthRecoveryState().refreshPromise != null)) console.warn("401 error, refreshing token");
|
|
@@ -5762,6 +5800,8 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5762
5800
|
getResourcePermissions: () => getResourcePermissions,
|
|
5763
5801
|
getRole: () => getRole,
|
|
5764
5802
|
getSearchEnabled: () => getSearchEnabled,
|
|
5803
|
+
getSharedFileDownload: () => getSharedFileDownload,
|
|
5804
|
+
getSharedFilePreview: () => getSharedFilePreview,
|
|
5765
5805
|
getSharedLink: () => getSharedLink,
|
|
5766
5806
|
getSharedMessages: () => getSharedMessages,
|
|
5767
5807
|
getSkill: () => getSkill,
|
|
@@ -5899,11 +5939,17 @@ const listSharedLinks = async (params) => {
|
|
|
5899
5939
|
function getSharedLink(conversationId) {
|
|
5900
5940
|
return request_default.get(getSharedLink$1(conversationId));
|
|
5901
5941
|
}
|
|
5902
|
-
function createSharedLink(conversationId, targetMessageId) {
|
|
5903
|
-
return request_default.post(createSharedLink$1(conversationId), {
|
|
5942
|
+
function createSharedLink(conversationId, targetMessageId, snapshotFiles) {
|
|
5943
|
+
return request_default.post(createSharedLink$1(conversationId), {
|
|
5944
|
+
targetMessageId,
|
|
5945
|
+
snapshotFiles
|
|
5946
|
+
});
|
|
5904
5947
|
}
|
|
5905
|
-
function updateSharedLink(shareId, targetMessageId) {
|
|
5906
|
-
return request_default.patch(updateSharedLink$1(shareId), {
|
|
5948
|
+
function updateSharedLink(shareId, targetMessageId, snapshotFiles) {
|
|
5949
|
+
return request_default.patch(updateSharedLink$1(shareId), {
|
|
5950
|
+
targetMessageId,
|
|
5951
|
+
snapshotFiles
|
|
5952
|
+
});
|
|
5907
5953
|
}
|
|
5908
5954
|
function deleteSharedLink(shareId) {
|
|
5909
5955
|
return request_default.delete(shareMessages(shareId));
|
|
@@ -6099,6 +6145,10 @@ const getFiles = () => {
|
|
|
6099
6145
|
const getFilePreview = (fileId) => {
|
|
6100
6146
|
return request_default.get(filePreview(fileId));
|
|
6101
6147
|
};
|
|
6148
|
+
/** Preview status for a snapshotted file served through a shared link. */
|
|
6149
|
+
const getSharedFilePreview = (shareId, fileId) => {
|
|
6150
|
+
return request_default.get(sharedFilePreview(shareId, fileId));
|
|
6151
|
+
};
|
|
6102
6152
|
const getAgentFiles = (agentId) => {
|
|
6103
6153
|
return request_default.get(agentFiles(agentId));
|
|
6104
6154
|
};
|
|
@@ -6242,6 +6292,13 @@ const getFileDownload = async (userId, file_id) => {
|
|
|
6242
6292
|
const getFileDownloadURL = async (userId, file_id) => {
|
|
6243
6293
|
return request_default.get(`${files()}/download-url/${userId}/${file_id}`);
|
|
6244
6294
|
};
|
|
6295
|
+
/** Blob download for a snapshotted file served through a shared link. */
|
|
6296
|
+
const getSharedFileDownload = async (shareId, file_id) => {
|
|
6297
|
+
return request_default.getResponse(sharedFileDownload(shareId, file_id), {
|
|
6298
|
+
responseType: "blob",
|
|
6299
|
+
headers: { Accept: "application/octet-stream" }
|
|
6300
|
+
});
|
|
6301
|
+
};
|
|
6245
6302
|
const getCodeOutputDownload = async (url) => {
|
|
6246
6303
|
return request_default.getResponse(url, {
|
|
6247
6304
|
responseType: "blob",
|
|
@@ -8352,6 +8409,12 @@ Object.defineProperty(exports, "setTokenHeader", {
|
|
|
8352
8409
|
return setTokenHeader;
|
|
8353
8410
|
}
|
|
8354
8411
|
});
|
|
8412
|
+
Object.defineProperty(exports, "sharedFileDownload", {
|
|
8413
|
+
enumerable: true,
|
|
8414
|
+
get: function() {
|
|
8415
|
+
return sharedFileDownload;
|
|
8416
|
+
}
|
|
8417
|
+
});
|
|
8355
8418
|
Object.defineProperty(exports, "skillSyncConfigSchema", {
|
|
8356
8419
|
enumerable: true,
|
|
8357
8420
|
get: function() {
|
|
@@ -8617,4 +8680,4 @@ Object.defineProperty(exports, "webSearchSchema", {
|
|
|
8617
8680
|
}
|
|
8618
8681
|
});
|
|
8619
8682
|
|
|
8620
|
-
//# sourceMappingURL=data-service-
|
|
8683
|
+
//# sourceMappingURL=data-service-DN-HeTC-.js.map
|