Class: AgUiProtocol::Util::Opaque

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/ag_ui_protocol/util.rb

Overview

Marks a value as opaque user-supplied payload that MUST pass through serialization unchanged — no key camelization, no nil compaction, no recursive normalization.

Use this for fields where the AG-UI protocol carries arbitrary user-defined Hash content (e.g., ‘metadata`, `custom`, `response_schema`, JSON Patch op payloads, raw upstream events). Schema-typed fields whose keys are part of the protocol contract MUST NOT be wrapped — those still need camelCase rewriting on the wire.

The wrapper unwraps to its original ‘value` at the camelization boundary in deep_transform_keys_to_camel. Keys inside the wrapped value (and any nested Hashes/Arrays within it) are preserved verbatim.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Opaque

Returns a new instance of Opaque.



32
33
34
# File 'lib/ag_ui_protocol/util.rb', line 32

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



29
30
31
# File 'lib/ag_ui_protocol/util.rb', line 29

def value
  @value
end