librechat-data-provider 0.8.509 → 0.8.521
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-XTxx76uB.js → data-service-DOIF4BkW.js} +1195 -91
- package/dist/data-service-DOIF4BkW.js.map +1 -0
- package/dist/{data-service-BsdHkdKS.mjs → data-service-pwrlWjJs.mjs} +1046 -92
- package/dist/data-service-pwrlWjJs.mjs.map +1 -0
- package/dist/index.js +457 -57
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +425 -58
- package/dist/index.mjs.map +1 -1
- package/dist/react-query/index.js +1 -1
- package/dist/react-query/index.js.map +1 -1
- package/dist/react-query/index.mjs +1 -1
- package/dist/react-query/index.mjs.map +1 -1
- package/dist/types/actions.d.ts +1 -1
- package/dist/types/api-endpoints.d.ts +10 -2
- package/dist/types/bedrock.d.ts +52 -0
- package/dist/types/config.d.ts +4142 -183
- package/dist/types/data-service.d.ts +27 -14
- package/dist/types/feedback.d.ts +9 -1
- package/dist/types/file-config.d.ts +41 -5
- package/dist/types/generate.d.ts +6 -0
- package/dist/types/keys.d.ts +6 -2
- package/dist/types/mcp.d.ts +45 -24
- package/dist/types/messages.d.ts +8 -0
- package/dist/types/models.d.ts +108 -0
- package/dist/types/parameterSettings.d.ts +2 -2
- package/dist/types/parsers.d.ts +3 -1
- package/dist/types/react-query/react-query-service.d.ts +2 -7
- package/dist/types/request.d.ts +3 -1
- package/dist/types/schemas.d.ts +167 -8
- package/dist/types/types/agents.d.ts +211 -1
- package/dist/types/types/assistants.d.ts +77 -5
- package/dist/types/types/files.d.ts +18 -7
- package/dist/types/types/mcpServers.d.ts +25 -0
- package/dist/types/types/mutations.d.ts +1 -0
- package/dist/types/types/queries.d.ts +17 -3
- package/dist/types/types/runs.d.ts +114 -25
- package/dist/types/types/skills.d.ts +25 -6
- package/dist/types/types.d.ts +115 -2
- package/dist/types/upload.d.ts +2 -0
- package/package.json +4 -4
- package/dist/data-service-BsdHkdKS.mjs.map +0 -1
- package/dist/data-service-XTxx76uB.js.map +0 -1
|
@@ -169,6 +169,9 @@ const feedbackSchema = z.object({
|
|
|
169
169
|
rating: feedbackRatingSchema,
|
|
170
170
|
tag: feedbackTagKeySchema,
|
|
171
171
|
text: z.string().max(1024).optional()
|
|
172
|
+
}).refine(({ rating, tag }) => FEEDBACK_TAGS.some((feedbackTag) => feedbackTag.key === tag && feedbackTag.direction === rating), {
|
|
173
|
+
message: "Feedback tag does not match rating",
|
|
174
|
+
path: ["tag"]
|
|
172
175
|
});
|
|
173
176
|
function toMinimalFeedback(feedback) {
|
|
174
177
|
if (!feedback?.rating || !feedback?.tag || !feedback.tag.key) return;
|
|
@@ -464,6 +467,7 @@ let ReasoningEffort = /* @__PURE__ */ function(ReasoningEffort) {
|
|
|
464
467
|
ReasoningEffort["medium"] = "medium";
|
|
465
468
|
ReasoningEffort["high"] = "high";
|
|
466
469
|
ReasoningEffort["xhigh"] = "xhigh";
|
|
470
|
+
ReasoningEffort["max"] = "max";
|
|
467
471
|
return ReasoningEffort;
|
|
468
472
|
}({});
|
|
469
473
|
let ReasoningParameterFormat = /* @__PURE__ */ function(ReasoningParameterFormat) {
|
|
@@ -530,6 +534,21 @@ let ThinkingLevel = /* @__PURE__ */ function(ThinkingLevel) {
|
|
|
530
534
|
ThinkingLevel["high"] = "high";
|
|
531
535
|
return ThinkingLevel;
|
|
532
536
|
}({});
|
|
537
|
+
/** OpenAI Responses API `reasoning.mode` (GPT-5.6+). */
|
|
538
|
+
let ReasoningMode = /* @__PURE__ */ function(ReasoningMode) {
|
|
539
|
+
ReasoningMode["unset"] = "";
|
|
540
|
+
ReasoningMode["standard"] = "standard";
|
|
541
|
+
ReasoningMode["pro"] = "pro";
|
|
542
|
+
return ReasoningMode;
|
|
543
|
+
}({});
|
|
544
|
+
/** OpenAI Responses API `reasoning.context` (GPT-5.6+). */
|
|
545
|
+
let ReasoningContext = /* @__PURE__ */ function(ReasoningContext) {
|
|
546
|
+
ReasoningContext["unset"] = "";
|
|
547
|
+
ReasoningContext["auto"] = "auto";
|
|
548
|
+
ReasoningContext["current_turn"] = "current_turn";
|
|
549
|
+
ReasoningContext["all_turns"] = "all_turns";
|
|
550
|
+
return ReasoningContext;
|
|
551
|
+
}({});
|
|
533
552
|
const imageDetailNumeric = {
|
|
534
553
|
["low"]: 0,
|
|
535
554
|
["auto"]: 1,
|
|
@@ -549,6 +568,8 @@ const eThinkingDisplaySchema = z.nativeEnum(ThinkingDisplay);
|
|
|
549
568
|
const eReasoningSummarySchema = z.nativeEnum(ReasoningSummary);
|
|
550
569
|
const eVerbositySchema = z.nativeEnum(Verbosity);
|
|
551
570
|
const eThinkingLevelSchema = z.nativeEnum(ThinkingLevel);
|
|
571
|
+
const eReasoningModeSchema = z.nativeEnum(ReasoningMode);
|
|
572
|
+
const eReasoningContextSchema = z.nativeEnum(ReasoningContext);
|
|
552
573
|
const defaultAssistantFormValues = {
|
|
553
574
|
assistant: "",
|
|
554
575
|
id: "",
|
|
@@ -580,6 +601,7 @@ const defaultAgentFormValues = {
|
|
|
580
601
|
["execute_code"]: false,
|
|
581
602
|
["file_search"]: false,
|
|
582
603
|
["web_search"]: false,
|
|
604
|
+
["memory"]: false,
|
|
583
605
|
category: "general",
|
|
584
606
|
support_contact: {
|
|
585
607
|
name: "",
|
|
@@ -592,7 +614,9 @@ const defaultAgentFormValues = {
|
|
|
592
614
|
* (full catalog unless `skills` narrows it). Anything else = inactive. */
|
|
593
615
|
skills_enabled: void 0,
|
|
594
616
|
/** `undefined` = feature disabled by default (no subagent tool injected). */
|
|
595
|
-
subagents: void 0
|
|
617
|
+
subagents: void 0,
|
|
618
|
+
/** Memory partition: 'agent' isolates memories per (user, agent); default shared pool */
|
|
619
|
+
memory_scope: void 0
|
|
596
620
|
};
|
|
597
621
|
const ImageVisionTool = {
|
|
598
622
|
type: "function",
|
|
@@ -712,6 +736,7 @@ const CLAUDE_4_64K_MAX_OUTPUT = 64e3;
|
|
|
712
736
|
const CLAUDE_32K_MAX_OUTPUT = 32e3;
|
|
713
737
|
const DEFAULT_MAX_OUTPUT = 8192;
|
|
714
738
|
const LEGACY_ANTHROPIC_MAX_OUTPUT = 4096;
|
|
739
|
+
const CLAUDE_SONNET_128K_OUTPUT_PATTERN = /claude-sonnet[-.]?(?:4[-.]?(?:[6-9]|\d{2})|[5-9]|\d{2,})(?=$|[^0-9])/;
|
|
715
740
|
/**
|
|
716
741
|
* Claude "Mythos-class" model families — new top-level classes (peers of
|
|
717
742
|
* `opus`/`sonnet`/`haiku`) that ship with the post-Opus-4.7 modern profile:
|
|
@@ -755,6 +780,7 @@ const anthropicSettings = {
|
|
|
755
780
|
reset: (modelName) => {
|
|
756
781
|
if (isMythosClassModel(modelName)) return ANTHROPIC_MAX_OUTPUT;
|
|
757
782
|
if (/claude-opus[-.]?(?:4[-.]?(?:[6-9]|\d{2,})|[5-9]|\d{2,})/.test(modelName)) return ANTHROPIC_MAX_OUTPUT;
|
|
783
|
+
if (CLAUDE_SONNET_128K_OUTPUT_PATTERN.test(modelName)) return ANTHROPIC_MAX_OUTPUT;
|
|
758
784
|
if (/claude-(?:sonnet|haiku)[-.]?[4-9]/.test(modelName)) return CLAUDE_4_64K_MAX_OUTPUT;
|
|
759
785
|
if (/claude-opus[-.]?(?:[5-9]|4[-.]?([5-9]|\d{2,}))/.test(modelName)) return CLAUDE_4_64K_MAX_OUTPUT;
|
|
760
786
|
if (/claude-opus[-.]?[4-9]/.test(modelName)) return CLAUDE_32K_MAX_OUTPUT;
|
|
@@ -769,6 +795,10 @@ const anthropicSettings = {
|
|
|
769
795
|
if (value > ANTHROPIC_MAX_OUTPUT) return ANTHROPIC_MAX_OUTPUT;
|
|
770
796
|
return value;
|
|
771
797
|
}
|
|
798
|
+
if (CLAUDE_SONNET_128K_OUTPUT_PATTERN.test(modelName)) {
|
|
799
|
+
if (value > ANTHROPIC_MAX_OUTPUT) return ANTHROPIC_MAX_OUTPUT;
|
|
800
|
+
return value;
|
|
801
|
+
}
|
|
772
802
|
if (/claude-(?:sonnet|haiku)[-.]?[4-9]/.test(modelName) && value > CLAUDE_4_64K_MAX_OUTPUT) return CLAUDE_4_64K_MAX_OUTPUT;
|
|
773
803
|
if (/claude-opus[-.]?(?:[5-9]|4[-.]?([5-9]|\d{2,}))/.test(modelName)) {
|
|
774
804
|
if (value > CLAUDE_4_64K_MAX_OUTPUT) return CLAUDE_4_64K_MAX_OUTPUT;
|
|
@@ -947,6 +977,16 @@ const tMessageSchema = z.object({
|
|
|
947
977
|
*/
|
|
948
978
|
quotes: z.array(z.string()).optional()
|
|
949
979
|
});
|
|
980
|
+
/**
|
|
981
|
+
* Which memory partition an agent reads/writes.
|
|
982
|
+
* `user` = the shared personal pool (default); `agent` = a partition
|
|
983
|
+
* isolated per (user, agent) so the agent only sees its own memories.
|
|
984
|
+
*/
|
|
985
|
+
let MemoryScope = /* @__PURE__ */ function(MemoryScope) {
|
|
986
|
+
MemoryScope["user"] = "user";
|
|
987
|
+
MemoryScope["agent"] = "agent";
|
|
988
|
+
return MemoryScope;
|
|
989
|
+
}({});
|
|
950
990
|
const coerceNumber = z.union([z.number(), z.string()]).transform((val) => {
|
|
951
991
|
if (typeof val === "string") return val.trim() === "" ? void 0 : parseFloat(val);
|
|
952
992
|
return val;
|
|
@@ -965,6 +1005,8 @@ const tConversationSchema = z.object({
|
|
|
965
1005
|
endpointType: eModelEndpointSchema.nullable().optional(),
|
|
966
1006
|
isArchived: z.boolean().optional(),
|
|
967
1007
|
pinned: z.boolean().optional(),
|
|
1008
|
+
/** Server-derived: an active shared link exists for this conversation. Not persisted. */
|
|
1009
|
+
isShared: z.boolean().optional(),
|
|
968
1010
|
title: z.string().nullable().or(z.literal("New Chat")).default("New Chat"),
|
|
969
1011
|
user: z.string().optional(),
|
|
970
1012
|
messages: z.array(z.string()).optional(),
|
|
@@ -1002,6 +1044,8 @@ const tConversationSchema = z.object({
|
|
|
1002
1044
|
imageDetail: eImageDetailSchema.optional(),
|
|
1003
1045
|
reasoning_effort: eReasoningEffortSchema.optional().nullable(),
|
|
1004
1046
|
reasoning_summary: eReasoningSummarySchema.optional().nullable(),
|
|
1047
|
+
reasoning_mode: eReasoningModeSchema.optional().nullable(),
|
|
1048
|
+
reasoning_context: eReasoningContextSchema.optional().nullable(),
|
|
1005
1049
|
verbosity: eVerbositySchema.optional().nullable(),
|
|
1006
1050
|
useResponsesApi: z.boolean().optional(),
|
|
1007
1051
|
effort: eAnthropicEffortSchema.optional().nullable(),
|
|
@@ -1093,6 +1137,10 @@ const tQueryParamsSchema = tConversationSchema.pick({
|
|
|
1093
1137
|
/** @endpoints openAI, custom, azureOpenAI */
|
|
1094
1138
|
reasoning_summary: true,
|
|
1095
1139
|
/** @endpoints openAI, custom, azureOpenAI */
|
|
1140
|
+
reasoning_mode: true,
|
|
1141
|
+
/** @endpoints openAI, custom, azureOpenAI */
|
|
1142
|
+
reasoning_context: true,
|
|
1143
|
+
/** @endpoints openAI, custom, azureOpenAI */
|
|
1096
1144
|
verbosity: true,
|
|
1097
1145
|
/** @endpoints openAI, custom, azureOpenAI */
|
|
1098
1146
|
useResponsesApi: true,
|
|
@@ -1348,6 +1396,8 @@ const openAIBaseSchema = tConversationSchema.pick({
|
|
|
1348
1396
|
max_tokens: true,
|
|
1349
1397
|
reasoning_effort: true,
|
|
1350
1398
|
reasoning_summary: true,
|
|
1399
|
+
reasoning_mode: true,
|
|
1400
|
+
reasoning_context: true,
|
|
1351
1401
|
verbosity: true,
|
|
1352
1402
|
useResponsesApi: true,
|
|
1353
1403
|
web_search: true,
|
|
@@ -1796,12 +1846,17 @@ const tModelSpecSchema = z.object({
|
|
|
1796
1846
|
showIconInHeader: z.boolean().optional(),
|
|
1797
1847
|
showOnLanding: z.boolean().optional(),
|
|
1798
1848
|
conversation_starters: z.array(z.string()).optional(),
|
|
1849
|
+
showInMenu: z.boolean().optional(),
|
|
1799
1850
|
iconURL: z.union([z.string(), eModelEndpointSchema]).optional(),
|
|
1800
1851
|
authType: authTypeSchema.optional(),
|
|
1801
1852
|
hideBadgeRow: z.boolean().optional(),
|
|
1802
1853
|
webSearch: z.boolean().optional(),
|
|
1803
1854
|
fileSearch: z.boolean().optional(),
|
|
1804
1855
|
executeCode: z.boolean().optional(),
|
|
1856
|
+
memory: z.boolean().optional(),
|
|
1857
|
+
askUserQuestion: z.boolean().optional(),
|
|
1858
|
+
runInBackground: z.union([z.boolean(), z.array(z.string())]).optional(),
|
|
1859
|
+
describeIntent: z.union([z.boolean(), z.array(z.string())]).optional(),
|
|
1805
1860
|
artifacts: z.union([z.string(), z.boolean()]).optional(),
|
|
1806
1861
|
mcpServers: z.array(z.string()).optional(),
|
|
1807
1862
|
skills: z.union([z.boolean(), z.array(z.string())]).optional(),
|
|
@@ -1883,6 +1938,7 @@ const fullMimeTypesList = [
|
|
|
1883
1938
|
"application/pdf",
|
|
1884
1939
|
"text/x-php",
|
|
1885
1940
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
1941
|
+
"application/vnd.openxmlformats-officedocument.presentationml.template",
|
|
1886
1942
|
"text/x-python",
|
|
1887
1943
|
"text/x-script.python",
|
|
1888
1944
|
"text/x-ruby",
|
|
@@ -1913,6 +1969,7 @@ const fullMimeTypesList = [
|
|
|
1913
1969
|
"application/vnd.oasis.opendocument.graphics",
|
|
1914
1970
|
"image/svg",
|
|
1915
1971
|
"image/svg+xml",
|
|
1972
|
+
"message/rfc822",
|
|
1916
1973
|
"video/mp4",
|
|
1917
1974
|
"video/avi",
|
|
1918
1975
|
"video/mov",
|
|
@@ -1946,6 +2003,7 @@ const codeInterpreterMimeTypesList = [
|
|
|
1946
2003
|
"application/pdf",
|
|
1947
2004
|
"text/x-php",
|
|
1948
2005
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
2006
|
+
"application/vnd.openxmlformats-officedocument.presentationml.template",
|
|
1949
2007
|
"text/x-python",
|
|
1950
2008
|
"text/x-script.python",
|
|
1951
2009
|
"text/x-ruby",
|
|
@@ -1978,6 +2036,7 @@ const retrievalMimeTypesList = [
|
|
|
1978
2036
|
"application/pdf",
|
|
1979
2037
|
"text/x-php",
|
|
1980
2038
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
2039
|
+
"application/vnd.openxmlformats-officedocument.presentationml.template",
|
|
1981
2040
|
"text/x-python",
|
|
1982
2041
|
"text/x-script.python",
|
|
1983
2042
|
"text/x-ruby",
|
|
@@ -1999,11 +2058,34 @@ const bedrockDocumentFormats = {
|
|
|
1999
2058
|
"text/markdown": "md"
|
|
2000
2059
|
};
|
|
2001
2060
|
const isBedrockDocumentType = (mimeType) => mimeType != null && mimeType in bedrockDocumentFormats;
|
|
2061
|
+
/** MIME types Bedrock's Converse document path can send to the model (mirrors `bedrockDocumentFormats`). */
|
|
2062
|
+
const bedrockDocumentMimeTypes = Object.keys(bedrockDocumentFormats);
|
|
2002
2063
|
/** File extensions accepted by Bedrock document uploads (for input accept attributes) */
|
|
2003
2064
|
const bedrockDocumentExtensions = ".pdf,.csv,.doc,.docx,.xls,.xlsx,.html,.htm,.txt,.md,application/pdf,text/csv,application/csv,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/html,text/plain,text/markdown";
|
|
2065
|
+
/** Textual `application/*` MIME types that can be decoded and sent as plain text */
|
|
2066
|
+
const textualApplicationTypes = new Set([
|
|
2067
|
+
"application/json",
|
|
2068
|
+
"application/xml",
|
|
2069
|
+
"application/yaml",
|
|
2070
|
+
"application/sql",
|
|
2071
|
+
"application/typescript",
|
|
2072
|
+
"application/x-sh",
|
|
2073
|
+
"application/csv"
|
|
2074
|
+
]);
|
|
2075
|
+
/**
|
|
2076
|
+
* MIME types the Anthropic Messages API accepts as a plain-text document source
|
|
2077
|
+
* (`source.type: 'text'`)
|
|
2078
|
+
*/
|
|
2079
|
+
const isAnthropicTextDocumentType = (mimeType) => mimeType != null && (mimeType.startsWith("text/") || textualApplicationTypes.has(mimeType));
|
|
2080
|
+
/**
|
|
2081
|
+
* MIME types the Anthropic Messages API document path can send to the model
|
|
2082
|
+
* (mirrors `isBedrockDocumentType`): PDF via base64, textual types via a
|
|
2083
|
+
* plain-text document source. All other types are rejected with a provider 400.
|
|
2084
|
+
*/
|
|
2085
|
+
const isAnthropicDocumentType = (mimeType) => mimeType === "application/pdf" || isAnthropicTextDocumentType(mimeType);
|
|
2004
2086
|
const excelMimeTypes = /^application\/(vnd\.ms-excel|msexcel|x-msexcel|x-ms-excel|x-excel|x-dos_ms_excel|xls|x-xls|vnd\.openxmlformats-officedocument\.spreadsheetml\.sheet)$/;
|
|
2005
2087
|
const textMimeTypes = /^(text\/(x-c|x-csharp|tab-separated-values|x-c\+\+|x-h|x-java|html|markdown|x-php|x-python|x-script\.python|x-ruby|x-tex|plain|css|vtt|javascript|csv|xml|calendar))$/;
|
|
2006
|
-
const applicationMimeTypes = /^(application\/(epub\+zip|csv|json|msword|pdf|x-tar|x-sh|x-zip-compressed|typescript|sql|yaml|x-parquet|vnd\.apache\.parquet|vnd\.coffeescript|vnd\.openxmlformats-officedocument\.(wordprocessingml\.document|presentationml\.presentation|spreadsheetml\.sheet)|vnd\.oasis\.opendocument\.(text|spreadsheet|presentation|graphics)|xml|zip))$/;
|
|
2088
|
+
const applicationMimeTypes = /^(application\/(epub\+zip|csv|json|msword|pdf|x-tar|x-sh|x-zip-compressed|typescript|sql|yaml|x-parquet|vnd\.apache\.parquet|vnd\.coffeescript|vnd\.openxmlformats-officedocument\.(wordprocessingml\.document|presentationml\.(presentation|template)|spreadsheetml\.sheet)|vnd\.oasis\.opendocument\.(text|spreadsheet|presentation|graphics)|xml|zip))$/;
|
|
2007
2089
|
const imageMimeTypes = /^image\/(jpeg|gif|png|webp|heic|heif)$/;
|
|
2008
2090
|
const audioMimeTypes = /^audio\/(mp3|mpeg|mpeg3|wav|wave|x-wav|ogg|vorbis|mp4|m4a|x-m4a|flac|x-flac|webm|aac|wma|opus)$/;
|
|
2009
2091
|
const videoMimeTypes = /^video\/(mp4|avi|mov|wmv|flv|webm|mkv|m4v|3gp|ogv)$/;
|
|
@@ -2012,6 +2094,7 @@ const defaultOCRMimeTypes = [
|
|
|
2012
2094
|
excelMimeTypes,
|
|
2013
2095
|
/^application\/pdf$/,
|
|
2014
2096
|
/^application\/vnd\.openxmlformats-officedocument\.(wordprocessingml\.document|presentationml\.presentation)$/,
|
|
2097
|
+
/^application\/vnd\.openxmlformats-officedocument\.presentationml\.template$/,
|
|
2015
2098
|
/^application\/vnd\.ms-(word|powerpoint)$/,
|
|
2016
2099
|
/^application\/epub\+zip$/,
|
|
2017
2100
|
/^application\/vnd\.oasis\.opendocument\.(text|spreadsheet|presentation|graphics)$/
|
|
@@ -2033,7 +2116,8 @@ const supportedMimeTypes = [
|
|
|
2033
2116
|
imageMimeTypes,
|
|
2034
2117
|
videoMimeTypes,
|
|
2035
2118
|
audioMimeTypes,
|
|
2036
|
-
/^image\/(svg|svg\+xml)
|
|
2119
|
+
/^image\/(svg|svg\+xml)$/,
|
|
2120
|
+
/^message\/rfc822$/
|
|
2037
2121
|
];
|
|
2038
2122
|
const codeInterpreterMimeTypes = [
|
|
2039
2123
|
textMimeTypes,
|
|
@@ -2088,6 +2172,7 @@ const codeTypeMapping = {
|
|
|
2088
2172
|
cljs: "text/plain",
|
|
2089
2173
|
cljc: "text/plain",
|
|
2090
2174
|
elm: "text/plain",
|
|
2175
|
+
eml: "message/rfc822",
|
|
2091
2176
|
erl: "text/plain",
|
|
2092
2177
|
hrl: "text/plain",
|
|
2093
2178
|
ex: "text/plain",
|
|
@@ -2159,6 +2244,13 @@ const codeTypeMapping = {
|
|
|
2159
2244
|
ods: "application/vnd.oasis.opendocument.spreadsheet",
|
|
2160
2245
|
odp: "application/vnd.oasis.opendocument.presentation",
|
|
2161
2246
|
odg: "application/vnd.oasis.opendocument.graphics",
|
|
2247
|
+
doc: "application/msword",
|
|
2248
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
2249
|
+
xls: "application/vnd.ms-excel",
|
|
2250
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
2251
|
+
ppt: "application/vnd.ms-powerpoint",
|
|
2252
|
+
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
2253
|
+
potx: "application/vnd.openxmlformats-officedocument.presentationml.template",
|
|
2162
2254
|
ics: "text/calendar",
|
|
2163
2255
|
ical: "text/calendar",
|
|
2164
2256
|
ifb: "text/calendar",
|
|
@@ -2173,7 +2265,11 @@ const imageTypeMapping = {
|
|
|
2173
2265
|
const mimeTypeAliases = {
|
|
2174
2266
|
"application/x-zip-compressed": "application/zip",
|
|
2175
2267
|
"text/x-python-script": "text/x-python",
|
|
2176
|
-
"text/x-markdown": "text/markdown"
|
|
2268
|
+
"text/x-markdown": "text/markdown",
|
|
2269
|
+
/** freedesktop shared-mime-info (Chrome on Linux) */
|
|
2270
|
+
"application/x-shellscript": "application/x-sh",
|
|
2271
|
+
/** libmagic, i.e. `file --mime-type` */
|
|
2272
|
+
"text/x-shellscript": "application/x-sh"
|
|
2177
2273
|
};
|
|
2178
2274
|
/**
|
|
2179
2275
|
* Infers the MIME type from a file's extension when the browser doesn't recognize it,
|
|
@@ -2187,7 +2283,7 @@ function inferMimeType(fileName, currentType) {
|
|
|
2187
2283
|
const extension = fileName.split(".").pop()?.toLowerCase() ?? "";
|
|
2188
2284
|
return codeTypeMapping[extension] || imageTypeMapping[extension] || currentType;
|
|
2189
2285
|
}
|
|
2190
|
-
const retrievalMimeTypes = [/^(text\/(x-c|x-c\+\+|x-h|html|x-java|markdown|x-php|x-python|x-script\.python|x-ruby|x-tex|plain|vtt|xml))$/, /^(application\/(json|pdf|vnd\.openxmlformats-officedocument\.(wordprocessingml\.document|presentationml\.presentation)))$/];
|
|
2286
|
+
const retrievalMimeTypes = [/^(text\/(x-c|x-c\+\+|x-h|html|x-java|markdown|x-php|x-python|x-script\.python|x-ruby|x-tex|plain|vtt|xml))$/, /^(application\/(json|pdf|vnd\.openxmlformats-officedocument\.(wordprocessingml\.document|presentationml\.(presentation|template))))$/];
|
|
2191
2287
|
const megabyte = 1024 * 1024;
|
|
2192
2288
|
/** Helper function to get megabytes value */
|
|
2193
2289
|
const mbToBytes = (mb) => mb * megabyte;
|
|
@@ -2266,21 +2362,212 @@ const fileConfigSchema = z.object({
|
|
|
2266
2362
|
ocr: z.object({ supportedMimeTypes: supportedMimeTypesSchema.optional() }).optional(),
|
|
2267
2363
|
text: z.object({ supportedMimeTypes: supportedMimeTypesSchema.optional() }).optional()
|
|
2268
2364
|
});
|
|
2269
|
-
/**
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2365
|
+
/**
|
|
2366
|
+
* Compiler for admin-supplied MIME patterns. Defaults to native `RegExp`, which browser
|
|
2367
|
+
* builds keep so no extra dependency is bundled. The server swaps in a linear-time engine
|
|
2368
|
+
* via `setFileConfigRegexCompiler` so an admin-authored catastrophic-backtracking pattern
|
|
2369
|
+
* cannot ReDoS the shared event loop when tested against an uploaded file's MIME type.
|
|
2370
|
+
*/
|
|
2371
|
+
let compileMimeRegex = (pattern) => new RegExp(pattern);
|
|
2372
|
+
/** Override the MIME-pattern compiler; the server injects a linear-time engine at startup. */
|
|
2373
|
+
const setFileConfigRegexCompiler = (compile) => {
|
|
2374
|
+
compileMimeRegex = compile;
|
|
2375
|
+
};
|
|
2376
|
+
/** Returned when every configured pattern fails to compile, so consumers that read an empty
|
|
2377
|
+
* allowlist as "no restriction" fail closed instead of allowing every file. */
|
|
2378
|
+
const rejectAllMimeMatcher = { test: () => false };
|
|
2379
|
+
/** Helper function to safely convert string patterns to matcher objects */
|
|
2380
|
+
const convertStringsToRegex = (patterns) => {
|
|
2381
|
+
const compiled = patterns.reduce((acc, pattern) => {
|
|
2382
|
+
try {
|
|
2383
|
+
acc.push(compileMimeRegex(pattern));
|
|
2384
|
+
} catch (error) {
|
|
2385
|
+
console.error(`Invalid regex pattern "${pattern}" skipped.`, error);
|
|
2386
|
+
}
|
|
2387
|
+
return acc;
|
|
2388
|
+
}, []);
|
|
2389
|
+
if (patterns.length > 0 && compiled.length === 0) {
|
|
2390
|
+
console.error(`All ${patterns.length} MIME type pattern(s) were invalid and skipped; the resulting allowlist rejects every file.`);
|
|
2391
|
+
return [rejectAllMimeMatcher];
|
|
2276
2392
|
}
|
|
2277
|
-
return
|
|
2278
|
-
}
|
|
2393
|
+
return compiled;
|
|
2394
|
+
};
|
|
2279
2395
|
/** Detects whether the given MIME type patterns accept all file types (e.g., `.*` or `.+`). */
|
|
2280
2396
|
const isPermissiveMimeConfig = (types) => {
|
|
2281
2397
|
if (!types || types.length === 0) return false;
|
|
2282
2398
|
return types.some((regex) => regex.test("x-librechat/x-probe"));
|
|
2283
2399
|
};
|
|
2400
|
+
/** Media categories that collapse to a wildcard `accept` token when any member type is allowed. */
|
|
2401
|
+
const mimeAcceptCategories = [
|
|
2402
|
+
{
|
|
2403
|
+
/** Mirrors `imageMimeTypes` (+ the code-interpreter svg variants) so every accepted type is known. */
|
|
2404
|
+
category: "image",
|
|
2405
|
+
token: "image/*",
|
|
2406
|
+
samples: [
|
|
2407
|
+
"image/jpeg",
|
|
2408
|
+
"image/gif",
|
|
2409
|
+
"image/png",
|
|
2410
|
+
"image/webp",
|
|
2411
|
+
"image/heic",
|
|
2412
|
+
"image/heif",
|
|
2413
|
+
"image/svg",
|
|
2414
|
+
"image/svg+xml"
|
|
2415
|
+
],
|
|
2416
|
+
extras: [".heif", ".heic"]
|
|
2417
|
+
},
|
|
2418
|
+
{
|
|
2419
|
+
/** Mirrors `audioMimeTypes`. */
|
|
2420
|
+
category: "audio",
|
|
2421
|
+
token: "audio/*",
|
|
2422
|
+
samples: [
|
|
2423
|
+
"audio/mp3",
|
|
2424
|
+
"audio/mpeg",
|
|
2425
|
+
"audio/mpeg3",
|
|
2426
|
+
"audio/wav",
|
|
2427
|
+
"audio/wave",
|
|
2428
|
+
"audio/x-wav",
|
|
2429
|
+
"audio/ogg",
|
|
2430
|
+
"audio/vorbis",
|
|
2431
|
+
"audio/mp4",
|
|
2432
|
+
"audio/m4a",
|
|
2433
|
+
"audio/x-m4a",
|
|
2434
|
+
"audio/flac",
|
|
2435
|
+
"audio/x-flac",
|
|
2436
|
+
"audio/webm",
|
|
2437
|
+
"audio/aac",
|
|
2438
|
+
"audio/wma",
|
|
2439
|
+
"audio/opus"
|
|
2440
|
+
]
|
|
2441
|
+
},
|
|
2442
|
+
{
|
|
2443
|
+
/** Mirrors `videoMimeTypes`. */
|
|
2444
|
+
category: "video",
|
|
2445
|
+
token: "video/*",
|
|
2446
|
+
samples: [
|
|
2447
|
+
"video/mp4",
|
|
2448
|
+
"video/avi",
|
|
2449
|
+
"video/mov",
|
|
2450
|
+
"video/wmv",
|
|
2451
|
+
"video/flv",
|
|
2452
|
+
"video/webm",
|
|
2453
|
+
"video/mkv",
|
|
2454
|
+
"video/m4v",
|
|
2455
|
+
"video/3gp",
|
|
2456
|
+
"video/ogv"
|
|
2457
|
+
]
|
|
2458
|
+
}
|
|
2459
|
+
];
|
|
2460
|
+
/** Document/text MIME types paired with the extension(s) browsers filter on in the file picker. */
|
|
2461
|
+
const documentMimeExtensions = [
|
|
2462
|
+
["application/pdf", [".pdf"]],
|
|
2463
|
+
["application/msword", [".doc"]],
|
|
2464
|
+
["application/vnd.openxmlformats-officedocument.wordprocessingml.document", [".docx"]],
|
|
2465
|
+
["application/vnd.ms-excel", [".xls"]],
|
|
2466
|
+
["application/msexcel", [".xls"]],
|
|
2467
|
+
["application/x-msexcel", [".xls"]],
|
|
2468
|
+
["application/x-ms-excel", [".xls"]],
|
|
2469
|
+
["application/x-excel", [".xls"]],
|
|
2470
|
+
["application/x-dos_ms_excel", [".xls"]],
|
|
2471
|
+
["application/xls", [".xls"]],
|
|
2472
|
+
["application/x-xls", [".xls"]],
|
|
2473
|
+
["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", [".xlsx"]],
|
|
2474
|
+
["application/vnd.ms-powerpoint", [".ppt"]],
|
|
2475
|
+
["application/vnd.openxmlformats-officedocument.presentationml.presentation", [".pptx"]],
|
|
2476
|
+
["application/vnd.openxmlformats-officedocument.presentationml.template", [".potx"]],
|
|
2477
|
+
["application/vnd.oasis.opendocument.text", [".odt"]],
|
|
2478
|
+
["application/vnd.oasis.opendocument.spreadsheet", [".ods"]],
|
|
2479
|
+
["application/vnd.oasis.opendocument.presentation", [".odp"]],
|
|
2480
|
+
["application/vnd.oasis.opendocument.graphics", [".odg"]],
|
|
2481
|
+
["application/rtf", [".rtf"]],
|
|
2482
|
+
["application/json", [".json"]],
|
|
2483
|
+
["application/xml", [".xml"]],
|
|
2484
|
+
["application/yaml", [".yaml", ".yml"]],
|
|
2485
|
+
["application/zip", [".zip"]],
|
|
2486
|
+
["application/x-zip-compressed", [".zip"]],
|
|
2487
|
+
["application/epub+zip", [".epub"]],
|
|
2488
|
+
["application/x-parquet", [".parquet"]],
|
|
2489
|
+
["application/vnd.apache.parquet", [".parquet"]],
|
|
2490
|
+
["text/csv", [".csv"]],
|
|
2491
|
+
["application/csv", [".csv"]],
|
|
2492
|
+
["text/tab-separated-values", [".tsv"]],
|
|
2493
|
+
["text/plain", [".txt"]],
|
|
2494
|
+
["text/markdown", [".md"]],
|
|
2495
|
+
["text/html", [".html", ".htm"]],
|
|
2496
|
+
["text/calendar", [".ics"]],
|
|
2497
|
+
["message/rfc822", [".eml"]]
|
|
2498
|
+
];
|
|
2499
|
+
const documentMimeSet = new Set(documentMimeExtensions.map(([mimeType]) => mimeType));
|
|
2500
|
+
/** Every MIME type LibreChat may accept, used to detect patterns that reach beyond the representable set. */
|
|
2501
|
+
const knownMimeUniverse = Array.from(new Set([
|
|
2502
|
+
...fullMimeTypesList,
|
|
2503
|
+
...documentMimeExtensions.map(([mimeType]) => mimeType),
|
|
2504
|
+
...mimeAcceptCategories.flatMap((category) => category.samples)
|
|
2505
|
+
]));
|
|
2506
|
+
const categoryOf = (mimeType) => {
|
|
2507
|
+
if (mimeType.startsWith("image/")) return "image";
|
|
2508
|
+
if (mimeType.startsWith("audio/")) return "audio";
|
|
2509
|
+
if (mimeType.startsWith("video/")) return "video";
|
|
2510
|
+
return "document";
|
|
2511
|
+
};
|
|
2512
|
+
/** Media types are covered by their `<cat>/*` wildcard token; document types need an explicit entry. */
|
|
2513
|
+
const isRepresentable = (mimeType) => categoryOf(mimeType) !== "document" || documentMimeSet.has(mimeType);
|
|
2514
|
+
/**
|
|
2515
|
+
* Translates a finite MIME allowlist into a file-input `accept` string, intersected with what the
|
|
2516
|
+
* provider upload path can actually send. Returns `undefined` (keep the provider filter) when a
|
|
2517
|
+
* configured pattern matches a supported, path-handleable type that cannot be represented, so the
|
|
2518
|
+
* picker never hides a file the path would have accepted.
|
|
2519
|
+
*/
|
|
2520
|
+
const buildMimeAccept = (types, { categories, documentMimeTypes }) => {
|
|
2521
|
+
const permittedSet = new Set(categories);
|
|
2522
|
+
const documentAllowSet = documentMimeTypes ? new Set(documentMimeTypes) : null;
|
|
2523
|
+
const emittedMedia = /* @__PURE__ */ new Set();
|
|
2524
|
+
const emittedDocuments = /* @__PURE__ */ new Set();
|
|
2525
|
+
if (!types.every((regex) => knownMimeUniverse.some((mimeType) => regex.test(mimeType)))) return;
|
|
2526
|
+
for (const regex of types) for (const mimeType of knownMimeUniverse) {
|
|
2527
|
+
if (!regex.test(mimeType)) continue;
|
|
2528
|
+
const category = categoryOf(mimeType);
|
|
2529
|
+
if (!permittedSet.has(category)) continue;
|
|
2530
|
+
/** The path handles documents but drops this specific type (e.g. Bedrock ignores pptx/ODF). */
|
|
2531
|
+
if (category === "document" && documentAllowSet && !documentAllowSet.has(mimeType)) continue;
|
|
2532
|
+
if (!isRepresentable(mimeType)) return;
|
|
2533
|
+
if (category === "document") emittedDocuments.add(mimeType);
|
|
2534
|
+
else emittedMedia.add(category);
|
|
2535
|
+
}
|
|
2536
|
+
const tokens = [];
|
|
2537
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2538
|
+
const push = (token) => {
|
|
2539
|
+
if (!seen.has(token)) {
|
|
2540
|
+
seen.add(token);
|
|
2541
|
+
tokens.push(token);
|
|
2542
|
+
}
|
|
2543
|
+
};
|
|
2544
|
+
for (const category of mimeAcceptCategories) if (emittedMedia.has(category.category)) {
|
|
2545
|
+
push(category.token);
|
|
2546
|
+
category.extras?.forEach(push);
|
|
2547
|
+
}
|
|
2548
|
+
for (const [mimeType, extensions] of documentMimeExtensions) if (emittedDocuments.has(mimeType)) {
|
|
2549
|
+
extensions.forEach(push);
|
|
2550
|
+
push(mimeType);
|
|
2551
|
+
}
|
|
2552
|
+
return tokens.length > 0 ? tokens.join(",") : void 0;
|
|
2553
|
+
};
|
|
2554
|
+
/**
|
|
2555
|
+
* Resolves the file-input `accept` value for a configured `supportedMimeTypes` allowlist, scoped to
|
|
2556
|
+
* what the current upload path (`capability`) can send to the model.
|
|
2557
|
+
* - `undefined` for the built-in default or a config that can't be represented safely, so callers
|
|
2558
|
+
* keep their provider-specific filter.
|
|
2559
|
+
* - `''` for permissive configs (e.g. `.*`), leaving the picker unrestricted.
|
|
2560
|
+
* - a translated `accept` string for a recognized finite allowlist (images, PDFs, Office docs, etc.).
|
|
2561
|
+
*
|
|
2562
|
+
* The picker `accept` is a UX convenience, not a security boundary: the backend still enforces
|
|
2563
|
+
* `supportedMimeTypes` on upload.
|
|
2564
|
+
*/
|
|
2565
|
+
const getConfiguredMimeAccept = (types, capability) => {
|
|
2566
|
+
/** Referential identity with the built-in list signals an unconfigured endpoint (keep provider filter). */
|
|
2567
|
+
if (!types || types.length === 0 || types === supportedMimeTypes) return;
|
|
2568
|
+
if (isPermissiveMimeConfig(types)) return "";
|
|
2569
|
+
return buildMimeAccept(types, capability);
|
|
2570
|
+
};
|
|
2284
2571
|
/**
|
|
2285
2572
|
* Gets the appropriate endpoint file configuration with standardized lookup logic.
|
|
2286
2573
|
*
|
|
@@ -2450,9 +2737,16 @@ const messagesArtifacts = (messageId) => `${messagesRoot}/artifact/${messageId}`
|
|
|
2450
2737
|
const messagesBranch = () => `${messagesRoot}/branch`;
|
|
2451
2738
|
const shareRoot = `${BASE_URL}/api/share`;
|
|
2452
2739
|
const shareMessages = (shareId) => `${shareRoot}/${shareId}`;
|
|
2740
|
+
const forkSharedMessages = (shareId) => `${shareRoot}/${shareId}/fork`;
|
|
2453
2741
|
const sharedStartupConfig = (shareId) => `${shareMessages(shareId)}/config`;
|
|
2454
2742
|
const getSharedLink$1 = (conversationId) => `${shareRoot}/link/${conversationId}`;
|
|
2455
|
-
const getSharedLinks = (pageSize, sortBy, sortDirection, search, cursor) => `${shareRoot}
|
|
2743
|
+
const getSharedLinks = (pageSize, sortBy, sortDirection, search, cursor) => `${shareRoot}${buildQuery({
|
|
2744
|
+
pageSize,
|
|
2745
|
+
sortBy,
|
|
2746
|
+
sortDirection,
|
|
2747
|
+
search,
|
|
2748
|
+
cursor
|
|
2749
|
+
})}`;
|
|
2456
2750
|
const createSharedLink$1 = (conversationId) => `${shareRoot}/${conversationId}`;
|
|
2457
2751
|
const updateSharedLink$1 = (shareId) => `${shareRoot}/${shareId}`;
|
|
2458
2752
|
/** Share-scoped file routes: serve snapshotted files via shared-link permission. */
|
|
@@ -2492,7 +2786,6 @@ const presets = () => `${BASE_URL}/api/presets`;
|
|
|
2492
2786
|
const deletePreset$1 = () => `${BASE_URL}/api/presets/delete`;
|
|
2493
2787
|
const aiEndpoints = () => `${BASE_URL}/api/endpoints`;
|
|
2494
2788
|
const tokenConfig = () => `${BASE_URL}/api/endpoints/token-config`;
|
|
2495
|
-
const contextProjection = () => `${BASE_URL}/api/endpoints/context-projection`;
|
|
2496
2789
|
const models = () => `${BASE_URL}/api/models`;
|
|
2497
2790
|
const tokenizer = () => `${BASE_URL}/api/tokenizer`;
|
|
2498
2791
|
const login$1 = () => `${BASE_URL}/api/auth/login`;
|
|
@@ -2531,6 +2824,7 @@ const mcpAuthValues = (serverName) => {
|
|
|
2531
2824
|
const cancelMCPOAuth$1 = (serverName) => {
|
|
2532
2825
|
return `${BASE_URL}/api/mcp/oauth/cancel/${serverName}`;
|
|
2533
2826
|
};
|
|
2827
|
+
const mcpOAuthStatus = (flowId) => `${BASE_URL}/api/mcp/oauth/status/${encodeURIComponent(flowId)}`;
|
|
2534
2828
|
const mcpOAuthBind = (serverName) => `${BASE_URL}/api/mcp/${serverName}/oauth/bind`;
|
|
2535
2829
|
const actionOAuthBind = (actionId) => `${BASE_URL}/api/actions/${actionId}/oauth/bind`;
|
|
2536
2830
|
const config = (context) => `${BASE_URL}/api/config${buildQuery({ context })}`;
|
|
@@ -2567,6 +2861,8 @@ const mcpServer = (serverName) => `${BASE_URL}/api/mcp/servers/${serverName}`;
|
|
|
2567
2861
|
const revertAgentVersion$1 = (agent_id) => `${agents({ path: `${agent_id}/revert` })}`;
|
|
2568
2862
|
const files = () => `${BASE_URL}/api/files`;
|
|
2569
2863
|
const filePreview = (fileId) => `${BASE_URL}/api/files/${encodeURIComponent(fileId)}/preview`;
|
|
2864
|
+
/** Owner-scoped usage touch so queued attachments outlive the upload-window TTL. */
|
|
2865
|
+
const fileUsage = () => `${BASE_URL}/api/files/usage`;
|
|
2570
2866
|
const agentFiles = (agentId) => `${BASE_URL}/api/files/agent/${agentId}`;
|
|
2571
2867
|
const images = () => `${files()}/images`;
|
|
2572
2868
|
const avatar = () => `${images()}/avatar`;
|
|
@@ -2628,6 +2924,11 @@ const adminSkillsSyncStatus = () => `${adminSkillsSync()}/status`;
|
|
|
2628
2924
|
const adminSkillsSyncRun = () => `${adminSkillsSync()}/run`;
|
|
2629
2925
|
const adminSkillsSyncCredential = (credentialKey) => `${adminSkillsSync()}/credentials/${encodeURIComponent(credentialKey)}`;
|
|
2630
2926
|
const skillStates = () => `${BASE_URL}/api/user/settings/skills/active`;
|
|
2927
|
+
const adminLangfuseConnection = () => `${BASE_URL}/api/admin/langfuse/connection`;
|
|
2928
|
+
const adminLangfuseConnectionTest = () => `${adminLangfuseConnection()}/test`;
|
|
2929
|
+
const adminLangfuseSessionLink = (conversationId) => `${adminLangfuseConnection()}/session/${encodeURIComponent(conversationId)}`;
|
|
2930
|
+
const toolFavorites = () => `${BASE_URL}/api/user/settings/favorites/tools`;
|
|
2931
|
+
const toolFavorite = (itemType, itemId) => `${toolFavorites()}/${itemType}/${encodeURIComponent(itemId)}`;
|
|
2631
2932
|
const roles = () => `${BASE_URL}/api/roles`;
|
|
2632
2933
|
const adminRoles = () => `${BASE_URL}/api/admin/roles`;
|
|
2633
2934
|
const getRole$1 = (roleName) => `${roles()}/${encodeURIComponent(roleName)}`;
|
|
@@ -2652,7 +2953,7 @@ const disableTwoFactor$1 = () => `${BASE_URL}/api/auth/2fa/disable`;
|
|
|
2652
2953
|
const regenerateBackupCodes$1 = () => `${BASE_URL}/api/auth/2fa/backup/regenerate`;
|
|
2653
2954
|
const verifyTwoFactorTemp$1 = () => `${BASE_URL}/api/auth/2fa/verify-temp`;
|
|
2654
2955
|
const memories = () => `${BASE_URL}/api/memories`;
|
|
2655
|
-
const memory = (key) => `${memories()}/${encodeURIComponent(key)}`;
|
|
2956
|
+
const memory = (key, agentId) => `${memories()}/${encodeURIComponent(key)}${agentId ? `?agentId=${encodeURIComponent(agentId)}` : ""}`;
|
|
2656
2957
|
const memoryPreferences = () => `${memories()}/preferences`;
|
|
2657
2958
|
const searchPrincipals$1 = (params) => {
|
|
2658
2959
|
const { q: query, limit, types } = params;
|
|
@@ -2935,7 +3236,12 @@ const StdioOptionsSchema = BaseOptionsSchema.extend({
|
|
|
2935
3236
|
"pipe",
|
|
2936
3237
|
"ignore",
|
|
2937
3238
|
"inherit"
|
|
2938
|
-
]), z.number().int().nonnegative()]).optional()
|
|
3239
|
+
]), z.number().int().nonnegative()]).optional(),
|
|
3240
|
+
/**
|
|
3241
|
+
* Working directory for the spawned process. Supplied by Agent Plugins
|
|
3242
|
+
* packages, which resolve and contain the path before it reaches this schema.
|
|
3243
|
+
*/
|
|
3244
|
+
cwd: z.string().optional()
|
|
2939
3245
|
});
|
|
2940
3246
|
const WebSocketOptionsSchema = BaseOptionsSchema.extend({
|
|
2941
3247
|
type: z.literal("websocket").default("websocket"),
|
|
@@ -3071,6 +3377,9 @@ const defaultSocialLogins = [
|
|
|
3071
3377
|
"saml"
|
|
3072
3378
|
];
|
|
3073
3379
|
const BASE_ONLY_CONFIG_SECTIONS = [];
|
|
3380
|
+
/** Sections that may be stored in the tenant's base config document but must
|
|
3381
|
+
* not be overridden or tombstoned by role, group, or user config documents. */
|
|
3382
|
+
const BASE_PRINCIPAL_CONFIG_SECTIONS = ["langfuse"];
|
|
3074
3383
|
const defaultRetrievalModels = [
|
|
3075
3384
|
"gpt-4o",
|
|
3076
3385
|
"o1-preview-2024-09-12",
|
|
@@ -3154,6 +3463,32 @@ function isPrivateIPv4Literal(value) {
|
|
|
3154
3463
|
if (a >= 224) return true;
|
|
3155
3464
|
return false;
|
|
3156
3465
|
}
|
|
3466
|
+
/**
|
|
3467
|
+
* Mirrors `hasPrivateEmbeddedIPv4` in `@librechat/api`'s ip helpers: 6to4, NAT64, and Teredo
|
|
3468
|
+
* carry an IPv4 address inside the IPv6 one, and the runtime guard blocks those when the
|
|
3469
|
+
* embedded address is private. Kept in sync so an operator can exempt what the runtime blocks.
|
|
3470
|
+
*/
|
|
3471
|
+
function hasPrivateEmbeddedIPv4Literal(value) {
|
|
3472
|
+
const is6to4 = value.startsWith("2002:");
|
|
3473
|
+
const isNat64 = value.startsWith("64:ff9b::");
|
|
3474
|
+
const isTeredo = value.startsWith("2001::");
|
|
3475
|
+
if (!is6to4 && !isNat64 && !isTeredo) return false;
|
|
3476
|
+
const segments = value.split(":").filter((segment) => segment !== "");
|
|
3477
|
+
const pair = is6to4 ? segments.slice(1, 3) : segments.slice(-2);
|
|
3478
|
+
if (pair.length !== 2) return false;
|
|
3479
|
+
const hi = parseInt(pair[0], 16);
|
|
3480
|
+
const lo = parseInt(pair[1], 16);
|
|
3481
|
+
if (isNaN(hi) || isNaN(lo)) return false;
|
|
3482
|
+
/** RFC 4380: Teredo stores the external IPv4 as a bitwise complement. */
|
|
3483
|
+
const high = isTeredo ? ~hi : hi;
|
|
3484
|
+
const low = isTeredo ? ~lo : lo;
|
|
3485
|
+
return isPrivateIPv4Literal([
|
|
3486
|
+
high >> 8 & 255,
|
|
3487
|
+
high & 255,
|
|
3488
|
+
low >> 8 & 255,
|
|
3489
|
+
low & 255
|
|
3490
|
+
].join("."));
|
|
3491
|
+
}
|
|
3157
3492
|
function isPrivateIPv6Literal(value) {
|
|
3158
3493
|
if (!value.includes(":")) return false;
|
|
3159
3494
|
if (value === "::1" || value === "::") return true;
|
|
@@ -3164,7 +3499,7 @@ function isPrivateIPv6Literal(value) {
|
|
|
3164
3499
|
}
|
|
3165
3500
|
const mappedMatch = value.match(/^::ffff:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/);
|
|
3166
3501
|
if (mappedMatch) return isPrivateIPv4Literal(mappedMatch[1]);
|
|
3167
|
-
return
|
|
3502
|
+
return hasPrivateEmbeddedIPv4Literal(value);
|
|
3168
3503
|
}
|
|
3169
3504
|
/**
|
|
3170
3505
|
* Mirrors the allowedAddresses parser in `@librechat/api`'s auth helpers.
|
|
@@ -3381,6 +3716,7 @@ let AgentCapabilities = /* @__PURE__ */ function(AgentCapabilities) {
|
|
|
3381
3716
|
AgentCapabilities["end_after_tools"] = "end_after_tools";
|
|
3382
3717
|
AgentCapabilities["deferred_tools"] = "deferred_tools";
|
|
3383
3718
|
AgentCapabilities["execute_code"] = "execute_code";
|
|
3719
|
+
AgentCapabilities["stateful_code_sessions"] = "stateful_code_sessions";
|
|
3384
3720
|
AgentCapabilities["file_search"] = "file_search";
|
|
3385
3721
|
AgentCapabilities["web_search"] = "web_search";
|
|
3386
3722
|
AgentCapabilities["artifacts"] = "artifacts";
|
|
@@ -3388,9 +3724,13 @@ let AgentCapabilities = /* @__PURE__ */ function(AgentCapabilities) {
|
|
|
3388
3724
|
AgentCapabilities["actions"] = "actions";
|
|
3389
3725
|
AgentCapabilities["context"] = "context";
|
|
3390
3726
|
AgentCapabilities["skills"] = "skills";
|
|
3727
|
+
AgentCapabilities["memory"] = "memory";
|
|
3728
|
+
AgentCapabilities["ask_user_question"] = "ask_user_question";
|
|
3391
3729
|
AgentCapabilities["tools"] = "tools";
|
|
3392
3730
|
AgentCapabilities["chain"] = "chain";
|
|
3393
3731
|
AgentCapabilities["ocr"] = "ocr";
|
|
3732
|
+
AgentCapabilities["run_in_background"] = "run_in_background";
|
|
3733
|
+
AgentCapabilities["tool_intents"] = "tool_intents";
|
|
3394
3734
|
return AgentCapabilities;
|
|
3395
3735
|
}({});
|
|
3396
3736
|
const defaultAssistantsVersion = {
|
|
@@ -3398,7 +3738,14 @@ const defaultAssistantsVersion = {
|
|
|
3398
3738
|
["azureAssistants"]: 1
|
|
3399
3739
|
};
|
|
3400
3740
|
const baseEndpointSchema = z.object({
|
|
3401
|
-
|
|
3741
|
+
/**
|
|
3742
|
+
* Milliseconds between visible streamed chunks. Agents SDK-backed
|
|
3743
|
+
* providers (openAI, custom, anthropic, google, bedrock, agents) smooth
|
|
3744
|
+
* adaptively at 25ms by default; set to override the cadence, 0 to
|
|
3745
|
+
* disable smoothing. Legacy Assistants and Ollama paths instead sleep
|
|
3746
|
+
* this long per provider chunk (default 1ms), with no adaptive smoothing.
|
|
3747
|
+
*/
|
|
3748
|
+
streamRate: z.number().min(0).optional(),
|
|
3402
3749
|
baseURL: z.string().optional(),
|
|
3403
3750
|
/**
|
|
3404
3751
|
* Custom request headers forwarded to the provider on every request. Values
|
|
@@ -3426,6 +3773,37 @@ const baseEndpointSchema = z.object({
|
|
|
3426
3773
|
* completes (legacy behavior).
|
|
3427
3774
|
*/
|
|
3428
3775
|
titleTiming: z.union([z.literal("immediate"), z.literal("final")]).optional(),
|
|
3776
|
+
/**
|
|
3777
|
+
* Agent activity groups: collapse each contiguous block of reasoning and
|
|
3778
|
+
* tool calls under a generated one-line header. Mirrors the title options
|
|
3779
|
+
* above — `activityLabel` enables it (like `titleConvo`), the rest tune
|
|
3780
|
+
* the fast model that writes the label.
|
|
3781
|
+
*
|
|
3782
|
+
* NOTE: fields added here reach `endpoints.all` automatically (that schema
|
|
3783
|
+
* is `baseEndpointSchema.omit({ baseURL })`), but NOT Azure — see the
|
|
3784
|
+
* enumerated `.pick()` in `azureEndpointSchema` below.
|
|
3785
|
+
*/
|
|
3786
|
+
activityLabel: z.boolean().optional(),
|
|
3787
|
+
/** Model used to write activity labels. Defaults to `titleModel`, then the agent's model. */
|
|
3788
|
+
activityModel: z.string().optional(),
|
|
3789
|
+
/** Endpoint whose credentials the label model runs on. Defaults to the agent's endpoint. */
|
|
3790
|
+
activityEndpoint: z.string().optional(),
|
|
3791
|
+
/** Overrides the system prompt used to write activity labels. */
|
|
3792
|
+
activityPrompt: z.string().optional(),
|
|
3793
|
+
/** Cost cap: maximum labels generated per run. Default 20. */
|
|
3794
|
+
activityMaxPerRun: z.number().int().positive().optional(),
|
|
3795
|
+
/** Per-entry truncation of tool input/output in the label prompt. Default 600. */
|
|
3796
|
+
activityCharLimit: z.number().int().positive().optional(),
|
|
3797
|
+
/** Generates one parent summary for each run phase containing 2+ activities. */
|
|
3798
|
+
activityPhaseLabel: z.boolean().optional(),
|
|
3799
|
+
/** Model used for phase summaries. Defaults to activityModel, titleModel, then the run model. */
|
|
3800
|
+
activityPhaseModel: z.string().optional(),
|
|
3801
|
+
/** Endpoint whose credentials the phase summary model uses. Defaults to activityEndpoint. */
|
|
3802
|
+
activityPhaseEndpoint: z.string().optional(),
|
|
3803
|
+
/** Overrides the dedicated phase-summary system prompt. */
|
|
3804
|
+
activityPhasePrompt: z.string().optional(),
|
|
3805
|
+
/** Cost cap: maximum phase summaries generated per run. Default 5. */
|
|
3806
|
+
activityPhaseMaxPerRun: z.number().int().positive().optional(),
|
|
3429
3807
|
/** Maximum characters allowed in a single tool result before truncation. */
|
|
3430
3808
|
maxToolResultChars: z.number().positive().optional()
|
|
3431
3809
|
});
|
|
@@ -3466,6 +3844,11 @@ const assistantEndpointSchema = baseEndpointSchema.merge(z.object({
|
|
|
3466
3844
|
"tools"
|
|
3467
3845
|
]),
|
|
3468
3846
|
apiKey: z.string().optional(),
|
|
3847
|
+
/** Masked preview of the API key, stored at write time so admin
|
|
3848
|
+
* reads can show which key is configured without returning the secret.
|
|
3849
|
+
* Shared by both `endpoints.assistants` and `endpoints.azureAssistants`,
|
|
3850
|
+
* which both use this schema. */
|
|
3851
|
+
apiKeyPreview: z.string().optional(),
|
|
3469
3852
|
models: z.object({
|
|
3470
3853
|
default: z.array(modelItemSchema).min(1),
|
|
3471
3854
|
fetch: z.boolean().optional(),
|
|
@@ -3483,6 +3866,8 @@ const defaultAgentCapabilities = [
|
|
|
3483
3866
|
"actions",
|
|
3484
3867
|
"context",
|
|
3485
3868
|
"skills",
|
|
3869
|
+
"memory",
|
|
3870
|
+
"ask_user_question",
|
|
3486
3871
|
"tools",
|
|
3487
3872
|
"chain",
|
|
3488
3873
|
"ocr"
|
|
@@ -3528,17 +3913,136 @@ const remoteApiAuthSchema = z.object({
|
|
|
3528
3913
|
oidc: remoteApiOidcSchema.optional()
|
|
3529
3914
|
});
|
|
3530
3915
|
const remoteApiSchema = z.object({ auth: remoteApiAuthSchema.optional() });
|
|
3916
|
+
/**
|
|
3917
|
+
* Permission mode applied to a tool call. Mirrors `@librechat/agents`'s
|
|
3918
|
+
* `ToolPolicyMode` 1:1.
|
|
3919
|
+
*
|
|
3920
|
+
* - `default`: ask the user about anything not explicitly allowed (default-on).
|
|
3921
|
+
* - `dontAsk`: deny anything not explicitly allowed (headless / API-key flows).
|
|
3922
|
+
* - `bypass`: auto-approve everything that isn't explicitly denied
|
|
3923
|
+
* (the user-facing "stop asking me" toggle).
|
|
3924
|
+
*
|
|
3925
|
+
* Subagents inherit the parent's mode; this is enforced by the SDK and not
|
|
3926
|
+
* overridable per-subagent.
|
|
3927
|
+
*/
|
|
3928
|
+
const toolApprovalModeSchema = z.enum([
|
|
3929
|
+
"default",
|
|
3930
|
+
"dontAsk",
|
|
3931
|
+
"bypass"
|
|
3932
|
+
]);
|
|
3933
|
+
/**
|
|
3934
|
+
* Per-endpoint tool-approval policy.
|
|
3935
|
+
*
|
|
3936
|
+
* Shape mirrors `@librechat/agents`'s `ToolPolicyConfig` so the host can map it
|
|
3937
|
+
* directly into `createToolPolicyHook(config)`. The SDK does the evaluation
|
|
3938
|
+
* (`deny → bypass → allow → ask → dontAsk → fallthrough(ask)`); this config
|
|
3939
|
+
* just describes the surface.
|
|
3940
|
+
*
|
|
3941
|
+
* Conventions:
|
|
3942
|
+
* - All list entries are matched as globs (`*`). Use `mcp:server:*` to scope
|
|
3943
|
+
* a rule to every tool from a single MCP server.
|
|
3944
|
+
* - `deny` always wins, including under `bypass`.
|
|
3945
|
+
* - `enabled: false` is a LibreChat-only kill switch that disables the entire
|
|
3946
|
+
* HITL machinery for this endpoint (no checkpointer, no hooks, no prompts).
|
|
3947
|
+
* This is admin-level; users toggle prompting via `mode: 'bypass'` instead.
|
|
3948
|
+
*/
|
|
3949
|
+
/**
|
|
3950
|
+
* A programmatic tool-approval hook loaded from a module at startup.
|
|
3951
|
+
*
|
|
3952
|
+
* The referenced module's default export must be a builder
|
|
3953
|
+
* `(options?) => ToolApprovalHookFactory` (see `@librechat/api`'s `registerToolApprovalHook`).
|
|
3954
|
+
* Hooks compose with the static `allow`/`deny`/`ask` policy above and can only TIGHTEN it
|
|
3955
|
+
* (the SDK folds decisions `deny → ask → allow`). This is admin-level config — the module is
|
|
3956
|
+
* dynamically imported and executed in-process, so only reference trusted code.
|
|
3957
|
+
*/
|
|
3958
|
+
const toolApprovalHookConfigSchema = z.object({
|
|
3959
|
+
/**
|
|
3960
|
+
* Module specifier to import: a bare package name (e.g. `@acme/approval-hooks`) or a path —
|
|
3961
|
+
* absolute, or relative to the app root. Its default export is the hook builder.
|
|
3962
|
+
*/
|
|
3963
|
+
module: z.string().min(1),
|
|
3964
|
+
/** Optional regex matched against the tool name; omit to run for every tool. */
|
|
3965
|
+
matcher: z.string().optional(),
|
|
3966
|
+
/** Static options forwarded to the module's builder; the hook's own per-call config. */
|
|
3967
|
+
options: z.record(z.unknown()).optional()
|
|
3968
|
+
});
|
|
3969
|
+
const toolApprovalPolicySchema = z.object({
|
|
3970
|
+
enabled: z.boolean().optional(),
|
|
3971
|
+
mode: toolApprovalModeSchema.optional(),
|
|
3972
|
+
allow: z.array(z.string()).optional(),
|
|
3973
|
+
deny: z.array(z.string()).optional(),
|
|
3974
|
+
ask: z.array(z.string()).optional(),
|
|
3975
|
+
/** Optional reason template surfaced in the prompt; `{tool}` is interpolated. */
|
|
3976
|
+
reason: z.string().optional(),
|
|
3977
|
+
/**
|
|
3978
|
+
* Programmatic policy hooks loaded from modules at startup. They layer on top of the
|
|
3979
|
+
* static lists above for dynamic, context-aware decisions the lists can't express
|
|
3980
|
+
* (per-args, per-agent, per-user). See {@link toolApprovalHookConfigSchema}.
|
|
3981
|
+
*
|
|
3982
|
+
* BASE-CONFIG ONLY: hooks are imported + registered once, process-wide, at server
|
|
3983
|
+
* startup — they are NOT reloaded from per-role/user/tenant admin overrides. Encode
|
|
3984
|
+
* per-user/tenant behavior INSIDE the hook (via its runtime context), not by varying the
|
|
3985
|
+
* module list per override. Honored only when `enabled` is true.
|
|
3986
|
+
*/
|
|
3987
|
+
hooks: z.array(toolApprovalHookConfigSchema).optional()
|
|
3988
|
+
}).optional();
|
|
3989
|
+
/**
|
|
3990
|
+
* Durable checkpointer backing human-in-the-loop resume.
|
|
3991
|
+
*
|
|
3992
|
+
* When `toolApproval.enabled` is true, a run that pauses for review suspends its
|
|
3993
|
+
* LangGraph state to a checkpoint; resuming rebuilds that state on a *fresh* `Run`
|
|
3994
|
+
* — possibly on a different replica, or the same worker after a restart. That only
|
|
3995
|
+
* works if the checkpoint outlives the original request, so HITL needs a durable
|
|
3996
|
+
* saver, not the SDK's process-local `MemorySaver` fallback.
|
|
3997
|
+
*
|
|
3998
|
+
* Defaults are zero-config: with `toolApproval.enabled` on and no `checkpointer`
|
|
3999
|
+
* block, LibreChat persists checkpoints to its primary MongoDB, so resume works
|
|
4000
|
+
* across replicas out of the box.
|
|
4001
|
+
*
|
|
4002
|
+
* - `type: 'mongo'` (default) — persist to the app database; survives restarts and
|
|
4003
|
+
* resolves on any replica. A TTL index reclaims runs that are never resolved.
|
|
4004
|
+
* - `type: 'memory'` — process-local only. Paused runs do NOT survive a restart and
|
|
4005
|
+
* can only be resolved on the originating worker. Single-process / dev only.
|
|
4006
|
+
*/
|
|
4007
|
+
const checkpointerTypeSchema = z.enum(["mongo", "memory"]);
|
|
4008
|
+
const checkpointerSchema = z.object({
|
|
4009
|
+
type: checkpointerTypeSchema.optional(),
|
|
4010
|
+
/**
|
|
4011
|
+
* Approval window, in seconds: how long a paused run waits for a decision
|
|
4012
|
+
* before it is reclaimed. Drives both the Mongo TTL index on checkpoints and
|
|
4013
|
+
* the pending-action expiry, keeping the two layers in lockstep. Defaults to
|
|
4014
|
+
* 86400 (24h). Raise it for longer review windows.
|
|
4015
|
+
*/
|
|
4016
|
+
ttl: z.number().int().positive().optional(),
|
|
4017
|
+
/** Advanced: override the Mongo collection names used for checkpoints. */
|
|
4018
|
+
checkpointCollectionName: z.string().optional(),
|
|
4019
|
+
checkpointWritesCollectionName: z.string().optional()
|
|
4020
|
+
}).optional();
|
|
3531
4021
|
const agentsEndpointSchema = baseEndpointSchema.omit({ baseURL: true }).merge(z.object({
|
|
3532
4022
|
recursionLimit: z.number().optional(),
|
|
3533
4023
|
disableBuilder: z.boolean().optional().default(false),
|
|
3534
4024
|
maxRecursionLimit: z.number().optional(),
|
|
4025
|
+
/** Max cumulative bytes a single streamed tool call's arguments may reach before the run
|
|
4026
|
+
* aborts. Defaults to 64 KiB in the agents SDK; `0` disables the guard. */
|
|
4027
|
+
maxToolCallArgBytes: z.number().optional(),
|
|
4028
|
+
/** Max streamed chunk events per model generation before the run aborts. Off by default. */
|
|
4029
|
+
maxDeltaEventsPerTurn: z.number().optional(),
|
|
4030
|
+
/** Per-tool overrides of `maxToolCallArgBytes`, keyed by model-facing tool name; `0`
|
|
4031
|
+
* disables the guard for that tool only. Merged over LibreChat's shipped default of
|
|
4032
|
+
* `{ create_file: 131072 }`. */
|
|
4033
|
+
maxToolCallArgBytesByTool: z.record(z.number()).optional(),
|
|
3535
4034
|
maxCitations: z.number().min(1).max(50).optional().default(30),
|
|
3536
4035
|
maxCitationsPerFile: z.number().min(1).max(10).optional().default(7),
|
|
3537
4036
|
minRelevanceScore: z.number().min(0).max(1).optional().default(.45),
|
|
3538
4037
|
allowedProviders: z.array(z.union([z.string(), eModelEndpointSchema])).optional(),
|
|
3539
4038
|
capabilities: z.array(z.nativeEnum(AgentCapabilities)).optional().default(defaultAgentCapabilities),
|
|
3540
4039
|
skills: z.object({ maxCatalogSkills: z.number().int().min(1).max(100).optional() }).optional(),
|
|
3541
|
-
remoteApi: remoteApiSchema.optional()
|
|
4040
|
+
remoteApi: remoteApiSchema.optional(),
|
|
4041
|
+
/** Human-in-the-loop tool approval policy. Off by default. */
|
|
4042
|
+
toolApproval: toolApprovalPolicySchema,
|
|
4043
|
+
/** Durable checkpointer backing tool-approval and Ask User resume.
|
|
4044
|
+
* Defaults to the app's MongoDB when either flow needs it. */
|
|
4045
|
+
checkpointer: checkpointerSchema
|
|
3542
4046
|
})).default({
|
|
3543
4047
|
disableBuilder: false,
|
|
3544
4048
|
capabilities: defaultAgentCapabilities,
|
|
@@ -3597,6 +4101,9 @@ const paramDefinitionSchema = z.object({
|
|
|
3597
4101
|
const endpointSchema = baseEndpointSchema.merge(z.object({
|
|
3598
4102
|
name: z.string().refine((value) => !eModelEndpointSchema.safeParse(value).success, { message: `Value cannot be one of the default endpoint (EModelEndpoint) values: ${Object.values(EModelEndpoint).join(", ")}` }),
|
|
3599
4103
|
apiKey: z.string(),
|
|
4104
|
+
/** Masked preview of the API key, stored at write time so admin
|
|
4105
|
+
* reads can show which key is configured without returning the secret. */
|
|
4106
|
+
apiKeyPreview: z.string().optional(),
|
|
3600
4107
|
baseURL: z.string(),
|
|
3601
4108
|
models: z.object({
|
|
3602
4109
|
default: z.array(modelItemSchema).min(1),
|
|
@@ -3644,15 +4151,35 @@ const endpointSchema = baseEndpointSchema.merge(z.object({
|
|
|
3644
4151
|
const azureEndpointSchema = z.object({
|
|
3645
4152
|
groups: azureGroupConfigsSchema,
|
|
3646
4153
|
assistants: z.boolean().optional()
|
|
3647
|
-
}).and(
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
4154
|
+
}).and(
|
|
4155
|
+
/**
|
|
4156
|
+
* Azure carries only the base-endpoint fields enumerated here. This is a
|
|
4157
|
+
* `.pick()`, NOT an omit, so a field added to `baseEndpointSchema` is
|
|
4158
|
+
* silently unavailable on Azure endpoints until it is listed below —
|
|
4159
|
+
* unlike `endpoints.all`, which omits and therefore inherits new fields
|
|
4160
|
+
* automatically. Keep this list in sync when adding endpoint options.
|
|
4161
|
+
*/
|
|
4162
|
+
endpointSchema.pick({
|
|
4163
|
+
streamRate: true,
|
|
4164
|
+
titleConvo: true,
|
|
4165
|
+
titleMethod: true,
|
|
4166
|
+
titleModel: true,
|
|
4167
|
+
titlePrompt: true,
|
|
4168
|
+
titleTiming: true,
|
|
4169
|
+
titlePromptTemplate: true,
|
|
4170
|
+
activityLabel: true,
|
|
4171
|
+
activityModel: true,
|
|
4172
|
+
activityEndpoint: true,
|
|
4173
|
+
activityPrompt: true,
|
|
4174
|
+
activityMaxPerRun: true,
|
|
4175
|
+
activityCharLimit: true,
|
|
4176
|
+
activityPhaseLabel: true,
|
|
4177
|
+
activityPhaseModel: true,
|
|
4178
|
+
activityPhaseEndpoint: true,
|
|
4179
|
+
activityPhasePrompt: true,
|
|
4180
|
+
activityPhaseMaxPerRun: true
|
|
4181
|
+
}).partial()
|
|
4182
|
+
);
|
|
3656
4183
|
/**
|
|
3657
4184
|
* Vertex AI model configuration - similar to Azure model config
|
|
3658
4185
|
* Allows specifying deployment name for each model
|
|
@@ -3688,15 +4215,20 @@ const anthropicEndpointSchema = baseEndpointSchema.merge(z.object({
|
|
|
3688
4215
|
/** Optional: List of available models */
|
|
3689
4216
|
models: z.array(z.string()).optional()
|
|
3690
4217
|
}));
|
|
4218
|
+
/** Masked preview of the API key, stored at write time so admin
|
|
4219
|
+
* reads can show which key is configured without returning the secret. */
|
|
4220
|
+
const apiKeyPreviewSchema = z.string().optional();
|
|
3691
4221
|
const ttsOpenaiSchema = z.object({
|
|
3692
4222
|
url: z.string().optional(),
|
|
3693
4223
|
apiKey: z.string(),
|
|
4224
|
+
apiKeyPreview: apiKeyPreviewSchema,
|
|
3694
4225
|
model: z.string(),
|
|
3695
4226
|
voices: z.array(z.string())
|
|
3696
4227
|
});
|
|
3697
4228
|
const ttsAzureOpenAISchema = z.object({
|
|
3698
4229
|
instanceName: z.string(),
|
|
3699
4230
|
apiKey: z.string(),
|
|
4231
|
+
apiKeyPreview: apiKeyPreviewSchema,
|
|
3700
4232
|
deploymentName: z.string(),
|
|
3701
4233
|
apiVersion: z.string(),
|
|
3702
4234
|
model: z.string(),
|
|
@@ -3706,6 +4238,7 @@ const ttsElevenLabsSchema = z.object({
|
|
|
3706
4238
|
url: z.string().optional(),
|
|
3707
4239
|
websocketUrl: z.string().optional(),
|
|
3708
4240
|
apiKey: z.string(),
|
|
4241
|
+
apiKeyPreview: apiKeyPreviewSchema,
|
|
3709
4242
|
model: z.string(),
|
|
3710
4243
|
voices: z.array(z.string()),
|
|
3711
4244
|
voice_settings: z.object({
|
|
@@ -3719,10 +4252,12 @@ const ttsElevenLabsSchema = z.object({
|
|
|
3719
4252
|
const ttsLocalaiSchema = z.object({
|
|
3720
4253
|
url: z.string(),
|
|
3721
4254
|
apiKey: z.string().optional(),
|
|
4255
|
+
apiKeyPreview: apiKeyPreviewSchema,
|
|
3722
4256
|
voices: z.array(z.string()),
|
|
3723
4257
|
backend: z.string()
|
|
3724
4258
|
});
|
|
3725
4259
|
const ttsSchema = z.object({
|
|
4260
|
+
allowedAddresses: allowedAddressesSchema,
|
|
3726
4261
|
openai: ttsOpenaiSchema.optional(),
|
|
3727
4262
|
azureOpenAI: ttsAzureOpenAISchema.optional(),
|
|
3728
4263
|
elevenlabs: ttsElevenLabsSchema.optional(),
|
|
@@ -3731,15 +4266,18 @@ const ttsSchema = z.object({
|
|
|
3731
4266
|
const sttOpenaiSchema = z.object({
|
|
3732
4267
|
url: z.string().optional(),
|
|
3733
4268
|
apiKey: z.string(),
|
|
4269
|
+
apiKeyPreview: apiKeyPreviewSchema,
|
|
3734
4270
|
model: z.string()
|
|
3735
4271
|
});
|
|
3736
4272
|
const sttAzureOpenAISchema = z.object({
|
|
3737
4273
|
instanceName: z.string(),
|
|
3738
4274
|
apiKey: z.string(),
|
|
4275
|
+
apiKeyPreview: apiKeyPreviewSchema,
|
|
3739
4276
|
deploymentName: z.string(),
|
|
3740
4277
|
apiVersion: z.string()
|
|
3741
4278
|
});
|
|
3742
4279
|
const sttSchema = z.object({
|
|
4280
|
+
allowedAddresses: allowedAddressesSchema,
|
|
3743
4281
|
openai: sttOpenaiSchema.optional(),
|
|
3744
4282
|
azureOpenAI: sttAzureOpenAISchema.optional()
|
|
3745
4283
|
});
|
|
@@ -3747,16 +4285,23 @@ const speechTab = z.object({
|
|
|
3747
4285
|
conversationMode: z.boolean().optional(),
|
|
3748
4286
|
advancedMode: z.boolean().optional(),
|
|
3749
4287
|
speechToText: z.boolean().optional().or(z.object({
|
|
3750
|
-
/**
|
|
3751
|
-
engineSTT: z.enum([
|
|
4288
|
+
/** Provider names remain valid for backward compatibility and are normalized for clients. */
|
|
4289
|
+
engineSTT: z.enum([
|
|
4290
|
+
"browser",
|
|
4291
|
+
"external",
|
|
4292
|
+
"openai",
|
|
4293
|
+
"azureOpenAI"
|
|
4294
|
+
]).optional(),
|
|
3752
4295
|
languageSTT: z.string().optional(),
|
|
3753
4296
|
autoTranscribeAudio: z.boolean().optional(),
|
|
3754
4297
|
decibelValue: z.number().optional(),
|
|
3755
4298
|
autoSendText: z.number().optional()
|
|
3756
4299
|
})).optional(),
|
|
3757
4300
|
textToSpeech: z.boolean().optional().or(z.object({
|
|
3758
|
-
/**
|
|
4301
|
+
/** Provider names remain valid for backward compatibility and are normalized for clients. */
|
|
3759
4302
|
engineTTS: z.enum([
|
|
4303
|
+
"browser",
|
|
4304
|
+
"external",
|
|
3760
4305
|
"openai",
|
|
3761
4306
|
"azureOpenAI",
|
|
3762
4307
|
"elevenlabs",
|
|
@@ -4017,18 +4562,25 @@ let SafeSearchTypes = /* @__PURE__ */ function(SafeSearchTypes) {
|
|
|
4017
4562
|
return SafeSearchTypes;
|
|
4018
4563
|
}({});
|
|
4019
4564
|
const webSearchSchema = z.object({
|
|
4565
|
+
allowedAddresses: allowedAddressesSchema,
|
|
4020
4566
|
serperApiKey: z.string().optional().default("${SERPER_API_KEY}"),
|
|
4567
|
+
serperApiKeyPreview: apiKeyPreviewSchema,
|
|
4021
4568
|
searxngInstanceUrl: z.string().optional().default("${SEARXNG_INSTANCE_URL}"),
|
|
4022
4569
|
searxngApiKey: z.string().optional().default("${SEARXNG_API_KEY}"),
|
|
4570
|
+
searxngApiKeyPreview: apiKeyPreviewSchema,
|
|
4023
4571
|
firecrawlApiKey: z.string().optional().default("${FIRECRAWL_API_KEY}"),
|
|
4572
|
+
firecrawlApiKeyPreview: apiKeyPreviewSchema,
|
|
4024
4573
|
firecrawlApiUrl: z.string().optional().default("${FIRECRAWL_API_URL}"),
|
|
4025
4574
|
firecrawlVersion: z.string().optional().default("${FIRECRAWL_VERSION}"),
|
|
4026
4575
|
tavilyApiKey: z.string().optional().default("${TAVILY_API_KEY}"),
|
|
4576
|
+
tavilyApiKeyPreview: apiKeyPreviewSchema,
|
|
4027
4577
|
tavilySearchUrl: z.string().optional().default("${TAVILY_SEARCH_URL}"),
|
|
4028
4578
|
tavilyExtractUrl: z.string().optional().default("${TAVILY_EXTRACT_URL}"),
|
|
4029
4579
|
jinaApiKey: z.string().optional().default("${JINA_API_KEY}"),
|
|
4580
|
+
jinaApiKeyPreview: apiKeyPreviewSchema,
|
|
4030
4581
|
jinaApiUrl: z.string().optional().default("${JINA_API_URL}"),
|
|
4031
4582
|
cohereApiKey: z.string().optional().default("${COHERE_API_KEY}"),
|
|
4583
|
+
cohereApiKeyPreview: apiKeyPreviewSchema,
|
|
4032
4584
|
searchProvider: z.nativeEnum(SearchProviders).optional(),
|
|
4033
4585
|
scraperProvider: z.nativeEnum(ScraperProviders).optional(),
|
|
4034
4586
|
rerankerType: z.nativeEnum(RerankerTypes).optional(),
|
|
@@ -4104,8 +4656,10 @@ const webSearchSchema = z.object({
|
|
|
4104
4656
|
}).optional()
|
|
4105
4657
|
});
|
|
4106
4658
|
const ocrSchema = z.object({
|
|
4659
|
+
allowedAddresses: allowedAddressesSchema,
|
|
4107
4660
|
mistralModel: z.string().optional(),
|
|
4108
4661
|
apiKey: z.string().optional().default("${OCR_API_KEY}"),
|
|
4662
|
+
apiKeyPreview: apiKeyPreviewSchema,
|
|
4109
4663
|
baseURL: z.string().optional().default("${OCR_BASEURL}"),
|
|
4110
4664
|
strategy: z.nativeEnum(OCRStrategy).default("mistral_ocr")
|
|
4111
4665
|
});
|
|
@@ -4163,6 +4717,10 @@ const contextPruningSchema = z.object({
|
|
|
4163
4717
|
hardClearRatio: z.number().min(0).max(1).optional(),
|
|
4164
4718
|
minPrunableToolChars: z.number().min(0).optional()
|
|
4165
4719
|
});
|
|
4720
|
+
const retainRecentConfigSchema = z.object({
|
|
4721
|
+
turns: z.number().min(0).max(20).optional(),
|
|
4722
|
+
tokens: z.number().positive().optional()
|
|
4723
|
+
});
|
|
4166
4724
|
const summarizationConfigSchema = z.object({
|
|
4167
4725
|
enabled: z.boolean().optional(),
|
|
4168
4726
|
provider: z.string().optional(),
|
|
@@ -4178,31 +4736,56 @@ const summarizationConfigSchema = z.object({
|
|
|
4178
4736
|
updatePrompt: z.string().optional(),
|
|
4179
4737
|
reserveRatio: z.number().min(0).max(1).optional(),
|
|
4180
4738
|
maxSummaryTokens: z.number().positive().optional(),
|
|
4181
|
-
contextPruning: contextPruningSchema.optional()
|
|
4739
|
+
contextPruning: contextPruningSchema.optional(),
|
|
4740
|
+
retainRecent: retainRecentConfigSchema.optional()
|
|
4182
4741
|
});
|
|
4183
4742
|
const customEndpointsSchema = z.array(endpointSchema.partial()).optional();
|
|
4743
|
+
/**
|
|
4744
|
+
* Validates a messageFilter PII regex at config load. Defaults to native RegExp so browser
|
|
4745
|
+
* builds add no extra engine; the server injects a check backed by the linear-time runtime
|
|
4746
|
+
* engine (RE2) via setMessageFilterRegexValidator, so a pattern the runtime cannot compile
|
|
4747
|
+
* (backreferences, lookaround, control escapes, and so on) is rejected at load rather than
|
|
4748
|
+
* silently dropped at request time.
|
|
4749
|
+
*/
|
|
4750
|
+
let messageFilterRegexValidator = (value) => {
|
|
4751
|
+
try {
|
|
4752
|
+
new RegExp(value, "g");
|
|
4753
|
+
return true;
|
|
4754
|
+
} catch {
|
|
4755
|
+
return false;
|
|
4756
|
+
}
|
|
4757
|
+
};
|
|
4758
|
+
const setMessageFilterRegexValidator = (validate) => {
|
|
4759
|
+
messageFilterRegexValidator = validate;
|
|
4760
|
+
};
|
|
4184
4761
|
const messageFilterPiiCustomPatternSchema = z.object({
|
|
4185
4762
|
id: z.string().min(1),
|
|
4186
4763
|
label: z.string().min(1),
|
|
4187
|
-
regex: z.string().min(1).refine((value) => {
|
|
4188
|
-
try {
|
|
4189
|
-
new RegExp(value, "g");
|
|
4190
|
-
return true;
|
|
4191
|
-
} catch {
|
|
4192
|
-
return false;
|
|
4193
|
-
}
|
|
4194
|
-
}, { message: "Invalid regex" })
|
|
4764
|
+
regex: z.string().min(1).refine((value) => messageFilterRegexValidator(value), { message: "Unsupported regex: not compatible with the RE2 engine (no backreferences, lookaround, or control escapes)" })
|
|
4195
4765
|
});
|
|
4196
4766
|
const messageFilterPiiSchema = z.object({
|
|
4197
4767
|
starterPatterns: z.array(z.string()).optional(),
|
|
4198
4768
|
customPatterns: z.array(messageFilterPiiCustomPatternSchema).optional()
|
|
4199
4769
|
});
|
|
4200
4770
|
const messageFilterSchema = z.object({ pii: messageFilterPiiSchema.optional() });
|
|
4771
|
+
const langfuseConfigSchema = z.object({
|
|
4772
|
+
enabled: z.boolean().optional(),
|
|
4773
|
+
publicKey: z.string().optional(),
|
|
4774
|
+
secretKey: z.string().optional(),
|
|
4775
|
+
/** Stable Langfuse project identity returned when credentials are verified. */
|
|
4776
|
+
projectId: z.string().optional(),
|
|
4777
|
+
/** Masked preview of the secret key, stored at write time so
|
|
4778
|
+
* admin reads can show which secret key is configured without returning the secret. */
|
|
4779
|
+
secretKeyPreview: z.string().optional(),
|
|
4780
|
+
/** Routing key for one of the deployment-configured tenant Langfuse destinations. */
|
|
4781
|
+
destination: z.string().optional()
|
|
4782
|
+
});
|
|
4201
4783
|
const configSchema = z.object({
|
|
4202
4784
|
version: z.string(),
|
|
4203
4785
|
cache: z.boolean().default(true),
|
|
4204
4786
|
ocr: ocrSchema.optional(),
|
|
4205
4787
|
webSearch: webSearchSchema.optional(),
|
|
4788
|
+
langfuse: langfuseConfigSchema.optional(),
|
|
4206
4789
|
memory: memorySchema.optional(),
|
|
4207
4790
|
summarization: summarizationConfigSchema.optional(),
|
|
4208
4791
|
skillSync: skillSyncConfigSchema,
|
|
@@ -4241,6 +4824,13 @@ const configSchema = z.object({
|
|
|
4241
4824
|
messageFilter: messageFilterSchema.optional(),
|
|
4242
4825
|
endpoints: z.object({
|
|
4243
4826
|
allowedAddresses: allowedAddressesSchema,
|
|
4827
|
+
/**
|
|
4828
|
+
* Defaults applied to every endpoint. Omit-based, so options added to
|
|
4829
|
+
* `baseEndpointSchema` are inherited here automatically — no list to
|
|
4830
|
+
* maintain (contrast `azureEndpointSchema`, which enumerates via
|
|
4831
|
+
* `.pick()`). Resolution order at read sites is `all` > the named
|
|
4832
|
+
* endpoint > a custom endpoint's own config.
|
|
4833
|
+
*/
|
|
4244
4834
|
all: baseEndpointSchema.omit({ baseURL: true }).optional(),
|
|
4245
4835
|
["openAI"]: baseEndpointSchema.optional(),
|
|
4246
4836
|
["google"]: baseEndpointSchema.optional(),
|
|
@@ -4310,6 +4900,9 @@ const alternateName = {
|
|
|
4310
4900
|
["helicone"]: "Helicone"
|
|
4311
4901
|
};
|
|
4312
4902
|
const sharedOpenAIModels = [
|
|
4903
|
+
"gpt-5.6",
|
|
4904
|
+
"gpt-5.6-terra",
|
|
4905
|
+
"gpt-5.6-luna",
|
|
4313
4906
|
"gpt-5.5",
|
|
4314
4907
|
"gpt-5.5-pro",
|
|
4315
4908
|
"chat-latest",
|
|
@@ -4334,8 +4927,10 @@ const sharedOpenAIModels = [
|
|
|
4334
4927
|
];
|
|
4335
4928
|
const sharedAnthropicModels = [
|
|
4336
4929
|
"claude-fable-5",
|
|
4930
|
+
"claude-opus-5",
|
|
4337
4931
|
"claude-opus-4-8",
|
|
4338
4932
|
"claude-opus-4-7",
|
|
4933
|
+
"claude-sonnet-5",
|
|
4339
4934
|
"claude-sonnet-4-6",
|
|
4340
4935
|
"claude-opus-4-6",
|
|
4341
4936
|
"claude-sonnet-4-5",
|
|
@@ -4356,18 +4951,25 @@ const sharedAnthropicModels = [
|
|
|
4356
4951
|
"claude-3-5-sonnet-20240620",
|
|
4357
4952
|
"claude-3-5-sonnet-latest"
|
|
4358
4953
|
];
|
|
4954
|
+
/**
|
|
4955
|
+
* Claude 4+ models are not invocable on-demand by their bare foundation-model
|
|
4956
|
+
* ID on the Converse path — Bedrock rejects those with "Invocation of model ID
|
|
4957
|
+
* ... with on-demand throughput isn't supported. Retry your request with the ID
|
|
4958
|
+
* or ARN of an inference profile that contains this model." Default to the
|
|
4959
|
+
* `global.` cross-region profile (no regional pricing premium, widest
|
|
4960
|
+
* availability); Opus 4.1 has no global profile, so it uses `us.`.
|
|
4961
|
+
*/
|
|
4359
4962
|
const bedrockModels = [
|
|
4360
|
-
"anthropic.claude-fable-5",
|
|
4361
|
-
"anthropic.claude-opus-
|
|
4362
|
-
"anthropic.claude-opus-4-
|
|
4363
|
-
"anthropic.claude-
|
|
4364
|
-
"anthropic.claude-
|
|
4365
|
-
"anthropic.claude-sonnet-4-
|
|
4366
|
-
"anthropic.claude-
|
|
4367
|
-
"anthropic.claude-
|
|
4368
|
-
"anthropic.claude-
|
|
4369
|
-
"anthropic.claude-
|
|
4370
|
-
"anthropic.claude-3-5-haiku-20241022-v1:0",
|
|
4963
|
+
"global.anthropic.claude-fable-5",
|
|
4964
|
+
"global.anthropic.claude-opus-5",
|
|
4965
|
+
"global.anthropic.claude-opus-4-8",
|
|
4966
|
+
"global.anthropic.claude-opus-4-7",
|
|
4967
|
+
"global.anthropic.claude-sonnet-5",
|
|
4968
|
+
"global.anthropic.claude-sonnet-4-6",
|
|
4969
|
+
"global.anthropic.claude-opus-4-6-v1",
|
|
4970
|
+
"global.anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
4971
|
+
"global.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
4972
|
+
"us.anthropic.claude-opus-4-1-20250805-v1:0",
|
|
4371
4973
|
"cohere.command-r-v1:0",
|
|
4372
4974
|
"cohere.command-r-plus-v1:0",
|
|
4373
4975
|
"meta.llama2-13b-chat-v1",
|
|
@@ -4392,7 +4994,10 @@ const defaultModels = {
|
|
|
4392
4994
|
["assistants"]: [...sharedOpenAIModels, "chatgpt-4o-latest"],
|
|
4393
4995
|
["agents"]: sharedOpenAIModels,
|
|
4394
4996
|
["google"]: [
|
|
4997
|
+
"gemini-3.7-flash",
|
|
4998
|
+
"gemini-3.6-flash",
|
|
4395
4999
|
"gemini-3.5-flash",
|
|
5000
|
+
"gemini-3.5-flash-lite",
|
|
4396
5001
|
"gemini-3.1-pro-preview",
|
|
4397
5002
|
"gemini-3.1-pro-preview-customtools",
|
|
4398
5003
|
"gemini-3.1-flash-lite-preview",
|
|
@@ -4552,6 +5157,14 @@ let CacheKeys = /* @__PURE__ */ function(CacheKeys) {
|
|
|
4552
5157
|
*/
|
|
4553
5158
|
CacheKeys["ROLES"] = "ROLES";
|
|
4554
5159
|
/**
|
|
5160
|
+
* Key for cached group memberships used to resolve ACL user principals.
|
|
5161
|
+
*/
|
|
5162
|
+
CacheKeys["USER_PRINCIPALS"] = "USER_PRINCIPALS";
|
|
5163
|
+
/**
|
|
5164
|
+
* Key for per-conversation stateful code sandbox prewarm/warm state.
|
|
5165
|
+
*/
|
|
5166
|
+
CacheKeys["SANDBOX_PREWARM"] = "SANDBOX_PREWARM";
|
|
5167
|
+
/**
|
|
4555
5168
|
* Key for the title generation cache.
|
|
4556
5169
|
*/
|
|
4557
5170
|
CacheKeys["GEN_TITLE"] = "GEN_TITLE";
|
|
@@ -4621,6 +5234,10 @@ let CacheKeys = /* @__PURE__ */ function(CacheKeys) {
|
|
|
4621
5234
|
*/
|
|
4622
5235
|
CacheKeys["OPENID_EXCHANGED_TOKENS"] = "OPENID_EXCHANGED_TOKENS";
|
|
4623
5236
|
/**
|
|
5237
|
+
* Key for cached authenticated user documents.
|
|
5238
|
+
*/
|
|
5239
|
+
CacheKeys["AUTH_USER_DOC"] = "AUTH_USER_DOC";
|
|
5240
|
+
/**
|
|
4624
5241
|
* Key for OpenID session.
|
|
4625
5242
|
*/
|
|
4626
5243
|
CacheKeys["OPENID_SESSION"] = "OPENID_SESSION";
|
|
@@ -4634,6 +5251,7 @@ let CacheKeys = /* @__PURE__ */ function(CacheKeys) {
|
|
|
4634
5251
|
CacheKeys["ADMIN_OAUTH_EXCHANGE"] = "ADMIN_OAUTH_EXCHANGE";
|
|
4635
5252
|
return CacheKeys;
|
|
4636
5253
|
}({});
|
|
5254
|
+
const AUTH_USER_DOC_BY_ID_PREFIX = "auth-user-doc-byid";
|
|
4637
5255
|
/**
|
|
4638
5256
|
* Enum for violation types, used to identify, log, and cache violations.
|
|
4639
5257
|
*/
|
|
@@ -4757,6 +5375,14 @@ let ErrorTypes = /* @__PURE__ */ function(ErrorTypes) {
|
|
|
4757
5375
|
*/
|
|
4758
5376
|
ErrorTypes["GOOGLE_TOOL_CONFLICT"] = "google_tool_conflict";
|
|
4759
5377
|
/**
|
|
5378
|
+
* Google provider could not process a linked video (most often longer than the model accepts)
|
|
5379
|
+
*/
|
|
5380
|
+
ErrorTypes["GOOGLE_VIDEO_UNPROCESSABLE"] = "google_video_unprocessable";
|
|
5381
|
+
/**
|
|
5382
|
+
* Required CodeAPI resources could not be restored before model invocation.
|
|
5383
|
+
*/
|
|
5384
|
+
ErrorTypes["RESOURCE_RECOVERY_REQUIRED"] = "resource_recovery_required";
|
|
5385
|
+
/**
|
|
4760
5386
|
* Invalid Agent Provider (excluded by Admin)
|
|
4761
5387
|
*/
|
|
4762
5388
|
ErrorTypes["INVALID_AGENT_PROVIDER"] = "invalid_agent_provider";
|
|
@@ -4849,6 +5475,10 @@ let SettingsTabValues = /* @__PURE__ */ function(SettingsTabValues) {
|
|
|
4849
5475
|
*/
|
|
4850
5476
|
SettingsTabValues["SPEECH"] = "speech";
|
|
4851
5477
|
/**
|
|
5478
|
+
* Tab for Langfuse Settings
|
|
5479
|
+
*/
|
|
5480
|
+
SettingsTabValues["LANGFUSE"] = "langfuse";
|
|
5481
|
+
/**
|
|
4852
5482
|
* Tab for Beta Features
|
|
4853
5483
|
*/
|
|
4854
5484
|
SettingsTabValues["BETA"] = "beta";
|
|
@@ -4911,7 +5541,7 @@ let TTSProviders = /* @__PURE__ */ function(TTSProviders) {
|
|
|
4911
5541
|
/** Enum for app-wide constants */
|
|
4912
5542
|
let Constants = /* @__PURE__ */ function(Constants) {
|
|
4913
5543
|
/**
|
|
4914
|
-
* Key for the app's version. The placeholder `v0.8.
|
|
5544
|
+
* Key for the app's version. The placeholder `v0.8.8-rc1` is
|
|
4915
5545
|
* swapped in by `@rollup/plugin-replace` during `npm run build:data-provider`
|
|
4916
5546
|
* using the value of the root `package.json`'s `version` field. Consumers
|
|
4917
5547
|
* always import this via the built dist bundle (see `main` field in
|
|
@@ -4919,9 +5549,9 @@ let Constants = /* @__PURE__ */ function(Constants) {
|
|
|
4919
5549
|
* substituted value. Only tests that import the TypeScript source directly
|
|
4920
5550
|
* would observe the raw placeholder.
|
|
4921
5551
|
*/
|
|
4922
|
-
Constants["VERSION"] = "v0.8.
|
|
5552
|
+
Constants["VERSION"] = "v0.8.8-rc1";
|
|
4923
5553
|
/** Key for the Custom Config's version (librechat.yaml). */
|
|
4924
|
-
Constants["CONFIG_VERSION"] = "1.3.
|
|
5554
|
+
Constants["CONFIG_VERSION"] = "1.3.14";
|
|
4925
5555
|
/** Standard value for the first message's `parentMessageId` value, to indicate no parent exists. */
|
|
4926
5556
|
Constants["NO_PARENT"] = "00000000-0000-0000-0000-000000000000";
|
|
4927
5557
|
/** Standard value to use whatever the submission prelim. `responseMessageId` is */
|
|
@@ -4973,8 +5603,126 @@ let Constants = /* @__PURE__ */ function(Constants) {
|
|
|
4973
5603
|
Constants["BASH_PROGRAMMATIC_TOOL_CALLING"] = "run_tools_with_bash";
|
|
4974
5604
|
/** Subagent spawn tool name (must match `@librechat/agents` `Constants.SUBAGENT`). */
|
|
4975
5605
|
Constants["SUBAGENT"] = "subagent";
|
|
5606
|
+
/** Poll tool for retrieving the status/result of a backgrounded tool call. */
|
|
5607
|
+
Constants["CHECK_BACKGROUND_TASK"] = "check_background_task";
|
|
4976
5608
|
return Constants;
|
|
4977
5609
|
}({});
|
|
5610
|
+
/**
|
|
5611
|
+
* Normalizes a server name into the character set tool keys are built from.
|
|
5612
|
+
* Tool keys embed this output, so any candidate list matched against a key must
|
|
5613
|
+
* be normalized the same way.
|
|
5614
|
+
*/
|
|
5615
|
+
function normalizeServerName(serverName) {
|
|
5616
|
+
if (/^[a-zA-Z0-9_.-]+$/.test(serverName)) return serverName;
|
|
5617
|
+
const normalized = serverName.replace(/[^a-zA-Z0-9_.-]/g, "_").replace(/^_+|_+$/g, "");
|
|
5618
|
+
if (normalized) return normalized;
|
|
5619
|
+
/** All characters were stripped; hash the original so the name stays unique. */
|
|
5620
|
+
let hash = 0;
|
|
5621
|
+
for (let i = 0; i < serverName.length; i++) {
|
|
5622
|
+
hash = (hash << 5) - hash + serverName.charCodeAt(i);
|
|
5623
|
+
hash |= 0;
|
|
5624
|
+
}
|
|
5625
|
+
return `server_${Math.abs(hash)}`;
|
|
5626
|
+
}
|
|
5627
|
+
/**
|
|
5628
|
+
* Splits a combined MCP tool key (`${rawToolName}${mcp_delimiter}${serverName}`)
|
|
5629
|
+
* back into its two parts.
|
|
5630
|
+
*
|
|
5631
|
+
* Both halves can legitimately contain the delimiter, so position alone cannot
|
|
5632
|
+
* identify the boundary. Raw tool names come from the upstream server and are
|
|
5633
|
+
* untrusted (`get_mcp_server_version`, or a gateway-prefixed
|
|
5634
|
+
* `gitlab-get_mcp_server_version`), and `normalizeServerName` preserves
|
|
5635
|
+
* underscores, so a configured server may be named `Google_mcp_Workspace`.
|
|
5636
|
+
*
|
|
5637
|
+
* When `knownServerNames` is supplied the boundary is resolved against it: the
|
|
5638
|
+
* longest configured name the key actually ends with wins. Otherwise this falls
|
|
5639
|
+
* back to the last delimiter, which is correct whenever only the tool half
|
|
5640
|
+
* contains one and matches `.split()` when neither does.
|
|
5641
|
+
*
|
|
5642
|
+
* One case stays undecidable from the key alone: if both `bar` and `foo_mcp_bar`
|
|
5643
|
+
* are configured, `tool_mcp_foo_mcp_bar` is a valid key for either. Longest match
|
|
5644
|
+
* is the deterministic tiebreak; resolving it properly needs the tool/server
|
|
5645
|
+
* mapping carried alongside the key rather than re-derived from the string.
|
|
5646
|
+
*/
|
|
5647
|
+
/**
|
|
5648
|
+
* Maps each configured server name's normalized form back to the raw config
|
|
5649
|
+
* name. Model-facing tool keys embed `normalizeServerName(server)`, while the
|
|
5650
|
+
* registry, config maps, tool cache, and plugin-auth rows are keyed by the raw
|
|
5651
|
+
* name — any consumer that parses a server out of a tool key must resolve it
|
|
5652
|
+
* through this map before those lookups. Identity entries are included so
|
|
5653
|
+
* `aliases.get(name) ?? name` works uniformly.
|
|
5654
|
+
*
|
|
5655
|
+
* When two configured names normalize to the same value their tool keys are
|
|
5656
|
+
* inherently ambiguous; the FIRST configured name wins deterministically here,
|
|
5657
|
+
* and `resolveMCPServerContext` warns about the collision so the operator can
|
|
5658
|
+
* rename one server.
|
|
5659
|
+
*/
|
|
5660
|
+
function buildServerNameAliases(rawServerNames) {
|
|
5661
|
+
const aliases = /* @__PURE__ */ new Map();
|
|
5662
|
+
/** Identity entries claim their slot FIRST regardless of configuration
|
|
5663
|
+
* order: a server literally named `foo` must never have its keys rerouted
|
|
5664
|
+
* to a `foo!` whose normalized form collides with it. */
|
|
5665
|
+
for (const raw of rawServerNames) if (raw && normalizeServerName(raw) === raw) aliases.set(raw, raw);
|
|
5666
|
+
for (const raw of rawServerNames) {
|
|
5667
|
+
if (!raw) continue;
|
|
5668
|
+
const normalized = normalizeServerName(raw);
|
|
5669
|
+
if (!aliases.has(normalized)) aliases.set(normalized, raw);
|
|
5670
|
+
}
|
|
5671
|
+
return aliases;
|
|
5672
|
+
}
|
|
5673
|
+
/**
|
|
5674
|
+
* Rewrites a tool key's server segment into the normalized form model-facing
|
|
5675
|
+
* keys carry, resolving the boundary against the configured raw names (longest
|
|
5676
|
+
* suffix wins, mirroring {@link splitMCPToolKey}). Returns the key unchanged
|
|
5677
|
+
* when no configured raw name matches — already-normalized keys, placeholder
|
|
5678
|
+
* tokens, and keys for servers that are no longer configured all pass through.
|
|
5679
|
+
* Idempotent: a normalized segment never matches a raw candidate that needs
|
|
5680
|
+
* rewriting.
|
|
5681
|
+
*/
|
|
5682
|
+
function normalizeMCPToolKey(toolKey, rawServerNames) {
|
|
5683
|
+
let matched;
|
|
5684
|
+
for (let i = 0; i < rawServerNames.length; i++) {
|
|
5685
|
+
const raw = rawServerNames[i];
|
|
5686
|
+
if (!raw || raw.length <= (matched?.length ?? 0)) continue;
|
|
5687
|
+
if (toolKey.endsWith(`_mcp_${raw}`)) matched = raw;
|
|
5688
|
+
}
|
|
5689
|
+
if (matched == null) return toolKey;
|
|
5690
|
+
const normalized = normalizeServerName(matched);
|
|
5691
|
+
if (normalized === matched) return toolKey;
|
|
5692
|
+
return `${toolKey.slice(0, toolKey.length - matched.length)}${normalized}`;
|
|
5693
|
+
}
|
|
5694
|
+
function splitMCPToolKey(toolKey, knownServerNames) {
|
|
5695
|
+
if (knownServerNames?.length) {
|
|
5696
|
+
let matched;
|
|
5697
|
+
for (let i = 0; i < knownServerNames.length; i++) {
|
|
5698
|
+
const serverName = knownServerNames[i];
|
|
5699
|
+
if (!serverName || serverName.length <= (matched?.length ?? 0)) continue;
|
|
5700
|
+
if (toolKey.endsWith(`_mcp_${serverName}`)) matched = serverName;
|
|
5701
|
+
}
|
|
5702
|
+
if (matched != null) return [toolKey.slice(0, toolKey.length - matched.length - 5), matched];
|
|
5703
|
+
}
|
|
5704
|
+
const idx = toolKey.lastIndexOf("_mcp_");
|
|
5705
|
+
if (idx === -1) return [toolKey, void 0];
|
|
5706
|
+
return [toolKey.slice(0, idx), toolKey.slice(idx + 5)];
|
|
5707
|
+
}
|
|
5708
|
+
/**
|
|
5709
|
+
* Splits a tool-call name for display, where the key may be a synthetic MCP OAuth
|
|
5710
|
+
* call (`oauth${mcp_delimiter}${serverName}`) rather than a real tool key.
|
|
5711
|
+
*
|
|
5712
|
+
* A configured server name is authoritative when one matches, because a real tool key
|
|
5713
|
+
* always ends in its server. Only when none matches does the `oauth` prefix decide,
|
|
5714
|
+
* which keeps a genuine upstream tool named `oauth${mcp_delimiter}...` from being read
|
|
5715
|
+
* as a synthetic call while still resolving OAuth prompts for unconfigured servers.
|
|
5716
|
+
*/
|
|
5717
|
+
function splitToolCallName(toolCallName, knownServerNames) {
|
|
5718
|
+
if (knownServerNames?.length) {
|
|
5719
|
+
const [toolName, serverName] = splitMCPToolKey(toolCallName, knownServerNames);
|
|
5720
|
+
if (serverName != null && knownServerNames.includes(serverName)) return [toolName, serverName];
|
|
5721
|
+
}
|
|
5722
|
+
const oauthPrefix = `oauth_mcp_`;
|
|
5723
|
+
if (toolCallName.startsWith(oauthPrefix)) return ["oauth", toolCallName.slice(oauthPrefix.length)];
|
|
5724
|
+
return splitMCPToolKey(toolCallName, knownServerNames);
|
|
5725
|
+
}
|
|
4978
5726
|
/** Maximum explicit subagent hops allowed from any root agent at runtime. */
|
|
4979
5727
|
const MAX_SUBAGENT_DEPTH = 5;
|
|
4980
5728
|
/** Maximum unique explicit subagent targets that may be loaded at runtime. */
|
|
@@ -5026,6 +5774,8 @@ let LocalStorageKeys = /* @__PURE__ */ function(LocalStorageKeys) {
|
|
|
5026
5774
|
LocalStorageKeys["LAST_ARTIFACTS_TOGGLE_"] = "LAST_ARTIFACTS_TOGGLE_";
|
|
5027
5775
|
/** Last checked toggle for Skills per conversation ID */
|
|
5028
5776
|
LocalStorageKeys["LAST_SKILLS_TOGGLE_"] = "LAST_SKILLS_TOGGLE_";
|
|
5777
|
+
/** Last checked toggle for Memory per conversation ID */
|
|
5778
|
+
LocalStorageKeys["LAST_MEMORY_TOGGLE_"] = "LAST_MEMORY_TOGGLE_";
|
|
5029
5779
|
/** Key for the last selected agent provider */
|
|
5030
5780
|
LocalStorageKeys["LAST_AGENT_PROVIDER"] = "lastAgentProvider";
|
|
5031
5781
|
/** Key for the last selected agent model */
|
|
@@ -5344,13 +6094,14 @@ let QueryKeys = /* @__PURE__ */ function(QueryKeys) {
|
|
|
5344
6094
|
QueryKeys["searchConversations"] = "searchConversations";
|
|
5345
6095
|
QueryKeys["conversation"] = "conversation";
|
|
5346
6096
|
QueryKeys["searchEnabled"] = "searchEnabled";
|
|
6097
|
+
QueryKeys["langfuseConnection"] = "langfuseConnection";
|
|
6098
|
+
QueryKeys["langfuseSessionLink"] = "langfuseSessionLink";
|
|
5347
6099
|
QueryKeys["user"] = "user";
|
|
5348
6100
|
QueryKeys["name"] = "name";
|
|
5349
6101
|
QueryKeys["models"] = "models";
|
|
5350
6102
|
QueryKeys["balance"] = "balance";
|
|
5351
6103
|
QueryKeys["endpoints"] = "endpoints";
|
|
5352
6104
|
QueryKeys["tokenConfig"] = "tokenConfig";
|
|
5353
|
-
QueryKeys["contextProjection"] = "contextProjection";
|
|
5354
6105
|
QueryKeys["presets"] = "presets";
|
|
5355
6106
|
QueryKeys["searchResults"] = "searchResults";
|
|
5356
6107
|
QueryKeys["tokenCount"] = "tokenCount";
|
|
@@ -5410,17 +6161,20 @@ let QueryKeys = /* @__PURE__ */ function(QueryKeys) {
|
|
|
5410
6161
|
QueryKeys["skillFileContent"] = "skillFileContent";
|
|
5411
6162
|
QueryKeys["skillTree"] = "skillTree";
|
|
5412
6163
|
QueryKeys["skillNodeContent"] = "skillNodeContent";
|
|
5413
|
-
QueryKeys["
|
|
6164
|
+
QueryKeys["toolFavorites"] = "toolFavorites";
|
|
5414
6165
|
QueryKeys["skillStates"] = "skillStates";
|
|
5415
6166
|
QueryKeys["favorites"] = "favorites";
|
|
5416
6167
|
return QueryKeys;
|
|
5417
6168
|
}({});
|
|
5418
6169
|
const DynamicQueryKeys = { agentFiles: (agentId) => ["agentFiles", agentId] };
|
|
5419
6170
|
let MutationKeys = /* @__PURE__ */ function(MutationKeys) {
|
|
6171
|
+
MutationKeys["updateLangfuseConnection"] = "updateLangfuseConnection";
|
|
6172
|
+
MutationKeys["testLangfuseConnection"] = "testLangfuseConnection";
|
|
5420
6173
|
MutationKeys["createAgentApiKey"] = "createAgentApiKey";
|
|
5421
6174
|
MutationKeys["deleteAgentApiKey"] = "deleteAgentApiKey";
|
|
5422
6175
|
MutationKeys["fileUpload"] = "fileUpload";
|
|
5423
6176
|
MutationKeys["fileDelete"] = "fileDelete";
|
|
6177
|
+
MutationKeys["fileUsage"] = "fileUsage";
|
|
5424
6178
|
MutationKeys["updatePreset"] = "updatePreset";
|
|
5425
6179
|
MutationKeys["deletePreset"] = "deletePreset";
|
|
5426
6180
|
MutationKeys["loginUser"] = "loginUser";
|
|
@@ -5509,6 +6263,7 @@ const TOKEN_REFRESH_BUFFER_MS = 120 * 1e3;
|
|
|
5509
6263
|
const refreshToken = (retry) => _post(refreshToken$1(retry));
|
|
5510
6264
|
const SHARE_PAGE_PATH_REGEX = /^\/share\/[^/]+\/?$/;
|
|
5511
6265
|
const SHARED_MESSAGES_PATH_REGEX = /^\/api\/share\/[^/]+$/;
|
|
6266
|
+
const SHARE_FORK_PATH_REGEX = /^\/api\/share\/[^/]+\/fork$/;
|
|
5512
6267
|
const normalizePathname = (pathname) => pathname.startsWith("/") ? pathname : `/${pathname}`;
|
|
5513
6268
|
const stripBasePath = (pathname) => {
|
|
5514
6269
|
const normalizedPathname = normalizePathname(pathname);
|
|
@@ -5528,6 +6283,11 @@ const getRequestPathname = (url) => {
|
|
|
5528
6283
|
}
|
|
5529
6284
|
};
|
|
5530
6285
|
const isSharedMessagesRequest = (url, method) => method?.toLowerCase() === "get" && SHARED_MESSAGES_PATH_REGEX.test(stripBasePath(getRequestPathname(url)));
|
|
6286
|
+
/** The "continue this chat" fork is a deliberate authenticated action initiated
|
|
6287
|
+
* from a share page, so it must reach auth recovery/redirect like the shared
|
|
6288
|
+
* data request — otherwise a logged-out (or cold-loaded) viewer's 401 is
|
|
6289
|
+
* rejected silently instead of routing them through login. */
|
|
6290
|
+
const isShareForkRequest = (url, method) => method?.toLowerCase() === "post" && SHARE_FORK_PATH_REGEX.test(stripBasePath(getRequestPathname(url)));
|
|
5531
6291
|
const dispatchTokenUpdatedEvent = (token) => {
|
|
5532
6292
|
setTokenHeader(token);
|
|
5533
6293
|
clearAuthRedirectStartedAt();
|
|
@@ -5626,16 +6386,42 @@ const shouldRefreshBeforeRequest = (url) => {
|
|
|
5626
6386
|
const timeUntilExpiry = expiresAt - Date.now();
|
|
5627
6387
|
return timeUntilExpiry > 0 && timeUntilExpiry <= TOKEN_REFRESH_BUFFER_MS;
|
|
5628
6388
|
};
|
|
6389
|
+
const refreshBeforeRequest = async (url) => {
|
|
6390
|
+
const state = getAuthRecoveryState();
|
|
6391
|
+
if (state.refreshPromise && !isAuthRecoveryEndpoint(url)) return state.refreshPromise.catch(() => null);
|
|
6392
|
+
if (!shouldRefreshBeforeRequest(url)) return null;
|
|
6393
|
+
return startAuthRecovery(false).catch(() => null);
|
|
6394
|
+
};
|
|
6395
|
+
const withAuthorization = (options, token) => {
|
|
6396
|
+
const headers = new Headers(options?.headers);
|
|
6397
|
+
if (token) headers.set("Authorization", `Bearer ${token}`);
|
|
6398
|
+
return {
|
|
6399
|
+
...options,
|
|
6400
|
+
headers
|
|
6401
|
+
};
|
|
6402
|
+
};
|
|
6403
|
+
async function _authenticatedFetch(url, options) {
|
|
6404
|
+
if (typeof window === "undefined") return fetch(url, options);
|
|
6405
|
+
const token = await refreshBeforeRequest(url) ?? getBearerToken();
|
|
6406
|
+
const response = await fetch(url, withAuthorization(options, token));
|
|
6407
|
+
if (response.status !== 401 || isAuthRecoveryEndpoint(url) || isAuthRedirectInProgress() || !getBearerToken()) return response;
|
|
6408
|
+
let refreshedToken;
|
|
6409
|
+
try {
|
|
6410
|
+
refreshedToken = await startAuthRecovery(false);
|
|
6411
|
+
} catch {
|
|
6412
|
+
redirectToLoginOnce();
|
|
6413
|
+
return response;
|
|
6414
|
+
}
|
|
6415
|
+
if (!refreshedToken) {
|
|
6416
|
+
redirectToLoginOnce();
|
|
6417
|
+
return response;
|
|
6418
|
+
}
|
|
6419
|
+
await response.body?.cancel().catch(() => void 0);
|
|
6420
|
+
return fetch(url, withAuthorization(options, refreshedToken));
|
|
6421
|
+
}
|
|
5629
6422
|
if (typeof window !== "undefined") {
|
|
5630
6423
|
axios.interceptors.request.use(async (config) => {
|
|
5631
|
-
const
|
|
5632
|
-
if (state.refreshPromise && !isAuthRecoveryEndpoint(config.url)) {
|
|
5633
|
-
const token = await state.refreshPromise.catch(() => null);
|
|
5634
|
-
if (token) setRequestAuthorizationHeader(config, token);
|
|
5635
|
-
return config;
|
|
5636
|
-
}
|
|
5637
|
-
if (!shouldRefreshBeforeRequest(config.url)) return config;
|
|
5638
|
-
const token = await startAuthRecovery(false).catch(() => null);
|
|
6424
|
+
const token = await refreshBeforeRequest(config.url);
|
|
5639
6425
|
if (token) setRequestAuthorizationHeader(config, token);
|
|
5640
6426
|
return config;
|
|
5641
6427
|
});
|
|
@@ -5649,7 +6435,7 @@ if (typeof window !== "undefined") {
|
|
|
5649
6435
|
/** Skip refresh when the Authorization header has been cleared (e.g. during logout),
|
|
5650
6436
|
* but allow the shared link data request to proceed so private shares can still
|
|
5651
6437
|
* recover auth/redirect without unrelated share-page queries forcing login. */
|
|
5652
|
-
if (!axios.defaults.headers.common["Authorization"] && !(isSharePage() && isSharedMessagesRequest(originalRequest.url, originalRequest.method))) return Promise.reject(error);
|
|
6438
|
+
if (!axios.defaults.headers.common["Authorization"] && !(isSharePage() && (isSharedMessagesRequest(originalRequest.url, originalRequest.method) || isShareForkRequest(originalRequest.url, originalRequest.method)))) return Promise.reject(error);
|
|
5653
6439
|
if (isAuthRedirectInProgress()) return Promise.reject(error);
|
|
5654
6440
|
if (error.response.status === 401 && !originalRequest._retry) {
|
|
5655
6441
|
if (!(getAuthRecoveryState().refreshPromise != null)) console.warn("401 error, refreshing token");
|
|
@@ -5662,8 +6448,12 @@ if (typeof window !== "undefined") {
|
|
|
5662
6448
|
}
|
|
5663
6449
|
redirectToLoginOnce();
|
|
5664
6450
|
return Promise.reject(error);
|
|
5665
|
-
} catch
|
|
5666
|
-
|
|
6451
|
+
} catch {
|
|
6452
|
+
/** A rejected refresh (stale/invalid session → 401/403) must route to
|
|
6453
|
+
* login just like an empty-token refresh, otherwise the original 401
|
|
6454
|
+
* surfaces to the caller (e.g. the share fork button) with no redirect. */
|
|
6455
|
+
redirectToLoginOnce();
|
|
6456
|
+
return Promise.reject(error);
|
|
5667
6457
|
}
|
|
5668
6458
|
}
|
|
5669
6459
|
return Promise.reject(error);
|
|
@@ -5679,15 +6469,142 @@ var request_default = {
|
|
|
5679
6469
|
delete: _delete,
|
|
5680
6470
|
deleteWithOptions: _deleteWithOptions,
|
|
5681
6471
|
patch: _patch,
|
|
6472
|
+
authenticatedFetch: _authenticatedFetch,
|
|
5682
6473
|
refreshToken,
|
|
5683
6474
|
dispatchTokenUpdatedEvent
|
|
5684
6475
|
};
|
|
5685
6476
|
//#endregion
|
|
6477
|
+
//#region src/upload.ts
|
|
6478
|
+
const EVENT_STREAM_MEDIA_TYPE = "text/event-stream";
|
|
6479
|
+
const HEARTBEAT_TIMEOUT_MS = 15e3;
|
|
6480
|
+
var FileUploadError = class extends Error {
|
|
6481
|
+
constructor(message, fileId, toolResource, displayToUser = false, code = 0) {
|
|
6482
|
+
super(message);
|
|
6483
|
+
this.name = "CustomAppError";
|
|
6484
|
+
this.code = code;
|
|
6485
|
+
this.file_id = fileId;
|
|
6486
|
+
this.tool_resource = toolResource;
|
|
6487
|
+
this.display_to_user = displayToUser;
|
|
6488
|
+
this.response = { data: { message: displayToUser ? message : "" } };
|
|
6489
|
+
}
|
|
6490
|
+
};
|
|
6491
|
+
var UploadCanceledError = class extends Error {
|
|
6492
|
+
constructor(..._args) {
|
|
6493
|
+
super(..._args);
|
|
6494
|
+
this.code = "ERR_CANCELED";
|
|
6495
|
+
}
|
|
6496
|
+
};
|
|
6497
|
+
const getFileId = (formData) => String(formData.get("file_id") ?? "");
|
|
6498
|
+
const getToolResource = (formData) => formData.get("tool_resource") ?? void 0;
|
|
6499
|
+
const parseEvent = (message) => {
|
|
6500
|
+
let type = "message";
|
|
6501
|
+
const data = [];
|
|
6502
|
+
for (const line of message.split(/\r?\n/)) {
|
|
6503
|
+
if (line.startsWith("event:")) {
|
|
6504
|
+
type = line.slice(6).trim();
|
|
6505
|
+
continue;
|
|
6506
|
+
}
|
|
6507
|
+
if (line.startsWith("data:")) data.push(line.slice(5).trimStart());
|
|
6508
|
+
}
|
|
6509
|
+
return {
|
|
6510
|
+
type,
|
|
6511
|
+
data: data.join("\n")
|
|
6512
|
+
};
|
|
6513
|
+
};
|
|
6514
|
+
const createHttpError = async (response, formData) => {
|
|
6515
|
+
let message = `Server responded with status: ${response.status}`;
|
|
6516
|
+
try {
|
|
6517
|
+
message = (await response.json()).message || message;
|
|
6518
|
+
} catch {}
|
|
6519
|
+
return new FileUploadError(message, getFileId(formData), getToolResource(formData), true, response.status);
|
|
6520
|
+
};
|
|
6521
|
+
const createStreamError = (data, formData) => {
|
|
6522
|
+
let error;
|
|
6523
|
+
try {
|
|
6524
|
+
error = JSON.parse(data);
|
|
6525
|
+
} catch {
|
|
6526
|
+
error = { message: data };
|
|
6527
|
+
}
|
|
6528
|
+
return new FileUploadError(error.message || "File upload failed.", error.temp_file_id || getFileId(formData), error.tool_resource || getToolResource(formData), error.display_to_user ?? false, error.code ?? 0);
|
|
6529
|
+
};
|
|
6530
|
+
const readEventStream = async (stream, formData) => {
|
|
6531
|
+
const reader = stream.getReader();
|
|
6532
|
+
const decoder = new TextDecoder();
|
|
6533
|
+
let buffer = "";
|
|
6534
|
+
let result = null;
|
|
6535
|
+
let streamEnded = false;
|
|
6536
|
+
let timeoutError = null;
|
|
6537
|
+
let heartbeatTimer;
|
|
6538
|
+
const resetHeartbeatTimer = () => {
|
|
6539
|
+
clearTimeout(heartbeatTimer);
|
|
6540
|
+
heartbeatTimer = setTimeout(() => {
|
|
6541
|
+
timeoutError = /* @__PURE__ */ new Error("Upload connection timed out waiting for a heartbeat.");
|
|
6542
|
+
reader.cancel(timeoutError);
|
|
6543
|
+
}, HEARTBEAT_TIMEOUT_MS);
|
|
6544
|
+
};
|
|
6545
|
+
resetHeartbeatTimer();
|
|
6546
|
+
try {
|
|
6547
|
+
while (true) {
|
|
6548
|
+
const { value, done } = await reader.read();
|
|
6549
|
+
if (done) {
|
|
6550
|
+
streamEnded = true;
|
|
6551
|
+
if (timeoutError) throw timeoutError;
|
|
6552
|
+
if (result) return result;
|
|
6553
|
+
throw new Error("Upload connection closed before completion.");
|
|
6554
|
+
}
|
|
6555
|
+
buffer += decoder.decode(value, { stream: true });
|
|
6556
|
+
const messages = buffer.split(/\r?\n\r?\n/);
|
|
6557
|
+
buffer = messages.pop() ?? "";
|
|
6558
|
+
for (const message of messages) {
|
|
6559
|
+
const event = parseEvent(message);
|
|
6560
|
+
if (event.type === "heartbeat") {
|
|
6561
|
+
resetHeartbeatTimer();
|
|
6562
|
+
continue;
|
|
6563
|
+
}
|
|
6564
|
+
if (event.type === "error") throw createStreamError(event.data, formData);
|
|
6565
|
+
if (event.type === "data") {
|
|
6566
|
+
result = JSON.parse(event.data);
|
|
6567
|
+
continue;
|
|
6568
|
+
}
|
|
6569
|
+
if (event.type === "close") {
|
|
6570
|
+
if (result) return result;
|
|
6571
|
+
throw new Error("Upload stream closed without a result.");
|
|
6572
|
+
}
|
|
6573
|
+
}
|
|
6574
|
+
}
|
|
6575
|
+
} catch (error) {
|
|
6576
|
+
if (error instanceof Error && error.name === "AbortError") throw new UploadCanceledError("Upload canceled.");
|
|
6577
|
+
throw error;
|
|
6578
|
+
} finally {
|
|
6579
|
+
clearTimeout(heartbeatTimer);
|
|
6580
|
+
if (!streamEnded) await reader.cancel().catch(() => void 0);
|
|
6581
|
+
reader.releaseLock();
|
|
6582
|
+
}
|
|
6583
|
+
};
|
|
6584
|
+
async function uploadEventStream(url, formData, signal) {
|
|
6585
|
+
try {
|
|
6586
|
+
const response = await request_default.authenticatedFetch(url, {
|
|
6587
|
+
method: "POST",
|
|
6588
|
+
body: formData,
|
|
6589
|
+
headers: { Accept: EVENT_STREAM_MEDIA_TYPE },
|
|
6590
|
+
signal: signal ?? void 0
|
|
6591
|
+
});
|
|
6592
|
+
if (!response.ok) throw await createHttpError(response, formData);
|
|
6593
|
+
if (!(response.headers.get("Content-Type")?.toLowerCase() ?? "").includes(EVENT_STREAM_MEDIA_TYPE)) return await response.json();
|
|
6594
|
+
if (!response.body) throw new Error("No upload response body received.");
|
|
6595
|
+
return await readEventStream(response.body, formData);
|
|
6596
|
+
} catch (error) {
|
|
6597
|
+
if (signal?.aborted || error instanceof Error && error.name === "AbortError") throw new UploadCanceledError("Upload canceled.");
|
|
6598
|
+
throw error;
|
|
6599
|
+
}
|
|
6600
|
+
}
|
|
6601
|
+
//#endregion
|
|
5686
6602
|
//#region src/data-service.ts
|
|
5687
6603
|
var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
5688
6604
|
acceptTerms: () => acceptTerms,
|
|
5689
6605
|
addPromptToGroup: () => addPromptToGroup,
|
|
5690
6606
|
addTagToConversation: () => addTagToConversation,
|
|
6607
|
+
addToolFavorite: () => addToolFavorite,
|
|
5691
6608
|
archiveConversation: () => archiveConversation,
|
|
5692
6609
|
assignConversationToProject: () => assignConversationToProject,
|
|
5693
6610
|
bindActionOAuth: () => bindActionOAuth,
|
|
@@ -5735,6 +6652,7 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5735
6652
|
editArtifact: () => editArtifact,
|
|
5736
6653
|
enableTwoFactor: () => enableTwoFactor,
|
|
5737
6654
|
forkConversation: () => forkConversation,
|
|
6655
|
+
forkSharedConversation: () => forkSharedConversation,
|
|
5738
6656
|
genTitle: () => genTitle,
|
|
5739
6657
|
getAIEndpoints: () => getAIEndpoints,
|
|
5740
6658
|
getAccessRoles: () => getAccessRoles,
|
|
@@ -5744,6 +6662,7 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5744
6662
|
getAgentById: () => getAgentById,
|
|
5745
6663
|
getAgentCategories: () => getAgentCategories,
|
|
5746
6664
|
getAgentFiles: () => getAgentFiles,
|
|
6665
|
+
getAgentVersions: () => getAgentVersions,
|
|
5747
6666
|
getAllEffectivePermissions: () => getAllEffectivePermissions,
|
|
5748
6667
|
getAllPromptGroups: () => getAllPromptGroups,
|
|
5749
6668
|
getAssistantById: () => getAssistantById,
|
|
@@ -5754,7 +6673,6 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5754
6673
|
getBanner: () => getBanner,
|
|
5755
6674
|
getCategories: () => getCategories,
|
|
5756
6675
|
getCodeOutputDownload: () => getCodeOutputDownload,
|
|
5757
|
-
getContextProjection: () => getContextProjection,
|
|
5758
6676
|
getConversationById: () => getConversationById,
|
|
5759
6677
|
getConversationTags: () => getConversationTags,
|
|
5760
6678
|
getConversations: () => getConversations,
|
|
@@ -5770,9 +6688,12 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5770
6688
|
getFiles: () => getFiles,
|
|
5771
6689
|
getGitHubSkillSyncStatus: () => getGitHubSkillSyncStatus,
|
|
5772
6690
|
getGraphApiToken: () => getGraphApiToken,
|
|
6691
|
+
getLangfuseConnection: () => getLangfuseConnection,
|
|
6692
|
+
getLangfuseSessionLink: () => getLangfuseSessionLink,
|
|
5773
6693
|
getLoginGoogle: () => getLoginGoogle,
|
|
5774
6694
|
getMCPAuthValues: () => getMCPAuthValues,
|
|
5775
6695
|
getMCPConnectionStatus: () => getMCPConnectionStatus,
|
|
6696
|
+
getMCPOAuthStatus: () => getMCPOAuthStatus,
|
|
5776
6697
|
getMCPServer: () => getMCPServer,
|
|
5777
6698
|
getMCPServerConnectionStatus: () => getMCPServerConnectionStatus,
|
|
5778
6699
|
getMCPServers: () => getMCPServers,
|
|
@@ -5797,7 +6718,6 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5797
6718
|
getSharedMessages: () => getSharedMessages,
|
|
5798
6719
|
getSharedStartupConfig: () => getSharedStartupConfig,
|
|
5799
6720
|
getSkill: () => getSkill,
|
|
5800
|
-
getSkillFavorites: () => getSkillFavorites,
|
|
5801
6721
|
getSkillFileContent: () => getSkillFileContent,
|
|
5802
6722
|
getSkillNodeContent: () => getSkillNodeContent,
|
|
5803
6723
|
getSkillStates: () => getSkillStates,
|
|
@@ -5805,6 +6725,7 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5805
6725
|
getStartupConfig: () => getStartupConfig,
|
|
5806
6726
|
getTokenConfig: () => getTokenConfig,
|
|
5807
6727
|
getToolCalls: () => getToolCalls,
|
|
6728
|
+
getToolFavorites: () => getToolFavorites,
|
|
5808
6729
|
getUser: () => getUser,
|
|
5809
6730
|
getUserBalance: () => getUserBalance,
|
|
5810
6731
|
getUserTerms: () => getUserTerms,
|
|
@@ -5825,12 +6746,14 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5825
6746
|
login: () => login,
|
|
5826
6747
|
logout: () => logout,
|
|
5827
6748
|
makePromptProduction: () => makePromptProduction,
|
|
6749
|
+
markFilesUsage: () => markFilesUsage,
|
|
5828
6750
|
pinConversation: () => pinConversation,
|
|
5829
6751
|
rebuildConversationTags: () => rebuildConversationTags,
|
|
5830
6752
|
recordPromptGroupUsage: () => recordPromptGroupUsage,
|
|
5831
6753
|
regenerateBackupCodes: () => regenerateBackupCodes,
|
|
5832
6754
|
register: () => register,
|
|
5833
6755
|
reinitializeMCPServer: () => reinitializeMCPServer,
|
|
6756
|
+
removeToolFavorite: () => removeToolFavorite,
|
|
5834
6757
|
requestPasswordReset: () => requestPasswordReset,
|
|
5835
6758
|
resendVerificationEmail: () => resendVerificationEmail,
|
|
5836
6759
|
resetPassword: () => resetPassword,
|
|
@@ -5841,6 +6764,7 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5841
6764
|
searchPrincipals: () => searchPrincipals,
|
|
5842
6765
|
setGitHubSkillSyncCredential: () => setGitHubSkillSyncCredential,
|
|
5843
6766
|
speechToText: () => speechToText,
|
|
6767
|
+
testLangfuseConnection: () => testLangfuseConnection,
|
|
5844
6768
|
textToSpeech: () => textToSpeech,
|
|
5845
6769
|
updateAction: () => updateAction,
|
|
5846
6770
|
updateAgent: () => updateAgent,
|
|
@@ -5851,6 +6775,7 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5851
6775
|
updateConversationTag: () => updateConversationTag,
|
|
5852
6776
|
updateFavorites: () => updateFavorites,
|
|
5853
6777
|
updateFeedback: () => updateFeedback,
|
|
6778
|
+
updateLangfuseConnection: () => updateLangfuseConnection,
|
|
5854
6779
|
updateMCPServer: () => updateMCPServer,
|
|
5855
6780
|
updateMCPServersPermissions: () => updateMCPServersPermissions,
|
|
5856
6781
|
updateMarketplacePermissions: () => updateMarketplacePermissions,
|
|
@@ -5869,7 +6794,6 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5869
6794
|
updateResourcePermissions: () => updateResourcePermissions,
|
|
5870
6795
|
updateSharedLink: () => updateSharedLink,
|
|
5871
6796
|
updateSkill: () => updateSkill,
|
|
5872
|
-
updateSkillFavorites: () => updateSkillFavorites,
|
|
5873
6797
|
updateSkillNode: () => updateSkillNode,
|
|
5874
6798
|
updateSkillNodeContent: () => updateSkillNodeContent,
|
|
5875
6799
|
updateSkillPermissions: () => updateSkillPermissions,
|
|
@@ -5888,6 +6812,18 @@ var data_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
5888
6812
|
verifyTwoFactor: () => verifyTwoFactor,
|
|
5889
6813
|
verifyTwoFactorTemp: () => verifyTwoFactorTemp
|
|
5890
6814
|
});
|
|
6815
|
+
function getLangfuseConnection() {
|
|
6816
|
+
return request_default.get(adminLangfuseConnection());
|
|
6817
|
+
}
|
|
6818
|
+
function updateLangfuseConnection(payload) {
|
|
6819
|
+
return request_default.put(adminLangfuseConnection(), payload);
|
|
6820
|
+
}
|
|
6821
|
+
function testLangfuseConnection(payload) {
|
|
6822
|
+
return request_default.post(adminLangfuseConnectionTest(), payload);
|
|
6823
|
+
}
|
|
6824
|
+
function getLangfuseSessionLink(conversationId) {
|
|
6825
|
+
return request_default.get(adminLangfuseSessionLink(conversationId));
|
|
6826
|
+
}
|
|
5891
6827
|
function revokeUserKey(name) {
|
|
5892
6828
|
return request_default.delete(revokeUserKey$1(name));
|
|
5893
6829
|
}
|
|
@@ -5903,16 +6839,15 @@ function getFavorites() {
|
|
|
5903
6839
|
function updateFavorites(favorites) {
|
|
5904
6840
|
return request_default.post(`${apiBaseUrl()}/api/user/settings/favorites`, { favorites });
|
|
5905
6841
|
}
|
|
5906
|
-
/**
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
* an empty list so the UI hooks compile and the Star button is a no-op.
|
|
5910
|
-
*/
|
|
5911
|
-
function getSkillFavorites() {
|
|
5912
|
-
return Promise.resolve([]);
|
|
6842
|
+
/** Tool favorites — starred marketplace items (builtins, tools, MCP servers, skills). */
|
|
6843
|
+
function getToolFavorites() {
|
|
6844
|
+
return request_default.get(toolFavorites());
|
|
5913
6845
|
}
|
|
5914
|
-
function
|
|
5915
|
-
return
|
|
6846
|
+
function addToolFavorite(favorite) {
|
|
6847
|
+
return request_default.put(toolFavorite(favorite.itemType, favorite.itemId));
|
|
6848
|
+
}
|
|
6849
|
+
function removeToolFavorite(favorite) {
|
|
6850
|
+
return request_default.delete(toolFavorite(favorite.itemType, favorite.itemId));
|
|
5916
6851
|
}
|
|
5917
6852
|
/** Per-user skill active/inactive overrides. */
|
|
5918
6853
|
function getSkillStates() {
|
|
@@ -6039,6 +6974,9 @@ const getMCPAuthValues = (serverName) => {
|
|
|
6039
6974
|
function cancelMCPOAuth(serverName) {
|
|
6040
6975
|
return request_default.post(cancelMCPOAuth$1(serverName), {});
|
|
6041
6976
|
}
|
|
6977
|
+
function getMCPOAuthStatus(flowId) {
|
|
6978
|
+
return request_default.get(mcpOAuthStatus(flowId));
|
|
6979
|
+
}
|
|
6042
6980
|
const getStartupConfig = (options) => {
|
|
6043
6981
|
return request_default.get(config(options?.context));
|
|
6044
6982
|
};
|
|
@@ -6048,9 +6986,6 @@ const getAIEndpoints = () => {
|
|
|
6048
6986
|
const getTokenConfig = () => {
|
|
6049
6987
|
return request_default.get(tokenConfig());
|
|
6050
6988
|
};
|
|
6051
|
-
const getContextProjection = (payload) => {
|
|
6052
|
-
return request_default.post(contextProjection(), payload);
|
|
6053
|
-
};
|
|
6054
6989
|
const getModels = async () => {
|
|
6055
6990
|
return request_default.get(models());
|
|
6056
6991
|
};
|
|
@@ -6150,14 +7085,24 @@ const getAgentFiles = (agentId) => {
|
|
|
6150
7085
|
const getFileConfig = () => {
|
|
6151
7086
|
return request_default.get(`${files()}/config`);
|
|
6152
7087
|
};
|
|
6153
|
-
const uploadImage = (data, signal) => {
|
|
7088
|
+
const uploadImage = (data, signal, sseEnabled = false) => {
|
|
6154
7089
|
const requestConfig = signal ? { signal } : void 0;
|
|
7090
|
+
if (sseEnabled) return uploadEventStream(images(), data, signal);
|
|
6155
7091
|
return request_default.postMultiPart(images(), data, requestConfig);
|
|
6156
7092
|
};
|
|
6157
|
-
const uploadFile = (data, signal) => {
|
|
7093
|
+
const uploadFile = (data, signal, sseEnabled = false) => {
|
|
6158
7094
|
const requestConfig = signal ? { signal } : void 0;
|
|
7095
|
+
if (sseEnabled) return uploadEventStream(files(), data, signal);
|
|
6159
7096
|
return request_default.postMultiPart(files(), data, requestConfig);
|
|
6160
7097
|
};
|
|
7098
|
+
/**
|
|
7099
|
+
* Marks uploaded files as used (owner-scoped TTL touch) so the upload-window
|
|
7100
|
+
* TTL cannot reap attachments held in a client-side queue during a long run.
|
|
7101
|
+
* Best-effort: callers fire-and-forget — send-time marking is the backstop.
|
|
7102
|
+
*/
|
|
7103
|
+
const markFilesUsage = (body) => {
|
|
7104
|
+
return request_default.post(fileUsage(), body);
|
|
7105
|
+
};
|
|
6161
7106
|
const updateAction = (data) => {
|
|
6162
7107
|
const { assistant_id, version, ...body } = data;
|
|
6163
7108
|
return request_default.post(assistants({
|
|
@@ -6185,6 +7130,9 @@ const getAgentById = ({ agent_id }) => {
|
|
|
6185
7130
|
const getExpandedAgentById = ({ agent_id }) => {
|
|
6186
7131
|
return request_default.get(agents({ path: `${agent_id}/expanded` }));
|
|
6187
7132
|
};
|
|
7133
|
+
const getAgentVersions = ({ agent_id }) => {
|
|
7134
|
+
return request_default.get(agents({ path: `${agent_id}/versions` }));
|
|
7135
|
+
};
|
|
6188
7136
|
const updateAgent = ({ agent_id, data }) => {
|
|
6189
7137
|
return request_default.patch(agents({ path: agent_id }), data);
|
|
6190
7138
|
};
|
|
@@ -6319,6 +7267,12 @@ function duplicateConversation(payload) {
|
|
|
6319
7267
|
function forkConversation(payload) {
|
|
6320
7268
|
return request_default.post(forkConversation$1(), payload);
|
|
6321
7269
|
}
|
|
7270
|
+
function forkSharedConversation(shareId, targetMessageIndex, shareRevision) {
|
|
7271
|
+
return request_default.post(forkSharedMessages(shareId), {
|
|
7272
|
+
targetMessageIndex,
|
|
7273
|
+
shareRevision
|
|
7274
|
+
});
|
|
7275
|
+
}
|
|
6322
7276
|
function deleteConversation(payload) {
|
|
6323
7277
|
return request_default.deleteWithOptions(deleteConversation$1(), { data: { arg: payload } });
|
|
6324
7278
|
}
|
|
@@ -6633,11 +7587,11 @@ function verifyTwoFactorTemp(payload) {
|
|
|
6633
7587
|
const getMemories = () => {
|
|
6634
7588
|
return request_default.get(memories());
|
|
6635
7589
|
};
|
|
6636
|
-
const deleteMemory = (key) => {
|
|
6637
|
-
return request_default.delete(memory(key));
|
|
7590
|
+
const deleteMemory = (key, agentId) => {
|
|
7591
|
+
return request_default.delete(memory(key, agentId));
|
|
6638
7592
|
};
|
|
6639
|
-
const updateMemory = (key, value, originalKey) => {
|
|
6640
|
-
return request_default.patch(memory(originalKey || key), {
|
|
7593
|
+
const updateMemory = (key, value, originalKey, agentId) => {
|
|
7594
|
+
return request_default.patch(memory(originalKey || key, agentId), {
|
|
6641
7595
|
key,
|
|
6642
7596
|
value
|
|
6643
7597
|
});
|
|
@@ -6676,6 +7630,6 @@ const getActiveJobs = () => {
|
|
|
6676
7630
|
return request_default.get(activeJobs());
|
|
6677
7631
|
};
|
|
6678
7632
|
//#endregion
|
|
6679
|
-
export { permissionEntrySchema as $,
|
|
7633
|
+
export { permissionEntrySchema as $, tMessageSchema as $a, anthropicSettings as $i, supportsBalanceCheck as $n, imageTypeMapping as $r, azureGroupConfigsSchema as $t, updateResourcePermissions as A, googleSettings as Aa, AuthType as Ai, isRemoteOidcUrlAllowed as An, extractEnvVariable as Ao, applicationMimeTypes as Ar, SKILL_SYNC_DEFAULT_DISCOVERY_DEPTH as At, MutationKeys as B, isParamEndpoint as Ba, ReasoningEffort as Bi, paramDefinitionSchema as Bn, defaultSTTMimeTypes as Br, SettingsViews as Bt, resetPassword as C, endpointSettings as Ca, OptionTypes as Ci, getConfigDefaults as Cn, feedbackRatingSchema as Co, FileSources as Cr, MAX_SUBAGENT_DEPTH as Ct, updateFeedback as D, googleBaseSchema as Da, generateOpenAISchema as Di, imageGenTools as Dn, getTagsForRating as Do, loginPage as Dr, RateLimitPrefix as Dt, searchPrincipals as E, getSettingsKeys as Ea, generateGoogleSchema as Ei, getSchemaDefaults as En, getTagByKey as Eo, buildLoginRedirectUrl as Er, OCRStrategy as Et, request_default as F, isAssistantsEndpoint as Fa, ImageVisionTool as Fi, modelConfigSchema as Fn, codeInterpreterMimeTypes as Fr, SafeSearchTypes as Ft, PrincipalType as G, openRouterSchema as Ga, ThinkingDisplay as Gi, setMessageFilterRegexValidator as Gn, excelMimeTypes as Gr, VisionModes as Gt, AccessRoleIds as H, openAIBaseSchema as Ha, ReasoningParameterFormat as Hi, rateLimitSchema as Hn, documentParserMimeTypes as Hr, TTSProviders as Ht, getTokenHeader as I, isDocumentSupportedProvider as Ia, MYTHOS_CLASS_FAMILIES as Ii, modularEndpoints as In, codeInterpreterMimeTypesList as Ir, ScraperProviders as It, accessRoleToPermBits as J, tBannerSchema as Ja, agentsBaseSchema as Ji, specialVariables as Jn, fullMimeTypesList as Jr, alternateName as Jt, ResourceType as K, paramEndpoints as Ka, ThinkingLevel as Ki, skillSyncConfigSchema as Kn, fileConfig as Kr, agentsEndpointSchema as Kt, setAcceptLanguageHeader as L, isImageVisionTool as La, MemoryScope as Li, normalizeMCPToolKey as Ln, codeTypeMapping as Lr, SearchCategories as Lt, updateUserKey as M, imageDetailValue as Ma, BedrockReasoningConfig as Mi, memorySchema as Mn, isSensitiveEnvVar as Mo, bedrockDocumentExtensions as Mr, SKILL_SYNC_MAX_INTERVAL_MINUTES as Mt, updateUserPlugins as N, inputTokensIncludesCache as Na, EModelEndpoint as Ni, messageFilterPiiSchema as Nn, normalizeEndpointName as No, bedrockDocumentFormats as Nr, SKILL_SYNC_MIN_INTERVAL_MINUTES as Nt, updateMessage as O, googleGenConfigSchema as Oa, validateSettingDefinitions as Oi, initialModelsConfig as On, toMinimalFeedback as Oo, registerPage as Or, RerankerTypes as Ot, userKeyQuery as P, isAgentsEndpoint as Pa, ImageDetail as Pi, messageFilterSchema as Pn, bedrockDocumentMimeTypes as Pr, STTProviders as Pt, permBitsToAccessLevel as Q, tExampleSchema as Qa, anthropicSchema as Qi, summarizationTriggerSchema as Qn, imageMimeTypes as Qr, azureEndpointSchema as Qt, setTokenHeader as R, isMythosClassModel as Ra, Providers as Ri, normalizeServerName as Rn, convertStringsToRegex as Rr, SearchProviders as Rt, requestPasswordReset as S, eVerbositySchema as Sa, ComponentTypes as Si, fileStrategiesSchema as Sn, FEEDBACK_TAGS as So, FileContext as Sr, LocalStorageKeys as St, revokeUserKey as T, getModelKey as Ta, generateDynamicSchema as Ti, getEndpointField as Tn, feedbackTagKeySchema as To, apiBaseUrl as Tr, MAX_SUBAGENT_RUN_CONFIGS as Tt, PermissionBits as U, openAISchema as Ua, ReasoningResponseKey as Ui, resolveEndpointType as Un, endpointFileConfigSchema as Ur, Time as Ut, QueryKeys as V, isUUID as Va, ReasoningMode as Vi, providerEndpointMap as Vn, defaultTextMimeTypes as Vr, SystemCategories as Vt, PrincipalModel as W, openAISettings as Wa, ReasoningSummary as Wi, retainRecentConfigSchema as Wn, excelFileTypes as Wr, ViolationTypes as Wt, getResourcePermissionsResponseSchema as X, tConversationTagSchema as Xa, agentsSettings as Xi, splitToolCallName as Xn, getEndpointFileConfig as Xr, assistantEndpointSchema as Xt, effectivePermissionsResponseSchema as Y, tConversationSchema as Ya, agentsSchema as Yi, splitMCPToolKey as Yn, getConfiguredMimeAccept as Yr, anthropicEndpointSchema as Yt, hasPermissions as Z, tConvoUpdateSchema as Za, anthropicBaseSchema as Zi, summarizationConfigSchema as Zn, imageExtRegex as Zr, azureBaseSchema as Zt, getResourcePermissions as _, eReasoningParameterFormatSchema as _a, getRefillEligibilityDate as _i, defaultSocialLogins as _n, hostImageIdSuffix as _o, StreamableHTTPOptionsSchema as _r, FetchTokenConfig as _t, data_service_exports as a, compactAgentsSchema as aa, mbToBytes as ai, bedrockModels as an, tSharedLinkSchema as ao, turnstileSchema as ar, AgentCapabilities as at, register as b, eThinkingDisplaySchema as ba, tModelSpecSchema as bi, fileSourceSchema as bn, FEEDBACK_RATINGS as bo, AuthorizationTypeEnum as br, InfiniteCollections as bt, getAccessRoles as c, defaultAgentFormValues as ca, mimeTypeAliases as ci, checkpointerTypeSchema as cn, EToolResources as co, vertexModelConfigSchema as cr, BASE_PRINCIPAL_CONFIG_SECTIONS as ct, getAvailablePlugins as d, eAnthropicEffortSchema as da, setFileConfigRegexCompiler as di, contextPruningSchema as dn, RunStatus as do, MCPOptionsSchema as dr, CohereConstants as dt, assistantSchema as ea, inferMimeType as ei, azureGroupSchema as en, tModelSpecPresetSchema as eo, toolApprovalHookConfigSchema as er, principalSchema as et, getConversationById as f, eImageDetailSchema as fa, supportedMimeTypes as fi, defaultAgentCapabilities as fn, StepStatus as fo, MCPServerUserInputSchema as fr, Constants as ft, getModels as g, eReasoningModeSchema as ga, REFILL_INTERVAL_UNITS as gi, defaultRetrievalModels as gn, defaultOrderQuery as go, StdioOptionsSchema as gr, ErrorTypes as gt, getMCPServerConnectionStatus as h, eReasoningEffortSchema as ha, videoMimeTypes as hi, defaultModels as hn, actionDomainSeparator as ho, SSEOptionsSchema as hr, EndpointURLs as ht, createPreset as i, compactAgentsBaseSchema as ia, isPermissiveMimeConfig as ii, bedrockGuardrailConfigSchema as in, tQueryParamsSchema as io, turnstileOptionsSchema as ir, AUTH_USER_DOC_BY_ID_PREFIX as it, updateTokenCount as j, imageDetailNumeric as ja, BedrockProviders as ji, langfuseConfigSchema as jn, extractVariableName as jo, audioMimeTypes as jr, SKILL_SYNC_MAX_DISCOVERY_DEPTH as jt, updateMessageContent as k, googleSchema as ka, AnthropicEffort as ki, interfaceSchema as kn, envVarRegex as ko, sharedFileDownload as kr, RetentionMode as kt, getAgentApiKeys as l, defaultAssistantFormValues as la, retrievalMimeTypes as li, cloudfrontConfigSchema as ln, FilePurpose as lo, visionModels as lr, CacheKeys as lt, getEffectivePermissions as m, eReasoningContextSchema as ma, textMimeTypes as mi, defaultEndpoints as mn, actionDelimiter as mo, MCP_USER_INPUT_FIELDS as mr, EImageOutputType as mt, clearAllConversations as n, cacheSubsetProviders as na, isAnthropicTextDocumentType as ni, baseEndpointSchema as nn, tPluginSchema as no, toolApprovalPolicySchema as nr, updateResourcePermissionsRequestSchema as nt, deleteAgentApiKey as o, compactAssistantSchema as oa, megabyte as oi, buildServerNameAliases as on, AnnotationTypes as oo, validateVisionModel as or, AuthKeys as ot, getCustomConfigSpeech as p, eModelEndpointSchema as pa, supportsFiles as pi, defaultAssistantsVersion as pn, Tools as po, MCPServersSchema as pr, DEFAULT_MEMORY_MAX_INPUT_TOKENS as pt, accessRoleSchema as q, removeNullishValues as qa, Verbosity as qi, skillSyncGitHubSourceSchema as qn, fileConfigSchema as qr, allowedAddressesSchema as qt, createAgentApiKey as r, coerceNumber as ra, isBedrockDocumentType as ri, bedrockEndpointSchema as rn, tPresetSchema as ro, transactionsSchema as rr, updateResourcePermissionsResponseSchema as rt, deletePreset as s, compactGoogleSchema as sa, mergeFileConfig as si, checkpointerSchema as sn, AssistantStreamEvents as so, vertexAISchema as sr, BASE_ONLY_CONFIG_SECTIONS as st, cancelMCPOAuth as t, authTypeSchema as ta, isAnthropicDocumentType as ti, balanceSchema as tn, tPluginAuthConfigSchema as to, toolApprovalModeSchema as tr, resourcePermissionsResponseSchema as tt, getAllEffectivePermissions as u, documentSupportedProviders as ua, retrievalMimeTypesList as ui, configSchema as un, MessageContentTypes as uo, webSearchSchema as ur, Capabilities as ut, getSharedLink as v, eReasoningResponseKeySchema as va, modelSpecSubagentsSchema as vi, endpointSchema as vn, hostImageNamePrefix as vo, WebSocketOptionsSchema as vr, ForkOptions as vt, revokeAllUserKeys as w, extendedModelEndpointSchema as wa, SettingTypes as wi, getDefaultParamsEndpoint as wn, feedbackSchema as wo, checkOpenAIStorage as wr, MAX_SUBAGENT_GRAPH_NODES as wt, reinitializeMCPServer as x, eThinkingLevelSchema as xa, MAX_SUBAGENTS as xi, fileStorageSchema as xn, FEEDBACK_REASON_KEYS as xo, TokenExchangeMethodEnum as xr, KnownEndpoints as xt, getSharedMessages as y, eReasoningSummarySchema as ya, specsConfigSchema as yi, excludedKeys as yn, isActionTool as yo, AuthTypeEnum as yr, ImageDetailCost as yt, DynamicQueryKeys as z, isOpenAILikeProvider as za, ReasoningContext as zi, ocrSchema as zn, defaultOCRMimeTypes as zr, SettingsTabValues as zt };
|
|
6680
7634
|
|
|
6681
|
-
//# sourceMappingURL=data-service-
|
|
7635
|
+
//# sourceMappingURL=data-service-pwrlWjJs.mjs.map
|