mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-12 15:20:13 +00:00
feat(media-use): v2 media OS core (resolve cascade, providers, local generation, telemetry) + retire hyperframes-media
This commit is contained in:
@@ -1,29 +1,5 @@
|
||||
import { sfxProvider } from "./sfx-provider.mjs";
|
||||
import { imageProvider, iconProvider } from "./image-provider.mjs";
|
||||
import { bgmProvider } from "./bgm-provider.mjs";
|
||||
import { brandProvider } from "./brand-provider.mjs";
|
||||
|
||||
const STUB = {
|
||||
async search() {
|
||||
return null;
|
||||
},
|
||||
};
|
||||
|
||||
const registry = {
|
||||
bgm: { ...bgmProvider, type: "bgm" },
|
||||
sfx: { ...sfxProvider, type: "sfx" },
|
||||
voice: { ...STUB, type: "voice" },
|
||||
image: { ...imageProvider, type: "image" },
|
||||
icon: { ...iconProvider, type: "icon" },
|
||||
brand: { ...brandProvider, type: "brand" },
|
||||
};
|
||||
|
||||
export function getProvider(type) {
|
||||
const p = registry[type];
|
||||
if (!p) throw new Error(`unknown media type: ${type}`);
|
||||
return p;
|
||||
}
|
||||
|
||||
export function listTypes() {
|
||||
return Object.keys(registry);
|
||||
}
|
||||
// Back-compat surface for the v1 provider API. The ordered, capability-based
|
||||
// registry now lives in registry.mjs; this re-exports the v1 helpers so existing
|
||||
// callers keep working. New code should import from registry.mjs directly
|
||||
// (getProviders / runCapability).
|
||||
export { getProvider, listTypes } from "./registry.mjs";
|
||||
|
||||
Reference in New Issue
Block a user