A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
serial_tags.h File Reference

The canonical cross-language serialization tags. More...

#include <string_view>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  a11
 
namespace  a11::data
 

Variables

constexpr std::string_view a11::data::kChunkMetadataTag = "a11.ChunkMetadata"
 
constexpr std::string_view a11::data::kChunkTag = "a11.Chunk"
 
constexpr std::string_view a11::data::kNodeRefTag = "a11.NodeRef"
 
constexpr std::string_view a11::data::kNodeFragmentTag = "a11.NodeFragment"
 
constexpr std::string_view a11::data::kPortTag = "a11.Port"
 
constexpr std::string_view a11::data::kActionMessageTag = "a11.ActionMessage"
 
constexpr std::string_view a11::data::kWireMessageTag = "a11.WireMessage"
 
constexpr std::string_view a11::data::kStatusTag = "a11.Status"
 
constexpr std::string_view a11::data::kTimeTag = "a11.Time"
 
constexpr std::string_view a11::data::kDurationTag = "a11.Duration"
 
constexpr std::string_view a11::data::kInteractionTag = "a11.sdk.Interaction"
 
constexpr std::string_view a11::data::kPeerTag = "a11.sdk.Peer"
 
constexpr std::string_view a11::data::kActionConfigTag = "a11.sdk.ActionConfig"
 
constexpr std::string_view a11::data::kUsageMetadataTag = "a11.sdk.UsageMetadata"
 
constexpr std::string_view a11::data::kInteractWithClaudeConfigTag
 
constexpr std::string_view a11::data::kInteractWithClaudeCodeConfigTag
 
constexpr std::string_view a11::data::kInteractWithGeminiConfigTag
 
constexpr std::string_view a11::data::kInteractWithGptConfigTag
 
constexpr std::string_view a11::data::kInteractWithCodexConfigTag
 
constexpr std::string_view a11::data::kInteractWithOllamaConfigTag
 
constexpr std::string_view a11::data::kInteractWithVllmConfigTag
 
constexpr std::string_view a11::data::kInteractWithGemmaConfigTag
 
constexpr std::string_view a11::data::kAudioBufferTag = "a11.sdk.AudioBuffer"
 
constexpr std::string_view a11::data::kAudioInputOptionsTag
 
constexpr std::string_view a11::data::kSpeechRecognizerOptionsTag
 
constexpr std::string_view a11::data::kAudioDeviceInfoTag
 
constexpr std::string_view a11::data::kAudioControlEventTag
 
constexpr std::string_view a11::data::kAudioCaptureEventTag
 
constexpr std::string_view a11::data::kTranscriptionEventTag
 

Detailed Description

The canonical cross-language serialization tags.

A serialized A11 value names its type with a tag: the type parameter of the chunk's MIME type ("application/json;type=a11.Chunk"). That is the only place a type is ever named. Nothing inside the payload repeats it – a declared model's fields say what they hold, and schemaless data is just data. A value the format already describes (an object, an array, a string) carries no tag at all, so a bare "application/json" is a complete description.

The tag is what a peer in another language matches on, so the same class must carry the same tag in every implementation. This header is that table for C++, and its siblings hold the identical strings:

  • Python – a11/data/serial_tags.py (declared per class with an A11_SERIAL_TAG ClassVar).
  • TypeScript – js/src/serial_tags.ts.
  • Kotlin – kotlin/src/main/kotlin/a11/SerialTags.kt.

testdata/serial_tags.json holds the same table once more, and each language's test suite asserts its own constants against it – so a tag added or renamed in one language and forgotten in another fails a test.

Conventions:

  • a11.<Class> for the runtime's own data and status types.
  • a11.sdk.<Class> for the SDKs, with subpackages omitted and names chosen for what the type is rather than where it lives.
  • JSON-native values keep their language-neutral tags (object, array, string, ...); they are not listed here.

A C++ type publishes its tag by returning one of these constants from its A11SerialTag ADL customization point (see a11/data/serializable.h).