Commit graph

439 commits

Author SHA1 Message Date
Danny Avila
62b4d29967
WIP: fix tests 2025-08-20 02:16:02 -04:00
Danny Avila
f7ea232760
refactor: decouple caching and DB operations from AppService, make part of consolidated getAppConfig 2025-08-20 02:03:38 -04:00
Danny Avila
550bf56077
refactor: migrate checkEmailConfig to TypeScript and update imports 2025-08-20 01:07:31 -04:00
Danny Avila
ab4596206f
refactor: move interface config logic to TS API 2025-08-20 01:00:25 -04:00
Danny Avila
84c78f5812
refactor: consolidate tool loading logic into a new tools module for startup logic 2025-08-20 00:57:42 -04:00
Danny Avila
1c7b3b53da
refactor: move /services/Files/images/parse to TS API 2025-08-20 00:54:02 -04:00
Danny Avila
c160e7c7d5
refactor: add type annotation for loadedEndpoints in loadEndpoints function 2025-08-19 12:22:14 -04:00
Danny Avila
c0d6404385
refactor: replace getMCPAuthMap with getUserMCPAuthMap and remove unused getCustomConfig file 2025-08-19 12:22:14 -04:00
Danny Avila
71a14517cd
refactor: streamline endpoint configuration and enhance appConfig usage across services 2025-08-19 12:22:11 -04:00
Danny Avila
647b1bbac6
refactor: update getAppConfig call to include user role parameter 2025-08-19 12:22:11 -04:00
Danny Avila
5eef6ea9e8
refactor: implement custom endpoints configuration and streamline endpoint loading logic 2025-08-19 12:22:11 -04:00
Danny Avila
240e3bd59e
refactor: update appConfig access to use endpoints structure across various services 2025-08-19 12:22:10 -04:00
Danny Avila
89fb9c7e1c
refactor: consolidate endpoint loading logic into loadEndpoints function 2025-08-19 12:22:10 -04:00
Danny Avila
8525c8df36
refactor: remove getCustomConfig usage and use app config in file citations 2025-08-19 12:22:10 -04:00
Danny Avila
46f9c90223
refactor: remove customConfig dependency for appConfig and streamline loadConfigModels logic 2025-08-19 12:22:09 -04:00
Danny Avila
1d2be247cf
refactor: get balance config primarily from appConfig 2025-08-19 12:22:09 -04:00
Danny Avila
5e70d518aa
refactor: update imports to use normalizeEndpointName from @librechat/api and remove redundant definitions 2025-08-19 12:22:08 -04:00
Danny Avila
8df0ecd438
refactor: enhance AppConfig to include fileStrategies and update related file strategy logic 2025-08-19 12:22:08 -04:00
Danny Avila
f25e4253d0
fix: update appConfig usage to access allowedDomains from actions instead of registration 2025-08-19 12:22:07 -04:00
Danny Avila
493f60fa54
refactor: update getAppConfig call in getCustomConfigSpeech to include user role 2025-08-19 12:22:07 -04:00
Danny Avila
1168a7d82e
ci: update related tests 2025-08-19 12:22:07 -04:00
Danny Avila
c82c47ab6a
refactor: replace getCustomConfig with getAppConfig in STTService, TTSService, and related files 2025-08-19 12:22:06 -04:00
Danny Avila
b0256510b5
refactor: remove getCustomConfig dependency and use getAppConfig in PluginController, multer, and MCP services 2025-08-19 12:22:05 -04:00
Danny Avila
50bd6d3a02
refactor: update domain validation to use appConfig for allowed domains 2025-08-19 12:22:04 -04:00
Danny Avila
2229672929
chore: correct parameter documentation for imageOutputType in ToolService.js 2025-08-19 12:21:31 -04:00
Danny Avila
68c6afd009
fix: streamline OpenAI image tools configuration by removing direct appConfig dependency and using function parameters 2025-08-19 12:21:30 -04:00
Danny Avila
0b5816d1be
chore: rename Config/getAppConfig -> Config/app 2025-08-19 12:21:30 -04:00
Danny Avila
b2b2aee945
ci: Mock getAppConfig in various tests to provide default configurations 2025-08-19 12:21:29 -04:00
Danny Avila
2501d11fa0
refactor: Rename initializeAppConfig to setAppConfig and update related tests 2025-08-19 12:21:29 -04:00
Danny Avila
5bb731764c
ci: Integrate getAppConfig into remaining tests 2025-08-19 12:21:28 -04:00
Danny Avila
5b43bf6c95
ci: Update AppService tests to initialize app config instead of app.locals 2025-08-19 12:21:28 -04:00
Danny Avila
b992fed16c
WIP: app.locals refactoring
WIP: appConfig

fix: update memory configuration retrieval to use getAppConfig based on user role

