v1.12.0 — Canonical provider contract
Canonical provider contract hardening from issue #81 / PR #82. Additive only.
Added
- Exported canonical provider contract types, including
CanonicalLLMRequest,CanonicalLLMResponse, and related helper types. - Added
normalizeLLMRequest()to map compatibilityLLMRequestfields into the canonical shape. - Added
canonicalToLLMRequest()to convert canonical requests back into existing adapter input while providers migrate internally. - Added
normalizeLLMResponse()for stable canonical response routing metadata, fallback/degradation fields, normalized error slots, and provider-extra metadata. - Added contract tests covering OpenAI-compatible, Anthropic-compatible, Groq/Cerebras, NVIDIA, and Cloudflare adapter preparation without live API calls.
- Documented the gateway boundary:
client protocol -> gateway adapter -> CanonicalLLMRequest -> llm-providers -> vendor API.
Validation
npm run typechecknpm testnpm run test:packagenpm audit --omit=dev