LibreChat/api/server/middleware
Danny Avila 55f5f2d11a
🗓️ feat: Add Special Variables for Prompts & Agents, Prompt UI Improvements (#7123)
* wip: Add Instructions component for agent configuration

*  feat: Implement DropdownPopup for variable insertion in instructions

* refactor: Enhance variable handling by exporting specialVariables and updating Markdown components

* feat: Add special variable support for current date and user in Instructions component

* refactor: Update handleAddVariable to include localized label

* feat: replace special variables in instructions presets

* chore: update parameter type for user in getListAgents function

* refactor: integrate dayjs for date handling and move replaceSpecialVars function to data-provider

* feat: enhance replaceSpecialVars to include day number in current date format

* feat: integrate replaceSpecialVars for processing agent instructions

* feat: add support for current date & time in replaceSpecialVars function

* feat: add iso_datetime support in replaceSpecialVars function

* fix: enforce text parameter to be a required field in replaceSpecialVars function

* feat: add ISO datetime support in translation file

* fix: disable eslint warning for autoFocus in TextareaAutosize component

* feat: add VariablesDropdown component and integrate it into CreatePromptForm and PromptEditor; update translation for special variables

* fix: CategorySelector and related localizations

* fix: add z-index class to LanguageSTTDropdown for proper stacking context

* fix: add max-height and overflow styles to OGDialogContent in VariableDialog and PreviewPrompt components

* fix: update variable detection logic to exclude special variables and improve regex matching

* fix: improve accessibility text for actions menu in ChatGroupItem component

* fix: adjust max-width and height styles for dialog components and improve markdown rendering for light vs. dark, height/widths, etc.

* fix: remove commented-out code for better readability in PromptVariableGfm component

* fix: handle undefined input parameter in setParams function call

* fix: update variable label types to use TSpecialVarLabel for consistency

* fix: remove outdated information from special variables description in translation file

* fix: enhance unused i18next keys detection for special variable keys

* fix: update color classes for consistency/a11y in category and prompt variable components

* fix: update PromptVariableGfm component and special variable styles for consistency

* fix: improve variable highlighting logic in VariableForm component

* fix: update background color classes for consistency in VariableForm component

* fix: add missing ref parameter to Dialog component in OriginalDialog

* refactor: move navigate call for new conversation to after setConversation update

* refactor: move message query hook to client workspace; fix: handle edge case for navigation from finalHandler creating race condition for response message DB save

* chore: bump librechat-data-provider to 0.7.793

* ci: add unit tests for replaceSpecialVars function

* fix: implement getToolkitKey function for image_gen_oai toolkit filtering/including

* ci: enhance dayjs mock for consistent date/time values in tests

* fix: MCP stdio server fail to start when passing env property

* fix: use optional chaining for clientRef dereferencing in AskController and EditController
feat: add context to saveMessage call in streamResponse utility

* fix: only save error messages if the userMessageId was initialized

* refactor: add isNotAppendable check to disable inputs in ChatForm and useTextarea

* feat: enhance error handling in useEventHandlers and update conversation state in useNewConvo

* refactor: prepend underscore to conversationId in newConversation template

* feat: log aborted conversations with minimal messages and use consistent conversationId generation

---------

Co-authored-by: Olivier Schiavo <olivier.schiavo@wengo.com>
Co-authored-by: aka012 <aka012@neowiz.com>
Co-authored-by: jiasheng <jiashengguo@outlook.com>
2025-04-29 03:49:02 -04:00
..
assistants fix: Wait for Initial Message Save & Correct Latest Message (#3399) 2024-07-20 01:51:59 -04:00
limiters 🤖 refactor: Improve Agents Memory Usage, Bump Keyv, Grok 3 (#6850) 2025-04-12 18:46:36 -04:00
roles 🪺 refactor: Nest Permission fields for Roles (#6487) 2025-04-04 19:47:14 -04:00
spec 🛡️ fix: Minor Vulnerabilities (#4543) 2024-10-24 15:50:48 -04:00
validate 🧹 chore: pre-release cleanup 2 (#3600) 2024-08-09 15:17:13 -04:00
abortControllers.js feat(GPT/Anthropic): Continue Regenerating & Generation Buttons (#808) 2023-08-17 12:50:05 -04:00
abortMiddleware.js 🗓️ feat: Add Special Variables for Prompts & Agents, Prompt UI Improvements (#7123) 2025-04-29 03:49:02 -04:00
abortRun.js feat: Add Current Datetime to Assistants (v1/v2) (#4952) 2024-12-11 15:26:18 -05:00
buildEndpointOption.js 🔦 feat: MCP Support for Non-Agent Endpoints (#6775) 2025-04-07 19:16:56 -04:00
canDeleteAccount.js 🗨️ feat: Prompts (#3131) 2024-06-20 20:24:32 -04:00
checkBan.js 🤖 refactor: Improve Agents Memory Usage, Bump Keyv, Grok 3 (#6850) 2025-04-12 18:46:36 -04:00
checkDomainAllowed.js 🔐 feat: Implement Allowed Action Domains (#4964) 2024-12-12 12:52:42 -05:00
checkInviteUser.js 📩 feat: invite user (#3012) 2024-08-18 00:23:38 -04:00
concurrentLimiter.js 🤖 feat: Support o4-mini and o3 Models (#6928) 2025-04-17 00:40:26 -04:00
denyRequest.js 🌿 fix: Message Route Improvements pt. 2 (#3379) 2024-07-18 13:56:19 -04:00
index.js 🪙 feat: Sync Balance Config on Login (#6671) 2025-04-01 21:19:42 -04:00
logHeaders.js 🛠 feat: Enhance Redis Integration, Rate Limiters & Log Headers (#6462) 2025-03-21 14:14:45 -04:00
moderateText.js 🔧 fix: Chat Middleware, Zod Conversion, Auto-Save and S3 URL Refresh (#6720) 2025-04-03 20:42:56 -04:00
noIndex.js 🚫🔍 feat: disallow search indexing (#1409) 2023-12-29 20:42:04 -05:00
optionalJwtAuth.js 🚀 feat: Banner (#3952) 2024-09-11 09:34:25 -04:00
requireJwtAuth.js feat(GPT/Anthropic): Continue Regenerating & Generation Buttons (#808) 2023-08-17 12:50:05 -04:00
requireLdapAuth.js 🚀 feat(LDAP): Add Flexible Configuration Options (#3124) 2024-06-21 10:14:53 -04:00
requireLocalAuth.js 🚀 feat: Enhance Model Handling, Logging & xAI Agent Support (#6182) 2025-03-05 12:04:26 -05:00
setBalanceConfig.js 🪙 feat: Sync Balance Config on Login (#6671) 2025-04-01 21:19:42 -04:00
setHeaders.js feat(GPT/Anthropic): Continue Regenerating & Generation Buttons (#808) 2023-08-17 12:50:05 -04:00
uaParser.js feat: Message Rate Limiters, Violation Logging, & Ban System 🔨 (#903) 2023-09-13 10:57:07 -04:00
validateEndpoint.js 💫 feat: Config File & Custom Endpoints (#1474) 2024-01-03 09:22:48 -05:00
validateImageRequest.js 🛡️ fix: Minor Vulnerabilities (#4543) 2024-10-24 15:50:48 -04:00
validateMessageReq.js 🚤 refactor: Optimize Request Lifecycle Speeds (#3222) 2024-06-28 08:44:47 -04:00
validateModel.js 🤖 feat(Anthropic): Claude 3 & Vision Support (#1984) 2024-03-06 00:04:52 -05:00
validatePasswordReset.js 🔒 feat: password reset disable option; fix: account email error message (#2327) 2024-06-06 11:39:36 -04:00
validateRegistration.js 📩 feat: invite user (#3012) 2024-08-18 00:23:38 -04:00