mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 06:50:21 +00:00
fix(plugins): normalize speech plugin package ids (#48777)
This commit is contained in:
@@ -16,6 +16,14 @@ import type { PluginBundleFormat, PluginDiagnostic, PluginFormat, PluginOrigin }
|
||||
|
||||
const EXTENSION_EXTS = new Set([".ts", ".js", ".mts", ".cts", ".mjs", ".cjs"]);
|
||||
|
||||
const CANONICAL_PACKAGE_ID_ALIASES: Record<string, string> = {
|
||||
"elevenlabs-speech": "elevenlabs",
|
||||
"microsoft-speech": "microsoft",
|
||||
"ollama-provider": "ollama",
|
||||
"sglang-provider": "sglang",
|
||||
"vllm-provider": "vllm",
|
||||
};
|
||||
|
||||
export type PluginCandidate = {
|
||||
idHint: string;
|
||||
source: string;
|
||||
@@ -337,12 +345,7 @@ function deriveIdHint(params: {
|
||||
const unscoped = rawPackageName.includes("/")
|
||||
? (rawPackageName.split("/").pop() ?? rawPackageName)
|
||||
: rawPackageName;
|
||||
const canonicalPackageId =
|
||||
{
|
||||
"ollama-provider": "ollama",
|
||||
"sglang-provider": "sglang",
|
||||
"vllm-provider": "vllm",
|
||||
}[unscoped] ?? unscoped;
|
||||
const canonicalPackageId = CANONICAL_PACKAGE_ID_ALIASES[unscoped] ?? unscoped;
|
||||
|
||||
if (!params.hasMultipleExtensions) {
|
||||
return canonicalPackageId;
|
||||
|
||||
Reference in New Issue
Block a user