mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-15 19:52:50 +03:00
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import { resolveProviderServiceKinds } from "@omniroute/open-sse/config/mediaServiceKinds.ts";
|
||
|
||
/**
|
||
* Full serviceKinds for a provider — the declared ones (llm, web*, imageToText)
|
||
* unioned with the registry-derived media kinds (image / video / music / tts /
|
||
* stt / embedding). This is the single client-side source of truth for the
|
||
* `/dashboard/providers` category (serviceKind) filter (#4240).
|
||
*
|
||
* Client-safe: `mediaServiceKinds` only pulls in the pure-data media registries
|
||
* (no server-only deps). Results are memoised per providerId+declared signature
|
||
* because the filter calls this once per provider on every keystroke/render.
|
||
*/
|
||
const _cache = new Map<string, readonly string[]>();
|
||
|
||
export function getProviderServiceKinds(
|
||
providerId: string,
|
||
declared?: readonly string[] | null
|
||
): readonly string[] {
|
||
const key = `${providerId} |