/** * Invariant definitions for @cortiq/dsh-llm-router. * * These invariants assert the plugin's dependencies are present at runtime: * - The LLM seam (`llm`) must be loaded before us * - At least one underlying model adapter must be available */ export const inject = { required: ['llm'] as const, }; export const invariant = (ctx: Record) => { const llm = (ctx as any).get?.('llm'); if (!llm) { throw new Error('[llm-cortiq-router] Missing dependency: llm seam not available'); } if (typeof llm.registerAdapter !== 'function') { throw new Error('[llm-cortiq-router] LLM seam does not support registerAdapter'); } };