librechat-data-provider 0.8.522 → 0.8.524

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 (57) hide show
  1. package/dist/{data-service-CaB7saTP.mjs → data-service-B-WUVvTH.mjs} +1044 -173
  2. package/dist/data-service-B-WUVvTH.mjs.map +1 -0
  3. package/dist/{data-service-D5kHzBt-.js → data-service-CUG1qdeC.js} +1426 -207
  4. package/dist/data-service-CUG1qdeC.js.map +1 -0
  5. package/dist/index.js +886 -74
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +780 -70
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/react-query/index.js +1 -1
  10. package/dist/react-query/index.mjs +1 -1
  11. package/dist/types/accessPermissions.d.ts +54 -1
  12. package/dist/types/actions.d.ts +1 -1
  13. package/dist/types/agentToolOptions.d.ts +1 -1
  14. package/dist/types/api-endpoints.d.ts +7 -0
  15. package/dist/types/backgroundResults.d.ts +13 -0
  16. package/dist/types/balance.d.ts +4 -0
  17. package/dist/types/bedrock.d.ts +132 -65
  18. package/dist/types/code/approval.d.ts +26 -0
  19. package/dist/types/code/worker.d.ts +10 -0
  20. package/dist/types/code/workspace.d.ts +50 -0
  21. package/dist/types/codeEnvRef.d.ts +5 -0
  22. package/dist/types/config.d.ts +5859 -2469
  23. package/dist/types/data-service.d.ts +22 -12
  24. package/dist/types/errors.d.ts +2 -0
  25. package/dist/types/file-config.d.ts +179 -12
  26. package/dist/types/filters.d.ts +97 -97
  27. package/dist/types/footer.d.ts +20 -0
  28. package/dist/types/generate.d.ts +48 -24
  29. package/dist/types/index.d.ts +11 -0
  30. package/dist/types/keys.d.ts +13 -2
  31. package/dist/types/limits.d.ts +8 -0
  32. package/dist/types/mcp.d.ts +683 -30
  33. package/dist/types/messages.d.ts +25 -1
  34. package/dist/types/models.d.ts +312 -183
  35. package/dist/types/parameterSettings.d.ts +10 -1
  36. package/dist/types/parsers.d.ts +25 -1
  37. package/dist/types/providers.d.ts +1 -0
  38. package/dist/types/resolve-llm-delivery-path.d.ts +161 -0
  39. package/dist/types/schemas.d.ts +771 -457
  40. package/dist/types/svg.d.ts +34 -0
  41. package/dist/types/types/agents.d.ts +257 -2
  42. package/dist/types/types/assistants.d.ts +2 -617
  43. package/dist/types/types/content.d.ts +286 -0
  44. package/dist/types/types/files.d.ts +48 -1
  45. package/dist/types/types/insights.d.ts +9 -0
  46. package/dist/types/types/mutations.d.ts +3 -2
  47. package/dist/types/types/queries.d.ts +8 -1
  48. package/dist/types/types/queuedTurns.d.ts +140 -106
  49. package/dist/types/types/runs.d.ts +33 -5
  50. package/dist/types/types/schedules.d.ts +40 -7
  51. package/dist/types/types/skills.d.ts +43 -0
  52. package/dist/types/types/tools.d.ts +132 -0
  53. package/dist/types/types/traces.d.ts +134 -0
  54. package/dist/types/types.d.ts +72 -2
  55. package/package.json +2 -2
  56. package/dist/data-service-CaB7saTP.mjs.map +0 -1
  57. package/dist/data-service-D5kHzBt-.js.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
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";
1
+ import { $ as permissionEntrySchema, $a as Providers, $c as envVarRegex, $i as isResponsesApiUpload, $n as isSpeechProviderConfigured, $o as isAssistantsEndpoint, $r as SSEOptionsSchema, $s as CODE_WORKSPACE_MAX_COUNT, $t as SearchCategories, Aa as validateSettingDefinitions, Ac as actionMetadataFilterFieldSchema, Ai as defaultOCRMimeTypes, An as codeEnvironmentUserSettingsSchema, Ao as eReasoningContextSchema, Ar as summarizationTriggerSchema, As as Tools, At as FetchTokenConfig, B as MutationKeys, Ba as DEFAULT_BALANCE_RESERVATION_TTL_MS, Bc as filtersConfigSchema, Bi as getConfiguredMimeAccept, Bn as excludedKeys, Bo as extendedModelEndpointSchema, Br as validateVisionModel, Bs as FEEDBACK_REASON_KEYS, Bt as MAX_SUBAGENT_GRAPH_NODES, Ca as ComponentTypes, Cc as MEMORY_FILTER_FIELDS, Ci as bedrockDocumentFormats, Cn as bedrockModels, Co as compactGoogleSchema, Cr as skillSyncGitHubSourceSchema, Cs as tModelSpecPresetSchema, Ct as DEFAULT_AGENT_MODEL_RESPONSE_HEADERS_TIMEOUT_MS, Da as generateDynamicSchema, Dc as SKILL_FILTER_FIELDS, Di as codeTypeMapping, Dn as cloudfrontConfigSchema, Do as eAnthropicEffortSchema, Dr as stripServerNamePrefix, Ds as tQueryParamsSchema, Dt as EImageOutputType, Ea as clampSettingRange, Ec as PROMPT_FILTER_FIELDS, Ei as codeInterpreterMimeTypesList, En as checkpointerTypeSchema, Eo as documentSupportedProviders, Er as splitToolCallName, Es as tPresetSchema, Et as DEFAULT_OAUTH_STATE_TTL_MS, F as request_default, Fa as MAX_GRAPH_SUBAGENT_MEMBERS, Fc as fileFilterFieldSchema, Fi as excelFileTypes, Fn as defaultEndpoints, Fo as eReasoningSummarySchema, Fr as traceViewerDefaults, Fs as CodeApprovalModeError, Ft as LANGFUSE_TRACE_CONVERSATION_METADATA_FIELDS, G as PrincipalType, Ga as AuthType, Gc as memoryFilterFieldSchema, Gi as imageTypeMapping, Gn as getDefaultParamsEndpoint, Go as googleBaseSchema, Gr as MAX_MCP_ICON_PATH_LENGTH, Gs as getTagByKey, Gt as RetentionMode, H as AccessRoleIds, Ha as REFILL_INTERVAL_UNITS, Hc as hasActiveFiltersConfig, Hi as getEndpointFileConfig, Hn as fileStorageSchema, Ho as getGoogleThinkingBudgetMax, Hr as vertexModelConfigSchema, Hs as feedbackRatingSchema, Ht as OCRStrategy, I as getTokenHeader, Ia as MAX_SUBAGENTS, Ic as filterPiiActionSchema, Ii as excelMimeTypes, In as defaultModels, Io as eThinkingDisplaySchema, Ir as traceViewerLimits, Is as getAllowedCodeApprovalModes, It as LANGFUSE_TRACE_USER_ID_FIELDS, J as accessRoleToPermBits, Ja as EModelEndpoint, Jc as promptFilterFieldSchema, Ji as isAnthropicTextDocumentType, Jn as imageGenTools, Jo as googleSettings, Jr as MCPServerUserInputSchema, Js as CODE_ENVIRONMENT_DECISION_VERSION, Jt as SKILL_SYNC_MAX_INTERVAL_MINUTES, K as ResourceType, Ka as BedrockProviders, Kc as messageFilterFieldSchema, Ki as inferMimeType, Kn as getEndpointField, Ko as googleGenConfigSchema, Kr as MAX_MCP_OAUTH_PERSISTENCE_WAIT_MS, Ks as getTagsForRating, Kt as SKILL_SYNC_DEFAULT_DISCOVERY_DEPTH, L as setAcceptLanguageHeader, La as MAX_SUBAGENTS_CEILING, Lc as filterPiiCustomPatternSchema, Li as fileConfig, Ln as defaultRetrievalModels, Lo as eThinkingLevelSchema, Lr as transactionsSchema, Ls as resolveCodeApprovalMode, Lt as LANGFUSE_TRACE_USER_METADATA_FIELDS, Ma as DEFAULT_RETAINED_ANSWER_TOKENS, Mc as conversationStarterFilterFieldSchema, Mi as defaultTextMimeTypes, Mn as contextPruningSchema, Mo as eReasoningModeSchema, Mr as toolApprovalHookConfigSchema, Ms as actionDomainSeparator, Mt as ImageDetailCost, Na as MAX_CHAT_PROJECT_DESCRIPTION_LENGTH, Nc as conversationTitleFilterFieldSchema, Ni as documentParserMimeTypes, Nn as defaultAgentCapabilities, No as eReasoningParameterFormatSchema, Nr as toolApprovalModeSchema, Ns as isActionTool, Nt as InfiniteCollections, Oa as generateGoogleSchema, Oc as STORED_MESSAGE_FILTER_FIELDS, Oi as convertStringsToRegex, On as codeEnvironmentPermissionDecisionSchema, Oo as eImageDetailSchema, Or as stripServerNamePrefixes, Os as tSharedLinkSchema, Ot as EndpointURLs, Pa as MAX_CHAT_PROJECT_NAME_LENGTH, Pc as feedbackFilterFieldSchema, Pi as endpointFileConfigSchema, Pn as defaultAssistantsVersion, Po as eReasoningResponseKeySchema, Pr as toolApprovalPolicySchema, Ps as CODE_APPROVAL_MODES, Pt as KnownEndpoints, Q as permBitsToAccessLevel, Qa as MemoryScope, Qc as userSubmittedMessageFieldPathSchema, Qi as isPermissiveMimeConfig, Qn as isSecureCodeEnvironmentControlURL, Qo as isAgentsEndpoint, Qr as MCP_USER_INPUT_FIELDS, Qs as CODE_WORKSPACE_INSTANCE_TYPES, Qt as ScraperProviders, R as setTokenHeader, Ra as getMaxSubagents, Rc as filterPiiRegexSchema, Ri as fileConfigSchema, Rn as defaultSocialLogins, Ro as eVerbositySchema, Rr as turnstileOptionsSchema, Rs as resolveCodePermissionDecision, Rt as LocalStorageKeys, Sa as resolveStatefulCodeEnvironment, Sc as MAX_PII_PATTERN_LENGTH, Si as bedrockDocumentExtensions, Sn as bedrockGuardrailConfigSchema, So as compactAssistantSchema, Sr as skillSyncConfigSchema, Ss as tMessageSchema, St as DEFAULT_AGENT_MODEL_RESPONSE_BODY_TIMEOUT_MS, Ta as SettingTypes, Tc as MODEL_PARAMETER_FILTER_FIELDS, Ti as codeInterpreterMimeTypes, Tn as checkpointerSchema, To as defaultAssistantFormValues, Tr as splitMCPToolKey, Ts as tPluginSchema, Tt as DEFAULT_MEMORY_MAX_INPUT_TOKENS, U as PermissionBits, Ua as getRefillEligibilityDate, Uc as hasActivePiiFields, Ui as imageExtRegex, Un as fileStrategiesSchema, Uo as getModelKey, Ur as visionModels, Us as feedbackSchema, Ut as RateLimitPrefix, V as QueryKeys, Va as MIN_BALANCE_RESERVATION_TTL_MS, Vc as getPiiRegexProgramSize, Vi as getDocumentFileExtension, Vn as fileSourceSchema, Vo as getGoogleThinkingBudgetBounds, Vr as vertexAISchema, Vs as FEEDBACK_TAGS, Vt as MAX_SUBAGENT_RUN_CONFIGS, W as PrincipalModel, Wa as AnthropicEffort, Wc as hasActivePiiPatterns, Wi as imageMimeTypes, Wn as getConfigDefaults, Wo as getSettingsKeys, Wr as webSearchSchema, Ws as feedbackTagKeySchema, Wt as RerankerTypes, X as getResourcePermissionsResponseSchema, Xa as ImageVisionTool, Xc as toolArgumentFilterFieldSchema, Xi as isExplicitMimeConfig, Xn as interfaceSchema, Xo as imageDetailValue, Xr as MCP_SERVER_TITLE_ERROR, Xs as CODE_ENVIRONMENT_MOVE_VERSION, Xt as STTProviders, Y as effectivePermissionsResponseSchema, Ya as ImageDetail, Yc as skillFilterFieldSchema, Yi as isBedrockDocumentType, Yn as initialModelsConfig, Yo as imageDetailNumeric, Yr as MCPServersSchema, Ys as CODE_ENVIRONMENT_MODES, Yt as SKILL_SYNC_MIN_INTERVAL_MINUTES, Z as hasPermissions, Za as MYTHOS_CLASS_FAMILIES, Zc as unattributedAssistantContentSchema, Zi as isMessageFileUpload, Zn as isRemoteOidcUrlAllowed, Zo as inputTokensIncludesCache, Zr as MCP_SERVER_TITLE_PATTERN, Zs as CODE_WORKSPACE_ID_PATTERN, Zt as SafeSearchTypes, _a as resolveModelSpecEndpoint, _c as MAX_PII_CUSTOM_REGEX_CHARACTERS, _i as sharedFileDownload, _n as azureGroupConfigsSchema, _o as authTypeSchema, _r as rateLimitSchema, _s as tBannerSchema, _t as CODE_ENVIRONMENT_QUEUE_WAIT_DEFAULT_MS, a as data_service_exports, aa as resolveEffectiveUseResponsesApi, ac as isCodeWorkspaceSelectionErrorReason, ai as isProcessMCPServerField, an as Time, ao as ReasoningSummary, ar as messageFilterPiiSchema, as as isOpenAILikeProvider, at as FilePurpose, ba as STATEFUL_CODE_ENVIRONMENTS, bc as MAX_PII_PATTERN_ID_LENGTH, bi as applicationMimeTypes, bn as baseEndpointSchema, bo as compactAgentsBaseSchema, br as retainRecentConfigSchema, bs as tConvoUpdateSchema, bt as CohereConstants, ca as retrievalMimeTypes, cc as ACTION_METADATA_FILTER_FIELDS, ci as TokenExchangeMethodEnum, cn as agentsEndpointSchema, co as ThinkingLevel, cr as modularEndpoints, cs as mediaSupportedProviders, ct as AGENT_BACKGROUND_COMPLETION_RESULT_MAX_CHARS_DEFAULT, da as supportedMimeTypes, dc as CONVERSATION_TITLE_FILTER_FIELDS, di as FileSources, dn as anthropicEndpointSchema, do as agentsSchema, dr as normalizeServerName, ds as openAISettings, dt as AgentCapabilities, ea as mbToBytes, ec as CODE_WORKSPACE_OPERATIONS, ei as StdioOptionsSchema, el as extractEnvVariable, en as SearchProviders, eo as ReasoningContext, er as langfuseConfigSchema, es as isDocumentSupportedProvider, et as principalSchema, fa as supportsFiles, fc as FEEDBACK_FILTER_FIELDS, fi as checkOpenAIStorage, fn as askUserQuestionConfigSchema, fo as agentsSettings, fr as ocrSchema, fs as openRouterSchema, ft as AuthKeys, ga as modelSpecSubagentsSchema, gc as MAX_PII_CUSTOM_PATTERNS_TOTAL, gi as registerPage, gn as azureEndpointSchema, go as assistantSchema, gr as providerEndpointMap, gs as subagentThreadLineageSchema, gt as CODE_ENVIRONMENT_COMMAND_TIMEOUT_HARD_MAX_MS, ha as materializeModelSpecEndpoints, hc as HITL_MESSAGE_FILTER_FIELDS, hi as loginPage, hn as azureBaseSchema, ho as anthropicSettings, hr as permissionWriteAttemptsSchema, hs as resolveAgentSkillsScope, ht as CODE_ENVIRONMENT_COMMAND_TIMEOUT_DEFAULT_MS, ia as prefersResponsesApiByModel, ic as isCodeWorkspaceSelection, ii as isProcessMCPServerConfig, in as TTSProviders, io as ReasoningResponseKey, ir as memorySchema, is as isMythosClassModel, it as AssistantStreamEvents, ja as DEFAULT_MAX_RETAINED_TOOL_COUNT_CHARS, jc as agentInstructionFilterFieldSchema, ji as defaultSTTMimeTypes, jn as configSchema, jo as eReasoningEffortSchema, jr as supportsBalanceCheck, js as actionDelimiter, jt as ForkOptions, ka as generateOpenAISchema, kc as TOOL_ARGUMENT_FILTER_FIELDS, ki as defaultLLMDeliveryPathSchema, kn as codeEnvironmentUserConfigSchema, ko as eModelEndpointSchema, kr as summarizationConfigSchema, ks as EToolResources, kt as ErrorTypes, la as retrievalMimeTypesList, lc as AGENT_INSTRUCTION_FILTER_FIELDS, li as agentGitIdentitySchema, ln as allowedAddressesSchema, lo as Verbosity, lr as normalizeMCPToolKey, ls as openAIBaseSchema, lt as AGENT_BACKGROUND_COMPLETION_RESULT_MAX_CHARS_HARD_MAX, ma as videoMimeTypes, mc as FILTER_PII_STARTER_PATTERNS, mi as buildLoginRedirectUrl, mn as assistantEndpointSchema, mo as anthropicSchema, mr as paramDefinitionSchema, ms as removeNullishValues, mt as BASE_PRINCIPAL_CONFIG_SECTIONS, na as mergeFileConfig, nc as isCodeEnvironmentMode, ni as WebSocketOptionsSchema, nl as isSensitiveEnvVar, nn as SettingsViews, no as ReasoningMode, nr as listConfiguredSpeechProviders, ns as isKnownProviderIdentifier, nt as updateResourcePermissionsRequestSchema, oa as resolveSandboxFilename, oc as isCodeWorkspaceSelections, oi as AuthTypeEnum, on as ViolationTypes, oo as SkillsScope, or as messageFilterSchema, os as isParamEndpoint, ot as RunStatus, pa as textMimeTypes, pc as FILE_FILTER_FIELDS, pi as apiBaseUrl, pn as askUserQuestionRetainedAnswersSchema, po as anthropicBaseSchema, pr as openIdDiscoverySchema, ps as paramEndpoints, pt as BASE_ONLY_CONFIG_SECTIONS, q as accessRoleSchema, qa as BedrockReasoningConfig, qc as modelParameterFilterFieldSchema, qi as isAnthropicDocumentType, qn as getSchemaDefaults, qo as googleSchema, qr as MCPOptionsSchema, qs as toMinimalFeedback, qt as SKILL_SYNC_MAX_DISCOVERY_DEPTH, ra as mimeTypeAliases, rc as isCodeWorkspaceEnvironment, ri as hasProcessMCPServerConfig, rl as normalizeEndpointName, rn as SystemCategories, ro as ReasoningParameterFormat, rr as mcpRefreshDefaults, rs as isMediaSupportedProvider, rt as updateResourcePermissionsResponseSchema, sa as resolveUseResponsesApi, sc as isRepositoryInstructionDescriptor, si as AuthorizationTypeEnum, sn as VisionModes, so as ThinkingDisplay, sr as modelConfigSchema, ss as isUUID, st as defaultOrderQuery, ta as megabyte, tc as CODE_WORKSPACE_SELECTION_ERROR_REASONS, ti as StreamableHTTPOptionsSchema, tl as extractVariableName, tn as SettingsTabValues, to as ReasoningEffort, tr as langfuseTraceConfigSchema, ts as isImageVisionTool, tt as resourcePermissionsResponseSchema, ua as setFileConfigRegexCompiler, uc as CONVERSATION_STARTER_FILTER_FIELDS, ui as FileContext, un as alternateName, uo as agentsBaseSchema, ur as normalizeSearxngEngines, us as openAISchema, ut as AUTH_USER_DOC_BY_ID_PREFIX, va as specsConfigSchema, vc as MAX_PII_CUSTOM_REGEX_INSTRUCTIONS, vi as DEFAULT_SKILL_IMPORT_CLEANUP_CONCURRENCY, vn as azureGroupSchema, vo as cacheSubsetProviders, vr as resolveEndpointType, vs as tConversationSchema, vt as CacheKeys, wa as OptionTypes, wc as MESSAGE_FILTER_FIELDS, wi as bedrockDocumentMimeTypes, wn as buildServerNameAliases, wo as defaultAgentFormValues, wr as specialVariables, ws as tPluginAuthConfigSchema, wt as DEFAULT_MAX_PROVIDER_ERROR_CHARS, xa as resolveAllowedStatefulCodeEnvironments, xc as MAX_PII_PATTERN_LABEL_LENGTH, xi as audioMimeTypes, xn as bedrockEndpointSchema, xo as compactAgentsSchema, xr as setMessageFilterRegexValidator, xs as tExampleSchema, xt as Constants, ya as tModelSpecSchema, yc as MAX_PII_PATTERNS_PER_SOURCE, yi as DefaultLLMDeliveryPath, yn as balanceSchema, yo as coerceNumber, yr as resolveTraceViewerConfig, ys as tConversationTagSchema, yt as Capabilities, z as DynamicQueryKeys, za as setMaxSubagents, zc as filterPiiStarterPatternSchema, zi as fullMimeTypesList, zn as endpointSchema, zo as endpointSettings, zr as turnstileSchema, zs as FEEDBACK_RATINGS, zt as MAX_SUBAGENT_DEPTH } from "./data-service-B-WUVvTH.mjs";
2
2
  import { z } from "zod";
