librechat-data-provider 0.8.509 → 0.8.522

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.
Files changed (61) hide show
  1. package/dist/{data-service-BsdHkdKS.mjs → data-service-CaB7saTP.mjs} +2175 -113
  2. package/dist/data-service-CaB7saTP.mjs.map +1 -0
  3. package/dist/{data-service-XTxx76uB.js → data-service-D5kHzBt-.js} +2806 -150
  4. package/dist/data-service-D5kHzBt-.js.map +1 -0
  5. package/dist/index.js +1403 -92
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +1248 -93
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/react-query/index.js +2 -1
  10. package/dist/react-query/index.js.map +1 -1
  11. package/dist/react-query/index.mjs +2 -1
  12. package/dist/react-query/index.mjs.map +1 -1
  13. package/dist/types/accessPermissions.d.ts +4 -0
  14. package/dist/types/actions.d.ts +3 -3
  15. package/dist/types/agentToolOptions.d.ts +11 -0
  16. package/dist/types/api-endpoints.d.ts +28 -2
  17. package/dist/types/bedrock.d.ts +220 -0
  18. package/dist/types/cadence.d.ts +33 -0
  19. package/dist/types/codeEnvRef.d.ts +21 -0
  20. package/dist/types/config.d.ts +13457 -1573
  21. package/dist/types/data-service.d.ts +65 -14
  22. package/dist/types/feedback.d.ts +9 -1
  23. package/dist/types/file-config.d.ts +42 -5
  24. package/dist/types/filters.d.ts +1422 -0
  25. package/dist/types/generate.d.ts +85 -1
  26. package/dist/types/index.d.ts +10 -0
  27. package/dist/types/keys.d.ts +29 -4
  28. package/dist/types/langchain.d.ts +4 -0
  29. package/dist/types/limits.d.ts +13 -0
  30. package/dist/types/mcp.d.ts +338 -228
  31. package/dist/types/messages.d.ts +13 -0
  32. package/dist/types/models.d.ts +840 -68
  33. package/dist/types/parameterSettings.d.ts +7 -3
  34. package/dist/types/parsers.d.ts +13 -1
  35. package/dist/types/permissions.d.ts +42 -1
  36. package/dist/types/providers.d.ts +36 -0
  37. package/dist/types/react-query/react-query-service.d.ts +2 -7
  38. package/dist/types/request.d.ts +4 -2
  39. package/dist/types/roles.d.ts +34 -0
  40. package/dist/types/runSteps.d.ts +59 -0
  41. package/dist/types/schemas.d.ts +1358 -34
  42. package/dist/types/stateful-code.d.ts +7 -0
  43. package/dist/types/types/agents.d.ts +303 -8
  44. package/dist/types/types/assistants.d.ts +170 -7
  45. package/dist/types/types/files.d.ts +29 -8
  46. package/dist/types/types/index.d.ts +2 -0
  47. package/dist/types/types/insights.d.ts +62 -0
  48. package/dist/types/types/mcpServers.d.ts +25 -0
  49. package/dist/types/types/mutations.d.ts +2 -0
  50. package/dist/types/types/queries.d.ts +47 -5
  51. package/dist/types/types/queuedTurns.d.ts +870 -0
  52. package/dist/types/types/runs.d.ts +206 -26
  53. package/dist/types/types/schedules.d.ts +306 -0
  54. package/dist/types/types/skills.d.ts +34 -6
  55. package/dist/types/types/subagents.d.ts +159 -0
  56. package/dist/types/types/web.d.ts +12 -2
  57. package/dist/types/types.d.ts +175 -2
  58. package/dist/types/upload.d.ts +2 -0
  59. package/package.json +7 -5
  60. package/dist/data-service-BsdHkdKS.mjs.map +0 -1
  61. package/dist/data-service-XTxx76uB.js.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,17 +1,21 @@
1
- import { $ as permissionEntrySchema, $a as feedbackSchema, $i as extendedModelEndpointSchema, $n as MCP_USER_INPUT_FIELDS, $r as specsConfigSchema, $t as balanceSchema, Aa as tPluginAuthConfigSchema, Ai as anthropicSettings, An as modularEndpoints, Ar as fileConfig, At as SKILL_SYNC_MAX_INTERVAL_MINUTES, B as MutationKeys, Ba as RunStatus, Bi as defaultAssistantFormValues, Bn as summarizationTriggerSchema, Br as mbToBytes, Bt as TTSProviders, Ca as tBannerSchema, Ci as ThinkingLevel, Cn as initialModelsConfig, Cr as defaultOCRMimeTypes, Ct as MAX_SUBAGENT_RUN_CONFIGS, Da as tExampleSchema, Di as agentsSettings, Dn as messageFilterPiiSchema, Dr as endpointFileConfigSchema, Dt as RetentionMode, Ea as tConvoUpdateSchema, Ei as agentsSchema, En as memorySchema, Er as documentParserMimeTypes, Et as RerankerTypes, F as request_default, Fa as AnnotationTypes, Fi as compactAgentsBaseSchema, Fn as resolveEndpointType, Fr as imageMimeTypes, Ft as SearchCategories, G as PrincipalType, Ga as defaultOrderQuery, Gi as eReasoningEffortSchema, Gn as validateVisionModel, Gr as retrievalMimeTypesList, Gt as allowedAddressesSchema, H as AccessRoleIds, Ha as Tools, Hi as eAnthropicEffortSchema, Hn as transactionsSchema, Hr as mergeFileConfig, Ht as ViolationTypes, I as getTokenHeader, Ia as AssistantStreamEvents, Ii as compactAgentsSchema, In as skillSyncConfigSchema, Ir as imageTypeMapping, It as SearchProviders, J as accessRoleToPermBits, Ja as isActionTool, Ji as eReasoningSummarySchema, Jn as visionModels, Jr as textMimeTypes, Jt as assistantEndpointSchema, K as ResourceType, Ka as hostImageIdSuffix, Ki as eReasoningParameterFormatSchema, Kn as vertexAISchema, Kr as supportedMimeTypes, Kt as alternateName, L as setAcceptLanguageHeader, La as EToolResources, Li as compactAssistantSchema, Ln as skillSyncGitHubSourceSchema, Lr as inferMimeType, Lt as SettingsTabValues, Ma as tPresetSchema, Mi as authTypeSchema, Mn as paramDefinitionSchema, Mr as fullMimeTypesList, Mt as STTProviders, Na as tQueryParamsSchema, Ni as cacheSubsetProviders, Nn as providerEndpointMap, Nr as getEndpointFileConfig, Nt as SafeSearchTypes, Oa as tMessageSchema, Oi as anthropicBaseSchema, On as messageFilterSchema, Or as excelFileTypes, Ot as SKILL_SYNC_DEFAULT_DISCOVERY_DEPTH, Pa as tSharedLinkSchema, Pi as coerceNumber, Pn as rateLimitSchema, Pr as imageExtRegex, Pt as ScraperProviders, Q as permBitsToAccessLevel, Qa as feedbackRatingSchema, Qi as endpointSettings, Qn as MCPServersSchema, Qr as modelSpecSubagentsSchema, Qt as azureGroupSchema, R as setTokenHeader, Ra as FilePurpose, Ri as compactGoogleSchema, Rn as specialVariables, Rr as isBedrockDocumentType, Rt as SettingsViews, Sa as removeNullishValues, Si as ThinkingDisplay, Sn as imageGenTools, Sr as convertStringsToRegex, St as MAX_SUBAGENT_GRAPH_NODES, Ta as tConversationTagSchema, Ti as agentsBaseSchema, Tn as isRemoteOidcUrlAllowed, Tr as defaultTextMimeTypes, Tt as RateLimitPrefix, U as PermissionBits, Ua as actionDelimiter, Ui as eImageDetailSchema, Un as turnstileOptionsSchema, Ur as mimeTypeAliases, Ut as VisionModes, V as QueryKeys, Va as StepStatus, Vi as documentSupportedProviders, Vn as supportsBalanceCheck, Vr as megabyte, Vt as Time, W as PrincipalModel, Wa as actionDomainSeparator, Wi as eModelEndpointSchema, Wn as turnstileSchema, Wr as retrievalMimeTypes, Wt as agentsEndpointSchema, X as getResourcePermissionsResponseSchema, Xa as FEEDBACK_REASON_KEYS, Xi as eThinkingLevelSchema, Xn as MCPOptionsSchema, Xr as REFILL_INTERVAL_UNITS, Xt as azureEndpointSchema, Y as effectivePermissionsResponseSchema, Ya as FEEDBACK_RATINGS, Yi as eThinkingDisplaySchema, Yn as webSearchSchema, Yr as videoMimeTypes, Yt as azureBaseSchema, Z as hasPermissions, Za as FEEDBACK_TAGS, Zi as eVerbositySchema, Zn as MCPServerUserInputSchema, Zr as getRefillEligibilityDate, Zt as azureGroupConfigsSchema, _a as openAIBaseSchema, _i as Providers, _n as fileStrategiesSchema, _r as bedrockDocumentExtensions, _t as ImageDetailCost, a as data_service_exports, aa as googleSettings, ai as generateDynamicSchema, an as configSchema, ao as extractEnvVariable, ar as AuthorizationTypeEnum, at as AuthKeys, ba as openRouterSchema, bi as ReasoningResponseKey, bn as getEndpointField, br as codeInterpreterMimeTypesList, bt as LocalStorageKeys, ca as inputTokensIncludesCache, ci as validateSettingDefinitions, cn as defaultAssistantsVersion, co as normalizeEndpointName, cr as FileSources, ct as Capabilities, da as isDocumentSupportedProvider, di as BedrockProviders, dn as defaultRetrievalModels, dr as buildLoginRedirectUrl, dt as DEFAULT_MEMORY_MAX_INPUT_TOKENS, ea as getModelKey, ei as tModelSpecSchema, en as baseEndpointSchema, eo as feedbackTagKeySchema, er as SSEOptionsSchema, et as principalSchema, fa as isImageVisionTool, fi as BedrockReasoningConfig, fn as defaultSocialLogins, fr as loginPage, ft as EImageOutputType, ga as isUUID, gi as MYTHOS_CLASS_FAMILIES, gn as fileStorageSchema, gr as audioMimeTypes, gt as ForkOptions, ha as isParamEndpoint, hi as ImageVisionTool, hn as fileSourceSchema, hr as applicationMimeTypes, ht as FetchTokenConfig, ia as googleSchema, ii as SettingTypes, in as cloudfrontConfigSchema, io as envVarRegex, ir as AuthTypeEnum, it as AgentCapabilities, ja as tPluginSchema, ji as assistantSchema, jn as ocrSchema, jr as fileConfigSchema, jt as SKILL_SYNC_MIN_INTERVAL_MINUTES, ka as tModelSpecPresetSchema, ki as anthropicSchema, kn as modelConfigSchema, kr as excelMimeTypes, kt as SKILL_SYNC_MAX_DISCOVERY_DEPTH, la as isAgentsEndpoint, li as AnthropicEffort, ln as defaultEndpoints, lr as checkOpenAIStorage, lt as CohereConstants, ma as isOpenAILikeProvider, mi as ImageDetail, mn as excludedKeys, mr as sharedFileDownload, mt as ErrorTypes, na as googleBaseSchema, ni as ComponentTypes, nn as bedrockGuardrailConfigSchema, no as getTagsForRating, nr as StreamableHTTPOptionsSchema, nt as updateResourcePermissionsRequestSchema, oa as imageDetailNumeric, oi as generateGoogleSchema, on as contextPruningSchema, oo as extractVariableName, or as TokenExchangeMethodEnum, ot as BASE_ONLY_CONFIG_SECTIONS, pa as isMythosClassModel, pi as EModelEndpoint, pn as endpointSchema, pr as registerPage, pt as EndpointURLs, q as accessRoleSchema, qa as hostImageNamePrefix, qi as eReasoningResponseKeySchema, qn as vertexModelConfigSchema, qr as supportsFiles, qt as anthropicEndpointSchema, ra as googleGenConfigSchema, ri as OptionTypes, rn as bedrockModels, ro as toMinimalFeedback, rr as WebSocketOptionsSchema, rt as updateResourcePermissionsResponseSchema, sa as imageDetailValue, si as generateOpenAISchema, sn as defaultAgentCapabilities, so as isSensitiveEnvVar, sr as FileContext, st as CacheKeys, ta as getSettingsKeys, ti as MAX_SUBAGENTS, tn as bedrockEndpointSchema, to as getTagByKey, tr as StdioOptionsSchema, tt as resourcePermissionsResponseSchema, ua as isAssistantsEndpoint, ui as AuthType, un as defaultModels, ur as apiBaseUrl, ut as Constants, va as openAISchema, vi as ReasoningEffort, vn as getConfigDefaults, vr as bedrockDocumentFormats, vt as InfiniteCollections, wa as tConversationSchema, wi as Verbosity, wn as interfaceSchema, wr as defaultSTTMimeTypes, wt as OCRStrategy, xa as paramEndpoints, xi as ReasoningSummary, xn as getSchemaDefaults, xr as codeTypeMapping, xt as MAX_SUBAGENT_DEPTH, ya as openAISettings, yi as ReasoningParameterFormat, yn as getDefaultParamsEndpoint, yr as codeInterpreterMimeTypes, yt as KnownEndpoints, z as DynamicQueryKeys, za as MessageContentTypes, zi as defaultAgentFormValues, zn as summarizationConfigSchema, zr as isPermissiveMimeConfig, zt as SystemCategories } from "./data-service-BsdHkdKS.mjs";
1
+ import { $ as permissionEntrySchema, $a as googleSchema, $i as BedrockReasoningConfig, $n as specialVariables, $o as feedbackSchema, $r as defaultTextMimeTypes, $s as normalizeEndpointName, $t as azureGroupConfigsSchema, Aa as defaultAgentFormValues, Ai as materializeModelSpecEndpoints, An as imageGenTools, Ao as tQueryParamsSchema, Ar as isProcessMCPServerField, As as feedbackFilterFieldSchema, At as SKILL_SYNC_DEFAULT_DISCOVERY_DEPTH, B as MutationKeys, Ba as eReasoningResponseKeySchema, Bi as getMaxSubagents, Bn as modularEndpoints, Bo as actionDelimiter, Br as registerPage, Bs as hasActivePiiPatterns, Bt as SettingsViews, Ca as authTypeSchema, Ci as setFileConfigRegexCompiler, Cn as fileSourceSchema, Co as tConvoUpdateSchema, Cr as MCP_USER_INPUT_FIELDS, Cs as SKILL_FILTER_FIELDS, Ct as MAX_SUBAGENT_DEPTH, Da as compactAgentsSchema, Di as videoMimeTypes, Dn as getDefaultParamsEndpoint, Do as tPluginAuthConfigSchema, Dr as WebSocketOptionsSchema, Ds as agentInstructionFilterFieldSchema, Dt as RateLimitPrefix, Ea as compactAgentsBaseSchema, Ei as textMimeTypes, En as getConfigDefaults, Eo as tModelSpecPresetSchema, Er as StreamableHTTPOptionsSchema, Es as actionMetadataFilterFieldSchema, Et as OCRStrategy, F as request_default, Fa as eModelEndpointSchema, Fi as MAX_CHAT_PROJECT_DESCRIPTION_LENGTH, Fn as langfuseConfigSchema, Fo as FilePurpose, Fr as FileSources, Fs as filterPiiStarterPatternSchema, Ft as SafeSearchTypes, G as PrincipalType, Ga as endpointSettings, Gi as clampSettingRange, Gn as paramDefinitionSchema, Go as isActionTool, Gr as bedrockDocumentFormats, Gs as skillFilterFieldSchema, Gt as VisionModes, H as AccessRoleIds, Ha as eThinkingDisplaySchema, Hi as ComponentTypes, Hn as normalizeSearxngEngines, Ho as defaultOrderQuery, Hr as applicationMimeTypes, Hs as messageFilterFieldSchema, Ht as TTSProviders, I as getTokenHeader, Ia as eReasoningContextSchema, Ii as MAX_CHAT_PROJECT_NAME_LENGTH, In as memorySchema, Io as MessageContentTypes, Ir as checkOpenAIStorage, Is as filtersConfigSchema, It as ScraperProviders, J as accessRoleToPermBits, Ja as getGoogleThinkingBudgetMax, Ji as generateOpenAISchema, Jn as resolveEndpointType, Jo as resolveStatefulCodeEnvironment, Jr as codeInterpreterMimeTypesList, Js as userSubmittedMessageFieldPathSchema, Jt as alternateName, K as ResourceType, Ka as extendedModelEndpointSchema, Ki as generateDynamicSchema, Kn as providerEndpointMap, Ko as STATEFUL_CODE_ENVIRONMENTS, Kr as bedrockDocumentMimeTypes, Ks as toolArgumentFilterFieldSchema, Kt as agentsEndpointSchema, L as setAcceptLanguageHeader, La as eReasoningEffortSchema, Li as MAX_GRAPH_SUBAGENT_MEMBERS, Ln as messageFilterPiiSchema, Lo as RunStatus, Lr as apiBaseUrl, Ls as getPiiRegexProgramSize, Lt as SearchCategories, Ma as documentSupportedProviders, Mi as resolveModelSpecEndpoint, Mn as interfaceSchema, Mo as AnnotationTypes, Mr as AuthorizationTypeEnum, Ms as filterPiiActionSchema, Mt as SKILL_SYNC_MAX_INTERVAL_MINUTES, Na as eAnthropicEffortSchema, Ni as specsConfigSchema, Nn as isRemoteOidcUrlAllowed, No as AssistantStreamEvents, Nr as TokenExchangeMethodEnum, Ns as filterPiiCustomPatternSchema, Nt as SKILL_SYNC_MIN_INTERVAL_MINUTES, Oa as compactAssistantSchema, Oi as REFILL_INTERVAL_UNITS, On as getEndpointField, Oo as tPluginSchema, Or as hasProcessMCPServerConfig, Os as conversationStarterFilterFieldSchema, Ot as RerankerTypes, Pa as eImageDetailSchema, Pi as tModelSpecSchema, Pn as isSecureCodeEnvironmentControlURL, Po as EToolResources, Pr as FileContext, Ps as filterPiiRegexSchema, Pt as STTProviders, Q as permBitsToAccessLevel, Qa as googleGenConfigSchema, Qi as BedrockProviders, Qn as skillSyncGitHubSourceSchema, Qo as feedbackRatingSchema, Qr as defaultSTTMimeTypes, Qs as isSensitiveEnvVar, Qt as azureEndpointSchema, R as setTokenHeader, Ra as eReasoningModeSchema, Ri as MAX_SUBAGENTS, Rn as messageFilterSchema, Ro as StepStatus, Rr as buildLoginRedirectUrl, Rs as hasActiveFiltersConfig, Rt as SearchProviders, Sa as assistantSchema, Si as retrievalMimeTypesList, Sn as excludedKeys, So as tConversationTagSchema, Sr as MCP_SERVER_TITLE_PATTERN, Ss as PROMPT_FILTER_FIELDS, St as LocalStorageKeys, Ta as coerceNumber, Ti as supportsFiles, Tn as fileStrategiesSchema, To as tMessageSchema, Tr as StdioOptionsSchema, Ts as TOOL_ARGUMENT_FILTER_FIELDS, Tt as MAX_SUBAGENT_RUN_CONFIGS, U as PermissionBits, Ua as eThinkingLevelSchema, Ui as OptionTypes, Un as normalizeServerName, Uo as hostImageIdSuffix, Ur as audioMimeTypes, Us as modelParameterFilterFieldSchema, Ut as Time, V as QueryKeys, Va as eReasoningSummarySchema, Vi as setMaxSubagents, Vn as normalizeMCPToolKey, Vo as actionDomainSeparator, Vr as sharedFileDownload, Vs as memoryFilterFieldSchema, Vt as SystemCategories, W as PrincipalModel, Wa as eVerbositySchema, Wi as SettingTypes, Wn as ocrSchema, Wo as hostImageNamePrefix, Wr as bedrockDocumentExtensions, Ws as promptFilterFieldSchema, Wt as ViolationTypes, X as getResourcePermissionsResponseSchema, Xa as getSettingsKeys, Xi as AnthropicEffort, Xn as setMessageFilterRegexValidator, Xo as FEEDBACK_REASON_KEYS, Xr as convertStringsToRegex, Xs as extractEnvVariable, Xt as assistantEndpointSchema, Y as effectivePermissionsResponseSchema, Ya as getModelKey, Yi as validateSettingDefinitions, Yn as retainRecentConfigSchema, Yo as FEEDBACK_RATINGS, Yr as codeTypeMapping, Ys as envVarRegex, Yt as anthropicEndpointSchema, Z as hasPermissions, Za as googleBaseSchema, Zi as AuthType, Zn as skillSyncConfigSchema, Zo as FEEDBACK_TAGS, Zr as defaultOCRMimeTypes, Zs as extractVariableName, Zt as azureBaseSchema, _a as agentsSchema, _i as mbToBytes, _n as defaultEndpoints, _o as removeNullishValues, _r as webSearchSchema, _s as MAX_PII_PATTERN_LABEL_LENGTH, _t as FetchTokenConfig, a as data_service_exports, aa as Providers, ai as fileConfigSchema, an as bedrockModels, ao as isAssistantsEndpoint, ar as summarizationTriggerSchema, as as AGENT_INSTRUCTION_FILTER_FIELDS, at as AgentCapabilities, ba as anthropicSchema, bi as mimeTypeAliases, bn as defaultSocialLogins, bo as tBannerSchema, br as MCPServersSchema, bs as MESSAGE_FILTER_FIELDS, bt as InfiniteCollections, ca as ReasoningMode, ci as getEndpointFileConfig, cn as checkpointerTypeSchema, co as isMythosClassModel, cr as toolApprovalModeSchema, cs as FEEDBACK_FILTER_FIELDS, ct as BASE_PRINCIPAL_CONFIG_SECTIONS, da as ReasoningSummary, di as imageTypeMapping, dn as codeEnvironmentUserConfigSchema, do as isUUID, dr as turnstileOptionsSchema, ds as HITL_MESSAGE_FILTER_FIELDS, dt as CohereConstants, ea as EModelEndpoint, ei as documentParserMimeTypes, en as azureGroupSchema, eo as googleSettings, er as splitMCPToolKey, es as feedbackTagKeySchema, et as principalSchema, fa as SkillsScope, fi as inferMimeType, fn as codeEnvironmentUserSettingsSchema, fo as openAIBaseSchema, fr as turnstileSchema, fs as MAX_PII_CUSTOM_PATTERNS_TOTAL, ft as Constants, ga as agentsBaseSchema, gi as isPermissiveMimeConfig, gn as defaultAssistantsVersion, go as paramEndpoints, gr as visionModels, gs as MAX_PII_PATTERN_ID_LENGTH, gt as ErrorTypes, ha as Verbosity, hi as isBedrockDocumentType, hn as defaultAgentCapabilities, ho as openRouterSchema, hr as vertexModelConfigSchema, hs as MAX_PII_PATTERNS_PER_SOURCE, ht as EndpointURLs, ia as MemoryScope, ii as fileConfig, in as bedrockGuardrailConfigSchema, io as isAgentsEndpoint, ir as summarizationConfigSchema, is as ACTION_METADATA_FILTER_FIELDS, it as AUTH_USER_DOC_BY_ID_PREFIX, ja as defaultAssistantFormValues, ji as modelSpecSubagentsSchema, jn as initialModelsConfig, jo as tSharedLinkSchema, jr as AuthTypeEnum, js as fileFilterFieldSchema, jt as SKILL_SYNC_MAX_DISCOVERY_DEPTH, ka as compactGoogleSchema, ki as getRefillEligibilityDate, kn as getSchemaDefaults, ko as tPresetSchema, kr as isProcessMCPServerConfig, ks as conversationTitleFilterFieldSchema, kt as RetentionMode, la as ReasoningParameterFormat, li as imageExtRegex, ln as cloudfrontConfigSchema, lo as isOpenAILikeProvider, lr as toolApprovalPolicySchema, ls as FILE_FILTER_FIELDS, lt as CacheKeys, ma as ThinkingLevel, mi as isAnthropicTextDocumentType, mn as contextPruningSchema, mo as openAISettings, mr as vertexAISchema, ms as MAX_PII_CUSTOM_REGEX_INSTRUCTIONS, mt as EImageOutputType, na as ImageVisionTool, ni as excelFileTypes, nn as baseEndpointSchema, no as imageDetailValue, nr as stripServerNamePrefix, ns as getTagsForRating, nt as updateResourcePermissionsRequestSchema, oa as ReasoningContext, oi as fullMimeTypesList, on as buildServerNameAliases, oo as isDocumentSupportedProvider, or as supportsBalanceCheck, os as CONVERSATION_STARTER_FILTER_FIELDS, ot as AuthKeys, pa as ThinkingDisplay, pi as isAnthropicDocumentType, pn as configSchema, po as openAISchema, pr as validateVisionModel, ps as MAX_PII_CUSTOM_REGEX_CHARACTERS, pt as DEFAULT_MEMORY_MAX_INPUT_TOKENS, q as accessRoleSchema, qa as getGoogleThinkingBudgetBounds, qi as generateGoogleSchema, qn as rateLimitSchema, qo as resolveAllowedStatefulCodeEnvironments, qr as codeInterpreterMimeTypes, qs as unattributedAssistantContentSchema, qt as allowedAddressesSchema, ra as MYTHOS_CLASS_FAMILIES, ri as excelMimeTypes, rn as bedrockEndpointSchema, ro as inputTokensIncludesCache, rr as stripServerNamePrefixes, rs as toMinimalFeedback, rt as updateResourcePermissionsResponseSchema, sa as ReasoningEffort, si as getConfiguredMimeAccept, sn as checkpointerSchema, so as isImageVisionTool, sr as toolApprovalHookConfigSchema, ss as CONVERSATION_TITLE_FILTER_FIELDS, st as BASE_ONLY_CONFIG_SECTIONS, ta as ImageDetail, ti as endpointFileConfigSchema, tn as balanceSchema, to as imageDetailNumeric, tr as splitToolCallName, ts as getTagByKey, tt as resourcePermissionsResponseSchema, ua as ReasoningResponseKey, ui as imageMimeTypes, un as codeEnvironmentPermissionDecisionSchema, uo as isParamEndpoint, ur as transactionsSchema, us as FILTER_PII_STARTER_PATTERNS, ut as Capabilities, va as agentsSettings, vi as megabyte, vn as defaultModels, vo as resolveAgentSkillsScope, vr as MCPOptionsSchema, vs as MAX_PII_PATTERN_LENGTH, vt as ForkOptions, wa as cacheSubsetProviders, wi as supportedMimeTypes, wn as fileStorageSchema, wo as tExampleSchema, wr as SSEOptionsSchema, ws as STORED_MESSAGE_FILTER_FIELDS, wt as MAX_SUBAGENT_GRAPH_NODES, xa as anthropicSettings, xi as retrievalMimeTypes, xn as endpointSchema, xo as tConversationSchema, xr as MCP_SERVER_TITLE_ERROR, xs as MODEL_PARAMETER_FILTER_FIELDS, xt as KnownEndpoints, ya as anthropicBaseSchema, yi as mergeFileConfig, yn as defaultRetrievalModels, yo as subagentThreadLineageSchema, yr as MCPServerUserInputSchema, ys as MEMORY_FILTER_FIELDS, yt as ImageDetailCost, z as DynamicQueryKeys, za as eReasoningParameterFormatSchema, zi as MAX_SUBAGENTS_CEILING, zn as modelConfigSchema, zo as Tools, zr as loginPage, zs as hasActivePiiFields, zt as SettingsTabValues } from "./data-service-CaB7saTP.mjs";
2
2
  import { z } from "zod";
