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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
|
; Open Screen protocol spec: https://webscreens.github.io/openscreenprotocol/#appendix-a
; CDDL spec: https://tools.ietf.org/html/draft-ietf-cbor-cddl-08
; type key 10
agent-info-request = {
request
}
; type key 11
agent-info-response = {
response
1: agent-info ; agent-info
}
agent-info = {
0: text ; friendly-name
1: text ; model-name
; ...
}
; type key 12
agent-status-request = {
request
? 1: status ; status
}
; type key 13
agent-status-response = {
response
? 1: status ; status
}
request = (
0: request-id ; request-id
)
response = (
0: request-id ; request-id
)
request-id = uint
microseconds = uint
; type key 1001
authentication-request = {
request
1: authentication-mechanism ; mechanism
2: bytes ; salt
3: uint ; cost
}
; type key 1002
authentication-response = {
response
1: authentication-response-result ; result
2: bytes ; proof
}
; type key 1003
authentication-result = {
1: authentication-result-result ; result
}
authentication-mechanism = &(
hkdf-of-scrypt-of-psk: 1
)
authentication-response-result = &(
ok: 0
unknown-error: 1
mechanism-unknown: 2
salt-too-small: 3
cost-too-low: 4
cost-too-high: 5
secret-unknown: 6
calculation-took-too-long: 7
)
authentication-result-result = &(
authenticated: 0
unknown-error: 1
proof-invalid: 2
)
; type key 14
presentation-url-availability-request = {
request
1: [* text] ; urls
2: microseconds ; watch-duration
3: uint ; watch-id
}
; type key 15
presentation-url-availability-response = {
response
1: [* url-availability] ; url-availabilities
}
; type key 103
presentation-url-availability-event = {
1: uint ; watch-id
2: [* url-availability] ; url-availabilities
}
; idea: use HTTP response codes?
url-availability = &(
available: 0
unavailable: 1
invalid: 10
)
; type key 104
presentation-start-request = {
request
1: text ; presentation-id
2: text ; url
3: [* http-header] ; headers
}
http-header = [
key: text
value: text
]
; type key 105
presentation-start-response = {
response
1: &result ; result
2: uint ; connection-id
}
; type key 106
presentation-termination-request = {
request
1: text ; presentation-id
2: &(
controller-called-terminate: 10
user-terminated-via-controller: 11
unknown: 255
)
; reason
}
; type key 107
presentation-termination-response = {
response
1: &result ; result
}
; type key 108
presentation-termination-event = {
1: text ; presentation-id
2: &(
receiver-called-terminate: 1
user-terminated-via-receiver: 2
controller-called-terminate: 10
user-terminated-via-controller: 11
receiver-replaced-presentation: 20
receiver-idle-too-long: 30
receiver-attempted-to-navigate: 31
receiver-powering-down: 100
receiver-crashed: 101
unknown: 255
) ; reason
}
; type key 109
presentation-connection-open-request = {
request
1: text ; presentation-id
2: text ; url
}
; type key 110
presentation-connection-open-response = {
response
1: &result ; result
2: uint; connection-id
}
; type key 111
presentation-connection-close-request = {
request
1: uint ; connection-id
}
; type key 112
presentation-connection-close-response = {
response
; TODO(btolsch): Update the spec or revert.
1: &(success: 0, invalid-connection-id: 1) ; result
}
; type key 113
presentation-connection-close-event = {
1: uint; connection-id
2: &(
close-method-called: 1
connection-object-discarded: 10
unrecoverable-error-while-sending-or-receiving-message: 100
) ; reason
? 3: text ; error-message
}
; type key 16
presentation-connection-message = {
1: uint ; connection-id
2: bytes / text ; message
}
status = {
status: text
}
result = (
success: 1
invalid-url: 10
invalid-presentation-id: 11
timeout: 100
transient-error: 101
permanent-error: 102
terminating: 103
unknown-error: 199
)
|