Factory function that creates a ContentClassifier โ a stateful, per-message service that detects content type from the token stream and routes to the appropriate parser.
Import:
import { createContentClassifier } from '@ngaf/chat';import type { ContentClassifier, ContentType } from '@ngaf/chat';
When the content type is a2ui, this signal contains all parsed A2UI surfaces with their components and data models. The map is keyed by surface ID and updates incrementally as JSONL lines arrive during streaming.
Parse errors are captured but don't stop the classifier. Partial results continue to render. Useful for diagnostics โ check this signal when debugging unexpected rendering behavior or malformed agent output.