module RubyLLM::AgUI::Coverage
The AG-UI 1.0 producer coverage map (FR-02).
Every one of the 31 event types the pinned 1.0 schema defines is listed with the status this gem gives it. A producer is not required to manufacture events it has no data for; what it must never do is emit an event that the schema does not define, or misreport one it does.
This is the gem’s own audit against the pinned schema commit (RubyLLM::AgUI::Protocol::SCHEMA_COMMIT). It is not a claim about ‘ag-ui-protocol`, whose enum is compared separately below.
Constants
- FAMILIES
- GAPS
The 1.0 shapes ‘ag-ui-protocol` 0.2.0 cannot express, with the gem’s handling. Upstream issues are drafted in docs/.internal/upstream.
- LEGACY_SDK_ONLY
Event types present in the SDK enum but not in the 1.0 schema (the five legacy THINKING constants). Emitting one would masquerade as 1.0.
- SCHEMA_EVENT_TYPES
Event types listed in the pinned docs/spec/1.0/schema.json Event union.
- STATUS
Producer status and a one-line reason, keyed by event type.
- STATUSES
The statuses an entry may have.
:produced — emitted from real RubyLLM data on the supported path :optional — emitted only when the host opts in and real data exists :host_owned — the host owns the payload; the gem does not produce it :not_produced — the producer has no data for it and never fabricates it
Public Instance Methods
Every schema event type with its family and status, as an array of hashes suitable for docs generation.
# File lib/ruby_llm/ag_ui/coverage.rb, line 129 def entries SCHEMA_EVENT_TYPES.map do |type| status, note = STATUS.fetch(type) { type: type, family: family_for(type), status: status, note: note } end end
The family an event type belongs to.
# File lib/ruby_llm/ag_ui/coverage.rb, line 137 def family_for(type) prefix = FAMILIES.keys.find { |key| type.start_with?(key) } FAMILIES.fetch(prefix) end
Event types grouped by status.
# File lib/ruby_llm/ag_ui/coverage.rb, line 143 def report entries.group_by { |entry| entry[:status] } end
1.0 schema types with no SDK constant.
# File lib/ruby_llm/ag_ui/coverage.rb, line 158 def schema_only_event_types SCHEMA_EVENT_TYPES - sdk_event_types end
Event type constants the SDK defines (read at runtime, not hardcoded).
# File lib/ruby_llm/ag_ui/coverage.rb, line 148 def sdk_event_types ::AgUiProtocol::Core::Events::EventType.constants.map { |name| ::AgUiProtocol::Core::Events::EventType.const_get(name) } end
SDK constants with no 1.0 schema counterpart.
# File lib/ruby_llm/ag_ui/coverage.rb, line 153 def sdk_only_event_types sdk_event_types - SCHEMA_EVENT_TYPES end