# `Tay.Protocol.V1`
[🔗](https://github.com/AndriiSydorenko1904/tay/blob/v1.6.1/lib/tay/executor/protocol.ex#L1)

Small, transport-neutral codec for the public Executor Protocol v1.

The durable Event codec is deliberately not used here.  Executor peers speak
length-prefixed UTF-8 JSON so a non-BEAM runtime never has to understand ETF
or Tay's on-disk value representation.

# `message`

```elixir
@type message() :: %{required(binary()) =&gt; term()}
```

# `decode_frames`

Decodes all complete frames in a byte buffer, retaining an incomplete tail.

# `decode_message`

Decodes and validates a single JSON protocol envelope.

# `default_max_frame_bytes`

# `envelope`

Validates the common `version`, `type`, and `request_id` envelope fields.

# `error`

# `frame`

Encodes one JSON message with an unsigned 32-bit big-endian length prefix.

# `identifier?`

# `json_bytes`

Encodes one JSON-safe value and verifies its independent byte budget.

# `json_value?`

Validates portable JSON values without admitting arbitrary BEAM terms.

# `reply`

# `request_id`

# `task_key?`

# `version`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
