librechat-data-provider 0.8.507 → 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 +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -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 +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
|
@@ -937,7 +937,15 @@ const tMessageSchema = z.object({
|
|
|
937
937
|
* edits to the skill's `alwaysApply` flag (the user bubble reflects
|
|
938
938
|
* what actually ran, not the current catalog).
|
|
939
939
|
*/
|
|
940
|
-
alwaysAppliedSkills: z.array(z.string()).optional()
|
|
940
|
+
alwaysAppliedSkills: z.array(z.string()).optional(),
|
|
941
|
+
/**
|
|
942
|
+
* Verbatim excerpts the user quoted (via the "Add to chat" selection
|
|
943
|
+
* popup) to reference on this turn. UI metadata that `MessageQuotes`
|
|
944
|
+
* renders above the user bubble so the references persist on reload. The
|
|
945
|
+
* excerpts are merged into the user message text sent to the model at
|
|
946
|
+
* request time and counted in the user message token count.
|
|
947
|
+
*/
|
|
948
|
+
quotes: z.array(z.string()).optional()
|
|
941
949
|
});
|
|
942
950
|
const coerceNumber = z.union([z.number(), z.string()]).transform((val) => {
|
|
943
951
|
if (typeof val === "string") return val.trim() === "" ? void 0 : parseFloat(val);
|
|
@@ -2441,6 +2449,10 @@ const getSharedLink$1 = (conversationId) => `${shareRoot}/link/${conversationId}
|
|
|
2441
2449
|
const getSharedLinks = (pageSize, sortBy, sortDirection, search, cursor) => `${shareRoot}?pageSize=${pageSize}&sortBy=${sortBy}&sortDirection=${sortDirection}${search ? `&search=${search}` : ""}${cursor ? `&cursor=${cursor}` : ""}`;
|
|
2442
2450
|
const createSharedLink$1 = (conversationId) => `${shareRoot}/${conversationId}`;
|
|
2443
2451
|
const updateSharedLink$1 = (shareId) => `${shareRoot}/${shareId}`;
|
|
2452
|
+
/** Share-scoped file routes: serve snapshotted files via shared-link permission. */
|
|
2453
|
+
const sharedFile = (shareId, fileId) => `${shareRoot}/${shareId}/files/${encodeURIComponent(fileId)}`;
|
|
2454
|
+
const sharedFileDownload = (shareId, fileId) => `${sharedFile(shareId, fileId)}/download`;
|
|
2455
|
+
const sharedFilePreview = (shareId, fileId) => `${sharedFile(shareId, fileId)}/preview`;
|
|
2444
2456
|
const keysEndpoint = `${BASE_URL}/api/keys`;
|
|
2445
2457
|
const keys = () => keysEndpoint;
|
|
2446
2458
|
const userKeyQuery$1 = (name) => `${keysEndpoint}?name=${name}`;
|
|
@@ -3858,6 +3870,8 @@ const interfaceSchema = z.object({
|
|
|
3858
3870
|
marketplace: z.object({ use: z.boolean().optional() }).optional(),
|
|
3859
3871
|
fileSearch: z.boolean().optional(),
|
|
3860
3872
|
fileCitations: z.boolean().optional(),
|
|
3873
|
+
/** Tool keys (and `'mcp'` or an MCP server name) pinned to the prompt bar by default */
|
|
3874
|
+
defaultPinnedTools: z.array(z.string()).optional(),
|
|
3861
3875
|
buildInfo: z.boolean().optional(),
|
|
3862
3876
|
remoteAgents: z.object({
|
|
3863
3877
|
use: z.boolean().optional(),
|
|
@@ -3875,7 +3889,8 @@ const interfaceSchema = z.object({
|
|
|
3875
3889
|
sharedLinks: z.union([z.boolean(), z.object({
|
|
3876
3890
|
create: z.boolean().optional(),
|
|
3877
3891
|
share: z.boolean().optional(),
|
|
3878
|
-
public: z.boolean().optional()
|
|
3892
|
+
public: z.boolean().optional(),
|
|
3893
|
+
snapshotFiles: z.boolean().optional()
|
|
3879
3894
|
})]).optional()
|
|
3880
3895
|
}).default({
|
|
3881
3896
|
modelSelect: true,
|
|
@@ -3933,7 +3948,8 @@ const interfaceSchema = z.object({
|
|
|
3933
3948
|
sharedLinks: {
|
|
3934
3949
|
create: true,
|
|
3935
3950
|
share: true,
|
|
3936
|
-
public: true
|
|
3951
|
+
public: true,
|
|
3952
|
+
snapshotFiles: true
|
|
3937
3953
|
}
|
|
3938
3954
|
});
|
|
3939
3955
|
const turnstileOptionsSchema = z.object({
|
|
@@ -5480,6 +5496,27 @@ const AUTH_REDIRECT_STORAGE_KEY = "librechat.auth.redirect.startedAt";
|
|
|
5480
5496
|
const AUTH_REDIRECT_DEDUPE_MS = 15e3;
|
|
5481
5497
|
const TOKEN_REFRESH_BUFFER_MS = 120 * 1e3;
|
|
5482
5498
|
const refreshToken = (retry) => _post(refreshToken$1(retry));
|
|
5499
|
+
const SHARE_PAGE_PATH_REGEX = /^\/share\/[^/]+\/?$/;
|
|
5500
|
+
const SHARED_MESSAGES_PATH_REGEX = /^\/api\/share\/[^/]+$/;
|
|
5501
|
+
const normalizePathname = (pathname) => pathname.startsWith("/") ? pathname : `/${pathname}`;
|
|
5502
|
+
const stripBasePath = (pathname) => {
|
|
5503
|
+
const normalizedPathname = normalizePathname(pathname);
|
|
5504
|
+
const baseUrl = apiBaseUrl();
|
|
5505
|
+
if (!baseUrl) return normalizedPathname;
|
|
5506
|
+
const normalizedBaseUrl = normalizePathname(baseUrl);
|
|
5507
|
+
if (normalizedPathname === normalizedBaseUrl || normalizedPathname.startsWith(`${normalizedBaseUrl}/`)) return normalizedPathname.slice(normalizedBaseUrl.length) || "/";
|
|
5508
|
+
return normalizedPathname;
|
|
5509
|
+
};
|
|
5510
|
+
const isSharePage = () => SHARE_PAGE_PATH_REGEX.test(stripBasePath(window.location.pathname));
|
|
5511
|
+
const getRequestPathname = (url) => {
|
|
5512
|
+
if (typeof url !== "string") return "";
|
|
5513
|
+
try {
|
|
5514
|
+
return new URL(url, window.location.origin).pathname;
|
|
5515
|
+
} catch {
|
|
5516
|
+
return url.split(/[?#]/)[0] ?? "";
|
|
5517
|
+
}
|
|
5518
|
+
};
|
|
5519
|
+
const isSharedMessagesRequest = (url, method) => method?.toLowerCase() === "get" && SHARED_MESSAGES_PATH_REGEX.test(stripBasePath(getRequestPathname(url)));
|
|
5483
5520
|
const dispatchTokenUpdatedEvent = (token) => {
|
|
5484
5521
|
setTokenHeader(token);
|
|
5485
5522
|
clearAuthRedirectStartedAt();
|
|
@@ -5599,8 +5636,9 @@ if (typeof window !== "undefined") {
|
|
|
5599
5636
|
if (isAuthRecoveryEndpoint(originalRequest.url) && !isRefreshRequest) return Promise.reject(error);
|
|
5600
5637
|
if (isRefreshRequest && getAuthRecoveryState().refreshPromise) return Promise.reject(error);
|
|
5601
5638
|
/** Skip refresh when the Authorization header has been cleared (e.g. during logout),
|
|
5602
|
-
* but allow shared link
|
|
5603
|
-
|
|
5639
|
+
* but allow the shared link data request to proceed so private shares can still
|
|
5640
|
+
* recover auth/redirect without unrelated share-page queries forcing login. */
|
|
5641
|
+
if (!axios.defaults.headers.common["Authorization"] && !(isSharePage() && isSharedMessagesRequest(originalRequest.url, originalRequest.method))) return Promise.reject(error);
|
|
5604
5642
|
if (isAuthRedirectInProgress()) return Promise.reject(error);
|
|
5605
5643
|
if (error.response.status === 401 && !originalRequest._retry) {
|
|
5606
5644
|
if (!(getAuthRecoveryState().refreshPromise != null)) console.warn("401 error, refreshing token");
|
|
@@ -5742,6 +5780,8 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5742
5780
|
getResourcePermissions: () => getResourcePermissions,
|
|
5743
5781
|
getRole: () => getRole,
|
|
5744
5782
|
getSearchEnabled: () => getSearchEnabled,
|
|
5783
|
+
getSharedFileDownload: () => getSharedFileDownload,
|
|
5784
|
+
getSharedFilePreview: () => getSharedFilePreview,
|
|
5745
5785
|
getSharedLink: () => getSharedLink,
|
|
5746
5786
|
getSharedMessages: () => getSharedMessages,
|
|
5747
5787
|
getSkill: () => getSkill,
|
|
@@ -5879,11 +5919,17 @@ const listSharedLinks = async (params) => {
|
|
|
5879
5919
|
function getSharedLink(conversationId) {
|
|
5880
5920
|
return request_default.get(getSharedLink$1(conversationId));
|
|
5881
5921
|
}
|
|
5882
|
-
function createSharedLink(conversationId, targetMessageId) {
|
|
5883
|
-
return request_default.post(createSharedLink$1(conversationId), {
|
|
5922
|
+
function createSharedLink(conversationId, targetMessageId, snapshotFiles) {
|
|
5923
|
+
return request_default.post(createSharedLink$1(conversationId), {
|
|
5924
|
+
targetMessageId,
|
|
5925
|
+
snapshotFiles
|
|
5926
|
+
});
|
|
5884
5927
|
}
|
|
5885
|
-
function updateSharedLink(shareId, targetMessageId) {
|
|
5886
|
-
return request_default.patch(updateSharedLink$1(shareId), {
|
|
5928
|
+
function updateSharedLink(shareId, targetMessageId, snapshotFiles) {
|
|
5929
|
+
return request_default.patch(updateSharedLink$1(shareId), {
|
|
5930
|
+
targetMessageId,
|
|
5931
|
+
snapshotFiles
|
|
5932
|
+
});
|
|
5887
5933
|
}
|
|
5888
5934
|
function deleteSharedLink(shareId) {
|
|
5889
5935
|
return request_default.delete(shareMessages(shareId));
|
|
@@ -6079,6 +6125,10 @@ const getFiles = () => {
|
|
|
6079
6125
|
const getFilePreview = (fileId) => {
|
|
6080
6126
|
return request_default.get(filePreview(fileId));
|
|
6081
6127
|
};
|
|
6128
|
+
/** Preview status for a snapshotted file served through a shared link. */
|
|
6129
|
+
const getSharedFilePreview = (shareId, fileId) => {
|
|
6130
|
+
return request_default.get(sharedFilePreview(shareId, fileId));
|
|
6131
|
+
};
|
|
6082
6132
|
const getAgentFiles = (agentId) => {
|
|
6083
6133
|
return request_default.get(agentFiles(agentId));
|
|
6084
6134
|
};
|
|
@@ -6222,6 +6272,13 @@ const getFileDownload = async (userId, file_id) => {
|
|
|
6222
6272
|
const getFileDownloadURL = async (userId, file_id) => {
|
|
6223
6273
|
return request_default.get(`${files()}/download-url/${userId}/${file_id}`);
|
|
6224
6274
|
};
|
|
6275
|
+
/** Blob download for a snapshotted file served through a shared link. */
|
|
6276
|
+
const getSharedFileDownload = async (shareId, file_id) => {
|
|
6277
|
+
return request_default.getResponse(sharedFileDownload(shareId, file_id), {
|
|
6278
|
+
responseType: "blob",
|
|
6279
|
+
headers: { Accept: "application/octet-stream" }
|
|
6280
|
+
});
|
|
6281
|
+
};
|
|
6225
6282
|
const getCodeOutputDownload = async (url) => {
|
|
6226
6283
|
return request_default.getResponse(url, {
|
|
6227
6284
|
responseType: "blob",
|
|
@@ -6604,6 +6661,6 @@ const getActiveJobs = () => {
|
|
|
6604
6661
|
return request_default.get(activeJobs());
|
|
6605
6662
|
};
|
|
6606
6663
|
//#endregion
|
|
6607
|
-
export { permissionEntrySchema as $,
|
|
6664
|
+
export { permissionEntrySchema as $, feedbackSchema as $a, extendedModelEndpointSchema as $i, MCP_USER_INPUT_FIELDS as $n, specsConfigSchema as $r, balanceSchema as $t, updateResourcePermissions as A, tPluginAuthConfigSchema as Aa, anthropicSettings as Ai, modularEndpoints as An, fileConfig as Ar, SKILL_SYNC_MAX_INTERVAL_MINUTES as At, MutationKeys as B, RunStatus as Ba, defaultAssistantFormValues as Bi, summarizationTriggerSchema as Bn, mbToBytes as Br, TTSProviders as Bt, resetPassword as C, tBannerSchema as Ca, ThinkingLevel as Ci, initialModelsConfig as Cn, defaultOCRMimeTypes as Cr, MAX_SUBAGENT_RUN_CONFIGS as Ct, updateFeedback as D, tExampleSchema as Da, agentsSettings as Di, messageFilterPiiSchema as Dn, endpointFileConfigSchema as Dr, RetentionMode as Dt, searchPrincipals as E, tConvoUpdateSchema as Ea, agentsSchema as Ei, memorySchema as En, documentParserMimeTypes as Er, RerankerTypes as Et, request_default as F, AnnotationTypes as Fa, compactAgentsBaseSchema as Fi, resolveEndpointType as Fn, imageMimeTypes as Fr, SearchCategories as Ft, PrincipalType as G, defaultOrderQuery as Ga, eReasoningEffortSchema as Gi, validateVisionModel as Gn, retrievalMimeTypesList as Gr, allowedAddressesSchema as Gt, AccessRoleIds as H, Tools as Ha, eAnthropicEffortSchema as Hi, transactionsSchema as Hn, mergeFileConfig as Hr, ViolationTypes as Ht, getTokenHeader as I, AssistantStreamEvents as Ia, compactAgentsSchema as Ii, skillSyncConfigSchema as In, imageTypeMapping as Ir, SearchProviders as It, accessRoleToPermBits as J, isActionTool as Ja, eReasoningSummarySchema as Ji, visionModels as Jn, textMimeTypes as Jr, assistantEndpointSchema as Jt, ResourceType as K, hostImageIdSuffix as Ka, eReasoningParameterFormatSchema as Ki, vertexAISchema as Kn, supportedMimeTypes as Kr, alternateName as Kt, setAcceptLanguageHeader as L, EToolResources as La, compactAssistantSchema as Li, skillSyncGitHubSourceSchema as Ln, inferMimeType as Lr, SettingsTabValues as Lt, updateUserKey as M, tPresetSchema as Ma, authTypeSchema as Mi, paramDefinitionSchema as Mn, fullMimeTypesList as Mr, STTProviders as Mt, updateUserPlugins as N, tQueryParamsSchema as Na, cacheSubsetProviders as Ni, providerEndpointMap as Nn, getEndpointFileConfig as Nr, SafeSearchTypes as Nt, updateMessage as O, tMessageSchema as Oa, anthropicBaseSchema as Oi, messageFilterSchema as On, excelFileTypes as Or, SKILL_SYNC_DEFAULT_DISCOVERY_DEPTH as Ot, userKeyQuery as P, tSharedLinkSchema as Pa, coerceNumber as Pi, rateLimitSchema as Pn, imageExtRegex as Pr, ScraperProviders as Pt, permBitsToAccessLevel as Q, feedbackRatingSchema as Qa, endpointSettings as Qi, MCPServersSchema as Qn, modelSpecSubagentsSchema as Qr, azureGroupSchema as Qt, setTokenHeader as R, FilePurpose as Ra, compactGoogleSchema as Ri, specialVariables as Rn, isBedrockDocumentType as Rr, SettingsViews as Rt, requestPasswordReset as S, removeNullishValues as Sa, ThinkingDisplay as Si, imageGenTools as Sn, convertStringsToRegex as Sr, MAX_SUBAGENT_GRAPH_NODES as St, revokeUserKey as T, tConversationTagSchema as Ta, agentsBaseSchema as Ti, isRemoteOidcUrlAllowed as Tn, defaultTextMimeTypes as Tr, RateLimitPrefix as Tt, PermissionBits as U, actionDelimiter as Ua, eImageDetailSchema as Ui, turnstileOptionsSchema as Un, mimeTypeAliases as Ur, VisionModes as Ut, QueryKeys as V, StepStatus as Va, documentSupportedProviders as Vi, supportsBalanceCheck as Vn, megabyte as Vr, Time as Vt, PrincipalModel as W, actionDomainSeparator as Wa, eModelEndpointSchema as Wi, turnstileSchema as Wn, retrievalMimeTypes as Wr, agentsEndpointSchema as Wt, getResourcePermissionsResponseSchema as X, FEEDBACK_REASON_KEYS as Xa, eThinkingLevelSchema as Xi, MCPOptionsSchema as Xn, REFILL_INTERVAL_UNITS as Xr, azureEndpointSchema as Xt, effectivePermissionsResponseSchema as Y, FEEDBACK_RATINGS as Ya, eThinkingDisplaySchema as Yi, webSearchSchema as Yn, videoMimeTypes as Yr, azureBaseSchema as Yt, hasPermissions as Z, FEEDBACK_TAGS as Za, eVerbositySchema as Zi, MCPServerUserInputSchema as Zn, getRefillEligibilityDate as Zr, azureGroupConfigsSchema as Zt, getResourcePermissions as _, openAIBaseSchema as _a, Providers as _i, fileStrategiesSchema as _n, bedrockDocumentExtensions as _r, ImageDetailCost as _t, data_service_exports as a, googleSettings as aa, generateDynamicSchema as ai, configSchema as an, extractEnvVariable as ao, AuthorizationTypeEnum as ar, AuthKeys as at, register as b, openRouterSchema as ba, ReasoningResponseKey as bi, getEndpointField as bn, codeInterpreterMimeTypesList as br, LocalStorageKeys as bt, getAccessRoles as c, inputTokensIncludesCache as ca, validateSettingDefinitions as ci, defaultAssistantsVersion as cn, normalizeEndpointName as co, FileSources as cr, Capabilities as ct, getAvailablePlugins as d, isDocumentSupportedProvider as da, BedrockProviders as di, defaultRetrievalModels as dn, buildLoginRedirectUrl as dr, DEFAULT_MEMORY_MAX_INPUT_TOKENS as dt, getModelKey as ea, tModelSpecSchema as ei, baseEndpointSchema as en, feedbackTagKeySchema as eo, SSEOptionsSchema as er, principalSchema as et, getConversationById as f, isImageVisionTool as fa, BedrockReasoningConfig as fi, defaultSocialLogins as fn, loginPage as fr, EImageOutputType as ft, getModels as g, isUUID as ga, MYTHOS_CLASS_FAMILIES as gi, fileStorageSchema as gn, audioMimeTypes as gr, ForkOptions as gt, getMCPServerConnectionStatus as h, isParamEndpoint as ha, ImageVisionTool as hi, fileSourceSchema as hn, applicationMimeTypes as hr, FetchTokenConfig as ht, createPreset as i, googleSchema as ia, SettingTypes as ii, cloudfrontConfigSchema as in, envVarRegex as io, AuthTypeEnum as ir, AgentCapabilities as it, updateTokenCount as j, tPluginSchema as ja, assistantSchema as ji, ocrSchema as jn, fileConfigSchema as jr, SKILL_SYNC_MIN_INTERVAL_MINUTES as jt, updateMessageContent as k, tModelSpecPresetSchema as ka, anthropicSchema as ki, modelConfigSchema as kn, excelMimeTypes as kr, SKILL_SYNC_MAX_DISCOVERY_DEPTH as kt, getAgentApiKeys as l, isAgentsEndpoint as la, AnthropicEffort as li, defaultEndpoints as ln, checkOpenAIStorage as lr, CohereConstants as lt, getEffectivePermissions as m, isOpenAILikeProvider as ma, ImageDetail as mi, excludedKeys as mn, sharedFileDownload as mr, ErrorTypes as mt, clearAllConversations as n, googleBaseSchema as na, ComponentTypes as ni, bedrockGuardrailConfigSchema as nn, getTagsForRating as no, StreamableHTTPOptionsSchema as nr, updateResourcePermissionsRequestSchema as nt, deleteAgentApiKey as o, imageDetailNumeric as oa, generateGoogleSchema as oi, contextPruningSchema as on, extractVariableName as oo, TokenExchangeMethodEnum as or, BASE_ONLY_CONFIG_SECTIONS as ot, getCustomConfigSpeech as p, isMythosClassModel as pa, EModelEndpoint as pi, endpointSchema as pn, registerPage as pr, EndpointURLs as pt, accessRoleSchema as q, hostImageNamePrefix as qa, eReasoningResponseKeySchema as qi, vertexModelConfigSchema as qn, supportsFiles as qr, anthropicEndpointSchema as qt, createAgentApiKey as r, googleGenConfigSchema as ra, OptionTypes as ri, bedrockModels as rn, toMinimalFeedback as ro, WebSocketOptionsSchema as rr, updateResourcePermissionsResponseSchema as rt, deletePreset as s, imageDetailValue as sa, generateOpenAISchema as si, defaultAgentCapabilities as sn, isSensitiveEnvVar as so, FileContext as sr, CacheKeys as st, cancelMCPOAuth as t, getSettingsKeys as ta, MAX_SUBAGENTS as ti, bedrockEndpointSchema as tn, getTagByKey as to, StdioOptionsSchema as tr, resourcePermissionsResponseSchema as tt, getAllEffectivePermissions as u, isAssistantsEndpoint as ua, AuthType as ui, defaultModels as un, apiBaseUrl as ur, Constants as ut, getSharedLink as v, openAISchema as va, ReasoningEffort as vi, getConfigDefaults as vn, bedrockDocumentFormats as vr, InfiniteCollections as vt, revokeAllUserKeys as w, tConversationSchema as wa, Verbosity as wi, interfaceSchema as wn, defaultSTTMimeTypes as wr, OCRStrategy as wt, reinitializeMCPServer as x, paramEndpoints as xa, ReasoningSummary as xi, getSchemaDefaults as xn, codeTypeMapping as xr, MAX_SUBAGENT_DEPTH as xt, getSharedMessages as y, openAISettings as ya, ReasoningParameterFormat as yi, getDefaultParamsEndpoint as yn, codeInterpreterMimeTypes as yr, KnownEndpoints as yt, DynamicQueryKeys as z, MessageContentTypes as za, defaultAgentFormValues as zi, summarizationConfigSchema as zn, isPermissiveMimeConfig as zr, SystemCategories as zt };
|
|
6608
6665
|
|
|
6609
|
-
//# sourceMappingURL=data-service-
|
|
6666
|
+
//# sourceMappingURL=data-service-DgNwjhBS.mjs.map
|