SIGN IN SIGN UP

fix: prevent unsupported Moonshot multimodal MIME types from reaching the API (#19584)

## Background

Moonshot requests previously serialized unsupported encoded image and
video formats, producing avoidable provider HTTP 400 responses instead
of local validation errors.

## Root Cause

The Moonshot converter classified files only by top-level media category
and lacked provider-specific MIME allowlists; the original reproduction
confirmed image/svg+xml reached transport. The initial fix also omitted
top-level URL media types, as confirmed by a public generateText probe.

## Summary

Added Moonshot image and video MIME allowlists, local unsupported-format
rejection, and preservation for supported data URIs, URL media types,
and ms:// references using concrete, wildcard, or top-level media types.
Added provider documentation and a patch changeset.

## Testing

Converter tests cover every documented MIME type, representative
unsupported formats, and top-level ms:// references. Language-model
tests verify unsupported SVG causes zero requests and top-level
image/video references are serialized. Node, Edge, workspace tests, type
checking, formatting, linting, and documentation validation pass.

## End-to-end Validation

- `pnpm -C examples/ai-functions exec tsx
src/reproduction/issue-19548-moonshot-mime-validation.ts` exited
successfully and confirmed SVG was rejected locally before any provider
request.
- `pnpm -C examples/ai-functions exec tsx --eval "<public generateText
ms:// reference probe>"` confirmed top-level image and video references
reached transport unchanged.

## Related Issues

Fixes #19548

Closes #19568

Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
A
ai-sdk-factory[bot] committed
c88b272c693eb343736c059ddfef2df4c82e8193
Parent: 462c498
Committed by GitHub <noreply@github.com> on 8/26/2026, 1:01:02 AM