3
3
  import dayjs from "dayjs";
4
4
  import utc from "dayjs/plugin/utc.js";
@@ -9,13 +9,18 @@ import { URL } from "url";
9
9
  import crypto from "crypto";
10
10
  import { load } from "js-yaml";
11
11
  //#region src/bedrock.ts
12
+ const THINKING_BINDING_BETA = "thinking-binding-controls-2026-08-01";
12
13
  const DEFAULT_THINKING_BUDGET = 2e3;
13
14
  const BEDROCK_CLAUDE_SONNET_4_6_MAX_OUTPUT = 64e3;
14
15
  const BEDROCK_OUTPUT_128K_BETA = "output-128k-2025-02-19";
15
16
  const BEDROCK_FINE_GRAINED_TOOL_STREAMING_BETA = "fine-grained-tool-streaming-2025-05-14";
16
17
  /** Betas LibreChat injects itself, safe to strip from persisted AMRF when a
17
18
  * 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]);
19
+ const GENERATED_BEDROCK_BETAS = new Set([
20
+ BEDROCK_OUTPUT_128K_BETA,
21
+ BEDROCK_FINE_GRAINED_TOOL_STREAMING_BETA,
22
+ THINKING_BINDING_BETA
23
+ ]);
19
24
  const bedrockReasoningConfigValues = new Set(Object.values(BedrockReasoningConfig));
20
25
  /**
21
26
  * Resolves the final `thinking.display` value for an adaptive-thinking request.
@@ -59,6 +64,13 @@ function parseOpusVersion(model) {
59
64
  };
60
65
  return null;
61
66
  }
67
+ /** Opus 5.5 has an always-on, conversation-bound thinking contract unlike Opus 5. */
68
+ function isOpus55Model(model) {
69
+ const opus = parseOpusVersion(model);
70
+ return opus?.major === 5 && opus.minor === 5;
71
+ }
72
+ /** LibreChat permits edits and compaction of earlier turns; drop only invalidated blocks. */
73
+ const OPUS_55_BLOCK_BINDING = { prefix_mismatch_behavior: "drop_block" };
62
74
  /** Extracts sonnet major/minor version from both naming formats.
63
75
  * Uses bounded minor capture to avoid matching date suffixes (e.g., -20250514). */
