@vibelord/lanes 1.7.3 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/package.json +1 -1
- package/payload/lanes/VERSION +1 -1
- package/payload/lanes/bin/lanes +97 -17
- package/payload/lanes/bin/lanes-site-serve +15 -0
- package/payload/lanes/bin-rs/BINARIES.json +5 -0
- package/payload/lanes/container/lane-mcp +105 -5
- package/payload/lanes/container/lane_core.py +110 -0
- package/payload/lanes/container/throttle-pulse +159 -14
- package/payload/lanes/docs/ARCHITECTURE.md +108 -11
- package/payload/lanes/docs/DESIGN.md +10 -8
- package/payload/lanes/docs/INSTALL.md +1 -1
- package/payload/lanes/docs/RUNBOOK.md +297 -5
- package/payload/lanes/docs/USERGUIDE.md +11 -6
- package/payload/lanes/install/host-install.sh +14 -3
- package/payload/lanes/libexec/adopt.py +325 -0
- package/payload/lanes/libexec/cutover.py +656 -0
- package/payload/lanes/libexec/docsd.py +12 -8
- package/payload/lanes/libexec/doctor_lanes2.py +213 -0
- package/payload/lanes/libexec/economy_poll.py +87 -2
- package/payload/lanes/libexec/lanes_lib.py +465 -2
- package/payload/lanes/libexec/native.sh +38 -0
- package/payload/lanes/libexec/native_bin.py +668 -0
- package/payload/lanes/libexec/shadow.py +1311 -0
- package/payload/lanes/libexec/sidebar.py +252 -30
- package/payload/lanes/libexec/sidebar_status.py +373 -25
- package/payload/lanes/libexec/statusd.py +67 -3
- package/payload/lanes/libexec/tokens.py +99 -131
- package/payload/lanes/libexec/tokens.sh +1 -1
- package/payload/lanes/libexec/update.py +48 -5
- package/payload/lanes/libexec/users.py +282 -0
- package/payload/lanes/site/README.md +9 -0
- package/payload/lanes/site/conformance.py +280 -0
- package/payload/lanes/site/protocol.py +368 -0
- package/payload/lanes/site/server.py +314 -0
- package/payload/lanes/tokens/README.md +156 -0
- package/payload/lanes/tokens/generate.py +930 -0
- package/payload/lanes/tokens/generated/parity.v1.tsv +489 -0
- package/payload/lanes/tokens/generated/tokens.resolved.json +835 -0
- package/payload/lanes/tokens/tokens.v1.json +763 -0
- package/payload/lanes/tokens/tokens.v1.schema.json +143 -0
- package/payload/lanes/web/README.md +132 -4
- package/payload/lanes/web/directory.css +95 -0
- package/payload/lanes/web/directory.js +951 -0
- package/payload/lanes/web/generated/README.md +107 -0
- package/payload/lanes/web/generated/lanes2_protocol.d.mts +1162 -0
- package/payload/lanes/web/generated/lanes2_protocol.mjs +2333 -0
- package/payload/lanes/web/mobile.js +17 -21
- package/payload/lanes/web/tokens.css +137 -0
- package/payload/manifest.json +7 -4
|
@@ -0,0 +1,2333 @@
|
|
|
1
|
+
// GENERATED by crates/lanes-protocol/src/schema/codegen.rs from docs/contracts/lanes2/schema (sha256:8770ee3de77611ab0ae32f07efd29a6e9640a86292954de263a91f83cf8ad35c). Do not edit; regenerate with `LANES2_DECODERS_BLESS=1 cargo test -p lanes-protocol --lib schema::codegen` in a managed build job.
|
|
2
|
+
// Lanes 2.0 wire decoders for the browser (fan-out lane A5; RT D03, 12.1). Types: lanes2_protocol.d.mts; decode tests: lanes/tests/web/lanes2_protocol.test.mjs.
|
|
3
|
+
// Each decodeX(input) takes a string or a Uint8Array holding one document and returns
|
|
4
|
+
// the decoded value or throws a Lanes2DecodeError. It enforces the exported JSON Schema
|
|
5
|
+
// exactly; the Validate rules of the Rust decoders are NOT enforced here (see the README
|
|
6
|
+
// beside this file).
|
|
7
|
+
|
|
8
|
+
export const SCHEMA_DIGEST = "sha256:8770ee3de77611ab0ae32f07efd29a6e9640a86292954de263a91f83cf8ad35c";
|
|
9
|
+
export const FRAME_MAX_BYTES = 1048576;
|
|
10
|
+
export const NESTING_MAX = 32;
|
|
11
|
+
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Runtime: the bounded strict JSON reader, the schema checks and the encoder.
|
|
14
|
+
// Emitted verbatim from crates/lanes-protocol/src/schema/codegen/runtime.mjs.in.
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
/** Why a document was refused: `limit` before parsing (size or nesting),
|
|
18
|
+
* `syntax` (not strict JSON), `schema` (JSON, but not the document). */
|
|
19
|
+
export class Lanes2DecodeError extends Error {
|
|
20
|
+
/**
|
|
21
|
+
* @param {'limit' | 'syntax' | 'schema'} kind
|
|
22
|
+
* @param {string} path JSON pointer of the refused value ('' is the root)
|
|
23
|
+
* @param {string} reason
|
|
24
|
+
*/
|
|
25
|
+
constructor(kind, path, reason) {
|
|
26
|
+
super(`${kind} at ${path === '' ? '/' : path}: ${reason}`);
|
|
27
|
+
this.name = 'Lanes2DecodeError';
|
|
28
|
+
this.kind = kind;
|
|
29
|
+
this.path = path;
|
|
30
|
+
this.reason = reason;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** A JSON number that is not an unsigned 64-bit integer: a fraction, an
|
|
35
|
+
* exponent, a negative or an out-of-range integer. Kept verbatim so a schema
|
|
36
|
+
* that wants an integer refuses it, as serde refuses a float for a u64. */
|
|
37
|
+
class WireNumber {
|
|
38
|
+
/** @param {string} text @param {boolean} negativeInteger */
|
|
39
|
+
constructor(text, negativeInteger) {
|
|
40
|
+
this.text = text;
|
|
41
|
+
this.negativeInteger = negativeInteger;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const U64_MAX = 18446744073709551615n;
|
|
46
|
+
const I64_MIN_MAGNITUDE = 9223372036854775808n;
|
|
47
|
+
const TOKEN = 1;
|
|
48
|
+
const TEXT = 2;
|
|
49
|
+
const PAYLOAD_DIGEST = 3;
|
|
50
|
+
const DIGEST_SHAPE = /^sha256:[0-9a-f]{64}$/;
|
|
51
|
+
const UTF8 = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true });
|
|
52
|
+
|
|
53
|
+
function limit(reason) {
|
|
54
|
+
return new Lanes2DecodeError('limit', '', reason);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function syntax(offset, reason) {
|
|
58
|
+
return new Lanes2DecodeError('syntax', '', `${reason} at offset ${offset}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function schema(path, reason) {
|
|
62
|
+
return new Lanes2DecodeError('schema', path, reason);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function tooLarge(bytes) {
|
|
66
|
+
return limit(`frame of ${bytes} bytes exceeds the ${FRAME_MAX_BYTES}-byte bound`);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** `limits::check_depth`: one pass that counts brackets outside strings. */
|
|
70
|
+
function checkDepth(at, length) {
|
|
71
|
+
let depth = 0;
|
|
72
|
+
let inString = false;
|
|
73
|
+
let escaped = false;
|
|
74
|
+
for (let i = 0; i < length; i++) {
|
|
75
|
+
const c = at(i);
|
|
76
|
+
if (inString) {
|
|
77
|
+
if (escaped) escaped = false;
|
|
78
|
+
else if (c === 0x5c) escaped = true;
|
|
79
|
+
else if (c === 0x22) inString = false;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (c === 0x22) inString = true;
|
|
83
|
+
else if (c === 0x5b || c === 0x7b) {
|
|
84
|
+
depth++;
|
|
85
|
+
if (depth > NESTING_MAX) throw limit(`frame nests deeper than ${NESTING_MAX} levels`);
|
|
86
|
+
} else if ((c === 0x5d || c === 0x7d) && depth > 0) depth--;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** UTF-8 length of a string, or -1 when it holds a lone surrogate. */
|
|
91
|
+
function utf8Length(text) {
|
|
92
|
+
let bytes = 0;
|
|
93
|
+
for (let i = 0; i < text.length; i++) {
|
|
94
|
+
const c = text.charCodeAt(i);
|
|
95
|
+
if (c < 0x80) bytes += 1;
|
|
96
|
+
else if (c < 0x800) bytes += 2;
|
|
97
|
+
else if (c >= 0xd800 && c <= 0xdbff) {
|
|
98
|
+
const d = text.charCodeAt(i + 1);
|
|
99
|
+
if (!(d >= 0xdc00 && d <= 0xdfff)) return -1;
|
|
100
|
+
bytes += 4;
|
|
101
|
+
i++;
|
|
102
|
+
} else if (c >= 0xdc00 && c <= 0xdfff) return -1;
|
|
103
|
+
else bytes += 3;
|
|
104
|
+
}
|
|
105
|
+
return bytes;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** The frame as text, after the size and nesting bounds. */
|
|
109
|
+
function frameText(input) {
|
|
110
|
+
if (typeof input === 'string') {
|
|
111
|
+
if (input.length > FRAME_MAX_BYTES) throw tooLarge(`more than ${FRAME_MAX_BYTES}`);
|
|
112
|
+
const bytes = utf8Length(input);
|
|
113
|
+
if (bytes > FRAME_MAX_BYTES) throw tooLarge(bytes);
|
|
114
|
+
checkDepth((i) => input.charCodeAt(i), input.length);
|
|
115
|
+
if (bytes < 0) throw syntax(0, 'a lone surrogate is not UTF-8');
|
|
116
|
+
return input;
|
|
117
|
+
}
|
|
118
|
+
if (input instanceof Uint8Array) {
|
|
119
|
+
if (input.byteLength > FRAME_MAX_BYTES) throw tooLarge(input.byteLength);
|
|
120
|
+
checkDepth((i) => input[i], input.length);
|
|
121
|
+
try {
|
|
122
|
+
return UTF8.decode(input);
|
|
123
|
+
} catch {
|
|
124
|
+
throw syntax(0, 'not valid UTF-8');
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
throw new TypeError('a Lanes 2.0 document is a string or a Uint8Array');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function isDigit(c) {
|
|
131
|
+
return c >= 0x30 && c <= 0x39;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function skipSpace(p) {
|
|
135
|
+
const t = p.text;
|
|
136
|
+
let i = p.at;
|
|
137
|
+
while (i < t.length) {
|
|
138
|
+
const c = t.charCodeAt(i);
|
|
139
|
+
if (c === 0x20 || c === 0x0a || c === 0x0d || c === 0x09) i++;
|
|
140
|
+
else break;
|
|
141
|
+
}
|
|
142
|
+
p.at = i;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function parseValue(p) {
|
|
146
|
+
skipSpace(p);
|
|
147
|
+
if (p.at >= p.text.length) throw syntax(p.at, 'unexpected end of input');
|
|
148
|
+
const c = p.text.charCodeAt(p.at);
|
|
149
|
+
if (c === 0x7b) return parseObject(p);
|
|
150
|
+
if (c === 0x5b) return parseArray(p);
|
|
151
|
+
if (c === 0x22) return parseString(p);
|
|
152
|
+
if (c === 0x74) return literal(p, 'true', true);
|
|
153
|
+
if (c === 0x66) return literal(p, 'false', false);
|
|
154
|
+
if (c === 0x6e) return literal(p, 'null', null);
|
|
155
|
+
if (c === 0x2d || isDigit(c)) return parseNumber(p);
|
|
156
|
+
throw syntax(p.at, 'unexpected character');
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function literal(p, word, value) {
|
|
160
|
+
if (!p.text.startsWith(word, p.at)) throw syntax(p.at, 'invalid literal');
|
|
161
|
+
p.at += word.length;
|
|
162
|
+
return value;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** Objects are Maps: insertion order is the wire order, and no key (not
|
|
166
|
+
* even `__proto__`) can reach a prototype. */
|
|
167
|
+
function parseObject(p) {
|
|
168
|
+
const map = new Map();
|
|
169
|
+
p.at++;
|
|
170
|
+
skipSpace(p);
|
|
171
|
+
if (p.text.charCodeAt(p.at) === 0x7d) {
|
|
172
|
+
p.at++;
|
|
173
|
+
return map;
|
|
174
|
+
}
|
|
175
|
+
for (;;) {
|
|
176
|
+
skipSpace(p);
|
|
177
|
+
if (p.text.charCodeAt(p.at) !== 0x22) throw syntax(p.at, 'expected a property name');
|
|
178
|
+
const at = p.at;
|
|
179
|
+
const key = parseString(p);
|
|
180
|
+
if (map.has(key)) throw syntax(at, `duplicate property ${JSON.stringify(key)}`);
|
|
181
|
+
skipSpace(p);
|
|
182
|
+
if (p.text.charCodeAt(p.at) !== 0x3a) throw syntax(p.at, "expected ':'");
|
|
183
|
+
p.at++;
|
|
184
|
+
map.set(key, parseValue(p));
|
|
185
|
+
skipSpace(p);
|
|
186
|
+
const c = p.text.charCodeAt(p.at);
|
|
187
|
+
p.at++;
|
|
188
|
+
if (c === 0x2c) continue;
|
|
189
|
+
if (c === 0x7d) return map;
|
|
190
|
+
throw syntax(p.at - 1, "expected ',' or '}'");
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function parseArray(p) {
|
|
195
|
+
const items = [];
|
|
196
|
+
p.at++;
|
|
197
|
+
skipSpace(p);
|
|
198
|
+
if (p.text.charCodeAt(p.at) === 0x5d) {
|
|
199
|
+
p.at++;
|
|
200
|
+
return items;
|
|
201
|
+
}
|
|
202
|
+
for (;;) {
|
|
203
|
+
items.push(parseValue(p));
|
|
204
|
+
skipSpace(p);
|
|
205
|
+
const c = p.text.charCodeAt(p.at);
|
|
206
|
+
p.at++;
|
|
207
|
+
if (c === 0x2c) continue;
|
|
208
|
+
if (c === 0x5d) return items;
|
|
209
|
+
throw syntax(p.at - 1, "expected ',' or ']'");
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function hex4(t, at) {
|
|
214
|
+
if (at + 4 > t.length) throw syntax(at, 'a truncated \\u escape');
|
|
215
|
+
let value = 0;
|
|
216
|
+
for (let k = 0; k < 4; k++) {
|
|
217
|
+
const c = t.charCodeAt(at + k);
|
|
218
|
+
let digit;
|
|
219
|
+
if (c >= 0x30 && c <= 0x39) digit = c - 0x30;
|
|
220
|
+
else if (c >= 0x61 && c <= 0x66) digit = c - 0x57;
|
|
221
|
+
else if (c >= 0x41 && c <= 0x46) digit = c - 0x37;
|
|
222
|
+
else throw syntax(at + k, 'an invalid \\u escape');
|
|
223
|
+
value = value * 16 + digit;
|
|
224
|
+
}
|
|
225
|
+
return value;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function parseString(p) {
|
|
229
|
+
const t = p.text;
|
|
230
|
+
let i = p.at + 1;
|
|
231
|
+
let start = i;
|
|
232
|
+
let out = '';
|
|
233
|
+
for (;;) {
|
|
234
|
+
if (i >= t.length) throw syntax(i, 'unterminated string');
|
|
235
|
+
const c = t.charCodeAt(i);
|
|
236
|
+
if (c === 0x22) {
|
|
237
|
+
p.at = i + 1;
|
|
238
|
+
return out + t.slice(start, i);
|
|
239
|
+
}
|
|
240
|
+
if (c < 0x20) throw syntax(i, 'a control character inside a string');
|
|
241
|
+
if (c !== 0x5c) {
|
|
242
|
+
i++;
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
out += t.slice(start, i);
|
|
246
|
+
const e = t.charCodeAt(i + 1);
|
|
247
|
+
if (e === 0x22) out += '"';
|
|
248
|
+
else if (e === 0x5c) out += '\\';
|
|
249
|
+
else if (e === 0x2f) out += '/';
|
|
250
|
+
else if (e === 0x62) out += '\b';
|
|
251
|
+
else if (e === 0x66) out += '\f';
|
|
252
|
+
else if (e === 0x6e) out += '\n';
|
|
253
|
+
else if (e === 0x72) out += '\r';
|
|
254
|
+
else if (e === 0x74) out += '\t';
|
|
255
|
+
else if (e === 0x75) {
|
|
256
|
+
const unit = hex4(t, i + 2);
|
|
257
|
+
if (unit >= 0xd800 && unit <= 0xdbff) {
|
|
258
|
+
if (t.charCodeAt(i + 6) !== 0x5c || t.charCodeAt(i + 7) !== 0x75) {
|
|
259
|
+
throw syntax(i, 'a lone leading surrogate in a \\u escape');
|
|
260
|
+
}
|
|
261
|
+
const low = hex4(t, i + 8);
|
|
262
|
+
if (low < 0xdc00 || low > 0xdfff) throw syntax(i, 'a lone leading surrogate in a \\u escape');
|
|
263
|
+
out += String.fromCharCode(unit, low);
|
|
264
|
+
i += 12;
|
|
265
|
+
} else if (unit >= 0xdc00 && unit <= 0xdfff) {
|
|
266
|
+
throw syntax(i, 'a lone trailing surrogate in a \\u escape');
|
|
267
|
+
} else {
|
|
268
|
+
out += String.fromCharCode(unit);
|
|
269
|
+
i += 6;
|
|
270
|
+
}
|
|
271
|
+
start = i;
|
|
272
|
+
continue;
|
|
273
|
+
} else throw syntax(i, 'an invalid escape');
|
|
274
|
+
i += 2;
|
|
275
|
+
start = i;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function parseNumber(p) {
|
|
280
|
+
const t = p.text;
|
|
281
|
+
const begin = p.at;
|
|
282
|
+
let i = begin;
|
|
283
|
+
const negative = t.charCodeAt(i) === 0x2d;
|
|
284
|
+
if (negative) i++;
|
|
285
|
+
const first = t.charCodeAt(i);
|
|
286
|
+
if (first === 0x30) i++;
|
|
287
|
+
else if (first >= 0x31 && first <= 0x39) {
|
|
288
|
+
while (isDigit(t.charCodeAt(i))) i++;
|
|
289
|
+
} else throw syntax(i, 'invalid number');
|
|
290
|
+
let integer = true;
|
|
291
|
+
if (t.charCodeAt(i) === 0x2e) {
|
|
292
|
+
integer = false;
|
|
293
|
+
i++;
|
|
294
|
+
if (!isDigit(t.charCodeAt(i))) throw syntax(i, 'invalid number');
|
|
295
|
+
while (isDigit(t.charCodeAt(i))) i++;
|
|
296
|
+
}
|
|
297
|
+
const e = t.charCodeAt(i);
|
|
298
|
+
if (e === 0x65 || e === 0x45) {
|
|
299
|
+
integer = false;
|
|
300
|
+
i++;
|
|
301
|
+
const sign = t.charCodeAt(i);
|
|
302
|
+
if (sign === 0x2b || sign === 0x2d) i++;
|
|
303
|
+
if (!isDigit(t.charCodeAt(i))) throw syntax(i, 'invalid number');
|
|
304
|
+
while (isDigit(t.charCodeAt(i))) i++;
|
|
305
|
+
}
|
|
306
|
+
p.at = i;
|
|
307
|
+
const text = t.slice(begin, i);
|
|
308
|
+
const digits = negative ? text.slice(1) : text;
|
|
309
|
+
// More than 20 digits cannot be a 64-bit integer; never hand BigInt a
|
|
310
|
+
// megabyte of digits.
|
|
311
|
+
if (!integer || digits.length > 20) return new WireNumber(text, false);
|
|
312
|
+
if (negative) return new WireNumber(text, BigInt(digits) <= I64_MIN_MAGNITUDE);
|
|
313
|
+
const value = BigInt(digits);
|
|
314
|
+
return value <= U64_MAX ? value : new WireNumber(text, false);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/** Parse one frame: bounds first, then strict JSON, then end of input. */
|
|
318
|
+
function parseFrame(input) {
|
|
319
|
+
const p = { text: frameText(input), at: 0 };
|
|
320
|
+
const value = parseValue(p);
|
|
321
|
+
skipSpace(p);
|
|
322
|
+
if (p.at !== p.text.length) throw syntax(p.at, 'trailing characters');
|
|
323
|
+
return value;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function object(value, path) {
|
|
327
|
+
if (!(value instanceof Map)) throw schema(path, 'expected object');
|
|
328
|
+
return value;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function need(map, path, names) {
|
|
332
|
+
for (const name of names) {
|
|
333
|
+
if (!map.has(name)) throw schema(path, `missing required property ${name}`);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function unknown(path) {
|
|
338
|
+
throw schema(path, 'unknown property');
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function list(value, path, maxItems, item) {
|
|
342
|
+
if (!Array.isArray(value)) throw schema(path, 'expected array');
|
|
343
|
+
if (maxItems !== null && value.length > maxItems) {
|
|
344
|
+
throw schema(path, `${value.length} items exceed maxItems ${maxItems}`);
|
|
345
|
+
}
|
|
346
|
+
const out = new Array(value.length);
|
|
347
|
+
for (let i = 0; i < value.length; i++) out[i] = item(value[i], `${path}/${i}`);
|
|
348
|
+
return out;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/** Lengths count Unicode scalar values; byte bounds count UTF-8 bytes. */
|
|
352
|
+
function string(value, path, minChars, maxChars, maxBytes, alphabet) {
|
|
353
|
+
if (typeof value !== 'string') throw schema(path, 'expected string');
|
|
354
|
+
let chars = 0;
|
|
355
|
+
let bytes = 0;
|
|
356
|
+
for (let i = 0; i < value.length; i++) {
|
|
357
|
+
const c = value.charCodeAt(i);
|
|
358
|
+
chars++;
|
|
359
|
+
if (c < 0x80) bytes += 1;
|
|
360
|
+
else if (c < 0x800) bytes += 2;
|
|
361
|
+
else if (c >= 0xd800 && c <= 0xdbff) {
|
|
362
|
+
bytes += 4;
|
|
363
|
+
i++;
|
|
364
|
+
} else bytes += 3;
|
|
365
|
+
if (alphabet === TOKEN && (c < 0x21 || c > 0x7e || c === 0x22 || c === 0x5c)) {
|
|
366
|
+
throw schema(path, 'outside the token alphabet');
|
|
367
|
+
}
|
|
368
|
+
if (alphabet === TEXT && ((c < 0x20 && c !== 0x0a && c !== 0x09) || (c >= 0x7f && c <= 0x9f))) {
|
|
369
|
+
throw schema(path, 'a control character in text');
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
if (minChars !== null && chars < minChars) throw schema(path, `shorter than minLength ${minChars}`);
|
|
373
|
+
if (maxChars !== null && chars > maxChars) throw schema(path, `longer than maxLength ${maxChars}`);
|
|
374
|
+
if (maxBytes !== null && bytes > maxBytes) throw schema(path, `more than ${maxBytes} UTF-8 bytes`);
|
|
375
|
+
if (alphabet === PAYLOAD_DIGEST && !DIGEST_SHAPE.test(value)) {
|
|
376
|
+
throw schema(path, 'not sha256:<64 lowercase hex>');
|
|
377
|
+
}
|
|
378
|
+
return value;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/** An unsigned integer; `small` returns a number (the schema's maximum is at
|
|
382
|
+
* most 2^53 - 1), otherwise a bigint. */
|
|
383
|
+
function integer(value, path, minimum, maximum, small) {
|
|
384
|
+
if (typeof value !== 'bigint') {
|
|
385
|
+
if (value instanceof WireNumber && value.negativeInteger) throw schema(path, 'negative integer');
|
|
386
|
+
throw schema(path, 'expected integer');
|
|
387
|
+
}
|
|
388
|
+
if (value < minimum) throw schema(path, `${value} is below the minimum ${minimum}`);
|
|
389
|
+
if (maximum !== null && value > maximum) throw schema(path, `${value} is above the maximum ${maximum}`);
|
|
390
|
+
return small ? Number(value) : value;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
function boolean(value, path) {
|
|
394
|
+
if (typeof value !== 'boolean') throw schema(path, 'expected boolean');
|
|
395
|
+
return value;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
function constant(value, path, expected) {
|
|
399
|
+
if (value !== expected) throw schema(path, `expected constant ${String(expected)}`);
|
|
400
|
+
return typeof expected === 'bigint' && expected <= 9007199254740991n ? Number(expected) : expected;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function enumeration(value, path, values) {
|
|
404
|
+
if (typeof value !== 'string') throw schema(path, 'expected string');
|
|
405
|
+
if (!values.has(value)) throw schema(path, `${JSON.stringify(value)} is not one of the enumerated values`);
|
|
406
|
+
return value;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/** One alternative of an adjacently tagged union whose tag already matched. */
|
|
410
|
+
function variant(map, path, tag, content, decodeContent) {
|
|
411
|
+
const out = {};
|
|
412
|
+
for (const [key, value] of map) {
|
|
413
|
+
if (key === tag) out[tag] = value;
|
|
414
|
+
else if (key === content) out[content] = decodeContent(value, `${path}/${content}`);
|
|
415
|
+
else unknown(`${path}/${key}`);
|
|
416
|
+
}
|
|
417
|
+
need(map, path, [tag, content]);
|
|
418
|
+
return out;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
function noAlternative(path, tag) {
|
|
422
|
+
return schema(path, `matches no oneOf alternative (unknown or missing ${JSON.stringify(tag)})`);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
function write(value, parts) {
|
|
426
|
+
switch (typeof value) {
|
|
427
|
+
case 'string':
|
|
428
|
+
parts.push(JSON.stringify(value));
|
|
429
|
+
return;
|
|
430
|
+
case 'bigint':
|
|
431
|
+
if (value < 0n || value > U64_MAX) throw new RangeError('not an unsigned 64-bit integer');
|
|
432
|
+
parts.push(value.toString());
|
|
433
|
+
return;
|
|
434
|
+
case 'number':
|
|
435
|
+
if (!Number.isSafeInteger(value) || value < 0) throw new RangeError('not an unsigned safe integer');
|
|
436
|
+
parts.push(String(value));
|
|
437
|
+
return;
|
|
438
|
+
case 'boolean':
|
|
439
|
+
parts.push(value ? 'true' : 'false');
|
|
440
|
+
return;
|
|
441
|
+
case 'object':
|
|
442
|
+
if (Array.isArray(value)) {
|
|
443
|
+
parts.push('[');
|
|
444
|
+
for (let i = 0; i < value.length; i++) {
|
|
445
|
+
if (i > 0) parts.push(',');
|
|
446
|
+
write(value[i], parts);
|
|
447
|
+
}
|
|
448
|
+
parts.push(']');
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
if (value !== null) {
|
|
452
|
+
parts.push('{');
|
|
453
|
+
let first = true;
|
|
454
|
+
for (const key of Object.keys(value)) {
|
|
455
|
+
const item = value[key];
|
|
456
|
+
if (item === undefined) continue;
|
|
457
|
+
if (!first) parts.push(',');
|
|
458
|
+
first = false;
|
|
459
|
+
parts.push(JSON.stringify(key), ':');
|
|
460
|
+
write(item, parts);
|
|
461
|
+
}
|
|
462
|
+
parts.push('}');
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
break;
|
|
466
|
+
default:
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
throw new TypeError('not a Lanes 2.0 wire value');
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/** Compact JSON of a decoded document, members in their own order: the
|
|
473
|
+
* strict re-encoding of a decoded golden fixture is its exact bytes. */
|
|
474
|
+
export function encode(value) {
|
|
475
|
+
const parts = [];
|
|
476
|
+
write(value, parts);
|
|
477
|
+
return parts.join('');
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// ---------------------------------------------------------------------------
|
|
481
|
+
// Generated decoders, one per schema type.
|
|
482
|
+
// ---------------------------------------------------------------------------
|
|
483
|
+
|
|
484
|
+
function d_Frame(value, path) {
|
|
485
|
+
const map = object(value, path);
|
|
486
|
+
switch (map.get("frame")) {
|
|
487
|
+
case "hello": return variant(map, path, "frame", "body", d_Hello);
|
|
488
|
+
case "command": return variant(map, path, "frame", "body", d_Command);
|
|
489
|
+
case "receipt": return variant(map, path, "frame", "body", d_Receipt);
|
|
490
|
+
case "event": return variant(map, path, "frame", "body", d_Event);
|
|
491
|
+
case "subscribe": return variant(map, path, "frame", "body", d_Subscribe);
|
|
492
|
+
case "snapshot": return variant(map, path, "frame", "body", d_Snapshot);
|
|
493
|
+
case "resync": return variant(map, path, "frame", "body", d_Resync);
|
|
494
|
+
case "refused": return variant(map, path, "frame", "body", d_FrameRefusal);
|
|
495
|
+
default: throw noAlternative(path, "frame");
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
function d_Hello(value, path) {
|
|
500
|
+
const map = object(value, path);
|
|
501
|
+
need(map, path, ["protocol", "role", "peer", "qualification", "capabilities"]);
|
|
502
|
+
const out = {};
|
|
503
|
+
for (const [key, item] of map) {
|
|
504
|
+
const at = `${path}/${key}`;
|
|
505
|
+
switch (key) {
|
|
506
|
+
case "protocol": out.protocol = d_HelloProtocol(item, at); break;
|
|
507
|
+
case "role": out.role = enumeration(item, at, E_HelloRole); break;
|
|
508
|
+
case "peer": out.peer = d_HelloPeer(item, at); break;
|
|
509
|
+
case "qualification": out.qualification = string(item, at, 1, 128, null, TOKEN); break;
|
|
510
|
+
case "capabilities": out.capabilities = list(item, at, 64, d_HelloCapabilitiesItem); break;
|
|
511
|
+
case "protocol_epoch": out.protocol_epoch = integer(item, at, 0n, null, false); break;
|
|
512
|
+
case "replay_horizon": out.replay_horizon = d_HelloReplayHorizon(item, at); break;
|
|
513
|
+
default: break; // tolerant: dropped (the reader is stricter than serde inside it)
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
return out;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
function d_HelloProtocol(value, path) {
|
|
520
|
+
const map = object(value, path);
|
|
521
|
+
need(map, path, ["major", "minor"]);
|
|
522
|
+
const out = {};
|
|
523
|
+
for (const [key, item] of map) {
|
|
524
|
+
const at = `${path}/${key}`;
|
|
525
|
+
switch (key) {
|
|
526
|
+
case "major": out.major = integer(item, at, 0n, 65535n, true); break;
|
|
527
|
+
case "minor": out.minor = integer(item, at, 0n, 65535n, true); break;
|
|
528
|
+
default: break; // tolerant: dropped (the reader is stricter than serde inside it)
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
return out;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
const E_HelloRole = new Set(["client", "host"]);
|
|
535
|
+
|
|
536
|
+
function d_HelloPeer(value, path) {
|
|
537
|
+
const map = object(value, path);
|
|
538
|
+
need(map, path, ["product", "build", "instance_id"]);
|
|
539
|
+
const out = {};
|
|
540
|
+
for (const [key, item] of map) {
|
|
541
|
+
const at = `${path}/${key}`;
|
|
542
|
+
switch (key) {
|
|
543
|
+
case "product": out.product = string(item, at, 1, 64, null, TOKEN); break;
|
|
544
|
+
case "build": out.build = string(item, at, 1, 64, null, TOKEN); break;
|
|
545
|
+
case "instance_id": out.instance_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
546
|
+
default: break; // tolerant: dropped (the reader is stricter than serde inside it)
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
return out;
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
function d_HelloCapabilitiesItem(value, path) {
|
|
553
|
+
const map = object(value, path);
|
|
554
|
+
need(map, path, ["name", "min_version", "max_version", "send", "receive"]);
|
|
555
|
+
const out = {};
|
|
556
|
+
for (const [key, item] of map) {
|
|
557
|
+
const at = `${path}/${key}`;
|
|
558
|
+
switch (key) {
|
|
559
|
+
case "name": out.name = string(item, at, 1, 64, null, TOKEN); break;
|
|
560
|
+
case "min_version": out.min_version = integer(item, at, 0n, 65535n, true); break;
|
|
561
|
+
case "max_version": out.max_version = integer(item, at, 0n, 65535n, true); break;
|
|
562
|
+
case "send": out.send = boolean(item, at); break;
|
|
563
|
+
case "receive": out.receive = boolean(item, at); break;
|
|
564
|
+
default: break; // tolerant: dropped (the reader is stricter than serde inside it)
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
return out;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
function d_HelloReplayHorizon(value, path) {
|
|
571
|
+
const map = object(value, path);
|
|
572
|
+
need(map, path, ["max_events", "max_bytes", "max_age_ms"]);
|
|
573
|
+
const out = {};
|
|
574
|
+
for (const [key, item] of map) {
|
|
575
|
+
const at = `${path}/${key}`;
|
|
576
|
+
switch (key) {
|
|
577
|
+
case "max_events": out.max_events = integer(item, at, 0n, 4294967295n, true); break;
|
|
578
|
+
case "max_bytes": out.max_bytes = integer(item, at, 0n, null, false); break;
|
|
579
|
+
case "max_age_ms": out.max_age_ms = integer(item, at, 0n, null, false); break;
|
|
580
|
+
default: break; // tolerant: dropped (the reader is stricter than serde inside it)
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
return out;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
function d_Command(value, path) {
|
|
587
|
+
const map = object(value, path);
|
|
588
|
+
need(map, path, ["v", "request_id", "operation_id", "retry_epoch", "protocol_epoch", "target", "expected_owner_epoch", "remaining_deadline_ms", "payload"]);
|
|
589
|
+
const out = {};
|
|
590
|
+
for (const [key, item] of map) {
|
|
591
|
+
const at = `${path}/${key}`;
|
|
592
|
+
switch (key) {
|
|
593
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
594
|
+
case "request_id": out.request_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
595
|
+
case "operation_id": out.operation_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
596
|
+
case "retry_epoch": out.retry_epoch = integer(item, at, 0n, null, false); break;
|
|
597
|
+
case "protocol_epoch": out.protocol_epoch = integer(item, at, 0n, null, false); break;
|
|
598
|
+
case "target": out.target = d_CommandTarget(item, at); break;
|
|
599
|
+
case "expected_owner_epoch": out.expected_owner_epoch = integer(item, at, 0n, null, false); break;
|
|
600
|
+
case "remaining_deadline_ms": out.remaining_deadline_ms = integer(item, at, 0n, 4294967295n, true); break;
|
|
601
|
+
case "payload": out.payload = d_CommandPayload(item, at); break;
|
|
602
|
+
case "expected_native_generation": out.expected_native_generation = string(item, at, 1, 128, null, TOKEN); break;
|
|
603
|
+
case "expected_revision": out.expected_revision = integer(item, at, 0n, null, false); break;
|
|
604
|
+
default: unknown(at);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
return out;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
function d_CommandTarget(value, path) {
|
|
611
|
+
const map = object(value, path);
|
|
612
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
613
|
+
const out = {};
|
|
614
|
+
for (const [key, item] of map) {
|
|
615
|
+
const at = `${path}/${key}`;
|
|
616
|
+
switch (key) {
|
|
617
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
618
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
619
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
620
|
+
default: unknown(at);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
return out;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
function d_CommandPayload(value, path) {
|
|
627
|
+
const map = object(value, path);
|
|
628
|
+
switch (map.get("kind")) {
|
|
629
|
+
case "rename_lane": return variant(map, path, "kind", "args", d_CommandPayloadRenameLane);
|
|
630
|
+
case "cancel_operation": return variant(map, path, "kind", "args", d_CommandPayloadCancelOperation);
|
|
631
|
+
case "query_operation": return variant(map, path, "kind", "args", d_CommandPayloadQueryOperation);
|
|
632
|
+
case "set_view_mode": return variant(map, path, "kind", "args", d_CommandPayloadSetViewMode);
|
|
633
|
+
case "return_focus": return variant(map, path, "kind", "args", d_CommandPayloadReturnFocus);
|
|
634
|
+
case "resize_view": return variant(map, path, "kind", "args", d_CommandPayloadResizeView);
|
|
635
|
+
case "answer_prompt": return variant(map, path, "kind", "args", d_CommandPayloadAnswerPrompt);
|
|
636
|
+
default: throw noAlternative(path, "kind");
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
function d_CommandPayloadRenameLane(value, path) {
|
|
641
|
+
const map = object(value, path);
|
|
642
|
+
need(map, path, ["display_name"]);
|
|
643
|
+
const out = {};
|
|
644
|
+
for (const [key, item] of map) {
|
|
645
|
+
const at = `${path}/${key}`;
|
|
646
|
+
switch (key) {
|
|
647
|
+
case "display_name": out.display_name = string(item, at, 1, 256, 256, TEXT); break;
|
|
648
|
+
default: unknown(at);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
return out;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
function d_CommandPayloadCancelOperation(value, path) {
|
|
655
|
+
const map = object(value, path);
|
|
656
|
+
need(map, path, ["operation_id"]);
|
|
657
|
+
const out = {};
|
|
658
|
+
for (const [key, item] of map) {
|
|
659
|
+
const at = `${path}/${key}`;
|
|
660
|
+
switch (key) {
|
|
661
|
+
case "operation_id": out.operation_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
662
|
+
default: unknown(at);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
return out;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
function d_CommandPayloadQueryOperation(value, path) {
|
|
669
|
+
const map = object(value, path);
|
|
670
|
+
need(map, path, ["operation_id"]);
|
|
671
|
+
const out = {};
|
|
672
|
+
for (const [key, item] of map) {
|
|
673
|
+
const at = `${path}/${key}`;
|
|
674
|
+
switch (key) {
|
|
675
|
+
case "operation_id": out.operation_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
676
|
+
default: unknown(at);
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
return out;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
function d_CommandPayloadSetViewMode(value, path) {
|
|
683
|
+
const map = object(value, path);
|
|
684
|
+
need(map, path, ["view_id", "mode"]);
|
|
685
|
+
const out = {};
|
|
686
|
+
for (const [key, item] of map) {
|
|
687
|
+
const at = `${path}/${key}`;
|
|
688
|
+
switch (key) {
|
|
689
|
+
case "view_id": out.view_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
690
|
+
case "mode": out.mode = enumeration(item, at, E_CommandPayloadSetViewModeMode); break;
|
|
691
|
+
default: unknown(at);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
return out;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
const E_CommandPayloadSetViewModeMode = new Set(["holder", "view"]);
|
|
698
|
+
|
|
699
|
+
function d_CommandPayloadReturnFocus(value, path) {
|
|
700
|
+
const map = object(value, path);
|
|
701
|
+
need(map, path, ["view_id", "focus_token"]);
|
|
702
|
+
const out = {};
|
|
703
|
+
for (const [key, item] of map) {
|
|
704
|
+
const at = `${path}/${key}`;
|
|
705
|
+
switch (key) {
|
|
706
|
+
case "view_id": out.view_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
707
|
+
case "focus_token": out.focus_token = string(item, at, 1, 512, null, TOKEN); break;
|
|
708
|
+
default: unknown(at);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
return out;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
function d_CommandPayloadResizeView(value, path) {
|
|
715
|
+
const map = object(value, path);
|
|
716
|
+
need(map, path, ["view_id", "cols", "rows"]);
|
|
717
|
+
const out = {};
|
|
718
|
+
for (const [key, item] of map) {
|
|
719
|
+
const at = `${path}/${key}`;
|
|
720
|
+
switch (key) {
|
|
721
|
+
case "view_id": out.view_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
722
|
+
case "cols": out.cols = integer(item, at, 0n, 65535n, true); break;
|
|
723
|
+
case "rows": out.rows = integer(item, at, 0n, 65535n, true); break;
|
|
724
|
+
default: unknown(at);
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return out;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
function d_CommandPayloadAnswerPrompt(value, path) {
|
|
731
|
+
const map = object(value, path);
|
|
732
|
+
need(map, path, ["prompt_id", "prompt_revision", "option_id", "assurance"]);
|
|
733
|
+
const out = {};
|
|
734
|
+
for (const [key, item] of map) {
|
|
735
|
+
const at = `${path}/${key}`;
|
|
736
|
+
switch (key) {
|
|
737
|
+
case "prompt_id": out.prompt_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
738
|
+
case "prompt_revision": out.prompt_revision = integer(item, at, 0n, null, false); break;
|
|
739
|
+
case "option_id": out.option_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
740
|
+
case "assurance": out.assurance = enumeration(item, at, E_CommandPayloadAnswerPromptAssurance); break;
|
|
741
|
+
default: unknown(at);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
return out;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
const E_CommandPayloadAnswerPromptAssurance = new Set(["atomic_prompt_answer", "verified_terminal_answer"]);
|
|
748
|
+
|
|
749
|
+
function d_Receipt(value, path) {
|
|
750
|
+
const map = object(value, path);
|
|
751
|
+
need(map, path, ["v", "operation_id", "revision", "state", "effect_certainty", "outcome", "evidence_refs"]);
|
|
752
|
+
const out = {};
|
|
753
|
+
for (const [key, item] of map) {
|
|
754
|
+
const at = `${path}/${key}`;
|
|
755
|
+
switch (key) {
|
|
756
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
757
|
+
case "operation_id": out.operation_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
758
|
+
case "revision": out.revision = integer(item, at, 0n, null, false); break;
|
|
759
|
+
case "state": out.state = enumeration(item, at, E_ReceiptState); break;
|
|
760
|
+
case "effect_certainty": out.effect_certainty = enumeration(item, at, E_ReceiptEffectCertainty); break;
|
|
761
|
+
case "outcome": out.outcome = d_ReceiptOutcome(item, at); break;
|
|
762
|
+
case "evidence_refs": out.evidence_refs = list(item, at, 32, d_ReceiptEvidenceRefsItem); break;
|
|
763
|
+
case "durable_at_unix_ms": out.durable_at_unix_ms = integer(item, at, 0n, null, false); break;
|
|
764
|
+
case "request_id": out.request_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
765
|
+
default: unknown(at);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
return out;
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
const E_ReceiptState = new Set(["refused", "queued", "preparing", "effect_authorized", "keys_accepted", "partial_input", "outcome_unknown", "applied", "rejected_stale", "failed_before_effect", "cancelled_before_effect", "expired_before_effect"]);
|
|
772
|
+
|
|
773
|
+
const E_ReceiptEffectCertainty = new Set(["no_effect", "navigation_possible", "navigation_definite", "submission_possible", "holder_accepted", "native_applied"]);
|
|
774
|
+
|
|
775
|
+
function d_ReceiptOutcome(value, path) {
|
|
776
|
+
const map = object(value, path);
|
|
777
|
+
switch (map.get("status")) {
|
|
778
|
+
case "pending": return variant(map, path, "status", "detail", d_ReceiptOutcomePending);
|
|
779
|
+
case "result": return variant(map, path, "status", "detail", d_ReceiptOutcomeResult);
|
|
780
|
+
case "refusal": return variant(map, path, "status", "detail", d_ReceiptOutcomeRefusal);
|
|
781
|
+
case "unresolved": return variant(map, path, "status", "detail", d_ReceiptOutcomeUnresolved);
|
|
782
|
+
default: throw noAlternative(path, "status");
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
function d_ReceiptOutcomePending(value, path) {
|
|
787
|
+
const map = object(value, path);
|
|
788
|
+
const out = {};
|
|
789
|
+
for (const [key, item] of map) {
|
|
790
|
+
const at = `${path}/${key}`;
|
|
791
|
+
switch (key) {
|
|
792
|
+
default: unknown(at);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
return out;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
function d_ReceiptOutcomeResult(value, path) {
|
|
799
|
+
const map = object(value, path);
|
|
800
|
+
const out = {};
|
|
801
|
+
for (const [key, item] of map) {
|
|
802
|
+
const at = `${path}/${key}`;
|
|
803
|
+
switch (key) {
|
|
804
|
+
case "summary": out.summary = string(item, at, 1, 256, 256, TEXT); break;
|
|
805
|
+
default: unknown(at);
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
return out;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
function d_ReceiptOutcomeRefusal(value, path) {
|
|
812
|
+
const map = object(value, path);
|
|
813
|
+
need(map, path, ["code", "reason"]);
|
|
814
|
+
const out = {};
|
|
815
|
+
for (const [key, item] of map) {
|
|
816
|
+
const at = `${path}/${key}`;
|
|
817
|
+
switch (key) {
|
|
818
|
+
case "code": out.code = string(item, at, 1, 64, null, TOKEN); break;
|
|
819
|
+
case "reason": out.reason = string(item, at, 1, 4096, 4096, TEXT); break;
|
|
820
|
+
default: unknown(at);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
return out;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
function d_ReceiptOutcomeUnresolved(value, path) {
|
|
827
|
+
const map = object(value, path);
|
|
828
|
+
need(map, path, ["reason", "requires_revalidation", "key_may_be_in_flight", "submission"]);
|
|
829
|
+
const out = {};
|
|
830
|
+
for (const [key, item] of map) {
|
|
831
|
+
const at = `${path}/${key}`;
|
|
832
|
+
switch (key) {
|
|
833
|
+
case "reason": out.reason = string(item, at, 1, 4096, 4096, TEXT); break;
|
|
834
|
+
case "requires_revalidation": out.requires_revalidation = boolean(item, at); break;
|
|
835
|
+
case "key_may_be_in_flight": out.key_may_be_in_flight = boolean(item, at); break;
|
|
836
|
+
case "submission": out.submission = enumeration(item, at, E_ReceiptOutcomeUnresolvedSubmission); break;
|
|
837
|
+
case "last_observed_navigation_step": out.last_observed_navigation_step = integer(item, at, 0n, 4294967295n, true); break;
|
|
838
|
+
default: unknown(at);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
return out;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
const E_ReceiptOutcomeUnresolvedSubmission = new Set(["definitely_not_started", "possibly_started"]);
|
|
845
|
+
|
|
846
|
+
function d_ReceiptEvidenceRefsItem(value, path) {
|
|
847
|
+
const map = object(value, path);
|
|
848
|
+
need(map, path, ["witness", "reference"]);
|
|
849
|
+
const out = {};
|
|
850
|
+
for (const [key, item] of map) {
|
|
851
|
+
const at = `${path}/${key}`;
|
|
852
|
+
switch (key) {
|
|
853
|
+
case "witness": out.witness = string(item, at, 1, 64, null, TOKEN); break;
|
|
854
|
+
case "reference": out.reference = string(item, at, 1, 128, null, TOKEN); break;
|
|
855
|
+
case "target_generation": out.target_generation = string(item, at, 1, 128, null, TOKEN); break;
|
|
856
|
+
default: unknown(at);
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
return out;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
function d_Event(value, path) {
|
|
863
|
+
const map = object(value, path);
|
|
864
|
+
need(map, path, ["v", "subscription_stream_id", "delivery_sequence", "event_id", "source_cursor", "committed_revision", "owner_epoch", "payload"]);
|
|
865
|
+
const out = {};
|
|
866
|
+
for (const [key, item] of map) {
|
|
867
|
+
const at = `${path}/${key}`;
|
|
868
|
+
switch (key) {
|
|
869
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
870
|
+
case "subscription_stream_id": out.subscription_stream_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
871
|
+
case "delivery_sequence": out.delivery_sequence = integer(item, at, 0n, null, false); break;
|
|
872
|
+
case "event_id": out.event_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
873
|
+
case "source_cursor": out.source_cursor = string(item, at, 1, 512, null, TOKEN); break;
|
|
874
|
+
case "committed_revision": out.committed_revision = integer(item, at, 0n, null, false); break;
|
|
875
|
+
case "owner_epoch": out.owner_epoch = integer(item, at, 0n, null, false); break;
|
|
876
|
+
case "payload": out.payload = d_EventPayload(item, at); break;
|
|
877
|
+
case "target_generation": out.target_generation = string(item, at, 1, 128, null, TOKEN); break;
|
|
878
|
+
default: unknown(at);
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
return out;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
function d_EventPayload(value, path) {
|
|
885
|
+
const map = object(value, path);
|
|
886
|
+
switch (map.get("kind")) {
|
|
887
|
+
case "directory_row": return variant(map, path, "kind", "data", d_LaneDirectoryRow);
|
|
888
|
+
case "directory_row_removed": return variant(map, path, "kind", "data", d_EventPayloadDirectoryRowRemoved);
|
|
889
|
+
case "prompt_opened": return variant(map, path, "kind", "data", d_EventPayloadPromptOpened);
|
|
890
|
+
case "prompt_closed": return variant(map, path, "kind", "data", d_EventPayloadPromptClosed);
|
|
891
|
+
case "receipt": return variant(map, path, "kind", "data", d_Receipt);
|
|
892
|
+
case "cursor_advance": return variant(map, path, "kind", "data", d_EventPayloadCursorAdvance);
|
|
893
|
+
default: throw noAlternative(path, "kind");
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
function d_EventPayloadDirectoryRowRemoved(value, path) {
|
|
898
|
+
const map = object(value, path);
|
|
899
|
+
need(map, path, ["lane", "reason"]);
|
|
900
|
+
const out = {};
|
|
901
|
+
for (const [key, item] of map) {
|
|
902
|
+
const at = `${path}/${key}`;
|
|
903
|
+
switch (key) {
|
|
904
|
+
case "lane": out.lane = d_EventPayloadDirectoryRowRemovedLane(item, at); break;
|
|
905
|
+
case "reason": out.reason = enumeration(item, at, E_EventPayloadDirectoryRowRemovedReason); break;
|
|
906
|
+
default: unknown(at);
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
return out;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
function d_EventPayloadDirectoryRowRemovedLane(value, path) {
|
|
913
|
+
const map = object(value, path);
|
|
914
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
915
|
+
const out = {};
|
|
916
|
+
for (const [key, item] of map) {
|
|
917
|
+
const at = `${path}/${key}`;
|
|
918
|
+
switch (key) {
|
|
919
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
920
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
921
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
922
|
+
default: unknown(at);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
return out;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
const E_EventPayloadDirectoryRowRemovedReason = new Set(["removed", "access_revoked", "left_filter"]);
|
|
929
|
+
|
|
930
|
+
function d_EventPayloadPromptOpened(value, path) {
|
|
931
|
+
const map = object(value, path);
|
|
932
|
+
need(map, path, ["prompt_id", "prompt_revision", "lane", "native_generation", "question", "options", "assurances"]);
|
|
933
|
+
const out = {};
|
|
934
|
+
for (const [key, item] of map) {
|
|
935
|
+
const at = `${path}/${key}`;
|
|
936
|
+
switch (key) {
|
|
937
|
+
case "prompt_id": out.prompt_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
938
|
+
case "prompt_revision": out.prompt_revision = integer(item, at, 0n, null, false); break;
|
|
939
|
+
case "lane": out.lane = d_EventPayloadPromptOpenedLane(item, at); break;
|
|
940
|
+
case "native_generation": out.native_generation = string(item, at, 1, 128, null, TOKEN); break;
|
|
941
|
+
case "question": out.question = string(item, at, 1, 4096, 4096, TEXT); break;
|
|
942
|
+
case "options": out.options = list(item, at, 32, d_EventPayloadPromptOpenedOptionsItem); break;
|
|
943
|
+
case "assurances": out.assurances = list(item, at, 2, (v1, p1) => enumeration(v1, p1, E_EventPayloadPromptOpenedAssurancesItem)); break;
|
|
944
|
+
default: unknown(at);
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
return out;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
function d_EventPayloadPromptOpenedLane(value, path) {
|
|
951
|
+
const map = object(value, path);
|
|
952
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
953
|
+
const out = {};
|
|
954
|
+
for (const [key, item] of map) {
|
|
955
|
+
const at = `${path}/${key}`;
|
|
956
|
+
switch (key) {
|
|
957
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
958
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
959
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
960
|
+
default: unknown(at);
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
return out;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
function d_EventPayloadPromptOpenedOptionsItem(value, path) {
|
|
967
|
+
const map = object(value, path);
|
|
968
|
+
need(map, path, ["option_id", "label"]);
|
|
969
|
+
const out = {};
|
|
970
|
+
for (const [key, item] of map) {
|
|
971
|
+
const at = `${path}/${key}`;
|
|
972
|
+
switch (key) {
|
|
973
|
+
case "option_id": out.option_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
974
|
+
case "label": out.label = string(item, at, 1, 256, 256, TEXT); break;
|
|
975
|
+
default: unknown(at);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
return out;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
const E_EventPayloadPromptOpenedAssurancesItem = new Set(["atomic_prompt_answer", "verified_terminal_answer"]);
|
|
982
|
+
|
|
983
|
+
function d_EventPayloadPromptClosed(value, path) {
|
|
984
|
+
const map = object(value, path);
|
|
985
|
+
need(map, path, ["prompt_id", "prompt_revision", "native_generation", "cause"]);
|
|
986
|
+
const out = {};
|
|
987
|
+
for (const [key, item] of map) {
|
|
988
|
+
const at = `${path}/${key}`;
|
|
989
|
+
switch (key) {
|
|
990
|
+
case "prompt_id": out.prompt_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
991
|
+
case "prompt_revision": out.prompt_revision = integer(item, at, 0n, null, false); break;
|
|
992
|
+
case "native_generation": out.native_generation = string(item, at, 1, 128, null, TOKEN); break;
|
|
993
|
+
case "cause": out.cause = enumeration(item, at, E_EventPayloadPromptClosedCause); break;
|
|
994
|
+
default: unknown(at);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
return out;
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
const E_EventPayloadPromptClosedCause = new Set(["answered", "superseded", "expired", "cancelled", "generation_ended"]);
|
|
1001
|
+
|
|
1002
|
+
function d_EventPayloadCursorAdvance(value, path) {
|
|
1003
|
+
const map = object(value, path);
|
|
1004
|
+
const out = {};
|
|
1005
|
+
for (const [key, item] of map) {
|
|
1006
|
+
const at = `${path}/${key}`;
|
|
1007
|
+
switch (key) {
|
|
1008
|
+
default: unknown(at);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
return out;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
function d_Subscribe(value, path) {
|
|
1015
|
+
const map = object(value, path);
|
|
1016
|
+
need(map, path, ["v", "request_id", "filter", "schema_revision"]);
|
|
1017
|
+
const out = {};
|
|
1018
|
+
for (const [key, item] of map) {
|
|
1019
|
+
const at = `${path}/${key}`;
|
|
1020
|
+
switch (key) {
|
|
1021
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1022
|
+
case "request_id": out.request_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1023
|
+
case "filter": out.filter = d_SubscribeFilter(item, at); break;
|
|
1024
|
+
case "schema_revision": out.schema_revision = integer(item, at, 0n, 65535n, true); break;
|
|
1025
|
+
case "page_limit": out.page_limit = integer(item, at, 0n, 65535n, true); break;
|
|
1026
|
+
case "resume": out.resume = d_SubscribeResume(item, at); break;
|
|
1027
|
+
default: unknown(at);
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
return out;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
function d_SubscribeFilter(value, path) {
|
|
1034
|
+
const map = object(value, path);
|
|
1035
|
+
need(map, path, ["workspace_ids", "project_ids"]);
|
|
1036
|
+
const out = {};
|
|
1037
|
+
for (const [key, item] of map) {
|
|
1038
|
+
const at = `${path}/${key}`;
|
|
1039
|
+
switch (key) {
|
|
1040
|
+
case "workspace_ids": out.workspace_ids = list(item, at, 64, (v1, p1) => string(v1, p1, 1, 128, null, TOKEN)); break;
|
|
1041
|
+
case "project_ids": out.project_ids = list(item, at, 64, (v1, p1) => string(v1, p1, 1, 128, null, TOKEN)); break;
|
|
1042
|
+
default: unknown(at);
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
return out;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
function d_SubscribeResume(value, path) {
|
|
1049
|
+
const map = object(value, path);
|
|
1050
|
+
need(map, path, ["subscription_stream_id", "subscription_epoch", "resume_token", "last_delivery_sequence", "protocol_epoch"]);
|
|
1051
|
+
const out = {};
|
|
1052
|
+
for (const [key, item] of map) {
|
|
1053
|
+
const at = `${path}/${key}`;
|
|
1054
|
+
switch (key) {
|
|
1055
|
+
case "subscription_stream_id": out.subscription_stream_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1056
|
+
case "subscription_epoch": out.subscription_epoch = integer(item, at, 0n, null, false); break;
|
|
1057
|
+
case "resume_token": out.resume_token = string(item, at, 1, 512, null, TOKEN); break;
|
|
1058
|
+
case "last_delivery_sequence": out.last_delivery_sequence = integer(item, at, 0n, null, false); break;
|
|
1059
|
+
case "protocol_epoch": out.protocol_epoch = integer(item, at, 0n, null, false); break;
|
|
1060
|
+
default: unknown(at);
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
return out;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
function d_Snapshot(value, path) {
|
|
1067
|
+
const map = object(value, path);
|
|
1068
|
+
need(map, path, ["v", "request_id", "subscription_stream_id", "subscription_epoch", "source_cursor", "delivery_sequence", "page_index", "directory"]);
|
|
1069
|
+
const out = {};
|
|
1070
|
+
for (const [key, item] of map) {
|
|
1071
|
+
const at = `${path}/${key}`;
|
|
1072
|
+
switch (key) {
|
|
1073
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1074
|
+
case "request_id": out.request_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1075
|
+
case "subscription_stream_id": out.subscription_stream_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1076
|
+
case "subscription_epoch": out.subscription_epoch = integer(item, at, 0n, null, false); break;
|
|
1077
|
+
case "source_cursor": out.source_cursor = string(item, at, 1, 512, null, TOKEN); break;
|
|
1078
|
+
case "delivery_sequence": out.delivery_sequence = integer(item, at, 0n, null, false); break;
|
|
1079
|
+
case "page_index": out.page_index = integer(item, at, 0n, 4294967295n, true); break;
|
|
1080
|
+
case "directory": out.directory = d_LaneDirectoryProjection(item, at); break;
|
|
1081
|
+
case "resume_token": out.resume_token = string(item, at, 1, 512, null, TOKEN); break;
|
|
1082
|
+
default: unknown(at);
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
return out;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
function d_Resync(value, path) {
|
|
1089
|
+
const map = object(value, path);
|
|
1090
|
+
need(map, path, ["v", "subscription_stream_id", "reason"]);
|
|
1091
|
+
const out = {};
|
|
1092
|
+
for (const [key, item] of map) {
|
|
1093
|
+
const at = `${path}/${key}`;
|
|
1094
|
+
switch (key) {
|
|
1095
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1096
|
+
case "subscription_stream_id": out.subscription_stream_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1097
|
+
case "reason": out.reason = enumeration(item, at, E_ResyncReason); break;
|
|
1098
|
+
case "request_id": out.request_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1099
|
+
default: unknown(at);
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
return out;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
const E_ResyncReason = new Set(["delivery_gap", "cursor_expired", "subscription_epoch_changed", "protocol_epoch_changed", "authorization_changed", "filter_changed", "lagged", "resume_token_invalid"]);
|
|
1106
|
+
|
|
1107
|
+
function d_FrameRefusal(value, path) {
|
|
1108
|
+
const map = object(value, path);
|
|
1109
|
+
need(map, path, ["v", "code", "reason"]);
|
|
1110
|
+
const out = {};
|
|
1111
|
+
for (const [key, item] of map) {
|
|
1112
|
+
const at = `${path}/${key}`;
|
|
1113
|
+
switch (key) {
|
|
1114
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1115
|
+
case "code": out.code = enumeration(item, at, E_FrameRefusalCode); break;
|
|
1116
|
+
case "reason": out.reason = string(item, at, 1, 4096, 4096, TEXT); break;
|
|
1117
|
+
case "request_id": out.request_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1118
|
+
default: unknown(at);
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
return out;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
const E_FrameRefusalCode = new Set(["malformed", "frame_too_large", "too_deep", "invalid", "wrong_direction", "not_negotiated", "stale_epoch", "hello_after_negotiation", "expected_hello", "protocol_epoch_changed"]);
|
|
1125
|
+
|
|
1126
|
+
function d_RuntimeBinding(value, path) {
|
|
1127
|
+
const map = object(value, path);
|
|
1128
|
+
need(map, path, ["v", "product", "product_version", "install_id", "edge", "machine_id", "host_id", "boot_id", "session_id", "credential_source", "schema_epoch", "capability_epoch", "negotiated_operations"]);
|
|
1129
|
+
const out = {};
|
|
1130
|
+
for (const [key, item] of map) {
|
|
1131
|
+
const at = `${path}/${key}`;
|
|
1132
|
+
switch (key) {
|
|
1133
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1134
|
+
case "product": out.product = enumeration(item, at, E_RuntimeBindingProduct); break;
|
|
1135
|
+
case "product_version": out.product_version = string(item, at, 1, 64, null, TOKEN); break;
|
|
1136
|
+
case "install_id": out.install_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1137
|
+
case "edge": out.edge = d_RuntimeBindingEdge(item, at); break;
|
|
1138
|
+
case "machine_id": out.machine_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1139
|
+
case "host_id": out.host_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1140
|
+
case "boot_id": out.boot_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1141
|
+
case "session_id": out.session_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1142
|
+
case "credential_source": out.credential_source = d_RuntimeBindingCredentialSource(item, at); break;
|
|
1143
|
+
case "schema_epoch": out.schema_epoch = integer(item, at, 0n, null, false); break;
|
|
1144
|
+
case "capability_epoch": out.capability_epoch = integer(item, at, 0n, null, false); break;
|
|
1145
|
+
case "negotiated_operations": out.negotiated_operations = list(item, at, 64, d_RuntimeBindingNegotiatedOperationsItem); break;
|
|
1146
|
+
case "platform": out.platform = d_RuntimeBindingPlatform(item, at); break;
|
|
1147
|
+
default: unknown(at);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
return out;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
const E_RuntimeBindingProduct = new Set(["throttle_classic", "throttle_rc"]);
|
|
1154
|
+
|
|
1155
|
+
function d_RuntimeBindingEdge(value, path) {
|
|
1156
|
+
const map = object(value, path);
|
|
1157
|
+
need(map, path, ["endpoint_id", "authenticated_identity"]);
|
|
1158
|
+
const out = {};
|
|
1159
|
+
for (const [key, item] of map) {
|
|
1160
|
+
const at = `${path}/${key}`;
|
|
1161
|
+
switch (key) {
|
|
1162
|
+
case "endpoint_id": out.endpoint_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1163
|
+
case "authenticated_identity": out.authenticated_identity = string(item, at, 1, 128, null, TOKEN); break;
|
|
1164
|
+
default: unknown(at);
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
return out;
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
function d_RuntimeBindingCredentialSource(value, path) {
|
|
1171
|
+
const map = object(value, path);
|
|
1172
|
+
need(map, path, ["kind", "reference"]);
|
|
1173
|
+
const out = {};
|
|
1174
|
+
for (const [key, item] of map) {
|
|
1175
|
+
const at = `${path}/${key}`;
|
|
1176
|
+
switch (key) {
|
|
1177
|
+
case "kind": out.kind = string(item, at, 1, 64, null, TOKEN); break;
|
|
1178
|
+
case "reference": out.reference = string(item, at, 1, 128, null, TOKEN); break;
|
|
1179
|
+
default: unknown(at);
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
return out;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
function d_RuntimeBindingNegotiatedOperationsItem(value, path) {
|
|
1186
|
+
const map = object(value, path);
|
|
1187
|
+
need(map, path, ["capability", "version", "initiator"]);
|
|
1188
|
+
const out = {};
|
|
1189
|
+
for (const [key, item] of map) {
|
|
1190
|
+
const at = `${path}/${key}`;
|
|
1191
|
+
switch (key) {
|
|
1192
|
+
case "capability": out.capability = enumeration(item, at, E_RuntimeBindingNegotiatedOperationsItemCapability); break;
|
|
1193
|
+
case "version": out.version = integer(item, at, 0n, 65535n, true); break;
|
|
1194
|
+
case "initiator": out.initiator = enumeration(item, at, E_RuntimeBindingNegotiatedOperationsItemInitiator); break;
|
|
1195
|
+
default: unknown(at);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
return out;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
const E_RuntimeBindingNegotiatedOperationsItemCapability = new Set(["holder_view_mode", "prompt_observation", "atomic_prompt_answer", "verified_terminal_answer", "exact_focus_return", "independent_resize", "durable_command_query", "replay_horizon"]);
|
|
1202
|
+
|
|
1203
|
+
const E_RuntimeBindingNegotiatedOperationsItemInitiator = new Set(["client", "host"]);
|
|
1204
|
+
|
|
1205
|
+
function d_RuntimeBindingPlatform(value, path) {
|
|
1206
|
+
const map = object(value, path);
|
|
1207
|
+
need(map, path, ["endpoint_id", "authenticated_identity"]);
|
|
1208
|
+
const out = {};
|
|
1209
|
+
for (const [key, item] of map) {
|
|
1210
|
+
const at = `${path}/${key}`;
|
|
1211
|
+
switch (key) {
|
|
1212
|
+
case "endpoint_id": out.endpoint_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1213
|
+
case "authenticated_identity": out.authenticated_identity = string(item, at, 1, 128, null, TOKEN); break;
|
|
1214
|
+
default: unknown(at);
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
return out;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
function d_ExecutionBinding(value, path) {
|
|
1221
|
+
const map = object(value, path);
|
|
1222
|
+
need(map, path, ["v", "principal_id", "acting_lane", "workspace_id", "run_id", "owner_epoch", "native_generation", "lineage", "policy_revision", "grant_revision", "horizon_unix_ms", "allowed_routes", "allowed_models"]);
|
|
1223
|
+
const out = {};
|
|
1224
|
+
for (const [key, item] of map) {
|
|
1225
|
+
const at = `${path}/${key}`;
|
|
1226
|
+
switch (key) {
|
|
1227
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1228
|
+
case "principal_id": out.principal_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1229
|
+
case "acting_lane": out.acting_lane = d_ExecutionBindingActingLane(item, at); break;
|
|
1230
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1231
|
+
case "run_id": out.run_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1232
|
+
case "owner_epoch": out.owner_epoch = integer(item, at, 0n, null, false); break;
|
|
1233
|
+
case "native_generation": out.native_generation = string(item, at, 1, 128, null, TOKEN); break;
|
|
1234
|
+
case "lineage": out.lineage = d_ExecutionBindingLineage(item, at); break;
|
|
1235
|
+
case "policy_revision": out.policy_revision = integer(item, at, 0n, null, false); break;
|
|
1236
|
+
case "grant_revision": out.grant_revision = integer(item, at, 0n, null, false); break;
|
|
1237
|
+
case "horizon_unix_ms": out.horizon_unix_ms = integer(item, at, 0n, null, false); break;
|
|
1238
|
+
case "allowed_routes": out.allowed_routes = list(item, at, 64, (v1, p1) => string(v1, p1, 1, 64, null, TOKEN)); break;
|
|
1239
|
+
case "allowed_models": out.allowed_models = list(item, at, 64, (v1, p1) => string(v1, p1, 1, 64, null, TOKEN)); break;
|
|
1240
|
+
case "concurrency_authority": out.concurrency_authority = d_ExecutionBindingConcurrencyAuthority(item, at); break;
|
|
1241
|
+
case "project_id": out.project_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1242
|
+
case "responsibility_id": out.responsibility_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1243
|
+
case "spend_authority": out.spend_authority = d_ExecutionBindingSpendAuthority(item, at); break;
|
|
1244
|
+
default: unknown(at);
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
return out;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
function d_ExecutionBindingActingLane(value, path) {
|
|
1251
|
+
const map = object(value, path);
|
|
1252
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
1253
|
+
const out = {};
|
|
1254
|
+
for (const [key, item] of map) {
|
|
1255
|
+
const at = `${path}/${key}`;
|
|
1256
|
+
switch (key) {
|
|
1257
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
1258
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1259
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1260
|
+
default: unknown(at);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
return out;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
function d_ExecutionBindingLineage(value, path) {
|
|
1267
|
+
const map = object(value, path);
|
|
1268
|
+
need(map, path, ["kind", "root_run_id", "depth"]);
|
|
1269
|
+
const out = {};
|
|
1270
|
+
for (const [key, item] of map) {
|
|
1271
|
+
const at = `${path}/${key}`;
|
|
1272
|
+
switch (key) {
|
|
1273
|
+
case "kind": out.kind = enumeration(item, at, E_ExecutionBindingLineageKind); break;
|
|
1274
|
+
case "root_run_id": out.root_run_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1275
|
+
case "depth": out.depth = integer(item, at, 0n, 65535n, true); break;
|
|
1276
|
+
case "parent_run_id": out.parent_run_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1277
|
+
default: unknown(at);
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
return out;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
const E_ExecutionBindingLineageKind = new Set(["initial", "retry", "fallback", "child", "replacement", "resumed"]);
|
|
1284
|
+
|
|
1285
|
+
function d_ExecutionBindingConcurrencyAuthority(value, path) {
|
|
1286
|
+
const map = object(value, path);
|
|
1287
|
+
need(map, path, ["owner", "reference", "revision"]);
|
|
1288
|
+
const out = {};
|
|
1289
|
+
for (const [key, item] of map) {
|
|
1290
|
+
const at = `${path}/${key}`;
|
|
1291
|
+
switch (key) {
|
|
1292
|
+
case "owner": out.owner = enumeration(item, at, E_ExecutionBindingConcurrencyAuthorityOwner); break;
|
|
1293
|
+
case "reference": out.reference = string(item, at, 1, 128, null, TOKEN); break;
|
|
1294
|
+
case "revision": out.revision = integer(item, at, 0n, null, false); break;
|
|
1295
|
+
default: unknown(at);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
return out;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
const E_ExecutionBindingConcurrencyAuthorityOwner = new Set(["lanes_host", "native_holder", "throttle_edge", "throttle_messaging", "throttle_platform", "buildctl"]);
|
|
1302
|
+
|
|
1303
|
+
function d_ExecutionBindingSpendAuthority(value, path) {
|
|
1304
|
+
const map = object(value, path);
|
|
1305
|
+
need(map, path, ["owner", "reference", "revision"]);
|
|
1306
|
+
const out = {};
|
|
1307
|
+
for (const [key, item] of map) {
|
|
1308
|
+
const at = `${path}/${key}`;
|
|
1309
|
+
switch (key) {
|
|
1310
|
+
case "owner": out.owner = enumeration(item, at, E_ExecutionBindingSpendAuthorityOwner); break;
|
|
1311
|
+
case "reference": out.reference = string(item, at, 1, 128, null, TOKEN); break;
|
|
1312
|
+
case "revision": out.revision = integer(item, at, 0n, null, false); break;
|
|
1313
|
+
default: unknown(at);
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
return out;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
const E_ExecutionBindingSpendAuthorityOwner = new Set(["lanes_host", "native_holder", "throttle_edge", "throttle_messaging", "throttle_platform", "buildctl"]);
|
|
1320
|
+
|
|
1321
|
+
function d_OwnerOperationReceipt(value, path) {
|
|
1322
|
+
const map = object(value, path);
|
|
1323
|
+
need(map, path, ["v", "scope", "operation_id", "payload_digest", "owner", "custody", "effect", "uncertainty", "source_revision", "retry_horizon", "recovery", "evidence_refs"]);
|
|
1324
|
+
const out = {};
|
|
1325
|
+
for (const [key, item] of map) {
|
|
1326
|
+
const at = `${path}/${key}`;
|
|
1327
|
+
switch (key) {
|
|
1328
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1329
|
+
case "scope": out.scope = d_OwnerOperationReceiptScope(item, at); break;
|
|
1330
|
+
case "operation_id": out.operation_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1331
|
+
case "payload_digest": out.payload_digest = string(item, at, 71, 71, null, PAYLOAD_DIGEST); break;
|
|
1332
|
+
case "owner": out.owner = d_OwnerOperationReceiptOwner(item, at); break;
|
|
1333
|
+
case "custody": out.custody = enumeration(item, at, E_OwnerOperationReceiptCustody); break;
|
|
1334
|
+
case "effect": out.effect = enumeration(item, at, E_OwnerOperationReceiptEffect); break;
|
|
1335
|
+
case "uncertainty": out.uncertainty = enumeration(item, at, E_OwnerOperationReceiptUncertainty); break;
|
|
1336
|
+
case "source_revision": out.source_revision = integer(item, at, 0n, null, false); break;
|
|
1337
|
+
case "retry_horizon": out.retry_horizon = d_OwnerOperationReceiptRetryHorizon(item, at); break;
|
|
1338
|
+
case "recovery": out.recovery = d_OwnerOperationReceiptRecovery(item, at); break;
|
|
1339
|
+
case "evidence_refs": out.evidence_refs = list(item, at, 32, d_OwnerOperationReceiptEvidenceRefsItem); break;
|
|
1340
|
+
case "owner_operation_ref": out.owner_operation_ref = string(item, at, 1, 128, null, TOKEN); break;
|
|
1341
|
+
default: unknown(at);
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
return out;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
function d_OwnerOperationReceiptScope(value, path) {
|
|
1348
|
+
const map = object(value, path);
|
|
1349
|
+
need(map, path, ["principal", "kind"]);
|
|
1350
|
+
const out = {};
|
|
1351
|
+
for (const [key, item] of map) {
|
|
1352
|
+
const at = `${path}/${key}`;
|
|
1353
|
+
switch (key) {
|
|
1354
|
+
case "principal": out.principal = string(item, at, 1, 128, null, TOKEN); break;
|
|
1355
|
+
case "kind": out.kind = string(item, at, 1, 64, null, TOKEN); break;
|
|
1356
|
+
default: unknown(at);
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
return out;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
function d_OwnerOperationReceiptOwner(value, path) {
|
|
1363
|
+
const map = object(value, path);
|
|
1364
|
+
need(map, path, ["service", "instance_id"]);
|
|
1365
|
+
const out = {};
|
|
1366
|
+
for (const [key, item] of map) {
|
|
1367
|
+
const at = `${path}/${key}`;
|
|
1368
|
+
switch (key) {
|
|
1369
|
+
case "service": out.service = enumeration(item, at, E_OwnerOperationReceiptOwnerService); break;
|
|
1370
|
+
case "instance_id": out.instance_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1371
|
+
default: unknown(at);
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
return out;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
const E_OwnerOperationReceiptOwnerService = new Set(["lanes_host", "native_holder", "throttle_edge", "throttle_messaging", "throttle_platform", "buildctl"]);
|
|
1378
|
+
|
|
1379
|
+
const E_OwnerOperationReceiptCustody = new Set(["accepted", "refused", "conflict", "expired", "unknown"]);
|
|
1380
|
+
|
|
1381
|
+
const E_OwnerOperationReceiptEffect = new Set(["none", "delivery_attempted", "native_accepted", "recipient_acknowledged", "completed", "failed"]);
|
|
1382
|
+
|
|
1383
|
+
const E_OwnerOperationReceiptUncertainty = new Set(["certain", "possible_effect", "unknown_outcome"]);
|
|
1384
|
+
|
|
1385
|
+
function d_OwnerOperationReceiptRetryHorizon(value, path) {
|
|
1386
|
+
const map = object(value, path);
|
|
1387
|
+
need(map, path, ["epoch", "not_after_unix_ms"]);
|
|
1388
|
+
const out = {};
|
|
1389
|
+
for (const [key, item] of map) {
|
|
1390
|
+
const at = `${path}/${key}`;
|
|
1391
|
+
switch (key) {
|
|
1392
|
+
case "epoch": out.epoch = integer(item, at, 0n, null, false); break;
|
|
1393
|
+
case "not_after_unix_ms": out.not_after_unix_ms = integer(item, at, 0n, null, false); break;
|
|
1394
|
+
default: unknown(at);
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
return out;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
function d_OwnerOperationReceiptRecovery(value, path) {
|
|
1401
|
+
const map = object(value, path);
|
|
1402
|
+
need(map, path, ["method", "reference"]);
|
|
1403
|
+
const out = {};
|
|
1404
|
+
for (const [key, item] of map) {
|
|
1405
|
+
const at = `${path}/${key}`;
|
|
1406
|
+
switch (key) {
|
|
1407
|
+
case "method": out.method = enumeration(item, at, E_OwnerOperationReceiptRecoveryMethod); break;
|
|
1408
|
+
case "reference": out.reference = string(item, at, 1, 128, null, TOKEN); break;
|
|
1409
|
+
default: unknown(at);
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
return out;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
const E_OwnerOperationReceiptRecoveryMethod = new Set(["by_operation_id", "by_owner_reference"]);
|
|
1416
|
+
|
|
1417
|
+
function d_OwnerOperationReceiptEvidenceRefsItem(value, path) {
|
|
1418
|
+
const map = object(value, path);
|
|
1419
|
+
need(map, path, ["witness", "reference"]);
|
|
1420
|
+
const out = {};
|
|
1421
|
+
for (const [key, item] of map) {
|
|
1422
|
+
const at = `${path}/${key}`;
|
|
1423
|
+
switch (key) {
|
|
1424
|
+
case "witness": out.witness = string(item, at, 1, 64, null, TOKEN); break;
|
|
1425
|
+
case "reference": out.reference = string(item, at, 1, 128, null, TOKEN); break;
|
|
1426
|
+
case "target_generation": out.target_generation = string(item, at, 1, 128, null, TOKEN); break;
|
|
1427
|
+
default: unknown(at);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
return out;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
function d_OperationTombstone(value, path) {
|
|
1434
|
+
const map = object(value, path);
|
|
1435
|
+
need(map, path, ["v", "scope", "operation_id", "retry_epoch", "payload_digest", "owner", "final_custody", "retained_until_unix_ms"]);
|
|
1436
|
+
const out = {};
|
|
1437
|
+
for (const [key, item] of map) {
|
|
1438
|
+
const at = `${path}/${key}`;
|
|
1439
|
+
switch (key) {
|
|
1440
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1441
|
+
case "scope": out.scope = d_OperationTombstoneScope(item, at); break;
|
|
1442
|
+
case "operation_id": out.operation_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1443
|
+
case "retry_epoch": out.retry_epoch = integer(item, at, 0n, null, false); break;
|
|
1444
|
+
case "payload_digest": out.payload_digest = string(item, at, 71, 71, null, PAYLOAD_DIGEST); break;
|
|
1445
|
+
case "owner": out.owner = d_OperationTombstoneOwner(item, at); break;
|
|
1446
|
+
case "final_custody": out.final_custody = enumeration(item, at, E_OperationTombstoneFinalCustody); break;
|
|
1447
|
+
case "retained_until_unix_ms": out.retained_until_unix_ms = integer(item, at, 0n, null, false); break;
|
|
1448
|
+
case "owner_operation_ref": out.owner_operation_ref = string(item, at, 1, 128, null, TOKEN); break;
|
|
1449
|
+
default: unknown(at);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
return out;
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
function d_OperationTombstoneScope(value, path) {
|
|
1456
|
+
const map = object(value, path);
|
|
1457
|
+
need(map, path, ["principal", "kind"]);
|
|
1458
|
+
const out = {};
|
|
1459
|
+
for (const [key, item] of map) {
|
|
1460
|
+
const at = `${path}/${key}`;
|
|
1461
|
+
switch (key) {
|
|
1462
|
+
case "principal": out.principal = string(item, at, 1, 128, null, TOKEN); break;
|
|
1463
|
+
case "kind": out.kind = string(item, at, 1, 64, null, TOKEN); break;
|
|
1464
|
+
default: unknown(at);
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
return out;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
function d_OperationTombstoneOwner(value, path) {
|
|
1471
|
+
const map = object(value, path);
|
|
1472
|
+
need(map, path, ["service", "instance_id"]);
|
|
1473
|
+
const out = {};
|
|
1474
|
+
for (const [key, item] of map) {
|
|
1475
|
+
const at = `${path}/${key}`;
|
|
1476
|
+
switch (key) {
|
|
1477
|
+
case "service": out.service = enumeration(item, at, E_OperationTombstoneOwnerService); break;
|
|
1478
|
+
case "instance_id": out.instance_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1479
|
+
default: unknown(at);
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
return out;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
const E_OperationTombstoneOwnerService = new Set(["lanes_host", "native_holder", "throttle_edge", "throttle_messaging", "throttle_platform", "buildctl"]);
|
|
1486
|
+
|
|
1487
|
+
const E_OperationTombstoneFinalCustody = new Set(["accepted", "refused", "conflict", "expired", "unknown"]);
|
|
1488
|
+
|
|
1489
|
+
function d_RetryHorizon(value, path) {
|
|
1490
|
+
const map = object(value, path);
|
|
1491
|
+
need(map, path, ["v", "current_epoch", "oldest_accepted_epoch", "oldest_accepted_epoch_started_unix_ms", "receipt_retention_ms", "tombstone_retention_ms"]);
|
|
1492
|
+
const out = {};
|
|
1493
|
+
for (const [key, item] of map) {
|
|
1494
|
+
const at = `${path}/${key}`;
|
|
1495
|
+
switch (key) {
|
|
1496
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1497
|
+
case "current_epoch": out.current_epoch = integer(item, at, 0n, null, false); break;
|
|
1498
|
+
case "oldest_accepted_epoch": out.oldest_accepted_epoch = integer(item, at, 0n, null, false); break;
|
|
1499
|
+
case "oldest_accepted_epoch_started_unix_ms": out.oldest_accepted_epoch_started_unix_ms = integer(item, at, 0n, null, false); break;
|
|
1500
|
+
case "receipt_retention_ms": out.receipt_retention_ms = integer(item, at, 0n, null, false); break;
|
|
1501
|
+
case "tombstone_retention_ms": out.tombstone_retention_ms = integer(item, at, 0n, null, false); break;
|
|
1502
|
+
default: unknown(at);
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
return out;
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
function d_SourceUpdate(value, path) {
|
|
1509
|
+
const map = object(value, path);
|
|
1510
|
+
need(map, path, ["v", "owner", "runtime_instance_id", "scope", "source_revision", "cursor", "observed_at_unix_ms", "freshness", "coverage"]);
|
|
1511
|
+
const out = {};
|
|
1512
|
+
for (const [key, item] of map) {
|
|
1513
|
+
const at = `${path}/${key}`;
|
|
1514
|
+
switch (key) {
|
|
1515
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1516
|
+
case "owner": out.owner = enumeration(item, at, E_SourceUpdateOwner); break;
|
|
1517
|
+
case "runtime_instance_id": out.runtime_instance_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1518
|
+
case "scope": out.scope = d_SourceUpdateScope(item, at); break;
|
|
1519
|
+
case "source_revision": out.source_revision = integer(item, at, 0n, null, false); break;
|
|
1520
|
+
case "cursor": out.cursor = string(item, at, 1, 512, null, TOKEN); break;
|
|
1521
|
+
case "observed_at_unix_ms": out.observed_at_unix_ms = integer(item, at, 0n, null, false); break;
|
|
1522
|
+
case "freshness": out.freshness = enumeration(item, at, E_SourceUpdateFreshness); break;
|
|
1523
|
+
case "coverage": out.coverage = d_SourceUpdateCoverage(item, at); break;
|
|
1524
|
+
case "native_generation": out.native_generation = string(item, at, 1, 128, null, TOKEN); break;
|
|
1525
|
+
case "run_id": out.run_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1526
|
+
default: unknown(at);
|
|
1527
|
+
}
|
|
1528
|
+
}
|
|
1529
|
+
return out;
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
const E_SourceUpdateOwner = new Set(["lanes_host", "native_holder", "throttle_edge", "throttle_messaging", "throttle_platform", "buildctl"]);
|
|
1533
|
+
|
|
1534
|
+
function d_SourceUpdateScope(value, path) {
|
|
1535
|
+
const map = object(value, path);
|
|
1536
|
+
need(map, path, ["principal_id", "workspace_ids", "authorization_epoch"]);
|
|
1537
|
+
const out = {};
|
|
1538
|
+
for (const [key, item] of map) {
|
|
1539
|
+
const at = `${path}/${key}`;
|
|
1540
|
+
switch (key) {
|
|
1541
|
+
case "principal_id": out.principal_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1542
|
+
case "workspace_ids": out.workspace_ids = list(item, at, 64, (v1, p1) => string(v1, p1, 1, 128, null, TOKEN)); break;
|
|
1543
|
+
case "authorization_epoch": out.authorization_epoch = integer(item, at, 0n, null, false); break;
|
|
1544
|
+
default: unknown(at);
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
return out;
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
const E_SourceUpdateFreshness = new Set(["fresh", "stale", "unknown"]);
|
|
1551
|
+
|
|
1552
|
+
function d_SourceUpdateCoverage(value, path) {
|
|
1553
|
+
const map = object(value, path);
|
|
1554
|
+
need(map, path, ["state", "missing"]);
|
|
1555
|
+
const out = {};
|
|
1556
|
+
for (const [key, item] of map) {
|
|
1557
|
+
const at = `${path}/${key}`;
|
|
1558
|
+
switch (key) {
|
|
1559
|
+
case "state": out.state = enumeration(item, at, E_SourceUpdateCoverageState); break;
|
|
1560
|
+
case "missing": out.missing = list(item, at, 64, (v1, p1) => string(v1, p1, 1, 64, null, TOKEN)); break;
|
|
1561
|
+
default: unknown(at);
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
return out;
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
const E_SourceUpdateCoverageState = new Set(["complete", "partial", "unknown"]);
|
|
1568
|
+
|
|
1569
|
+
function d_AdapterCapability(value, path) {
|
|
1570
|
+
const map = object(value, path);
|
|
1571
|
+
need(map, path, ["v", "adapter", "adapter_version", "qualification", "observe", "attach", "resume", "send", "answer", "cancel", "recover", "schemas", "limits"]);
|
|
1572
|
+
const out = {};
|
|
1573
|
+
for (const [key, item] of map) {
|
|
1574
|
+
const at = `${path}/${key}`;
|
|
1575
|
+
switch (key) {
|
|
1576
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1577
|
+
case "adapter": out.adapter = string(item, at, 1, 64, null, TOKEN); break;
|
|
1578
|
+
case "adapter_version": out.adapter_version = string(item, at, 1, 64, null, TOKEN); break;
|
|
1579
|
+
case "qualification": out.qualification = string(item, at, 1, 128, null, TOKEN); break;
|
|
1580
|
+
case "observe": out.observe = enumeration(item, at, E_AdapterCapabilityObserve); break;
|
|
1581
|
+
case "attach": out.attach = enumeration(item, at, E_AdapterCapabilityAttach); break;
|
|
1582
|
+
case "resume": out.resume = enumeration(item, at, E_AdapterCapabilityResume); break;
|
|
1583
|
+
case "send": out.send = enumeration(item, at, E_AdapterCapabilitySend); break;
|
|
1584
|
+
case "answer": out.answer = d_AdapterCapabilityAnswer(item, at); break;
|
|
1585
|
+
case "cancel": out.cancel = enumeration(item, at, E_AdapterCapabilityCancel); break;
|
|
1586
|
+
case "recover": out.recover = enumeration(item, at, E_AdapterCapabilityRecover); break;
|
|
1587
|
+
case "schemas": out.schemas = list(item, at, 64, d_AdapterCapabilitySchemasItem); break;
|
|
1588
|
+
case "limits": out.limits = d_AdapterCapabilityLimits(item, at); break;
|
|
1589
|
+
default: unknown(at);
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
return out;
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
const E_AdapterCapabilityObserve = new Set(["unsupported", "supported", "qualified"]);
|
|
1596
|
+
|
|
1597
|
+
const E_AdapterCapabilityAttach = new Set(["unsupported", "supported", "qualified"]);
|
|
1598
|
+
|
|
1599
|
+
const E_AdapterCapabilityResume = new Set(["unsupported", "supported", "qualified"]);
|
|
1600
|
+
|
|
1601
|
+
const E_AdapterCapabilitySend = new Set(["unsupported", "supported", "qualified"]);
|
|
1602
|
+
|
|
1603
|
+
function d_AdapterCapabilityAnswer(value, path) {
|
|
1604
|
+
const map = object(value, path);
|
|
1605
|
+
need(map, path, ["atomic_prompt_answer", "verified_terminal_answer"]);
|
|
1606
|
+
const out = {};
|
|
1607
|
+
for (const [key, item] of map) {
|
|
1608
|
+
const at = `${path}/${key}`;
|
|
1609
|
+
switch (key) {
|
|
1610
|
+
case "atomic_prompt_answer": out.atomic_prompt_answer = enumeration(item, at, E_AdapterCapabilityAnswerAtomicPromptAnswer); break;
|
|
1611
|
+
case "verified_terminal_answer": out.verified_terminal_answer = enumeration(item, at, E_AdapterCapabilityAnswerVerifiedTerminalAnswer); break;
|
|
1612
|
+
default: unknown(at);
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
return out;
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
const E_AdapterCapabilityAnswerAtomicPromptAnswer = new Set(["unsupported", "supported", "qualified"]);
|
|
1619
|
+
|
|
1620
|
+
const E_AdapterCapabilityAnswerVerifiedTerminalAnswer = new Set(["unsupported", "supported", "qualified"]);
|
|
1621
|
+
|
|
1622
|
+
const E_AdapterCapabilityCancel = new Set(["unsupported", "supported", "qualified"]);
|
|
1623
|
+
|
|
1624
|
+
const E_AdapterCapabilityRecover = new Set(["unsupported", "supported", "qualified"]);
|
|
1625
|
+
|
|
1626
|
+
function d_AdapterCapabilitySchemasItem(value, path) {
|
|
1627
|
+
const map = object(value, path);
|
|
1628
|
+
need(map, path, ["name", "version"]);
|
|
1629
|
+
const out = {};
|
|
1630
|
+
for (const [key, item] of map) {
|
|
1631
|
+
const at = `${path}/${key}`;
|
|
1632
|
+
switch (key) {
|
|
1633
|
+
case "name": out.name = string(item, at, 1, 64, null, TOKEN); break;
|
|
1634
|
+
case "version": out.version = integer(item, at, 0n, 65535n, true); break;
|
|
1635
|
+
default: unknown(at);
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
return out;
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
function d_AdapterCapabilityLimits(value, path) {
|
|
1642
|
+
const map = object(value, path);
|
|
1643
|
+
need(map, path, ["max_input_bytes", "max_answer_options", "max_concurrent_operations"]);
|
|
1644
|
+
const out = {};
|
|
1645
|
+
for (const [key, item] of map) {
|
|
1646
|
+
const at = `${path}/${key}`;
|
|
1647
|
+
switch (key) {
|
|
1648
|
+
case "max_input_bytes": out.max_input_bytes = integer(item, at, 0n, 4294967295n, true); break;
|
|
1649
|
+
case "max_answer_options": out.max_answer_options = integer(item, at, 0n, 65535n, true); break;
|
|
1650
|
+
case "max_concurrent_operations": out.max_concurrent_operations = integer(item, at, 0n, 65535n, true); break;
|
|
1651
|
+
default: unknown(at);
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
return out;
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
function d_LaneDirectoryProjection(value, path) {
|
|
1658
|
+
const map = object(value, path);
|
|
1659
|
+
need(map, path, ["v", "scope", "directory_revision", "schema_revision", "presentation_revision", "filter", "sources", "completeness", "counts", "rows"]);
|
|
1660
|
+
const out = {};
|
|
1661
|
+
for (const [key, item] of map) {
|
|
1662
|
+
const at = `${path}/${key}`;
|
|
1663
|
+
switch (key) {
|
|
1664
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1665
|
+
case "scope": out.scope = d_LaneDirectoryProjectionScope(item, at); break;
|
|
1666
|
+
case "directory_revision": out.directory_revision = integer(item, at, 0n, null, false); break;
|
|
1667
|
+
case "schema_revision": out.schema_revision = integer(item, at, 0n, 65535n, true); break;
|
|
1668
|
+
case "presentation_revision": out.presentation_revision = integer(item, at, 0n, null, false); break;
|
|
1669
|
+
case "filter": out.filter = d_LaneDirectoryProjectionFilter(item, at); break;
|
|
1670
|
+
case "sources": out.sources = list(item, at, 64, d_LaneDirectoryProjectionSourcesItem); break;
|
|
1671
|
+
case "completeness": out.completeness = enumeration(item, at, E_LaneDirectoryProjectionCompleteness); break;
|
|
1672
|
+
case "counts": out.counts = d_LaneDirectoryProjectionCounts(item, at); break;
|
|
1673
|
+
case "rows": out.rows = list(item, at, 500, d_LaneDirectoryRow); break;
|
|
1674
|
+
case "next_page": out.next_page = string(item, at, 1, 512, null, TOKEN); break;
|
|
1675
|
+
default: unknown(at);
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
return out;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
function d_LaneDirectoryProjectionScope(value, path) {
|
|
1682
|
+
const map = object(value, path);
|
|
1683
|
+
need(map, path, ["principal_id", "authorization_epoch", "runtime_instance_id"]);
|
|
1684
|
+
const out = {};
|
|
1685
|
+
for (const [key, item] of map) {
|
|
1686
|
+
const at = `${path}/${key}`;
|
|
1687
|
+
switch (key) {
|
|
1688
|
+
case "principal_id": out.principal_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1689
|
+
case "authorization_epoch": out.authorization_epoch = integer(item, at, 0n, null, false); break;
|
|
1690
|
+
case "runtime_instance_id": out.runtime_instance_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1691
|
+
default: unknown(at);
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
return out;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
function d_LaneDirectoryProjectionFilter(value, path) {
|
|
1698
|
+
const map = object(value, path);
|
|
1699
|
+
need(map, path, ["workspace_ids", "project_ids"]);
|
|
1700
|
+
const out = {};
|
|
1701
|
+
for (const [key, item] of map) {
|
|
1702
|
+
const at = `${path}/${key}`;
|
|
1703
|
+
switch (key) {
|
|
1704
|
+
case "workspace_ids": out.workspace_ids = list(item, at, 64, (v1, p1) => string(v1, p1, 1, 128, null, TOKEN)); break;
|
|
1705
|
+
case "project_ids": out.project_ids = list(item, at, 64, (v1, p1) => string(v1, p1, 1, 128, null, TOKEN)); break;
|
|
1706
|
+
default: unknown(at);
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
return out;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
function d_LaneDirectoryProjectionSourcesItem(value, path) {
|
|
1713
|
+
const map = object(value, path);
|
|
1714
|
+
need(map, path, ["owner", "runtime_instance_id", "cursor", "revision", "freshness", "observed_at_unix_ms"]);
|
|
1715
|
+
const out = {};
|
|
1716
|
+
for (const [key, item] of map) {
|
|
1717
|
+
const at = `${path}/${key}`;
|
|
1718
|
+
switch (key) {
|
|
1719
|
+
case "owner": out.owner = enumeration(item, at, E_LaneDirectoryProjectionSourcesItemOwner); break;
|
|
1720
|
+
case "runtime_instance_id": out.runtime_instance_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1721
|
+
case "cursor": out.cursor = string(item, at, 1, 512, null, TOKEN); break;
|
|
1722
|
+
case "revision": out.revision = integer(item, at, 0n, null, false); break;
|
|
1723
|
+
case "freshness": out.freshness = enumeration(item, at, E_LaneDirectoryProjectionSourcesItemFreshness); break;
|
|
1724
|
+
case "observed_at_unix_ms": out.observed_at_unix_ms = integer(item, at, 0n, null, false); break;
|
|
1725
|
+
default: unknown(at);
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
return out;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
const E_LaneDirectoryProjectionSourcesItemOwner = new Set(["lanes_host", "native_holder", "throttle_edge", "throttle_messaging", "throttle_platform", "buildctl"]);
|
|
1732
|
+
|
|
1733
|
+
const E_LaneDirectoryProjectionSourcesItemFreshness = new Set(["fresh", "stale", "unknown"]);
|
|
1734
|
+
|
|
1735
|
+
const E_LaneDirectoryProjectionCompleteness = new Set(["complete", "incomplete"]);
|
|
1736
|
+
|
|
1737
|
+
function d_LaneDirectoryProjectionCounts(value, path) {
|
|
1738
|
+
const map = object(value, path);
|
|
1739
|
+
need(map, path, ["total", "needs_you", "working", "done_unseen"]);
|
|
1740
|
+
const out = {};
|
|
1741
|
+
for (const [key, item] of map) {
|
|
1742
|
+
const at = `${path}/${key}`;
|
|
1743
|
+
switch (key) {
|
|
1744
|
+
case "total": out.total = integer(item, at, 0n, 4294967295n, true); break;
|
|
1745
|
+
case "needs_you": out.needs_you = integer(item, at, 0n, 4294967295n, true); break;
|
|
1746
|
+
case "working": out.working = integer(item, at, 0n, 4294967295n, true); break;
|
|
1747
|
+
case "done_unseen": out.done_unseen = integer(item, at, 0n, 4294967295n, true); break;
|
|
1748
|
+
default: unknown(at);
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
return out;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
function d_LaneDirectoryRow(value, path) {
|
|
1755
|
+
const map = object(value, path);
|
|
1756
|
+
need(map, path, ["v", "lane", "memberships", "label", "activity", "attention", "section", "last_activity_unix_ms", "style_token", "source", "actions"]);
|
|
1757
|
+
const out = {};
|
|
1758
|
+
for (const [key, item] of map) {
|
|
1759
|
+
const at = `${path}/${key}`;
|
|
1760
|
+
switch (key) {
|
|
1761
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1762
|
+
case "lane": out.lane = d_LaneDirectoryRowLane(item, at); break;
|
|
1763
|
+
case "memberships": out.memberships = list(item, at, 64, d_LaneDirectoryRowMembershipsItem); break;
|
|
1764
|
+
case "label": out.label = string(item, at, 1, 256, 256, TEXT); break;
|
|
1765
|
+
case "activity": out.activity = enumeration(item, at, E_LaneDirectoryRowActivity); break;
|
|
1766
|
+
case "attention": out.attention = enumeration(item, at, E_LaneDirectoryRowAttention); break;
|
|
1767
|
+
case "section": out.section = enumeration(item, at, E_LaneDirectoryRowSection); break;
|
|
1768
|
+
case "last_activity_unix_ms": out.last_activity_unix_ms = integer(item, at, 0n, null, false); break;
|
|
1769
|
+
case "style_token": out.style_token = string(item, at, 1, 64, null, TOKEN); break;
|
|
1770
|
+
case "source": out.source = d_LaneDirectoryRowSource(item, at); break;
|
|
1771
|
+
case "actions": out.actions = list(item, at, 64, d_LaneDirectoryRowActionsItem); break;
|
|
1772
|
+
case "native_binding": out.native_binding = d_LaneDirectoryRowNativeBinding(item, at); break;
|
|
1773
|
+
default: unknown(at);
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
return out;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
function d_LaneDirectoryRowLane(value, path) {
|
|
1780
|
+
const map = object(value, path);
|
|
1781
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
1782
|
+
const out = {};
|
|
1783
|
+
for (const [key, item] of map) {
|
|
1784
|
+
const at = `${path}/${key}`;
|
|
1785
|
+
switch (key) {
|
|
1786
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
1787
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1788
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1789
|
+
default: unknown(at);
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
return out;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
function d_LaneDirectoryRowMembershipsItem(value, path) {
|
|
1796
|
+
const map = object(value, path);
|
|
1797
|
+
need(map, path, ["workspace_id"]);
|
|
1798
|
+
const out = {};
|
|
1799
|
+
for (const [key, item] of map) {
|
|
1800
|
+
const at = `${path}/${key}`;
|
|
1801
|
+
switch (key) {
|
|
1802
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1803
|
+
case "project_id": out.project_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1804
|
+
default: unknown(at);
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
return out;
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
const E_LaneDirectoryRowActivity = new Set(["working", "delegating", "waiting_build", "waiting_capacity", "waiting_person", "disconnected", "stale", "finished", "stopped"]);
|
|
1811
|
+
|
|
1812
|
+
const E_LaneDirectoryRowAttention = new Set(["none", "approval", "actionable_error", "input"]);
|
|
1813
|
+
|
|
1814
|
+
const E_LaneDirectoryRowSection = new Set(["needs_you", "working", "done_unseen", "remaining", "unregistered"]);
|
|
1815
|
+
|
|
1816
|
+
function d_LaneDirectoryRowSource(value, path) {
|
|
1817
|
+
const map = object(value, path);
|
|
1818
|
+
need(map, path, ["owner", "revision", "freshness"]);
|
|
1819
|
+
const out = {};
|
|
1820
|
+
for (const [key, item] of map) {
|
|
1821
|
+
const at = `${path}/${key}`;
|
|
1822
|
+
switch (key) {
|
|
1823
|
+
case "owner": out.owner = enumeration(item, at, E_LaneDirectoryRowSourceOwner); break;
|
|
1824
|
+
case "revision": out.revision = integer(item, at, 0n, null, false); break;
|
|
1825
|
+
case "freshness": out.freshness = enumeration(item, at, E_LaneDirectoryRowSourceFreshness); break;
|
|
1826
|
+
default: unknown(at);
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
return out;
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
const E_LaneDirectoryRowSourceOwner = new Set(["lanes_host", "native_holder", "throttle_edge", "throttle_messaging", "throttle_platform", "buildctl"]);
|
|
1833
|
+
|
|
1834
|
+
const E_LaneDirectoryRowSourceFreshness = new Set(["fresh", "stale", "unknown"]);
|
|
1835
|
+
|
|
1836
|
+
function d_LaneDirectoryRowActionsItem(value, path) {
|
|
1837
|
+
const map = object(value, path);
|
|
1838
|
+
need(map, path, ["action", "availability"]);
|
|
1839
|
+
const out = {};
|
|
1840
|
+
for (const [key, item] of map) {
|
|
1841
|
+
const at = `${path}/${key}`;
|
|
1842
|
+
switch (key) {
|
|
1843
|
+
case "action": out.action = string(item, at, 1, 64, null, TOKEN); break;
|
|
1844
|
+
case "availability": out.availability = enumeration(item, at, E_LaneDirectoryRowActionsItemAvailability); break;
|
|
1845
|
+
case "reason": out.reason = string(item, at, 1, 256, 256, TEXT); break;
|
|
1846
|
+
default: unknown(at);
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
return out;
|
|
1850
|
+
}
|
|
1851
|
+
|
|
1852
|
+
const E_LaneDirectoryRowActionsItemAvailability = new Set(["available", "unsupported", "unconfigured", "unauthorized", "unqualified", "unhealthy"]);
|
|
1853
|
+
|
|
1854
|
+
function d_LaneDirectoryRowNativeBinding(value, path) {
|
|
1855
|
+
const map = object(value, path);
|
|
1856
|
+
need(map, path, ["runtime_instance_id", "native_generation", "backend"]);
|
|
1857
|
+
const out = {};
|
|
1858
|
+
for (const [key, item] of map) {
|
|
1859
|
+
const at = `${path}/${key}`;
|
|
1860
|
+
switch (key) {
|
|
1861
|
+
case "runtime_instance_id": out.runtime_instance_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1862
|
+
case "native_generation": out.native_generation = string(item, at, 1, 128, null, TOKEN); break;
|
|
1863
|
+
case "backend": out.backend = enumeration(item, at, E_LaneDirectoryRowNativeBindingBackend); break;
|
|
1864
|
+
default: unknown(at);
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
return out;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
const E_LaneDirectoryRowNativeBindingBackend = new Set(["tmux", "zellij", "zmx", "exec", "ssh"]);
|
|
1871
|
+
|
|
1872
|
+
function d_PrincipalPresentationPreferences(value, path) {
|
|
1873
|
+
const map = object(value, path);
|
|
1874
|
+
need(map, path, ["v", "principal_id", "revision", "pinned", "hidden", "viewed_done", "board_order", "theme"]);
|
|
1875
|
+
const out = {};
|
|
1876
|
+
for (const [key, item] of map) {
|
|
1877
|
+
const at = `${path}/${key}`;
|
|
1878
|
+
switch (key) {
|
|
1879
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
1880
|
+
case "principal_id": out.principal_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1881
|
+
case "revision": out.revision = integer(item, at, 0n, null, false); break;
|
|
1882
|
+
case "pinned": out.pinned = list(item, at, 640, d_PrincipalPresentationPreferencesPinnedItem); break;
|
|
1883
|
+
case "hidden": out.hidden = list(item, at, 640, d_PrincipalPresentationPreferencesHiddenItem); break;
|
|
1884
|
+
case "viewed_done": out.viewed_done = list(item, at, 640, d_PrincipalPresentationPreferencesViewedDoneItem); break;
|
|
1885
|
+
case "board_order": out.board_order = list(item, at, 640, d_PrincipalPresentationPreferencesBoardOrderItem); break;
|
|
1886
|
+
case "theme": out.theme = d_PrincipalPresentationPreferencesTheme(item, at); break;
|
|
1887
|
+
case "resume": out.resume = d_PrincipalPresentationPreferencesResume(item, at); break;
|
|
1888
|
+
default: unknown(at);
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
return out;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
function d_PrincipalPresentationPreferencesPinnedItem(value, path) {
|
|
1895
|
+
const map = object(value, path);
|
|
1896
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
1897
|
+
const out = {};
|
|
1898
|
+
for (const [key, item] of map) {
|
|
1899
|
+
const at = `${path}/${key}`;
|
|
1900
|
+
switch (key) {
|
|
1901
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
1902
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1903
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1904
|
+
default: unknown(at);
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
return out;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
function d_PrincipalPresentationPreferencesHiddenItem(value, path) {
|
|
1911
|
+
const map = object(value, path);
|
|
1912
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
1913
|
+
const out = {};
|
|
1914
|
+
for (const [key, item] of map) {
|
|
1915
|
+
const at = `${path}/${key}`;
|
|
1916
|
+
switch (key) {
|
|
1917
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
1918
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1919
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1920
|
+
default: unknown(at);
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
return out;
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
function d_PrincipalPresentationPreferencesViewedDoneItem(value, path) {
|
|
1927
|
+
const map = object(value, path);
|
|
1928
|
+
need(map, path, ["lane", "done_revision"]);
|
|
1929
|
+
const out = {};
|
|
1930
|
+
for (const [key, item] of map) {
|
|
1931
|
+
const at = `${path}/${key}`;
|
|
1932
|
+
switch (key) {
|
|
1933
|
+
case "lane": out.lane = d_PrincipalPresentationPreferencesViewedDoneItemLane(item, at); break;
|
|
1934
|
+
case "done_revision": out.done_revision = integer(item, at, 0n, null, false); break;
|
|
1935
|
+
default: unknown(at);
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
return out;
|
|
1939
|
+
}
|
|
1940
|
+
|
|
1941
|
+
function d_PrincipalPresentationPreferencesViewedDoneItemLane(value, path) {
|
|
1942
|
+
const map = object(value, path);
|
|
1943
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
1944
|
+
const out = {};
|
|
1945
|
+
for (const [key, item] of map) {
|
|
1946
|
+
const at = `${path}/${key}`;
|
|
1947
|
+
switch (key) {
|
|
1948
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
1949
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1950
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1951
|
+
default: unknown(at);
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
return out;
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
function d_PrincipalPresentationPreferencesBoardOrderItem(value, path) {
|
|
1958
|
+
const map = object(value, path);
|
|
1959
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
1960
|
+
const out = {};
|
|
1961
|
+
for (const [key, item] of map) {
|
|
1962
|
+
const at = `${path}/${key}`;
|
|
1963
|
+
switch (key) {
|
|
1964
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
1965
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1966
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1967
|
+
default: unknown(at);
|
|
1968
|
+
}
|
|
1969
|
+
}
|
|
1970
|
+
return out;
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
function d_PrincipalPresentationPreferencesTheme(value, path) {
|
|
1974
|
+
const map = object(value, path);
|
|
1975
|
+
need(map, path, ["theme_id", "theme_revision"]);
|
|
1976
|
+
const out = {};
|
|
1977
|
+
for (const [key, item] of map) {
|
|
1978
|
+
const at = `${path}/${key}`;
|
|
1979
|
+
switch (key) {
|
|
1980
|
+
case "theme_id": out.theme_id = string(item, at, 1, 64, null, TOKEN); break;
|
|
1981
|
+
case "theme_revision": out.theme_revision = integer(item, at, 0n, null, false); break;
|
|
1982
|
+
default: unknown(at);
|
|
1983
|
+
}
|
|
1984
|
+
}
|
|
1985
|
+
return out;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
function d_PrincipalPresentationPreferencesResume(value, path) {
|
|
1989
|
+
const map = object(value, path);
|
|
1990
|
+
need(map, path, ["lane", "revision"]);
|
|
1991
|
+
const out = {};
|
|
1992
|
+
for (const [key, item] of map) {
|
|
1993
|
+
const at = `${path}/${key}`;
|
|
1994
|
+
switch (key) {
|
|
1995
|
+
case "lane": out.lane = d_PrincipalPresentationPreferencesResumeLane(item, at); break;
|
|
1996
|
+
case "revision": out.revision = integer(item, at, 0n, null, false); break;
|
|
1997
|
+
case "record_id": out.record_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
1998
|
+
default: unknown(at);
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
return out;
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
function d_PrincipalPresentationPreferencesResumeLane(value, path) {
|
|
2005
|
+
const map = object(value, path);
|
|
2006
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
2007
|
+
const out = {};
|
|
2008
|
+
for (const [key, item] of map) {
|
|
2009
|
+
const at = `${path}/${key}`;
|
|
2010
|
+
switch (key) {
|
|
2011
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
2012
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2013
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2014
|
+
default: unknown(at);
|
|
2015
|
+
}
|
|
2016
|
+
}
|
|
2017
|
+
return out;
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
function d_PreferencesUpdate(value, path) {
|
|
2021
|
+
const map = object(value, path);
|
|
2022
|
+
need(map, path, ["v", "expected_revision", "preferences"]);
|
|
2023
|
+
const out = {};
|
|
2024
|
+
for (const [key, item] of map) {
|
|
2025
|
+
const at = `${path}/${key}`;
|
|
2026
|
+
switch (key) {
|
|
2027
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
2028
|
+
case "expected_revision": out.expected_revision = integer(item, at, 0n, null, false); break;
|
|
2029
|
+
case "preferences": out.preferences = d_PreferencesUpdatePreferences(item, at); break;
|
|
2030
|
+
default: unknown(at);
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
return out;
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
function d_PreferencesUpdatePreferences(value, path) {
|
|
2037
|
+
const map = object(value, path);
|
|
2038
|
+
need(map, path, ["pinned", "hidden", "viewed_done", "board_order", "theme"]);
|
|
2039
|
+
const out = {};
|
|
2040
|
+
for (const [key, item] of map) {
|
|
2041
|
+
const at = `${path}/${key}`;
|
|
2042
|
+
switch (key) {
|
|
2043
|
+
case "pinned": out.pinned = list(item, at, 640, d_PreferencesUpdatePreferencesPinnedItem); break;
|
|
2044
|
+
case "hidden": out.hidden = list(item, at, 640, d_PreferencesUpdatePreferencesHiddenItem); break;
|
|
2045
|
+
case "viewed_done": out.viewed_done = list(item, at, 640, d_PreferencesUpdatePreferencesViewedDoneItem); break;
|
|
2046
|
+
case "board_order": out.board_order = list(item, at, 640, d_PreferencesUpdatePreferencesBoardOrderItem); break;
|
|
2047
|
+
case "theme": out.theme = d_PreferencesUpdatePreferencesTheme(item, at); break;
|
|
2048
|
+
case "resume": out.resume = d_PreferencesUpdatePreferencesResume(item, at); break;
|
|
2049
|
+
default: unknown(at);
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
return out;
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
function d_PreferencesUpdatePreferencesPinnedItem(value, path) {
|
|
2056
|
+
const map = object(value, path);
|
|
2057
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
2058
|
+
const out = {};
|
|
2059
|
+
for (const [key, item] of map) {
|
|
2060
|
+
const at = `${path}/${key}`;
|
|
2061
|
+
switch (key) {
|
|
2062
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
2063
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2064
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2065
|
+
default: unknown(at);
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
return out;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
function d_PreferencesUpdatePreferencesHiddenItem(value, path) {
|
|
2072
|
+
const map = object(value, path);
|
|
2073
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
2074
|
+
const out = {};
|
|
2075
|
+
for (const [key, item] of map) {
|
|
2076
|
+
const at = `${path}/${key}`;
|
|
2077
|
+
switch (key) {
|
|
2078
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
2079
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2080
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2081
|
+
default: unknown(at);
|
|
2082
|
+
}
|
|
2083
|
+
}
|
|
2084
|
+
return out;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
function d_PreferencesUpdatePreferencesViewedDoneItem(value, path) {
|
|
2088
|
+
const map = object(value, path);
|
|
2089
|
+
need(map, path, ["lane", "done_revision"]);
|
|
2090
|
+
const out = {};
|
|
2091
|
+
for (const [key, item] of map) {
|
|
2092
|
+
const at = `${path}/${key}`;
|
|
2093
|
+
switch (key) {
|
|
2094
|
+
case "lane": out.lane = d_PreferencesUpdatePreferencesViewedDoneItemLane(item, at); break;
|
|
2095
|
+
case "done_revision": out.done_revision = integer(item, at, 0n, null, false); break;
|
|
2096
|
+
default: unknown(at);
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
return out;
|
|
2100
|
+
}
|
|
2101
|
+
|
|
2102
|
+
function d_PreferencesUpdatePreferencesViewedDoneItemLane(value, path) {
|
|
2103
|
+
const map = object(value, path);
|
|
2104
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
2105
|
+
const out = {};
|
|
2106
|
+
for (const [key, item] of map) {
|
|
2107
|
+
const at = `${path}/${key}`;
|
|
2108
|
+
switch (key) {
|
|
2109
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
2110
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2111
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2112
|
+
default: unknown(at);
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
return out;
|
|
2116
|
+
}
|
|
2117
|
+
|
|
2118
|
+
function d_PreferencesUpdatePreferencesBoardOrderItem(value, path) {
|
|
2119
|
+
const map = object(value, path);
|
|
2120
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
2121
|
+
const out = {};
|
|
2122
|
+
for (const [key, item] of map) {
|
|
2123
|
+
const at = `${path}/${key}`;
|
|
2124
|
+
switch (key) {
|
|
2125
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
2126
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2127
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2128
|
+
default: unknown(at);
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
return out;
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
function d_PreferencesUpdatePreferencesTheme(value, path) {
|
|
2135
|
+
const map = object(value, path);
|
|
2136
|
+
need(map, path, ["theme_id", "theme_revision"]);
|
|
2137
|
+
const out = {};
|
|
2138
|
+
for (const [key, item] of map) {
|
|
2139
|
+
const at = `${path}/${key}`;
|
|
2140
|
+
switch (key) {
|
|
2141
|
+
case "theme_id": out.theme_id = string(item, at, 1, 64, null, TOKEN); break;
|
|
2142
|
+
case "theme_revision": out.theme_revision = integer(item, at, 0n, null, false); break;
|
|
2143
|
+
default: unknown(at);
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
return out;
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
function d_PreferencesUpdatePreferencesResume(value, path) {
|
|
2150
|
+
const map = object(value, path);
|
|
2151
|
+
need(map, path, ["lane", "revision"]);
|
|
2152
|
+
const out = {};
|
|
2153
|
+
for (const [key, item] of map) {
|
|
2154
|
+
const at = `${path}/${key}`;
|
|
2155
|
+
switch (key) {
|
|
2156
|
+
case "lane": out.lane = d_PreferencesUpdatePreferencesResumeLane(item, at); break;
|
|
2157
|
+
case "revision": out.revision = integer(item, at, 0n, null, false); break;
|
|
2158
|
+
case "record_id": out.record_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2159
|
+
default: unknown(at);
|
|
2160
|
+
}
|
|
2161
|
+
}
|
|
2162
|
+
return out;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
function d_PreferencesUpdatePreferencesResumeLane(value, path) {
|
|
2166
|
+
const map = object(value, path);
|
|
2167
|
+
need(map, path, ["authority", "workspace_id", "lane_id"]);
|
|
2168
|
+
const out = {};
|
|
2169
|
+
for (const [key, item] of map) {
|
|
2170
|
+
const at = `${path}/${key}`;
|
|
2171
|
+
switch (key) {
|
|
2172
|
+
case "authority": out.authority = string(item, at, 1, 64, null, TOKEN); break;
|
|
2173
|
+
case "workspace_id": out.workspace_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2174
|
+
case "lane_id": out.lane_id = string(item, at, 1, 128, null, TOKEN); break;
|
|
2175
|
+
default: unknown(at);
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
return out;
|
|
2179
|
+
}
|
|
2180
|
+
|
|
2181
|
+
function d_MessageCreatePayload(value, path) {
|
|
2182
|
+
const map = object(value, path);
|
|
2183
|
+
need(map, path, ["v", "to", "text"]);
|
|
2184
|
+
const out = {};
|
|
2185
|
+
for (const [key, item] of map) {
|
|
2186
|
+
const at = `${path}/${key}`;
|
|
2187
|
+
switch (key) {
|
|
2188
|
+
case "v": out.v = constant(item, at, 1n); break;
|
|
2189
|
+
case "to": out.to = string(item, at, 1, 128, null, TOKEN); break;
|
|
2190
|
+
case "text": out.text = string(item, at, 1, 4096, 4096, TEXT); break;
|
|
2191
|
+
case "ttl_s": out.ttl_s = integer(item, at, 0n, null, false); break;
|
|
2192
|
+
default: unknown(at);
|
|
2193
|
+
}
|
|
2194
|
+
}
|
|
2195
|
+
return out;
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
// ---------------------------------------------------------------------------
|
|
2199
|
+
// Documents.
|
|
2200
|
+
// ---------------------------------------------------------------------------
|
|
2201
|
+
|
|
2202
|
+
/** Lanes 2.0 frame (RT 7) (`frame.schema.json`). @param {string | Uint8Array} input */
|
|
2203
|
+
export function decodeFrame(input) {
|
|
2204
|
+
return d_Frame(parseFrame(input), '');
|
|
2205
|
+
}
|
|
2206
|
+
|
|
2207
|
+
/** Lanes 2.0 bootstrap handshake (RT 7.1) (`hello.schema.json`). @param {string | Uint8Array} input */
|
|
2208
|
+
export function decodeHello(input) {
|
|
2209
|
+
return d_Hello(parseFrame(input), '');
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
/** Lanes 2.0 command envelope (RT 7.2) (`command.schema.json`). @param {string | Uint8Array} input */
|
|
2213
|
+
export function decodeCommand(input) {
|
|
2214
|
+
return d_Command(parseFrame(input), '');
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
/** Lanes 2.0 operation receipt (RT 7.2, 9.2) (`receipt.schema.json`). @param {string | Uint8Array} input */
|
|
2218
|
+
export function decodeReceipt(input) {
|
|
2219
|
+
return d_Receipt(parseFrame(input), '');
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
/** Lanes 2.0 subscription event (RT 7.2, 7.3) (`event.schema.json`). @param {string | Uint8Array} input */
|
|
2223
|
+
export function decodeEvent(input) {
|
|
2224
|
+
return d_Event(parseFrame(input), '');
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
/** Lanes 2.0 directory subscription (RT 7.3) (`subscribe.schema.json`). @param {string | Uint8Array} input */
|
|
2228
|
+
export function decodeSubscribe(input) {
|
|
2229
|
+
return d_Subscribe(parseFrame(input), '');
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
/** Lanes 2.0 subscription snapshot (RT 7.3) (`snapshot.schema.json`). @param {string | Uint8Array} input */
|
|
2233
|
+
export function decodeSnapshot(input) {
|
|
2234
|
+
return d_Snapshot(parseFrame(input), '');
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
/** Lanes 2.0 resynchronization (RT 7.3) (`resync.schema.json`). @param {string | Uint8Array} input */
|
|
2238
|
+
export function decodeResync(input) {
|
|
2239
|
+
return d_Resync(parseFrame(input), '');
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
/** Lanes 2.0 boundary refusal (RT 7.1, 7.2) (`frame_refusal.schema.json`). @param {string | Uint8Array} input */
|
|
2243
|
+
export function decodeFrameRefusal(input) {
|
|
2244
|
+
return d_FrameRefusal(parseFrame(input), '');
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2247
|
+
/** RuntimeBinding (TI 3, INT-01) (`runtime_binding.schema.json`). @param {string | Uint8Array} input */
|
|
2248
|
+
export function decodeRuntimeBinding(input) {
|
|
2249
|
+
return d_RuntimeBinding(parseFrame(input), '');
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
/** ExecutionBinding (TI 3, INT-04) (`execution_binding.schema.json`). @param {string | Uint8Array} input */
|
|
2253
|
+
export function decodeExecutionBinding(input) {
|
|
2254
|
+
return d_ExecutionBinding(parseFrame(input), '');
|
|
2255
|
+
}
|
|
2256
|
+
|
|
2257
|
+
/** OwnerOperationReceipt (TI 3, 6) (`owner_operation_receipt.schema.json`). @param {string | Uint8Array} input */
|
|
2258
|
+
export function decodeOwnerOperationReceipt(input) {
|
|
2259
|
+
return d_OwnerOperationReceipt(parseFrame(input), '');
|
|
2260
|
+
}
|
|
2261
|
+
|
|
2262
|
+
/** Operation anti-replay tombstone (TI 6) (`operation_tombstone.schema.json`). @param {string | Uint8Array} input */
|
|
2263
|
+
export function decodeOperationTombstone(input) {
|
|
2264
|
+
return d_OperationTombstone(parseFrame(input), '');
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
/** Owner retry horizon (TI 6, RT 6.2) (`retry_horizon.schema.json`). @param {string | Uint8Array} input */
|
|
2268
|
+
export function decodeRetryHorizon(input) {
|
|
2269
|
+
return d_RetryHorizon(parseFrame(input), '');
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
/** SourceUpdate (TI 3, INT-12) (`source_update.schema.json`). @param {string | Uint8Array} input */
|
|
2273
|
+
export function decodeSourceUpdate(input) {
|
|
2274
|
+
return d_SourceUpdate(parseFrame(input), '');
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
/** AdapterCapability (TI 3, RT 8, 9.4) (`adapter_capability.schema.json`). @param {string | Uint8Array} input */
|
|
2278
|
+
export function decodeAdapterCapability(input) {
|
|
2279
|
+
return d_AdapterCapability(parseFrame(input), '');
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
/** LaneDirectoryProjection (TI 3, INT-12, IC 5.1) (`lane_directory_projection.schema.json`). @param {string | Uint8Array} input */
|
|
2283
|
+
export function decodeLaneDirectoryProjection(input) {
|
|
2284
|
+
return d_LaneDirectoryProjection(parseFrame(input), '');
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
/** Lane directory row (TI 3, IC 5.1) (`lane_directory_row.schema.json`). @param {string | Uint8Array} input */
|
|
2288
|
+
export function decodeLaneDirectoryRow(input) {
|
|
2289
|
+
return d_LaneDirectoryRow(parseFrame(input), '');
|
|
2290
|
+
}
|
|
2291
|
+
|
|
2292
|
+
/** PrincipalPresentationPreferences (TI 3, IC 5.1) (`principal_presentation_preferences.schema.json`). @param {string | Uint8Array} input */
|
|
2293
|
+
export function decodePrincipalPresentationPreferences(input) {
|
|
2294
|
+
return d_PrincipalPresentationPreferences(parseFrame(input), '');
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
/** Revision-checked preferences update (IC 5.1) (`preferences_update.schema.json`). @param {string | Uint8Array} input */
|
|
2298
|
+
export function decodePreferencesUpdate(input) {
|
|
2299
|
+
return d_PreferencesUpdate(parseFrame(input), '');
|
|
2300
|
+
}
|
|
2301
|
+
|
|
2302
|
+
/** Message creation payload, the digest input (TI 6, INT-07) (`message_create_payload.schema.json`). @param {string | Uint8Array} input */
|
|
2303
|
+
export function decodeMessageCreatePayload(input) {
|
|
2304
|
+
return d_MessageCreatePayload(parseFrame(input), '');
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
/** Every document name (the schema file stem), in export order. */
|
|
2308
|
+
export const DOCUMENT_NAMES = Object.freeze(["frame", "hello", "command", "receipt", "event", "subscribe", "snapshot", "resync", "frame_refusal", "runtime_binding", "execution_binding", "owner_operation_receipt", "operation_tombstone", "retry_horizon", "source_update", "adapter_capability", "lane_directory_projection", "lane_directory_row", "principal_presentation_preferences", "preferences_update", "message_create_payload"]);
|
|
2309
|
+
|
|
2310
|
+
/** The decoder of every document, by name. */
|
|
2311
|
+
export const DOCUMENTS = Object.freeze({
|
|
2312
|
+
frame: decodeFrame,
|
|
2313
|
+
hello: decodeHello,
|
|
2314
|
+
command: decodeCommand,
|
|
2315
|
+
receipt: decodeReceipt,
|
|
2316
|
+
event: decodeEvent,
|
|
2317
|
+
subscribe: decodeSubscribe,
|
|
2318
|
+
snapshot: decodeSnapshot,
|
|
2319
|
+
resync: decodeResync,
|
|
2320
|
+
frame_refusal: decodeFrameRefusal,
|
|
2321
|
+
runtime_binding: decodeRuntimeBinding,
|
|
2322
|
+
execution_binding: decodeExecutionBinding,
|
|
2323
|
+
owner_operation_receipt: decodeOwnerOperationReceipt,
|
|
2324
|
+
operation_tombstone: decodeOperationTombstone,
|
|
2325
|
+
retry_horizon: decodeRetryHorizon,
|
|
2326
|
+
source_update: decodeSourceUpdate,
|
|
2327
|
+
adapter_capability: decodeAdapterCapability,
|
|
2328
|
+
lane_directory_projection: decodeLaneDirectoryProjection,
|
|
2329
|
+
lane_directory_row: decodeLaneDirectoryRow,
|
|
2330
|
+
principal_presentation_preferences: decodePrincipalPresentationPreferences,
|
|
2331
|
+
preferences_update: decodePreferencesUpdate,
|
|
2332
|
+
message_create_payload: decodeMessageCreatePayload,
|
|
2333
|
+
});
|