• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Open Screen protocol spec: https://webscreens.github.io/openscreenprotocol/#appendix-a
2; CDDL spec: https://tools.ietf.org/html/draft-ietf-cbor-cddl-08
3
4; type key 10
5agent-info-request = {
6  request
7}
8
9; type key 11
10agent-info-response = {
11  response
12  1: agent-info ; agent-info
13}
14
15agent-info = {
16  0: text ; friendly-name
17  1: text ; model-name
18  ; ...
19}
20
21; type key 12
22agent-status-request = {
23  request
24  ? 1: status ; status
25}
26
27; type key 13
28agent-status-response = {
29  response
30  ? 1: status ; status
31}
32
33request = (
34 0: request-id ; request-id
35)
36
37response = (
38 0: request-id ; request-id
39)
40
41request-id = uint
42
43microseconds = uint
44
45; type key 1001
46authentication-request = {
47  request
48  1: authentication-mechanism ; mechanism
49  2: bytes ; salt
50  3: uint ; cost
51}
52
53; type key 1002
54authentication-response = {
55  response
56  1: authentication-response-result ; result
57  2: bytes ; proof
58}
59
60; type key 1003
61authentication-result = {
62  1: authentication-result-result ; result
63}
64
65authentication-mechanism = &(
66  hkdf-of-scrypt-of-psk: 1
67)
68
69authentication-response-result = &(
70  ok: 0
71  unknown-error: 1
72  mechanism-unknown: 2
73  salt-too-small: 3
74  cost-too-low: 4
75  cost-too-high: 5
76  secret-unknown: 6
77  calculation-took-too-long: 7
78)
79
80authentication-result-result = &(
81  authenticated: 0
82  unknown-error: 1
83  proof-invalid: 2
84)
85
86; type key 14
87presentation-url-availability-request = {
88  request
89  1: [* text] ; urls
90  2: microseconds ; watch-duration
91  3: uint ; watch-id
92}
93
94; type key 15
95presentation-url-availability-response = {
96  response
97  1: [* url-availability] ; url-availabilities
98}
99
100; type key 103
101presentation-url-availability-event = {
102  1: uint ; watch-id
103  2: [* url-availability] ; url-availabilities
104}
105
106; idea: use HTTP response codes?
107url-availability = &(
108  available: 0
109  unavailable: 1
110  invalid: 10
111)
112
113; type key 104
114presentation-start-request = {
115  request
116  1: text ; presentation-id
117  2: text ; url
118  3: [* http-header] ; headers
119}
120
121http-header = [
122  key: text
123  value: text
124]
125
126; type key 105
127presentation-start-response = {
128  response
129  1: &result ; result
130  2: uint ; connection-id
131}
132
133; type key 106
134presentation-termination-request = {
135  request
136  1: text ; presentation-id
137  2: &(
138    controller-called-terminate: 10
139    user-terminated-via-controller: 11
140    unknown: 255
141  )
142 ; reason
143}
144
145; type key 107
146presentation-termination-response = {
147  response
148  1: &result ; result
149}
150
151; type key 108
152presentation-termination-event = {
153  1: text ; presentation-id
154  2: &(
155    receiver-called-terminate: 1
156    user-terminated-via-receiver: 2
157    controller-called-terminate: 10
158    user-terminated-via-controller: 11
159    receiver-replaced-presentation: 20
160    receiver-idle-too-long: 30
161    receiver-attempted-to-navigate: 31
162    receiver-powering-down: 100
163    receiver-crashed: 101
164    unknown: 255
165  ) ; reason
166}
167
168; type key 109
169presentation-connection-open-request = {
170  request
171  1: text ; presentation-id
172  2: text ; url
173}
174
175; type key 110
176presentation-connection-open-response = {
177  response
178  1: &result ; result
179  2: uint; connection-id
180}
181
182; type key 111
183presentation-connection-close-request = {
184  request
185  1: uint ; connection-id
186}
187
188; type key 112
189presentation-connection-close-response = {
190  response
191  ; TODO(btolsch): Update the spec or revert.
192  1: &(success: 0, invalid-connection-id: 1) ; result
193}
194
195; type key 113
196presentation-connection-close-event = {
197  1: uint; connection-id
198  2: &(
199    close-method-called: 1
200    connection-object-discarded: 10
201    unrecoverable-error-while-sending-or-receiving-message: 100
202  ) ; reason
203  ? 3: text ; error-message
204}
205
206; type key 16
207presentation-connection-message = {
208  1: uint ; connection-id
209  2: bytes / text ; message
210}
211
212status = {
213  status: text
214}
215
216result = (
217  success: 1
218  invalid-url: 10
219  invalid-presentation-id: 11
220  timeout: 100
221  transient-error: 101
222  permanent-error: 102
223  terminating: 103
224  unknown-error: 199
225)
226