3
3
  import dayjs from "dayjs";
4
4
  import utc from "dayjs/plugin/utc.js";
5
5
  import timezonePlugin from "dayjs/plugin/timezone.js";
6
+ import { Cron } from "croner";
6
7
  import axios from "axios";
7
8
  import { URL } from "url";
8
9
  import crypto from "crypto";
9
10
  import { load } from "js-yaml";
10
11
  //#region src/bedrock.ts
11
- const DEFAULT_ENABLED_MAX_TOKENS = 8192;
12
12
  const DEFAULT_THINKING_BUDGET = 2e3;
13
+ const BEDROCK_CLAUDE_SONNET_4_6_MAX_OUTPUT = 64e3;
13
14
  const BEDROCK_OUTPUT_128K_BETA = "output-128k-2025-02-19";
14
15
  const BEDROCK_FINE_GRAINED_TOOL_STREAMING_BETA = "fine-grained-tool-streaming-2025-05-14";
16
+ /** Betas LibreChat injects itself, safe to strip from persisted AMRF when a
17
+ * model no longer supports them; anything else in `anthropic_beta` is a user opt-in. */
18
+ const GENERATED_BEDROCK_BETAS = new Set([BEDROCK_OUTPUT_128K_BETA, BEDROCK_FINE_GRAINED_TOOL_STREAMING_BETA]);
15
19
  const bedrockReasoningConfigValues = new Set(Object.values(BedrockReasoningConfig));