64
76
  function parseSonnetVersion(model) {
@@ -127,6 +139,7 @@ function omitsSamplingParameters(model) {
127
139
  * See https://platform.claude.com/docs/en/about-claude/models/migration-guide#migrating-to-claude-sonnet-5
128
140
  */
129
141
  function requiresExplicitThinkingDisabled(model) {
142
+ if (isOpus55Model(model)) return false;
130
143
  const sonnet = parseSonnetVersion(model);
131
144
  if (sonnet != null && sonnet.major >= 5) return true;
132
145
  const opus = parseOpusVersion(model);
@@ -144,6 +157,7 @@ const EFFORTS_REJECTED_WHEN_THINKING_DISABLED = new Set(["xhigh", "max"]);
144
157
  * off, so the cap is Opus 5+ only.
145
158
  */
146
159
  function capsEffortWhenThinkingDisabled(model) {
160
+ if (isOpus55Model(model)) return false;
147
161
  const opus = parseOpusVersion(model);
148
162
  return opus != null && opus.major >= 5;
149
163
  }
@@ -216,6 +230,7 @@ function isBedrockClaudeModel(model) {
216
230
  * @returns Array of beta header strings, or empty array if not applicable
217
231
  */
218
232
  function getBedrockAnthropicBetaHeaders(model) {
233
+ if (isOpus55Model(model)) return [THINKING_BINDING_BETA];
219
234
  const betaHeaders = [];
220
235
  /** Mythos-class (Fable/Mythos) is intentionally not matched: these betas are built-in/no-op for the
221
236
  * 4.7+ generation (Fable has native 128K output), so omitting them on Bedrock is lossless. */
@@ -363,7 +378,7 @@ const bedrockInputParser = tConversationSchema.pick({
363
378
  /** Persisted AMRF is spread into the final request, so clearing only
364
379
  * `additionalFields` leaves a stale value from a prior selection. */
365
380
  const persistedAmrf = typedData.additionalModelRequestFields;
366
- const thinkingDisabled = additionalFields.thinking === false;
381
+ const thinkingDisabled = additionalFields.thinking === false && !isOpus55Model(typedData.model);
367
382
  const effort = additionalFields.effort;
368
383
  if (typeof effort === "string" && effort !== "") additionalFields.output_config = { effort };
369
384
  else if (effort !== void 0 && persistedAmrf)
@@ -379,7 +394,7 @@ const bedrockInputParser = tConversationSchema.pick({
379
394
  * `effort`, so the branch above leaves it untouched).
380
395
  */
381
396
  if (thinkingDisabled) [additionalFields, persistedAmrf].forEach((target) => clampOutputConfigEffort(typedData.model, target?.output_config));
382
- if (additionalFields.thinking === false) {
397
+ if (thinkingDisabled) {
383
398
  delete additionalFields.thinkingBudget;
384
399
  delete additionalFields.thinkingDisplay;
385
400
  if (requiresExplicitThinkingDisabled(typedData.model)) additionalFields.thinking = { type: "disabled" };
@@ -401,6 +416,7 @@ const bedrockInputParser = tConversationSchema.pick({
401
416
  const topLevelDisplay = additionalFields.thinkingDisplay;
402
417
  const persistedDisplay = extractPersistedDisplay(typedData.additionalModelRequestFields);
403
418
  const thinkingConfig = { type: "adaptive" };
419
+ if (isOpus55Model(typedData.model)) thinkingConfig.block_binding = { ...OPUS_55_BLOCK_BINDING };
404
420
  const display = resolveThinkingDisplay(typedData.model, topLevelDisplay ?? persistedDisplay);
405
421
  if (display) thinkingConfig.display = display;
406
422
  additionalFields.thinking = thinkingConfig;
@@ -705,6 +721,10 @@ let ReasoningLabelEvents = /* @__PURE__ */ function(ReasoningLabelEvents) {
705
721
  ReasoningLabelEvents["ON_REASONING_LABEL_ATTEMPT"] = "on_reasoning_label_attempt";
706
722
  return ReasoningLabelEvents;
707
723
  }({});
724
+ const finiteNonNegativeInteger = (value) => {
725
+ if (typeof value !== "number" || !Number.isFinite(value)) return;
726
+ return Math.min(Number.MAX_SAFE_INTEGER, Math.max(0, Math.floor(value)));
727
+ };
708
728
  /**
709
729
  * Full prompt token count for one completed model call — the EXACT context the
710
730
  * model saw, provider-aware: additive providers (Bedrock) report `input_tokens`
@@ -716,37 +736,114 @@ let ReasoningLabelEvents = /* @__PURE__ */ function(ReasoningLabelEvents) {
716
736
  * gauge reconciles its calibrated estimate to.
717
737
  */
718
738
  const promptTokensFromUsage = (event) => {
719
- const input = event.input_tokens ?? 0;
739
+ const input = finiteNonNegativeInteger(event.input_tokens) ?? 0;
720
740
  const details = event.input_token_details ?? {};
721
- const cacheRead = details.cache_read ?? 0;
722
- const cacheCreation = details.cache_creation ?? 0;
723
- return (event.provider != null ? inputTokensIncludesCache(event.provider) : cacheRead + cacheCreation <= input) ? input : input + cacheRead + cacheCreation;
741
+ const cacheRead = finiteNonNegativeInteger(details.cache_read) ?? 0;
742
+ const cacheCreation = finiteNonNegativeInteger(details.cache_creation) ?? 0;
743
+ return (event.provider != null ? inputTokensIncludesCache(event.provider) : cacheRead + cacheCreation <= input) ? input : Math.min(Number.MAX_SAFE_INTEGER, input + cacheRead + cacheCreation);
744
+ };
745
+ /**
746
+ * Scales per-tool result-message counts while bounding both malformed input and
747
+ * rounding error. Null-prototype records keep tool names as ordinary data keys;
748
+ * cumulative apportionment preserves the scaled sum in one linear pass.
749
+ */
750
+ const scaleToolMessageTokenCounts = (value, oldTotal, newTotal) => {
751
+ if (value == null || typeof value !== "object" || Array.isArray(value)) return;
752
+ const scaled = Object.create(null);
753
+ let remaining = oldTotal;
754
+ let cumulative = 0;
755
+ let allocated = 0;
756
+ let found = false;
757
+ for (const [name, rawCount] of Object.entries(value)) {
758
+ const count = finiteNonNegativeInteger(rawCount);
759
+ if (count == null || count === 0) continue;
760
+ const bounded = Math.min(count, remaining);
761
+ remaining -= bounded;
762
+ cumulative += bounded;
763
+ const target = oldTotal > 0 ? Math.round(cumulative / oldTotal * newTotal) : 0;
764
+ const apportioned = target - allocated;
765
+ allocated = target;
766
+ if (apportioned > 0) {
767
+ scaled[name] = apportioned;
768
+ found = true;
769
+ }
770
+ }
771
+ return found ? scaled : void 0;
724
772
  };
725
773
  /**
726
774
  * Reconciles a pre-invoke context snapshot's CALIBRATED estimate to a call's
727
775
  * ACTUAL prompt tokens. The SDK's calibration multiplier scales only
728
- * `messageTokens` (instructions/summary are raw tiktoken counts), and it can
776
+ * `messageTokens` (instructions/summary are raw tiktoken counts) and can
729
777
  * over-shoot badly when a provider injects server-side content the SDK never
730
778
  * counted (e.g. Anthropic web search) — pinning the gauge several× too high and
731
779
  * persisting it. Trust the provider's own prompt count: keep the raw
732
- * instruction/summary rows, set `messageTokens` to the remainder, and recompute
733
- * the free space. No-op when `promptTokens` is unusable.
780
+ * instruction/summary rows, set `messageTokens` to the remainder, recompute the
781
+ * free space, and rescale the `toolMessageTokens` share to the new message
782
+ * total. No-op when `promptTokens` is unusable.
734
783
  */
735
784
  const reconcileContextUsage = (snapshot, promptTokens) => {
736
785
  if (!Number.isFinite(promptTokens) || promptTokens <= 0) return snapshot;
786
+ const normalizedPromptTokens = Math.min(Number.MAX_SAFE_INTEGER, Math.floor(promptTokens));
787
+ if (normalizedPromptTokens <= 0) return snapshot;
737
788
  const { breakdown } = snapshot;
738
- const budget = snapshot.contextBudget ?? breakdown.maxContextTokens;
739
- const nonMessageTokens = (breakdown.instructionTokens ?? 0) + (breakdown.summaryTokens ?? 0);
740
- const messageTokens = Math.max(0, promptTokens - nonMessageTokens);
741
- return {
789
+ const instructionTokens = finiteNonNegativeInteger(breakdown.instructionTokens) ?? 0;
790
+ const summaryTokens = finiteNonNegativeInteger(breakdown.summaryTokens) ?? 0;
791
+ const budget = finiteNonNegativeInteger(snapshot.contextBudget) ?? finiteNonNegativeInteger(breakdown.maxContextTokens);
792
+ const nonMessageTokens = instructionTokens + summaryTokens;
793
+ const messageTokens = Math.max(0, normalizedPromptTokens - nonMessageTokens);
794
+ /** `toolMessageTokens` is a subset of the OLD (calibrated) `messageTokens`;
795
+ * rescale it by the same proportion so the split tracks the provider's real
796
+ * total. A supplied zero remains a known-zero split; absent fields stay absent
797
+ * for older snapshots. */
798
+ const priorMessageTokens = finiteNonNegativeInteger(breakdown.messageTokens) ?? 0;
799
+ const priorToolMessageTokens = finiteNonNegativeInteger(breakdown.toolMessageTokens);
800
+ let toolMessageTokens;
801
+ if (priorToolMessageTokens != null) {
802
+ toolMessageTokens = 0;
803
+ if (priorMessageTokens > 0 && priorToolMessageTokens > 0) toolMessageTokens = Math.min(messageTokens, Math.round(Math.min(priorToolMessageTokens, priorMessageTokens) / priorMessageTokens * messageTokens));
804
+ }
805
+ const toolMessageTokenCounts = toolMessageTokens != null ? scaleToolMessageTokenCounts(breakdown.toolMessageTokenCounts, Math.min(priorToolMessageTokens ?? 0, priorMessageTokens), toolMessageTokens) : void 0;
806
+ const nextBreakdown = {
807
+ ...breakdown,
808
+ instructionTokens,
809
+ summaryTokens,
810
+ messageTokens
811
+ };
812
+ if (toolMessageTokens == null) {
813
+ delete nextBreakdown.toolMessageTokens;
814
+ delete nextBreakdown.toolMessageTokenCounts;
815
+ } else {
816
+ nextBreakdown.toolMessageTokens = toolMessageTokens;
817
+ if (toolMessageTokenCounts == null) delete nextBreakdown.toolMessageTokenCounts;
818
+ else nextBreakdown.toolMessageTokenCounts = toolMessageTokenCounts;
819
+ }
820
+ const result = {
742
821
  ...snapshot,
743
- breakdown: {
744
- ...breakdown,
745
- messageTokens
746
- },
747
- remainingContextTokens: budget != null ? Math.max(0, budget - promptTokens) : snapshot.remainingContextTokens
822
+ breakdown: nextBreakdown
748
823
  };
824
+ if (budget != null) result.remainingContextTokens = Math.max(0, budget - normalizedPromptTokens);
825
+ else {
826
+ const remaining = finiteNonNegativeInteger(snapshot.remainingContextTokens);
827
+ if (remaining == null) delete result.remainingContextTokens;
828
+ else result.remainingContextTokens = remaining;
829
+ }
830
+ return result;
749
831
  };
832
+ /** Provider output, including reasoning omitted from an under-reported output count. */
833
+ const outputTokensFromUsage = (event) => {
834
+ const output = finiteNonNegativeInteger(event.output_tokens) ?? 0;
835
+ const total = finiteNonNegativeInteger(event.total_tokens) ?? 0;
836
+ return Math.max(output, total - promptTokensFromUsage(event));
837
+ };
838
+ /** Reconcile and retain the primary call details on live, saved, and resumable snapshots. */
839
+ const reconcileContextUsageFromEvent = (snapshot, event) => ({
840
+ ...reconcileContextUsage(snapshot, promptTokensFromUsage(event)),
841
+ model: event.model,
842
+ provider: event.provider,
843
+ completedOutputTokens: outputTokensFromUsage(event),
844
+ cacheRead: finiteNonNegativeInteger(event.input_token_details?.cache_read) ?? 0,
845
+ cacheWrite: finiteNonNegativeInteger(event.input_token_details?.cache_creation) ?? 0
846
+ });
750
847
  //#endregion
751
848
  //#region src/parsers.ts
752
849
  dayjs.extend(utc);
@@ -987,6 +1084,45 @@ function replaceSpecialVars({ text, user, now: inputNow, timezone }) {
987
1084
  function getEphemeralSender({ modelLabel, specLabel, modelDisplayLabel }) {
988
1085
  return modelLabel ?? specLabel ?? modelDisplayLabel ?? "";
989
1086
  }
1087
+ /** Built-in endpoints; anything else in `endpoint` is a custom endpoint's own name. */
1088
+ const builtInEndpoints = new Set(Object.values(EModelEndpoint));
1089
+ /**
1090
+ * Whether a persisted `sender` is a label someone configured rather than the
1091
+ * model-derived name `getResponseSender` produces.
1092
+ *
1093
+ * The sender is the one thing that records which it was: `resolveSender` writes an
1094
+ * agent's name, then the `getEphemeralSender` chain (`modelLabel` → a model spec's
1095
+ * `label` → an endpoint's `modelDisplayLabel`), and falls back to `getResponseSender`
1096
+ * only when none of those is set. Asking the message rather than the conversation
1097
+ * settles three things a settings lookup cannot: labels that live in config a caller
1098
+ * may not hold, labels an endpoint ignores (Anthropic keeps reading `Claude` whatever
1099
+ * `chatGptLabel` says, and matches here), and labels changed since the message was
1100
+ * written — its header still shows the sender it was written under.
1101
+ *
1102
+ * Equality is the test, so the only way to be wrong is a stored name that no longer
1103
+ * matches what the current heuristics produce, which withholds a model rather than
1104
+ * revealing one.
1105
+ */
1106
+ const isConfiguredSender = ({ sender, endpoint, endpointType, model, isCreatedByUser }) => {
1107
+ /** A user turn is headed by the person who wrote it, so it has no model to withhold
1108
+ * and its `User` sender would never match a derived name. */
1109
+ if (isCreatedByUser === true) return false;
1110
+ /** Agents and assistants are named by whoever authored them: the header shows that
1111
+ * name whether or not the response stored a sender, and `getResponseSender` has no
1112
+ * branch to derive one. */
1113
+ if (isAgentsEndpoint(endpoint) || isAssistantsEndpoint(endpoint)) return true;
1114
+ if (sender == null || sender === "") return false;
1115
+ const derived = getResponseSender({
1116
+ endpoint,
1117
+ endpointType: endpointType ?? (endpoint != null && !builtInEndpoints.has(endpoint) ? "custom" : void 0),
1118
+ model
1119
+ });
1120
+ /** An endpoint this cannot name — an older message stored without one, say — says
1121
+ * nothing either way, and reading that silence as "configured" would withhold the
1122
+ * model from every unlabelled row it reached. */
1123
+ if (derived === "") return false;
1124
+ return sender !== derived;
1125
+ };
990
1126
  /**
991
1127
  * Encodes an ephemeral agent ID from endpoint, model, optional sender, and optional index.
992
1128
  * Uses __ to replace : (reserved in graph node names) and ___ to separate sender.
@@ -1279,6 +1415,20 @@ function mapGroupToAzureConfig({ groupName, groupMap }) {
1279
1415
  return result;
1280
1416
  }
1281
1417
  //#endregion
1418
+ //#region src/footer.ts
1419
+ /**
1420
+ * Whether a deployment configured footer content of its own — a custom footer,
1421
+ * a privacy policy or terms of service.
1422
+ *
1423
+ * The footer bar is absolutely positioned in a zero-height wrapper, so the
1424
+ * composer above it is what reserves its band: this answer decides both the
1425
+ * bar and the clearance. The client and the server share it because the two
1426
+ * answering differently is exactly the layout correction it exists to remove.
1427
+ */
1428
+ function hasConfiguredFooter(source) {
1429
+ return typeof source?.customFooter === "string" || source?.interface?.privacyPolicy?.externalUrl != null || source?.interface?.termsOfService?.externalUrl != null;
1430
+ }
1431
+ //#endregion
1282
1432
  //#region src/langchain.ts
1283
1433
  /**
1284
1434
  * LangChain classifies a provider failure by mutating the error: it stamps `lc_error_code` and
@@ -1369,6 +1519,298 @@ function parseLangChainErrorCode(message) {
1369
1519
  }
1370
1520
  }
1371
1521
  //#endregion
1522
+ //#region src/codeEnvRef.ts
1523
+ /**
1524
+ * Closed set of resource kinds for sandbox file caching. Defined as a
1525
+ * `as const` tuple so the runtime list and the TypeScript union can't
1526
+ * drift on future additions — adding a new kind to the tuple updates
1527
+ * both at once.
1528
+ *
1529
+ * - `skill`: shared per skill identity. Cross-user-within-tenant
1530
+ * sharing. Code API sessionKey omits the user dimension.
1531
+ * `version` is required (the skill's monotonic counter scopes the
1532
+ * cache per revision so any edit invalidates the prior cache
1533
+ * entry naturally).
1534
+ * - `agent`: shared per agent identity. Same sharing semantic as
1535
+ * skills (agents are addressable resources accessible to a
1536
+ * permission-defined audience).
1537
+ * - `user`: user-private. Code API sessionKey is keyed by the
1538
+ * requesting user from auth context. Used for chat attachments
1539
+ * and code-output artifacts.
1540
+ */
1541
+ const CODE_ENV_KINDS = [
1542
+ "skill",
1543
+ "agent",
1544
+ "user"
1545
+ ];
1546
+ function getCodeEnvRefForProfile(refs, routeKey) {
1547
+ const profileRef = refs?.codeEnvRefs?.[routeKey];
1548
+ if (profileRef) return profileRef;
1549
+ const legacyRef = refs?.codeEnvRef;
1550
+ if (legacyRef && (legacyRef.executionRouteKey ?? legacyRef.executionProfile ?? "default") === routeKey) return legacyRef;
1551
+ }
1552
+ /** Adds one profile pointer without discarding the other profile's storage object. */
1553
+ function mergeCodeEnvRef(refs, ref) {
1554
+ const codeEnvRefs = { ...refs?.codeEnvRefs };
1555
+ const legacyRef = refs?.codeEnvRef;
1556
+ if (legacyRef) codeEnvRefs[legacyRef.executionRouteKey ?? legacyRef.executionProfile ?? "default"] ??= legacyRef;
1557
+ const routeKey = ref.executionRouteKey ?? ref.executionProfile ?? "default";
1558
+ codeEnvRefs[routeKey] = ref;
1559
+ return {
1560
+ codeEnvRef: codeEnvRefs.default ?? codeEnvRefs.stateful ?? ref,
1561
+ codeEnvRefs
1562
+ };
1563
+ }
1564
+ /** Enumerates every deployment-local pointer, including legacy single-pointer records. */
1565
+ function getCodeEnvRefs(refs) {
1566
+ const merged = { ...refs?.codeEnvRefs };
1567
+ const legacyRef = refs?.codeEnvRef;
1568
+ if (legacyRef) merged[legacyRef.executionRouteKey ?? legacyRef.executionProfile ?? "default"] ??= legacyRef;
1569
+ return Object.entries(merged).flatMap(([routeKey, ref]) => ref ? [[routeKey, ref]] : []);
1570
+ }
1571
+ //#endregion
1572
+ //#region src/resolve-llm-delivery-path.ts
1573
+ /**
1574
+ * The native provider a custom endpoint declares, when it declares one. A custom endpoint
1575
+ * speaks OpenAI's API unless its config names another dialect, and the upload route needs
1576
+ * that answer for the same reason request initialization does: the media encoders emit
1577
+ * OpenAI-format parts, so a custom endpoint running as Anthropic receives none.
1578
+ */
1579
+ function getCustomEndpointProvider(customEndpoints, endpoint) {
1580
+ if (!customEndpoints || !endpoint) return;
1581
+ const normalized = normalizeEndpointName(endpoint);
1582
+ return customEndpoints.find((config) => normalizeEndpointName(config.name ?? "") === normalized)?.provider;
1583
+ }
1584
+ /** A custom endpoint emits OpenAI-format media parts only for the types the admin listed
1585
+ * in its `supportedMimeTypes`; the inherited default list is not an opt-in. A name that
1586
+ * is not a known provider is a custom endpoint. Mirrors `isConfiguredProviderMediaType`
1587
+ * on the encoder side, so the route and the encoder agree on which uploads the provider
1588
+ * actually receives; the built-in endpoints are left out because the client offers no
1589
+ * media for them. */
1590
+ const isConfiguredMediaEndpoint = (mimeType, endpoint, supportedMimeTypes) => {
1591
+ if (!isExplicitMimeConfig(supportedMimeTypes) || isKnownProviderIdentifier(endpoint)) return false;
1592
+ return fileConfig.checkType(mimeType, supportedMimeTypes);
1593
+ };
1594
+ /** Audio and video reach the model only through the media encoders, which support a
1595
+ * narrower provider set than documents. Images use the broadly supported vision
1596
+ * path and are never gated here. */
1597
+ const isProviderCapable = (mimeType, endpoint, useResponsesApi, supportedMimeTypes) => {
1598
+ if (mimeType.startsWith("audio/") || mimeType.startsWith("video/")) return isMediaSupportedProvider(endpoint) || isConfiguredMediaEndpoint(mimeType, endpoint, supportedMimeTypes);
1599
+ if (mimeType === "application/pdf") return useResponsesApi === true || isDocumentSupportedProvider(endpoint);
1600
+ return true;
1601
+ };
1602
+ const SYSTEM_LLM_DELIVERY_DEFAULTS = {
1603
+ fallback: "text",
1604
+ overrides: {
1605
+ "image/*": "provider",
1606
+ "video/*": "provider",
1607
+ "audio/*": "provider",
1608
+ "application/pdf": "provider"
1609
+ }
1610
+ };
1611
+ /**
1612
+ * Types some step in the upload pipeline can turn into text: natively readable text,
1613
+ * documents a parser or OCR handles, images through OCR, and audio through transcription.
1614
+ *
1615
+ * Everything absent from this list, notably archives, tarballs, columnar data files and
1616
+ * video, has no such step, and the default text matcher accepts any well-formed type, so
1617
+ * routing them to text ends in their bytes being decoded as UTF-8.
1618
+ */
1619
+ const TEXT_RECOVERABLE_MIME_TYPES = [
1620
+ /^text\//,
1621
+ /^image\//,
1622
+ /^audio\//,
1623
+ /^application\/(json|javascript|xml|sql|yaml|x-yaml|csv|typescript|x-sh|vnd\.coffeescript)$/,
1624
+ /^application\/pdf$/,
1625
+ /^application\/vnd\.openxmlformats-officedocument\.(wordprocessingml\.document|spreadsheetml\.sheet)$/,
1626
+ /^application\/vnd\.oasis\.opendocument\.(text|spreadsheet)$/,
1627
+ /^application\/(vnd\.ms-excel|x-msexcel|msexcel|x-ms-excel|x-excel|x-dos_ms_excel|xls|x-xls)$/,
1628
+ /^message\/rfc822$/
1629
+ ];
1630
+ /**
1631
+ * Types whose bytes are text already, so reading them directly is meaningful. Everything
1632
+ * else needs a real extractor: decoding it as UTF-8 produces mojibake rather than content.
1633
+ */
1634
+ /** Application types whose payload is text. Mirrors the set the content-protection code
1635
+ * treats as textual, plus the source and data formats this pipeline also accepts. */
1636
+ const TEXTUAL_APPLICATION_MIME_TYPES = new Set([
1637
+ "application/json",
1638
+ "application/javascript",
1639
+ "application/sql",
1640
+ "application/xml",
1641
+ "application/x-yaml",
1642
+ "application/yaml",
1643
+ "application/csv",
1644
+ "application/typescript",
1645
+ "application/x-sh",
1646
+ "application/vnd.coffeescript"
1647
+ ]);
1648
+ function isNativelyReadableText(mimeType) {
1649
+ const normalized = mimeType.split(";", 1)[0].trim().toLowerCase();
1650
+ return normalized.startsWith("text/") || TEXTUAL_APPLICATION_MIME_TYPES.has(normalized) || normalized === "message/rfc822";
1651
+ }
1652
+ function hasTextExtractionPath(mimeType) {
1653
+ return TEXT_RECOVERABLE_MIME_TYPES.some((pattern) => pattern.test(mimeType));
1654
+ }
1655
+ /**
1656
+ * Resolves the default file path destination for a given mime type.
1657
+ * Resolution chain: endpoint overrides -> endpoint fallback -> global overrides -> global fallback -> system defaults.
1658
+ */
1659
+ function resolveDefaultLLMDeliveryPath(mimeType, endpointConfig, globalConfig, endpoint, useResponsesApi, sttConfigured, supportedMimeTypes) {
1660
+ const wildcard = mimeType.split("/")[0] + "/*";
1661
+ if (endpointConfig?.overrides) {
1662
+ if (endpointConfig.overrides[mimeType]) return endpointConfig.overrides[mimeType];
1663
+ if (endpointConfig.overrides[wildcard]) return endpointConfig.overrides[wildcard];
1664
+ }
1665
+ if (endpointConfig?.fallback) return endpointConfig.fallback;
1666
+ if (globalConfig?.overrides) {
1667
+ if (globalConfig.overrides[mimeType]) return globalConfig.overrides[mimeType];
1668
+ if (globalConfig.overrides[wildcard]) return globalConfig.overrides[wildcard];
1669
+ }
1670
+ if (globalConfig?.fallback) return globalConfig.fallback;
1671
+ const systemDefault = SYSTEM_LLM_DELIVERY_DEFAULTS.overrides[mimeType] ?? SYSTEM_LLM_DELIVERY_DEFAULTS.overrides[wildcard] ?? SYSTEM_LLM_DELIVERY_DEFAULTS.fallback;
1672
+ /** Only the system default is capability-gated: an explicit config above is the
1673
+ * admin's decision. A known endpoint that cannot encode documents or media would
1674
+ * otherwise accept the upload and hand the model nothing at all. */
1675
+ /** `agents` is a container, not a provider: it is what an upload reports when the
1676
+ * agent's real provider could not be resolved, as for ephemeral agents. A custom
1677
+ * endpoint name is likewise unresolvable here, since its real provider is chosen
1678
+ * at request time and is usually OpenAI- or Anthropic-compatible. Judging
1679
+ * capability from either would downgrade media the actual provider can deliver,
1680
+ * so an unresolved provider keeps the system default. */
1681
+ const namedEndpoint = endpoint != null && endpoint !== "agents";
1682
+ const providerKnown = namedEndpoint && isKnownProviderIdentifier(endpoint);
1683
+ const isMedia = mimeType.startsWith("audio/") || mimeType.startsWith("video/");
1684
+ const canRecoverText = (type) => type.startsWith("audio/") && sttConfigured === false ? false : hasTextExtractionPath(type);
1685
+ if (systemDefault === "provider" && (isMedia ? namedEndpoint : providerKnown) && !isProviderCapable(mimeType, endpoint, useResponsesApi, supportedMimeTypes)) return canRecoverText(mimeType) ? "text" : "none";
1686
+ /** Bedrock's Converse document path natively accepts more than PDF, so on that
1687
+ * endpoint its document types belong on the provider path rather than being
1688
+ * extracted, which would drop non-text content and layout. */
1689
+ if (systemDefault !== "provider" && endpoint === "bedrock" && isBedrockDocumentType(mimeType)) return "provider";
1690
+ if (systemDefault === "text" && !canRecoverText(mimeType)) return "none";
1691
+ return systemDefault;
1692
+ }
1693
+ /**
1694
+ * Delivery path for an upload that named no tool resource. The legacy chooser makes the
1695
+ * destination explicit, so nothing is inferred there.
1696
+ */
1697
+ function resolveDefaultUploadLLMDeliveryPath({ mimeType, endpointConfig, fileConfig, endpoint, endpointProvider, useResponsesApi, sttConfigured }) {
1698
+ if (endpointConfig?.legacyFileUploadUX === true) return "provider";
1699
+ const runsAsOpenAI = endpointProvider == null || isOpenAILikeProvider(endpointProvider);
1700
+ return resolveDefaultLLMDeliveryPath(mimeType, endpointConfig?.defaultLLMDeliveryPath, fileConfig?.defaultLLMDeliveryPath, endpoint, useResponsesApi, sttConfigured, runsAsOpenAI ? endpointConfig?.supportedMimeTypes : void 0);
1701
+ }
1702
+ /** Delivery path for an upload, honoring an explicitly chosen tool resource. */
1703
+ function resolveUploadLLMDeliveryPath({ toolResource, mimeType, endpointConfig, fileConfig, endpoint, useResponsesApi, endpointProvider, sttConfigured }) {
1704
+ if (toolResource === "context" || toolResource === "ocr") return "text";
1705
+ if (toolResource === "file_search" || toolResource === "execute_code") return "none";
1706
+ return resolveDefaultUploadLLMDeliveryPath({
1707
+ mimeType,
1708
+ endpointConfig,
1709
+ fileConfig,
1710
+ endpoint,
1711
+ endpointProvider,
1712
+ useResponsesApi,
1713
+ sttConfigured
1714
+ });
1715
+ }
1716
+ /**
1717
+ * Whether a file tool can do anything with this type. `file_search` indexes extracted
1718
+ * text, so it needs a type some step can turn into text and cannot use media, whose
1719
+ * extraction paths are OCR and speech rather than the vector store. Code execution is
1720
+ * judged by the list the client offers it from. Shared by upload-time selection and
1721
+ * deferred provisioning so the two cannot queue a file the other would refuse.
1722
+ */
1723
+ function canToolResourceConsume(toolResource, mimeType) {
1724
+ if (toolResource === "file_search") return !mimeType.startsWith("image") && !mimeType.startsWith("audio") && !mimeType.startsWith("video") && (hasTextExtractionPath(mimeType) || matchesMimeList(mimeType, retrievalMimeTypes));
1725
+ if (toolResource === "execute_code") return matchesMimeList(mimeType, codeInterpreterMimeTypes);
1726
+ return true;
1727
+ }
1728
+ const matchesMimeList = (mimeType, patterns) => patterns.some((pattern) => pattern.test(mimeType));
1729
+ /**
1730
+ * Whether the record shows this file reached a tool's own store: vectors for file search, a
1731
+ * sandbox pointer for code execution. Nothing else writes either, so their presence is proof
1732
+ * the file was provisioned and their absence proof it was not. The same evidence deferred
1733
+ * provisioning reads before queueing a file, so a turn cannot withhold content for a tool that
1734
+ * provisioning has yet to serve.
1735
+ */
1736
+ function hasToolResourceProvisioning(file, toolResource) {
1737
+ if (toolResource === "execute_code") return getCodeEnvRefs(file.metadata).length > 0;
1738
+ return file.embedded === true || (file.metadata?.embeddedEntities?.length ?? 0) > 0;
1739
+ }
1740
+ /**
1741
+ * Whether a tool this turn runs can read a file of this type.
1742
+ *
1743
+ * Passing the record asks the stricter question a delivery decision needs where a tool serves
1744
+ * only what it already holds. File search reads the vector store, and an upload that named no
1745
+ * destination is filed under no tool at all, so an enabled search tool is a reader only once
1746
+ * the record shows the store holds the file. Run Code needs no copy in advance: its first call
1747
+ * uploads every attachment it can read to the sandbox, so enabling it is enough. Requiring a
1748
+ * copy there would hand the file's text to the prompt on every turn before the first code run,
1749
+ * and a turn that refuses that text never runs code, so the file would never become held.
1750
+ */
1751
+ function hasTurnFileConsumer(mimeType, consumers, file) {
1752
+ const searchHolds = file == null || hasToolResourceProvisioning(file, "file_search");
1753
+ return consumers.executeCode && canToolResourceConsume("execute_code", mimeType) || consumers.fileSearch && canToolResourceConsume("file_search", mimeType) && searchHolds;
1754
+ }
1755
+ const isLLMDeliveryPath = (value) => value === "provider" || value === "text" || value === "none";
1756
+ /** Whether a record's stored route was inferred at upload, so each turn resolves it again. */
1757
+ function hasInferredLLMDeliveryPath(file) {
1758
+ return file.llmDeliveryPath != null && file.metadata?.destinationChosen !== true;
1759
+ }
1760
+ /**
1761
+ * Delivery path for one attachment on one agent's turn.
1762
+ *
1763
+ * A record predating routing and a destination the user chose keep what they stored. An
1764
+ * inferred route re-resolves against the endpoint handling the turn. A `none` route leaves
1765
+ * the file for a tool; where the endpoint enables `textFallbackWithoutTools` and no tool this
1766
+ * turn runs can read the file, the text extracted at upload is delivered rather than the file
1767
+ * reaching nothing. Consumers left undefined are unknown and not judged, as in
1768
+ * {@link resolveUploadDestination}.
1769
+ *
1770
+ * For file search, reading is asked of the record rather than of the tool set, because the two
1771
+ * disagree for the upload that needs the fallback most: one that named no destination is filed
1772
+ * under no tool, so enabling file search would otherwise withhold the text for a vector store
1773
+ * that never received the file. Run Code is judged by the tool set: see
1774
+ * {@link hasTurnFileConsumer}.
1775
+ */
1776
+ function resolveTurnLLMDeliveryPath(routing, file, consumers) {
1777
+ if (routing == null || !hasInferredLLMDeliveryPath(file)) return isLLMDeliveryPath(file.llmDeliveryPath) ? file.llmDeliveryPath : void 0;
1778
+ const { endpointConfig } = routing;
1779
+ const mimeType = file.metadata?.routingMimeType ?? file.type ?? "";
1780
+ const path = resolveUploadLLMDeliveryPath({
1781
+ mimeType,
1782
+ ...routing
1783
+ });
1784
+ const hasFallbackText = typeof file.text === "string" && file.text.length > 0;
1785
+ if (path === "none" && endpointConfig?.textFallbackWithoutTools === true && consumers != null && hasFallbackText && !hasTurnFileConsumer(mimeType, consumers, file)) return "text";
1786
+ return path;
1787
+ }
1788
+ /**
1789
+ * Where a unified upload will end up, and whether it can be accepted at all.
1790
+ *
1791
+ * An upload has to be readable by something: the model, an extraction step, or a file
1792
+ * tool. A permanent one has to land on an agent resource too, or storing it succeeds
1793
+ * while leaving the agent no reference to it. Both outcomes are decided here rather than
1794
+ * discovered later, so a request that would change nothing is refused with a reason.
1795
+ *
1796
+ * `agentTools` is undefined when no agent record backs the upload, as for an ephemeral
1797
+ * agent that exists only for the request. An unknown tool set is not judged.
1798
+ */
1799
+ function resolveUploadDestination(params) {
1800
+ const { toolResource, deliveryPath, mimeType, agentTools, hasAgent, isMessageAttachment, allowUnknownMessageConsumer = false, contextEnabled } = params;
1801
+ const refusesContext = (resource) => resource === "context" && hasAgent && !isMessageAttachment && contextEnabled === false;
1802
+ if (toolResource) {
1803
+ const resolved = toolResource === "ocr" ? "context" : toolResource;
1804
+ return refusesContext(resolved) ? { rejection: "context-disabled" } : { toolResource: resolved };
1805
+ }
1806
+ if (deliveryPath === "text") return refusesContext("context") ? { rejection: "context-disabled" } : { toolResource: "context" };
1807
+ const consumingTool = agentTools?.find((tool) => (tool === "execute_code" || tool === "file_search") && canToolResourceConsume(tool, mimeType));
1808
+ if (deliveryPath === "none" && consumingTool) return { toolResource: consumingTool };
1809
+ if (hasAgent && !isMessageAttachment) return { rejection: "no-agent-resource" };
1810
+ if (deliveryPath === "none" && (!isMessageAttachment || !allowUnknownMessageConsumer)) return { rejection: "no-consumer" };
1811
+ return {};
1812
+ }
1813
+ //#endregion
1372
1814
  //#region src/messages.ts
1373
1815
  /** A generated reasoning title describes the text as it existed at generation time.
1374
1816
  * Any manual edit or merge into a different reasoning step invalidates the entire
@@ -1457,6 +1899,73 @@ function buildTree({ messages, fileMap }) {
1457
1899
  if (!cached) treeCache.set(messages, entry);
1458
1900
  return tree;
1459
1901
  }
1902
+ /**
1903
+ * Memoizes a messages array's id index. Every row that needs to look another
1904
+ * message up (the hover controls resolving the turn a rerun would replay) would
1905
+ * otherwise scan the whole array, which is quadratic in the conversation. A
1906
+ * cache write replaces the array, so the index dies with the array it indexes
1907
+ * and can never answer from stale rows.
1908
+ */
1909
+ const indexCache = /* @__PURE__ */ new WeakMap();
1910
+ /** The message with this id, resolved through the array's memoized index. */
1911
+ function findMessageById(messages, messageId) {
1912
+ if (messages == null || messageId == null) return;
1913
+ let index = indexCache.get(messages);
1914
+ if (index == null) {
1915
+ index = /* @__PURE__ */ new Map();
1916
+ for (const message of messages) if (message?.messageId != null && !index.has(message.messageId)) index.set(message.messageId, message);
1917
+ indexCache.set(messages, index);
1918
+ }
1919
+ return index.get(messageId);
1920
+ }
1921
+ /**
1922
+ * True when a turn carries the marker the server stamps on a manual compaction:
1923
+ * `markCompactionOutcome` sets `initiatedBy: 'user'` on whichever part carries
1924
+ * the outcome — the summary a Compact action produced, or the error part a run
1925
+ * that produced none recorded instead — and nothing else writes it, so an
1926
+ * automatic summary detour is not one. This is the compaction's own identity,
1927
+ * independent of where it hangs: Compact runs on whatever leaf the branch ends
1928
+ * with, so its response can parent onto a user message as easily as onto the
1929
+ * answer it summarized. Redoing one is the context indicator's Compact action,
1930
+ * never a rerun of the turn behind it.
1931
+ *
1932
+ * Compactions stored before the marker existed carry none, so callers keep
1933
+ * their own ancestry test as the fallback.
1934
+ */
1935
+ function isUserInitiatedCompaction(message) {
1936
+ const content = message?.content;
1937
+ if (!Array.isArray(content)) return false;
1938
+ return content.some((part) => (part?.type === "summary" || part?.type === "error") && part.initiatedBy === "user");
1939
+ }
1940
+ /**
1941
+ * True when a message is a finished manual compaction: every content part is a
1942
+ * summary and at least one of them carries text. A part that is still streaming
1943
+ * or that failed contributes no text of its own, so an interrupted compaction
1944
+ * can be retried.
1945
+ */
1946
+ function isCompactedLeaf(message) {
1947
+ const content = message?.content;
1948
+ if (!Array.isArray(content) || content.length === 0) return false;
1949
+ let usable = false;
1950
+ for (const part of content) {
1951
+ if (part?.type !== "summary") return false;
1952
+ /** No `boundary` means the round never completed: only the final summary
1953
+ * block carries one, so a part holding streamed deltas alone lacks it. */
1954
+ if (part.summarizing === true || part.failed === true || part.boundary == null) continue;
1955
+ const hasText = (part.content ?? []).some((block) => typeof block?.text === "string" && block.text.trim().length > 0);
1956
+ usable = usable || hasText;
1957
+ }
1958
+ return usable;
1959
+ }
1960
+ //#endregion
1961
+ //#region src/errors.ts
1962
+ const TOOL_CALL_ERROR_PREFIX = /^Error:\s*(?:\[[^\]]*\]\s*)*tool call failed:\s*/i;
1963
+ function hasToolCallErrorPrefix(text) {
1964
+ return TOOL_CALL_ERROR_PREFIX.test(text);
1965
+ }
1966
+ function stripToolCallErrorPrefix(text) {
1967
+ return text.replace(TOOL_CALL_ERROR_PREFIX, "");
1968
+ }
1460
1969
  //#endregion
1461
1970
  //#region src/runSteps.ts
1462
1971
  /**
@@ -5089,6 +5598,28 @@ let InvocationMode = /* @__PURE__ */ function(InvocationMode) {
5089
5598
  return InvocationMode;
5090
5599
  }({});
5091
5600
  //#endregion
5601
+ //#region src/types/content.ts
5602
+ let AnnotationTypes = /* @__PURE__ */ function(AnnotationTypes) {
5603
+ AnnotationTypes["FILE_CITATION"] = "file_citation";
5604
+ AnnotationTypes["FILE_PATH"] = "file_path";
5605
+ return AnnotationTypes;
5606
+ }({});
5607
+ let StepStatus = /* @__PURE__ */ function(StepStatus) {
5608
+ StepStatus["IN_PROGRESS"] = "in_progress";
5609
+ StepStatus["CANCELLED"] = "cancelled";
5610
+ StepStatus["FAILED"] = "failed";
5611
+ StepStatus["COMPLETED"] = "completed";
5612
+ StepStatus["EXPIRED"] = "expired";
5613
+ return StepStatus;
5614
+ }({});
5615
+ let MessageContentTypes = /* @__PURE__ */ function(MessageContentTypes) {
5616
+ MessageContentTypes["TEXT"] = "text";
5617
+ MessageContentTypes["IMAGE_FILE"] = "image_file";
5618
+ return MessageContentTypes;
5619
+ }({});
5620
+ const hostImageIdSuffix = "_host_copy";
5621
+ const hostImageNamePrefix = "host_copy_";
5622
+ //#endregion
5092
5623
  //#region src/types/schedules.ts
5093
5624
  /** Cadences the dialog builds from structured pickers (hour, minute, weekday). */
5094
5625
  const scheduleStructuredFrequencies = [
@@ -5155,6 +5686,35 @@ const updateSchedulePayloadSchema = createSchedulePayloadSchema.omit({ clientReq
5155
5686
  * server-side fresh-read fence alone cannot detect this).
5156
5687
  */
5157
5688
  expectedConfigRevision: z.number().int().min(0).optional() });
5689
+ /** Only structured schedule preflight failures may request immediate suspension. */
5690
+ function getScheduleMCPDisabledReason(outcomes) {
5691
+ const statuses = new Set(outcomes?.map((outcome) => outcome.status));
5692
+ if (statuses.has("mcp_permission_denied")) return "mcp_permission_denied";
5693
+ if (statuses.has("mcp_configuration_missing")) return "mcp_configuration_missing";
5694
+ if (statuses.has("mcp_reauth_required")) return "mcp_reauth_required";
5695
+ }
5696
+ const scheduleMCPOutcomeSchema = z.object({
5697
+ server: z.string(),
5698
+ /** Agent whose selected tool requires this server. Used to open the correct
5699
+ * recovery chat when the requirement belongs to a handoff or subagent. */
5700
+ agentId: z.string().optional(),
5701
+ status: z.enum([
5702
+ "ready",
5703
+ "mcp_reauth_required",
5704
+ "mcp_configuration_missing",
5705
+ "mcp_permission_denied",
5706
+ "mcp_unavailable"
5707
+ ])
5708
+ });
5709
+ function readScheduleMCPOutcomes(error) {
5710
+ if (!error || !/^mcp_(reauth_required|configuration_missing|permission_denied|unavailable): \[/.test(error)) return [];
5711
+ try {
5712
+ const result = scheduleMCPOutcomeSchema.array().safeParse(JSON.parse(error.slice(error.indexOf(": ") + 2)));
5713
+ return result.success ? result.data : [];
5714
+ } catch {
5715
+ return [];
5716
+ }
5717
+ }
5158
5718
  //#endregion
5159
5719
  //#region src/cadence.ts
5160
5720
  /** Mirrors the server default when a weekly cadence omits `daysOfWeek`. */
@@ -5427,6 +5987,12 @@ let DATE_RANGE = /* @__PURE__ */ function(DATE_RANGE) {
5427
5987
  const INSIGHTS_MAX_RANGE_DAYS = 30;
5428
5988
  const INSIGHTS_SEARCH_MIN_LENGTH = 3;
5429
5989
  const INSIGHTS_SEARCH_MAX_LENGTH = 200;
5990
+ const INSIGHTS_AGENT_ID_MAX_LENGTH = 256;
5991
+ //#endregion
5992
+ //#region src/types/traces.ts
5993
+ const TRACE_CURSOR_MAX_LENGTH = 4096;
5994
+ const TRACE_SOURCE_ID_MAX_LENGTH = 128;
5995
+ const TRACE_RECORD_ID_MAX_LENGTH = 256;
5430
5996
  //#endregion
5431
5997
  //#region src/types/queuedTurns.ts
5432
5998
  const agentQueuedTurnStatuses = [
@@ -5444,7 +6010,12 @@ const agentQueuedTurnFileRefSchema = z.object({
5444
6010
  filename: z.string().optional(),
5445
6011
  height: z.number().optional(),
5446
6012
  width: z.number().optional(),
5447
- bytes: z.number().nonnegative().optional()
6013
+ bytes: z.number().nonnegative().optional(),
6014
+ llmDeliveryPath: z.enum([
6015
+ "provider",
6016
+ "text",
6017
+ "none"
6018
+ ]).optional()
5448
6019
  });
5449
6020
  const enqueueAgentQueuedTurnSchema = z.object({
5450
6021
  conversationId: z.string().trim().min(1),
@@ -5513,6 +6084,7 @@ let ProviderId = /* @__PURE__ */ function(ProviderId) {
5513
6084
  ProviderId["groq"] = "groq";
5514
6085
  ProviderId["helicone"] = "helicone";
5515
6086
  ProviderId["huggingface"] = "huggingface";
6087
+ ProviderId["lemonade"] = "lemonade";
5516
6088
  ProviderId["mistral"] = "mistral";
5517
6089
  ProviderId["mlx"] = "mlx";
5518
6090
  ProviderId["ollama"] = "ollama";
@@ -5542,6 +6114,7 @@ const knownEndpointToProvider = {
5542
6114
  ["groq"]: "groq",
5543
6115
  ["helicone"]: "helicone",
5544
6116
  ["huggingface"]: "huggingface",
6117
+ ["lemonade"]: "lemonade",
5545
6118
  ["mistral"]: "mistral",
5546
6119
  ["mlx"]: "mlx",
5547
6120
  ["ollama"]: "ollama",
@@ -5567,6 +6140,8 @@ const providerAliases = {
5567
6140
  grok: "xai",
5568
6141
  kimi: "moonshot",
5569
6142
  moonshotai: "moonshot",
6143
+ amdlemonade: "lemonade",
6144
+ lemonadeserver: "lemonade",
5570
6145
  mistralai: "mistral",
5571
6146
  togetherai: "together"
5572
6147
  };
@@ -5588,6 +6163,77 @@ function resolveModelCatalogKey(provider, catalogs) {
5588
6163
  return catalogs?.[key] != null ? key : modelCatalogAliases[key] ?? key;
5589
6164
  }
5590
6165
  //#endregion
6166
+ //#region src/svg.ts
6167
+ /**
6168
+ * DOMPurify policy for user-provided SVG icons, shared by the browser uploader and
6169
+ * the server trust boundary so a preview and the persisted icon cannot disagree.
6170
+ * `use` is re-added for self-contained `<defs>` references (targets restricted by
6171
+ * `restrictSvgReferences`); every SMIL element is forbidden so a stored icon
6172
+ * cannot animate forever wherever it renders.
6173
+ */
6174
+ const SVG_SANITIZE_CONFIG = {
6175
+ USE_PROFILES: {
6176
+ svg: true,
6177
+ svgFilters: true
6178
+ },
6179
+ ADD_TAGS: ["use"],
6180
+ ADD_ATTR: ["fr"],
6181
+ FORBID_TAGS: [
6182
+ "script",
6183
+ "foreignObject",
6184
+ "style",
6185
+ "a",
6186
+ "image",
6187
+ "animate",
6188
+ "animateColor",
6189
+ "animateMotion",
6190
+ "animateTransform",
6191
+ "mpath",
6192
+ "set"
6193
+ ],
6194
+ FORBID_ATTR: ["style"]
6195
+ };
6196
+ const URL_TOKEN_PREFIX = /url\(\s*['"]?\s*/gi;
6197
+ /**
6198
+ * True when every `url()` token targets a fragment. Backslashes reject the value
6199
+ * outright: CSS unescapes idents before tokenizing, so `u\72l(...)` is a `url()`.
6200
+ */
6201
+ function referencesOnlyFragments(value) {
6202
+ if (value.includes("\\")) return false;
6203
+ if (!value.toLowerCase().includes("url(")) return true;
6204
+ URL_TOKEN_PREFIX.lastIndex = 0;
6205
+ while (URL_TOKEN_PREFIX.exec(value) !== null) if (value[URL_TOKEN_PREFIX.lastIndex] !== "#") return false;
6206
+ return true;
6207
+ }
6208
+ /** DOMPurify hook that drops every attribute referencing outside the document. */
6209
+ function restrictSvgReferences(node) {
6210
+ const names = [];
6211
+ for (let i = 0; i < node.attributes.length; i += 1) names.push(node.attributes[i].name);
6212
+ for (const name of names) {
6213
+ const value = node.getAttribute(name)?.trim();
6214
+ if (value == null) continue;
6215
+ if (name === "href" || name === "xlink:href") {
6216
+ if (!value.startsWith("#")) node.removeAttribute(name);
6217
+ continue;
6218
+ }
6219
+ if (!referencesOnlyFragments(value)) node.removeAttribute(name);
6220
+ }
6221
+ }
6222
+ /** SVG names the HTML parser lowercases and its adjustment table does not restore. */
6223
+ const UNADJUSTED_SVG_TAGS = [[/(<\/?)fedropshadow\b/gi, "$1feDropShadow"]];
6224
+ const SVG_ROOT_TAG = /<svg(\s[^>]*)?>/i;
6225
+ /**
6226
+ * Makes HTML-mode sanitizer output valid as a standalone `image/svg+xml`
6227
+ * document: restores camelCase element names the HTML parser lowercased and
6228
+ * declares the SVG namespace on the root, without which an XML parser puts the
6229
+ * root in no namespace and the icon renders blank.
6230
+ */
6231
+ function finalizeSvgMarkup(markup) {
6232
+ let restored = markup;
6233
+ for (const [pattern, canonical] of UNADJUSTED_SVG_TAGS) restored = restored.replace(pattern, canonical);
6234
+ return restored.replace(SVG_ROOT_TAG, (tag, attributes) => attributes != null && /\sxmlns\s*=/i.test(attributes) ? tag : `<svg xmlns="http://www.w3.org/2000/svg"${attributes ?? ""}>`);
6235
+ }
6236
+ //#endregion
5591
6237
  //#region src/actions.ts
5592
6238
  function sha1(input) {
5593
6239
  return crypto.createHash("sha1").update(input).digest("hex");
@@ -6071,7 +6717,7 @@ function getUserTimezone() {
6071
6717
  }
6072
6718
  }
6073
6719
  function createPayload(submission) {
6074
- const { isEdited, addedConvo, userMessage, isContinued, isTemporary, isRegenerate, conversation, editedContent, ephemeralAgent, endpointOption, manualSkills, clientRequestId, recoverySteerId, expectedPredecessorCreatedAt } = submission;
6720
+ const { isEdited, addedConvo, userMessage, isContinued, isTemporary, isRegenerate, compact, conversation, editedContent, ephemeralAgent, endpointOption, manualSkills, codeApprovalMode, codeEnvironmentMode, codeWorkspaces, clientRequestId, recoverySteerId, expectedPredecessorCreatedAt } = submission;
6075
6721
  const { conversationId } = tConvoUpdateSchema.parse(conversation);
6076
6722
  const { endpoint: _e, endpointType } = endpointOption;
6077
6723
  const endpoint = _e;
@@ -6085,12 +6731,18 @@ function createPayload(submission) {
6085
6731
  endpoint,
6086
6732
  addedConvo,
6087
6733
  isTemporary,
6088
- isRegenerate,
6734
+ /** A compaction borrows the regenerate shape client-side only: the server
6735
+ * must see it as a compaction, never as a regenerated user turn. */
6736
+ isRegenerate: compact === true ? void 0 : isRegenerate,
6737
+ ...compact === true && { compact: true },
6089
6738
  editedContent,
6090
6739
  conversationId,
6091
6740
  isContinued: !!(isEdited && isContinued),
6092
6741
  ephemeralAgent: isAssistantsEndpoint(endpoint) ? void 0 : ephemeralAgent,
6093
6742
  manualSkills: isAssistantsEndpoint(endpoint) ? void 0 : manualSkills,
6743
+ codeApprovalMode: isAssistantsEndpoint(endpoint) ? void 0 : codeApprovalMode,
6744
+ codeEnvironmentMode: isAssistantsEndpoint(endpoint) ? void 0 : codeEnvironmentMode,
6745
+ codeWorkspaces: isAssistantsEndpoint(endpoint) ? void 0 : codeWorkspaces,
6094
6746
  timezone: getUserTimezone(),
6095
6747
  clientRequestId,
6096
6748
  recoverySteerId,
@@ -7273,6 +7925,38 @@ const paramSettings = {
7273
7925
  [`bedrock-zai`]: bedrockZAI,
7274
7926
  ["google"]: googleConfig
7275
7927
  };
7928
+ /**
7929
+ * Maps effective backend param names for OpenAI-compatible/Azure endpoints (as deleted from
7930
+ * `llmConfig` via `dropParams`, e.g. `maxTokens`) to their corresponding UI/conversation keys
7931
+ * (e.g. `max_tokens`). Native providers (anthropic, google, bedrock, ...) already render these
7932
+ * same camelCase names as their UI key (e.g. `topP`), so this alias must only be applied to
7933
+ * OpenAI-compatible parameter sets — see `resolveDropParamsUIKeys`.
7934
+ */
7935
+ const dropParamsBackendToUIKey = {
7936
+ maxTokens: "max_tokens",
7937
+ topP: "top_p",
7938
+ frequencyPenalty: "frequency_penalty",
7939
+ presencePenalty: "presence_penalty"
7940
+ };
7941
+ /** Endpoint keys whose parameter settings render the OpenAI-compatible (snake_case) UI keys. */
7942
+ const openAILikeParamEndpointKeys = new Set([
7943
+ "openAI",
7944
+ "azureOpenAI",
7945
+ "custom",
7946
+ "openrouter"
7947
+ ]);
7948
+ /**
7949
+ * Normalizes an admin-configured `dropParams` list into the UI/conversation keys used to hide
7950
+ * the matching controls in the settings panels. `endpointKey` should be the same key used to
7951
+ * resolve the panel's parameter settings (e.g. `overriddenEndpointKey`); the backend-name alias
7952
+ * is only applied for OpenAI-compatible endpoints, since native providers (anthropic, google,
7953
+ * bedrock, ...) already use these backend names as their UI key.
7954
+ */
7955
+ function resolveDropParamsUIKeys(dropParams, endpointKey) {
7956
+ if (!dropParams || dropParams.length === 0) return /* @__PURE__ */ new Set();
7957
+ if (!openAILikeParamEndpointKeys.has(endpointKey)) return new Set(dropParams);
7958
+ return new Set(dropParams.map((param) => dropParamsBackendToUIKey[param] ?? param));
7959
+ }
7276
7960
  const openAIColumns = {
7277
7961
  col1: openAICol1,
7278
7962
  col2: openAICol2
@@ -7341,8 +8025,50 @@ const agentParamSettings = Object.entries(presetSettings).reduce((acc, [key, val
7341
8025
  * current models (2.5 and 3+) surface their 64K output limit instead of the legacy 8K value.
7342
8026
  * Anthropic prompt-cache controls are only surfaced for models that support them.
7343
8027
  */
7344
- function applyModelAwareDefaults(settings, endpoint, model) {
8028
+ function applyModelAwareDefaults(settings, endpoint, model, responsesApiRouting) {
7345
8029
  if (!model) return settings;
8030
+ if (/^grok-4[.-]7(?:$|[-:])/.test(model.split("/").pop() ?? "")) return settings.map((setting) => setting.key === "reasoning_effort" ? {
8031
+ ...setting,
8032
+ options: [
8033
+ "",
8034
+ "low",
8035
+ "medium",
8036
+ "high",
8037
+ "xhigh"
8038
+ ]
8039
+ } : setting);
8040
+ if (/^gpt-6-(?:sol|luna)(?:$|-)/i.test(model)) return settings.map((setting) => {
8041
+ if (setting.key === "reasoning_effort") return {
8042
+ ...setting,
8043
+ options: setting.options?.filter((effort) => effort !== "minimal")
8044
+ };
8045
+ /** Match the native backend's unset default without writing into stored
8046
+ * settings. Explicit false still overrides this rendered default. */
8047
+ if (setting.key === "useResponsesApi") {
8048
+ const route = (value) => resolveEffectiveUseResponsesApi({
8049
+ endpoint,
8050
+ model,
8051
+ routing: responsesApiRouting,
8052
+ value
8053
+ });
8054
+ return {
8055
+ ...setting,
8056
+ default: route() ?? false,
8057
+ enumMappings: {
8058
+ true: route(true) ?? true,
8059
+ false: route(false) ?? false
8060
+ }
8061
+ };
8062
+ }
8063
+ return setting;
8064
+ });
8065
+ if (isOpus55Model(model)) return settings.filter((setting) => ![
8066
+ "thinking",
8067
+ "thinkingBudget",
8068
+ "temperature",
8069
+ "topP",
8070
+ "topK"
8071
+ ].includes(setting.key));
7346
8072
  const modelAwareSettings = endpoint === "google" ? settings.map((setting) => {
7347
8073
  if (setting.key === "maxOutputTokens") return {
7348
8074
  ...setting,
@@ -7406,56 +8132,40 @@ function removeCodeExecutionCaller(toolOptions) {
7406
8132
  return normalized;
7407
8133
  }
7408
8134
  //#endregion
7409
- //#region src/codeEnvRef.ts
7410
- /**
7411
- * Closed set of resource kinds for sandbox file caching. Defined as a
7412
- * `as const` tuple so the runtime list and the TypeScript union can't
7413
- * drift on future additions — adding a new kind to the tuple updates
7414
- * both at once.
7415
- *
7416
- * - `skill`: shared per skill identity. Cross-user-within-tenant
7417
- * sharing. Code API sessionKey omits the user dimension.
7418
- * `version` is required (the skill's monotonic counter scopes the
7419
- * cache per revision so any edit invalidates the prior cache
7420
- * entry naturally).
7421
- * - `agent`: shared per agent identity. Same sharing semantic as
7422
- * skills (agents are addressable resources accessible to a
7423
- * permission-defined audience).
7424
- * - `user`: user-private. Code API sessionKey is keyed by the
7425
- * requesting user from auth context. Used for chat attachments
7426
- * and code-output artifacts.
7427
- */
7428
- const CODE_ENV_KINDS = [
7429
- "skill",
7430
- "agent",
7431
- "user"
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;
8135
+ //#region src/backgroundResults.ts
8136
+ /** Shared serialized metadata shape for admission budgeting and continuation rendering. */
8137
+ function backgroundResultMetadata(result) {
7446
8138
  return {
7447
- codeEnvRef: codeEnvRefs.default ?? codeEnvRefs.stateful ?? ref,
7448
- codeEnvRefs
8139
+ background_task_id: result.taskId,
8140
+ tool_call_id: result.toolCallId,
8141
+ tool: result.toolName,
8142
+ status: result.status,
8143
+ result: ""
7449
8144
  };
7450
8145
  }
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]] : []);
8146
+ //#endregion
8147
+ //#region src/code/worker.ts
8148
+ function isCodeWorkerShell(value) {
8149
+ return value === "posix" || value === "powershell";
8150
+ }
8151
+ function quotePosix(value) {
8152
+ return `'${value.replace(/'/g, `'\\''`)}'`;
8153
+ }
8154
+ function quotePowerShell(value) {
8155
+ return `'${value.replace(/'/g, "''")}'`;
8156
+ }
8157
+ function createCodeWorkerSetupCommand(pairing, shell, options = {}) {
8158
+ const quote = shell === "powershell" ? quotePowerShell : quotePosix;
8159
+ const pair = `librechat-code pair ${quote(pairing.endpoint)} ${quote(pairing.code)} --worker-id ${quote(pairing.workerId)}`;
8160
+ const run = ["librechat-code run", ...[
8161
+ options.defaultWorkspace === false ? null : "--default-workspace",
8162
+ options.allowWorkspaceWrites === true ? "--allow-workspace-writes" : null,
8163
+ options.allowWorkspaceCommands === true ? "--allow-workspace-commands" : null
8164
+ ].filter((value) => value != null)].join(" ");
8165
+ if (shell === "powershell") return `${pair}\n$env:LIBRECHAT_CODE_WORKER_ID = ${quote(pairing.workerId)}\n${run}`;
8166
+ return `${pair}\nLIBRECHAT_CODE_WORKER_ID=${quote(pairing.workerId)} ${run}`;
7457
8167
  }
7458
8168
  //#endregion
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 };
8169
+ export { ACTION_METADATA_FILTER_FIELDS, AGENT_BACKGROUND_COMPLETION_RESULT_MAX_CHARS_DEFAULT, AGENT_BACKGROUND_COMPLETION_RESULT_MAX_CHARS_HARD_MAX, 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_APPROVAL_MODES, CODE_ENVIRONMENT_COMMAND_TIMEOUT_DEFAULT_MS, CODE_ENVIRONMENT_COMMAND_TIMEOUT_HARD_MAX_MS, CODE_ENVIRONMENT_DECISION_VERSION, CODE_ENVIRONMENT_MODES, CODE_ENVIRONMENT_MOVE_VERSION, CODE_ENVIRONMENT_QUEUE_WAIT_DEFAULT_MS, CODE_ENV_KINDS, CODE_WORKSPACE_ID_PATTERN, CODE_WORKSPACE_INSTANCE_TYPES, CODE_WORKSPACE_MAX_COUNT, CODE_WORKSPACE_OPERATIONS, CODE_WORKSPACE_SELECTION_ERROR_REASONS, CONVERSATION_STARTER_FILTER_FIELDS, CONVERSATION_TITLE_FILTER_FIELDS, CacheKeys, Capabilities, CodeApprovalModeError, CohereConstants, ComponentTypes, Constants, ContentTypes, DATE_RANGE, DEFAULT_AGENT_MODEL_RESPONSE_BODY_TIMEOUT_MS, DEFAULT_AGENT_MODEL_RESPONSE_HEADERS_TIMEOUT_MS, DEFAULT_BALANCE_RESERVATION_TTL_MS, DEFAULT_MAX_PROVIDER_ERROR_CHARS, DEFAULT_MAX_RETAINED_TOOL_COUNT_CHARS, DEFAULT_MEMORY_MAX_INPUT_TOKENS, DEFAULT_OAUTH_STATE_TTL_MS, DEFAULT_RETAINED_ANSWER_TOKENS, DEFAULT_SKILL_IMPORT_CLEANUP_CONCURRENCY, DefaultLLMDeliveryPath, 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_AGENT_ID_MAX_LENGTH, INSIGHTS_MAX_RANGE_DAYS, INSIGHTS_SEARCH_MAX_LENGTH, INSIGHTS_SEARCH_MIN_LENGTH, INTERFACE_PERMISSION_FIELDS, ImageDetail, ImageDetailCost, ImageVisionTool, InfiniteCollections, InvocationMode, KnownEndpoints, LANGFUSE_TRACE_CONVERSATION_METADATA_FIELDS, LANGFUSE_TRACE_USER_ID_FIELDS, LANGFUSE_TRACE_USER_METADATA_FIELDS, LocalStorageKeys, MAX_CHAT_PROJECT_DESCRIPTION_LENGTH, MAX_CHAT_PROJECT_NAME_LENGTH, MAX_GRAPH_SUBAGENT_MEMBERS, MAX_MCP_ICON_PATH_LENGTH, MAX_MCP_OAUTH_PERSISTENCE_WAIT_MS, 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_BALANCE_RESERVATION_TTL_MS, MIN_REPORTABLE_RUN_STEP_DURATION_MS, MODEL_PARAMETER_FILTER_FIELDS, MYTHOS_CLASS_FAMILIES, MemoryScope, MessageContentTypes, MutationKeys, OCRStrategy, OPUS_55_BLOCK_BINDING, 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, SVG_SANITIZE_CONFIG, SYSTEM_LLM_DELIVERY_DEFAULTS, SafeSearchTypes, ScraperProviders, SearchCategories, SearchProviders, SettingTypes, SettingsTabValues, SettingsViews, SkillsScope, StdioOptionsSchema, SteerEvents, StepEvents, StepStatus, StepTypes, StreamableHTTPOptionsSchema, SystemCategories, SystemRoles, THINKING_BINDING_BETA, TOOL_ARGUMENT_FILTER_FIELDS, TRACE_CURSOR_MAX_LENGTH, TRACE_RECORD_ID_MAX_LENGTH, TRACE_SOURCE_ID_MAX_LENGTH, TTSProviders, ThinkingDisplay, ThinkingLevel, Time, TokenExchangeMethodEnum, ToolCallTypes, Tools, UsageEvents, Verbosity, ViolationTypes, VisionModes, WebSocketOptionsSchema, accessRoleSchema, accessRoleToPermBits, accordian, actionDelimiter, actionDomainSeparator, actionMetadataFilterFieldSchema, agentGitIdentitySchema, agentInstructionFilterFieldSchema, agentParamSettings, agentPermissionsSchema, agentQueuedTurnCapabilitySchema, agentQueuedTurnDurability, agentQueuedTurnFileRefSchema, agentQueuedTurnReceiptSchema, agentQueuedTurnStatuses, agentsBaseSchema, agentsEndpointSchema, agentsSchema, agentsSettings, alert, alertDialog, allowedAddressesSchema, alternateName, anthropicBaseSchema, anthropicEndpointSchema, anthropicSchema, anthropicSettings, apiBaseUrl, appendAgentIdSuffix, applicationMimeTypes, applyModelAwareDefaults, askUserQuestionConfigSchema, askUserQuestionRetainedAnswersSchema, assistantEndpointSchema, assistantSchema, audioMimeTypes, authTypeSchema, avatar, azureBaseSchema, azureEndpointSchema, azureGroupConfigsSchema, azureGroupSchema, backgroundResultMetadata, badge, balanceSchema, baseEndpointSchema, bedrockDocumentExtensions, bedrockDocumentFormats, bedrockDocumentMimeTypes, bedrockEndpointSchema, bedrockGuardrailConfigSchema, bedrockInputParser, bedrockInputSchema, bedrockModels, bedrockOutputParser, bookmarkPermissionsSchema, breadcrumb, buildLoginRedirectUrl, buildServerNameAliases, buildTree, button, cacheSubsetProviders, cadenceIntervalMinutes, cadenceToCron, calendar, canToolResourceConsume, 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, createCodeWorkerSetupCommand, createPayload, createSchedulePayloadSchema, createURL, cronCadenceSchema, data_service_exports as dataService, defaultAgentCapabilities, defaultAgentFormValues, defaultAssistantFormValues, defaultAssistantsVersion, defaultEndpoints, defaultLLMDeliveryPathSchema, 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, finalizeSvgMarkup, findLastSeparatorIndex, findMessageById, fullMimeTypesList, generateDynamicSchema, generateGoogleSchema, generateOpenAISchema, getAllowedCodeApprovalModes, getCodeEnvRefForProfile, getCodeEnvRefs, getConfigDefaults, getConfiguredMimeAccept, getCustomEndpointProvider, getDefaultParamsEndpoint, getDocumentFileExtension, getEnabledEndpoints, getEndpointField, getEndpointFileConfig, getEphemeralSender, getFirstDefinedValue, getGoogleThinkingBudgetBounds, getGoogleThinkingBudgetMax, getMaxSubagents, getModelKey, getNonEmptyValue, getPiiRegexProgramSize, getRefillEligibilityDate, getResourcePermissionsResponseSchema, getResponseSender, getRunStepDurationMs, getScheduleMCPDisabledReason, getSchemaDefaults, getSettingsKeys, getTagByKey, getTagsForRating, getTokenHeader, googleBaseSchema, googleGenConfigSchema, googleSchema, googleSettings, hasActiveFiltersConfig, hasActivePiiFields, hasActivePiiPatterns, hasConfiguredFooter, hasInferredLLMDeliveryPath, hasPermissions, hasProcessMCPServerConfig, hasTextExtractionPath, hasToolCallErrorPrefix, hasToolResourceProvisioning, hasTurnFileConsumer, hostImageIdSuffix, hostImageNamePrefix, hoverCard, imageDetailNumeric, imageDetailValue, imageExtRegex, imageGenTools, imageMimeTypes, imageTypeMapping, inferMimeType, initialModelsConfig, input, inputTokensIncludesCache, interfaceSchema, isActionTool, isAgentsEndpoint, isAnthropicDocumentType, isAnthropicTextDocumentType, isAssistantsEndpoint, isBedrockDocumentType, isCodeEnvironmentMode, isCodeWorkerShell, isCodeWorkspaceEnvironment, isCodeWorkspaceSelection, isCodeWorkspaceSelectionErrorReason, isCodeWorkspaceSelections, isCompactedLeaf, isConfiguredSender, isCronCadence, isDocumentSupportedProvider, isEphemeralAgentId, isExplicitMimeConfig, isImageVisionTool, isKnownProviderIdentifier, isMediaSupportedProvider, isMessageFileUpload, isMythosClassModel, isNativelyReadableText, isOpenAILikeProvider, isOpus55Model, isParamEndpoint, isPermissiveMimeConfig, isProcessMCPServerConfig, isProcessMCPServerField, isRemoteOidcUrlAllowed, isReportableRunStepDuration, isRepositoryInstructionDescriptor, isResponsesApiUpload, isSecureCodeEnvironmentControlURL, isSensitiveEnvVar, isSpeechProviderConfigured, isSystemRoleName, isThinkingDisabled, isUUID, isUserInitiatedCompaction, isValidCronExpression, knownEndpointToProvider, label, langfuseConfigSchema, langfuseTraceConfigSchema, librechat, listAgentQueuedTurnsResponseSchema, listAgentQueuedTurnsSchema, listConfiguredSpeechProviders, loginPage, mapGroupToAzureConfig, mapModelToAzureConfig, marketplacePermissionsSchema, materializeModelSpecEndpoints, mbToBytes, mcpRefreshDefaults, mcpServersPermissionsSchema, mediaSupportedProviders, 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, openIdDiscoverySchema, openRouterSchema, openapiToFunction, orderEndpointsConfig, outputTokensFromUsage, pagination, paramDefinitionSchema, paramEndpoints, paramSettings, parseCompactConvo, parseConvo, parseEphemeralAgentId, parseLangChainErrorCode, parseTextParts, peoplePickerPermissionsSchema, permBitsToAccessLevel, permissionEntrySchema, permissionWriteAttemptsSchema, permissionsSchema, popover, prefersResponsesApiByModel, presetSettings, principalSchema, progress, promptFilterFieldSchema, promptPermissionsSchema, promptTokensFromUsage, providerEndpointMap, radioGroup, rateLimitSchema, readScheduleMCPOutcomes, reconcileContextUsage, reconcileContextUsageFromEvent, registerPage, remoteAgentsPermissionsSchema, removeCodeExecutionCaller, removeNullishValues, replaceSpecialVars, request_default as request, requiresExplicitThinkingDisabled, resolveAgentSkillsScope, resolveAllowedStatefulCodeEnvironments, resolveCodeApprovalMode, resolveCodePermissionDecision, resolveDefaultLLMDeliveryPath, resolveDefaultUploadLLMDeliveryPath, resolveDropParamsUIKeys, resolveEffectiveUseResponsesApi, resolveEndpointType, resolveModelCatalogKey, resolveModelSpecEndpoint, resolveProviderId, resolveRef, resolveSandboxFilename, resolveStatefulCodeEnvironment, resolveThinkingDisplay, resolveTraceViewerConfig, resolveTurnLLMDeliveryPath, resolveUploadDestination, resolveUploadLLMDeliveryPath, resolveUseResponsesApi, resourcePermissionsResponseSchema, restrictSvgReferences, retainRecentConfigSchema, retrievalMimeTypes, retrievalMimeTypesList, roleDefaults, roleSchema, runCodePermissionsSchema, scheduleCadenceSchema, scheduleFrequencies, scheduleMCPOutcomeSchema, 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, stripToolCallErrorPrefix, 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, traceViewerDefaults, traceViewerLimits, transactionsSchema, turnstileOptionsSchema, turnstileSchema, unattributedAssistantContentSchema, updateResourcePermissionsRequestSchema, updateResourcePermissionsResponseSchema, updateSchedulePayloadSchema, useToast, userSubmittedMessageFieldPathSchema, utils, validateActionDomain, validateAndParseOpenAPISpec, validateAzureGroups, validateSettingDefinitions, validateVisionModel, vertexAISchema, vertexModelConfigSchema, videoMimeTypes, visionModels, webSearchPermissionsSchema, webSearchSchema };
7460
8170
 
7461
8171
  //# sourceMappingURL=index.mjs.map