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
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as permissionEntrySchema, $a as
|
|
1
|
+
import { $ as permissionEntrySchema, $a as tMessageSchema, $i as anthropicSettings, $n as supportsBalanceCheck, $r as imageTypeMapping, $t as azureGroupConfigsSchema, Aa as googleSettings, Ai as AuthType, An as isRemoteOidcUrlAllowed, Ao as extractEnvVariable, Ar as applicationMimeTypes, At as SKILL_SYNC_DEFAULT_DISCOVERY_DEPTH, B as MutationKeys, Ba as isParamEndpoint, Bi as ReasoningEffort, Bn as paramDefinitionSchema, Br as defaultSTTMimeTypes, Bt as SettingsViews, Ca as endpointSettings, Ci as OptionTypes, Cn as getConfigDefaults, Co as feedbackRatingSchema, Cr as FileSources, Ct as MAX_SUBAGENT_DEPTH, Da as googleBaseSchema, Di as generateOpenAISchema, Dn as imageGenTools, Do as getTagsForRating, Dr as loginPage, Dt as RateLimitPrefix, Ea as getSettingsKeys, Ei as generateGoogleSchema, En as getSchemaDefaults, Eo as getTagByKey, Er as buildLoginRedirectUrl, Et as OCRStrategy, F as request_default, Fa as isAssistantsEndpoint, Fi as ImageVisionTool, Fn as modelConfigSchema, Fr as codeInterpreterMimeTypes, Ft as SafeSearchTypes, G as PrincipalType, Ga as openRouterSchema, Gi as ThinkingDisplay, Gn as setMessageFilterRegexValidator, Gr as excelMimeTypes, Gt as VisionModes, H as AccessRoleIds, Ha as openAIBaseSchema, Hi as ReasoningParameterFormat, Hn as rateLimitSchema, Hr as documentParserMimeTypes, Ht as TTSProviders, I as getTokenHeader, Ia as isDocumentSupportedProvider, Ii as MYTHOS_CLASS_FAMILIES, In as modularEndpoints, Ir as codeInterpreterMimeTypesList, It as ScraperProviders, J as accessRoleToPermBits, Ja as tBannerSchema, Ji as agentsBaseSchema, Jn as specialVariables, Jr as fullMimeTypesList, Jt as alternateName, K as ResourceType, Ka as paramEndpoints, Ki as ThinkingLevel, Kn as skillSyncConfigSchema, Kr as fileConfig, Kt as agentsEndpointSchema, L as setAcceptLanguageHeader, La as isImageVisionTool, Li as MemoryScope, Ln as normalizeMCPToolKey, Lr as codeTypeMapping, Lt as SearchCategories, Ma as imageDetailValue, Mi as BedrockReasoningConfig, Mn as memorySchema, Mo as isSensitiveEnvVar, Mr as bedrockDocumentExtensions, Mt as SKILL_SYNC_MAX_INTERVAL_MINUTES, Na as inputTokensIncludesCache, Ni as EModelEndpoint, Nn as messageFilterPiiSchema, No as normalizeEndpointName, Nr as bedrockDocumentFormats, Nt as SKILL_SYNC_MIN_INTERVAL_MINUTES, Oa as googleGenConfigSchema, Oi as validateSettingDefinitions, On as initialModelsConfig, Oo as toMinimalFeedback, Or as registerPage, Ot as RerankerTypes, Pa as isAgentsEndpoint, Pi as ImageDetail, Pn as messageFilterSchema, Pr as bedrockDocumentMimeTypes, Pt as STTProviders, Q as permBitsToAccessLevel, Qa as tExampleSchema, Qi as anthropicSchema, Qn as summarizationTriggerSchema, Qr as imageMimeTypes, Qt as azureEndpointSchema, R as setTokenHeader, Ra as isMythosClassModel, Ri as Providers, Rn as normalizeServerName, Rr as convertStringsToRegex, Rt as SearchProviders, Sa as eVerbositySchema, Si as ComponentTypes, Sn as fileStrategiesSchema, So as FEEDBACK_TAGS, Sr as FileContext, St as LocalStorageKeys, Ta as getModelKey, Ti as generateDynamicSchema, Tn as getEndpointField, To as feedbackTagKeySchema, Tr as apiBaseUrl, Tt as MAX_SUBAGENT_RUN_CONFIGS, U as PermissionBits, Ua as openAISchema, Ui as ReasoningResponseKey, Un as resolveEndpointType, Ur as endpointFileConfigSchema, Ut as Time, V as QueryKeys, Va as isUUID, Vi as ReasoningMode, Vn as providerEndpointMap, Vr as defaultTextMimeTypes, Vt as SystemCategories, W as PrincipalModel, Wa as openAISettings, Wi as ReasoningSummary, Wn as retainRecentConfigSchema, Wr as excelFileTypes, Wt as ViolationTypes, X as getResourcePermissionsResponseSchema, Xa as tConversationTagSchema, Xi as agentsSettings, Xn as splitToolCallName, Xr as getEndpointFileConfig, Xt as assistantEndpointSchema, Y as effectivePermissionsResponseSchema, Ya as tConversationSchema, Yi as agentsSchema, Yn as splitMCPToolKey, Yr as getConfiguredMimeAccept, Yt as anthropicEndpointSchema, Z as hasPermissions, Za as tConvoUpdateSchema, Zi as anthropicBaseSchema, Zn as summarizationConfigSchema, Zr as imageExtRegex, Zt as azureBaseSchema, _a as eReasoningParameterFormatSchema, _i as getRefillEligibilityDate, _n as defaultSocialLogins, _o as hostImageIdSuffix, _r as StreamableHTTPOptionsSchema, _t as FetchTokenConfig, a as data_service_exports, aa as compactAgentsSchema, ai as mbToBytes, an as bedrockModels, ao as tSharedLinkSchema, ar as turnstileSchema, at as AgentCapabilities, ba as eThinkingDisplaySchema, bi as tModelSpecSchema, bn as fileSourceSchema, bo as FEEDBACK_RATINGS, br as AuthorizationTypeEnum, bt as InfiniteCollections, ca as defaultAgentFormValues, ci as mimeTypeAliases, cn as checkpointerTypeSchema, co as EToolResources, cr as vertexModelConfigSchema, ct as BASE_PRINCIPAL_CONFIG_SECTIONS, da as eAnthropicEffortSchema, di as setFileConfigRegexCompiler, dn as contextPruningSchema, do as RunStatus, dr as MCPOptionsSchema, dt as CohereConstants, ea as assistantSchema, ei as inferMimeType, en as azureGroupSchema, eo as tModelSpecPresetSchema, er as toolApprovalHookConfigSchema, et as principalSchema, fa as eImageDetailSchema, fi as supportedMimeTypes, fn as defaultAgentCapabilities, fo as StepStatus, fr as MCPServerUserInputSchema, ft as Constants, ga as eReasoningModeSchema, gi as REFILL_INTERVAL_UNITS, gn as defaultRetrievalModels, go as defaultOrderQuery, gr as StdioOptionsSchema, gt as ErrorTypes, ha as eReasoningEffortSchema, hi as videoMimeTypes, hn as defaultModels, ho as actionDomainSeparator, hr as SSEOptionsSchema, ht as EndpointURLs, ia as compactAgentsBaseSchema, ii as isPermissiveMimeConfig, in as bedrockGuardrailConfigSchema, io as tQueryParamsSchema, ir as turnstileOptionsSchema, it as AUTH_USER_DOC_BY_ID_PREFIX, ja as imageDetailNumeric, ji as BedrockProviders, jn as langfuseConfigSchema, jo as extractVariableName, jr as audioMimeTypes, jt as SKILL_SYNC_MAX_DISCOVERY_DEPTH, ka as googleSchema, ki as AnthropicEffort, kn as interfaceSchema, ko as envVarRegex, kr as sharedFileDownload, kt as RetentionMode, la as defaultAssistantFormValues, li as retrievalMimeTypes, ln as cloudfrontConfigSchema, lo as FilePurpose, lr as visionModels, lt as CacheKeys, ma as eReasoningContextSchema, mi as textMimeTypes, mn as defaultEndpoints, mo as actionDelimiter, mr as MCP_USER_INPUT_FIELDS, mt as EImageOutputType, na as cacheSubsetProviders, ni as isAnthropicTextDocumentType, nn as baseEndpointSchema, no as tPluginSchema, nr as toolApprovalPolicySchema, nt as updateResourcePermissionsRequestSchema, oa as compactAssistantSchema, oi as megabyte, on as buildServerNameAliases, oo as AnnotationTypes, or as validateVisionModel, ot as AuthKeys, pa as eModelEndpointSchema, pi as supportsFiles, pn as defaultAssistantsVersion, po as Tools, pr as MCPServersSchema, pt as DEFAULT_MEMORY_MAX_INPUT_TOKENS, q as accessRoleSchema, qa as removeNullishValues, qi as Verbosity, qn as skillSyncGitHubSourceSchema, qr as fileConfigSchema, qt as allowedAddressesSchema, ra as coerceNumber, ri as isBedrockDocumentType, rn as bedrockEndpointSchema, ro as tPresetSchema, rr as transactionsSchema, rt as updateResourcePermissionsResponseSchema, sa as compactGoogleSchema, si as mergeFileConfig, sn as checkpointerSchema, so as AssistantStreamEvents, sr as vertexAISchema, st as BASE_ONLY_CONFIG_SECTIONS, ta as authTypeSchema, ti as isAnthropicDocumentType, tn as balanceSchema, to as tPluginAuthConfigSchema, tr as toolApprovalModeSchema, tt as resourcePermissionsResponseSchema, ua as documentSupportedProviders, ui as retrievalMimeTypesList, un as configSchema, uo as MessageContentTypes, ur as webSearchSchema, ut as Capabilities, va as eReasoningResponseKeySchema, vi as modelSpecSubagentsSchema, vn as endpointSchema, vo as hostImageNamePrefix, vr as WebSocketOptionsSchema, vt as ForkOptions, wa as extendedModelEndpointSchema, wi as SettingTypes, wn as getDefaultParamsEndpoint, wo as feedbackSchema, wr as checkOpenAIStorage, wt as MAX_SUBAGENT_GRAPH_NODES, xa as eThinkingLevelSchema, xi as MAX_SUBAGENTS, xn as fileStorageSchema, xo as FEEDBACK_REASON_KEYS, xr as TokenExchangeMethodEnum, xt as KnownEndpoints, ya as eReasoningSummarySchema, yi as specsConfigSchema, yn as excludedKeys, yo as isActionTool, yr as AuthTypeEnum, yt as ImageDetailCost, z as DynamicQueryKeys, za as isOpenAILikeProvider, zi as ReasoningContext, zn as ocrSchema, zr as defaultOCRMimeTypes, zt as SettingsTabValues } from "./data-service-pwrlWjJs.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import dayjs from "dayjs";
|
|
4
4
|
import utc from "dayjs/plugin/utc.js";
|
|
@@ -8,10 +8,13 @@ import { URL } from "url";
|
|
|
8
8
|
import crypto from "crypto";
|
|
9
9
|
import { load } from "js-yaml";
|
|
10
10
|
//#region src/bedrock.ts
|
|
11
|
-
const DEFAULT_ENABLED_MAX_TOKENS = 8192;
|
|
12
11
|
const DEFAULT_THINKING_BUDGET = 2e3;
|
|
12
|
+
const BEDROCK_CLAUDE_SONNET_4_6_MAX_OUTPUT = 64e3;
|
|
13
13
|
const BEDROCK_OUTPUT_128K_BETA = "output-128k-2025-02-19";
|
|
14
14
|
const BEDROCK_FINE_GRAINED_TOOL_STREAMING_BETA = "fine-grained-tool-streaming-2025-05-14";
|
|
15
|
+
/** Betas LibreChat injects itself, safe to strip from persisted AMRF when a
|
|
16
|
+
* model no longer supports them; anything else in `anthropic_beta` is a user opt-in. */
|
|
17
|
+
const GENERATED_BEDROCK_BETAS = new Set([BEDROCK_OUTPUT_128K_BETA, BEDROCK_FINE_GRAINED_TOOL_STREAMING_BETA]);
|
|
15
18
|
const bedrockReasoningConfigValues = new Set(Object.values(BedrockReasoningConfig));
|
|
16
19
|
/**
|
|
17
20
|
* Resolves the final `thinking.display` value for an adaptive-thinking request.
|
|
@@ -56,14 +59,14 @@ function parseOpusVersion(model) {
|
|
|
56
59
|
return null;
|
|
57
60
|
}
|
|
58
61
|
/** Extracts sonnet major/minor version from both naming formats.
|
|
59
|
-
* Uses
|
|
62
|
+
* Uses bounded minor capture to avoid matching date suffixes (e.g., -20250514). */
|
|
60
63
|
function parseSonnetVersion(model) {
|
|
61
|
-
const nameFirst = model.match(/claude-sonnet[-.]?(\d+)(?:[-.](\d)(?!\d))?/);
|
|
64
|
+
const nameFirst = model.match(/claude-sonnet[-.]?(\d+)(?:[-.](\d{1,2})(?!\d))?/);
|
|
62
65
|
if (nameFirst) return {
|
|
63
66
|
major: parseInt(nameFirst[1], 10),
|
|
64
67
|
minor: nameFirst[2] != null ? parseInt(nameFirst[2], 10) : 0
|
|
65
68
|
};
|
|
66
|
-
const numFirst = model.match(/claude-(\d+)(?:[-.](\d)(?!\d))?-sonnet/);
|
|
69
|
+
const numFirst = model.match(/claude-(\d+)(?:[-.](\d{1,2})(?!\d))?-sonnet/);
|
|
67
70
|
if (numFirst) return {
|
|
68
71
|
major: parseInt(numFirst[1], 10),
|
|
69
72
|
minor: numFirst[2] != null ? parseInt(numFirst[2], 10) : 0
|
|
@@ -97,15 +100,80 @@ function supportsAdaptiveThinking(model) {
|
|
|
97
100
|
function omitsThinkingByDefault(model) {
|
|
98
101
|
const opus = parseOpusVersion(model);
|
|
99
102
|
if (opus && (opus.major > 4 || opus.major === 4 && opus.minor >= 7)) return true;
|
|
103
|
+
const sonnet = parseSonnetVersion(model);
|
|
104
|
+
if (sonnet != null && sonnet.major >= 5) return true;
|
|
100
105
|
if (isMythosClassModel(model)) return true;
|
|
101
106
|
return false;
|
|
102
107
|
}
|
|
103
108
|
function omitsSamplingParameters(model) {
|
|
104
109
|
const opus = parseOpusVersion(model);
|
|
105
110
|
if (opus && (opus.major > 4 || opus.major === 4 && opus.minor >= 7)) return true;
|
|
111
|
+
const sonnet = parseSonnetVersion(model);
|
|
112
|
+
if (sonnet != null && sonnet.major >= 5) return true;
|
|
106
113
|
if (isMythosClassModel(model)) return true;
|
|
107
114
|
return false;
|
|
108
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Whether disabling thinking requires sending an explicit `{ type: 'disabled' }`
|
|
118
|
+
* config rather than simply omitting the `thinking` field.
|
|
119
|
+
*
|
|
120
|
+
* Sonnet 5 and Opus 5 treat an omitted `thinking` field as adaptive thinking ON
|
|
121
|
+
* by default, so honoring a user who turns thinking off means sending the
|
|
122
|
+
* disabled config explicitly. Opus 4.7/4.8 run without thinking when the field
|
|
123
|
+
* is omitted, and Fable/Mythos reject an explicit disabled config (400,
|
|
124
|
+
* thinking always on), so both are excluded.
|
|
125
|
+
*
|
|
126
|
+
* See https://platform.claude.com/docs/en/about-claude/models/migration-guide#migrating-to-claude-sonnet-5
|
|
127
|
+
*/
|
|
128
|
+
function requiresExplicitThinkingDisabled(model) {
|
|
129
|
+
const sonnet = parseSonnetVersion(model);
|
|
130
|
+
if (sonnet != null && sonnet.major >= 5) return true;
|
|
131
|
+
const opus = parseOpusVersion(model);
|
|
132
|
+
return opus != null && opus.major >= 5;
|
|
133
|
+
}
|
|
134
|
+
/** Effort levels Opus 5 rejects while thinking is explicitly disabled. */
|
|
135
|
+
const EFFORTS_REJECTED_WHEN_THINKING_DISABLED = new Set(["xhigh", "max"]);
|
|
136
|
+
/**
|
|
137
|
+
* Whether the model caps `output_config.effort` while thinking is disabled.
|
|
138
|
+
*
|
|
139
|
+
* Opus 5 rejects `xhigh`/`max` in that combination with a 400: "output_config
|
|
140
|
+
* .effort 'xhigh' is not supported when thinking is disabled on this model. Use
|
|
141
|
+
* effort 'high' or below, or enable thinking." Opus 4.7/4.8, Sonnet 5, and
|
|
142
|
+
* Sonnet 4.6 accept every effort level they otherwise support with thinking
|
|
143
|
+
* off, so the cap is Opus 5+ only.
|
|
144
|
+
*/
|
|
145
|
+
function capsEffortWhenThinkingDisabled(model) {
|
|
146
|
+
const opus = parseOpusVersion(model);
|
|
147
|
+
return opus != null && opus.major >= 5;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Lowers an effort level the model would reject while thinking is disabled to
|
|
151
|
+
* the highest accepted value (`high`, which is also the API default). Returns
|
|
152
|
+
* the effort unchanged when the combination is valid.
|
|
153
|
+
*/
|
|
154
|
+
function clampEffortForDisabledThinking(model, effort) {
|
|
155
|
+
if (capsEffortWhenThinkingDisabled(model) && EFFORTS_REJECTED_WHEN_THINKING_DISABLED.has(effort)) return "high";
|
|
156
|
+
return effort;
|
|
157
|
+
}
|
|
158
|
+
/** An `output_config` container carrying a usable effort level. */
|
|
159
|
+
function hasStringEffort(value) {
|
|
160
|
+
if (typeof value !== "object" || value === null || !("effort" in value)) return false;
|
|
161
|
+
return typeof value.effort === "string";
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Clamps an `output_config.effort` in place when the model would reject it
|
|
165
|
+
* while thinking is disabled. No-op when the container carries no string
|
|
166
|
+
* effort, so callers can pass a possibly-absent config directly.
|
|
167
|
+
*/
|
|
168
|
+
function clampOutputConfigEffort(model, outputConfig) {
|
|
169
|
+
if (!hasStringEffort(outputConfig)) return;
|
|
170
|
+
outputConfig.effort = clampEffortForDisabledThinking(model, outputConfig.effort);
|
|
171
|
+
}
|
|
172
|
+
/** Whether a resolved thinking config is an explicit `{ type: 'disabled' }`. */
|
|
173
|
+
function isThinkingDisabled(thinking) {
|
|
174
|
+
if (typeof thinking !== "object" || thinking === null || !("type" in thinking)) return false;
|
|
175
|
+
return thinking.type === "disabled";
|
|
176
|
+
}
|
|
109
177
|
/** Checks if a model has a 1M context window (Sonnet 4.6+, Opus 4.6+, Opus 5+, Fable/Mythos) */
|
|
110
178
|
function supportsContext1m(model) {
|
|
111
179
|
const sonnet = parseSonnetVersion(model);
|
|
@@ -116,6 +184,19 @@ function supportsContext1m(model) {
|
|
|
116
184
|
return false;
|
|
117
185
|
}
|
|
118
186
|
/**
|
|
187
|
+
* A Bedrock Claude model ID may be prefixed (`anthropic.claude-*`,
|
|
188
|
+
* `us.anthropic.claude-*`, `global.anthropic.claude-*`) or bare (`claude-*`,
|
|
189
|
+
* used when the LibreChat model ID maps to an application inference profile).
|
|
190
|
+
* Match on the `claude` family token so every form is recognized — requiring
|
|
191
|
+
* the literal `anthropic.` prefix silently dropped thinking config, beta
|
|
192
|
+
* headers, and sampling handling for inference-profile deployments.
|
|
193
|
+
*/
|
|
194
|
+
const BEDROCK_CLAUDE_4PLUS_THINKING = /claude-(?:[4-9](?:\.\d+)?(?:-\d+)?-(?:sonnet|opus|haiku)|(?:sonnet|opus|haiku)-[4-9])/;
|
|
195
|
+
/** Whether a Bedrock model ID is an Anthropic Claude model (prefixed or bare). */
|
|
196
|
+
function isBedrockClaudeModel(model) {
|
|
197
|
+
return model.includes("claude");
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
119
200
|
* Gets the appropriate anthropic_beta headers for Bedrock Anthropic models.
|
|
120
201
|
* Bedrock uses `anthropic_beta` (with underscore) in additionalModelRequestFields.
|
|
121
202
|
*
|
|
@@ -126,19 +207,33 @@ function getBedrockAnthropicBetaHeaders(model) {
|
|
|
126
207
|
const betaHeaders = [];
|
|
127
208
|
/** Mythos-class (Fable/Mythos) is intentionally not matched: these betas are built-in/no-op for the
|
|
128
209
|
* 4.7+ generation (Fable has native 128K output), so omitting them on Bedrock is lossless. */
|
|
129
|
-
const isClaude4PlusModel =
|
|
130
|
-
if (model.includes("
|
|
210
|
+
const isClaude4PlusModel = BEDROCK_CLAUDE_4PLUS_THINKING.test(model);
|
|
211
|
+
if (model.includes("claude-3-7-sonnet") || isClaude4PlusModel) betaHeaders.push(BEDROCK_OUTPUT_128K_BETA);
|
|
131
212
|
if (isClaude4PlusModel) betaHeaders.push(BEDROCK_FINE_GRAINED_TOOL_STREAMING_BETA);
|
|
132
213
|
return betaHeaders;
|
|
133
214
|
}
|
|
215
|
+
/** Flatten an anthropic_beta value (array, single string, or comma-delimited
|
|
216
|
+
* string) into trimmed, non-empty header tokens. */
|
|
217
|
+
function normalizeBetaHeaders(value) {
|
|
218
|
+
let values = [];
|
|
219
|
+
if (Array.isArray(value)) values = value;
|
|
220
|
+
else if (typeof value === "string") values = [value];
|
|
221
|
+
const headers = [];
|
|
222
|
+
values.forEach((entry) => {
|
|
223
|
+
if (typeof entry !== "string") return;
|
|
224
|
+
entry.split(",").map((header) => header.trim()).filter(Boolean).forEach((header) => headers.push(header));
|
|
225
|
+
});
|
|
226
|
+
return headers;
|
|
227
|
+
}
|
|
134
228
|
function mergeBedrockAnthropicBetaHeaders(existing, generated) {
|
|
135
|
-
|
|
136
|
-
if (Array.isArray(existing)) existingValues = existing;
|
|
137
|
-
else if (typeof existing === "string") existingValues = [existing];
|
|
229
|
+
const generatedSet = new Set(generated);
|
|
138
230
|
const betaHeaders = /* @__PURE__ */ new Set();
|
|
139
|
-
[...
|
|
140
|
-
|
|
141
|
-
|
|
231
|
+
[...normalizeBetaHeaders(existing), ...generated].forEach((header) => {
|
|
232
|
+
/** Drop a generated beta carried over from a prior model that the current
|
|
233
|
+
* model does not generate (e.g. fine-grained-tool-streaming on a 3.7
|
|
234
|
+
* profile); user opt-ins are always preserved. */
|
|
235
|
+
if (GENERATED_BEDROCK_BETAS.has(header) && !generatedSet.has(header)) return;
|
|
236
|
+
betaHeaders.add(header);
|
|
142
237
|
});
|
|
143
238
|
return Array.from(betaHeaders);
|
|
144
239
|
}
|
|
@@ -172,7 +267,7 @@ const bedrockInputSchema = tConversationSchema.pick({
|
|
|
172
267
|
}).transform((obj) => {
|
|
173
268
|
if (obj.additionalModelRequestFields?.thinking != null) {
|
|
174
269
|
const thinking = obj.additionalModelRequestFields.thinking;
|
|
175
|
-
obj.thinking = !!thinking;
|
|
270
|
+
obj.thinking = typeof thinking === "object" && thinking !== null && thinking.type === "disabled" ? false : !!thinking;
|
|
176
271
|
obj.thinkingBudget = typeof thinking === "object" && "budget_tokens" in thinking ? thinking.budget_tokens : void 0;
|
|
177
272
|
if (obj.thinkingDisplay == null) {
|
|
178
273
|
const persistedDisplay = extractPersistedDisplay({ thinking });
|
|
@@ -239,16 +334,49 @@ const bedrockInputParser = tConversationSchema.pick({
|
|
|
239
334
|
delete typedData[key];
|
|
240
335
|
}
|
|
241
336
|
});
|
|
242
|
-
/**
|
|
243
|
-
|
|
337
|
+
/**
|
|
338
|
+
* Persisted `model_parameters` can carry a prior "thinking off" only inside
|
|
339
|
+
* `additionalModelRequestFields.thinking = { type: 'disabled' }` (a known
|
|
340
|
+
* key that isn't spread into `additionalFields`). `initializeBedrock` feeds
|
|
341
|
+
* those params straight through this parser, so surface that as
|
|
342
|
+
* `thinking: false` — otherwise the disabled branch is skipped and the
|
|
343
|
+
* config rebuilds adaptive, flipping a user's Sonnet 5 setting back on.
|
|
344
|
+
*/
|
|
345
|
+
const persistedThinking = typedData.additionalModelRequestFields?.thinking;
|
|
346
|
+
if (additionalFields.thinking === void 0 && typeof persistedThinking === "object" && persistedThinking !== null && persistedThinking.type === "disabled") additionalFields.thinking = false;
|
|
347
|
+
/** Bedrock thinking-capable Claude models: 3.7 Sonnet, Claude 4+ (opus/sonnet/haiku), and Mythos-class (Fable/Mythos). */
|
|
348
|
+
const isThinkingModel = typeof typedData.model === "string" && (typedData.model.includes("claude-3-7-sonnet") || BEDROCK_CLAUDE_4PLUS_THINKING.test(typedData.model) || isMythosClassModel(typedData.model));
|
|
349
|
+
if (isThinkingModel) {
|
|
244
350
|
if (supportsAdaptiveThinking(typedData.model)) {
|
|
351
|
+
/** Persisted AMRF is spread into the final request, so clearing only
|
|
352
|
+
* `additionalFields` leaves a stale value from a prior selection. */
|
|
353
|
+
const persistedAmrf = typedData.additionalModelRequestFields;
|
|
354
|
+
const thinkingDisabled = additionalFields.thinking === false;
|
|
245
355
|
const effort = additionalFields.effort;
|
|
246
|
-
if (
|
|
356
|
+
if (typeof effort === "string" && effort !== "") additionalFields.output_config = { effort };
|
|
357
|
+
else if (effort !== void 0 && persistedAmrf)
|
|
358
|
+
/** Explicit unset ('' or null) clears the persisted effort. An absent
|
|
359
|
+
* effort (agent resume, where the prior llmConfig persisted
|
|
360
|
+
* `output_config` but no top-level `effort`) preserves it. */
|
|
361
|
+
delete persistedAmrf.output_config;
|
|
247
362
|
delete additionalFields.effort;
|
|
363
|
+
/**
|
|
364
|
+
* Opus 5 rejects `xhigh`/`max` effort while thinking is disabled, so
|
|
365
|
+
* clamp both the effort derived above and any effort still carried in
|
|
366
|
+
* persisted AMRF (agent resume sends `output_config` with no top-level
|
|
367
|
+
* `effort`, so the branch above leaves it untouched).
|
|
368
|
+
*/
|
|
369
|
+
if (thinkingDisabled) [additionalFields, persistedAmrf].forEach((target) => clampOutputConfigEffort(typedData.model, target?.output_config));
|
|
248
370
|
if (additionalFields.thinking === false) {
|
|
249
|
-
delete additionalFields.thinking;
|
|
250
371
|
delete additionalFields.thinkingBudget;
|
|
251
372
|
delete additionalFields.thinkingDisplay;
|
|
373
|
+
if (requiresExplicitThinkingDisabled(typedData.model)) additionalFields.thinking = { type: "disabled" };
|
|
374
|
+
else {
|
|
375
|
+
delete additionalFields.thinking;
|
|
376
|
+
/** Disable-by-omission models (Opus 4.7+): drop the persisted
|
|
377
|
+
* adaptive config so turning thinking off actually disables it. */
|
|
378
|
+
if (persistedAmrf) delete persistedAmrf.thinking;
|
|
379
|
+
}
|
|
252
380
|
} else {
|
|
253
381
|
/**
|
|
254
382
|
* Persisted agent `model_parameters` round-trip back through this
|
|
@@ -276,10 +404,18 @@ const bedrockInputParser = tConversationSchema.pick({
|
|
|
276
404
|
if (additionalFields.thinking === true && additionalFields.thinkingBudget === void 0) additionalFields.thinkingBudget = DEFAULT_THINKING_BUDGET;
|
|
277
405
|
delete additionalFields.effort;
|
|
278
406
|
delete additionalFields.thinkingDisplay;
|
|
407
|
+
/** A bare non-adaptive thinking profile (e.g. `claude-3-7-sonnet`) must
|
|
408
|
+
* not inherit an adaptive/disabled thinking object or `output_config`
|
|
409
|
+
* persisted from another model; this branch's own fields are authoritative. */
|
|
410
|
+
const persistedAmrf = typedData.additionalModelRequestFields;
|
|
411
|
+
if (persistedAmrf) {
|
|
412
|
+
delete persistedAmrf.thinking;
|
|
413
|
+
delete persistedAmrf.output_config;
|
|
414
|
+
}
|
|
279
415
|
}
|
|
280
416
|
/** Anthropic uses 'effort' via output_config, not reasoning_config */
|
|
281
417
|
delete additionalFields.reasoning_effort;
|
|
282
|
-
if (typedData.model
|
|
418
|
+
if (isBedrockClaudeModel(typedData.model)) {
|
|
283
419
|
const betaHeaders = getBedrockAnthropicBetaHeaders(typedData.model);
|
|
284
420
|
if (betaHeaders.length > 0) {
|
|
285
421
|
const existingBetaHeaders = typedData.additionalModelRequestFields?.anthropic_beta;
|
|
@@ -297,7 +433,7 @@ const bedrockInputParser = tConversationSchema.pick({
|
|
|
297
433
|
delete additionalFields.reasoning_effort;
|
|
298
434
|
if (typeof reasoningEffort === "string" && bedrockReasoningConfigValues.has(reasoningEffort)) additionalFields.reasoning_config = reasoningEffort;
|
|
299
435
|
}
|
|
300
|
-
const isAnthropicModel = typeof typedData.model === "string" && typedData.model
|
|
436
|
+
const isAnthropicModel = typeof typedData.model === "string" && isBedrockClaudeModel(typedData.model);
|
|
301
437
|
/** Strip stale fields from previously-persisted additionalModelRequestFields */
|
|
302
438
|
if (typeof typedData.additionalModelRequestFields === "object" && typedData.additionalModelRequestFields != null) {
|
|
303
439
|
const amrf = typedData.additionalModelRequestFields;
|
|
@@ -311,6 +447,22 @@ const bedrockInputParser = tConversationSchema.pick({
|
|
|
311
447
|
} else {
|
|
312
448
|
delete amrf.reasoning_config;
|
|
313
449
|
delete amrf.reasoning_effort;
|
|
450
|
+
/** A Claude model that does not support Bedrock thinking (e.g. a bare
|
|
451
|
+
* `claude-3-5-sonnet` inference profile) must not carry stale thinking
|
|
452
|
+
* fields from a previously-selected thinking model. Drop only the
|
|
453
|
+
* LibreChat-generated betas (output-128k, fine-grained tool streaming);
|
|
454
|
+
* user opt-ins in `anthropic_beta` are preserved. */
|
|
455
|
+
if (!isThinkingModel) {
|
|
456
|
+
delete amrf.thinking;
|
|
457
|
+
delete amrf.thinkingBudget;
|
|
458
|
+
delete amrf.effort;
|
|
459
|
+
delete amrf.output_config;
|
|
460
|
+
if (amrf.anthropic_beta !== void 0) {
|
|
461
|
+
const kept = normalizeBetaHeaders(amrf.anthropic_beta).filter((header) => !GENERATED_BEDROCK_BETAS.has(header));
|
|
462
|
+
if (kept.length > 0) amrf.anthropic_beta = kept;
|
|
463
|
+
else delete amrf.anthropic_beta;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
314
466
|
}
|
|
315
467
|
if (shouldOmitSamplingParameters) {
|
|
316
468
|
delete amrf.temperature;
|
|
@@ -353,11 +505,37 @@ const bedrockInputParser = tConversationSchema.pick({
|
|
|
353
505
|
* @param data - The parsed Bedrock request options object
|
|
354
506
|
* @returns The object with thinking configured appropriately
|
|
355
507
|
*/
|
|
508
|
+
/**
|
|
509
|
+
* `anthropicSettings.maxOutputTokens.reset` only matches the canonical
|
|
510
|
+
* family-first id (`claude-sonnet-5`); Bedrock also accepts number-first
|
|
511
|
+
* aliases (`claude-5-sonnet`, `claude-4-7-sonnet`) that this file gates as
|
|
512
|
+
* thinking models. Canonicalize to family-first so those aliases resolve to the
|
|
513
|
+
* real ceiling instead of the 8192 fallback.
|
|
514
|
+
*/
|
|
515
|
+
function toFamilyFirstClaudeId(model) {
|
|
516
|
+
return model.replace(/claude-(\d+(?:[-.]\d+)?)-(sonnet|opus|haiku)/, "claude-$2-$1");
|
|
517
|
+
}
|
|
518
|
+
function isBedrockClaudeSonnet46(model) {
|
|
519
|
+
return /claude-sonnet[-.]?4[-.]?6(?=$|[^0-9])/.test(toFamilyFirstClaudeId(model));
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Thinking tokens share the `maxTokens` output budget with tool-call arguments
|
|
523
|
+
* (e.g. a `create_file` `content`), so a low default truncates large authored
|
|
524
|
+
* files mid-argument. Mirror the direct-Anthropic path and default to the
|
|
525
|
+
* model's full max output when the request does not set one explicitly.
|
|
526
|
+
*/
|
|
527
|
+
function resolveThinkingMaxTokens(data) {
|
|
528
|
+
const explicit = data.maxTokens ?? data.maxOutputTokens;
|
|
529
|
+
if (typeof explicit === "number" && explicit > 0) return explicit;
|
|
530
|
+
const model = typeof data.model === "string" ? data.model : "";
|
|
531
|
+
if (isBedrockClaudeSonnet46(model)) return BEDROCK_CLAUDE_SONNET_4_6_MAX_OUTPUT;
|
|
532
|
+
return anthropicSettings.maxOutputTokens.reset(toFamilyFirstClaudeId(model));
|
|
533
|
+
}
|
|
356
534
|
function configureThinking(data) {
|
|
357
535
|
const updatedData = { ...data };
|
|
358
536
|
const thinking = updatedData.additionalModelRequestFields?.thinking;
|
|
359
537
|
if (thinking === true) {
|
|
360
|
-
updatedData.maxTokens = updatedData
|
|
538
|
+
updatedData.maxTokens = resolveThinkingMaxTokens(updatedData);
|
|
361
539
|
delete updatedData.maxOutputTokens;
|
|
362
540
|
const thinkingConfig = {
|
|
363
541
|
type: "enabled",
|
|
@@ -367,12 +545,30 @@ function configureThinking(data) {
|
|
|
367
545
|
updatedData.additionalModelRequestFields.thinking = thinkingConfig;
|
|
368
546
|
delete updatedData.additionalModelRequestFields.thinkingBudget;
|
|
369
547
|
} else if (typeof thinking === "object" && thinking != null && thinking.type === "adaptive") {
|
|
370
|
-
|
|
548
|
+
updatedData.maxTokens = resolveThinkingMaxTokens(updatedData);
|
|
371
549
|
delete updatedData.maxOutputTokens;
|
|
372
550
|
delete updatedData.additionalModelRequestFields.thinkingBudget;
|
|
373
551
|
}
|
|
374
552
|
return updatedData;
|
|
375
553
|
}
|
|
554
|
+
/** Top-level Converse request fields (issue #14029: `system` from a preset).
|
|
555
|
+
* The input parser's catch-all routes unknown keys into
|
|
556
|
+
* additionalModelRequestFields, and Bedrock rejects any that collide with a
|
|
557
|
+
* field the request already sends (`messages`/`modelId` always,
|
|
558
|
+
* `inferenceConfig` whenever maxTokens is set, `toolConfig` for agents). */
|
|
559
|
+
const RESERVED_CONVERSE_FIELDS = [
|
|
560
|
+
"system",
|
|
561
|
+
"messages",
|
|
562
|
+
"modelId",
|
|
563
|
+
"toolConfig",
|
|
564
|
+
"inferenceConfig",
|
|
565
|
+
"guardrailConfig",
|
|
566
|
+
"promptVariables",
|
|
567
|
+
"requestMetadata",
|
|
568
|
+
"performanceConfig",
|
|
569
|
+
"additionalModelRequestFields",
|
|
570
|
+
"additionalModelResponseFieldPaths"
|
|
571
|
+
];
|
|
376
572
|
const bedrockOutputParser = (data) => {
|
|
377
573
|
const knownKeys = [
|
|
378
574
|
...Object.keys(tConversationSchema.shape),
|
|
@@ -391,7 +587,15 @@ const bedrockOutputParser = (data) => {
|
|
|
391
587
|
if (result.maxTokens !== void 0 && result.maxOutputTokens === void 0) result.maxOutputTokens = result.maxTokens;
|
|
392
588
|
else if (result.maxOutputTokens !== void 0 && result.maxTokens === void 0) result.maxTokens = result.maxOutputTokens;
|
|
393
589
|
result = configureThinking(result);
|
|
394
|
-
|
|
590
|
+
let amrf = result.additionalModelRequestFields;
|
|
591
|
+
if (amrf && typeof amrf === "object") {
|
|
592
|
+
const reserved = RESERVED_CONVERSE_FIELDS.filter((key) => key in (amrf ?? {}));
|
|
593
|
+
if (reserved.length > 0) {
|
|
594
|
+
amrf = { ...amrf };
|
|
595
|
+
for (const key of reserved) delete amrf[key];
|
|
596
|
+
result.additionalModelRequestFields = amrf;
|
|
597
|
+
}
|
|
598
|
+
}
|
|
395
599
|
if (!amrf || Object.keys(amrf).length === 0) delete result.additionalModelRequestFields;
|
|
396
600
|
return result;
|
|
397
601
|
};
|
|
@@ -408,6 +612,8 @@ let ContentTypes = /* @__PURE__ */ function(ContentTypes) {
|
|
|
408
612
|
ContentTypes["INPUT_AUDIO"] = "input_audio";
|
|
409
613
|
ContentTypes["AGENT_UPDATE"] = "agent_update";
|
|
410
614
|
ContentTypes["SUMMARY"] = "summary";
|
|
615
|
+
ContentTypes["ACTIVITY_LABEL"] = "activity_label";
|
|
616
|
+
ContentTypes["STEER"] = "steer";
|
|
411
617
|
ContentTypes["ERROR"] = "error";
|
|
412
618
|
return ContentTypes;
|
|
413
619
|
}({});
|
|
@@ -436,6 +642,7 @@ let StepEvents = /* @__PURE__ */ function(StepEvents) {
|
|
|
436
642
|
StepEvents["ON_SUMMARIZE_DELTA"] = "on_summarize_delta";
|
|
437
643
|
StepEvents["ON_SUMMARIZE_COMPLETE"] = "on_summarize_complete";
|
|
438
644
|
StepEvents["ON_SUBAGENT_UPDATE"] = "on_subagent_update";
|
|
645
|
+
StepEvents["ON_SANDBOX_STARTING"] = "on_sandbox_starting";
|
|
439
646
|
return StepEvents;
|
|
440
647
|
}({});
|
|
441
648
|
/** Token-tracking event names streamed to the client (separate from StepEvents dispatch). */
|
|
@@ -445,6 +652,38 @@ let UsageEvents = /* @__PURE__ */ function(UsageEvents) {
|
|
|
445
652
|
return UsageEvents;
|
|
446
653
|
}({});
|
|
447
654
|
/**
|
|
655
|
+
* Human-in-the-loop event names. Streamed to live clients when a run pauses for
|
|
656
|
+
* tool approval (or an ask-user question). Reconnecting clients instead read the
|
|
657
|
+
* same record from `resumeState.pendingAction` on the sync event / status route.
|
|
658
|
+
*/
|
|
659
|
+
let ApprovalEvents = /* @__PURE__ */ function(ApprovalEvents) {
|
|
660
|
+
ApprovalEvents["ON_PENDING_ACTION"] = "on_pending_action";
|
|
661
|
+
return ApprovalEvents;
|
|
662
|
+
}({});
|
|
663
|
+
/**
|
|
664
|
+
* Steering event names. `on_steer_applied` streams to live clients when a
|
|
665
|
+
* queued steer message is injected at a tool-batch boundary; reconnecting
|
|
666
|
+
* clients recover injected steers from `aggregatedContent` and still-queued
|
|
667
|
+
* ones from `resumeState.pendingSteers`. Steers that never reach a boundary
|
|
668
|
+
* ride the final/abort events as `pendingSteers`.
|
|
669
|
+
*/
|
|
670
|
+
let SteerEvents = /* @__PURE__ */ function(SteerEvents) {
|
|
671
|
+
SteerEvents["ON_STEER_APPLIED"] = "on_steer_applied";
|
|
672
|
+
/** Durable capability correction for queued steers after HITL handover. */
|
|
673
|
+
SteerEvents["ON_STEER_UPDATED"] = "on_steer_updated";
|
|
674
|
+
return SteerEvents;
|
|
675
|
+
}({});
|
|
676
|
+
/**
|
|
677
|
+
* Activity-label event names. `on_activity_label` streams to live clients
|
|
678
|
+
* when a tool-batch or parent-phase label part is claimed and again when the
|
|
679
|
+
* fast-model label resolves; reconnecting clients recover applied labels
|
|
680
|
+
* from `aggregatedContent` like any other content part.
|
|
681
|
+
*/
|
|
682
|
+
let ActivityLabelEvents = /* @__PURE__ */ function(ActivityLabelEvents) {
|
|
683
|
+
ActivityLabelEvents["ON_ACTIVITY_LABEL"] = "on_activity_label";
|
|
684
|
+
return ActivityLabelEvents;
|
|
685
|
+
}({});
|
|
686
|
+
/**
|
|
448
687
|
* Full prompt token count for one completed model call — the EXACT context the
|
|
449
688
|
* model saw, provider-aware: additive providers (Bedrock) report `input_tokens`
|
|
450
689
|
* excluding cache, so cache reads/writes are added back; subset providers
|
|
@@ -651,19 +890,21 @@ const parseCompactConvo = ({ endpoint, endpointType, conversation, possibleValue
|
|
|
651
890
|
if (models && convo) convo.model = getFirstDefinedValue(models) ?? convo.model;
|
|
652
891
|
return convo;
|
|
653
892
|
};
|
|
654
|
-
function parseTextParts(contentParts, skipReasoning = false) {
|
|
893
|
+
function parseTextParts(contentParts, skipReasoning = false, options) {
|
|
655
894
|
let result = "";
|
|
895
|
+
const append = (textValue) => {
|
|
896
|
+
if (result.length > 0 && textValue.length > 0 && result[result.length - 1] !== " " && textValue[0] !== " ") result += " ";
|
|
897
|
+
result += textValue;
|
|
898
|
+
};
|
|
656
899
|
for (const part of contentParts) {
|
|
657
900
|
if (!part?.type) continue;
|
|
658
|
-
if (part.type === "text")
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
result += textValue;
|
|
666
|
-
}
|
|
901
|
+
if (part.type === "text") append((typeof part.text === "string" ? part.text : part.text?.value) || "");
|
|
902
|
+
else if (part.type === "steer" && options?.includeSteer === true)
|
|
903
|
+
/** Mid-run user speech: excluded by default so generic extraction (TTS
|
|
904
|
+
* reading assistant output) never speaks the user's own words — the
|
|
905
|
+
* full-record surfaces (search indexing, persisted abort text) opt in. */
|
|
906
|
+
append(typeof part.steer === "string" ? part.steer : "");
|
|
907
|
+
else if (part.type === "think" && !skipReasoning) append(typeof part.think === "string" ? part.think : "");
|
|
667
908
|
}
|
|
668
909
|
return result;
|
|
669
910
|
}
|
|
@@ -1009,14 +1250,27 @@ function mapGroupToAzureConfig({ groupName, groupMap }) {
|
|
|
1009
1250
|
}
|
|
1010
1251
|
//#endregion
|
|
1011
1252
|
//#region src/messages.ts
|
|
1253
|
+
/**
|
|
1254
|
+
* Builds the render tree from the flat messages array. Order-robust: live
|
|
1255
|
+
* stream/steer/preempt cache writes can momentarily place a child before its
|
|
1256
|
+
* parent, and a single-pass link would hoist such rows into phantom root
|
|
1257
|
+
* branches — folding the visible thread to one dangling branch until a
|
|
1258
|
+
* refetch restores creation order. Linking happens only after every message
|
|
1259
|
+
* is indexed, so array order never changes the tree shape.
|
|
1260
|
+
*/
|
|
1012
1261
|
function buildTree({ messages, fileMap }) {
|
|
1013
1262
|
if (messages === null) return null;
|
|
1014
1263
|
const messageMap = {};
|
|
1264
|
+
const orderedMessages = [];
|
|
1015
1265
|
const rootMessages = [];
|
|
1016
1266
|
const childrenCount = {};
|
|
1017
|
-
|
|
1018
|
-
if (!message)
|
|
1019
|
-
|
|
1267
|
+
for (const message of messages) {
|
|
1268
|
+
if (!message) continue;
|
|
1269
|
+
/** A self-parented row can never link under itself (it becomes a root),
|
|
1270
|
+
* so count it with the parentless group — charging its own id would
|
|
1271
|
+
* inflate the sibling indices of its real children past
|
|
1272
|
+
* `children.length`. */
|
|
1273
|
+
const parentId = message.parentMessageId === message.messageId ? "" : message.parentMessageId ?? "";
|
|
1020
1274
|
childrenCount[parentId] = (childrenCount[parentId] || 0) + 1;
|
|
1021
1275
|
const extendedMessage = {
|
|
1022
1276
|
...message,
|
|
@@ -1026,12 +1280,39 @@ function buildTree({ messages, fileMap }) {
|
|
|
1026
1280
|
};
|
|
1027
1281
|
if (message.files && fileMap) extendedMessage.files = message.files.map((file) => fileMap[file.file_id ?? ""] ?? file);
|
|
1028
1282
|
messageMap[message.messageId] = extendedMessage;
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1283
|
+
orderedMessages.push(extendedMessage);
|
|
1284
|
+
}
|
|
1285
|
+
for (const extendedMessage of orderedMessages) {
|
|
1286
|
+
const parentMessage = messageMap[extendedMessage.parentMessageId ?? ""];
|
|
1287
|
+
if (parentMessage && parentMessage !== extendedMessage) parentMessage.children.push(extendedMessage);
|
|
1288
|
+
else rootMessages.push(extendedMessage);
|
|
1289
|
+
}
|
|
1290
|
+
/** Depth comes from a roots-down walk (a child linked before its parent
|
|
1291
|
+
* can't inherit depth at link time). The `visited` set doubles as the
|
|
1292
|
+
* cycle guard: nodes on a corrupt parent cycle are unreachable from any
|
|
1293
|
+
* root, so they resurface as roots instead of disappearing. */
|
|
1294
|
+
const visited = /* @__PURE__ */ new Set();
|
|
1295
|
+
const assignDepths = (root) => {
|
|
1296
|
+
visited.add(root);
|
|
1297
|
+
const stack = [root];
|
|
1298
|
+
while (stack.length > 0) {
|
|
1299
|
+
const node = stack.pop();
|
|
1300
|
+
/** Every node has one parent, so this walk reaches each node once — an
|
|
1301
|
+
* already-visited child is a cycle back-edge. Sever it (not just skip
|
|
1302
|
+
* it) so consumers that recurse `children` terminate. */
|
|
1303
|
+
if (node.children.some((child) => visited.has(child))) node.children = node.children.filter((child) => !visited.has(child));
|
|
1304
|
+
for (const child of node.children) {
|
|
1305
|
+
child.depth = node.depth + 1;
|
|
1306
|
+
visited.add(child);
|
|
1307
|
+
stack.push(child);
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
};
|
|
1311
|
+
for (const root of rootMessages) assignDepths(root);
|
|
1312
|
+
for (const extendedMessage of orderedMessages) if (!visited.has(extendedMessage)) {
|
|
1313
|
+
rootMessages.push(extendedMessage);
|
|
1314
|
+
assignDepths(extendedMessage);
|
|
1315
|
+
}
|
|
1035
1316
|
return rootMessages;
|
|
1036
1317
|
}
|
|
1037
1318
|
//#endregion
|
|
@@ -4940,6 +5221,27 @@ function extractDomainFromUrl(url) {
|
|
|
4940
5221
|
throw new Error(`Invalid URL format: ${url}`);
|
|
4941
5222
|
}
|
|
4942
5223
|
}
|
|
5224
|
+
function getExplicitPort(value) {
|
|
5225
|
+
const normalizedValue = value.trim();
|
|
5226
|
+
const protocolSeparatorIndex = normalizedValue.indexOf("://");
|
|
5227
|
+
const hasProtocol = protocolSeparatorIndex !== -1;
|
|
5228
|
+
const authorityAndPath = hasProtocol ? normalizedValue.slice(protocolSeparatorIndex + 3) : normalizedValue;
|
|
5229
|
+
let port;
|
|
5230
|
+
try {
|
|
5231
|
+
const parsedUrl = new URL(hasProtocol ? normalizedValue : `https://${normalizedValue}`);
|
|
5232
|
+
port = parsedUrl.port;
|
|
5233
|
+
if (!port && (parsedUrl.protocol === "http:" || parsedUrl.protocol === "https:")) port = new URL(`${parsedUrl.protocol === "http:" ? "https:" : "http:"}//${authorityAndPath}`).port;
|
|
5234
|
+
} catch {
|
|
5235
|
+
return null;
|
|
5236
|
+
}
|
|
5237
|
+
if (!port) return null;
|
|
5238
|
+
const parsedPort = Number(port);
|
|
5239
|
+
if (!Number.isInteger(parsedPort) || parsedPort < 1 || parsedPort > 65535) throw new Error(`Invalid port in domain: ${value}`);
|
|
5240
|
+
return String(parsedPort);
|
|
5241
|
+
}
|
|
5242
|
+
function getDefaultActionPort(protocol) {
|
|
5243
|
+
return protocol === "https:" ? "443" : "80";
|
|
5244
|
+
}
|
|
4943
5245
|
/**
|
|
4944
5246
|
* Validates client domain matches OpenAPI spec server URL domain (SSRF prevention).
|
|
4945
5247
|
* @param clientProvidedDomain - Domain from client (with/without protocol)
|
|
@@ -4960,6 +5262,7 @@ function validateActionDomain(clientProvidedDomain, specServerUrl) {
|
|
|
4960
5262
|
/** Extract hostname from client domain if it's a full URL */
|
|
4961
5263
|
let clientHostname = clientProvidedDomain;
|
|
4962
5264
|
let clientHasProtocol = false;
|
|
5265
|
+
const clientExplicitPort = getExplicitPort(clientProvidedDomain);
|
|
4963
5266
|
if (clientProvidedDomain.includes("://")) {
|
|
4964
5267
|
if (!clientProvidedDomain.startsWith("http://") && !clientProvidedDomain.startsWith("https://")) return {
|
|
4965
5268
|
isValid: false,
|
|
@@ -4971,7 +5274,7 @@ function validateActionDomain(clientProvidedDomain, specServerUrl) {
|
|
|
4971
5274
|
} catch {
|
|
4972
5275
|
clientHasProtocol = false;
|
|
4973
5276
|
}
|
|
4974
|
-
}
|
|
5277
|
+
} else if (clientExplicitPort !== null) clientHostname = new URL(`https://${clientProvidedDomain}`).hostname;
|
|
4975
5278
|
/** Normalize IPv6 addresses by removing brackets for comparison */
|
|
4976
5279
|
const normalizedClientHostname = clientHostname.replace(/^\[(.+)\]$/, "$1");
|
|
4977
5280
|
const normalizedSpecHostname = specHostname.replace(/^\[(.+)\]$/, "$1");
|
|
@@ -4984,14 +5287,23 @@ function validateActionDomain(clientProvidedDomain, specServerUrl) {
|
|
|
4984
5287
|
const hostname = isIP(normalizedClientHostname) === 6 && !clientHostname.startsWith("[") ? `[${normalizedClientHostname}]` : clientHostname;
|
|
4985
5288
|
normalizedClientDomain = `${specUrl.protocol}//${hostname}`;
|
|
4986
5289
|
} else normalizedClientDomain = `https://${clientHostname}`;
|
|
4987
|
-
if (normalizedSpecDomain === normalizedClientDomain || !clientHasProtocol && isIPAddress && normalizedClientHostname === normalizedSpecHostname) return {
|
|
4988
|
-
isValid:
|
|
5290
|
+
if (!(normalizedSpecDomain === normalizedClientDomain || !clientHasProtocol && isIPAddress && normalizedClientHostname === normalizedSpecHostname)) return {
|
|
5291
|
+
isValid: false,
|
|
5292
|
+
message: `Domain mismatch: Client provided '${clientProvidedDomain}', but spec uses '${specHostname}'`,
|
|
4989
5293
|
normalizedSpecDomain,
|
|
4990
5294
|
normalizedClientDomain
|
|
4991
5295
|
};
|
|
5296
|
+
if (clientExplicitPort !== null) {
|
|
5297
|
+
const specEffectivePort = specUrl.port || getDefaultActionPort(specUrl.protocol);
|
|
5298
|
+
if (clientExplicitPort !== specEffectivePort) return {
|
|
5299
|
+
isValid: false,
|
|
5300
|
+
message: `Port mismatch: Client provided '${clientProvidedDomain}', but spec uses effective port '${specEffectivePort}'`,
|
|
5301
|
+
normalizedSpecDomain,
|
|
5302
|
+
normalizedClientDomain
|
|
5303
|
+
};
|
|
5304
|
+
}
|
|
4992
5305
|
return {
|
|
4993
|
-
isValid:
|
|
4994
|
-
message: `Domain mismatch: Client provided '${clientProvidedDomain}', but spec uses '${specHostname}'`,
|
|
5306
|
+
isValid: true,
|
|
4995
5307
|
normalizedSpecDomain,
|
|
4996
5308
|
normalizedClientDomain
|
|
4997
5309
|
};
|
|
@@ -5066,7 +5378,7 @@ function getUserTimezone() {
|
|
|
5066
5378
|
}
|
|
5067
5379
|
}
|
|
5068
5380
|
function createPayload(submission) {
|
|
5069
|
-
const { isEdited, addedConvo, userMessage, isContinued, isTemporary, isRegenerate, conversation, editedContent, ephemeralAgent, endpointOption, manualSkills } = submission;
|
|
5381
|
+
const { isEdited, addedConvo, userMessage, isContinued, isTemporary, isRegenerate, conversation, editedContent, ephemeralAgent, endpointOption, manualSkills, clientRequestId, recoverySteerId, expectedPredecessorCreatedAt } = submission;
|
|
5070
5382
|
const { conversationId } = tConvoUpdateSchema.parse(conversation);
|
|
5071
5383
|
const { endpoint: _e, endpointType } = endpointOption;
|
|
5072
5384
|
const endpoint = _e;
|
|
@@ -5084,7 +5396,10 @@ function createPayload(submission) {
|
|
|
5084
5396
|
isContinued: !!(isEdited && isContinued),
|
|
5085
5397
|
ephemeralAgent: isAssistantsEndpoint(endpoint) ? void 0 : ephemeralAgent,
|
|
5086
5398
|
manualSkills: isAssistantsEndpoint(endpoint) ? void 0 : manualSkills,
|
|
5087
|
-
timezone: getUserTimezone()
|
|
5399
|
+
timezone: getUserTimezone(),
|
|
5400
|
+
clientRequestId,
|
|
5401
|
+
recoverySteerId,
|
|
5402
|
+
expectedPredecessorCreatedAt
|
|
5088
5403
|
};
|
|
5089
5404
|
return {
|
|
5090
5405
|
server,
|
|
@@ -5191,7 +5506,7 @@ const librechat = {
|
|
|
5191
5506
|
labelCode: true,
|
|
5192
5507
|
type: "number",
|
|
5193
5508
|
component: "input",
|
|
5194
|
-
placeholder: "
|
|
5509
|
+
placeholder: "com_endpoint_default",
|
|
5195
5510
|
placeholderCode: true,
|
|
5196
5511
|
description: "com_endpoint_context_info",
|
|
5197
5512
|
descriptionCode: true,
|
|
@@ -5228,7 +5543,7 @@ const librechat = {
|
|
|
5228
5543
|
labelCode: true,
|
|
5229
5544
|
description: "com_ui_file_token_limit_desc",
|
|
5230
5545
|
descriptionCode: true,
|
|
5231
|
-
placeholder: "
|
|
5546
|
+
placeholder: "com_endpoint_default",
|
|
5232
5547
|
placeholderCode: true,
|
|
5233
5548
|
type: "number",
|
|
5234
5549
|
component: "input",
|
|
@@ -5300,7 +5615,7 @@ const openAIParams = {
|
|
|
5300
5615
|
component: "input",
|
|
5301
5616
|
description: "com_endpoint_openai_max_tokens",
|
|
5302
5617
|
descriptionCode: true,
|
|
5303
|
-
placeholder: "
|
|
5618
|
+
placeholder: "com_endpoint_default",
|
|
5304
5619
|
placeholderCode: true,
|
|
5305
5620
|
optionType: "model",
|
|
5306
5621
|
columnSpan: 2
|
|
@@ -5321,7 +5636,8 @@ const openAIParams = {
|
|
|
5321
5636
|
"low",
|
|
5322
5637
|
"medium",
|
|
5323
5638
|
"high",
|
|
5324
|
-
"xhigh"
|
|
5639
|
+
"xhigh",
|
|
5640
|
+
"max"
|
|
5325
5641
|
],
|
|
5326
5642
|
enumMappings: {
|
|
5327
5643
|
[""]: "com_ui_auto",
|
|
@@ -5330,7 +5646,8 @@ const openAIParams = {
|
|
|
5330
5646
|
["low"]: "com_ui_low",
|
|
5331
5647
|
["medium"]: "com_ui_medium",
|
|
5332
5648
|
["high"]: "com_ui_high",
|
|
5333
|
-
["xhigh"]: "com_ui_xhigh"
|
|
5649
|
+
["xhigh"]: "com_ui_xhigh",
|
|
5650
|
+
["max"]: "com_ui_max"
|
|
5334
5651
|
},
|
|
5335
5652
|
optionType: "model",
|
|
5336
5653
|
columnSpan: 4
|
|
@@ -5385,6 +5702,52 @@ const openAIParams = {
|
|
|
5385
5702
|
optionType: "model",
|
|
5386
5703
|
columnSpan: 4
|
|
5387
5704
|
},
|
|
5705
|
+
reasoning_mode: {
|
|
5706
|
+
key: "reasoning_mode",
|
|
5707
|
+
label: "com_endpoint_reasoning_mode",
|
|
5708
|
+
labelCode: true,
|
|
5709
|
+
description: "com_endpoint_openai_reasoning_mode",
|
|
5710
|
+
descriptionCode: true,
|
|
5711
|
+
type: "enum",
|
|
5712
|
+
default: "",
|
|
5713
|
+
component: "slider",
|
|
5714
|
+
options: [
|
|
5715
|
+
"",
|
|
5716
|
+
"standard",
|
|
5717
|
+
"pro"
|
|
5718
|
+
],
|
|
5719
|
+
enumMappings: {
|
|
5720
|
+
[""]: "com_ui_unset",
|
|
5721
|
+
["standard"]: "com_ui_standard",
|
|
5722
|
+
["pro"]: "com_ui_pro"
|
|
5723
|
+
},
|
|
5724
|
+
optionType: "model",
|
|
5725
|
+
columnSpan: 4
|
|
5726
|
+
},
|
|
5727
|
+
reasoning_context: {
|
|
5728
|
+
key: "reasoning_context",
|
|
5729
|
+
label: "com_endpoint_reasoning_context",
|
|
5730
|
+
labelCode: true,
|
|
5731
|
+
description: "com_endpoint_openai_reasoning_context",
|
|
5732
|
+
descriptionCode: true,
|
|
5733
|
+
type: "enum",
|
|
5734
|
+
default: "",
|
|
5735
|
+
component: "slider",
|
|
5736
|
+
options: [
|
|
5737
|
+
"",
|
|
5738
|
+
"auto",
|
|
5739
|
+
"current_turn",
|
|
5740
|
+
"all_turns"
|
|
5741
|
+
],
|
|
5742
|
+
enumMappings: {
|
|
5743
|
+
[""]: "com_ui_unset",
|
|
5744
|
+
["auto"]: "com_ui_auto",
|
|
5745
|
+
["current_turn"]: "com_ui_current_turn",
|
|
5746
|
+
["all_turns"]: "com_ui_all_turns"
|
|
5747
|
+
},
|
|
5748
|
+
optionType: "model",
|
|
5749
|
+
columnSpan: 4
|
|
5750
|
+
},
|
|
5388
5751
|
verbosity: {
|
|
5389
5752
|
key: "verbosity",
|
|
5390
5753
|
label: "com_endpoint_verbosity",
|
|
@@ -5432,7 +5795,7 @@ const anthropic = {
|
|
|
5432
5795
|
component: "input",
|
|
5433
5796
|
description: "com_endpoint_anthropic_maxoutputtokens",
|
|
5434
5797
|
descriptionCode: true,
|
|
5435
|
-
placeholder: "
|
|
5798
|
+
placeholder: "com_endpoint_default",
|
|
5436
5799
|
placeholderCode: true,
|
|
5437
5800
|
range: {
|
|
5438
5801
|
min: anthropicSettings.maxOutputTokens.min,
|
|
@@ -5620,7 +5983,7 @@ const bedrock = {
|
|
|
5620
5983
|
component: "input",
|
|
5621
5984
|
description: "com_endpoint_anthropic_maxoutputtokens",
|
|
5622
5985
|
descriptionCode: true,
|
|
5623
|
-
placeholder: "
|
|
5986
|
+
placeholder: "com_endpoint_default",
|
|
5624
5987
|
placeholderCode: true,
|
|
5625
5988
|
optionType: "model",
|
|
5626
5989
|
columnSpan: 2
|
|
@@ -5793,7 +6156,7 @@ const google = {
|
|
|
5793
6156
|
component: "input",
|
|
5794
6157
|
description: "com_endpoint_google_maxoutputtokens",
|
|
5795
6158
|
descriptionCode: true,
|
|
5796
|
-
placeholder: "
|
|
6159
|
+
placeholder: "com_endpoint_default",
|
|
5797
6160
|
placeholderCode: true,
|
|
5798
6161
|
default: googleSettings.maxOutputTokens.default,
|
|
5799
6162
|
range: {
|
|
@@ -5939,6 +6302,8 @@ const openAI = [
|
|
|
5939
6302
|
openAIParams.reasoning_effort,
|
|
5940
6303
|
openAIParams.useResponsesApi,
|
|
5941
6304
|
openAIParams.reasoning_summary,
|
|
6305
|
+
openAIParams.reasoning_mode,
|
|
6306
|
+
openAIParams.reasoning_context,
|
|
5942
6307
|
openAIParams.verbosity,
|
|
5943
6308
|
openAIParams.disableStreaming,
|
|
5944
6309
|
librechat.fileTokenLimit
|
|
@@ -5965,6 +6330,8 @@ const openAICol2 = [
|
|
|
5965
6330
|
baseDefinitions.imageDetail,
|
|
5966
6331
|
openAIParams.reasoning_effort,
|
|
5967
6332
|
openAIParams.reasoning_summary,
|
|
6333
|
+
openAIParams.reasoning_mode,
|
|
6334
|
+
openAIParams.reasoning_context,
|
|
5968
6335
|
openAIParams.verbosity,
|
|
5969
6336
|
openAIParams.useResponsesApi,
|
|
5970
6337
|
openAIParams.web_search,
|
|
@@ -6301,6 +6668,6 @@ const CODE_ENV_KINDS = [
|
|
|
6301
6668
|
"user"
|
|
6302
6669
|
];
|
|
6303
6670
|
//#endregion
|
|
6304
|
-
export { AccessRoleIds, ActionRequest, AgentCapabilities, AnnotationTypes, AnthropicEffort, ArtifactModes, AssistantStreamEvents, AuthKeys, AuthType, AuthTypeEnum, AuthorizationTypeEnum, BASE_ONLY_CONFIG_SECTIONS, BEDROCK_FINE_GRAINED_TOOL_STREAMING_BETA, BEDROCK_OUTPUT_128K_BETA, BedrockProviders, BedrockReasoningConfig, CODE_ENV_KINDS, CacheKeys, Capabilities, CohereConstants, ComponentTypes, Constants, ContentTypes, DATE_RANGE, DEFAULT_MEMORY_MAX_INPUT_TOKENS, DynamicQueryKeys, EImageOutputType, EModelEndpoint, EToolResources, EndpointURLs, ErrorTypes, FEEDBACK_RATINGS, FEEDBACK_REASON_KEYS, FEEDBACK_TAGS, FetchTokenConfig, FileContext, FilePurpose, FileSources, ForkOptions, FunctionSignature, INTERFACE_PERMISSION_FIELDS, ImageDetail, ImageDetailCost, ImageVisionTool, InfiniteCollections, InvocationMode, KnownEndpoints, LocalStorageKeys, MAX_SUBAGENTS, MAX_SUBAGENT_DEPTH, MAX_SUBAGENT_GRAPH_NODES, MAX_SUBAGENT_RUN_CONFIGS, MCPOptionsSchema, MCPServerUserInputSchema, MCPServersSchema, MCP_USER_INPUT_FIELDS, MYTHOS_CLASS_FAMILIES, MessageContentTypes, MutationKeys, OCRStrategy, OptionTypes, PERMISSION_SUB_KEYS, PERMISSION_TYPE_INTERFACE_FIELDS, PermissionBits, PermissionTypes, Permissions, PrincipalModel, PrincipalType, Providers, QueryKeys, REFILL_INTERVAL_UNITS, RateLimitPrefix, ReasoningEffort, ReasoningParameterFormat, ReasoningResponseKey, ReasoningSummary, RerankerTypes, ResourceType, RetentionMode, RunStatus, SEPARATORS, SKILL_BODY_MAX_LENGTH, SKILL_DESCRIPTION_MAX_LENGTH, SKILL_DESCRIPTION_SHORT_THRESHOLD, SKILL_DISPLAY_TITLE_MAX_LENGTH, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_SYNC_DEFAULT_DISCOVERY_DEPTH, SKILL_SYNC_MAX_DISCOVERY_DEPTH, SKILL_SYNC_MAX_INTERVAL_MINUTES, SKILL_SYNC_MIN_INTERVAL_MINUTES, SSEOptionsSchema, STTProviders, SafeSearchTypes, ScraperProviders, SearchCategories, SearchProviders, SettingTypes, SettingsTabValues, SettingsViews, StdioOptionsSchema, StepEvents, StepStatus, StepTypes, StreamableHTTPOptionsSchema, SystemCategories, SystemRoles, TTSProviders, ThinkingDisplay, ThinkingLevel, Time, TokenExchangeMethodEnum, ToolCallTypes, Tools, UsageEvents, Verbosity, ViolationTypes, VisionModes, WebSocketOptionsSchema, accessRoleSchema, accessRoleToPermBits, accordian, actionDelimiter, actionDomainSeparator, agentParamSettings, agentPermissionsSchema, agentsBaseSchema, agentsEndpointSchema, agentsSchema, agentsSettings, alert, alertDialog, allowedAddressesSchema, alternateName, anthropicBaseSchema, anthropicEndpointSchema, anthropicSchema, anthropicSettings, apiBaseUrl, appendAgentIdSuffix, applicationMimeTypes, applyModelAwareDefaults, assistantEndpointSchema, assistantSchema, audioMimeTypes, authTypeSchema, avatar, azureBaseSchema, azureEndpointSchema, azureGroupConfigsSchema, azureGroupSchema, badge, balanceSchema, baseEndpointSchema, bedrockDocumentExtensions, bedrockDocumentFormats, bedrockEndpointSchema, bedrockGuardrailConfigSchema, bedrockInputParser, bedrockInputSchema, bedrockModels, bedrockOutputParser, bookmarkPermissionsSchema, breadcrumb, buildLoginRedirectUrl, buildTree, button, cacheSubsetProviders, calendar, card, carousel, checkOpenAIStorage, checkbox, cloudfrontConfigSchema, codeInterpreterMimeTypes, codeInterpreterMimeTypesList, codeTypeMapping, coerceNumber, collapsible, compactAgentsBaseSchema, compactAgentsSchema, compactAssistantSchema, compactGoogleSchema, configSchema, contextPruningSchema, convertStringsToRegex, createPayload, createURL, data_service_exports as dataService, defaultAgentCapabilities, defaultAgentFormValues, defaultAssistantFormValues, defaultAssistantsVersion, defaultEndpoints, defaultModels, defaultOCRMimeTypes, defaultOrderQuery, defaultRetrievalModels, defaultSTTMimeTypes, defaultSocialLogins, defaultTextMimeTypes, dialog, documentParserMimeTypes, documentSupportedProviders, drawer, dropdownMenu, eAnthropicEffortSchema, eImageDetailSchema, eModelEndpointSchema, eReasoningEffortSchema, eReasoningParameterFormatSchema, eReasoningResponseKeySchema, eReasoningSummarySchema, eThinkingDisplaySchema, eThinkingLevelSchema, eVerbositySchema, effectivePermissionsResponseSchema, encodeEphemeralAgentId, endpointFileConfigSchema, endpointSchema, endpointSettings, envVarRegex, errorsToString, essentialShadcnComponents, excelFileTypes, excelMimeTypes, excludedKeys, extendedModelEndpointSchema, extractDomainFromUrl, extractEnvVariable, extractVariableName, feedbackRatingSchema, feedbackSchema, feedbackTagKeySchema, fileCitationsPermissionsSchema, fileConfig, fileConfigSchema, fileSearchPermissionsSchema, fileSourceSchema, fileStorageSchema, fileStrategiesSchema, findLastSeparatorIndex, fullMimeTypesList, generateDynamicSchema, generateGoogleSchema, generateOpenAISchema, getConfigDefaults, getDefaultParamsEndpoint, getEnabledEndpoints, getEndpointField, getEndpointFileConfig, getFirstDefinedValue, getModelKey, getNonEmptyValue, getRefillEligibilityDate, getResourcePermissionsResponseSchema, getResponseSender, getSchemaDefaults, getSettingsKeys, getTagByKey, getTagsForRating, getTokenHeader, googleBaseSchema, googleGenConfigSchema, googleSchema, googleSettings, hasPermissions, hostImageIdSuffix, hostImageNamePrefix, hoverCard, imageDetailNumeric, imageDetailValue, imageExtRegex, imageGenTools, imageMimeTypes, imageTypeMapping, inferMimeType, initialModelsConfig, input, inputTokensIncludesCache, interfaceSchema, isActionTool, isAgentsEndpoint, isAssistantsEndpoint, isBedrockDocumentType, isDocumentSupportedProvider, isEphemeralAgentId, isImageVisionTool, isMythosClassModel, isOpenAILikeProvider, isParamEndpoint, isPermissiveMimeConfig, isRemoteOidcUrlAllowed, isSensitiveEnvVar, isSystemRoleName, isUUID, label, librechat, loginPage, mapGroupToAzureConfig, mapModelToAzureConfig, marketplacePermissionsSchema, mbToBytes, mcpServersPermissionsSchema, megabyte, memoryPermissionsSchema, memorySchema, menuBar, mergeFileConfig, messageFilterPiiSchema, messageFilterSchema, mimeTypeAliases, modelConfigSchema, modelSpecSubagentsSchema, modularEndpoints, multiConvoPermissionsSchema, navigationMenu, normalizeEndpointName, ocrSchema, omitsSamplingParameters, omitsThinkingByDefault, openAIBaseSchema, openAISchema, openAISettings, openRouterSchema, openapiToFunction, orderEndpointsConfig, pagination, paramDefinitionSchema, paramEndpoints, paramSettings, parseCompactConvo, parseConvo, parseEphemeralAgentId, parseTextParts, peoplePickerPermissionsSchema, permBitsToAccessLevel, permissionEntrySchema, permissionsSchema, popover, presetSettings, principalSchema, progress, promptPermissionsSchema, promptTokensFromUsage, providerEndpointMap, radioGroup, rateLimitSchema, reconcileContextUsage, registerPage, remoteAgentsPermissionsSchema, removeNullishValues, replaceSpecialVars, request_default as request, resolveEndpointType, resolveRef, resolveThinkingDisplay, resourcePermissionsResponseSchema, retrievalMimeTypes, retrievalMimeTypesList, roleDefaults, roleSchema, runCodePermissionsSchema, select, separator, setAcceptLanguageHeader, setTokenHeader, sha1, shadcnComponents, sharedFileDownload, sharedLinksPermissionsSchema, skeleton, skillPermissionsSchema, skillSyncConfigSchema, skillSyncGitHubSourceSchema, slider, specialVariables, specsConfigSchema, stripAgentIdSuffix, summarizationConfigSchema, summarizationTriggerSchema, supportedMimeTypes, supportsAdaptiveThinking, supportsBalanceCheck, supportsContext1m, supportsFiles, switchComponent, tBannerSchema, tConversationSchema, tConversationTagSchema, tConvoUpdateSchema, tExampleSchema, tMessageSchema, tModelSpecPresetSchema, tModelSpecSchema, tPluginAuthConfigSchema, tPluginSchema, tPresetSchema, tQueryParamsSchema, tSharedLinkSchema, table, tabs, temporaryChatPermissionsSchema, textMimeTypes, textarea, toMinimalFeedback, toast, toaster, toggle, toggleGroup, tooltip, transactionsSchema, turnstileOptionsSchema, turnstileSchema, updateResourcePermissionsRequestSchema, updateResourcePermissionsResponseSchema, useToast, utils, validateActionDomain, validateAndParseOpenAPISpec, validateAzureGroups, validateSettingDefinitions, validateVisionModel, vertexAISchema, vertexModelConfigSchema, videoMimeTypes, visionModels, webSearchPermissionsSchema, webSearchSchema };
|
|
6671
|
+
export { AUTH_USER_DOC_BY_ID_PREFIX, AccessRoleIds, ActionRequest, ActivityLabelEvents, AgentCapabilities, AnnotationTypes, AnthropicEffort, ApprovalEvents, ArtifactModes, AssistantStreamEvents, AuthKeys, AuthType, AuthTypeEnum, AuthorizationTypeEnum, BASE_ONLY_CONFIG_SECTIONS, BASE_PRINCIPAL_CONFIG_SECTIONS, BEDROCK_FINE_GRAINED_TOOL_STREAMING_BETA, BEDROCK_OUTPUT_128K_BETA, BedrockProviders, BedrockReasoningConfig, CODE_ENV_KINDS, CacheKeys, Capabilities, CohereConstants, ComponentTypes, Constants, ContentTypes, DATE_RANGE, DEFAULT_MEMORY_MAX_INPUT_TOKENS, DynamicQueryKeys, EImageOutputType, EModelEndpoint, EToolResources, EndpointURLs, ErrorTypes, FEEDBACK_RATINGS, FEEDBACK_REASON_KEYS, FEEDBACK_TAGS, FetchTokenConfig, FileContext, FilePurpose, FileSources, ForkOptions, FunctionSignature, INTERFACE_PERMISSION_FIELDS, ImageDetail, ImageDetailCost, ImageVisionTool, InfiniteCollections, InvocationMode, KnownEndpoints, LocalStorageKeys, MAX_SUBAGENTS, MAX_SUBAGENT_DEPTH, MAX_SUBAGENT_GRAPH_NODES, MAX_SUBAGENT_RUN_CONFIGS, MCPOptionsSchema, MCPServerUserInputSchema, MCPServersSchema, MCP_USER_INPUT_FIELDS, MYTHOS_CLASS_FAMILIES, MemoryScope, MessageContentTypes, MutationKeys, OCRStrategy, OptionTypes, PERMISSION_SUB_KEYS, PERMISSION_TYPE_INTERFACE_FIELDS, PermissionBits, PermissionTypes, Permissions, PrincipalModel, PrincipalType, Providers, QueryKeys, REFILL_INTERVAL_UNITS, RateLimitPrefix, ReasoningContext, ReasoningEffort, ReasoningMode, ReasoningParameterFormat, ReasoningResponseKey, ReasoningSummary, RerankerTypes, ResourceType, RetentionMode, RunStatus, SEPARATORS, SKILL_BODY_MAX_LENGTH, SKILL_DESCRIPTION_MAX_LENGTH, SKILL_DESCRIPTION_SHORT_THRESHOLD, SKILL_DISPLAY_TITLE_MAX_LENGTH, SKILL_NAME_MAX_LENGTH, SKILL_NAME_PATTERN, SKILL_SYNC_DEFAULT_DISCOVERY_DEPTH, SKILL_SYNC_MAX_DISCOVERY_DEPTH, SKILL_SYNC_MAX_INTERVAL_MINUTES, SKILL_SYNC_MIN_INTERVAL_MINUTES, SSEOptionsSchema, STTProviders, SafeSearchTypes, ScraperProviders, SearchCategories, SearchProviders, SettingTypes, SettingsTabValues, SettingsViews, StdioOptionsSchema, SteerEvents, StepEvents, StepStatus, StepTypes, StreamableHTTPOptionsSchema, SystemCategories, SystemRoles, TTSProviders, ThinkingDisplay, ThinkingLevel, Time, TokenExchangeMethodEnum, ToolCallTypes, Tools, UsageEvents, Verbosity, ViolationTypes, VisionModes, WebSocketOptionsSchema, accessRoleSchema, accessRoleToPermBits, accordian, actionDelimiter, actionDomainSeparator, agentParamSettings, agentPermissionsSchema, agentsBaseSchema, agentsEndpointSchema, agentsSchema, agentsSettings, alert, alertDialog, allowedAddressesSchema, alternateName, anthropicBaseSchema, anthropicEndpointSchema, anthropicSchema, anthropicSettings, apiBaseUrl, appendAgentIdSuffix, applicationMimeTypes, applyModelAwareDefaults, assistantEndpointSchema, assistantSchema, audioMimeTypes, authTypeSchema, avatar, azureBaseSchema, azureEndpointSchema, azureGroupConfigsSchema, azureGroupSchema, badge, balanceSchema, baseEndpointSchema, bedrockDocumentExtensions, bedrockDocumentFormats, bedrockDocumentMimeTypes, bedrockEndpointSchema, bedrockGuardrailConfigSchema, bedrockInputParser, bedrockInputSchema, bedrockModels, bedrockOutputParser, bookmarkPermissionsSchema, breadcrumb, buildLoginRedirectUrl, buildServerNameAliases, buildTree, button, cacheSubsetProviders, calendar, capsEffortWhenThinkingDisabled, card, carousel, checkOpenAIStorage, checkbox, checkpointerSchema, checkpointerTypeSchema, clampEffortForDisabledThinking, clampOutputConfigEffort, cloudfrontConfigSchema, codeInterpreterMimeTypes, codeInterpreterMimeTypesList, codeTypeMapping, coerceNumber, collapsible, compactAgentsBaseSchema, compactAgentsSchema, compactAssistantSchema, compactGoogleSchema, configSchema, contextPruningSchema, convertStringsToRegex, createPayload, createURL, data_service_exports as dataService, defaultAgentCapabilities, defaultAgentFormValues, defaultAssistantFormValues, defaultAssistantsVersion, defaultEndpoints, defaultModels, defaultOCRMimeTypes, defaultOrderQuery, defaultRetrievalModels, defaultSTTMimeTypes, defaultSocialLogins, defaultTextMimeTypes, dialog, documentParserMimeTypes, documentSupportedProviders, drawer, dropdownMenu, eAnthropicEffortSchema, eImageDetailSchema, eModelEndpointSchema, eReasoningContextSchema, eReasoningEffortSchema, eReasoningModeSchema, eReasoningParameterFormatSchema, eReasoningResponseKeySchema, eReasoningSummarySchema, eThinkingDisplaySchema, eThinkingLevelSchema, eVerbositySchema, effectivePermissionsResponseSchema, encodeEphemeralAgentId, endpointFileConfigSchema, endpointSchema, endpointSettings, envVarRegex, errorsToString, essentialShadcnComponents, excelFileTypes, excelMimeTypes, excludedKeys, extendedModelEndpointSchema, extractDomainFromUrl, extractEnvVariable, extractVariableName, feedbackRatingSchema, feedbackSchema, feedbackTagKeySchema, fileCitationsPermissionsSchema, fileConfig, fileConfigSchema, fileSearchPermissionsSchema, fileSourceSchema, fileStorageSchema, fileStrategiesSchema, findLastSeparatorIndex, fullMimeTypesList, generateDynamicSchema, generateGoogleSchema, generateOpenAISchema, getConfigDefaults, getConfiguredMimeAccept, getDefaultParamsEndpoint, getEnabledEndpoints, getEndpointField, getEndpointFileConfig, getFirstDefinedValue, getModelKey, getNonEmptyValue, getRefillEligibilityDate, getResourcePermissionsResponseSchema, getResponseSender, getSchemaDefaults, getSettingsKeys, getTagByKey, getTagsForRating, getTokenHeader, googleBaseSchema, googleGenConfigSchema, googleSchema, googleSettings, hasPermissions, hostImageIdSuffix, hostImageNamePrefix, hoverCard, imageDetailNumeric, imageDetailValue, imageExtRegex, imageGenTools, imageMimeTypes, imageTypeMapping, inferMimeType, initialModelsConfig, input, inputTokensIncludesCache, interfaceSchema, isActionTool, isAgentsEndpoint, isAnthropicDocumentType, isAnthropicTextDocumentType, isAssistantsEndpoint, isBedrockDocumentType, isDocumentSupportedProvider, isEphemeralAgentId, isImageVisionTool, isMythosClassModel, isOpenAILikeProvider, isParamEndpoint, isPermissiveMimeConfig, isRemoteOidcUrlAllowed, isSensitiveEnvVar, isSystemRoleName, isThinkingDisabled, isUUID, label, langfuseConfigSchema, librechat, loginPage, mapGroupToAzureConfig, mapModelToAzureConfig, marketplacePermissionsSchema, mbToBytes, mcpServersPermissionsSchema, megabyte, memoryPermissionsSchema, memorySchema, menuBar, mergeFileConfig, messageFilterPiiSchema, messageFilterSchema, mimeTypeAliases, modelConfigSchema, modelSpecSubagentsSchema, modularEndpoints, multiConvoPermissionsSchema, navigationMenu, normalizeEndpointName, normalizeMCPToolKey, normalizeServerName, ocrSchema, omitsSamplingParameters, omitsThinkingByDefault, openAIBaseSchema, openAISchema, openAISettings, openRouterSchema, openapiToFunction, orderEndpointsConfig, pagination, paramDefinitionSchema, paramEndpoints, paramSettings, parseCompactConvo, parseConvo, parseEphemeralAgentId, parseTextParts, peoplePickerPermissionsSchema, permBitsToAccessLevel, permissionEntrySchema, permissionsSchema, popover, presetSettings, principalSchema, progress, promptPermissionsSchema, promptTokensFromUsage, providerEndpointMap, radioGroup, rateLimitSchema, reconcileContextUsage, registerPage, remoteAgentsPermissionsSchema, removeNullishValues, replaceSpecialVars, request_default as request, requiresExplicitThinkingDisabled, resolveEndpointType, resolveRef, resolveThinkingDisplay, resourcePermissionsResponseSchema, retainRecentConfigSchema, retrievalMimeTypes, retrievalMimeTypesList, roleDefaults, roleSchema, runCodePermissionsSchema, select, separator, setAcceptLanguageHeader, setFileConfigRegexCompiler, setMessageFilterRegexValidator, setTokenHeader, sha1, shadcnComponents, sharedFileDownload, sharedLinksPermissionsSchema, skeleton, skillPermissionsSchema, skillSyncConfigSchema, skillSyncGitHubSourceSchema, slider, specialVariables, specsConfigSchema, splitMCPToolKey, splitToolCallName, stripAgentIdSuffix, summarizationConfigSchema, summarizationTriggerSchema, supportedMimeTypes, supportsAdaptiveThinking, supportsBalanceCheck, supportsContext1m, supportsFiles, switchComponent, tBannerSchema, tConversationSchema, tConversationTagSchema, tConvoUpdateSchema, tExampleSchema, tMessageSchema, tModelSpecPresetSchema, tModelSpecSchema, tPluginAuthConfigSchema, tPluginSchema, tPresetSchema, tQueryParamsSchema, tSharedLinkSchema, table, tabs, temporaryChatPermissionsSchema, textMimeTypes, textarea, toMinimalFeedback, toast, toaster, toggle, toggleGroup, toolApprovalHookConfigSchema, toolApprovalModeSchema, toolApprovalPolicySchema, tooltip, transactionsSchema, turnstileOptionsSchema, turnstileSchema, updateResourcePermissionsRequestSchema, updateResourcePermissionsResponseSchema, useToast, utils, validateActionDomain, validateAndParseOpenAPISpec, validateAzureGroups, validateSettingDefinitions, validateVisionModel, vertexAISchema, vertexModelConfigSchema, videoMimeTypes, visionModels, webSearchPermissionsSchema, webSearchSchema };
|
|
6305
6672
|
|
|
6306
6673
|
//# sourceMappingURL=index.mjs.map
|