🔁 refactor: Capabilities for Tools/File handling for Direct Endpoints (#8253)

* feat: add useAgentCapabilities hook to manage agent capabilities

* refactor: move  agents and endpoints configuration to AgentPanel context provider

* refactor: implement useGetAgentsConfig hook for consolidated agents and endpoints management

* refactor: enhance ToolsDropdown to utilize agent capabilities and streamline dropdown item rendering

* chore: reorder return values in useAgentCapabilities for improved clarity

* refactor: enhance agent capabilities handling in AttachFileMenu and update file handling logic to allow capabilities to be used for non-agents endpoints
This commit is contained in:
Danny Avila 2025-07-04 14:51:26 -04:00 committed by GitHub
parent a288ad1d9c
commit f5511e4a4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 308 additions and 250 deletions

View file

@ -59,7 +59,7 @@ export const getAvailableEndpoints = (
/** Get the specified field from the endpoint config */
export function getEndpointField<K extends keyof t.TConfig>(
endpointsConfig: t.TEndpointsConfig | undefined,
endpointsConfig: t.TEndpointsConfig | undefined | null,
endpoint: EModelEndpoint | string | null | undefined,
property: K,
): t.TConfig[K] | undefined {
@ -246,7 +246,7 @@ export function getIconKey({
endpointIconURL: iconURL,
}: {
endpoint?: string | null;
endpointsConfig?: t.TEndpointsConfig;
endpointsConfig?: t.TEndpointsConfig | null;
endpointType?: string | null;
endpointIconURL?: string;
}): keyof IconsRecord {