16
20
  /**
17
21
  * Resolves the final `thinking.display` value for an adaptive-thinking request.
@@ -56,14 +60,14 @@ function parseOpusVersion(model) {
56
60
  return null;
57
61
  }
58
62
  /** Extracts sonnet major/minor version from both naming formats.
59
- * Uses single-digit minor capture to avoid matching date suffixes (e.g., -20250514). */
63
+ * Uses bounded minor capture to avoid matching date suffixes (e.g., -20250514). */
60
64
  function parseSonnetVersion(model) {
61
- const nameFirst = model.match(/claude-sonnet[-.]?(\d+)(?:[-.](\d)(?!\d))?/);
65
+ const nameFirst = model.match(/claude-sonnet[-.]?(\d+)(?:[-.](\d{1,2})(?!\d))?/);
62
66
  if (nameFirst) return {
63
67
  major: parseInt(nameFirst[1], 10),
64
68
  minor: nameFirst[2] != null ? parseInt(nameFirst[2], 10) : 0
65
69
  };
66
- const numFirst = model.match(/claude-(\d+)(?:[-.](\d)(?!\d))?-sonnet/);
70
+ const numFirst = model.match(/claude-(\d+)(?:[-.](\d{1,2})(?!\d))?-sonnet/);
67
71
  if (numFirst) return {
68
72
  major: parseInt(numFirst[1], 10),
69
73
  minor: numFirst[2] != null ? parseInt(numFirst[2], 10) : 0
@@ -97,15 +101,80 @@ function supportsAdaptiveThinking(model) {
97
101
  function omitsThinkingByDefault(model) {
98
102
  const opus = parseOpusVersion(model);
99
103
  if (opus && (opus.major > 4 || opus.major === 4 && opus.minor >= 7)) return true;
104
+ const sonnet = parseSonnetVersion(model);
105
+ if (sonnet != null && sonnet.major >= 5) return true;
100
106
  if (isMythosClassModel(model)) return true;
101
107
  return false;
102
108
  }
103
109
  function omitsSamplingParameters(model) {
104
110
  const opus = parseOpusVersion(model);
105
111
  if (opus && (opus.major > 4 || opus.major === 4 && opus.minor >= 7)) return true;
112
+ const sonnet = parseSonnetVersion(model);
113
+ if (sonnet != null && sonnet.major >= 5) return true;
106
114
  if (isMythosClassModel(model)) return true;
107
115
  return false;
108
116
  }
117
+ /**
118
+ * Whether disabling thinking requires sending an explicit `{ type: 'disabled' }`
119
+ * config rather than simply omitting the `thinking` field.
120
+ *
121
+ * Sonnet 5 and Opus 5 treat an omitted `thinking` field as adaptive thinking ON
122
+ * by default, so honoring a user who turns thinking off means sending the
123
+ * disabled config explicitly. Opus 4.7/4.8 run without thinking when the field
124
+ * is omitted, and Fable/Mythos reject an explicit disabled config (400,
125
+ * thinking always on), so both are excluded.
126
+ *
127
+ * See https://platform.claude.com/docs/en/about-claude/models/migration-guide#migrating-to-claude-sonnet-5
128
+ */
129
+ function requiresExplicitThinkingDisabled(model) {
130
+ const sonnet = parseSonnetVersion(model);
131
+ if (sonnet != null && sonnet.major >= 5) return true;
132
+ const opus = parseOpusVersion(model);
133
+ return opus != null && opus.major >= 5;
134
+ }
135
+ /** Effort levels Opus 5 rejects while thinking is explicitly disabled. */
136
+ const EFFORTS_REJECTED_WHEN_THINKING_DISABLED = new Set(["xhigh", "max"]);
137
+ /**
138
+ * Whether the model caps `output_config.effort` while thinking is disabled.
139
+ *
140
+ * Opus 5 rejects `xhigh`/`max` in that combination with a 400: "output_config
141
+ * .effort 'xhigh' is not supported when thinking is disabled on this model. Use
142
+ * effort 'high' or below, or enable thinking." Opus 4.7/4.8, Sonnet 5, and
143
+ * Sonnet 4.6 accept every effort level they otherwise support with thinking
144
+ * off, so the cap is Opus 5+ only.
145
+ */
146
+ function capsEffortWhenThinkingDisabled(model) {
147
+ const opus = parseOpusVersion(model);
148
+ return opus != null && opus.major >= 5;
149
+ }
150
+ /**
151
+ * Lowers an effort level the model would reject while thinking is disabled to
152
+ * the highest accepted value (`high`, which is also the API default). Returns
153
+ * the effort unchanged when the combination is valid.
154
+ */
155
+ function clampEffortForDisabledThinking(model, effort) {
156
+ if (capsEffortWhenThinkingDisabled(model) && EFFORTS_REJECTED_WHEN_THINKING_DISABLED.has(effort)) return "high";
157
+ return effort;
158
+ }
159
+ /** An `output_config` container carrying a usable effort level. */
160
+ function hasStringEffort(value) {
161
+ if (typeof value !== "object" || value === null || !("effort" in value)) return false;
162
+ return typeof value.effort === "string";
163
+ }
164
+ /**
165
+ * Clamps an `output_config.effort` in place when the model would reject it
166
+ * while thinking is disabled. No-op when the container carries no string
167
+ * effort, so callers can pass a possibly-absent config directly.
168
+ */
169
+ function clampOutputConfigEffort(model, outputConfig) {
170
+ if (!hasStringEffort(outputConfig)) return;
171
+ outputConfig.effort = clampEffortForDisabledThinking(model, outputConfig.effort);
172
+ }
173
+ /** Whether a resolved thinking config is an explicit `{ type: 'disabled' }`. */
174
+ function isThinkingDisabled(thinking) {
175
+ if (typeof thinking !== "object" || thinking === null || !("type" in thinking)) return false;
176
+ return thinking.type === "disabled";
177
+ }
109
178
  /** Checks if a model has a 1M context window (Sonnet 4.6+, Opus 4.6+, Opus 5+, Fable/Mythos) */
110
179
  function supportsContext1m(model) {
111
180
  const sonnet = parseSonnetVersion(model);
@@ -116,6 +185,30 @@ function supportsContext1m(model) {
116
185
  return false;
117
186
  }
118
187
  /**
188
+ * Checks whether a native Anthropic Claude model supports prompt caching.
189
+ *
190
+ * This uses the configured model ID directly. Resolving it through a token
191
+ * map first can collapse a newly released Claude model to the generic
192
+ * `claude-` fallback and incorrectly disable cache control.
193
+ */
194
+ function supportsPromptCache(model) {
195
+ if (model.includes("claude-3-5-sonnet-latest") || model.includes("claude-3.5-sonnet-latest")) return false;
196
+ return /claude-3[-.]7/.test(model) || /claude-3[-.]5-(?:sonnet|haiku)/.test(model) || /claude-3-(?:sonnet|haiku|opus)?/.test(model) || /claude-(?:sonnet|opus|haiku)[-.]?(?:[4-9]|\d{2,})/.test(model) || /claude-(?:[4-9]|\d{2,})(?:[-.](?:sonnet|opus|haiku))?/.test(model) || isMythosClassModel(model);
197
+ }
198
+ /**
199
+ * A Bedrock Claude model ID may be prefixed (`anthropic.claude-*`,
200
+ * `us.anthropic.claude-*`, `global.anthropic.claude-*`) or bare (`claude-*`,
201
+ * used when the LibreChat model ID maps to an application inference profile).
202
+ * Match on the `claude` family token so every form is recognized — requiring
203
+ * the literal `anthropic.` prefix silently dropped thinking config, beta
204
+ * headers, and sampling handling for inference-profile deployments.
205
+ */
206
+ const BEDROCK_CLAUDE_4PLUS_THINKING = /claude-(?:[4-9](?:\.\d+)?(?:-\d+)?-(?:sonnet|opus|haiku)|(?:sonnet|opus|haiku)-[4-9])/;
207
+ /** Whether a Bedrock model ID is an Anthropic Claude model (prefixed or bare). */
208
+ function isBedrockClaudeModel(model) {
209
+ return model.includes("claude");
210
+ }
211
+ /**
119
212
  * Gets the appropriate anthropic_beta headers for Bedrock Anthropic models.
120
213
  * Bedrock uses `anthropic_beta` (with underscore) in additionalModelRequestFields.
121
214
  *
@@ -126,19 +219,33 @@ function getBedrockAnthropicBetaHeaders(model) {
126
219
  const betaHeaders = [];
127
220
  /** Mythos-class (Fable/Mythos) is intentionally not matched: these betas are built-in/no-op for the
128
221
  * 4.7+ generation (Fable has native 128K output), so omitting them on Bedrock is lossless. */
129
- const isClaude4PlusModel = /anthropic\.claude-(?:[4-9](?:\.\d+)?(?:-\d+)?-(?:sonnet|opus|haiku)|(?:sonnet|opus|haiku)-[4-9])/.test(model);
130
- if (model.includes("anthropic.claude-3-7-sonnet") || isClaude4PlusModel) betaHeaders.push(BEDROCK_OUTPUT_128K_BETA);
222
+ const isClaude4PlusModel = BEDROCK_CLAUDE_4PLUS_THINKING.test(model);
223
+ if (model.includes("claude-3-7-sonnet") || isClaude4PlusModel) betaHeaders.push(BEDROCK_OUTPUT_128K_BETA);
131
224
  if (isClaude4PlusModel) betaHeaders.push(BEDROCK_FINE_GRAINED_TOOL_STREAMING_BETA);
132
225
  return betaHeaders;
133
226
  }
227
+ /** Flatten an anthropic_beta value (array, single string, or comma-delimited
228
+ * string) into trimmed, non-empty header tokens. */
229
+ function normalizeBetaHeaders(value) {
230
+ let values = [];
231
+ if (Array.isArray(value)) values = value;
232
+ else if (typeof value === "string") values = [value];
233
+ const headers = [];
234
+ values.forEach((entry) => {
235
+ if (typeof entry !== "string") return;
236
+ entry.split(",").map((header) => header.trim()).filter(Boolean).forEach((header) => headers.push(header));
237
+ });
238
+ return headers;
239
+ }
134
240
  function mergeBedrockAnthropicBetaHeaders(existing, generated) {
135
- let existingValues = [];
136
- if (Array.isArray(existing)) existingValues = existing;
137
- else if (typeof existing === "string") existingValues = [existing];
241
+ const generatedSet = new Set(generated);
138
242
  const betaHeaders = /* @__PURE__ */ new Set();
139
- [...existingValues, ...generated].forEach((value) => {
140
- if (typeof value !== "string") return;
141
- value.split(",").map((header) => header.trim()).filter(Boolean).forEach((header) => betaHeaders.add(header));
243
+ [...normalizeBetaHeaders(existing), ...generated].forEach((header) => {
244
+ /** Drop a generated beta carried over from a prior model that the current
245
+ * model does not generate (e.g. fine-grained-tool-streaming on a 3.7
246
+ * profile); user opt-ins are always preserved. */
247
+ if (GENERATED_BEDROCK_BETAS.has(header) && !generatedSet.has(header)) return;
248
+ betaHeaders.add(header);
142
249
  });
143
250
  return Array.from(betaHeaders);
144
251
  }
@@ -172,7 +279,7 @@ const bedrockInputSchema = tConversationSchema.pick({
172
279
  }).transform((obj) => {
173
280
  if (obj.additionalModelRequestFields?.thinking != null) {
174
281
  const thinking = obj.additionalModelRequestFields.thinking;
175
- obj.thinking = !!thinking;
282
+ obj.thinking = typeof thinking === "object" && thinking !== null && thinking.type === "disabled" ? false : !!thinking;
176
283
  obj.thinkingBudget = typeof thinking === "object" && "budget_tokens" in thinking ? thinking.budget_tokens : void 0;
177
284
  if (obj.thinkingDisplay == null) {
178
285
  const persistedDisplay = extractPersistedDisplay({ thinking });
@@ -239,16 +346,49 @@ const bedrockInputParser = tConversationSchema.pick({
239
346
  delete typedData[key];
240
347
  }
241
348
  });
242
- /** Configure thinking for Bedrock Anthropic models: 3.7 Sonnet, Claude 4+ (opus/sonnet/haiku), and Mythos-class (Fable/Mythos). */
243
- if (typeof typedData.model === "string" && (typedData.model.includes("anthropic.claude-3-7-sonnet") || /anthropic\.claude-(?:[4-9](?:\.\d+)?(?:-\d+)?-(?:sonnet|opus|haiku)|(?:sonnet|opus|haiku)-[4-9])/.test(typedData.model) || isMythosClassModel(typedData.model))) {
349
+ /**
350
+ * Persisted `model_parameters` can carry a prior "thinking off" only inside
351
+ * `additionalModelRequestFields.thinking = { type: 'disabled' }` (a known
352
+ * key that isn't spread into `additionalFields`). `initializeBedrock` feeds
353
+ * those params straight through this parser, so surface that as
354
+ * `thinking: false` — otherwise the disabled branch is skipped and the
355
+ * config rebuilds adaptive, flipping a user's Sonnet 5 setting back on.
356
+ */
357
+ const persistedThinking = typedData.additionalModelRequestFields?.thinking;
358
+ if (additionalFields.thinking === void 0 && typeof persistedThinking === "object" && persistedThinking !== null && persistedThinking.type === "disabled") additionalFields.thinking = false;
359
+ /** Bedrock thinking-capable Claude models: 3.7 Sonnet, Claude 4+ (opus/sonnet/haiku), and Mythos-class (Fable/Mythos). */
360
+ const isThinkingModel = typeof typedData.model === "string" && (typedData.model.includes("claude-3-7-sonnet") || BEDROCK_CLAUDE_4PLUS_THINKING.test(typedData.model) || isMythosClassModel(typedData.model));
361
+ if (isThinkingModel) {
244
362
  if (supportsAdaptiveThinking(typedData.model)) {
363
+ /** Persisted AMRF is spread into the final request, so clearing only
364
+ * `additionalFields` leaves a stale value from a prior selection. */
365
+ const persistedAmrf = typedData.additionalModelRequestFields;
366
+ const thinkingDisabled = additionalFields.thinking === false;
245
367
  const effort = additionalFields.effort;
246
- if (effort && typeof effort === "string" && effort !== "") additionalFields.output_config = { effort };
368
+ if (typeof effort === "string" && effort !== "") additionalFields.output_config = { effort };
369
+ else if (effort !== void 0 && persistedAmrf)
370
+ /** Explicit unset ('' or null) clears the persisted effort. An absent
371
+ * effort (agent resume, where the prior llmConfig persisted
372
+ * `output_config` but no top-level `effort`) preserves it. */
373
+ delete persistedAmrf.output_config;
247
374
  delete additionalFields.effort;
375
+ /**
376
+ * Opus 5 rejects `xhigh`/`max` effort while thinking is disabled, so
377
+ * clamp both the effort derived above and any effort still carried in
378
+ * persisted AMRF (agent resume sends `output_config` with no top-level
379
+ * `effort`, so the branch above leaves it untouched).
380
+ */
381
+ if (thinkingDisabled) [additionalFields, persistedAmrf].forEach((target) => clampOutputConfigEffort(typedData.model, target?.output_config));
248
382
  if (additionalFields.thinking === false) {
249
- delete additionalFields.thinking;
250
383
  delete additionalFields.thinkingBudget;
251
384
  delete additionalFields.thinkingDisplay;
385
+ if (requiresExplicitThinkingDisabled(typedData.model)) additionalFields.thinking = { type: "disabled" };
386
+ else {
387
+ delete additionalFields.thinking;
388
+ /** Disable-by-omission models (Opus 4.7+): drop the persisted
389
+ * adaptive config so turning thinking off actually disables it. */
390
+ if (persistedAmrf) delete persistedAmrf.thinking;
391
+ }
252
392
  } else {
253
393
  /**
254
394
  * Persisted agent `model_parameters` round-trip back through this
@@ -276,10 +416,18 @@ const bedrockInputParser = tConversationSchema.pick({
276
416
  if (additionalFields.thinking === true && additionalFields.thinkingBudget === void 0) additionalFields.thinkingBudget = DEFAULT_THINKING_BUDGET;
277
417
  delete additionalFields.effort;
278
418
  delete additionalFields.thinkingDisplay;
419
+ /** A bare non-adaptive thinking profile (e.g. `claude-3-7-sonnet`) must
420
+ * not inherit an adaptive/disabled thinking object or `output_config`
421
+ * persisted from another model; this branch's own fields are authoritative. */
422
+ const persistedAmrf = typedData.additionalModelRequestFields;
423
+ if (persistedAmrf) {
424
+ delete persistedAmrf.thinking;
425
+ delete persistedAmrf.output_config;
426
+ }
279
427
  }
280
428
  /** Anthropic uses 'effort' via output_config, not reasoning_config */
281
429
  delete additionalFields.reasoning_effort;
282
- if (typedData.model.includes("anthropic.")) {
430
+ if (isBedrockClaudeModel(typedData.model)) {
283
431
  const betaHeaders = getBedrockAnthropicBetaHeaders(typedData.model);
284
432
  if (betaHeaders.length > 0) {
285
433
  const existingBetaHeaders = typedData.additionalModelRequestFields?.anthropic_beta;
@@ -297,7 +445,7 @@ const bedrockInputParser = tConversationSchema.pick({
297
445
  delete additionalFields.reasoning_effort;
298
446
  if (typeof reasoningEffort === "string" && bedrockReasoningConfigValues.has(reasoningEffort)) additionalFields.reasoning_config = reasoningEffort;
299
447
  }
300
- const isAnthropicModel = typeof typedData.model === "string" && typedData.model.includes("anthropic.");
448
+ const isAnthropicModel = typeof typedData.model === "string" && isBedrockClaudeModel(typedData.model);
301
449
  /** Strip stale fields from previously-persisted additionalModelRequestFields */
302
450
  if (typeof typedData.additionalModelRequestFields === "object" && typedData.additionalModelRequestFields != null) {
303
451
  const amrf = typedData.additionalModelRequestFields;
@@ -311,6 +459,22 @@ const bedrockInputParser = tConversationSchema.pick({
311
459
  } else {
312
460
  delete amrf.reasoning_config;
313
461
  delete amrf.reasoning_effort;
462
+ /** A Claude model that does not support Bedrock thinking (e.g. a bare
463
+ * `claude-3-5-sonnet` inference profile) must not carry stale thinking
464
+ * fields from a previously-selected thinking model. Drop only the
465
+ * LibreChat-generated betas (output-128k, fine-grained tool streaming);
466
+ * user opt-ins in `anthropic_beta` are preserved. */
467
+ if (!isThinkingModel) {
468
+ delete amrf.thinking;
469
+ delete amrf.thinkingBudget;
470
+ delete amrf.effort;
471
+ delete amrf.output_config;
472
+ if (amrf.anthropic_beta !== void 0) {
473
+ const kept = normalizeBetaHeaders(amrf.anthropic_beta).filter((header) => !GENERATED_BEDROCK_BETAS.has(header));
474
+ if (kept.length > 0) amrf.anthropic_beta = kept;
475
+ else delete amrf.anthropic_beta;
476
+ }
477
+ }
314
478
  }
315
479
  if (shouldOmitSamplingParameters) {
316
480
  delete amrf.temperature;
@@ -353,11 +517,37 @@ const bedrockInputParser = tConversationSchema.pick({
353
517
  * @param data - The parsed Bedrock request options object
354
518
  * @returns The object with thinking configured appropriately
355
519
  */
520
+ /**
521
+ * `anthropicSettings.maxOutputTokens.reset` only matches the canonical
522
+ * family-first id (`claude-sonnet-5`); Bedrock also accepts number-first
523
+ * aliases (`claude-5-sonnet`, `claude-4-7-sonnet`) that this file gates as
524
+ * thinking models. Canonicalize to family-first so those aliases resolve to the
525
+ * real ceiling instead of the 8192 fallback.
526
+ */
527
+ function toFamilyFirstClaudeId(model) {
528
+ return model.replace(/claude-(\d+(?:[-.]\d+)?)-(sonnet|opus|haiku)/, "claude-$2-$1");
529
+ }
530
+ function isBedrockClaudeSonnet46(model) {
531
+ return /claude-sonnet[-.]?4[-.]?6(?=$|[^0-9])/.test(toFamilyFirstClaudeId(model));
532
+ }
533
+ /**
534
+ * Thinking tokens share the `maxTokens` output budget with tool-call arguments
535
+ * (e.g. a `create_file` `content`), so a low default truncates large authored
536
+ * files mid-argument. Mirror the direct-Anthropic path and default to the
537
+ * model's full max output when the request does not set one explicitly.
538
+ */
539
+ function resolveThinkingMaxTokens(data) {
540
+ const explicit = data.maxTokens ?? data.maxOutputTokens;
541
+ if (typeof explicit === "number" && explicit > 0) return explicit;
542
+ const model = typeof data.model === "string" ? data.model : "";
543
+ if (isBedrockClaudeSonnet46(model)) return BEDROCK_CLAUDE_SONNET_4_6_MAX_OUTPUT;
544
+ return anthropicSettings.maxOutputTokens.reset(toFamilyFirstClaudeId(model));
545
+ }
356
546
  function configureThinking(data) {
357
547
  const updatedData = { ...data };
358
548
  const thinking = updatedData.additionalModelRequestFields?.thinking;
359
549
  if (thinking === true) {
360
- updatedData.maxTokens = updatedData.maxTokens ?? updatedData.maxOutputTokens ?? DEFAULT_ENABLED_MAX_TOKENS;
550
+ updatedData.maxTokens = resolveThinkingMaxTokens(updatedData);
361
551
  delete updatedData.maxOutputTokens;
362
552
  const thinkingConfig = {
363
553
  type: "enabled",
@@ -367,12 +557,30 @@ function configureThinking(data) {
367
557
  updatedData.additionalModelRequestFields.thinking = thinkingConfig;
368
558
  delete updatedData.additionalModelRequestFields.thinkingBudget;
369
559
  } else if (typeof thinking === "object" && thinking != null && thinking.type === "adaptive") {
370
- if (updatedData.maxTokens == null && updatedData.maxOutputTokens != null) updatedData.maxTokens = updatedData.maxOutputTokens;
560
+ updatedData.maxTokens = resolveThinkingMaxTokens(updatedData);
371
561
  delete updatedData.maxOutputTokens;
372
562
  delete updatedData.additionalModelRequestFields.thinkingBudget;
373
563
  }
374
564
  return updatedData;
375
565
  }
566
+ /** Top-level Converse request fields (issue #14029: `system` from a preset).
567
+ * The input parser's catch-all routes unknown keys into
568
+ * additionalModelRequestFields, and Bedrock rejects any that collide with a
569
+ * field the request already sends (`messages`/`modelId` always,
570
+ * `inferenceConfig` whenever maxTokens is set, `toolConfig` for agents). */
571
+ const RESERVED_CONVERSE_FIELDS = [
572
+ "system",
573
+ "messages",
574
+ "modelId",
575
+ "toolConfig",
576
+ "inferenceConfig",
577
+ "guardrailConfig",
578
+ "promptVariables",
579
+ "requestMetadata",
580
+ "performanceConfig",
581
+ "additionalModelRequestFields",
582
+ "additionalModelResponseFieldPaths"
583
+ ];
376
584
  const bedrockOutputParser = (data) => {
377
585
  const knownKeys = [
378
586
  ...Object.keys(tConversationSchema.shape),
@@ -391,7 +599,15 @@ const bedrockOutputParser = (data) => {
391
599
  if (result.maxTokens !== void 0 && result.maxOutputTokens === void 0) result.maxOutputTokens = result.maxTokens;
392
600
  else if (result.maxOutputTokens !== void 0 && result.maxTokens === void 0) result.maxTokens = result.maxOutputTokens;
393
601
  result = configureThinking(result);
394
- const amrf = result.additionalModelRequestFields;
602
+ let amrf = result.additionalModelRequestFields;
603
+ if (amrf && typeof amrf === "object") {
604
+ const reserved = RESERVED_CONVERSE_FIELDS.filter((key) => key in (amrf ?? {}));
605
+ if (reserved.length > 0) {
606
+ amrf = { ...amrf };
607
+ for (const key of reserved) delete amrf[key];
608
+ result.additionalModelRequestFields = amrf;
609
+ }
610
+ }
395
611
  if (!amrf || Object.keys(amrf).length === 0) delete result.additionalModelRequestFields;
396
612
  return result;
397
613
  };
@@ -408,6 +624,8 @@ let ContentTypes = /* @__PURE__ */ function(ContentTypes) {
408
624
  ContentTypes["INPUT_AUDIO"] = "input_audio";
409
625
  ContentTypes["AGENT_UPDATE"] = "agent_update";
410
626
  ContentTypes["SUMMARY"] = "summary";
627
+ ContentTypes["ACTIVITY_LABEL"] = "activity_label";
628
+ ContentTypes["STEER"] = "steer";
411
629
  ContentTypes["ERROR"] = "error";
412
630
  return ContentTypes;
413
631
  }({});
@@ -432,10 +650,14 @@ let StepEvents = /* @__PURE__ */ function(StepEvents) {
432
650
  StepEvents["ON_REASONING_DELTA"] = "on_reasoning_delta";
433
651
  StepEvents["ON_RUN_STEP_DELTA"] = "on_run_step_delta";
434
652
  StepEvents["ON_RUN_STEP_COMPLETED"] = "on_run_step_completed";
653
+ /** Terminal signal for a run step: closed with a status and timestamps. */
654
+ StepEvents["ON_RUN_STEP_CLOSED"] = "on_run_step_closed";
435
655
  StepEvents["ON_SUMMARIZE_START"] = "on_summarize_start";
436
656
  StepEvents["ON_SUMMARIZE_DELTA"] = "on_summarize_delta";
437
657
  StepEvents["ON_SUMMARIZE_COMPLETE"] = "on_summarize_complete";
438
658
  StepEvents["ON_SUBAGENT_UPDATE"] = "on_subagent_update";
659
+ StepEvents["ON_SANDBOX_STARTING"] = "on_sandbox_starting";
660
+ StepEvents["ON_PTC_TOOL_CALL"] = "on_ptc_tool_call";
439
661
  return StepEvents;
440
662
  }({});
441
663
  /** Token-tracking event names streamed to the client (separate from StepEvents dispatch). */
@@ -445,6 +667,45 @@ let UsageEvents = /* @__PURE__ */ function(UsageEvents) {
445
667
  return UsageEvents;
446
668
  }({});
447
669
  /**
670
+ * Human-in-the-loop event names. Streamed to live clients when a run pauses for
671
+ * tool approval (or an ask-user question). Reconnecting clients instead read the
672
+ * same record from `resumeState.pendingAction` on the sync event / status route.
673
+ */
674
+ let ApprovalEvents = /* @__PURE__ */ function(ApprovalEvents) {
675
+ ApprovalEvents["ON_PENDING_ACTION"] = "on_pending_action";
676
+ return ApprovalEvents;
677
+ }({});
678
+ /**
679
+ * Steering event names. `on_steer_applied` streams to live clients when a
680
+ * queued steer message is injected at a tool-batch boundary; reconnecting
681
+ * clients recover injected steers from `aggregatedContent` and still-queued
682
+ * ones from `resumeState.pendingSteers`. Steers that never reach a boundary
683
+ * ride the final/abort events as `pendingSteers`.
684
+ */
685
+ let SteerEvents = /* @__PURE__ */ function(SteerEvents) {
686
+ SteerEvents["ON_STEER_APPLIED"] = "on_steer_applied";
687
+ /** Durable capability correction for queued steers after HITL handover. */
688
+ SteerEvents["ON_STEER_UPDATED"] = "on_steer_updated";
689
+ return SteerEvents;
690
+ }({});
691
+ /**
692
+ * Activity-label event names. `on_activity_label` streams to live clients
693
+ * when a tool-batch or parent-phase label part is claimed and again when the
694
+ * fast-model label resolves; reconnecting clients recover applied labels
695
+ * from `aggregatedContent` like any other content part.
696
+ */
697
+ let ActivityLabelEvents = /* @__PURE__ */ function(ActivityLabelEvents) {
698
+ ActivityLabelEvents["ON_ACTIVITY_LABEL"] = "on_activity_label";
699
+ return ActivityLabelEvents;
700
+ }({});
701
+ /** Live title updates for an existing reasoning content part. */
702
+ let ReasoningLabelEvents = /* @__PURE__ */ function(ReasoningLabelEvents) {
703
+ ReasoningLabelEvents["ON_REASONING_LABEL"] = "on_reasoning_label";
704
+ /** Internal durable budget reservation; clients intentionally do not render it. */
705
+ ReasoningLabelEvents["ON_REASONING_LABEL_ATTEMPT"] = "on_reasoning_label_attempt";
706
+ return ReasoningLabelEvents;
707
+ }({});
708
+ /**
448
709
  * Full prompt token count for one completed model call — the EXACT context the
449
710
  * model saw, provider-aware: additive providers (Bedrock) report `input_tokens`
450
711
  * excluding cache, so cache reads/writes are added back; subset providers
@@ -651,19 +912,21 @@ const parseCompactConvo = ({ endpoint, endpointType, conversation, possibleValue
651
912
  if (models && convo) convo.model = getFirstDefinedValue(models) ?? convo.model;
652
913
  return convo;
653
914
  };
654
- function parseTextParts(contentParts, skipReasoning = false) {
915
+ function parseTextParts(contentParts, skipReasoning = false, options) {
655
916
  let result = "";
917
+ const append = (textValue) => {
918
+ if (result.length > 0 && textValue.length > 0 && result[result.length - 1] !== " " && textValue[0] !== " ") result += " ";
919
+ result += textValue;
920
+ };
656
921
  for (const part of contentParts) {
657
922
  if (!part?.type) continue;
658
- if (part.type === "text") {
659
- const textValue = (typeof part.text === "string" ? part.text : part.text?.value) || "";
660
- if (result.length > 0 && textValue.length > 0 && result[result.length - 1] !== " " && textValue[0] !== " ") result += " ";
661
- result += textValue;
662
- } else if (part.type === "think" && !skipReasoning) {
663
- const textValue = typeof part.think === "string" ? part.think : "";
664
- if (result.length > 0 && textValue.length > 0 && result[result.length - 1] !== " " && textValue[0] !== " ") result += " ";
665
- result += textValue;
666
- }
923
+ if (part.type === "text") append((typeof part.text === "string" ? part.text : part.text?.value) || "");
924
+ else if (part.type === "steer" && options?.includeSteer === true)
925
+ /** Mid-run user speech: excluded by default so generic extraction (TTS
926
+ * reading assistant output) never speaks the user's own words — the
927
+ * full-record surfaces (search indexing, persisted abort text) opt in. */
928
+ append(typeof part.steer === "string" ? part.steer : "");
929
+ else if (part.type === "think" && !skipReasoning) append(typeof part.think === "string" ? part.think : "");
667
930
  }
668
931
  return result;
669
932
  }
@@ -717,6 +980,14 @@ function replaceSpecialVars({ text, user, now: inputNow, timezone }) {
717
980
  return result;
718
981
  }
719
982
  /**
983
+ * Resolves the display label ("sender") for an ephemeral agent:
984
+ * `modelLabel` (user/preset) → model spec's `label` → endpoint config's
985
+ * `modelDisplayLabel` → `''` (lets consumers fall back to the model name).
986
+ */
987
+ function getEphemeralSender({ modelLabel, specLabel, modelDisplayLabel }) {
988
+ return modelLabel ?? specLabel ?? modelDisplayLabel ?? "";
989
+ }
990
+ /**
720
991
  * Encodes an ephemeral agent ID from endpoint, model, optional sender, and optional index.
721
992
  * Uses __ to replace : (reserved in graph node names) and ___ to separate sender.
722
993
  *
@@ -1008,15 +1279,132 @@ function mapGroupToAzureConfig({ groupName, groupMap }) {
1008
1279
  return result;
1009
1280
  }
1010
1281
  //#endregion
1282
+ //#region src/langchain.ts
1283
+ /**
1284
+ * LangChain classifies a provider failure by mutating the error: it stamps `lc_error_code` and
1285
+ * appends `\n\nTroubleshooting URL: <docs url>\n` to the message. Both halves are handled here
1286
+ * because the server strips the URL before persisting the message, while the client still reads the
1287
+ * code back out of messages persisted before it did.
1288
+ */
1289
+ const LANGCHAIN = "langchain";
1290
+ const ERROR_PATH = "/errors/";
1291
+ const TROUBLESHOOTING_LABEL = "Troubleshooting URL:";
1292
+ const WHITESPACE = /\s/;
1293
+ /** Provider errors cross untyped boundaries, so a `message` is not guaranteed to be a string. */
1294
+ function toMessageText(message) {
1295
+ if (typeof message === "string") return message;
1296
+ return message == null ? "" : String(message);
1297
+ }
1298
+ function isErrorCodeCharacter(character) {
1299
+ const code = character.charCodeAt(0);
1300
+ return character === "_" || code >= 65 && code <= 90 || code >= 97 && code <= 122;
1301
+ }
1302
+ function findTokenEnd(text, start, limit = text.length) {
1303
+ let end = start;
1304
+ while (end < limit && !WHITESPACE.test(text[end])) end += 1;
1305
+ return end;
1306
+ }
1307
+ function findErrorCode(text, searchableText, start, end) {
1308
+ const langChainIndex = searchableText.indexOf(LANGCHAIN, start);
1309
+ if (langChainIndex < 0 || langChainIndex >= end) return;
1310
+ let errorCode;
1311
+ let pathIndex = searchableText.indexOf(ERROR_PATH, langChainIndex + 9);
1312
+ while (pathIndex >= 0 && pathIndex < end) {
1313
+ const codeStart = pathIndex + 8;
1314
+ let codeEnd = codeStart;
1315
+ while (codeEnd < end && isErrorCodeCharacter(text[codeEnd])) codeEnd += 1;
1316
+ if (codeEnd > codeStart) errorCode = {
1317
+ start: codeStart,
1318
+ end: codeEnd
1319
+ };
1320
+ pathIndex = searchableText.indexOf(ERROR_PATH, Math.max(codeStart, codeEnd));
1321
+ }
1322
+ return errorCode;
1323
+ }
1324
+ /** Removes LangChain's appended docs URL so provider text carries no third-party attribution. */
1325
+ function stripLangChainTroubleshootingUrl(message) {
1326
+ const text = toMessageText(message);
1327
+ const parts = [];
1328
+ let copiedUntil = 0;
1329
+ let searchFrom = 0;
1330
+ while (searchFrom < text.length) {
1331
+ const labelStart = text.indexOf(TROUBLESHOOTING_LABEL, searchFrom);
1332
+ if (labelStart < 0) break;
1333
+ let matchStart = labelStart;
1334
+ while (matchStart > copiedUntil && WHITESPACE.test(text[matchStart - 1])) matchStart -= 1;
1335
+ let urlStart = labelStart + 20;
1336
+ while (urlStart < text.length && WHITESPACE.test(text[urlStart])) urlStart += 1;
1337
+ if (!text.startsWith("https://", urlStart) && !text.startsWith("http://", urlStart)) {
1338
+ searchFrom = urlStart;
1339
+ continue;
1340
+ }
1341
+ const urlEnd = findTokenEnd(text, urlStart);
1342
+ const errorCode = findErrorCode(text, text, urlStart, urlEnd);
1343
+ if (errorCode == null) {
1344
+ searchFrom = urlEnd;
1345
+ continue;
1346
+ }
1347
+ let matchEnd = errorCode.end;
1348
+ if (text[matchEnd] === "/") matchEnd += 1;
1349
+ while (matchEnd < text.length && WHITESPACE.test(text[matchEnd])) matchEnd += 1;
1350
+ parts.push(text.slice(copiedUntil, matchStart), " ");
1351
+ copiedUntil = matchEnd;
1352
+ searchFrom = matchEnd;
1353
+ }
1354
+ parts.push(text.slice(copiedUntil));
1355
+ return parts.join("").trim();
1356
+ }
1357
+ /** The classification LangChain encoded in the docs URL it appended, when the text carries one. */
1358
+ function parseLangChainErrorCode(message) {
1359
+ const text = toMessageText(message);
1360
+ const searchableText = text.toLowerCase();
1361
+ let searchFrom = 0;
1362
+ while (searchFrom < text.length) {
1363
+ const langChainIndex = searchableText.indexOf(LANGCHAIN, searchFrom);
1364
+ if (langChainIndex < 0) return;
1365
+ const tokenEnd = findTokenEnd(text, langChainIndex);
1366
+ const errorCode = findErrorCode(text, searchableText, langChainIndex, tokenEnd);
1367
+ if (errorCode != null) return text.slice(errorCode.start, errorCode.end).toUpperCase();
1368
+ searchFrom = tokenEnd + 1;
1369
+ }
1370
+ }
1371
+ //#endregion
1011
1372
  //#region src/messages.ts
1373
+ /** A generated reasoning title describes the text as it existed at generation time.
1374
+ * Any manual edit or merge into a different reasoning step invalidates the entire
1375
+ * title revision domain while preserving unrelated content metadata. */
1376
+ function stripReasoningLabelMetadata(part) {
1377
+ if (part.type !== "think") return part;
1378
+ const { reasoning_label: _label, reasoning_label_step_id: _stepId, reasoning_label_attempts: _attempts, reasoning_label_submitted_chars: _submittedChars, reasoning_label_revision: _revision, reasoning_label_status: _status, ...unlabeledPart } = part;
1379
+ return unlabeledPart;
1380
+ }
1381
+ const treeCache = /* @__PURE__ */ new WeakMap();
1382
+ /**
1383
+ * Builds the render tree from the flat messages array. Order-robust: live
1384
+ * stream/steer/preempt cache writes can momentarily place a child before its
1385
+ * parent, and a single-pass link would hoist such rows into phantom root
1386
+ * branches — folding the visible thread to one dangling branch until a
1387
+ * refetch restores creation order. Linking happens only after every message
1388
+ * is indexed, so array order never changes the tree shape.
1389
+ */
1012
1390
  function buildTree({ messages, fileMap }) {
1013
1391
  if (messages === null) return null;
1392
+ const cached = treeCache.get(messages);
1393
+ if (cached) {
1394
+ if (fileMap == null && cached.bare) return cached.bare;
1395
+ if (fileMap != null && cached.fileMap === fileMap && cached.hydrated) return cached.hydrated;
1396
+ }
1014
1397
  const messageMap = {};
1398
+ const orderedMessages = [];
1015
1399
  const rootMessages = [];
1016
1400
  const childrenCount = {};
1017
- messages.forEach((message) => {
1018
- if (!message) return;
1019
- const parentId = message.parentMessageId ?? "";
1401
+ for (const message of messages) {
1402
+ if (!message) continue;
1403
+ /** A self-parented row can never link under itself (it becomes a root),
1404
+ * so count it with the parentless group — charging its own id would
1405
+ * inflate the sibling indices of its real children past
1406
+ * `children.length`. */
1407
+ const parentId = message.parentMessageId === message.messageId ? "" : message.parentMessageId ?? "";
1020
1408
  childrenCount[parentId] = (childrenCount[parentId] || 0) + 1;
1021
1409
  const extendedMessage = {
1022
1410
  ...message,
@@ -1026,13 +1414,102 @@ function buildTree({ messages, fileMap }) {
1026
1414
  };
1027
1415
  if (message.files && fileMap) extendedMessage.files = message.files.map((file) => fileMap[file.file_id ?? ""] ?? file);
1028
1416
  messageMap[message.messageId] = extendedMessage;
1029
- const parentMessage = messageMap[parentId];
1030
- if (parentMessage) {
1031
- parentMessage.children.push(extendedMessage);
1032
- extendedMessage.depth = parentMessage.depth + 1;
1033
- } else rootMessages.push(extendedMessage);
1034
- });
1035
- return rootMessages;
1417
+ orderedMessages.push(extendedMessage);
1418
+ }
1419
+ for (const extendedMessage of orderedMessages) {
1420
+ const parentMessage = messageMap[extendedMessage.parentMessageId ?? ""];
1421
+ if (parentMessage && parentMessage !== extendedMessage) parentMessage.children.push(extendedMessage);
1422
+ else rootMessages.push(extendedMessage);
1423
+ }
1424
+ /** Depth comes from a roots-down walk (a child linked before its parent
1425
+ * can't inherit depth at link time). The `visited` set doubles as the
1426
+ * cycle guard: nodes on a corrupt parent cycle are unreachable from any
1427
+ * root, so they resurface as roots instead of disappearing. */
1428
+ const visited = /* @__PURE__ */ new Set();
1429
+ const assignDepths = (root) => {
1430
+ visited.add(root);
1431
+ const stack = [root];
1432
+ while (stack.length > 0) {
1433
+ const node = stack.pop();
1434
+ /** Every node has one parent, so this walk reaches each node once — an
1435
+ * already-visited child is a cycle back-edge. Sever it (not just skip
1436
+ * it) so consumers that recurse `children` terminate. */
1437
+ if (node.children.some((child) => visited.has(child))) node.children = node.children.filter((child) => !visited.has(child));
1438
+ for (const child of node.children) {
1439
+ child.depth = node.depth + 1;
1440
+ visited.add(child);
1441
+ stack.push(child);
1442
+ }
1443
+ }
1444
+ };
1445
+ for (const root of rootMessages) assignDepths(root);
1446
+ for (const extendedMessage of orderedMessages) if (!visited.has(extendedMessage)) {
1447
+ rootMessages.push(extendedMessage);
1448
+ assignDepths(extendedMessage);
1449
+ }
1450
+ const tree = rootMessages;
1451
+ const entry = cached ?? {};
1452
+ if (fileMap == null) entry.bare = tree;
1453
+ else {
1454
+ entry.fileMap = fileMap;
1455
+ entry.hydrated = tree;
1456
+ }
1457
+ if (!cached) treeCache.set(messages, entry);
1458
+ return tree;
1459
+ }
1460
+ //#endregion
1461
+ //#region src/runSteps.ts
1462
+ /**
1463
+ * Below this, a duration is noise rather than information: sub-second tool
1464
+ * calls are the common case, and labelling every one of them `· 0.3s` adds a
1465
+ * moving number to the end of most cards without telling the reader anything
1466
+ * they could act on. Callers use {@link isReportableRunStepDuration} rather
1467
+ * than comparing against this directly.
1468
+ */
1469
+ const MIN_REPORTABLE_RUN_STEP_DURATION_MS = 1e3;
1470
+ /**
1471
+ * Wall-clock duration of a run step, derived from the terminal
1472
+ * `on_run_step_closed` event.
1473
+ *
1474
+ * Returns `undefined` rather than a fallback whenever the value would be a
1475
+ * guess, because a wrong duration is worse than an absent one — an absent one
1476
+ * renders nothing, a wrong one is indistinguishable from a real measurement:
1477
+ *
1478
+ * - `created_at` is optional on the event; emitters that do not know when the
1479
+ * step opened cannot have their duration inferred from anything else.
1480
+ * - A negative result means the two timestamps came from clocks that disagree.
1481
+ * That is not hypothetical: since `@librechat/agents` v3.6.0 a step can be
1482
+ * opened in one process and closed in another after a checkpoint resume, so
1483
+ * the two stamps can legitimately originate on different machines.
1484
+ * - Non-finite input is treated as absent instead of propagating `NaN` into
1485
+ * rendering.
1486
+ *
1487
+ * Known limits, accepted rather than guessed at: only the negative direction
1488
+ * of clock skew is detectable from a single stamp pair — positive skew
1489
+ * inflates the result and cannot be distinguished from a genuinely long
1490
+ * step. And the value is wall-clock elapsed between open and close, so a
1491
+ * step held open across a suspension (a checkpoint resume, a HITL approval
1492
+ * wait) includes that held-open time. Both are properties of the only data
1493
+ * available, not derivation bugs.
1494
+ */
1495
+ function getRunStepDurationMs(closed) {
1496
+ const { created_at: createdAt, closed_at: closedAt } = closed;
1497
+ if (typeof createdAt !== "number" || typeof closedAt !== "number") return;
1498
+ if (!Number.isFinite(createdAt) || !Number.isFinite(closedAt)) return;
1499
+ const durationMs = closedAt - createdAt;
1500
+ return durationMs >= 0 ? durationMs : void 0;
1501
+ }
1502
+ /**
1503
+ * Whether a derived duration is worth showing to the reader.
1504
+ *
1505
+ * This is a presentation judgment, so it belongs at render time only. The
1506
+ * stamp sites persist the raw {@link getRunStepDurationMs} value instead of
1507
+ * pre-filtering through this — thresholding at write time would bake a
1508
+ * display rule into stored data, making "fast" indistinguishable from "not
1509
+ * derivable" and unrecoverable if the rule ever changes.
1510
+ */
1511
+ function isReportableRunStepDuration(durationMs) {
1512
+ return typeof durationMs === "number" && durationMs >= 1e3;
1036
1513
  }
1037
1514
  //#endregion
1038
1515
  //#region src/artifacts.ts
@@ -4205,6 +4682,10 @@ let PermissionTypes = /* @__PURE__ */ function(PermissionTypes) {
4205
4682
  * Type for Shared Link Permissions
4206
4683
  */
4207
4684
  PermissionTypes["SHARED_LINKS"] = "SHARED_LINKS";
4685
+ /**
4686
+ * Type for Scheduled Chats Permissions
4687
+ */
4688
+ PermissionTypes["SCHEDULES"] = "SCHEDULES";
4208
4689
  return PermissionTypes;
4209
4690
  }({});
4210
4691
  /**
@@ -4228,11 +4709,20 @@ const PERMISSION_TYPE_INTERFACE_FIELDS = {
4228
4709
  ["MCP_SERVERS"]: "mcpServers",
4229
4710
  ["REMOTE_AGENTS"]: "remoteAgents",
4230
4711
  ["SKILLS"]: "skills",
4231
- ["SHARED_LINKS"]: "sharedLinks"
4712
+ ["SHARED_LINKS"]: "sharedLinks",
4713
+ ["SCHEDULES"]: "schedules"
4232
4714
  };
4233
4715
  /** Set of interface config field names that correspond to role permissions. */
4234
4716
  const INTERFACE_PERMISSION_FIELDS = new Set(Object.values(PERMISSION_TYPE_INTERFACE_FIELDS));
4235
4717
  /**
4718
+ * Interface fields that seed a permission (use/create) BUT also carry runtime
4719
+ * config that must survive DB/tenant/user overrides. For these, override
4720
+ * sanitizers strip only the permission sub-keys (use/create) from the object
4721
+ * form and PRESERVE the boolean form — for `schedules`, `interface.schedules: false`
4722
+ * is the runtime feature disable that `getLimits` reads, not a permission toggle.
4723
+ */
4724
+ const RUNTIME_CONFIG_INTERFACE_FIELDS = new Set(["schedules"]);
4725
+ /**
4236
4726
  * YAML sub-keys within composite interface permission fields that map to permission bits.
4237
4727
  * When an interface permission field is an object, only these sub-keys are stripped from
4238
4728
  * DB overrides — other sub-keys (like `placeholder`, `trustCheckbox`) are UI-only and pass through.
@@ -4333,6 +4823,10 @@ const skillPermissionsSchema = z.object({
4333
4823
  ["SHARE"]: z.boolean().default(false),
4334
4824
  ["SHARE_PUBLIC"]: z.boolean().default(false)
4335
4825
  });
4826
+ const schedulesPermissionsSchema = z.object({
4827
+ ["USE"]: z.boolean().default(true),
4828
+ ["CREATE"]: z.boolean().default(true)
4829
+ });
4336
4830
  const sharedLinksPermissionsSchema = z.object({
4337
4831
  ["CREATE"]: z.boolean().default(true),
4338
4832
  ["SHARE"]: z.boolean().default(true),
@@ -4354,7 +4848,8 @@ const permissionsSchema = z.object({
4354
4848
  ["MCP_SERVERS"]: mcpServersPermissionsSchema,
4355
4849
  ["REMOTE_AGENTS"]: remoteAgentsPermissionsSchema,
4356
4850
  ["SKILLS"]: skillPermissionsSchema,
4357
- ["SHARED_LINKS"]: sharedLinksPermissionsSchema
4851
+ ["SHARED_LINKS"]: sharedLinksPermissionsSchema,
4852
+ ["SCHEDULES"]: schedulesPermissionsSchema
4358
4853
  });
4359
4854
  //#endregion
4360
4855
  //#region src/roles.ts
@@ -4435,6 +4930,10 @@ const defaultRolesSchema = z.object({
4435
4930
  ["CREATE"]: z.boolean().default(true),
4436
4931
  ["SHARE"]: z.boolean().default(true),
4437
4932
  ["SHARE_PUBLIC"]: z.boolean().default(true)
4933
+ }),
4934
+ ["SCHEDULES"]: schedulesPermissionsSchema.extend({
4935
+ ["USE"]: z.boolean().default(true),
4936
+ ["CREATE"]: z.boolean().default(true)
4438
4937
  })
4439
4938
  })
4440
4939
  }),
@@ -4508,6 +5007,10 @@ const roleDefaults = defaultRolesSchema.parse({
4508
5007
  ["CREATE"]: true,
4509
5008
  ["SHARE"]: true,
4510
5009
  ["SHARE_PUBLIC"]: true
5010
+ },
5011
+ ["SCHEDULES"]: {
5012
+ ["USE"]: true,
5013
+ ["CREATE"]: true
4511
5014
  }
4512
5015
  }
4513
5016
  },
@@ -4563,6 +5066,10 @@ const roleDefaults = defaultRolesSchema.parse({
4563
5066
  ["CREATE"]: true,
4564
5067
  ["SHARE"]: true,
4565
5068
  ["SHARE_PUBLIC"]: true
5069
+ },
5070
+ ["SCHEDULES"]: {
5071
+ ["USE"]: true,
5072
+ ["CREATE"]: true
4566
5073
  }
4567
5074
  }
4568
5075
  }
@@ -4582,6 +5089,308 @@ let InvocationMode = /* @__PURE__ */ function(InvocationMode) {
4582
5089
  return InvocationMode;
4583
5090
  }({});
4584
5091
  //#endregion
5092
+ //#region src/types/schedules.ts
5093
+ /** Cadences the dialog builds from structured pickers (hour, minute, weekday). */
5094
+ const scheduleStructuredFrequencies = [
5095
+ "hourly",
5096
+ "daily",
5097
+ "weekdays",
5098
+ "weekly"
5099
+ ];
5100
+ const scheduleFrequencies = [...scheduleStructuredFrequencies, "cron"];
5101
+ /** Bounds a stored expression. Generous for five fields, because each one can hold a
5102
+ * list: an every-minute-of-the-hour cadence spelled out runs past two hundred chars. */
5103
+ const SCHEDULE_CRON_MAX_LENGTH = 256;
5104
+ const scheduleTargets = ["new"];
5105
+ const structuredCadenceSchema = z.object({
5106
+ frequency: z.enum(scheduleStructuredFrequencies),
5107
+ hour: z.number().int().min(0).max(23),
5108
+ minute: z.number().int().min(0).max(59),
5109
+ daysOfWeek: z.array(z.number().int().min(0).max(6)).min(1).max(7).transform((days) => Array.from(new Set(days))).optional()
5110
+ });
5111
+ /**
5112
+ * A raw cron expression carries its own hour and minute, so it cannot share the
5113
+ * structured shape: there is no single `hour` for `0 9,17 * * 1-5`. Syntax is
5114
+ * validated server-side by croner, the same parser the engine fires from, rather
5115
+ * than by a regex that would accept patterns croner then rejects at fire time.
5116
+ */
5117
+ const cronCadenceSchema = z.object({
5118
+ frequency: z.literal("cron"),
5119
+ expression: z.string().trim().min(1).max(256)
5120
+ });
5121
+ const scheduleCadenceSchema = z.discriminatedUnion("frequency", [structuredCadenceSchema, cronCadenceSchema]);
5122
+ const isCronCadence = (cadence) => cadence.frequency === "cron";
5123
+ const createSchedulePayloadSchema = z.object({
5124
+ name: z.string().trim().min(1).max(256),
5125
+ prompt: z.string().trim().min(1).max(32e3),
5126
+ agent_id: z.string().trim().min(1),
5127
+ cadence: scheduleCadenceSchema,
5128
+ timezone: z.string().min(1),
5129
+ target: z.enum(scheduleTargets).default("new"),
5130
+ file_ids: z.array(z.string()).max(10).transform((ids) => Array.from(new Set(ids))).optional(),
5131
+ /**
5132
+ * Chat project each run's conversation is filed under. `null` clears the scope.
5133
+ * Ownership is checked server-side at write time and again at every fire, so a
5134
+ * deleted project disables the schedule instead of silently filing runs loose.
5135
+ */
5136
+ chatProjectId: z.string().trim().min(1).nullable().optional(),
5137
+ enabled: z.boolean().default(true),
5138
+ /**
5139
+ * Client-generated key making creation idempotent across retries. Creation commits
5140
+ * the row and arms it in two writes, so a failure between them leaves the client
5141
+ * unable to tell whether anything persisted; retrying blind can produce two recurring
5142
+ * schedules. A retry carrying the same key resolves to the original row instead.
5143
+ * REQUIRED: an optional key preserves the keyless duplicate path for any client
5144
+ * that omits it, which is exactly the failure the key exists to close.
5145
+ */
5146
+ clientRequestId: z.string().trim().min(1).max(128)
5147
+ });
5148
+ /** Idempotency is a property of the CREATE attempt, not of the schedule's config. */
5149
+ const updateSchedulePayloadSchema = createSchedulePayloadSchema.omit({ clientRequestId: true }).partial().extend({
5150
+ /**
5151
+ * The configRevision the client's edit was computed from (captured when the
5152
+ * dialog opened). The server fences the update on it, so a concurrent edit
5153
+ * from another tab answers 409 instead of being silently overwritten by a
5154
+ * payload rebuilt from a stale snapshot (cadence is sent whole, so the
5155
+ * server-side fresh-read fence alone cannot detect this).
5156
+ */
5157
+ expectedConfigRevision: z.number().int().min(0).optional() });
5158
+ //#endregion
5159
+ //#region src/cadence.ts
5160
+ /** Mirrors the server default when a weekly cadence omits `daysOfWeek`. */
5161
+ const WEEKLY_DEFAULT_DAY = 1;
5162
+ /**
5163
+ * Minute, hour, day of month, month, day of week. croner also reads a six-field form
5164
+ * carrying seconds and a seven-field form that pins a year, and both are refused.
5165
+ * Seconds would promise a precision the runtime does not keep: the engine polls on a
5166
+ * thirty-second tick and offsets each schedule by up to two minutes of jitter. A pinned
5167
+ * year makes a cadence that runs out, and every caller here treats "no next occurrence"
5168
+ * as a cadence it cannot read.
5169
+ */
5170
+ const CRON_FIELD_COUNT = 5;
5171
+ /**
5172
+ * Spring-forward compresses consecutive wall-clock occurrences, so the ENFORCEABLE
5173
+ * minimum for day-and-longer gaps is the nominal gap minus the largest real-world
5174
+ * transition: two hours (Antarctica/Troll; every other zone shifts at most one).
5175
+ * A floor set exactly at the nominal value would otherwise admit a schedule that
5176
+ * genuinely violates it once a year. Hourly gaps are unaffected (the skipped hours
5177
+ * lengthen, never shorten, the gap between occurrences).
5178
+ */
5179
+ const DST_COMPRESSION_MINUTES = 120;
5180
+ /**
5181
+ * Occurrences sampled when measuring a cron expression's tightest gap. The floor
5182
+ * exists to reject expressions that fire too OFTEN, and a dense pattern reveals
5183
+ * its short gap within the first few occurrences, so a small window answers the
5184
+ * question this guards. Known limit: this is a bounded probe, not the exhaustive
5185
+ * proof the structured formulas give. An expression that is sparse for the next
5186
+ * `CRON_PROBE_OCCURRENCES` runs and dense later would pass here and be caught by
5187
+ * the fire-time recheck instead.
5188
+ */
5189
+ const CRON_PROBE_OCCURRENCES = 32;
5190
+ /** Enough to span four nominal gaps from an anchor two gaps before a transition,
5191
+ * which is what guarantees the straddling pair falls inside the window. */
5192
+ const TRANSITION_PROBE_OCCURRENCES = 5;
5193
+ /**
5194
+ * Compiles a cadence to the cron expression the engine fires from. Shared rather
5195
+ * than server-owned because the dialog previews the next runs, validates the
5196
+ * interval floor, and disables its own submit from these same functions: a second
5197
+ * client-side implementation would drift and either show run times the schedule
5198
+ * does not keep or accept a cadence the server then rejects.
5199
+ */
5200
+ function cadenceToCron(cadence) {
5201
+ if (cadence.frequency === "cron") return cadence.expression;
5202
+ const { frequency, hour, minute } = cadence;
5203
+ if (frequency === "hourly") return `${minute} * * * *`;
5204
+ if (frequency === "daily") return `${minute} ${hour} * * *`;
5205
+ if (frequency === "weekdays") return `${minute} ${hour} * * 1-5`;
5206
+ return `${minute} ${hour} * * ${[...cadence.daysOfWeek?.length ? cadence.daysOfWeek : [WEEKLY_DEFAULT_DAY]].sort((a, b) => a - b).join(",")}`;
5207
+ }
5208
+ /**
5209
+ * Everything `cronCadenceSchema` will accept: exactly five fields, within the length
5210
+ * the schema stores, and actually matching at some point. croner accepts syntactically
5211
+ * valid patterns that can never match (`0 0 30 2 *`), and those would arm a schedule
5212
+ * that never fires. Validated with croner rather than a regex, because a regex would
5213
+ * accept patterns croner then rejects at fire time.
5214
+ *
5215
+ * A five-field expression that matches at all matches forever, which is what lets every
5216
+ * caller keep reading "no next occurrence" as "this cadence is unreadable".
5217
+ */
5218
+ function isValidCronExpression(expression, timezone) {
5219
+ const trimmed = expression.trim();
5220
+ if (trimmed.length > 256) return false;
5221
+ if (trimmed.split(/\s+/).length !== CRON_FIELD_COUNT) return false;
5222
+ try {
5223
+ return new Cron(trimmed, {
5224
+ timezone,
5225
+ paused: true
5226
+ }).nextRun() != null;
5227
+ } catch {
5228
+ return false;
5229
+ }
5230
+ }
5231
+ /**
5232
+ * The next occurrences the engine would fire. Server-side jitter (up to two
5233
+ * minutes) is deliberately not modelled: it is keyed off a schedule id that does
5234
+ * not exist yet at create time, and showing 9:01 for a 9:00 schedule reads as a bug.
5235
+ */
5236
+ function nextRunInstants(cadence, timezone, count) {
5237
+ try {
5238
+ const runs = new Cron(cadenceToCron(cadence), {
5239
+ timezone,
5240
+ paused: true
5241
+ }).nextRuns(count);
5242
+ return runs.filter((run, index) => index === 0 || run.getTime() !== runs[index - 1].getTime());
5243
+ } catch {
5244
+ return [];
5245
+ }
5246
+ }
5247
+ const MINUTE_MS = 6e4;
5248
+ const DAY_MS = 1440 * MINUTE_MS;
5249
+ /** A year and a bit, so a zone with a single yearly transition always shows one. */
5250
+ const TRANSITION_SEARCH_DAYS = 400;
5251
+ const offsetFormatters = /* @__PURE__ */ new Map();
5252
+ /** Minutes east of UTC in `zone` at `instant`, read back from the wall clock the
5253
+ * zone renders. The only way to observe a zone's offset without a tz database. */
5254
+ function zoneOffsetMinutes(zone, instant) {
5255
+ let formatter = offsetFormatters.get(zone);
5256
+ if (formatter == null) {
5257
+ formatter = new Intl.DateTimeFormat("en-US", {
5258
+ timeZone: zone,
5259
+ hourCycle: "h23",
5260
+ year: "numeric",
5261
+ month: "2-digit",
5262
+ day: "2-digit",
5263
+ hour: "2-digit",
5264
+ minute: "2-digit",
5265
+ second: "2-digit"
5266
+ });
5267
+ offsetFormatters.set(zone, formatter);
5268
+ }
5269
+ const parts = {};
5270
+ for (const part of formatter.formatToParts(instant)) parts[part.type] = part.value;
5271
+ const wallClock = Date.UTC(Number(parts.year), Number(parts.month) - 1, Number(parts.day), Number(parts.hour), Number(parts.minute), Number(parts.second));
5272
+ return Math.round((wallClock - instant.getTime()) / MINUTE_MS);
5273
+ }
5274
+ /** Zone transitions are asked for once per fire, and the scan below costs ~10ms.
5275
+ * Keyed by day because that is how far the answer stays put as the window slides,
5276
+ * and cleared wholesale at the cap so a long-lived worker cannot accumulate an
5277
+ * entry per zone per day forever. */
5278
+ const transitionCache = /* @__PURE__ */ new Map();
5279
+ const TRANSITION_CACHE_MAX = 512;
5280
+ /**
5281
+ * Every instant `zone` changes its UTC offset within the search window; empty for a
5282
+ * fixed-offset zone. Both directions matter and only one of them shortens anything,
5283
+ * so taking just the next one would usually find the harmless fall-back and miss the
5284
+ * spring-forward six months behind it. Bracketed a day at a time, bisected to the
5285
+ * minute.
5286
+ */
5287
+ function offsetChanges(zone, from) {
5288
+ const day = Math.floor(from.getTime() / DAY_MS);
5289
+ const cacheKey = `${zone}:${day}`;
5290
+ const cached = transitionCache.get(cacheKey);
5291
+ if (cached != null) return cached;
5292
+ const changes = [];
5293
+ const start = /* @__PURE__ */ new Date((day - 1) * DAY_MS);
5294
+ let low = start.getTime();
5295
+ let baseOffset = zoneOffsetMinutes(zone, start);
5296
+ const end = low + TRANSITION_SEARCH_DAYS * DAY_MS;
5297
+ for (let probe = low + DAY_MS; probe <= end; probe += DAY_MS) {
5298
+ const offset = zoneOffsetMinutes(zone, new Date(probe));
5299
+ if (offset !== baseOffset) {
5300
+ let high = probe;
5301
+ let bracket = low;
5302
+ while (high - bracket > MINUTE_MS) {
5303
+ const mid = bracket + Math.floor((high - bracket) / 2);
5304
+ if (zoneOffsetMinutes(zone, new Date(mid)) === baseOffset) bracket = mid;
5305
+ else high = mid;
5306
+ }
5307
+ changes.push(new Date(high));
5308
+ baseOffset = offset;
5309
+ }
5310
+ low = probe;
5311
+ }
5312
+ if (transitionCache.size >= TRANSITION_CACHE_MAX) transitionCache.clear();
5313
+ transitionCache.set(cacheKey, changes);
5314
+ return changes;
5315
+ }
5316
+ function runsAfter(expression, from, zone, occurrences = CRON_PROBE_OCCURRENCES) {
5317
+ return new Cron(expression, {
5318
+ timezone: zone,
5319
+ paused: true
5320
+ }).nextRuns(occurrences, from);
5321
+ }
5322
+ /** Tightest gap, in minutes, across `runs`; null when there is no pair to measure. */
5323
+ function minGapMinutes(runs) {
5324
+ if (runs.length < 2) return null;
5325
+ let minGapMs = Number.MAX_SAFE_INTEGER;
5326
+ for (let i = 1; i < runs.length; i++) {
5327
+ const gapMs = runs[i].getTime() - runs[i - 1].getTime();
5328
+ if (gapMs <= 0) continue;
5329
+ minGapMs = Math.min(minGapMs, gapMs);
5330
+ }
5331
+ if (minGapMs === Number.MAX_SAFE_INTEGER) return null;
5332
+ return Math.floor(minGapMs / MINUTE_MS);
5333
+ }
5334
+ function probeMinGapMinutes(expression, zone, from, occurrences = CRON_PROBE_OCCURRENCES) {
5335
+ return minGapMinutes(runsAfter(expression, from, zone, occurrences));
5336
+ }
5337
+ /**
5338
+ * Smallest gap in minutes between occurrences. Returns 0 for an unparseable or
5339
+ * never-matching expression so every floor rejects it, failing closed rather than
5340
+ * admitting an expression the engine cannot fire.
5341
+ *
5342
+ * Measured twice, and the smaller wins:
5343
+ *
5344
+ * 1. Nominal, probed in UTC, then discounted by the same worst-case DST allowance
5345
+ * the structured branches assume. This keeps `0 9 * * *` reporting exactly what
5346
+ * the Daily preset reports, so the same schedule cannot be admitted in one form
5347
+ * and rejected in the other.
5348
+ * 2. Real elapsed time in the schedule's own zone, across each of that zone's
5349
+ * transitions. Spring-forward compresses a gap that straddles one
5350
+ * (`0 0,12 * * *` in America/New_York is 11 hours that day, not 12), and step 1
5351
+ * only discounts gaps of a day or more, so a subdaily gap needs measuring rather
5352
+ * than estimating. Anchoring at the transition is what makes a bounded probe see
5353
+ * it at all: from today it is usually months outside any reasonable window.
5354
+ */
5355
+ function cronIntervalMinutes(expression, timezone) {
5356
+ try {
5357
+ const now = /* @__PURE__ */ new Date();
5358
+ const nominal = probeMinGapMinutes(expression, "UTC", now);
5359
+ if (nominal == null) return 0;
5360
+ const estimate = nominal < 1440 ? nominal : Math.max(0, nominal - DST_COMPRESSION_MINUTES);
5361
+ if (timezone == null || estimate === 0) return estimate;
5362
+ const anchorBackMs = 2 * Math.max(nominal, 1) * MINUTE_MS;
5363
+ let smallest = estimate;
5364
+ for (const transition of offsetChanges(timezone, now)) {
5365
+ const measured = probeMinGapMinutes(expression, timezone, new Date(Math.max(now.getTime(), transition.getTime() - anchorBackMs)), TRANSITION_PROBE_OCCURRENCES);
5366
+ if (measured != null) smallest = Math.min(smallest, measured);
5367
+ }
5368
+ return smallest;
5369
+ } catch {
5370
+ return 0;
5371
+ }
5372
+ }
5373
+ /**
5374
+ * Minimum minutes between occurrences, for the admin interval floor. `timezone` is
5375
+ * the schedule's own; passing it lets the cron branch measure a DST-compressed gap
5376
+ * instead of estimating one. The structured branches are zone-independent: their
5377
+ * formulas already carry the worst-case allowance.
5378
+ */
5379
+ function cadenceIntervalMinutes(cadence, timezone) {
5380
+ if (isCronCadence(cadence)) return cronIntervalMinutes(cadence.expression, timezone);
5381
+ if (cadence.frequency === "hourly") return 60;
5382
+ if (cadence.frequency === "daily" || cadence.frequency === "weekdays") return 1440 - DST_COMPRESSION_MINUTES;
5383
+ const days = cadence.daysOfWeek?.length ? Array.from(new Set(cadence.daysOfWeek)) : [WEEKLY_DEFAULT_DAY];
5384
+ if (days.length <= 1) return 10080 - DST_COMPRESSION_MINUTES;
5385
+ const sorted = [...days].sort((a, b) => a - b);
5386
+ let minGapDays = 7;
5387
+ for (let i = 0; i < sorted.length; i++) {
5388
+ const gap = i + 1 < sorted.length ? sorted[i + 1] - sorted[i] : 7 - sorted[i] + sorted[0];
5389
+ minGapDays = Math.min(minGapDays, gap);
5390
+ }
5391
+ return minGapDays * 24 * 60 - DST_COMPRESSION_MINUTES;
5392
+ }
5393
+ //#endregion
4585
5394
  //#region src/types/skills.ts
4586
5395
  /**
4587
5396
  * Shared skill validation constants — the single source of truth for name,
@@ -4614,6 +5423,171 @@ let DATE_RANGE = /* @__PURE__ */ function(DATE_RANGE) {
4614
5423
  return DATE_RANGE;
4615
5424
  }({});
4616
5425
  //#endregion
5426
+ //#region src/types/insights.ts
5427
+ const INSIGHTS_MAX_RANGE_DAYS = 30;
5428
+ const INSIGHTS_SEARCH_MIN_LENGTH = 3;
5429
+ const INSIGHTS_SEARCH_MAX_LENGTH = 200;
5430
+ //#endregion
5431
+ //#region src/types/queuedTurns.ts
5432
+ const agentQueuedTurnStatuses = [
5433
+ "queued",
5434
+ "claimed",
5435
+ "admitted",
5436
+ "cancelled",
5437
+ "dead"
5438
+ ];
5439
+ const agentQueuedTurnDurability = ["process_local", "durable"];
5440
+ const agentQueuedTurnFileRefSchema = z.object({
5441
+ file_id: z.string().trim().min(1),
5442
+ type: z.string().optional(),
5443
+ filepath: z.string().optional(),
5444
+ filename: z.string().optional(),
5445
+ height: z.number().optional(),
5446
+ width: z.number().optional(),
5447
+ bytes: z.number().nonnegative().optional()
5448
+ });
5449
+ const enqueueAgentQueuedTurnSchema = z.object({
5450
+ conversationId: z.string().trim().min(1),
5451
+ parentMessageId: z.string().trim().min(1),
5452
+ clientRequestId: z.string().trim().min(1).max(128),
5453
+ text: z.string(),
5454
+ files: z.array(agentQueuedTurnFileRefSchema).optional(),
5455
+ quotes: z.array(z.string()).optional(),
5456
+ manualSkills: z.array(z.string().trim().min(1)).optional(),
5457
+ priority: z.boolean().optional(),
5458
+ expectedPredecessorCreatedAt: z.number().int().nonnegative().optional()
5459
+ });
5460
+ const listAgentQueuedTurnsSchema = z.object({
5461
+ conversationId: z.string().trim().min(1),
5462
+ clientRequestIds: z.array(z.string().trim().min(1).max(128)).max(100).transform((ids) => Array.from(new Set(ids))).optional()
5463
+ });
5464
+ const cancelAgentQueuedTurnSchema = z.object({ queuedTurnId: z.string().trim().min(1) });
5465
+ const agentQueuedTurnReceiptSchema = enqueueAgentQueuedTurnSchema.extend({
5466
+ queuedTurnId: z.string().trim().min(1),
5467
+ status: z.enum(agentQueuedTurnStatuses),
5468
+ /** Effective generation boundary consumed by an admitted turn. This can
5469
+ * advance beyond the originally captured root as queued turns chain. */
5470
+ effectivePredecessorCreatedAt: z.number().int().nonnegative().optional(),
5471
+ /** Explicitly proves that this admission consumed no predecessor boundary. */
5472
+ rootPredecessor: z.literal(true).optional(),
5473
+ position: z.number().int().nonnegative().optional(),
5474
+ /** Immutable queue sequence retained as `revision` for wire compatibility. */
5475
+ revision: z.number().int().nonnegative(),
5476
+ failure: z.object({
5477
+ code: z.string().trim().min(1).max(128),
5478
+ message: z.string().max(2048).optional()
5479
+ }).optional(),
5480
+ createdAt: z.string(),
5481
+ updatedAt: z.string()
5482
+ });
5483
+ const agentQueuedTurnCapabilitySchema = z.discriminatedUnion("supported", [z.object({ supported: z.literal(false) }), z.object({
5484
+ supported: z.literal(true),
5485
+ durability: z.enum(agentQueuedTurnDurability)
5486
+ })]);
5487
+ const enqueueAgentQueuedTurnResponseSchema = z.object({
5488
+ receipt: agentQueuedTurnReceiptSchema,
5489
+ capability: agentQueuedTurnCapabilitySchema
5490
+ });
5491
+ const listAgentQueuedTurnsResponseSchema = z.object({
5492
+ queuedTurns: z.array(agentQueuedTurnReceiptSchema),
5493
+ capability: agentQueuedTurnCapabilitySchema,
5494
+ revision: z.number().int().nonnegative()
5495
+ });
5496
+ const cancelAgentQueuedTurnResponseSchema = z.object({ receipt: agentQueuedTurnReceiptSchema });
5497
+ //#endregion
5498
+ //#region src/providers.ts
5499
+ /** Canonical provider identity used for branding across client and server. */
5500
+ let ProviderId = /* @__PURE__ */ function(ProviderId) {
5501
+ ProviderId["openai"] = "openai";
5502
+ ProviderId["anthropic"] = "anthropic";
5503
+ ProviderId["google"] = "google";
5504
+ ProviderId["azure"] = "azure";
5505
+ ProviderId["bedrock"] = "bedrock";
5506
+ ProviderId["xai"] = "xai";
5507
+ ProviderId["moonshot"] = "moonshot";
5508
+ ProviderId["anyscale"] = "anyscale";
5509
+ ProviderId["apipie"] = "apipie";
5510
+ ProviderId["cohere"] = "cohere";
5511
+ ProviderId["deepseek"] = "deepseek";
5512
+ ProviderId["fireworks"] = "fireworks";
5513
+ ProviderId["groq"] = "groq";
5514
+ ProviderId["helicone"] = "helicone";
5515
+ ProviderId["huggingface"] = "huggingface";
5516
+ ProviderId["mistral"] = "mistral";
5517
+ ProviderId["mlx"] = "mlx";
5518
+ ProviderId["ollama"] = "ollama";
5519
+ ProviderId["openrouter"] = "openrouter";
5520
+ ProviderId["perplexity"] = "perplexity";
5521
+ ProviderId["qwen"] = "qwen";
5522
+ ProviderId["shuttleai"] = "shuttleai";
5523
+ ProviderId["together"] = "together";
5524
+ ProviderId["unify"] = "unify";
5525
+ ProviderId["vercel"] = "vercel";
5526
+ return ProviderId;
5527
+ }({});
5528
+ const endpointToProvider = {
5529
+ ["openAI"]: "openai",
5530
+ ["azureOpenAI"]: "azure",
5531
+ ["anthropic"]: "anthropic",
5532
+ ["google"]: "google",
5533
+ ["bedrock"]: "bedrock"
5534
+ };
5535
+ const knownEndpointToProvider = {
5536
+ ["anyscale"]: "anyscale",
5537
+ ["apipie"]: "apipie",
5538
+ ["cohere"]: "cohere",
5539
+ ["fireworks"]: "fireworks",
5540
+ ["deepseek"]: "deepseek",
5541
+ ["moonshot"]: "moonshot",
5542
+ ["groq"]: "groq",
5543
+ ["helicone"]: "helicone",
5544
+ ["huggingface"]: "huggingface",
5545
+ ["mistral"]: "mistral",
5546
+ ["mlx"]: "mlx",
5547
+ ["ollama"]: "ollama",
5548
+ ["openrouter"]: "openrouter",
5549
+ ["perplexity"]: "perplexity",
5550
+ ["shuttleai"]: "shuttleai",
5551
+ ["together.ai"]: "together",
5552
+ ["unify"]: "unify",
5553
+ ["vercel"]: "vercel",
5554
+ ["xai"]: "xai"
5555
+ };
5556
+ const providerAliases = {
5557
+ chatgpt: "openai",
5558
+ gpt: "openai",
5559
+ azureopenai: "azure",
5560
+ claude: "anthropic",
5561
+ gemini: "google",
5562
+ gemma: "google",
5563
+ vertex: "google",
5564
+ vertexai: "google",
5565
+ palm: "google",
5566
+ awsbedrock: "bedrock",
5567
+ grok: "xai",
5568
+ kimi: "moonshot",
5569
+ moonshotai: "moonshot",
5570
+ mistralai: "mistral",
5571
+ togetherai: "together"
5572
+ };
5573
+ const modelCatalogAliases = { ["vertexai"]: "google" };
5574
+ const normalize = (input) => input.toLowerCase().replace(/[\s._-]/g, "");
5575
+ const providerByNormalizedId = Object.values(ProviderId).reduce((acc, id) => {
5576
+ acc[normalize(id)] = id;
5577
+ return acc;
5578
+ }, {});
5579
+ /** Resolves free-form provider text to a canonical id, ignoring case and separators. */
5580
+ function resolveProviderId(input) {
5581
+ if (!input) return null;
5582
+ const key = normalize(input);
5583
+ return providerByNormalizedId[key] ?? providerAliases[key] ?? null;
5584
+ }
5585
+ /** Resolves a runtime provider to its model catalog, using a native alias only when needed. */
5586
+ function resolveModelCatalogKey(provider, catalogs) {
5587
+ const key = provider ?? "";
5588
+ return catalogs?.[key] != null ? key : modelCatalogAliases[key] ?? key;
5589
+ }
5590
+ //#endregion
4617
5591
  //#region src/actions.ts
4618
5592
  function sha1(input) {
4619
5593
  return crypto.createHash("sha1").update(input).digest("hex");
@@ -4940,6 +5914,27 @@ function extractDomainFromUrl(url) {
4940
5914
  throw new Error(`Invalid URL format: ${url}`);
4941
5915
  }
4942
5916
  }
5917
+ function getExplicitPort(value) {
5918
+ const normalizedValue = value.trim();
5919
+ const protocolSeparatorIndex = normalizedValue.indexOf("://");
5920
+ const hasProtocol = protocolSeparatorIndex !== -1;
5921
+ const authorityAndPath = hasProtocol ? normalizedValue.slice(protocolSeparatorIndex + 3) : normalizedValue;
5922
+ let port;
5923
+ try {
5924
+ const parsedUrl = new URL(hasProtocol ? normalizedValue : `https://${normalizedValue}`);
5925
+ port = parsedUrl.port;
5926
+ if (!port && (parsedUrl.protocol === "http:" || parsedUrl.protocol === "https:")) port = new URL(`${parsedUrl.protocol === "http:" ? "https:" : "http:"}//${authorityAndPath}`).port;
5927
+ } catch {
5928
+ return null;
5929
+ }
5930
+ if (!port) return null;
5931
+ const parsedPort = Number(port);
5932
+ if (!Number.isInteger(parsedPort) || parsedPort < 1 || parsedPort > 65535) throw new Error(`Invalid port in domain: ${value}`);
5933
+ return String(parsedPort);
5934
+ }
5935
+ function getDefaultActionPort(protocol) {
5936
+ return protocol === "https:" ? "443" : "80";
5937
+ }
4943
5938
  /**
4944
5939
  * Validates client domain matches OpenAPI spec server URL domain (SSRF prevention).
4945
5940
  * @param clientProvidedDomain - Domain from client (with/without protocol)
@@ -4960,6 +5955,7 @@ function validateActionDomain(clientProvidedDomain, specServerUrl) {
4960
5955
  /** Extract hostname from client domain if it's a full URL */
4961
5956
  let clientHostname = clientProvidedDomain;
4962
5957
  let clientHasProtocol = false;
5958
+ const clientExplicitPort = getExplicitPort(clientProvidedDomain);
4963
5959
  if (clientProvidedDomain.includes("://")) {
4964
5960
  if (!clientProvidedDomain.startsWith("http://") && !clientProvidedDomain.startsWith("https://")) return {
4965
5961
  isValid: false,
@@ -4971,7 +5967,7 @@ function validateActionDomain(clientProvidedDomain, specServerUrl) {
4971
5967
  } catch {
4972
5968
  clientHasProtocol = false;
4973
5969
  }
4974
- }
5970
+ } else if (clientExplicitPort !== null) clientHostname = new URL(`https://${clientProvidedDomain}`).hostname;
4975
5971
  /** Normalize IPv6 addresses by removing brackets for comparison */
4976
5972
  const normalizedClientHostname = clientHostname.replace(/^\[(.+)\]$/, "$1");
4977
5973
  const normalizedSpecHostname = specHostname.replace(/^\[(.+)\]$/, "$1");
@@ -4984,14 +5980,23 @@ function validateActionDomain(clientProvidedDomain, specServerUrl) {
4984
5980
  const hostname = isIP(normalizedClientHostname) === 6 && !clientHostname.startsWith("[") ? `[${normalizedClientHostname}]` : clientHostname;
4985
5981
  normalizedClientDomain = `${specUrl.protocol}//${hostname}`;
4986
5982
  } else normalizedClientDomain = `https://${clientHostname}`;
4987
- if (normalizedSpecDomain === normalizedClientDomain || !clientHasProtocol && isIPAddress && normalizedClientHostname === normalizedSpecHostname) return {
4988
- isValid: true,
5983
+ if (!(normalizedSpecDomain === normalizedClientDomain || !clientHasProtocol && isIPAddress && normalizedClientHostname === normalizedSpecHostname)) return {
5984
+ isValid: false,
5985
+ message: `Domain mismatch: Client provided '${clientProvidedDomain}', but spec uses '${specHostname}'`,
4989
5986
  normalizedSpecDomain,
4990
5987
  normalizedClientDomain
4991
5988
  };
5989
+ if (clientExplicitPort !== null) {
5990
+ const specEffectivePort = specUrl.port || getDefaultActionPort(specUrl.protocol);
5991
+ if (clientExplicitPort !== specEffectivePort) return {
5992
+ isValid: false,
5993
+ message: `Port mismatch: Client provided '${clientProvidedDomain}', but spec uses effective port '${specEffectivePort}'`,
5994
+ normalizedSpecDomain,
5995
+ normalizedClientDomain
5996
+ };
5997
+ }
4992
5998
  return {
4993
- isValid: false,
4994
- message: `Domain mismatch: Client provided '${clientProvidedDomain}', but spec uses '${specHostname}'`,
5999
+ isValid: true,
4995
6000
  normalizedSpecDomain,
4996
6001
  normalizedClientDomain
4997
6002
  };
@@ -5066,11 +6071,13 @@ function getUserTimezone() {
5066
6071
  }
5067
6072
  }
5068
6073
  function createPayload(submission) {
5069
- const { isEdited, addedConvo, userMessage, isContinued, isTemporary, isRegenerate, conversation, editedContent, ephemeralAgent, endpointOption, manualSkills } = submission;
6074
+ const { isEdited, addedConvo, userMessage, isContinued, isTemporary, isRegenerate, conversation, editedContent, ephemeralAgent, endpointOption, manualSkills, clientRequestId, recoverySteerId, expectedPredecessorCreatedAt } = submission;
5070
6075
  const { conversationId } = tConvoUpdateSchema.parse(conversation);
5071
6076
  const { endpoint: _e, endpointType } = endpointOption;
5072
6077
  const endpoint = _e;
5073
- let server = `${EndpointURLs["agents"]}/${endpoint}`;
6078
+ /** Custom endpoint names are user-defined and may contain `/`, which would
6079
+ * otherwise split into extra path segments and miss the `/:endpoint` route. */
6080
+ let server = `${EndpointURLs["agents"]}/${encodeURIComponent(endpoint)}`;
5074
6081
  if (isAssistantsEndpoint(endpoint)) server = EndpointURLs[endpointType ?? endpoint] + (isEdited ? "/modify" : "");
5075
6082
  const payload = {
5076
6083
  ...userMessage,
@@ -5084,7 +6091,10 @@ function createPayload(submission) {
5084
6091
  isContinued: !!(isEdited && isContinued),
5085
6092
  ephemeralAgent: isAssistantsEndpoint(endpoint) ? void 0 : ephemeralAgent,
5086
6093
  manualSkills: isAssistantsEndpoint(endpoint) ? void 0 : manualSkills,
5087
- timezone: getUserTimezone()
6094
+ timezone: getUserTimezone(),
6095
+ clientRequestId,
6096
+ recoverySteerId,
6097
+ expectedPredecessorCreatedAt
5088
6098
  };
5089
6099
  return {
5090
6100
  server,
@@ -5143,28 +6153,6 @@ const baseDefinitions = {
5143
6153
  optionType: "conversation",
5144
6154
  minTags: 0,
5145
6155
  maxTags: 4
5146
- },
5147
- imageDetail: {
5148
- key: "imageDetail",
5149
- label: "com_endpoint_plug_image_detail",
5150
- labelCode: true,
5151
- description: "com_endpoint_openai_detail",
5152
- descriptionCode: true,
5153
- type: "enum",
5154
- default: "auto",
5155
- component: "slider",
5156
- options: [
5157
- "low",
5158
- "auto",
5159
- "high"
5160
- ],
5161
- enumMappings: {
5162
- ["low"]: "com_ui_low",
5163
- ["auto"]: "com_ui_auto",
5164
- ["high"]: "com_ui_high"
5165
- },
5166
- optionType: "conversation",
5167
- columnSpan: 2
5168
6156
  }
5169
6157
  };
5170
6158
  const createDefinition = (base, overrides) => {
@@ -5191,7 +6179,7 @@ const librechat = {
5191
6179
  labelCode: true,
5192
6180
  type: "number",
5193
6181
  component: "input",
5194
- placeholder: "com_nav_theme_system",
6182
+ placeholder: "com_endpoint_default",
5195
6183
  placeholderCode: true,
5196
6184
  description: "com_endpoint_context_info",
5197
6185
  descriptionCode: true,
@@ -5222,13 +6210,37 @@ const librechat = {
5222
6210
  placeholderCode: true,
5223
6211
  optionType: "model"
5224
6212
  },
6213
+ /** Controls how LibreChat encodes image content blocks, not a provider request
6214
+ * parameter — so it belongs to this group and is stripped from model options. */
6215
+ imageDetail: {
6216
+ key: "imageDetail",
6217
+ label: "com_endpoint_plug_image_detail",
6218
+ labelCode: true,
6219
+ description: "com_endpoint_openai_detail",
6220
+ descriptionCode: true,
6221
+ type: "enum",
6222
+ default: "auto",
6223
+ component: "slider",
6224
+ options: [
6225
+ "low",
6226
+ "auto",
6227
+ "high"
6228
+ ],
6229
+ enumMappings: {
6230
+ ["low"]: "com_ui_low",
6231
+ ["auto"]: "com_ui_auto",
6232
+ ["high"]: "com_ui_high"
6233
+ },
6234
+ optionType: "conversation",
6235
+ columnSpan: 2
6236
+ },
5225
6237
  fileTokenLimit: {
5226
6238
  key: "fileTokenLimit",
5227
6239
  label: "com_ui_file_token_limit",
5228
6240
  labelCode: true,
5229
6241
  description: "com_ui_file_token_limit_desc",
5230
6242
  descriptionCode: true,
5231
- placeholder: "com_nav_theme_system",
6243
+ placeholder: "com_endpoint_default",
5232
6244
  placeholderCode: true,
5233
6245
  type: "number",
5234
6246
  component: "input",
@@ -5300,7 +6312,7 @@ const openAIParams = {
5300
6312
  component: "input",
5301
6313
  description: "com_endpoint_openai_max_tokens",
5302
6314
  descriptionCode: true,
5303
- placeholder: "com_nav_theme_system",
6315
+ placeholder: "com_endpoint_default",
5304
6316
  placeholderCode: true,
5305
6317
  optionType: "model",
5306
6318
  columnSpan: 2
@@ -5321,7 +6333,8 @@ const openAIParams = {
5321
6333
  "low",
5322
6334
  "medium",
5323
6335
  "high",
5324
- "xhigh"
6336
+ "xhigh",
6337
+ "max"
5325
6338
  ],
5326
6339
  enumMappings: {
5327
6340
  [""]: "com_ui_auto",
@@ -5330,7 +6343,8 @@ const openAIParams = {
5330
6343
  ["low"]: "com_ui_low",
5331
6344
  ["medium"]: "com_ui_medium",
5332
6345
  ["high"]: "com_ui_high",
5333
- ["xhigh"]: "com_ui_xhigh"
6346
+ ["xhigh"]: "com_ui_xhigh",
6347
+ ["max"]: "com_ui_max"
5334
6348
  },
5335
6349
  optionType: "model",
5336
6350
  columnSpan: 4
@@ -5385,6 +6399,52 @@ const openAIParams = {
5385
6399
  optionType: "model",
5386
6400
  columnSpan: 4
5387
6401
  },
6402
+ reasoning_mode: {
6403
+ key: "reasoning_mode",
6404
+ label: "com_endpoint_reasoning_mode",
6405
+ labelCode: true,
6406
+ description: "com_endpoint_openai_reasoning_mode",
6407
+ descriptionCode: true,
6408
+ type: "enum",
6409
+ default: "",
6410
+ component: "slider",
6411
+ options: [
6412
+ "",
6413
+ "standard",
6414
+ "pro"
6415
+ ],
6416
+ enumMappings: {
6417
+ [""]: "com_ui_unset",
6418
+ ["standard"]: "com_ui_standard",
6419
+ ["pro"]: "com_ui_pro"
6420
+ },
6421
+ optionType: "model",
6422
+ columnSpan: 4
6423
+ },
6424
+ reasoning_context: {
6425
+ key: "reasoning_context",
6426
+ label: "com_endpoint_reasoning_context",
6427
+ labelCode: true,
6428
+ description: "com_endpoint_openai_reasoning_context",
6429
+ descriptionCode: true,
6430
+ type: "enum",
6431
+ default: "",
6432
+ component: "slider",
6433
+ options: [
6434
+ "",
6435
+ "auto",
6436
+ "current_turn",
6437
+ "all_turns"
6438
+ ],
6439
+ enumMappings: {
6440
+ [""]: "com_ui_unset",
6441
+ ["auto"]: "com_ui_auto",
6442
+ ["current_turn"]: "com_ui_current_turn",
6443
+ ["all_turns"]: "com_ui_all_turns"
6444
+ },
6445
+ optionType: "model",
6446
+ columnSpan: 4
6447
+ },
5388
6448
  verbosity: {
5389
6449
  key: "verbosity",
5390
6450
  label: "com_endpoint_verbosity",
@@ -5432,7 +6492,7 @@ const anthropic = {
5432
6492
  component: "input",
5433
6493
  description: "com_endpoint_anthropic_maxoutputtokens",
5434
6494
  descriptionCode: true,
5435
- placeholder: "com_nav_theme_system",
6495
+ placeholder: "com_endpoint_default",
5436
6496
  placeholderCode: true,
5437
6497
  range: {
5438
6498
  min: anthropicSettings.maxOutputTokens.min,
@@ -5620,7 +6680,7 @@ const bedrock = {
5620
6680
  component: "input",
5621
6681
  description: "com_endpoint_anthropic_maxoutputtokens",
5622
6682
  descriptionCode: true,
5623
- placeholder: "com_nav_theme_system",
6683
+ placeholder: "com_endpoint_default",
5624
6684
  placeholderCode: true,
5625
6685
  optionType: "model",
5626
6686
  columnSpan: 2
@@ -5752,6 +6812,14 @@ const meta = {
5752
6812
  })
5753
6813
  };
5754
6814
  const google = {
6815
+ /** Bounds the hand-rolled editor enforced through InputNumber, and they stay
6816
+ * scoped to this endpoint: the shared definition is rendered by every other
6817
+ * endpoint, whose own context windows may fall outside them. */
6818
+ maxContextTokens: createDefinition(librechat.maxContextTokens, { range: {
6819
+ min: googleSettings.maxContextTokens.min,
6820
+ max: googleSettings.maxContextTokens.max,
6821
+ step: googleSettings.maxContextTokens.step
6822
+ } }),
5755
6823
  temperature: createDefinition(baseDefinitions.temperature, {
5756
6824
  default: googleSettings.temperature.default,
5757
6825
  range: {
@@ -5793,7 +6861,7 @@ const google = {
5793
6861
  component: "input",
5794
6862
  description: "com_endpoint_google_maxoutputtokens",
5795
6863
  descriptionCode: true,
5796
- placeholder: "com_nav_theme_system",
6864
+ placeholder: "com_endpoint_default",
5797
6865
  placeholderCode: true,
5798
6866
  default: googleSettings.maxOutputTokens.default,
5799
6867
  range: {
@@ -5891,7 +6959,7 @@ const google = {
5891
6959
  const googleConfig = [
5892
6960
  librechat.modelLabel,
5893
6961
  librechat.promptPrefix,
5894
- librechat.maxContextTokens,
6962
+ google.maxContextTokens,
5895
6963
  google.maxOutputTokens,
5896
6964
  google.temperature,
5897
6965
  google.topP,
@@ -5910,7 +6978,7 @@ const googleCol1 = [
5910
6978
  librechat.promptPrefix
5911
6979
  ];
5912
6980
  const googleCol2 = [
5913
- librechat.maxContextTokens,
6981
+ google.maxContextTokens,
5914
6982
  google.maxOutputTokens,
5915
6983
  google.temperature,
5916
6984
  google.topP,
@@ -5934,11 +7002,13 @@ const openAI = [
5934
7002
  openAIParams.presence_penalty,
5935
7003
  baseDefinitions.stop,
5936
7004
  librechat.resendFiles,
5937
- baseDefinitions.imageDetail,
7005
+ librechat.imageDetail,
5938
7006
  openAIParams.web_search,
5939
7007
  openAIParams.reasoning_effort,
5940
7008
  openAIParams.useResponsesApi,
5941
7009
  openAIParams.reasoning_summary,
7010
+ openAIParams.reasoning_mode,
7011
+ openAIParams.reasoning_context,
5942
7012
  openAIParams.verbosity,
5943
7013
  openAIParams.disableStreaming,
5944
7014
  librechat.fileTokenLimit
@@ -5962,9 +7032,11 @@ const openAICol2 = [
5962
7032
  openAIParams.presence_penalty,
5963
7033
  baseDefinitions.stop,
5964
7034
  librechat.resendFiles,
5965
- baseDefinitions.imageDetail,
7035
+ librechat.imageDetail,
5966
7036
  openAIParams.reasoning_effort,
5967
7037
  openAIParams.reasoning_summary,
7038
+ openAIParams.reasoning_mode,
7039
+ openAIParams.reasoning_context,
5968
7040
  openAIParams.verbosity,
5969
7041
  openAIParams.useResponsesApi,
5970
7042
  openAIParams.web_search,
@@ -6267,13 +7339,71 @@ const agentParamSettings = Object.entries(presetSettings).reduce((acc, [key, val
6267
7339
  * Resolves model-aware defaults for a settings configuration before rendering.
6268
7340
  * Google's `maxOutputTokens` default depends on the selected Gemini model so that
6269
7341
  * current models (2.5 and 3+) surface their 64K output limit instead of the legacy 8K value.
7342
+ * Anthropic prompt-cache controls are only surfaced for models that support them.
6270
7343
  */
6271
7344
  function applyModelAwareDefaults(settings, endpoint, model) {
6272
- if (endpoint !== "google" || !model) return settings;
6273
- return settings.map((setting) => setting.key === "maxOutputTokens" ? {
6274
- ...setting,
6275
- default: googleSettings.maxOutputTokens.reset(model)
6276
- } : setting);
7345
+ if (!model) return settings;
7346
+ const modelAwareSettings = endpoint === "google" ? settings.map((setting) => {
7347
+ if (setting.key === "maxOutputTokens") return {
7348
+ ...setting,
7349
+ default: googleSettings.maxOutputTokens.reset(model)
7350
+ };
7351
+ /** The shared thinking budget range is model-agnostic, so it caps Pro below
7352
+ * its real ceiling and accepts Flash values the provider rejects. The
7353
+ * maximum and the positive floor move together. `range.min` stays -1 so
7354
+ * the "decide automatically" sentinel remains typeable. */
7355
+ if (setting.key === "thinkingBudget" && setting.range != null) {
7356
+ const bounds = getGoogleThinkingBudgetBounds(model);
7357
+ if (bounds != null) return {
7358
+ ...setting,
7359
+ range: {
7360
+ ...setting.range,
7361
+ max: bounds.max,
7362
+ positiveMin: bounds.min,
7363
+ modelSpecific: true
7364
+ }
7365
+ };
7366
+ }
7367
+ return setting;
7368
+ }) : settings;
7369
+ if (endpoint !== "anthropic" || supportsPromptCache(model)) return modelAwareSettings;
7370
+ return modelAwareSettings.filter((setting) => setting.key !== "promptCache" && setting.key !== "promptCacheTtl");
7371
+ }
7372
+ //#endregion
7373
+ //#region src/agentToolOptions.ts
7374
+ const actionDomainSeparatorRegex = /* @__PURE__ */ new RegExp("---", "g");
7375
+ /**
7376
+ * Collapses the encoded-domain suffix of an action tool name to the shape used
7377
+ * by runtime tool definitions. The operation id is deliberately preserved.
7378
+ */
7379
+ function normalizeActionToolName(toolName) {
7380
+ if (!isActionTool(toolName)) return toolName;
7381
+ const prefixEnd = toolName.lastIndexOf(actionDelimiter) + actionDelimiter.length;
7382
+ const encodedDomain = toolName.slice(prefixEnd);
7383
+ return toolName.slice(0, prefixEnd) + encodedDomain.replace(actionDomainSeparatorRegex, "_");
7384
+ }
7385
+ /**
7386
+ * Removes Code Interpreter as an allowed caller without mutating the input.
7387
+ * Tool entries and unrelated options are preserved; an empty entry is removed.
7388
+ */
7389
+ function removeCodeExecutionCaller(toolOptions) {
7390
+ if (toolOptions == null) return toolOptions;
7391
+ const normalized = {};
7392
+ for (const [toolName, options] of Object.entries(toolOptions)) {
7393
+ const callers = options.allowed_callers;
7394
+ if (callers?.includes("code_execution") !== true) {
7395
+ normalized[toolName] = options;
7396
+ continue;
7397
+ }
7398
+ const allowedCallers = callers.filter((caller) => caller !== "code_execution");
7399
+ const { allowed_callers: _removed, ...remainingOptions } = options;
7400
+ const nextOptions = allowedCallers.length > 0 ? {
7401
+ ...remainingOptions,
7402
+ allowed_callers: allowedCallers
7403
+ } : remainingOptions;
7404
+ if (Object.keys(nextOptions).length > 0) normalized[toolName] = nextOptions;
7405
+ }
7406
+ return normalized;
6277
7407
  }
6278
7408
  //#endregion
6279
7409
  //#region src/codeEnvRef.ts
@@ -6300,7 +7430,32 @@ const CODE_ENV_KINDS = [
6300
7430
  "agent",
6301
7431
  "user"
6302
7432
  ];
7433
+ function getCodeEnvRefForProfile(refs, routeKey) {
7434
+ const profileRef = refs?.codeEnvRefs?.[routeKey];
7435
+ if (profileRef) return profileRef;
7436
+ const legacyRef = refs?.codeEnvRef;
7437
+ if (legacyRef && (legacyRef.executionRouteKey ?? legacyRef.executionProfile ?? "default") === routeKey) return legacyRef;
7438
+ }
7439
+ /** Adds one profile pointer without discarding the other profile's storage object. */
7440
+ function mergeCodeEnvRef(refs, ref) {
7441
+ const codeEnvRefs = { ...refs?.codeEnvRefs };
7442
+ const legacyRef = refs?.codeEnvRef;
7443
+ if (legacyRef) codeEnvRefs[legacyRef.executionRouteKey ?? legacyRef.executionProfile ?? "default"] ??= legacyRef;
7444
+ const routeKey = ref.executionRouteKey ?? ref.executionProfile ?? "default";
7445
+ codeEnvRefs[routeKey] = ref;
7446
+ return {
7447
+ codeEnvRef: codeEnvRefs.default ?? codeEnvRefs.stateful ?? ref,
7448
+ codeEnvRefs
7449
+ };
7450
+ }
7451
+ /** Enumerates every deployment-local pointer, including legacy single-pointer records. */
7452
+ function getCodeEnvRefs(refs) {
7453
+ const merged = { ...refs?.codeEnvRefs };
7454
+ const legacyRef = refs?.codeEnvRef;
7455
+ if (legacyRef) merged[legacyRef.executionRouteKey ?? legacyRef.executionProfile ?? "default"] ??= legacyRef;
7456
+ return Object.entries(merged).flatMap(([routeKey, ref]) => ref ? [[routeKey, ref]] : []);
7457
+ }
6303
7458
  //#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 };
7459
+ export { ACTION_METADATA_FILTER_FIELDS, AGENT_INSTRUCTION_FILTER_FIELDS, 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, CONVERSATION_STARTER_FILTER_FIELDS, CONVERSATION_TITLE_FILTER_FIELDS, CacheKeys, Capabilities, CohereConstants, ComponentTypes, Constants, ContentTypes, DATE_RANGE, DEFAULT_MEMORY_MAX_INPUT_TOKENS, DynamicQueryKeys, EImageOutputType, EModelEndpoint, EToolResources, EndpointURLs, ErrorTypes, FEEDBACK_FILTER_FIELDS, FEEDBACK_RATINGS, FEEDBACK_REASON_KEYS, FEEDBACK_TAGS, FILE_FILTER_FIELDS, FILTER_PII_STARTER_PATTERNS, FetchTokenConfig, FileContext, FilePurpose, FileSources, ForkOptions, FunctionSignature, HITL_MESSAGE_FILTER_FIELDS, INSIGHTS_MAX_RANGE_DAYS, INSIGHTS_SEARCH_MAX_LENGTH, INSIGHTS_SEARCH_MIN_LENGTH, INTERFACE_PERMISSION_FIELDS, ImageDetail, ImageDetailCost, ImageVisionTool, InfiniteCollections, InvocationMode, KnownEndpoints, LocalStorageKeys, MAX_CHAT_PROJECT_DESCRIPTION_LENGTH, MAX_CHAT_PROJECT_NAME_LENGTH, MAX_GRAPH_SUBAGENT_MEMBERS, MAX_PII_CUSTOM_PATTERNS_TOTAL, MAX_PII_CUSTOM_REGEX_CHARACTERS, MAX_PII_CUSTOM_REGEX_INSTRUCTIONS, MAX_PII_PATTERNS_PER_SOURCE, MAX_PII_PATTERN_ID_LENGTH, MAX_PII_PATTERN_LABEL_LENGTH, MAX_PII_PATTERN_LENGTH, MAX_SUBAGENTS, MAX_SUBAGENTS_CEILING, MAX_SUBAGENT_DEPTH, MAX_SUBAGENT_GRAPH_NODES, MAX_SUBAGENT_RUN_CONFIGS, MCPOptionsSchema, MCPServerUserInputSchema, MCPServersSchema, MCP_SERVER_TITLE_ERROR, MCP_SERVER_TITLE_PATTERN, MCP_USER_INPUT_FIELDS, MEMORY_FILTER_FIELDS, MESSAGE_FILTER_FIELDS, MIN_REPORTABLE_RUN_STEP_DURATION_MS, MODEL_PARAMETER_FILTER_FIELDS, MYTHOS_CLASS_FAMILIES, MemoryScope, MessageContentTypes, MutationKeys, OCRStrategy, OptionTypes, PERMISSION_SUB_KEYS, PERMISSION_TYPE_INTERFACE_FIELDS, PROMPT_FILTER_FIELDS, PermissionBits, PermissionTypes, Permissions, PrincipalModel, PrincipalType, ProviderId, Providers, QueryKeys, REFILL_INTERVAL_UNITS, RUNTIME_CONFIG_INTERFACE_FIELDS, RateLimitPrefix, ReasoningContext, ReasoningEffort, ReasoningLabelEvents, ReasoningMode, ReasoningParameterFormat, ReasoningResponseKey, ReasoningSummary, RerankerTypes, ResourceType, RetentionMode, RunStatus, SCHEDULE_CRON_MAX_LENGTH, SEPARATORS, SKILL_BODY_MAX_LENGTH, SKILL_DESCRIPTION_MAX_LENGTH, SKILL_DESCRIPTION_SHORT_THRESHOLD, SKILL_DISPLAY_TITLE_MAX_LENGTH, SKILL_FILTER_FIELDS, 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, STATEFUL_CODE_ENVIRONMENTS, STORED_MESSAGE_FILTER_FIELDS, STTProviders, SafeSearchTypes, ScraperProviders, SearchCategories, SearchProviders, SettingTypes, SettingsTabValues, SettingsViews, SkillsScope, StdioOptionsSchema, SteerEvents, StepEvents, StepStatus, StepTypes, StreamableHTTPOptionsSchema, SystemCategories, SystemRoles, TOOL_ARGUMENT_FILTER_FIELDS, TTSProviders, ThinkingDisplay, ThinkingLevel, Time, TokenExchangeMethodEnum, ToolCallTypes, Tools, UsageEvents, Verbosity, ViolationTypes, VisionModes, WebSocketOptionsSchema, accessRoleSchema, accessRoleToPermBits, accordian, actionDelimiter, actionDomainSeparator, actionMetadataFilterFieldSchema, agentInstructionFilterFieldSchema, agentParamSettings, agentPermissionsSchema, agentQueuedTurnCapabilitySchema, agentQueuedTurnDurability, agentQueuedTurnFileRefSchema, agentQueuedTurnReceiptSchema, agentQueuedTurnStatuses, 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, cadenceIntervalMinutes, cadenceToCron, calendar, cancelAgentQueuedTurnResponseSchema, cancelAgentQueuedTurnSchema, capsEffortWhenThinkingDisabled, card, carousel, checkOpenAIStorage, checkbox, checkpointerSchema, checkpointerTypeSchema, clampEffortForDisabledThinking, clampOutputConfigEffort, clampSettingRange, cloudfrontConfigSchema, codeEnvironmentPermissionDecisionSchema, codeEnvironmentUserConfigSchema, codeEnvironmentUserSettingsSchema, codeInterpreterMimeTypes, codeInterpreterMimeTypesList, codeTypeMapping, coerceNumber, collapsible, compactAgentsBaseSchema, compactAgentsSchema, compactAssistantSchema, compactGoogleSchema, configSchema, contextPruningSchema, conversationStarterFilterFieldSchema, conversationTitleFilterFieldSchema, convertStringsToRegex, createPayload, createSchedulePayloadSchema, createURL, cronCadenceSchema, 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, endpointToProvider, enqueueAgentQueuedTurnResponseSchema, enqueueAgentQueuedTurnSchema, envVarRegex, errorsToString, essentialShadcnComponents, excelFileTypes, excelMimeTypes, excludedKeys, extendedModelEndpointSchema, extractDomainFromUrl, extractEnvVariable, extractVariableName, feedbackFilterFieldSchema, feedbackRatingSchema, feedbackSchema, feedbackTagKeySchema, fileCitationsPermissionsSchema, fileConfig, fileConfigSchema, fileFilterFieldSchema, fileSearchPermissionsSchema, fileSourceSchema, fileStorageSchema, fileStrategiesSchema, filterPiiActionSchema, filterPiiCustomPatternSchema, filterPiiRegexSchema, filterPiiStarterPatternSchema, filtersConfigSchema, findLastSeparatorIndex, fullMimeTypesList, generateDynamicSchema, generateGoogleSchema, generateOpenAISchema, getCodeEnvRefForProfile, getCodeEnvRefs, getConfigDefaults, getConfiguredMimeAccept, getDefaultParamsEndpoint, getEnabledEndpoints, getEndpointField, getEndpointFileConfig, getEphemeralSender, getFirstDefinedValue, getGoogleThinkingBudgetBounds, getGoogleThinkingBudgetMax, getMaxSubagents, getModelKey, getNonEmptyValue, getPiiRegexProgramSize, getRefillEligibilityDate, getResourcePermissionsResponseSchema, getResponseSender, getRunStepDurationMs, getSchemaDefaults, getSettingsKeys, getTagByKey, getTagsForRating, getTokenHeader, googleBaseSchema, googleGenConfigSchema, googleSchema, googleSettings, hasActiveFiltersConfig, hasActivePiiFields, hasActivePiiPatterns, hasPermissions, hasProcessMCPServerConfig, hostImageIdSuffix, hostImageNamePrefix, hoverCard, imageDetailNumeric, imageDetailValue, imageExtRegex, imageGenTools, imageMimeTypes, imageTypeMapping, inferMimeType, initialModelsConfig, input, inputTokensIncludesCache, interfaceSchema, isActionTool, isAgentsEndpoint, isAnthropicDocumentType, isAnthropicTextDocumentType, isAssistantsEndpoint, isBedrockDocumentType, isCronCadence, isDocumentSupportedProvider, isEphemeralAgentId, isImageVisionTool, isMythosClassModel, isOpenAILikeProvider, isParamEndpoint, isPermissiveMimeConfig, isProcessMCPServerConfig, isProcessMCPServerField, isRemoteOidcUrlAllowed, isReportableRunStepDuration, isSecureCodeEnvironmentControlURL, isSensitiveEnvVar, isSystemRoleName, isThinkingDisabled, isUUID, isValidCronExpression, knownEndpointToProvider, label, langfuseConfigSchema, librechat, listAgentQueuedTurnsResponseSchema, listAgentQueuedTurnsSchema, loginPage, mapGroupToAzureConfig, mapModelToAzureConfig, marketplacePermissionsSchema, materializeModelSpecEndpoints, mbToBytes, mcpServersPermissionsSchema, megabyte, memoryFilterFieldSchema, memoryPermissionsSchema, memorySchema, menuBar, mergeCodeEnvRef, mergeFileConfig, messageFilterFieldSchema, messageFilterPiiSchema, messageFilterSchema, mimeTypeAliases, modelConfigSchema, modelParameterFilterFieldSchema, modelSpecSubagentsSchema, modularEndpoints, multiConvoPermissionsSchema, navigationMenu, nextRunInstants, normalizeActionToolName, normalizeEndpointName, normalizeMCPToolKey, normalizeSearxngEngines, normalizeServerName, ocrSchema, omitsSamplingParameters, omitsThinkingByDefault, openAIBaseSchema, openAISchema, openAISettings, openRouterSchema, openapiToFunction, orderEndpointsConfig, pagination, paramDefinitionSchema, paramEndpoints, paramSettings, parseCompactConvo, parseConvo, parseEphemeralAgentId, parseLangChainErrorCode, parseTextParts, peoplePickerPermissionsSchema, permBitsToAccessLevel, permissionEntrySchema, permissionsSchema, popover, presetSettings, principalSchema, progress, promptFilterFieldSchema, promptPermissionsSchema, promptTokensFromUsage, providerEndpointMap, radioGroup, rateLimitSchema, reconcileContextUsage, registerPage, remoteAgentsPermissionsSchema, removeCodeExecutionCaller, removeNullishValues, replaceSpecialVars, request_default as request, requiresExplicitThinkingDisabled, resolveAgentSkillsScope, resolveAllowedStatefulCodeEnvironments, resolveEndpointType, resolveModelCatalogKey, resolveModelSpecEndpoint, resolveProviderId, resolveRef, resolveStatefulCodeEnvironment, resolveThinkingDisplay, resourcePermissionsResponseSchema, retainRecentConfigSchema, retrievalMimeTypes, retrievalMimeTypesList, roleDefaults, roleSchema, runCodePermissionsSchema, scheduleCadenceSchema, scheduleFrequencies, scheduleStructuredFrequencies, scheduleTargets, schedulesPermissionsSchema, select, separator, setAcceptLanguageHeader, setFileConfigRegexCompiler, setMaxSubagents, setMessageFilterRegexValidator, setTokenHeader, sha1, shadcnComponents, sharedFileDownload, sharedLinksPermissionsSchema, skeleton, skillFilterFieldSchema, skillPermissionsSchema, skillSyncConfigSchema, skillSyncGitHubSourceSchema, slider, specialVariables, specsConfigSchema, splitMCPToolKey, splitToolCallName, stripAgentIdSuffix, stripLangChainTroubleshootingUrl, stripReasoningLabelMetadata, stripServerNamePrefix, stripServerNamePrefixes, structuredCadenceSchema, subagentThreadLineageSchema, summarizationConfigSchema, summarizationTriggerSchema, supportedMimeTypes, supportsAdaptiveThinking, supportsBalanceCheck, supportsContext1m, supportsFiles, supportsPromptCache, 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, toolArgumentFilterFieldSchema, tooltip, transactionsSchema, turnstileOptionsSchema, turnstileSchema, unattributedAssistantContentSchema, updateResourcePermissionsRequestSchema, updateResourcePermissionsResponseSchema, updateSchedulePayloadSchema, useToast, userSubmittedMessageFieldPathSchema, utils, validateActionDomain, validateAndParseOpenAPISpec, validateAzureGroups, validateSettingDefinitions, validateVisionModel, vertexAISchema, vertexModelConfigSchema, videoMimeTypes, visionModels, webSearchPermissionsSchema, webSearchSchema };
6305
7460
 
6306
7461
  //# sourceMappingURL=index.mjs.map