1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//! The AG-UI binary transport — **not implemented**.
//!
//! This module exists so that a build with the `protobuf` feature can name the
//! media type, and so the reason it does nothing is written down next to the
//! code rather than discovered at runtime. [`ProtobufFormatter`] reports the
//! binary media type and refuses every event; negotiation never picks that
//! media type, with or without this feature.
//!
//! # Why there is no encoder here
//!
//! The binary transport is defined by `events.proto` in the upstream
//! `@ag-ui/proto` package. When this module was written, its `Event` message
//! was a `oneof` over 21 of the 36 event types this crate defines, with no
//! `REASONING_*`, `ACTIVITY_*` or `THINKING_*` event and no
//! `TOOL_CALL_RESULT`. Encoding a run would have meant silently dropping
//! events, so this crate declined to encode any.
//!
//! That reason is gone. Upstream now generates `events.proto` from the AG-UI
//! 1.0 JSON Schema, and both its `EventType` enum and its `oneof` cover all 31
//! 1.0 event types. Only the five deprecated `THINKING_*` events, which 1.0
//! retired, are absent.
//!
//! The encoder is still not written
//! ([#46](https://github.com/KimSoungRyoul/ag-ui-rust/issues/46)), for two
//! reasons:
//!
//! - Nothing would ask for it. The stock TypeScript client, `HttpAgent` in
//! `@ag-ui/client`, sends `Accept: text/event-stream`, so a server that
//! could encode protobuf would still not be asked to.
//! - It is a second encoding to keep in step with a generated schema, for a
//! path nobody has asked this SDK for. Generating the Rust types means
//! either a `build.rs` that requires `protoc` on every consumer's machine or
//! checked-in generated code to refresh each time upstream regenerates.
//!
//! An encoder can be added behind this same feature later without a breaking
//! change.
//!
//! # What to do instead
//!
use crate;
use crate;
use crateEvent;
/// Placeholder for the binary formatter.
///
/// [`content_type`](EventStreamFormatter::content_type) reports the binary
/// media type, but [`encode`](EventStreamFormatter::encode) always fails with
/// [`Error::UnsupportedTransport`] — see the [module docs](self) for why.
;