terminal.proto RawHistoryFolder
1// Terminal I/O, UI fences, and bounded preview viewports.
2syntax = "proto3";
3
4package vev.wire.v1;
5
6import "common.proto";
7import "session.proto";
8
9option go_package = "github.com/bnema/vev/internal/protocol/wire";
10
11// ViewContext is the committed boundary of one output state.
12message ViewContext {
13 uint64 publication = 1;
14 CommittedRouteIdentity route = 2;
15 string tab_id = 3;
16 string focused_pane_id = 4;
17}
18
19// Output is one terminal state. Terminal data uses the explicit encoding
20// enum below; converters compress only full snapshots at the frozen
21// threshold and only when smaller.
22message Output {
23 uint64 epoch = 1;
24 uint64 base = 2;
25 uint64 new_state = 3;
26 uint64 echo = 4;
27 uint64 view_revision = 5;
28 uint32 cols = 6;
29 uint32 rows = 7;
30 bool full = 8;
31 ViewContext context = 9; // optional pointer
32 // Closed encoding taxonomy: 0 = raw, 1 = zlib (full snapshots only).
33 uint32 encoding = 10;
34 uint64 uncompressed_length = 11;
35 bytes data = 12;
36}
37
38// Ack cumulatively acknowledges one epoch.
39message Ack {
40 uint64 epoch = 1;
41 uint64 state = 2;
42}
43
44// Input carries client keystrokes and pastes.
45message Input {
46 uint64 input_seq = 1;
47 uint64 action_id = 2;
48 bytes data = 3;
49}
50
51// Resize carries a geometry claim.
52message Resize {
53 uint32 cols = 1;
54 uint32 rows = 2;
55 uint32 pixel_width = 3;
56 uint32 pixel_height = 4;
57}
58
59// Theme carries the 57-byte fixed terminal theme block field by field.
60message Theme {
61 bool has_foreground = 1;
62 RGB foreground = 2;
63 bool has_background = 3;
64 RGB background = 4;
65 bool true_color = 5;
66 bool scheme_known = 6;
67 bool light = 7;
68 uint32 palette_known = 8;
69 repeated RGB palette = 9; // exactly 16 entries
70}
71
72// ImagePush carries one Kitty graphics payload.
73message ImagePush {
74 uint64 input_seq = 1;
75 string mime = 2;
76 bytes data = 3;
77}
78
79// ClientNotice is a fixed one-byte client signal.
80message ClientNotice {
81 // Closed action taxonomy: 1 = clipboard fallback, 2 = clipboard too
82 // large, 3 = link degraded, 4 = link connected.
83 uint32 action = 1;
84}
85
86// OutputResetRequest restarts the output chain. Empty marker.
87message OutputResetRequest {}
88
89// TerminalFocus reports a focus change of the client's terminal window.
90message TerminalFocus {
91 // Closed focus taxonomy: 1 = focused, 2 = unfocused.
92 uint32 focus = 1;
93}
94
95// SelectTab shows one exact tab of the attached session on this attachment.
96message SelectTab {
97 string tab_id = 1;
98}
99
100// UIFence orders UI operations by action.
101message UIFence {
102 uint64 action_id = 1;
103}
104
105// UIReceipt reports the processed output boundary.
106message UIReceipt {
107 uint64 action_id = 1;
108 uint64 epoch = 2;
109 uint64 state = 3;
110 uint64 view_publication = 4;
111 // Closed outcome taxonomy: 1 = processed, 2 = unavailable.
112 uint32 outcome = 5;
113}
114
115// UIViewUpdate publishes a view boundary without terminal data.
116message UIViewUpdate {
117 uint64 epoch = 1;
118 uint64 state = 2;
119 ViewContext context = 3;
120}
121
122// RemotePreviewRequest names a bounded exact-target viewport.
123message RemotePreviewRequest {
124 uint32 version = 1;
125 RemoteTarget target = 2;
126 uint32 width = 3;
127 uint32 height = 4;
128}
129
130// RemotePreviewWatch is a client first message: the server answers with a
131// stream of RemotePreview frames, at most one per min_interval_ms, until the
132// client closes the connection.
133message RemotePreviewWatch {
134 RemotePreviewRequest request = 1;
135 // Whole milliseconds inside [16, 1000].
136 uint32 min_interval_ms = 2;
137}
138
139// RemotePreview is a bounded row-major styled-cell viewport.
140message RemotePreview {
141 uint32 version = 1;
142 // Closed status taxonomy: 0 = ok, 1 = unavailable, 2 = no such target,
143 // 3 = stale, 4 = malformed, 5 = too large.
144 uint32 status = 2;
145 LifecycleID lifecycle_id = 3;
146 string tab_id = 4;
147 uint64 revision = 5;
148 uint32 width = 6;
149 uint32 height = 7;
150 repeated PreviewCell cells = 8;
151}