Freeze the shared contracts every Media Studio slice builds on: zod DTOs, EDL, platform profile, brand kit, gate and render plan schemas; the media RPC surface with a scaffold router; provider interfaces for sources, inference, rendering, motion graphics and publishing; media background jobs; the Prisma models and migration; and the @rakazo/media domain package signatures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0138YqDj3ttfayRwuMKKrqVj
44 lines
1.0 KiB
TypeScript
44 lines
1.0 KiB
TypeScript
export class AdapterRegistry {
|
|
private readonly adapters = new Map<string, unknown>();
|
|
|
|
register<T>(slot: string, adapter: T): void {
|
|
this.adapters.set(slot, adapter);
|
|
}
|
|
|
|
get<T>(slot: string): T {
|
|
const adapter = this.adapters.get(slot);
|
|
if (!adapter) {
|
|
throw new Error(`No adapter registered for ${slot}`);
|
|
}
|
|
return adapter as T;
|
|
}
|
|
|
|
tryGet<T>(slot: string): T | undefined {
|
|
return this.adapters.get(slot) as T | undefined;
|
|
}
|
|
}
|
|
|
|
export const slots = {
|
|
runtime: "runtime",
|
|
sandbox: "sandbox",
|
|
memory: "memory",
|
|
home: "home",
|
|
artifacts: "artifacts",
|
|
secrets: "secrets",
|
|
jobs: "jobs",
|
|
realtime: "realtime",
|
|
notifications: "notifications",
|
|
models: "models",
|
|
connector: "connector",
|
|
auth: "connection-auth",
|
|
runner: "runner",
|
|
voice: "voice",
|
|
web: "web",
|
|
browser: "browser",
|
|
cloudAgent: "cloud-agent",
|
|
mediaInference: "media-inference",
|
|
mediaRenderer: "media-renderer",
|
|
motionGraphics: "motion-graphics",
|
|
mediaPublisher: "media-publisher",
|
|
} as const;
|