fix: update comment for AppConfig interface to clarify purpose
2025-08-19 12:21:27 -04:00
Danny Avila
3394aa5030
🗃️ fix: Only Unlink Temp files on Error for Firebase File Uploads (#9152) 2025-08-19 12:05:27 -04:00
Danny Avila
822e2310ce
🚮 fix: Remove Filtering Logic Before MCP Initialization (#9149) 2025-08-19 11:03:11 -04:00
Danny Avila
d7d02766ea
🏷️ feat: Request Placeholders for Custom Endpoint & MCP Headers (#9095)
* feat: Add conversation ID support to custom endpoint headers

- Add LIBRECHAT_CONVERSATION_ID to customUserVars when provided
- Pass conversation ID to header resolution for dynamic headers
- Add comprehensive test coverage

Enables custom endpoints to access conversation context using {{LIBRECHAT_CONVERSATION_ID}} placeholder.

* fix: filter out unresolved placeholders from headers (thanks @MrunmayS)

* feat: add support for request body placeholders in custom endpoint headers

- Add {{LIBRECHAT_BODY_*}} placeholders for conversationId, parentMessageId, messageId
- Update tests to reflect new body placeholder functionality

* refactor resolveHeaders

* style: minor styling cleanup

* fix: type error in unit test

* feat: add body to other endpoints

* feat: add body for mcp tool calls

* chore: remove changes that unnecessarily increase scope after clarification of requirements

* refactor: move http.ts to packages/api and have RequestBody intersect with Express request body

* refactor: processMCPEnv now uses single object argument pattern

* refactor: update processMCPEnv to use 'options' parameter and align types across MCP connection classes

* feat: enhance MCP connection handling with dynamic request headers to pass request body fields

---------

Co-authored-by: Gopal Sharma <gopalsharma@gopal.sharma1>
Co-authored-by: s10gopal <36487439+s10gopal@users.noreply.github.com>
Co-authored-by: Dustin Healy <dustinhealy1@gmail.com>
2025-08-16 20:45:55 -04:00
Danny Avila
ad1503abdc
🧪 feat: Claude Sonnet 4 - 1M Context Window (Beta Header) (#9093)
* adding beta header context-1m-2025-08-07 to claude sonnet 4 to increase contact window to 1M tokens

* adding context-1m beta header to test cases

* ci: Update Anthropic `getLLMConfig` tests and headers for model variations

- Refactored test cases to ensure proper handling of model variations for 'claude-sonnet-4'.
- Cleaned up unused mock implementations in tests for better clarity and performance.

* refactor: regex in header retrieval for 'claude-sonnet-4' models

* refactor: default tokens for 'claude-sonnet-4' to `1,000,000`

* refactor: add token value retrieval and pattern matching to model tests

---------

Co-authored-by: Dirk Petersen <no-reply@nowhere.com>
2025-08-16 13:36:46 -04:00
Danny Avila
e4e25aaf2b
🔎 feat: Add Prompt and Agent Permissions Migration Checks (#9063)
* chore: fix mock typing in packages/api tests

* chore: improve imports, type handling and method signatures for MCPServersRegistry

* chore: use enum in migration scripts

* chore: ParsedServerConfig type to enhance server configuration handling

* feat: Implement agent permissions migration check and logging

* feat: Integrate migration checks into server initialization process

* feat: Add prompt permissions migration check and logging to server initialization

* chore: move prompt formatting functions to dedicated prompts dir
2025-08-14 17:20:00 -04:00
Danny Avila
e8ddd279fd
🎏 refactor: Streamline Role Permissions from Interface Config 2025-08-14 02:15:33 -04:00
Danny Avila
53c31b85d0
🗞️ refactor: Apply Role Permissions at Startup only if Missing or Configured 2025-08-13 16:24:25 -04:00
Danny Avila
d07c2b3475
🛒 feat: Implement Marketplace Permissions Management UI
- Added MarketplaceAdminSettings component for managing marketplace permissions.
- Updated roles.js to include marketplace permissions in the API.
- Refactored interface.js to streamline marketplace permissions handling.
- Enhanced Marketplace component to integrate admin settings.
- Updated localization files to include new marketplace-related keys.
- Added new API endpoint for updating marketplace permissions in data-service.
2025-08-13 16:24:24 -04:00
Danny Avila
a434d28579
🧑‍🤝‍🧑 feat: Add People Picker Permissions Management UI 2025-08-13 16:24:24 -04:00
Danny Avila
39346d6b8e
🛂 feat: Role as Permission Principal Type
WIP: Role as Permission Principal Type

WIP: add user role check optimization to user principal check, update type comparisons

WIP: cover edge cases for string vs ObjectId handling in permission granting and checking

chore: Update people picker access middleware to use PrincipalType constants

feat: Enhance people picker access control to include roles permissions

chore: add missing default role schema values for people picker perms, cleanup typing

feat: Enhance PeoplePicker component with role-specific UI and localization updates

chore: Add missing `VIEW_ROLES` permission to role schema
2025-08-13 16:24:23 -04:00
Danny Avila
28d63dab71
🔧 refactor: Integrate PrincipalModel Enum for Principal Handling
- Replaced string literals for principal models ('User', 'Group') with the new PrincipalModel enum across various models, services, and tests to enhance type safety and consistency.
- Updated permission handling in multiple files to utilize the PrincipalModel enum, improving maintainability and reducing potential errors.
- Ensured all relevant tests reflect these changes to maintain coverage and functionality.
2025-08-13 16:24:22 -04:00
Danny Avila
49d1cefe71
🔧 refactor: Add and use PrincipalType Enum
- Replaced string literals for principal types ('user', 'group', 'public') with the new PrincipalType enum across various models, services, and tests for improved type safety and consistency.
- Updated permission handling in multiple files to utilize the PrincipalType enum, enhancing maintainability and reducing potential errors.
- Ensured all relevant tests reflect these changes to maintain coverage and functionality.
2025-08-13 16:24:22 -04:00
Danny Avila
90b037a67f
🧪 ci: Update PermissionService tests for PromptGroup resource type
- Refactor tests to use PromptGroup roles instead of Project roles.
- Initialize models and seed default roles in test setup.
- Update error handling for non-existent resource types.
- Ensure proper cleanup of test data while retaining seeded roles.
2025-08-13 16:24:21 -04:00
Danny Avila
fc8fd489d6
🔗 fix: File Citation Processing to Use Tool Artifacts 2025-08-13 16:24:21 -04:00
Danny Avila
81b32e400a
🔧 refactor: Organize Sharing/Agent Components and Improve Type Safety
refactor: organize Sharing/Agent components, improve type safety for resource types and access role ids, rename enums to PascalCase

refactor: organize Sharing/Agent components, improve type safety for resource types and access role ids

chore: move sharing related components to dedicated "Sharing" directory

chore: remove PublicSharingToggle component and update index exports

chore: move non-sidepanel agent components to `~/components/Agents`

chore: move AgentCategoryDisplay component with tests

chore: remove commented out code

refactor: change PERMISSION_BITS from const to enum for better type safety

refactor: reorganize imports in GenericGrantAccessDialog and update index exports for hooks

refactor: update type definitions to use ACCESS_ROLE_IDS for improved type safety

refactor: remove unused canAccessPromptResource middleware and related code

refactor: remove unused prompt access roles from createAccessRoleMethods

refactor: update resourceType in AclEntry type definition to remove unused 'prompt' value

refactor: introduce ResourceType enum and update resourceType usage across data provider files for improved type safety

refactor: update resourceType usage to ResourceType enum across sharing and permissions components for improved type safety

refactor: standardize resourceType usage to ResourceType enum across agent and prompt models, permissions controller, and middleware for enhanced type safety

refactor: update resourceType references from PROMPT_GROUP to PROMPTGROUP for consistency across models, middleware, and components

refactor: standardize access role IDs and resource type usage across agent, file, and prompt models for improved type safety and consistency

chore: add typedefs for TUpdateResourcePermissionsRequest and TUpdateResourcePermissionsResponse to enhance type definitions

chore: move SearchPicker to PeoplePicker dir

refactor: implement debouncing for query changes in SearchPicker for improved performance

chore: fix typing, import order for agent admin settings

fix: agent admin settings, prevent agent form submission

refactor: rename `ACCESS_ROLE_IDS` to `AccessRoleIds`

refactor: replace PermissionBits with PERMISSION_BITS

refactor: replace PERMISSION_BITS with PermissionBits
2025-08-13 16:24:20 -04:00
Danny Avila
ae732b2ebc
🗨️ feat: Granular Prompt Permissions via ACL and Permission Bits
feat: Implement prompt permissions management and access control middleware

fix: agent deletion process to remove associated permissions and ACL entries

fix: Import Permissions for enhanced access control in GrantAccessDialog

feat: use PromptGroup for access control

- Added migration script for PromptGroup permissions, categorizing groups into global view access and private groups.
- Created unit tests for the migration script to ensure correct categorization and permission granting.
- Introduced middleware for checking access permissions on PromptGroups and prompts via their groups.
- Updated routes to utilize new access control middleware for PromptGroups.
- Enhanced access role definitions to include roles specific to PromptGroups.
- Modified ACL entry schema and types to accommodate PromptGroup resource type.
- Updated data provider to include new access role identifiers for PromptGroups.

feat: add generic access management dialogs and hooks for resource permissions

fix: remove duplicate imports in FileContext component

fix: remove duplicate mongoose dependency in package.json

feat: add access permissions handling for dynamic resource types and add promptGroup roles

feat: implement centralized role localization and update access role types

refactor: simplify author handling in prompt group routes and enhance ACL checks

feat: implement addPromptToGroup functionality and update PromptForm to use it

feat: enhance permission handling in ChatGroupItem, DashGroupItem, and PromptForm components

chore: rename migration script for prompt group permissions and update package.json scripts

chore: update prompt tests
2025-08-13 16:24:20 -04:00
Danny Avila
7e7e75714e
🧹 chore: Add Back Agent-Specific File Retrieval and Deletion Permissions 2025-08-13 16:24:19 -04:00
“Praneeth
ff54cbffd9
🔒 feat: Implement Granular File Storage Strategies and Access Control Middleware 2025-08-13 16:24:19 -04:00