* agents - phase 1 (#30)
* chore: copy assistant files
* feat: frontend and data-provider
* feat: backend get endpoint test
* fix(MessageEndpointIcon): switched to AgentName and AgentAvatar
* fix: small fixes
* fix: agent endpoint config
* fix: show Agent Builder
* chore: install agentus
* chore: initial scaffolding for agents
* fix: updated Assistant logic to Agent Logic for some Agent components
* WIP first pass, demo of agent package
* WIP: initial backend infra for agents
* fix: agent list error
* wip: agents routing
* chore: Refactor useSSE hook to handle different data events
* wip: correctly emit events
* chore: Update @librechat/agentus npm dependency to version 1.0.9
* remove comment
* first pass: streaming agent text
* chore: Remove @librechat/agentus root-level workspace npm dependency
* feat: Agent Schema and Model
* fix: content handling fixes
* fix: content message save
* WIP: new content data
* fix: run step issue with tool calls
* chore: Update @librechat/agentus npm dependency to version 1.1.5
* feat: update controller and agent routes
* wip: initial backend tool and tool error handling support
* wip: tool chunks
* chore: Update @librechat/agentus npm dependency to version 1.1.7
* chore: update tool_call typing, add test conditions and logs
* fix: create agent
* fix: create agent
* first pass: render completed content parts
* fix: remove logging, fix step handler typing
* chore: Update @librechat/agentus npm dependency to version 1.1.9
* refactor: cleanup maps on unmount
* chore: Update BaseClient.js to safely count tokens for string, number, and boolean values
* fix: support subsequent messages with tool_calls
* chore: export order
* fix: select agent
* fix: tool call types and handling
* chore: switch to anthropic for testing
* fix: AgentSelect
* refactor: experimental: OpenAIClient to use array for intermediateReply
* fix(useSSE): revert old condition for streaming legacy client tokens
* fix: lint
* revert `agent_id` to `id`
* chore: update localization keys for agent-related components
* feat: zod schema handling for actions
* refactor(actions): if no params, no zodSchema
* chore: Update @librechat/agentus npm dependency to version 1.2.1
* feat: first pass, actions
* refactor: empty schema for actions without params
* feat: Update createRun function to accept additional options
* fix: message payload formatting; feat: add more client options
* fix: ToolCall component rendering when action has no args but has output
* refactor(ToolCall): allow non-stringy args
* WIP: first pass, correctly formatted tool_calls between providers
* refactor: Remove duplicate import of 'roles' module
* refactor: Exclude 'vite.config.ts' from TypeScript compilation
* refactor: fix agent related types
> - no need to use endpoint/model fields for identifying agent metadata
> - add `provider` distinction for agent-configured 'endpoint'
- no need for agent-endpoint map
- reduce complexity of tools as functions into tools as string[]
- fix types related to above changes
- reduce unnecessary variables for queries/mutations and corresponding react-query keys
* refactor: Add tools and tool_kwargs fields to agent schema
* refactor: Remove unused code and update dependencies
* refactor: Update updateAgentHandler to use req.body directly
* refactor: Update AgentSelect component to use localized hooks
* refactor: Update agent schema to include tools and provider fields
* refactor(AgentPanel): add scrollbar gutter, add provider field to form, fix agent schema required values
* refactor: Update AgentSwitcher component to use selectedAgentId instead of selectedAgent
* refactor: Update AgentPanel component to include alternateName import and defaultAgentFormValues
* refactor(SelectDropDown): allow setting value as option while still supporting legacy usage (string values only)
* refactor: SelectDropdown changes - Only necessary when the available values are objects with label/value fields and the selected value is expected to be a string.
* refactor: TypeError issues and handle provider as option
* feat: Add placeholder for provider selection in AgentPanel component
* refactor: Update agent schema to include author and provider fields
* fix: show expected 'create agent' placeholder when creating agent
* chore: fix localization strings, hide capabilities form for now
* chore: typing
* refactor: import order and use compact agents schema for now
* chore: typing
* refactor: Update AgentForm type to use AgentCapabilities
* fix agent form agent selection issues
* feat: responsive agent selection
* fix: Handle cancelled fetch in useSelectAgent hook
* fix: reset agent form on accordion close/open
* feat: Add agent_id to default conversation for agents endpoint
* feat: agents endpoint request handling
* refactor: reset conversation model on agent select
* refactor: add `additional_instructions` to conversation schema, organize other fields
* chore: casing
* chore: types
* refactor(loadAgentTools): explicitly pass agent_id, do not pass `model` to loadAgentTools for now, load action sets by agent_id
* WIP: initial draft of real agent client initialization
* WIP: first pass, anthropic agent requests
* feat: remember last selected agent
* feat: openai and azure connected
* fix: prioritize agent model for runs unless an explicit override model is passed from client
* feat: Agent Actions
* fix: save agent id to convo
* feat: model panel (#29)
* feat: model panel
* bring back comments
* fix: method still null
* fix: AgentPanel FormContext
* feat: add more parameters
* fix: style issues; refactor: Agent Controller
* fix: cherry-pick
* fix: Update AgentAvatar component to use AssistantIcon instead of BrainCircuit
* feat: OGDialog for delete agent; feat(assistant): update Agent types, introduced `model_parameters`
* feat: icon and general `model_parameters` update
* feat: use react-hook-form better
* fix: agent builder form reset issue when switching panels
* refactor: modularize agent builder form
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: AgentPanel and ModelPanel type issues and use `useFormContext` and `watch` instead of `methods` directly and `useWatch`.
* fix: tool call issues due to invalid input (anthropic) of empty string
* fix: handle empty text in Part component
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* refactor: remove form ModelPanel and fixed nested ternary expressions in AgentConfig
* fix: Model Parameters not saved correctly
* refactor: remove console log
* feat: avatar upload and get for Agents (#36)
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* chore: update to public package
* fix: typing, optional chaining
* fix: cursor not showing for content parts
* chore: conditionally enable agents
* ci: fix azure test
* ci: fix frontend tests, fix eslint api
* refactor: Remove unused errorContentPart variable
* continue of the agent message PR (#40)
* last fixes
* fix: agentMap
* pr merge test (#41)
* fix: model icon not fetching correctly
* remove console logs
* feat: agent name
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* refactor: pass documentsMap as a prop to allow re-render of assistant form
* chore: Bump version to 0.7.419
* fix: TypeError: Cannot read properties of undefined (reading 'id')
* refactor: update AgentSwitcher component to use ControlCombobox instead of Combobox
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* Added UI for Terms and Conditions Modal Dialogue
* Handled the logout on not accepting
* Added logic for terms acceptance
* Add terms and conditions modal
* Fixed bug on terms and conditions modal, clicking out of it won't close it now
* Added acceptance of Terms to Database
* Removed unnecessary api endpoints from index.js
* Added NPM script to reset terms acceptance
* Added translations, markdown terms and samples
* Merged terms and conditions modal feature
* feat/Modal Terms and Conditions Dialog
* Amendments as requested by maintainers
* Reset package-lock (again)
* refactor: Update staticCache to use oneDayInSeconds for sMaxAge and maxAge
* refactor: role updates
* style: first pass cursor
* style: Update nested list styles in style.css
* feat: setIsSubmitting to true in message handler to prevent edge case where submitting turns false during message stream
* feat: Add logic to redirect to conversation page after creating a new conversation
* refactor: Trim code string before copying in CodeBlock component
* feat: configSchema bookmarks and presets defaults
* feat: Update loadDefaultInterface to handle undefined config
* refactor: use for compression check
* feat: first pass, query params
* fix: styling issues for prompt cards
* feat: anthropic prompt caching UI switch
* chore: Update static file cache control defaults/comments in .env.example
* ci: fix tests
* ci: fix tests
* chore: use "submitting" class server error connection suspense fallback
* chore: update package version to 0.7.416
* chore: Update Role.js imports order
* refactor: move updateTagsInConvo to tags route, add RBAC for tags
* refactor: add updateTagsInConvoOptions
* fix: loading state for bookmark form
* refactor: update primaryText class in TitleButton component
* refactor: remove duplicate bookmarks and theming
* refactor: update EditIcon component to use React.forwardRef
* refactor: add _id field to tConversationTagSchema
* refactor: remove promises
* refactor: move mutation logic from BookmarkForm -> BookmarkEditDialog
* refactor: update button class in BookmarkForm component
* fix: conversation mutations and add better logging to useConversationTagMutation
* refactor: update logger message in BookmarkEditDialog component
* refactor: improve UI consistency in BookmarkNav and NewChat components
* refactor: update logger message in BookmarkEditDialog component
* refactor: Add tags prop to BookmarkForm component
* refactor: Update BookmarkForm to avoid tag mutation if the tag already exists; also close dialog on submission programmatically
* refactor: general role helper function to support updating access permissions for different permission types
* refactor: Update getLatestText function to handle undefined values in message.content
* refactor: Update useHasAccess hook to handle null role values for authenticated users
* feat: toggle bookmarks access
* refactor: Update PromptsCommand to handle access permissions for prompts
* feat: updateConversationSelector
* refactor: rename `vars` to `tagToDelete` for clarity
* fix: prevent recreation of deleted tags in BookmarkMenu on Item Click
* ci: mock updateBookmarksAccess function
* ci: mock updateBookmarksAccess function
* chore: update CONFIG_VERSION to '1.1.6'
* chore: update package version to 0.7.415
* feat: toggle USER role access to prompts via librechat.yaml
* refactor: set prompts to true when loadDefaultInterface returns true
* ci(AppService): mock updatePromptsAccess
* feat: basic invite-user script
* feat: add invite user functionality and registration validation middleware
* fix: invite user fixes
* refactor: consolidate direct model access to a central place of functions
* style(Registration): add spinner to continue button
* refactor: import ordrer
* feat: improve invite user script and error handling
* fix: merge conflict
* refactor: remove `console.log` and use `logger`
* fix: token operation and checkinvite issues
* bring back comment and remove console log
* fix: return invalid token when token is not found
* fix: getInvite fix
* refactor: Update Token.js to use async/await syntax for update and delete operations
* feat: Refactor Token.js to use async/await syntax for createToken and findToken functions
* refactor(inviteUser): define functions outside of module.exports
* Update AuthService.js
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* wip: initial cache control implementation, add typing for transactions handling
* feat: first pass of Anthropic Prompt Caching
* feat: standardize stream usage as pass in when calculating token counts
* feat: Add getCacheMultiplier function to calculate cache multiplier for different valueKeys and cacheTypes
* chore: imports order
* refactor: token usage recording in AnthropicClient, no need to "correct" as we have the correct amount
* feat: more accurate token counting using stream usage data
* feat: Improve token counting accuracy with stream usage data
* refactor: ensure more accurate than not token estimations if custom instructions or files are not being resent with every request
* refactor: cleanup updateUserMessageTokenCount to allow transactions to be as accurate as possible even if we shouldn't update user message token counts
* ci: fix tests
* feat: new dropdown
* fix: maintain popover active when open
* fix: update DeleteButton and ShareButton component to use useState for managing dialog state
* BREAKING: style improvement of base Button component
* style: update export button
* a11y: ExportAndShareButton
* add border
* quick style fix
* fix: flick issue on convo
* fix: DropDown opens when renaming
* chore: update radix-ui/react-dropdown-menu to latest
* small fix
* style: bookmarks update
* reorder export modal
* feat: imporved dropdowns
* style: a lot of changes; header, bookmarks, export, nav, convo, convoOptions
* fix: small style issues
* fix: button
* fix: bookmarks header menu
* fix: dropdown close glitch
* feat: Improve accessibility and keyboard navigation in ModelSpec component
* fix: Nav related type issues
* style: ConvoOptions theming and focus ring
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* refactor: scrollToEnd
* fix(validateConvoAccess): search conversation by ID for proper validation
* feat: Add unique index for conversationId and user in convoSchema
* refactor: Update font sizes 1 rem -> font-size-base in style.css
* fix: Assistants map type issues
* refactor: Remove obsolete scripts
* fix: Update DropdownNoState component to handle both string and OptionType values
* refactor: Remove config/loader.js file
* fix: remove crypto.randomBytes(); refactor: Create reusable function for generating token and hash
* fix: Update health endpoint URL
* refactor: use Constants for saved tag default value, do not place Saved as first always
* refactor: check trimmed currentText before appending parsedText in useSubmitMessage
* refactor: move `scrollToEnd()` to `createdHandler` and increase delay before execution slightly
* chore: Add back TypeScript linting rules for unnecessary conditions and strict boolean expressions
* chore: Update librechat-data-provider package.json version to 0.7.4.0
* feat: gpt-4o-2024-08-06 pricing for tx
* feat: add AWS models to tokenValues in tx.js for pricing transactions
* feat: Update tokenValues in tx.js for AWS models pricing
* refactor: add bedrock prefix values as well (temporary until we update value keys which includes context)
* refactor: optimize tag methods, remove rebuild
* refactor(tags): add lean db operations, fix updateTagsForConversation, remove rebuild button, only send convoId once
* refactor: Update BookmarkMenu to use Constants.NEW_CONVO constant for comparison
* style: Update BookmarkMenu styles and constants, use theming
* refactor: move tags query from package to client workspace
* refactor: optimize ConversationTag document creation and update logic
* style: Update BookmarkMenuItems to use theming
* refactor: JSDocs + try/catch for conversation tags API routes
* refactor: Update BookmarkNav theming classes and new data provider location
* fix: statefulness of conversation bookmarks
- move non-mutation hook to hooks/Conversation
- remove use of deprecated global convo
- update convo infinite data as well as current convo state upon successful tag add
* refactor: Update BookmarkMenu styles and constants, use theming
* refactor: Add lean option to ConversationTag deletion query
* fix(BookmarkTable): position order rendering esp. when new tag is created
* refactor: Update useBookmarkSucess to useBookmarkSuccess for consistency
* refactor: Update ConversationTag creation logic to increment count only if addToConversation is true
* style: theming
* chore: playwright setup update
* refactor: update ChatRoute component with accessible loading spinner with live region
* chore(Message): typing
* ci: first pass, a11y testing
* refactor: update lang attribute in index.html to "en-US"
* ci: jsx-a11y dev eslint plugin
* ci: jsx plugin
* fix: Exclude 'vite.config.ts' from TypeScript compilation for testing
* fix(a11y): Remove tabIndex from non-interactive element in MessagesView component
* fix(a11y):
- Visible, non-interactive elements with click handlers must have at least one keyboard listener.eslintjsx-a11y/click-events-have-key-events
- Avoid non-native interactive elements. If using native HTML is not possible, add an appropriate role and support for tabbing, mouse, keyboard, and touch inputs to an interactive content element.eslintjsx-a11y/no-static-element-interactions
chore: remove unused bookmarks panel
- fix some "Unexpected nullable boolean value in conditional" warnings
* fix(NewChat): a11y, nested button issue, add aria-label, remove implicit role
* fix(a11y):
- partially address #3515 with `main` landmark
other:
- eslint@typescript-eslint/strict-boolean-expressions
* chore(MenuButton): Use button element instead of div for accessibility
* chore: Update TitleButton to use button element for accessibility
* chore: Update TitleButton to use button element for accessibility
* refactor(ChatMenuItem): Improve focus accessibility and code readability
* chore(MenuButton): Update aria-label to dynamically include primaryText
* fix(a11y): SearchBar
- If a form control does not have a properly associated text label, the function or purpose of that form control may not be presented to screen reader users. Visible form labels also provide visible descriptions and larger clickable targets for form controls which placeholders do not.
* chore: remove duplicate SearchBar twcss
* fix(a11y):
- The edit and copy buttons that are visually hidden are exposed to Assistive technology and are announced to screen reader users.
* fix(a11y): visible focus outline
* fix(a11y): The button to select the LLM Model has the aria-haspopup and aria- expanded attributes which makes its role ambuguous and unclear. It functions like a combobox but doesn't fully support that interaction and also fucntions like a dialog but doesn't completely support that interaction either.
* fix(a11y): fix visible focus outline
* fix(a11y): Scroll to bottom button missing accessible name #3474
* fix(a11y): The page lacks any heading structure. There should be at least one H1 and other headings to help users understand the orgainzation of the page and the contents.
Note: h1 won't be correct here so made it h2
* fix(a11y): LLM controls aria-labels
* fix(a11y): There is no visible focus outline to the 'send message' button
* fix(a11y): fix visible focus outline for Fork button
* refactor(MessageRender): add focus ring to message cards, consolidate complex conditions, add logger for setting latest message, add tabindex for card
* fix: focus border color and fix set latest message card condition
* fix(a11y): Adequate contrast for MessageAudio buttton
* feat: Add GitHub Actions workflow for accessibility linting
* chore: Update GitHub Actions workflow for accessibility linting to include client/src/** path
* fix(Nav): navmask and accessibility
* fix: Update Nav component to handle potential undefined type in SearchContext
* fix(a11y): add focus visibility to attach files button #3475
* fix(a11y): discernible text for NewChat button
* fix(a11y): accessible landmark names, all page content in landmarks, ensures landmarks are unique #3514#3515
* fix(Prompts): update isChatRoute prop to be required in List component
* fix(a11y): buttons must have discernible text
* feat: add tags property in Conversation model
* feat: add ConversationTag model
* feat: add the tags parameter to getConvosByPage
* feat: add API route to ConversationTag
* feat: add types of ConversationTag
* feat: add data access functions for conversation tags
* feat: add Bookmark table component
* feat: Add an action to bookmark
* feat: add Bookmark nav component
* fix: failed test
* refactor: made 'Saved' tag a constant
* feat: add new bookmark to current conversation
* chore: Add comment
* fix: delete tag from conversations when it's deleted
* fix: Update the query cache when the tag title is changed.
* chore: fix typo
* refactor: add description of rebuilding bookmarks
* chore: remove unused variables
* fix: position when adding a new bookmark
* refactor: add comment, rename a function
* refactor: add a unique constraint in ConversationTag
* chore: add localizations
- Add unique index for messageId and user in messageSchema
- use `updateMessage` for updating the plugins message?
- add better logging for updateMessage
- prevents dupe_key or getKeyIndex error
* feat: `gpt-4o-mini`
* feat: retrival
* fix: Update order of model token values for 'gpt-4o' and 'gpt-4o-mini'
* fix: Update order of model token values for 'gpt-4o' and 'gpt-4o-mini'
* fix: Update order of model token values for 'gpt-4o' and 'gpt-4o-mini'
* fix: add jsdoc
* fix: Update order of model token values for 'gpt-4o' and 'gpt-4o-mini'
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* fix: edge case with debugTraverse function in parsers.js
* chore: Update error message in audio stream processing
* refactor: Add ONE_MINUTE and THIRTY_SECONDS options to Time enum
* fix: logging
* fix: do not throw errors for invalid convo id, simply return undefined
* feat: Add error handling and logging to message route definitions
* feat: Refactor Message.js to improve code organization and readability
* fix: Return undefined instead of throwing error for invalid conversation ID in Message.spec.js
* refactor: optimize backend operations for client requests
* fix: message styling
* refactor: Improve handleKeyUp logic in StreamRunManager.js and handleText.js
* refactor: Improve handleKeyUp logic in StreamRunManager.js and handleText.js
* fix: clear new convo messages on clear all convos
* fix: forgot to pass userId to getConvo
* refactor: update getPartialText to send basePayload.text
* chore: Update prompt description placeholder text
* fix: promptsPathPattern to not include new
* feat: command input and styling change for prompt views
* fix: intended validation
* feat: prompts slash command
* chore: localizations and fix add command during creation
* refactor(PromptsCommand): better label
* feat: update `allPrompGroups` cache on all promptGroups mutations
* refactor: ensure assistants builder is first within sidepanel
* refactor: allow defining emailVerified via create-user script
* refactor: add error handling in Share model
* refactor: add error handing to API routers
* refactor: display error message when API response is an error
* chore: remove unneccesary JSON.stringify
* chore: revert unintended changes
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* 🗨️ feat: Prompts (#7)
* WIP: MERGE prompts/frontend (#1)
* added schema for prompt and promptgroup, added model methods for prompts, added routes for prompts
* * updated promptGroup Schema
* updated model methods for prompts (get, add, delete)
* slight fixes in prompt routes
* * Created Files Management components
* Created Vector Stores components
* Added file management route in the routes folder
* Completed UI for Files list, Compeleted UI for vector stores list, Completed UI for upload file modal, Completed UI for preview file, Completed UI for preview vector store
* Fixed style and UI fixes for file dashboard, file list and vector stores list
* added responsiveness classes for vector store page
* fixed responsiveness of file page, dashboard page, and main page
* fixed styling and responsiveness issues on dashboard page, file list page and vector store page
* added queries and mutations for prompts and promptGroups, added relevant endpoints in data-provider, added relevant components prompts, added and updated relevant APIs
* added types on mutation queries data service, updated prompt attributes
* feature: Prompts and prompt groups management, added relevant APIs, added types for data service/queries/mutations, added relevant mutation and queries
* chore: typing clarifications
* added drop down on prompts mgmt dashboard
* Fixes: fixed version switching issue on tags update or labels update, added cross button on create prompt group, fixed list updation on prompt group renaiming, added CSV upload button
* Feature: Added oneliner and category attributes in prompt group, added schema for categories, added schema methods and route for categories
* chore: typing and lint issues
* chore: more type and linter fixes
* chore: linting
* chore: prompt controller and backend typing example; MOVE TO CONTROLLER DIRECTORY
* chore: more type fixes
* style: prompt name changes
* chore: more type changes, and stateful prompt name change without flickering
* fix: Return result of savePrompt in patchPrompt API endpoint
* fix: navigation prompt queries; refactor: name 'prompt-groups' to just 'groups'
* refactor: fetch prompt groups rewrite
* refactor(prompts): query/mutation statefulness
* refactor: remove `isActive` field
* refactor: remove labels, consolidate logic
* style: width, layout shift
* refactor: improve hover toggle behavior and styling
* refactor: add useParams hook to PromptListItem for dynamic rendering and add timeout ref for blur timeout
* chore: hide upload button
* refactor: import Button component from correct location in PromptSidePanel
* style: prompt editor styling
* style: fix more layout shifts
* style: container scroll
* refactor: Rename CreatePrompt component to CreatePromptForm
* refactor: use react-hook-form
* refactor: Add Prompts components and routes to Dashboard
* style: skeletons for loading
* fix: optimize makePromptProduction
* refactor: consolidate variables
* feat: create prompt form validation
* refactor: Consolidate variables and update mutation hooks
* style: minor touchups
* chore: Update lucide-react npm dependency to version 0.394.0 and npm audit fix
* refactor: add a new icon for the Prompts heading.
* style: Update PromptsView heading to use h1 instead of h2 and other minor margin issues
* chore: wording
* refactor: Update PromptsView heading to use h1 instead of h2, consolidate variables, and add new icons
* refactor: Prompts Button for Mobile
* feature: added category field in prompt group, added relevant API and static data on BE to support FE UI for category in prompt group
* chore: template for prompt cards
---------
Co-authored-by: Fawadpot <contactfawada@gmail.com>
* WIP: Prompts/frontend Continued (#2)
* chore: loading style, remove unused component
* feat: Add CategorySelector component for prompt group category selection
* feat: add categories to create prompt
* feat: prompt versions styling
* feat: optimistic updates for prompt production state
* refactor: optimize form state and show if prompt field is dirty with cross icon, also other styling changes
* chore: remove unused code and localizations
* fix: light mode styling
* WIP: SidePanel Prompts
* refactor: move to groups directory
* refactor: rename GroupsSidePanel to GroupSidePanel and update imports
* style: ListCard
* refactor: isProduction changes
* refactor: infinite query with productionPrompt
* refactor: optimize snippets and prompts, and styling
* refactor: Update getSnippet function to accept a length parameter
* chore: localizations
* feat: prompts navigation to chat and vice versa
* fix: create prompt
* feat: remember last selected category for creating prompts
* fix(promptGroups): fix pagination and add usePromptGroupsNav hook
* Prompts/frontend 3 (#3)
* fix: stateful issues with prompt groups
* style: improved layout
* refactor: improve variable naming in Eng.ts
* refactor: theme selector styling improvements
* added prompt cards on chat new page, with dark mode, added API to fetch random prompts, added types for useQuery
Slightly improved usePromptGroupNav logic to fetch updated result for pageSize, updated prompt cards view with darkmode and responsiveness
fixed page size option buttons styling to match the theme
added dark mode on create prompt page and prompt edit/preview page
fixed page size option buttons styling to match the theme
added dark mode on create prompt page and prompt edit/preview page
* WIP: Prompts/frontend (#4)
* fix: optimize and fix paginated query
* fix: remove unique constraint on names
* refactor: button links and styling
* style: menu border light mode
* feat: Add Auto-Send Switch component for prompts groups
* refactor(ChatView): use form context for submission text
* chore: clear convo state on navigation to dashboard routes
* chore: save prompt edit name on tab, remove console log
* feat: basic prompt submission
* refactor: move Auto-Send Switch
* style(ListCard): border styling
* feat: Add function to detect variables in text
* feat: Add OriginalDialog component to UI library
* chore(ui): Update SelectDropDown options list class to use text-xs size
* refactor: submitMessage hook now includes submitPrompt, make compatible to document query selector
* WIP: Variable Dialog
* feat: variable submission working for both auto-send and non-autosend
* feat: dashboard breadcrumbs and prompts/chat navigation
* refactor: dashboard breadcrumb and dashboard link to chat navigation
* refactor: Update VariableDialog and VariableForm styles
* Prompts: Admin features (#5)
* fix: link issue
* fix: usePromptGroupsNav add missing dep.
* style: dashbreadcrumb and sidepanel text color
* temp fix: remove refetch on pageNumber change
* fix: handle multiple variable replacement
* WIP: create project schema and add project groups to fetch
* feat: Add functionality to add prompt group IDs to a project
* feat: Add caching for startup config in config route
* chore: remove prompt landing
* style: Update Skeleton component with additional background styling
* chore: styling and types
* WIP: SharePrompt first draft
* feat(SharePrompt): form validation
* feat: shared global indicators
* refactor: prompt details
* refactor: change NoPromptGroup directory
* feat: preview prompt
* feat: remove/add global prompts, add rbac-related enums
* refactor: manage prompts location
* WIP: first draft admin settings for prompts
* feat: SystemRoles enum
* refactor: update PromptDetails component styling
* style: ellipsis custom class for showing more preview text
* WIP: initial role schema and initialization
* style: improved margins for single unordered lists
* fix: use custom chat form context to prevent re-renders from FormProvider
* feat: Role mutations for Prompt Permissions
* feat: fetch user role
* feat: update AdminSettings form default values from user role values
* refactor: rename PromptPermissions to Permissions for general definitions
* feat: initial role checks
* feat: Add optional `bodyProps` parameter to generateCheckAccess middleware
* refactor: UI access checks
* Prompts: delete (#6)
* Fixed delete prompt version API, fixed types and logic for prompt version deletion, updated prompt delete mutation logic
* chore: Update return type of deletePrompt function in Prompt.js
---------
Co-authored-by: Fawadpot <contactfawada@gmail.com>
* chore: Update package-lock.json version to 0.7.4-rc1 and fast-xml-parser to 4.4.0
* feat: toast for saving admin settings, add timer no-access navigation
* feat: always make prod
* feat: Add localization to category labels in CategorySelector component
* feat: Update category label localization in CategorySelector component
* fix: Enable making prompt production in Prompt API
---------
Co-authored-by: Fawadpot <contactfawada@gmail.com>
* feat: Add helper fn for dark mode detection in ThemeProvider
* style: surface-primary definition
* fix(useHasAccess): utilize user.role and not just USER role
* fix: empty category and role fetch
* refactort: increase max height to options list and use label if no localization is found
* fix: update CategorySelector to handle empty category value and improve localization
* refactor: move prompts to own store/reactquery modules, add in filter WIP
* refactor: Rename AutoSendSwitch to AutoSendPrompt
* style: theming commit
* style: fix slight coloring issue for convos in dark mode
* style: better composition for prompts side panel
* style: remove gray-750 and make it gray-850
* chore: adjust theming
* feat: filter all prompt groups and properly remove prompts from projects
* refactor: optimize delete prompt groups further
* chore: localization
* feat: Add uniqueProperty filtering to normalizeData function
* WIP: filter prompts
* chore: Update FilterPrompts component to include User icon in FilterItem
* feat(FilterPrompts): set categories
* feat: more system filters and show selected category icon
* style: always make prod, flips switch to avoid mis-clicks
* style: ui/ux loading/no prompts
* chore: style FilterPrompts ChatView
* fix: handle missing role edge case
* style: special variables
* feat: special variables
* refactor: improve replaceSpecialVars function in prompts.ts
* feat: simple/advanced editor modes
* chore: bump versions
* feat: localizations and hide production button on simple mode
* fix: error connecting layout shift
* fix: prompts CRUD for admins
* fix: secure single group fetch
* style: sidepanel styling
* style(PromptName): bring edit button closer to name
* style: mobile prompts header
* style: mobile prompts header continued
* style: align send prompts switch right
* feat: description
* Update special variables description in Eng.ts
* feat: update/create/preview oneliner
* fix: allow empty oneliner update
* style: loading improvement and always make selected prompt Production if simple mode
* fix: production index set and remove unused props
* fix(ci): mock initializeRoles
* fix: address #3128
* fix: address #3128
* feat: add deletion confirmation dialog
* fix: mobile UI issues
* style: prompt library UI update
* style: focus, logcal tab order
* style: Refactor SelectDropDown component to improve code readability and maintainability
* chore: bump data-provider
* chore: fix labels
* refactor: confirm delete prompt version
---------
Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
* feat: Add index to conversationId field in messageSchema
* refactor: prevent immediate event close on error
* refactor: use undici instead of node-fetch in non-Bun environment
* fix: user.id assignment in jwtStrategy.js
* refactor(sendEmail): pass params as object, await email sending to propogate errors and restrict registration flow
* fix(Conversations): handle missing updatedAt field
* refactor: use `processDeleteRequest` when deleting user account for user file deletion
* refactor: delete orphaned files when deleting user account
* fix: remove unnecessary 404 status code in server/index.js
* feat: verification email
* chore: email verification invalid; localize: update
* fix: redirect to login when signup: fix: save emailVerified correctly
* docs: update ALLOW_UNVERIFIED_EMAIL_LOGIN; fix: don't accept login only when ALLOW_UNVERIFIED_EMAIL_LOGIN = true
* fix: user needs to be authenticated
* style: update
* fix: registration success message and redirect logic
* refactor: use `isEnabled` in ALLOW_UNVERIFIED_EMAIL_LOGIN
* refactor: move checkEmailConfig to server/utils
* refactor: use req as param for verifyEmail function
* chore: jsdoc
* chore: remove console log
* refactor: rename `createNewUser` to `createSocialUser`
* refactor: update typing and add expiresAt field to userSchema
* refactor: begin use of user methods over direct model access for User
* refactor: initial email verification rewrite
* chore: typing
* refactor: registration flow rewrite
* chore: remove help center text
* refactor: update getUser to getUserById and add findUser methods. general fixes from recent changes
* refactor: Update updateUser method to remove expiresAt field and use $set and $unset operations, createUser now returns Id only
* refactor: Update openidStrategy to use optional chaining for avatar check, move saveBuffer init to buffer condition
* refactor: logout on deleteUser mutatation
* refactor: Update openidStrategy login success message format
* refactor: Add emailVerified field to Discord and Facebook profile details
* refactor: move limiters to separate middleware dir
* refactor: Add limiters for email verification and password reset
* refactor: Remove getUserController and update routes and controllers accordingly
* refactor: Update getUserById method to exclude password and version fields
* refactor: move verification to user route, add resend verification option
* refactor: Improve email verification process and resend option
* refactor: remove more direct model access of User and remove unused code
* refactor: replace user authentication methods and token generation
* fix: add user.id to jwt user
* refactor: Update AuthContext to include setError function, add resend link to Login Form, make registration redirect shorter
* fix(updateUserPluginsService): ensure userPlugins variable is defined
* refactor: Delete all shared links for a specific user
* fix: remove use of direct User.save() in handleExistingUser
* fix(importLibreChatConvo): handle missing createdAt field in messages
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
* initial commit
* fix: UserController bugs; fix: lint errors
* fix: delete files
* language support
* style(DeleteAccount): update to the latest style
* style: fix after merge main
* chore: Add canDeleteAccount middleware for user deletion endpoint
* chore: renamed to ALLOW_ACCOUNT_DELETION
* fix(canDeleteAccount): use uppercase admin role
* chore: imports order
* chore: Enable account deletion by default if omitted/commented out
* chore: Add logging for user account deletion
* chore: Bump data-provider package version to 0.6.6
* chore: Import Transaction model in UserController
* chore: Update CONFIG_VERSION to 1.1.4
* chore: Update user account deletion logging
* chore: Refactor user account deletion logic
---------
Co-authored-by: Berry-13 <root@Berry>
Co-authored-by: Danny Avila <messagedaniel@protonmail.com>
Co-authored-by: Danny Avila <danny@librechat.ai>
* chore: remove unused code
* refactor: Update NewChatButtonIcon component to use JSX syntax
The NewChatButtonIcon component in the Nav folder has been updated to use JSX syntax instead of calling the Icon function directly. This change improves code readability and maintainability.
* remove use memo
* refactor: allow passing `select` to messages db query
* fix: initial fix for non-recursive messages
* ci: first pass, importers test rewrite
* fix(groupConversationsByDate): handle edge case of conversation.updatedAt being null
* fix: correctly handle non-recursive uploads
* feat: imports non-recursive conversations with branches correctly
* feat: support retaining original options on import
* refactor: Allow `messageTree` field for Import of non-recursive conversations
* chore: use node-fetch for OpenAIClient fetch key for non-crashing usage of AbortController in Bun runtime
* chore: variable order
* fix(useSSE): prevent finalHandler call in abortConversation to update messages/conversation after user navigated away
* chore: params order
* refactor: organize intermediate message logic and ensure correct variables are passed
* fix: Add stt and tts routes before upload limiters, prevent bans
* fix(abortRun): temp fix to delete unfinished messages to avoid message thread parent relationship issues
* refactor: Update AnthropicClient to use node-fetch for fetch key and add proxy support
* fix(gptPlugins): ensure parentMessageId/messageId relationship is maintained
* feat(BaseClient): custom fetch function to analyze/edit payloads just before sending (also prevents abortController crash on Bun runtime)
* feat: `directEndpoint` and `titleMessageRole` custom endpoint options
* chore: Bump version to 0.6.6 in data-provider package.json
* 🤖 Assistants V2 Support: Part 1
- Separated Azure Assistants to its own endpoint
- File Search / Vector Store integration is incomplete, but can toggle and use storage from playground
- Code Interpreter resource files can be added but not deleted
- GPT-4o is supported
- Many improvements to the Assistants Endpoint overall
data-provider v2 changes
copy existing route as v1
chore: rename new endpoint to reduce comparison operations and add new azure filesource
api: add azureAssistants part 1
force use of version for assistants/assistantsAzure
chore: switch name back to azureAssistants
refactor type version: string | number
Ensure assistants endpoints have version set
fix: isArchived type issue in ConversationListParams
refactor: update assistants mutations/queries with endpoint/version definitions, update Assistants Map structure
chore: FilePreview component ExtendedFile type assertion
feat: isAssistantsEndpoint helper
chore: remove unused useGenerations
chore(buildTree): type issue
chore(Advanced): type issue (unused component, maybe in future)
first pass for multi-assistant endpoint rewrite
fix(listAssistants): pass params correctly
feat: list separate assistants by endpoint
fix(useTextarea): access assistantMap correctly
fix: assistant endpoint switching, resetting ID
fix: broken during rewrite, selecting assistant mention
fix: set/invalidate assistants endpoint query data correctly
feat: Fix issue with assistant ID not being reset correctly
getOpenAIClient helper function
feat: add toast for assistant deletion
fix: assistants delete right after create issue for azure
fix: assistant patching
refactor: actions to use getOpenAIClient
refactor: consolidate logic into helpers file
fix: issue where conversation data was not initially available
v1 chat support
refactor(spendTokens): only early return if completionTokens isNaN
fix(OpenAIClient): ensure spendTokens has all necessary params
refactor: route/controller logic
fix(assistants/initializeClient): use defaultHeaders field
fix: sanitize default operation id
chore: bump openai package
first pass v2 action service
feat: retroactive domain parsing for actions added via v1
feat: delete db records of actions/assistants on openai assistant deletion
chore: remove vision tools from v2 assistants
feat: v2 upload and delete assistant vision images
WIP first pass, thread attachments
fix: show assistant vision files (save local/firebase copy)
v2 image continue
fix: annotations
fix: refine annotations
show analyze as error if is no longer submitting before progress reaches 1 and show file_search as retrieval tool
fix: abort run, undefined endpoint issue
refactor: consolidate capabilities logic and anticipate versioning
frontend version 2 changes
fix: query selection and filter
add endpoint to unknown filepath
add file ids to resource, deleting in progress
enable/disable file search
remove version log
* 🤖 Assistants V2 Support: Part 2
🎹 fix: Autocompletion Chrome Bug on Action API Key Input
chore: remove `useOriginNavigate`
chore: set correct OpenAI Storage Source
fix: azure file deletions, instantiate clients by source for deletion
update code interpret files info
feat: deleteResourceFileId
chore: increase poll interval as azure easily rate limits
fix: openai file deletions, TODO: evaluate rejected deletion settled promises to determine which to delete from db records
file source icons
update table file filters
chore: file search info and versioning
fix: retrieval update with necessary tool_resources if specified
fix(useMentions): add optional chaining in case listMap value is undefined
fix: force assistant avatar roundedness
fix: azure assistants, check correct flag
chore: bump data-provider
* fix: merge conflict
* ci: fix backend tests due to new updates
* chore: update .env.example
* meilisearch improvements
* localization updates
* chore: update comparisons
* feat: add additional metadata: endpoint, author ID
* chore: azureAssistants ENDPOINTS exclusion warning
* ✨ feat(types): add necessary types for shared link feature
* ✨ feat: add shared links functions to data service
Added functions for retrieving, creating, updating, and deleting shared links and shared messages.
* ✨ feat: Add useGetSharedMessages hook to fetch shared messages by shareId
Adds a new hook `useGetSharedMessages` which fetches shared messages based on the provided shareId.
* ✨ feat: Add share schema and data access functions to API models
* ✨ feat: Add share endpoint to API
The GET /api/share/${shareId} is exposed to the public, so authentication is not required. Other paths require authentication.
* ♻️ refactor(utils): generalize react-query cache manipulation functions
Introduces generic functions for manipulating react-query cache entries, marking a refinement in how query cache data is managed. It aims to enhance the flexibility and reusability of the cache interaction patterns within our application.
- Replaced specific index names with more generic terms in queries.ts, enhancing consistency across data handling functions.
- Introduced new utility functions in collection.ts for adding, updating, and deleting data entries in an InfiniteData<TCollection>. These utility functions (`addData`, `updateData`, `deleteData`, `findPage`) are designed to be re-usable across different data types and collections.
- Adapted existing conversation utility functions in convos.ts to leverage these new generic utilities.
* ✨ feat(shared-link): add functions to manipulate shared link cache list
implemented new utility functions to handle additions, updates, and deletions in the shared link cache list.
* ✨ feat: Add mutations and queries for shared links
* ✨ feat(shared-link): add `Share` button to conversation list
- Added a share button in each conversation in the conversation list.
- Implemented functionality where clicking the share button triggers a POST request to the API.
- The API checks if a share link was already created for the conversation today; if so, it returns the existing link.
- If no link was created for today, the API will create a new share link and return it.
- Each click on the share button results in a new API request, following the specification similar to ChatGPT's share link feature.
* ♻️ refactor(hooks): generalize useNavScrolling for broader use
- Modified `useNavScrolling` to accept a generic type parameter `TData`, allowing it to be used with different data structures besides `ConversationListResponse`.
- Updated instances in `Nav.tsx` and `ArchivedChatsTable.tsx` to explicitly specify `ConversationListResponse` as the type argument when invoking `useNavScrolling`.
* ✨ feat(settings): add shared links listing table with delete functionality in settings
- Integrated a delete button for each shared link in the table, allowing users to remove links as needed.
* ♻️ refactor(components): separate `EndpointIcon` from `Icon` component for standalone use
* ♻️ refactor: update useGetSharedMessages to return TSharedLink
- Modified the useGetSharedMessages hook to return not only a list of TMessage but also the TSharedLink itself.
- This change was necessary to support displaying the title and date in the Shared Message UI, which requires data from TSharedLink.
* ✨ feat(shared link): add UI for displaying shared conversations without authentication
- Implemented a new UI component to display shared conversations, designed to be accessible without requiring authentication.
- Reused components from the authenticated Messages module where possible. Copied and adapted components that could not be directly reused to fit the non-authenticated context.
* 🔧 chore: Add translations
Translate labels only. Messages remain in English as they are possibly subject to change.
* ♻️ refactor: add icon and tooltip props to EditMenuButton component
* moved icon and popover to arguments so that EditMenuButton can be reused.
* modified so that when a ShareButton is closed, the parent DropdownMenu is also closed.
* ♻️irefactor: added DropdownMenu for Export and Share
* ♻️ refactor: renamed component names more intuitive
* More accurate naming of the dropdown menu.
* When the export button is closed, the parent dropdown menu is also closed.
* 🌍 chore: updated translations
* 🐞 Fix: OpenID Profile Image Download (#2757)
* Add fetch requirement
Fixes - error: [openidStrategy] downloadImage: Error downloading image at URL "https://graph.microsoft.com/v1.0/me/photo/$value": TypeError: response.buffer is not a function
* Update openidStrategy.js
---------
Co-authored-by: Danny Avila <danacordially@gmail.com>
* 🚑 fix(export): Issue exporting Conversation with Assistants (#2769)
* 🚑 fix(export): use content as text if content is present in the message
If the endpoint is assistants, the text of the message goes into content, not message.text.
* refactor(ExportModel): TypeScript, remove unused code
---------
Co-authored-by: Yuichi Ohneda <ohneda@gmail.com>
* 📤style: export button icon (#2752)
* refactor(ShareDialog): logic and styling
* refactor(ExportAndShareMenu): imports order and icon update
* chore: imports
* chore: imports/render logic
* feat: message branching
* refactor: add optional config to useGetStartupConfig
* refactor: disable endpoints query
* chore: fix search view styling gradient in light mode
* style: ShareView gradient styling
* refactor(Share): use select queries
* style: shared link table buttons
* localization and dark text styling
* style: fix clipboard button layout shift app-wide and add localization for copy code
* support assistants message content in shared links, add useCopyToClipboard, add copy buttons to Search Messages and Shared Link Messages
* add localizations
* comparisons
---------
Co-authored-by: Yuichi Ohneda <ohneda@gmail.com>
Co-authored-by: bsu3338 <bsu3338@users.noreply.github.com>
Co-authored-by: Fuegovic <32828263+fuegovic@users.noreply.github.com>