mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-04 00:31:50 +01:00
- Fix ObjectId comparison in getListAgentsHandler using .equals() method instead of strict equality
- Add findPubliclyAccessibleResources function to PermissionService for bulk public resource queries - Add hasPublicPermission function to PermissionService for individual resource public permission checks - Update getAgentHandler to use hasPublicPermission for accurate individual agent public status - Replace instanceProjectId-based global checks with isPublic property from backend in client code - Add isPublic property to Agent type definition - Add NODE_TLS_REJECT_UNAUTHORIZED debug setting to VS Code launch config
This commit is contained in:
parent
5979efd607
commit
c9aa10d3d5
7 changed files with 102 additions and 12 deletions
|
|
@ -43,9 +43,7 @@ export default function AgentSelect({
|
|||
|
||||
const resetAgentForm = useCallback(
|
||||
(fullAgent: Agent) => {
|
||||
const { instanceProjectId } = startupConfig ?? {};
|
||||
const isGlobal =
|
||||
(instanceProjectId != null && fullAgent.projectIds?.includes(instanceProjectId)) ?? false;
|
||||
const isGlobal = fullAgent.isPublic ?? false;
|
||||
const update = {
|
||||
...fullAgent,
|
||||
provider: createProviderOption(fullAgent.provider),
|
||||
|
|
|
|||
|
|
@ -125,8 +125,7 @@ export const useEndpoints = ({
|
|||
if (ep === EModelEndpoint.agents && agents.length > 0) {
|
||||
result.models = agents.map((agent) => ({
|
||||
name: agent.id,
|
||||
isGlobal:
|
||||
(instanceProjectId != null && agent.projectIds?.includes(instanceProjectId)) ?? false,
|
||||
isGlobal: agent.isPublic ?? false,
|
||||
}));
|
||||
result.agentNames = agents.reduce((acc, agent) => {
|
||||
acc[agent.id] = agent.name || '';
|
||||
|
|
|
|||
|
|
@ -63,8 +63,7 @@ export const processAgentOption = ({
|
|||
fileMap?: Record<string, TFile | undefined>;
|
||||
instanceProjectId?: string;
|
||||
}): TAgentOption => {
|
||||
const isGlobal =
|
||||
(instanceProjectId != null && _agent?.projectIds?.includes(instanceProjectId)) ?? false;
|
||||
const isGlobal = _agent?.isPublic ?? false;
|
||||
const agent: TAgentOption = {
|
||||
...(_agent ?? ({} as Agent)),
|
||||
label: _agent?.name ?? '',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue